gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit9197159f9197159fTake components e54f83a: table lines and one-row desktop toolbar in the theme, Table button gates, a table in the md-editor demomre9197159f/components/showcase/files-upload-pick.hl

2.5 KB

  1. // components/showcase/files-upload-pick.hl — `/components/files-upload-pick`: the upload component in PICK mode (components ticket #18):
  2. // dropped, chosen, pasted (Ctrl+V) or photographed files are only collected, as thumbnails and rows; ✕ takes one away. It is ONE box: the
  3. // text field, the files right under it, and the footer: the small "Choose files" button at the left, Send at the right end. THE PAGE OWNS THE
  4. // LIST: it binds `files = attached`, hears every change through `onChange`, and at Send shows the message and empties the list. The
  5. // showcase sends nothing anywhere (the files stay in the browser). One FilesUpload per page, so this is a page of its own.
  6. parent '../main.hl'
  7. import SiteHeader from '../site-header.hl'
  8. import SiteSidebar from '../site-sidebar.hl'
  9. import ContentFirst from '../../theme/shell/content-first.hl'
  10. import TheFilesUpload from '../files-upload/files-upload.hl'
  11. import { namesOf } from '../../lib/pick.hl'
  12. __title = 'File upload, pick first · WorldAPI layouts'
  13. Hybrid attached = []
  14. Hybrid sent = []
  15. String state = ''
  16. picked = (list) => { attached = list }
  17. View {
  18. showFilesUploadPick {
  19. SiteHeader { current = "/components/files-upload-pick" }
  20. ContentFirst {
  21. SiteSidebar { current = "/components/files-upload-pick" }
  22. main {
  23. h1 { "File upload, pick first" }
  24. p { class = "muted" "A chat input in one box: type, and drop, paste (Ctrl+V), choose or photograph files — they wait under the text as thumbnails and rows, ✕ takes one away. Nothing is sent until Send (and here nothing leaves the browser). Up to 2 MB per file." }
  25. ol { id = "sent" for (m of sent) { li { p { class = "sent-text" m.text } p { class = "sent-files" m.files } } } }
  26. TheFilesUpload { mode = "pick" files = attached onChange = picked maxSize = 2097152
  27. form { id = "chat-form" on submit(e) { emit chatSend(e) }
  28. textarea { id = "chat-text" name = "text" rows = "2" placeholder = "Write a message…" 'aria-label' = "Message" }
  29. button { type = "submit" id = "chat-send" "Send" }
  30. }
  31. }
  32. p { class = "muted" output { id = "chat-state" state } }
  33. p { class = "readme links" a { href = "/read/readme-files-upload" "README of the component (how an app uses it)" } }
  34. }
  35. }
  36. }
  37. }
  38. on chatSend(e) {
  39. e.preventDefault()
  40. form = e.target
  41. text = form.querySelector('textarea').value
  42. if (text.trim() == '' && attached.length == 0) { return null }
  43. sent.push({ text = text files = attached.length + ' files: ' + namesOf(attached) })
  44. attached = []
  45. form.reset()
  46. state = 'Sent'
  47. }

Branches

Latest commits

  • 9197159fTake components e54f83a: table lines and one-row desktop toolbar in the theme, Table button gates, a table in the md-editor demomre
  • e6322a44UX: report and LOG linemre
  • 58c2da6fUX: nav marker without bars; chat composer is one box (files-upload pick mode, showcase); comments state footer + closer reactions row; modal footer rule only for its own footer; gates for all of itmre
  • 956f107async components.hybriel 4922f9c: 44 px targets in month-view, date-picker, range-picker, pagination, modal, comments; names follow <html lang> (English default), UTC weekday fix; gate: 390 px target checks, 'edited' hit-area padding; comments showcase 'You are' is a labelled group (SY)mre
  • 49940371sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 6f7bd392gate: the phone toolbar is two even rows (E2)mre
  • 3049c082sync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
  • b9a3f85fLOG: MLmre
  • 7979397creport ML-mobilemre
  • 85d2ed25gate: wordingmre
  • 98a311c0gate: 390 px checks for list rows, table word, edited tap target, code in titlesmre
  • 769b99d7theme: table cells keep a word whole, code in a title stays text-sized, 'edited' is a 44 px tap target on the phonemre
  • c36b7595list rows (notes, mail) stack their parts full width: the date no longer a one-letter column beside the titlemre
  • 02aa74aasync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
  • 268b1c87sync components.hybriel 6b0936a: the 'edited' foldable drops the theme's border and marginmre
  • c51d039fsync components.hybriel 8d79ff7: bubble hugs its content, quiet 'edited' label; gate checksmre
  • f4ad7eecsync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
  • db258c11sync-components: copy icons/icons.hl + README (F4); testsmre
  • badc1879md-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
  • 867a8375md-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre