components
All repositories: gitoria
8.5 KB
// project.hl — components.hybriel.worldapi.org: THE SITE. Hybriel components developed standalone: the home// lists them, each has a demo page (`/<component>`) and its README (`/<component>/README.md`). No login, no data.// Apps vendor a component by copying its folder (README of the component says which files).// THE MAP — which file handles what:// components/main.hl the shell: header, offline note, the slot every page renders into// components/index.hl `/`: the list of components (a new component adds one entry there)// components/styles.hl the site's own CSS (/__hl/app.css); every component carries its own Style// components/<name>/<name>.hl a component (the public file apps copy; layouts.worldapi.org themes it)// components/<name>/demo.hl its demo page `/<name>`; README.md is served at `/<name>/README.md`// components/files-upload/demo-pick.hl `/files-upload/pick`: the several-files upload in pick mode (a chat input, ticket #18)// components/media-player/ the media player (audio + video, phone first) and its demo `/<name>`; the demo's media files in storage/media// lib/comments.hl the comments demo's mock thread and what the page does with a post / edit / delete / like// lib/uploads.hl where the demos keep uploaded files (file upload, several files, Markdown editor), one day// lib/media.hl the media player demo's own files: storage/media served with ranges (a media element seeks)// shared/base.hl THE BASE LOOK: black, white, four greys (#15) — the site's colours and every component's fallbacks// shared/tokens.hl the WorldAPI colour tokens (verbatim copy; not used by the site since #15 — the theme's business)import WebFramework from 'hl:web'import { env, exit } from 'hl:proc'import { serve as serveMedia } from './lib/media.hl'import { black, white } from './shared/base.hl'import Styles from './components/styles.hl'import Index from './components/index.hl'import MonthViewDemo from './components/month-view/demo.hl'import DatePickerDemo from './components/date-picker/demo.hl'import RangePickerDemo from './components/range-picker/demo.hl'import PaginationDemo from './components/pagination/demo.hl'import MdEditorDemo from './components/md-editor/demo.hl'import CodeEditorDemo from './components/code-editor/demo.hl'import FileUploadDemo from './components/file-upload/demo.hl'import FilesUploadDemo from './components/files-upload/demo.hl'import FilesPickDemo from './components/files-upload/demo-pick.hl'import ModalDemo from './components/modal/demo.hl'import CommentsDemo from './components/comments/demo.hl'import MediaPlayerDemo from './components/media-player/demo.hl'import MediaPlayerAudioDemo from './components/media-player/demo-audio.hl'static siteName = "Hybriel components"appTitle = siteName// ---- THE INSTALLABLE APP (mission 046), the same way calendar.worldapi.org / tracker.worldapi.org do it: hl:web's own// web app manifest (/__hl/manifest.webmanifest, linked from every head with the apple-touch-icon and theme-color) and// service worker (/__hl/sw.js) from these settings — no JavaScript of ours. Icons in icons/ (icon.svg is the source,// the PNGs are rendered from it with rsvg-convert, README "PWA"). The theme colour is the header's background// (black), the splash background the page's (white) — both off shared/base.hl, not written out again.appShortName = 'Components' // the name under the home-screen icon (the full one is too long there)appThemeColor = black.valueappBackgroundColor = white.valueappIcons = [{ src = '/icons/icon-192.png' sizes = '192x192' purpose = 'any' }{ src = '/icons/icon-512.png' sizes = '512x512' purpose = 'any' }{ src = '/icons/icon-192.png' sizes = '192x192' purpose = 'maskable' }{ src = '/icons/icon-512.png' sizes = '512x512' purpose = 'maskable' }]appTouchIcon = '/icons/apple-touch-icon.png'appFavicon = '/icons/favicon.svg'// OFFLINE: only the shell — the header and the home list `/` (components/main.hl says "You are offline" while the// browser has no network). The demo pages are not kept: without a network they get hl:web's "Unavailable offline" page.offline = [ Index ]styles = Styles// the component's README is plain Markdown, served as it isroutes = [{ pattern = "/favicon.ico" file = "./icons/favicon.ico" headers = { 'Cache-Control' = 'no-cache' } }// the installable app (mission 046): the icons (manifest and service worker are hl:web's own, from appIcons / offline){ pattern = "/icons/icon-192.png" file = "./icons/icon-192.png" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/icons/icon-512.png" file = "./icons/icon-512.png" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/icons/apple-touch-icon.png" file = "./icons/apple-touch-icon.png" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/icons/favicon.svg" file = "./icons/favicon.svg" headers = { 'Cache-Control' = 'no-cache' } }{ pattern = "/" component = Index }{ pattern = "/month-view" component = MonthViewDemo }{ pattern = "/month-view/README.md" file = "./components/month-view/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/date-picker" component = DatePickerDemo }{ pattern = "/date-picker/README.md" file = "./components/date-picker/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/range-picker" component = RangePickerDemo }{ pattern = "/range-picker/README.md" file = "./components/range-picker/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/md-editor" component = MdEditorDemo }{ pattern = "/md-editor/README.md" file = "./components/md-editor/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/md-editor/files/*" directory = "./storage/md-files" headers = { 'X-Content-Type-Options' = 'nosniff' 'Content-Security-Policy' = "sandbox" } }{ pattern = "/code-editor" component = CodeEditorDemo }{ pattern = "/code-editor/README.md" file = "./components/code-editor/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/file-upload" component = FileUploadDemo }{ pattern = "/file-upload/README.md" file = "./components/file-upload/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/files-upload" component = FilesUploadDemo }{ pattern = "/files-upload/pick" component = FilesPickDemo }{ pattern = "/files-upload/README.md" file = "./components/files-upload/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/modal" component = ModalDemo }{ pattern = "/modal/README.md" file = "./components/modal/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/comments" component = CommentsDemo }{ pattern = "/comments/README.md" file = "./components/comments/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/media-player" component = MediaPlayerDemo }{ pattern = "/media-player/audio" component = MediaPlayerAudioDemo }{ pattern = "/media-player/README.md" file = "./components/media-player/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ pattern = "/media/*" function = (route, req) => { return serveMedia(req) } }{ pattern = "/pagination" component = PaginationDemo }{ pattern = "/pagination/README.md" file = "./components/pagination/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }]sessionDir = env('COMPONENTS_SESSIONS') != null ? env('COMPONENTS_SESSIONS') : nullport = env('COMPONENTS_PORT') != null ? toNumber(env('COMPONENTS_PORT')) : 8380// HL_HOST = the interface hl:web binds: 127.0.0.1 on Byrodin behind nginx; unset = 0.0.0.0 (dev on Loreana).// COMPONENTS_WATCH=0 = no dev watcher.watching = env('COMPONENTS_WATCH') != '0'sessionCookie = 'componentssid'server = new WebFramework(routes = routes, styles = styles, minify = true, port = port, watchMode = watching, sessionCookie = sessionCookie, uploadMax = 5242880, sessionMaxAge = 3122064000)on Error(e) {if (e.phase == 'startup') { exit(1) }console.log('error absorbed: ' + e.message)}
Branches
- b27b
- mainmain branch
- vl27-resetkey
Latest commits
- 3d43c187ident-access: server-side check of an ident access key (Bearer or Basic password), asks ident on every call, README, gate tests/ident-access.mjs (ident#27 app side)mre
- 59704ce1Merge branch 'n5b-pipes'mre
- 23b9164aMdEditor: a clipboard whose text is only the names or file:// paths of its files (a file manager copy) is about the files, as before; any other text wins (tickets#49); gate casesmre
- b0f1ec28MdEditor: a clipboard with text always pastes the text, also when a picture is on it too (a spreadsheet or office app), files on or off; a picture alone still goes to the files; real Ctrl+V gate tests/md-paste-files.mjs (tickets#49)mre
- ad4e929bMdEditor: pipe rows without a delimiter row are a table (first row = header, short rows padded, written back without an invented | --- | line) (notes#5)mre
- 4bd11128MdEditor: the Table button's empty table is written as a real pipe table (empty cells), so it survives the source switch, a save and a reload (notes#7)mre
- 7437e32bMdEditor draws its surface at once when claimed from server HTML: 1 ms mount animation, the first editor mounts all editors of the pagemre
- 5de0264cRe-vendor onto Hybriel master acaceaf3 (set-day27b): binary, lib and plugins; exit 1 on a startup fault; .gitignore binmre
- 79c77e7dMerge sb3-standby: components deploys through its standbymre
- c5442043components: no jobs switch needed in the standbymre
- 8d2fb24ccomponents: a standby container (port 45016, profile standby); deploy hands over through standby-swap.sh without a gapmre
- c2834dd3Merge mr-fixes: media player state after a queue pick, Range handling, cover-less audio, accessibility labelsmre
- 354fe3c6Media player: audio without a cover starts and shows its time (the mount tick sits on the seek bar, which every item has); the speed button names the current speed, the seek slider says its time in words; a gate page for the first render on cover-less audio and a fourth demo queue item without a covermre
- ee4aee1eMedia player: a new queue item shows its own speed, mute, play state and time and starts when asked, also for two videos in a row; the media route reads suffix ranges and ignores range lists and garbage instead of answering 500; stronger gate checks (the 10 percent drag, the played bar, the queue tap)mre
- 9a4f9b31Merge mp-player: media served from the committed filesmre
- 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
- b2980734Merge mp-player: the media player (components/media-player), its demo and the media iconsmre
- 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