components
All repositories: gitoria
9.3 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/icons/ shared inline icons and the `/icons` family comparison demo// components/media-player/ the media player (audio + video, phone first) and its demo `/<name>`; the demo's media files in storage/media// components/virtual-list/ the virtual list (a very long list, only the rows near the viewport exist) and its demo `/virtual-list`// 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'import IconsDemo from './components/icons/demo.hl'import VirtualListDemo from './components/virtual-list/demo.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 = "/icons" component = IconsDemo }{ pattern = "/icons/README.md" file = "./components/icons/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' } }{ 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 = "/virtual-list" component = VirtualListDemo }{ pattern = "/virtual-list/README.md" file = "./components/virtual-list/README.md" headers = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' } }{ 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') { console.log('components: startup error: ' + e.message) exit(1) }console.log('error absorbed: ' + e.message)}
Branches
- b27b
- mainmain branch
- vl27-resetkey
Latest commits
- 1b7413beIgnore detached media events and space demo option outputsmre
- ca3b4959Re-vendor complete Hybriel plugins and runtime to day44mre
- df9e7df9Last-item checks run in the browser gate (components#26 fixed on day41); media-player loop is a plain Booleanmre
- 895a5afcRe-vendor complete Hybriel plugins and runtime to day41mre
- 16006bb3Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
- 88397fc3Re-vendor complete Hybriel plugins and runtime to day39mre
- 9b872cedRecord IC28 deployment and live icon verificationmre
- 46fefaa7Count the icons entry in the offline home-page checkmre
- c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
- 5e090ffdRecord IC28 review evidence and gate resultsmre
- adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
- c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre
- bd4aa808Record VL24 deployment and live verificationmre
- e5b98ecfRun virtual-list gate before deploymentmre
- 2e9b4a8evirtual-list: into main, with centerId and scrollTop/onScroll (jukebox#20)mre
- 69954249Align all plugin sources with Hybriel day38bmre
- f740f666Re-vendor components to Hybriel set day38bmre
- 8176eb14Record CS23b deployment and live verificationmre
- 84e3ddaaRemove blank line before pagination Style closing bracemre
- a92298ddRecord exact CSS and same-date proof after specificity reviewmre