gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0dce28990dce2899reports/K1-bubble.mdmre0dce2899/project.hl

7.6 KB

  1. // project.hl — components.hybriel.worldapi.org: THE SITE. Hybriel components developed standalone: the home
  2. // lists them, each has a demo page (`/<component>`) and its README (`/<component>/README.md`). No login, no data.
  3. // Apps vendor a component by copying its folder (README of the component says which files).
  4. // THE MAP — which file handles what:
  5. // components/main.hl the shell: header, offline note, the slot every page renders into
  6. // components/index.hl `/`: the list of components (a new component adds one entry there)
  7. // components/styles.hl the site's own CSS (/__hl/app.css); every component carries its own Style
  8. // components/<name>/<name>.hl a component (the public file apps copy; layouts.worldapi.org themes it)
  9. // components/<name>/demo.hl its demo page `/<name>`; README.md is served at `/<name>/README.md`
  10. // components/files-upload/demo-pick.hl `/files-upload/pick`: the several-files upload in pick mode (a chat input, ticket #18)
  11. // lib/comments.hl the comments demo's mock thread and what the page does with a post / edit / delete / like
  12. // lib/uploads.hl where the demos keep uploaded files (file upload, several files, Markdown editor), one day
  13. // shared/base.hl THE BASE LOOK: black, white, four greys (#15) — the site's colours and every component's fallbacks
  14. // shared/tokens.hl the WorldAPI colour tokens (verbatim copy; not used by the site since #15 — the theme's business)
  15. import WebFramework from 'hl:web'
  16. import { env } from 'hl:proc'
  17. import { black, white } from './shared/base.hl'
  18. import Styles from './components/styles.hl'
  19. import Index from './components/index.hl'
  20. import MonthViewDemo from './components/month-view/demo.hl'
  21. import DatePickerDemo from './components/date-picker/demo.hl'
  22. import RangePickerDemo from './components/range-picker/demo.hl'
  23. import PaginationDemo from './components/pagination/demo.hl'
  24. import MdEditorDemo from './components/md-editor/demo.hl'
  25. import CodeEditorDemo from './components/code-editor/demo.hl'
  26. import FileUploadDemo from './components/file-upload/demo.hl'
  27. import FilesUploadDemo from './components/files-upload/demo.hl'
  28. import FilesPickDemo from './components/files-upload/demo-pick.hl'
  29. import ModalDemo from './components/modal/demo.hl'
  30. import CommentsDemo from './components/comments/demo.hl'
  31. static siteName = "Hybriel components"
  32. appTitle = siteName
  33. // ---- THE INSTALLABLE APP (mission 046), the same way calendar.worldapi.org / tracker.worldapi.org do it: hl:web's own
  34. // web app manifest (/__hl/manifest.webmanifest, linked from every head with the apple-touch-icon and theme-color) and
  35. // service worker (/__hl/sw.js) from these settings — no JavaScript of ours. Icons in icons/ (icon.svg is the source,
  36. // the PNGs are rendered from it with rsvg-convert, README "PWA"). The theme colour is the header's background
  37. // (black), the splash background the page's (white) — both off shared/base.hl, not written out again.
  38. appShortName = 'Components' // the name under the home-screen icon (the full one is too long there)
  39. appThemeColor = black.value
  40. appBackgroundColor = white.value
  41. appIcons = [
  42. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'any' }
  43. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'any' }
  44. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'maskable' }
  45. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'maskable' }
  46. ]
  47. appTouchIcon = '/icons/apple-touch-icon.png'
  48. appFavicon = '/icons/favicon.svg'
  49. // OFFLINE: only the shell — the header and the home list `/` (components/main.hl says "You are offline" while the
  50. // browser has no network). The demo pages are not kept: without a network they get hl:web's "Unavailable offline" page.
  51. offline = [ Index ]
  52. styles = Styles
  53. // the component's README is plain Markdown, served as it is
  54. routes = [
  55. { pattern = "/favicon.ico" file = "./icons/favicon.ico" headers = { 'Cache-Control' = 'no-cache' } }
  56. // the installable app (mission 046): the icons (manifest and service worker are hl:web's own, from appIcons / offline)
  57. { pattern = "/icons/icon-192.png" file = "./icons/icon-192.png" headers = { 'Cache-Control' = 'no-cache' } }
  58. { pattern = "/icons/icon-512.png" file = "./icons/icon-512.png" headers = { 'Cache-Control' = 'no-cache' } }
  59. { pattern = "/icons/apple-touch-icon.png" file = "./icons/apple-touch-icon.png" headers = { 'Cache-Control' = 'no-cache' } }
  60. { pattern = "/icons/favicon.svg" file = "./icons/favicon.svg" headers = { 'Cache-Control' = 'no-cache' } }
  61. { pattern = "/" component = Index }
  62. { pattern = "/month-view" component = MonthViewDemo }
  63. { pattern = "/month-view/README.md" file = "./components/month-view/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  64. { pattern = "/date-picker" component = DatePickerDemo }
  65. { pattern = "/date-picker/README.md" file = "./components/date-picker/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  66. { pattern = "/range-picker" component = RangePickerDemo }
  67. { pattern = "/range-picker/README.md" file = "./components/range-picker/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  68. { pattern = "/md-editor" component = MdEditorDemo }
  69. { pattern = "/md-editor/README.md" file = "./components/md-editor/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  70. { pattern = "/md-editor/files/*" directory = "./storage/md-files" headers = { 'X-Content-Type-Options' = 'nosniff' 'Content-Security-Policy' = "sandbox" } }
  71. { pattern = "/code-editor" component = CodeEditorDemo }
  72. { pattern = "/code-editor/README.md" file = "./components/code-editor/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  73. { pattern = "/file-upload" component = FileUploadDemo }
  74. { pattern = "/file-upload/README.md" file = "./components/file-upload/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  75. { pattern = "/files-upload" component = FilesUploadDemo }
  76. { pattern = "/files-upload/pick" component = FilesPickDemo }
  77. { pattern = "/files-upload/README.md" file = "./components/files-upload/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  78. { pattern = "/modal" component = ModalDemo }
  79. { pattern = "/modal/README.md" file = "./components/modal/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  80. { pattern = "/comments" component = CommentsDemo }
  81. { pattern = "/comments/README.md" file = "./components/comments/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  82. { pattern = "/pagination" component = PaginationDemo }
  83. { pattern = "/pagination/README.md" file = "./components/pagination/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  84. ]
  85. sessionDir = env('COMPONENTS_SESSIONS') != null ? env('COMPONENTS_SESSIONS') : null
  86. port = env('COMPONENTS_PORT') != null ? toNumber(env('COMPONENTS_PORT')) : 8380
  87. // HL_HOST = the interface hl:web binds: 127.0.0.1 on Byrodin behind nginx; unset = 0.0.0.0 (dev on Loreana).
  88. // COMPONENTS_WATCH=0 = no dev watcher.
  89. watching = env('COMPONENTS_WATCH') != '0'
  90. sessionCookie = 'componentssid'
  91. server = new WebFramework(routes = routes, styles = styles, minify = true, port = port, watchMode = watching, sessionCookie = sessionCookie, uploadMax = 5242880)
  92. on Error(e) { console.log('error absorbed: ' + e.message) }

Branches

Latest commits

  • 0dce2899reports/K1-bubble.mdmre
  • 6b0936a0comments: 'edited' foldable also drops the theme's border, margin and radius (display: contents alone left them computed)mre
  • 8d79ff79comments bubble hugs its content: a readonly md-editor surface gets no inline min-height (it beat the stylesheet's min-height 0); 'edited' is a quiet label beside the time, versions unframed; gate checksmre
  • ef253fecreports/F4-icons.mdmre
  • ba96735ficons: README, md-editor README note, gate checks for the single focus ring and toolbar iconsmre
  • 96c97691icons: shared Icon component; md-editor toolbar and files-upload remove use it; no inner focus ring in md-editormre
  • 0d6863d6reports/F3-mdvalue.mdmre
  • d58ed98bMdEditor: an older text of the editor handed back is not an outside change (kept surface, written back); gate for itmre
  • c2d0de59MdEditor: show a value that changes from outside (data-value observer), demo button and gatemre
  • c4272fa3re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • 2e22618etests: cdp-blank/md-bg/md-keys-run Chrome range and base port from env (MDK_CHROME, MDK_PORT), defaults unchangedmre
  • a5d2384bre-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • 52902d23docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
  • 022b943fdeploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • d17f8543mission 012: re-vendor Hybriel master f9614007 (plugins), fixes comments push redraw; gate 480/0mre
  • 5f95de05mission 012: re-vendor Hybriel ce6f2e0a (plugins), report: gate 478/2 on comments push redrawmre
  • 3794c591mission 011: report, LOG, STATUS, md-keys-run widths, cdp-blank helpermre
  • 77a93c16mission 011: gate hook for md-keys (480/0), flatten() runs one at a time (removeChild race), surface also built on first focus / pointer-down (background tab), md-bg test, README keysmre
  • 3c906718mission 011: md-editor key tests (real keys) and fixes: nested p/ul flatten, bare br, link change, Ctrl+E, code block exit (WIP)mre
  • 1442e583mission 010: report, LOG, STATUSmre