gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitab96e686ab96e686Media route: serve the demo's media from the committed files in components/media-player (storage/ is not in git, the deploy gate found no files)mreab96e686/project.hl

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

Branches

Latest commits

  • ab96e686Media route: serve the demo's media from the committed files in components/media-player (storage/ is not in git, the deploy gate found no files)mre
  • 1c41293eMediaPlayer: back / forward 10 s as replay / forward 10 icons (circular arrow with a 10), the play button keeps its surface background on audio and video, the media route's range end is a letmre
  • 9e1ab228MP: report, LOG line, STATUS entrymre
  • dd003e5dMediaPlayer: audio and video in one phone-first player (components/media-player), its demo /media-player with a queue, the media icons in components/icons, the demo's media files served with ranges (lib/media.hl), 35 gate checksmre
  • e54f83adMdEditor: text typed before the editor is built is kept (the build takes it in once, the input handler no longer writes it to the field first), tickets#35mre
  • 8c920932gate: the 11 old drop-zone checks now test the one-box pick mode (drop anywhere in the box, Choose files button inside it, no drop zone)mre
  • 626de199MdEditor: copy and cut put the selection's Markdown on the clipboard, a clipboard with HTML only pastes its text, gate checks for copy, cut and paste (components#20)mre
  • 5228126dUX: components synced from the tickets/layouts UX mission (comments: State select in the footer and button words; files-upload: one-box pick mode; modal: footer rule for its own footer). WIP: the gate's #18 pick-mode checks still expect the old drop zone (11 fail), see the UX2 reportmre
  • 0a9216fbMdEditor: a Table button in the toolbar, a typed pipe row fills the cells, tables take the page theme's look; gate checks updated for 12 toolbar buttonsmre
  • f9d405c8comments: reactions row half as far from its comment (creator 2026-10-24: 'half this distance please'); the 44 px tap targets staymre
  • 4922f9cfsessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 0355975areports/MC-mobile.md, LOG, STATUS (MC)mre
  • 3f0a7229Month view, date picker, range picker: names follow the page language (English by default, not the browser's), weekday/month names formatted in UTC (a UTC+12 zone showed Tue first), 44 px day cells and buttons, Send row air; gate checks at 390 px for every page, popup and dialog (MC)mre
  • 29eb07eaPhone: 44 px targets on the site (brand, home links, buttons), comments, modal and pagination; the header is the brand alone on a phone; comments demo: labelled 'You are' group with the chosen user pressed (MC)mre
  • d1cc83e2reports/E2-toolbar.mdmre
  • 214c3183MdEditor on a phone: toolbar as two even rows of 44 px targets (no clipped icon, no swipe), 'Markdown source' label 15 px, table head 16 px; gate checks (E2)mre
  • 9215bbaareports/F5-empty.mdmre
  • 134b4e3eMdEditor: an editor the framework puts into the page is built at once (page observer), a surface put in anew under a built editor is redrawn; gates for both (hybriel#211)mre
  • 0dce2899reports/K1-bubble.mdmre
  • 6b0936a0comments: 'edited' foldable also drops the theme's border, margin and radius (display: contents alone left them computed)mre