gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain4099e64aMerge branch 'font-segoe-ui' into mainAtlasmain/components/demo/mail-demo.hl

3.7 KB

  1. // components/demo/mail-demo.hl — `/shells/three-pane[/:id]`: SHELL 3 as a mock mail client, signed in. Phone: the message
  2. // list first, the folders are the sidebar overlay (header toggle); a message replaces the list, with its own actions and a
  3. // link back. Desktop: folders, list and message side by side.
  4. parent '../main.hl'
  5. import AppHeader from '../../theme/shell/app-header.hl'
  6. import UserMenu from '../../theme/shell/user-menu.hl'
  7. import Sidebar from '../../theme/shell/app-sidebar.hl'
  8. import ThreePane from '../../theme/shell/three-pane.hl'
  9. import { folders, mails } from '../../lib/mock.hl'
  10. id = null
  11. String view = id == null ? 'list' : 'detail'
  12. Hybrid boxes = folders
  13. Hybrid rows = listRows(id)
  14. Hybrid mail = mailOf(id)
  15. Boolean hasMail = id != null
  16. Boolean welcome = id == null
  17. String acted = ''
  18. __title = 'Three-pane demo · WorldAPI layouts'
  19. listRows(String at) {
  20. out = []
  21. for (m of mails) { out.push({ href = '/shells/three-pane/' + m.id from = m.from subject = m.subject date = m.date cls = (m.id == at ? 'selected ' : '') + m.unread aria = m.id == at ? 'page' : 'false' }) }
  22. return out
  23. }
  24. mailOf(String at) {
  25. for (m of mails) { if (m.id == at) { return m } }
  26. return { id = '' from = '' subject = '' date = '' unread = '' body = [] }
  27. }
  28. Style {
  29. mailDemo {
  30. mailFrom {
  31. display = 'flex'
  32. justifyContent = 'space-between'
  33. gap = '.5rem'
  34. fontSize = '.9rem'
  35. color = 'var(--color-text-muted)'
  36. span {
  37. firstChild {
  38. minWidth = '0'
  39. overflowWrap = 'anywhere'
  40. }
  41. lastChild {
  42. flex = '0 0 auto'
  43. whiteSpace = 'nowrap'
  44. }
  45. }
  46. }
  47. mailSubject {
  48. display = 'block'
  49. overflowWrap = 'anywhere'
  50. }
  51. aside {
  52. 'a.unread' {
  53. mailSubject {
  54. fontWeight = '700'
  55. color = 'var(--color-text-strong)'
  56. }
  57. }
  58. }
  59. appSidebar {
  60. nav {
  61. a {
  62. display = 'flex'
  63. justifyContent = 'space-between'
  64. span { color = 'var(--color-text-muted)' }
  65. }
  66. }
  67. }
  68. output {
  69. display = 'block'
  70. marginBottom = '1rem'
  71. color = 'var(--color-success)'
  72. }
  73. }
  74. }
  75. View {
  76. mailDemo { on click(e) { emit mailAction(e) }
  77. AppHeader { brand = "Mail (demo)" brandHref = "/shells/three-pane" search = "/search" searchPlaceholder = "Search mail…"
  78. UserMenu { name = "Signed in as az5b2 (mock)"
  79. a { href = "/shells" "Settings" }
  80. a { href = "/shells" "Logout" }
  81. }
  82. }
  83. ThreePane { view = view
  84. Sidebar {
  85. nav { 'aria-label' = "Folders"
  86. h2 { "Folders" }
  87. for (f of boxes) { a { href = "/shells/three-pane" f.label span { f.count } } }
  88. }
  89. nav { 'aria-label' = "Showcase"
  90. h2 { "Showcase" }
  91. a { class = "back" href = "/shells" "‹ Shells" }
  92. }
  93. }
  94. aside { 'aria-label' = "Inbox"
  95. ul { for (r of rows) { li { a { href = r.href class = r.cls 'aria-current' = r.aria mailFrom { span { r.from } span { r.date } } mailSubject { r.subject } } } } }
  96. }
  97. main {
  98. if (welcome) {
  99. h1 { "Inbox" }
  100. p { class = "muted" "Pick a message. (A phone never shows this text: it opens on the list.)" }
  101. }
  102. if (hasMail) {
  103. a { class = "back" href = "/shells/three-pane" "Inbox" }
  104. menu { 'aria-label' = "Message actions"
  105. li { button { type = "button" value = "Replied" "Reply" } }
  106. li { button { type = "button" value = "Forwarded" "Forward" } }
  107. li { button { type = "button" value = "Archived" "Archive" } }
  108. li { button { type = "button" class = "danger" value = "Deleted" "Delete" } }
  109. }
  110. output { acted }
  111. h1 { mail.subject }
  112. p { class = "muted" mail.from " · " mail.date }
  113. article { for (t of mail.body) { p { t } } }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. // the actions are mock: they only say what they would have done
  120. on mailAction(e) {
  121. b = e.target.closest('menu button')
  122. if (b != null) { acted = b.value + ' (mock — nothing happened)' }
  123. }

Branches

Latest commits

  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre