components
All repositories: gitoria
2.8 KB
// demo.hl — `/md-editor`: three editors on one page (the second starts empty and shows its placeholder, the third holds a table), and the Markdown each holds// shown below. The editor announces a change with a bubbling DOM `input` event on its hidden field: `e.target.value` is the Markdown.parent '../main.hl'import MdEditor from './md-editor.hl'import { storeMdFiles } from '../../lib/uploads.hl'__title = 'Markdown editor · Hybriel components'static NL = ""String note = '# Hello' + NL + NL + 'Some **bold** and *italic* text with `code` and a [link](https://example.com).' + NL + NL + '- first' + NL + '- second'String summary = ''Number outsideN = 0// a GitHub pipe table (mission 004): alignment, an escaped pipe, bold and code in cells, a long row that scrolls on a phoneString plan = '## Shopping' + NL + NL + '| Item | Qty | Note \| x |' + NL + '|:-----|:---:|---:|' + NL + '| **milk** | `2` | fresh |' + NL + '| bread | 1 | wholegrainsourdoughwithseedsfromthebakeryaroundthecorner |' + NL + NL + 'Tab moves to the next cell, Enter adds a row.'View {mdEditorDemo {h1 { "Markdown editor" }p { class = "muted" "Edit it visually: headings look like headings, bold is bold, lists are lists. The value below each editor is plain Markdown; paste Markdown in and it shows formatted." }// a value that arrives from outside after the editor is built (a kept state, a push from another device): the editor shows itp { button { id = "md-outside" type = "button" "Set the second editor from outside" on click(e) { outsideN = outsideN + 1 summary = '# Outside ' + outsideN + NL + NL + 'set by **the page**' } }button { id = "md-stale" type = "button" "Hand the second editor its first text back" on click(e) { summary = '' } } }form { id = "md-form" method = "get" action = "/md-editor" on input(e) { emit demoValue(e) }MdEditor { name = "note" value = note }h2 { "Value of “note”" }pre { id = "md-value" note }MdEditor { name = "summary" value = summary placeholder = "A second editor, empty: type here…" }h2 { "Value of “summary”" }pre { id = "md-value-summary" summary }MdEditor { name = "plan" value = plan }h2 { "Value of “plan”" }pre { id = "md-value-plan" plan }p { button { type = "submit" "Send (posts both as Markdown)" } }}p { a { id = "readme" href = "/md-editor/README.md" "README (how to use it)" } }}}on demoValue(e) {if (e.target.name == 'note') { note = e.target.value }if (e.target.name == 'summary') { summary = e.target.value }if (e.target.name == 'plan') { plan = e.target.value }}// WHERE THE FILES GO IS THE APP'S DECISION: the editor sends dropped / pasted / chosen files here (`emit server mdUpload`), this site// keeps them for one day and answers the address of each file, in order (lib/uploads.hl storeMdFiles).on server mdUpload(files) { return storeMdFiles(files) }
Branches
Latest commits
- b7e11e3bvirtual-list: the first resetKey is the baseline, so centerId and scrollTop keep their place at mount; gate for itAtlas
- 7e428ba6Re-vendor Hybriel day72 (day73 withdrawn: minifier breaks write sets)Atlas
- a06fc778Reset virtual-list window when the host changes resetKeyAtlas
- 3aab598cRe-vendor complete Hybriel day73 set for virtual-list resetAtlas
- 337ca075MD1 gate check measures frames in the page, not milliseconds from outside, and takes the middle load (components#30)mre
- f5f131c5Record AP29 autoplay comparisons and passing gatesmre
- 51c38187Gate media autoplay on first load and after client mountmre
- a3f2223dRecord successful B44 deployment and live proofmre
- 06c1e021Record passing B44 browser rerunmre
- c9861533Record B44 component proof and browser gate blockermre
- 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