gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2b480a642b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas2b480a64/components/comments/comments.hl

22.7 KB

  1. // comments.hl — THE COMMENTS BLOCK (layouts#2; shape of hybriel's demo-social-network), pure Hybriel: "1 comment" / "n comments",
  2. // then every comment — an avatar (the initial), a bubble with the name, the time, "edited" (the earlier versions fold out) and the
  3. // text as formatted Markdown; under it a like (♥ and the count) and, for the comment's author, Edit / Delete — and the form below,
  4. // typed in the Markdown editor (components/md-editor). `Comments { comments = list user = me onPost = posted onEdit = edited
  5. // onDelete = deleted onLike = liked }`.
  6. // GENERIC: no app data, no storage. The host passes the comments (a list of records, below) and the current user's name, and
  7. // hands four functions (hybriel#87: a child talks upward by calling a function its host gives it); the host decides what is
  8. // stored and gives a new list back — the block shows what it is given. A comment record:
  9. // { id, author, when, text (Markdown), likes (a number), liked (true when `user` likes it), history ([{ when, text }], the
  10. // earlier versions, oldest first; empty = never edited) }
  11. // Edit / Delete show where `author == user`; with `user` empty there is no form and the like does nothing.
  12. // The text is drawn by MdEditor's own renderer (`readonly = "true"`). The editor builds its content in the browser once per element;
  13. // hl:web builds a composed child anew when a value bound into it changes, so a changed text (an edit here, or a new list from a push)
  14. // is drawn anew, and the rows are keyed by `id`, so a deleted comment takes its own editor with it.
  15. // The per-comment state (which one is being edited / asked to be deleted) is one member each: one block per page (a composed
  16. // component's members are the page's state).
  17. // ATTACHMENTS (mission 009, tickets#27): a comment record may carry `files` ([{ name, url, image (true = a picture), size (bytes) }]):
  18. // pictures show as thumbnails that open the full picture, any other file as a row (kind, name, size); a file without `url` (the
  19. // viewer may not fetch it) shows as a row without a link. `attach = "true"` puts the form inside the shared FilesUpload in pick mode
  20. // (components/files-upload/): files dropped, chosen, photographed or pasted (Ctrl+V, also into the editor: its files = "off") wait
  21. // as thumbnails / rows under the editor, and the host hears them with the text: `onPost(text, files)` (browser Files — the host sends
  22. // them with its own face; the framework uploads them first). Without `attach` nothing changes: `onPost(text)`.
  23. // A STATE CHANGE IN THE FORM'S FOOTER (tickets UX mission): `states = [{ value, label }]` (the host's choices, the current one left out) puts
  24. // `State [select]` in front of the post button, right side of the form's footer; the select starts on "no change". The button says what
  25. // happens: "Comment" (text or files, no state), "Set to <state>" (a state and nothing to say), "Comment and set to <state>" (both). The
  26. // host hears `onPost(text, files, state)` (state '' = unchanged; the third argument only comes when `states` is not empty).
  27. import MdEditor from '../md-editor/md-editor.hl'
  28. import FilesUpload from '../files-upload/files-upload.hl'
  29. Hybrid comments = []
  30. String user = ''
  31. onPost = null
  32. onEdit = null
  33. onDelete = null
  34. onLike = null
  35. String oneLabel = 'comment'
  36. String manyLabel = 'comments'
  37. String emptyText = 'No comments yet.'
  38. String placeholder = 'Write a comment…'
  39. String postLabel = 'Comment'
  40. String editLabel = 'Edit'
  41. String deleteLabel = 'Delete'
  42. String saveLabel = 'Save'
  43. String cancelLabel = 'Cancel'
  44. String askText = 'Delete this comment?'
  45. String keepLabel = 'Keep'
  46. String editedLabel = 'edited'
  47. String likeLabel = 'Like'
  48. String signInText = ''
  49. // attachments in the form (above): "true" turns them on; the size limit per file (bytes, 0 = none) and the chooser's `accept`
  50. String attach = 'false'
  51. Number maxFileSize = 0
  52. String accept = ''
  53. String attachText = 'Drop or paste files here, or'
  54. String chooseText = 'Choose files'
  55. String cameraText = 'Camera'
  56. String filesLabel = 'Attachments'
  57. // the state choice in the footer (`states` empty = none): its label, the first choice, and what the button says with a state chosen
  58. Hybrid states = []
  59. String stateLabel = 'State'
  60. String keepText = 'no change'
  61. String stateOnlyLabel = 'Set to'
  62. String bothLabel = 'Comment and set to'
  63. String editingId = ''
  64. String askingId = ''
  65. Number formSeq = 0
  66. Hybrid shown = rowsOf(comments, user, editingId, askingId)
  67. String countText = countOf(comments)
  68. Boolean hasNone = comments.length == 0
  69. Boolean canWrite = user != ''
  70. Boolean cannotWrite = user == '' && signInText != ''
  71. Hybrid forms = [{ id = 'new-' + formSeq }]
  72. // the files waiting in the form (browser Files, the FilesUpload's list: this block is its host) — sent with the next post
  73. Hybrid attached = []
  74. Boolean attaching = canWrite && attach == 'true'
  75. Boolean plainForm = canWrite && attach != 'true'
  76. picked = (list) => { attached = list }
  77. // the state select's choice ('' = no change) and whether the editor holds any text: they decide what the post button says
  78. String chosen = ''
  79. Boolean typed = false
  80. Hybrid choices = choicesOf(states)
  81. Boolean stating = canWrite && states.length > 0
  82. String buttonText = buttonOf(typed, attached, chosen, states)
  83. // the select's choices: "no change" first, then the host's states
  84. choicesOf(list) {
  85. out = [{ value = '' label = keepText }]
  86. for (o of list) { out.push({ value = '' + o.value label = '' + o.label }) }
  87. return out
  88. }
  89. // what the post button says: "Comment", "Set to review" (only a state), "Comment and set to review" (text or files and a state)
  90. buttonOf(hasText, files, state, list) {
  91. if (state == '') { return postLabel }
  92. let name = state
  93. for (o of list) { if ('' + o.value == state) { name = '' + o.label } }
  94. return ((hasText || files.length > 0) ? bothLabel : stateOnlyLabel) + ' ' + name
  95. }
  96. // "1 comment", "n comments"
  97. countOf(list) { return list.length == 1 ? '1 ' + oneLabel : list.length + ' ' + manyLabel }
  98. initialOf(name) {
  99. t = ('' + name).trim()
  100. return t == '' ? '?' : t.slice(0, 1).toUpperCase()
  101. }
  102. // "5 B", "1.2 KB", "3.4 MB" — whole numbers only (rounded to tenths by hand: the server side has no toFixed, hybriel#182)
  103. sizeTextOf(n) {
  104. if (n == null || n < 0) { return '' }
  105. if (n < 1024) { return n + ' B' }
  106. if (n < 1048576) { return tenthsOf(n, 1024) + ' KB' }
  107. return tenthsOf(n, 1048576) + ' MB'
  108. }
  109. tenthsOf(n, unit) {
  110. x = n * 20 + unit
  111. t = (x - x % (2 * unit)) / (2 * unit)
  112. return (t - t % 10) / 10 + '.' + t % 10
  113. }
  114. // "PNG", "PDF": the box a file row shows
  115. kindOf(name) {
  116. t = '' + name
  117. dot = t.lastIndexOf('.')
  118. return dot > 0 && dot < t.length - 1 ? t.slice(dot + 1, dot + 5).toUpperCase() : 'FILE'
  119. }
  120. // what each attached file of a comment shows: a thumbnail (a picture the viewer may fetch), a linked row, or a plain row (no url)
  121. filesOf(list) {
  122. out = []
  123. if (list == null) { return out }
  124. for (f of list) {
  125. let url = f.url != null ? '' + f.url : ''
  126. let thumb = f.image == true && url != ''
  127. out.push({ name = f.name url = url size = sizeTextOf(f.size) kind = kindOf(f.name) thumb = thumb linked = !thumb && url != '' plain = url == '' })
  128. }
  129. return out
  130. }
  131. // what one comment shows: the host's record, and what this block works out for the user looking
  132. rowsOf(list, me, editing, asking) {
  133. out = []
  134. for (c of list) {
  135. let mine = me != '' && c.author == me
  136. let past = c.history != null ? c.history : []
  137. let count = c.likes != null ? c.likes : 0
  138. let isEditing = mine && '' + c.id == editing
  139. let isAsking = mine && '' + c.id == asking && !isEditing
  140. let attachedFiles = filesOf(c.files)
  141. out.push({
  142. id = '' + c.id
  143. author = c.author
  144. initial = initialOf(c.author)
  145. when = c.when != null ? c.when : ''
  146. text = c.text
  147. likes = count
  148. likeText = (c.liked == true ? '♥ ' : '♡ ') + count
  149. pressed = c.liked == true ? 'true' : 'false'
  150. edited = past.length > 0
  151. history = past
  152. editedTitle = past.length == 1 ? 'Edited once' : 'Edited ' + past.length + ' times'
  153. mine = mine
  154. editing = isEditing
  155. notEditing = !isEditing
  156. asking = isAsking
  157. offering = mine && !isEditing && !isAsking
  158. files = attachedFiles
  159. hasFiles = attachedFiles.length > 0
  160. })
  161. }
  162. return out
  163. }
  164. View {
  165. commentsBlock {
  166. h2 { class = "comments-count" countText }
  167. if (hasNone) { p { class = "comments-empty" emptyText } }
  168. ol { class = "comment-list"
  169. for (c of shown) {
  170. li { class = "comment" 'data-id' = c.id
  171. commentAvatar { 'aria-hidden' = "true" c.initial }
  172. commentMain {
  173. commentBubble {
  174. commentMeta {
  175. strong { class = "comment-author" c.author }
  176. time { c.when }
  177. if (c.edited) { details { class = "comment-history"
  178. summary { editedLabel }
  179. p { class = "comment-history-title" c.editedTitle }
  180. ol { for (h of c.history) { li { time { h.when } pre { h.text } } } }
  181. } }
  182. }
  183. if (c.notEditing) { MdEditor { name = "comment-text" value = c.text readonly = "true" } }
  184. if (c.editing) { form { class = "comment-edit" 'data-id' = c.id on submit(e) { emit commentsSave(e) }
  185. MdEditor { name = "comment-edit" value = c.text }
  186. commentButtons {
  187. button { type = "button" class = "comment-cancel" cancelLabel on click(e) { emit commentsCancel(e) } }
  188. button { type = "submit" class = "comment-save" saveLabel }
  189. }
  190. } }
  191. if (c.hasFiles) { ul { class = "comment-files" 'aria-label' = filesLabel
  192. for (f of c.files) { li {
  193. if (f.thumb) { a { class = "comment-thumb" href = f.url target = "_blank" rel = "noopener" title = f.name
  194. img { src = f.url alt = f.name loading = "lazy" }
  195. } }
  196. if (f.linked) { a { class = "comment-file" href = f.url target = "_blank" rel = "noopener"
  197. span { class = "kind" 'aria-hidden' = "true" f.kind }
  198. fileInfo { strong { class = "name" f.name } span { class = "size" f.size } }
  199. } }
  200. if (f.plain) { span { class = "comment-file"
  201. span { class = "kind" 'aria-hidden' = "true" f.kind }
  202. fileInfo { strong { class = "name" f.name } span { class = "size" f.size } }
  203. } }
  204. } }
  205. } }
  206. }
  207. commentActions {
  208. button { type = "button" class = "comment-like" 'data-id' = c.id 'aria-pressed' = c.pressed title = likeLabel c.likeText on click(e) { emit commentsLike(e) } }
  209. if (c.offering) {
  210. button { type = "button" class = "comment-edit-start" 'data-id' = c.id editLabel on click(e) { emit commentsEdit(e) } }
  211. button { type = "button" class = "comment-delete" 'data-id' = c.id deleteLabel on click(e) { emit commentsAsk(e) } }
  212. }
  213. if (c.asking) { commentAsk {
  214. span { askText }
  215. button { type = "button" class = "comment-delete-yes" 'data-id' = c.id deleteLabel on click(e) { emit commentsDelete(e) } }
  216. button { type = "button" class = "comment-delete-keep" keepLabel on click(e) { emit commentsKeep(e) } }
  217. } }
  218. }
  219. }
  220. }
  221. }
  222. }
  223. if (plainForm) { for (f of forms) { form { class = "comment-form" on submit(e) { emit commentsPost(e) } on input(e) { emit commentsTyping(e) }
  224. MdEditor { name = "comment-new" value = "" placeholder = placeholder rows = 3 }
  225. commentButtons {
  226. if (stating) { label { class = "comment-state" stateLabel select { name = "state" value = chosen on change(e) { emit commentsState(e) } for (o of choices) { option { value = o.value o.label } } } } }
  227. button { type = "submit" class = "comment-post" buttonText }
  228. }
  229. } } }
  230. if (attaching) { FilesUpload { mode = "pick" files = attached onChange = picked maxSize = maxFileSize accept = accept pickText = attachText chooseText = chooseText cameraText = cameraText
  231. for (f of forms) { form { class = "comment-form" on submit(e) { emit commentsPost(e) } on input(e) { emit commentsTyping(e) }
  232. MdEditor { name = "comment-new" value = "" placeholder = placeholder rows = 3 files = "off" }
  233. commentButtons {
  234. if (stating) { label { class = "comment-state" stateLabel select { name = "state" value = chosen on change(e) { emit commentsState(e) } for (o of choices) { option { value = o.value o.label } } } } }
  235. button { type = "submit" class = "comment-post" buttonText }
  236. }
  237. } }
  238. } }
  239. if (cannotWrite) { p { class = "comments-sign-in" signInText } }
  240. }
  241. }
  242. idOf(e) {
  243. el = e.target.closest('[data-id]')
  244. return el == null ? '' : el.getAttribute('data-id')
  245. }
  246. // the Markdown the editor of a form holds now (its hidden field, kept up to date by every keystroke)
  247. typedIn(form) {
  248. f = form.querySelector('md-editor input.value')
  249. return f == null ? '' : f.value
  250. }
  251. // post: the host is told the text (and, with attach, the waiting files: a post may be files only); answering false keeps text and
  252. // files in the form (e.g. the server refused), else the form starts empty
  253. on commentsPost(e) {
  254. e.preventDefault()
  255. text = typedIn(e.target)
  256. if (onPost == null) { return null }
  257. if (attach == 'true') {
  258. if (text.trim() == '' && attached.length == 0 && chosen == '') { return null }
  259. sent = states.length > 0 ? onPost(text, attached, chosen) : onPost(text, attached)
  260. if (sent != false) {
  261. attached = []
  262. chosen = ''
  263. typed = false
  264. formSeq = formSeq + 1
  265. }
  266. return null
  267. }
  268. if (text.trim() == '' && chosen == '') { return null }
  269. ok = states.length > 0 ? onPost(text, [], chosen) : onPost(text)
  270. if (ok != false) {
  271. chosen = ''
  272. typed = false
  273. formSeq = formSeq + 1
  274. }
  275. }
  276. // every keystroke in a form's editor: is there any text (the button's words change with it)
  277. on commentsTyping(e) {
  278. form = e.target.closest('form')
  279. if (form == null) { return null }
  280. typed = typedIn(form).trim() != ''
  281. }
  282. on commentsState(e) { chosen = e.target.value }
  283. on commentsEdit(e) {
  284. askingId = ''
  285. editingId = idOf(e)
  286. }
  287. on commentsCancel(e) { editingId = '' }
  288. on commentsSave(e) {
  289. e.preventDefault()
  290. id = idOf(e)
  291. text = typedIn(e.target)
  292. let old = ''
  293. for (c of comments) { if ('' + c.id == id) { old = c.text } }
  294. if (text.trim() != '' && text != old && onEdit != null) { onEdit(id, text) }
  295. editingId = ''
  296. }
  297. on commentsAsk(e) {
  298. editingId = ''
  299. askingId = idOf(e)
  300. }
  301. on commentsKeep(e) { askingId = '' }
  302. on commentsDelete(e) {
  303. id = idOf(e)
  304. askingId = ''
  305. if (onDelete != null) { onDelete(id) }
  306. }
  307. on commentsLike(e) {
  308. if (user == '' || onLike == null) { return null }
  309. onLike(idOf(e))
  310. }
  311. // ---- look: the component's own Style; the base look is black, white and the greys #555 #999 #ddd #f2f2f2 (shared/base.hl names them;
  312. // root README "Look"); every colour is a semantic token with its base value as fallback, so an app that declares the tokens
  313. // (layouts.worldapi.org's theme) restyles it. No frames: the bubble is a grey field on the page, the avatar a grey disc.
  314. Style {
  315. commentsBlock {
  316. display = 'block'
  317. color = 'var(--color-text, #000)'
  318. // Class or attribute assigned by the View or code; no compound-selector form.
  319. 'h2.comments-count' {
  320. margin = '0 0 .8rem'
  321. fontSize = '1.05rem'
  322. }
  323. // Class or attribute assigned by the View or code; no compound-selector form.
  324. 'ol.comment-list' {
  325. display = 'flex'
  326. flexDirection = 'column'
  327. gap = '.9rem'
  328. margin = '0 0 1rem'
  329. padding = '0'
  330. listStyle = 'none'
  331. }
  332. // Class or attribute assigned by the View or code; no compound-selector form.
  333. 'li.comment' {
  334. display = 'flex'
  335. gap = '.6rem'
  336. alignItems = 'flex-start'
  337. }
  338. commentAvatar {
  339. flex = 'none'
  340. display = 'grid'
  341. placeItems = 'center'
  342. width = '2.2rem'
  343. height = '2.2rem'
  344. borderRadius = '50%'
  345. fontWeight = '700'
  346. color = 'var(--color-text, #000)'
  347. background = 'var(--color-surface, #ddd)'
  348. }
  349. commentMain {
  350. display = 'block'
  351. flex = '1'
  352. minWidth = '0'
  353. }
  354. commentBubble {
  355. display = 'block'
  356. padding = '.5rem .8rem .6rem'
  357. background = 'var(--color-background-sunken, #f2f2f2)'
  358. borderRadius = 'var(--radius-small, 5px) var(--radius-large, 10px) var(--radius-large, 10px) var(--radius-large, 10px)'
  359. }
  360. commentMeta {
  361. display = 'flex'
  362. flexWrap = 'wrap'
  363. alignItems = 'baseline'
  364. gap = '.2rem .6rem'
  365. marginBottom = '.2rem'
  366. time {
  367. fontSize = '.8rem'
  368. color = 'var(--color-text-muted, #555)'
  369. }
  370. }
  371. // Class or attribute assigned by the View or code; no compound-selector form.
  372. '.comment-author' {
  373. fontSize = '.95rem'
  374. color = 'var(--color-text-strong, #000)'
  375. overflowWrap = 'anywhere'
  376. }
  377. // Class or attribute assigned by the View or code; no compound-selector form.
  378. 'details.comment-history' {
  379. display = 'contents'
  380. margin = '0'
  381. padding = '0'
  382. border = '0'
  383. borderRadius = '0'
  384. background = 'transparent'
  385. summary {
  386. display = 'inline'
  387. minHeight = '0'
  388. border = '0'
  389. background = 'transparent'
  390. fontSize = '.8rem'
  391. fontWeight = '400'
  392. color = 'var(--color-text-muted, #555)'
  393. cursor = 'pointer'
  394. textDecoration = 'underline dotted'
  395. textUnderlineOffset = '.15em'
  396. padding = '.85rem .5rem'
  397. margin = '-.85rem -.5rem'
  398. hover {
  399. background = 'transparent'
  400. color = 'var(--color-text, #000)'
  401. }
  402. focusVisible {
  403. outline = '2px solid var(--color-accent, #555)'
  404. outlineOffset = '2px'
  405. }
  406. }
  407. ol {
  408. padding = '0'
  409. listStyle = 'none'
  410. }
  411. li {
  412. display = 'block'
  413. margin = '.2rem 0 0'
  414. }
  415. pre {
  416. margin = '0'
  417. padding = '0'
  418. fontFamily = 'inherit'
  419. fontSize = '.85rem'
  420. whiteSpace = 'pre-wrap'
  421. overflowWrap = 'anywhere'
  422. color = 'var(--color-text-muted, #555)'
  423. background = 'transparent'
  424. }
  425. }
  426. // Class or attribute assigned by the View or code; no compound-selector form.
  427. '.comment-history-title' {
  428. margin = '.2rem 0 0'
  429. fontWeight = '600'
  430. }
  431. commentActions {
  432. display = 'flex'
  433. flexWrap = 'wrap'
  434. alignItems = 'center'
  435. gap = '.1rem .3rem'
  436. marginTop = '-.375rem'
  437. fontSize = '.85rem'
  438. }
  439. button {
  440. font = 'inherit'
  441. fontWeight = '600'
  442. minHeight = '2.75rem'
  443. minWidth = '2.75rem'
  444. padding = '.25rem .6rem'
  445. color = 'var(--color-text-muted, #555)'
  446. background = 'transparent'
  447. border = '0'
  448. borderRadius = 'var(--radius-small, 5px)'
  449. cursor = 'pointer'
  450. hover {
  451. color = 'var(--color-text, #000)'
  452. background = 'var(--color-surface, #f2f2f2)'
  453. }
  454. focusVisible {
  455. outline = '2px solid var(--color-accent, #555)'
  456. outlineOffset = '1px'
  457. }
  458. }
  459. // Class or attribute assigned by the View or code; no compound-selector form.
  460. 'button.comment-like[aria-pressed="true"]' { color = 'var(--color-text-strong, #000)' }
  461. commentAsk {
  462. display = 'flex'
  463. flexWrap = 'wrap'
  464. alignItems = 'center'
  465. gap = '.3rem'
  466. }
  467. // Class or attribute assigned by the View or code; no compound-selector form.
  468. 'form.comment-edit' {
  469. display = 'block'
  470. marginTop = '.3rem'
  471. mdEditor { background = 'var(--color-background, #fff)' }
  472. }
  473. // Class or attribute assigned by the View or code; no compound-selector form.
  474. 'form.comment-form' { display = 'block' }
  475. commentButtons {
  476. display = 'flex'
  477. flexWrap = 'wrap'
  478. justifyContent = 'flex-end'
  479. alignItems = 'center'
  480. gap = '.4rem'
  481. marginTop = '.4rem'
  482. }
  483. // Class or attribute assigned by the View or code; no compound-selector form.
  484. 'label.comment-state' {
  485. display = 'inline-flex'
  486. alignItems = 'center'
  487. gap = '.5rem'
  488. margin = '0'
  489. fontSize = '.9rem'
  490. fontWeight = '400'
  491. color = 'var(--color-text-muted, #555)'
  492. select {
  493. background = 'var(--color-surface, #ddd)'
  494. color = 'var(--color-text, #000)'
  495. }
  496. }
  497. // Class or attribute assigned by the View or code; no compound-selector form.
  498. 'button.comment-post' {
  499. minHeight = '2.75rem'
  500. minWidth = '2.75rem'
  501. padding = '.25rem 1rem'
  502. }
  503. // Class or attribute assigned by the View or code; no compound-selector form.
  504. 'ul.comment-files' {
  505. display = 'flex'
  506. flexWrap = 'wrap'
  507. gap = '.4rem'
  508. margin = '.4rem 0 .1rem'
  509. padding = '0'
  510. listStyle = 'none'
  511. li {
  512. display = 'block'
  513. minWidth = '0'
  514. maxWidth = '100%'
  515. }
  516. }
  517. // Class or attribute assigned by the View or code; no compound-selector form.
  518. 'a.comment-thumb' {
  519. display = 'block'
  520. width = '6rem'
  521. height = '6rem'
  522. borderRadius = 'var(--radius-small, 5px)'
  523. overflow = 'hidden'
  524. background = 'var(--color-surface, #ddd)'
  525. img {
  526. display = 'block'
  527. width = '100%'
  528. height = '100%'
  529. objectFit = 'cover'
  530. }
  531. }
  532. // Class or attribute assigned by the View or code; no compound-selector form.
  533. '.comment-file' {
  534. display = 'flex'
  535. alignItems = 'center'
  536. gap = '.5rem'
  537. minHeight = '2.75rem'
  538. padding = '.2rem .6rem .2rem .2rem'
  539. boxSizing = 'border-box'
  540. maxWidth = '100%'
  541. color = 'var(--color-text, #000)'
  542. textDecoration = 'none'
  543. background = 'var(--color-background, #fff)'
  544. borderRadius = 'var(--radius-small, 5px)'
  545. // Class or attribute assigned by the View or code; no compound-selector form.
  546. '.kind' {
  547. flex = 'none'
  548. display = 'grid'
  549. placeItems = 'center'
  550. width = '2.4rem'
  551. height = '2.4rem'
  552. fontSize = '.7rem'
  553. fontWeight = '700'
  554. color = 'var(--color-text-muted, #555)'
  555. background = 'var(--color-surface, #ddd)'
  556. borderRadius = 'var(--radius-small, 5px)'
  557. }
  558. fileInfo {
  559. display = 'flex'
  560. flexDirection = 'column'
  561. minWidth = '0'
  562. }
  563. // Class or attribute assigned by the View or code; no compound-selector form.
  564. '.name' {
  565. fontSize = '.9rem'
  566. overflowWrap = 'anywhere'
  567. }
  568. // Class or attribute assigned by the View or code; no compound-selector form.
  569. '.size' {
  570. fontSize = '.8rem'
  571. color = 'var(--color-text-muted, #555)'
  572. }
  573. }
  574. // Class or attribute assigned by the View or code; no compound-selector form.
  575. 'a.comment-file' {
  576. hover { background = 'var(--color-surface, #f2f2f2)' }
  577. }
  578. filesUpload {
  579. // Class or attribute assigned by the View or code; no compound-selector form.
  580. 'form.comment-form' { display = 'contents' }
  581. }
  582. }
  583. // No language form for selector list.
  584. 'comments-block .comments-empty, comments-block .comments-sign-in' {
  585. margin = '0 0 .8rem'
  586. color = 'var(--color-text-muted, #555)'
  587. }
  588. // No language form for pseudo-element.
  589. 'comments-block details.comment-history::details-content' { display = 'contents' }
  590. // No language form for direct-child combinator, :not/:has/:where condition.
  591. 'comments-block details.comment-history > :not(summary)' {
  592. flexBasis = '100%'
  593. margin = '0'
  594. fontSize = '.8rem'
  595. color = 'var(--color-text-muted, #555)'
  596. }
  597. // No language form for selector list.
  598. 'comments-block button.comment-delete-yes, comments-block button.comment-save, comments-block button.comment-post' {
  599. color = 'var(--color-accent-text, #fff)'
  600. background = 'var(--color-accent, #000)'
  601. }
  602. // No language form for selector list.
  603. 'comments-block button.comment-delete-yes:hover, comments-block button.comment-save:hover, comments-block button.comment-post:hover' {
  604. color = 'var(--color-accent-text, #fff)'
  605. background = 'var(--color-accent, #000)'
  606. filter = 'brightness(1.3)'
  607. }
  608. // No language form for selector list.
  609. 'comments-block a.comment-thumb:focus-visible, comments-block a.comment-file:focus-visible' {
  610. outline = '2px solid var(--color-accent, #555)'
  611. outlineOffset = '1px'
  612. }
  613. }

Branches

Latest commits

  • 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
  • 494d75d4Nest caller slot styles in app-sidebarmre
  • e5571680Align all plugin sources with Hybriel day38bmre
  • 5d204c46Re-vendor layouts to Hybriel set day38bmre
  • 17e0f03eNest html-prefixed theme component overridesmre
  • e54e735eFormat plain theme elements with nested rules and bare mediamre
  • 547f834eRecord LY7 deployment and live verificationmre
  • fa4600b1Link caller-slot style exceptions to hybriel#270mre