@fieldia/viewer 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +18 -0
  2. package/bundle/fieldia.ar.js +2 -2
  3. package/bundle/fieldia.ar.js.map +2 -2
  4. package/bundle/fieldia.choice.js +5 -0
  5. package/bundle/fieldia.choice.js.map +7 -0
  6. package/bundle/fieldia.de.js +2 -2
  7. package/bundle/fieldia.de.js.map +2 -2
  8. package/bundle/fieldia.filters.js +5 -0
  9. package/bundle/fieldia.filters.js.map +7 -0
  10. package/bundle/fieldia.fr.js +2 -2
  11. package/bundle/fieldia.fr.js.map +2 -2
  12. package/bundle/fieldia.head.js +5 -0
  13. package/bundle/fieldia.head.js.map +7 -0
  14. package/bundle/fieldia.js +44 -44
  15. package/bundle/fieldia.js.map +4 -4
  16. package/bundle/fieldia.path.js +5 -0
  17. package/bundle/fieldia.path.js.map +7 -0
  18. package/bundle/fieldia.text.js +24 -0
  19. package/bundle/fieldia.text.js.map +7 -0
  20. package/package.json +7 -3
  21. package/src/index.d.mts +2 -1
  22. package/src/index.d.ts +2 -1
  23. package/src/index.js +6 -1
  24. package/src/index.js.map +1 -1
  25. package/src/index.mjs +1 -0
  26. package/src/index.mjs.map +1 -1
  27. package/src/lib/button-parts.d.mts +30 -0
  28. package/src/lib/button-parts.d.ts +30 -0
  29. package/src/lib/button-parts.js +24 -0
  30. package/src/lib/button-parts.js.map +1 -0
  31. package/src/lib/button-parts.mjs +18 -0
  32. package/src/lib/button-parts.mjs.map +1 -0
  33. package/src/lib/dialog-window.d.mts +11 -0
  34. package/src/lib/dialog-window.d.ts +11 -0
  35. package/src/lib/dialog-window.js +86 -0
  36. package/src/lib/dialog-window.js.map +1 -0
  37. package/src/lib/dialog-window.mjs +82 -0
  38. package/src/lib/dialog-window.mjs.map +1 -0
  39. package/src/lib/dialog.d.mts +14 -3
  40. package/src/lib/dialog.d.ts +14 -3
  41. package/src/lib/dialog.js +84 -14
  42. package/src/lib/dialog.js.map +1 -1
  43. package/src/lib/dialog.mjs +85 -15
  44. package/src/lib/dialog.mjs.map +1 -1
  45. package/src/lib/filter-bar.d.mts +39 -0
  46. package/src/lib/filter-bar.d.ts +39 -0
  47. package/src/lib/filter-bar.js +290 -0
  48. package/src/lib/filter-bar.js.map +1 -0
  49. package/src/lib/filter-bar.mjs +287 -0
  50. package/src/lib/filter-bar.mjs.map +1 -0
  51. package/src/lib/filter-styles.d.mts +4 -0
  52. package/src/lib/filter-styles.d.ts +4 -0
  53. package/src/lib/filter-styles.js +63 -0
  54. package/src/lib/filter-styles.js.map +1 -0
  55. package/src/lib/filter-styles.mjs +59 -0
  56. package/src/lib/filter-styles.mjs.map +1 -0
  57. package/src/lib/filters-part.d.mts +8 -0
  58. package/src/lib/filters-part.d.ts +8 -0
  59. package/src/lib/filters-part.js +14 -0
  60. package/src/lib/filters-part.js.map +1 -0
  61. package/src/lib/filters-part.mjs +9 -0
  62. package/src/lib/filters-part.mjs.map +1 -0
  63. package/src/lib/group-styles.d.mts +9 -0
  64. package/src/lib/group-styles.d.ts +9 -0
  65. package/src/lib/group-styles.js +64 -0
  66. package/src/lib/group-styles.js.map +1 -0
  67. package/src/lib/group-styles.mjs +60 -0
  68. package/src/lib/group-styles.mjs.map +1 -0
  69. package/src/lib/head-part.d.mts +15 -0
  70. package/src/lib/head-part.d.ts +15 -0
  71. package/src/lib/head-part.js +26 -0
  72. package/src/lib/head-part.js.map +1 -0
  73. package/src/lib/head-part.mjs +16 -0
  74. package/src/lib/head-part.mjs.map +1 -0
  75. package/src/lib/head-styles.d.mts +28 -0
  76. package/src/lib/head-styles.d.ts +28 -0
  77. package/src/lib/head-styles.js +320 -0
  78. package/src/lib/head-styles.js.map +1 -0
  79. package/src/lib/head-styles.mjs +316 -0
  80. package/src/lib/head-styles.mjs.map +1 -0
  81. package/src/lib/labels.d.mts +29 -0
  82. package/src/lib/labels.d.ts +29 -0
  83. package/src/lib/labels.js +16 -0
  84. package/src/lib/labels.js.map +1 -1
  85. package/src/lib/labels.mjs +16 -0
  86. package/src/lib/labels.mjs.map +1 -1
  87. package/src/lib/list-styles.d.mts +1 -1
  88. package/src/lib/list-styles.d.ts +1 -1
  89. package/src/lib/list-styles.js +88 -1
  90. package/src/lib/list-styles.js.map +1 -1
  91. package/src/lib/list-styles.mjs +88 -1
  92. package/src/lib/list-styles.mjs.map +1 -1
  93. package/src/lib/list.d.mts +16 -1
  94. package/src/lib/list.d.ts +16 -1
  95. package/src/lib/list.js +281 -51
  96. package/src/lib/list.js.map +1 -1
  97. package/src/lib/list.mjs +282 -52
  98. package/src/lib/list.mjs.map +1 -1
  99. package/src/lib/locales/ar.js +16 -0
  100. package/src/lib/locales/ar.js.map +1 -1
  101. package/src/lib/locales/ar.mjs +16 -0
  102. package/src/lib/locales/ar.mjs.map +1 -1
  103. package/src/lib/locales/de.js +16 -0
  104. package/src/lib/locales/de.js.map +1 -1
  105. package/src/lib/locales/de.mjs +16 -0
  106. package/src/lib/locales/de.mjs.map +1 -1
  107. package/src/lib/locales/fr.js +16 -0
  108. package/src/lib/locales/fr.js.map +1 -1
  109. package/src/lib/locales/fr.mjs +16 -0
  110. package/src/lib/locales/fr.mjs.map +1 -1
  111. package/src/lib/look.d.mts +1 -1
  112. package/src/lib/look.d.ts +1 -1
  113. package/src/lib/look.js +3 -0
  114. package/src/lib/look.js.map +1 -1
  115. package/src/lib/look.mjs +3 -0
  116. package/src/lib/look.mjs.map +1 -1
  117. package/src/lib/record-bar.d.mts +10 -1
  118. package/src/lib/record-bar.d.ts +10 -1
  119. package/src/lib/record-bar.js +15 -7
  120. package/src/lib/record-bar.js.map +1 -1
  121. package/src/lib/record-bar.mjs +14 -7
  122. package/src/lib/record-bar.mjs.map +1 -1
  123. package/src/lib/record-head.d.mts +58 -0
  124. package/src/lib/record-head.d.ts +58 -0
  125. package/src/lib/record-head.js +245 -0
  126. package/src/lib/record-head.js.map +1 -0
  127. package/src/lib/record-head.mjs +240 -0
  128. package/src/lib/record-head.mjs.map +1 -0
  129. package/src/lib/rich-button.d.mts +12 -0
  130. package/src/lib/rich-button.d.ts +12 -0
  131. package/src/lib/rich-button.js +186 -0
  132. package/src/lib/rich-button.js.map +1 -0
  133. package/src/lib/rich-button.mjs +183 -0
  134. package/src/lib/rich-button.mjs.map +1 -0
  135. package/src/lib/section-head.d.mts +26 -0
  136. package/src/lib/section-head.d.ts +26 -0
  137. package/src/lib/section-head.js +65 -0
  138. package/src/lib/section-head.js.map +1 -0
  139. package/src/lib/section-head.mjs +56 -0
  140. package/src/lib/section-head.mjs.map +1 -0
  141. package/src/lib/section-tools.d.mts +12 -0
  142. package/src/lib/section-tools.d.ts +12 -0
  143. package/src/lib/section-tools.js +124 -0
  144. package/src/lib/section-tools.js.map +1 -0
  145. package/src/lib/section-tools.mjs +121 -0
  146. package/src/lib/section-tools.mjs.map +1 -0
  147. package/src/lib/viewer-parts.d.mts +33 -0
  148. package/src/lib/viewer-parts.d.ts +33 -0
  149. package/src/lib/viewer-parts.js +75 -0
  150. package/src/lib/viewer-parts.js.map +1 -0
  151. package/src/lib/viewer-parts.mjs +70 -0
  152. package/src/lib/viewer-parts.mjs.map +1 -0
  153. package/src/lib/viewer.d.mts +30 -7
  154. package/src/lib/viewer.d.ts +30 -7
  155. package/src/lib/viewer.js +317 -97
  156. package/src/lib/viewer.js.map +1 -1
  157. package/src/lib/viewer.mjs +319 -99
  158. package/src/lib/viewer.mjs.map +1 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["fieldia-shared:5", "fieldia-shared:2", "fieldia-shared:4", "fieldia-shared:1", "fieldia-shared:3", "../../../../fieldia.head.ts", "../../../../libs/viewer/src/lib/record-head.ts", "../../../../libs/viewer/src/lib/head-styles.ts", "../../../../libs/viewer/src/lib/rich-button.ts", "../../../../libs/viewer/src/lib/section-tools.ts", "../../../../libs/viewer/src/lib/group-styles.ts", "../../../../libs/viewer/src/lib/dialog-window.ts"],
4
+ "sourcesContent": ["module.exports = __fieldia[5];", "module.exports = __fieldia[2];", "module.exports = __fieldia[4];", "module.exports = __fieldia[1];", "module.exports = __fieldia[3];", "export * from \"/home/rthm/IWork/fieldia-dev/fieldia-lanes/wi-join/libs/viewer/src/lib/head-part.ts\";", "import { displayValue, drawIcon, type IconSet } from '@fieldia/widgets';\nimport type { ButtonNode, FieldNode, Form, FormState, HeadLink, LabelPlace, LayoutNode, LineField, Locale, MenuItem, Page, RootLayout, RunResult, SheetHead, SheetNode, Tone, Values } from '@fieldia/core';\nimport { setAttr, setHidden, setText, type El } from './dom';\nimport type { ViewerLabels } from './labels';\nimport type { Place } from './place';\nimport { recordMenu } from './record-bar';\nimport { installHeadStyles } from './head-styles';\n\n/**\n * A record's head as a work tracker draws a work item's (`SheetHead`): the\n * kind's strip of colour along its start edge and the badge over the title \u2014\n * the kind's icon, its name in capitals, the record's number \u2014 with room at\n * the badge row's end for a dialog's \u2922 and \u00D7; the title line, the number\n * before the title, a Copy title button at its end while it is pointed at or\n * focused; the row of people and links, the record's buttons and \u22EE at its\n * end; then the band of fields, labels beside them, a lead slot before each\n * value (a state's dot, a lock), \"Updated by\" and the tabs placed in the head\n * at its end. Plain DOM, drawn with the viewer's own parts.\n */\n\nexport interface RecordHeadContext {\n doc: Document;\n el: El;\n form: Form;\n page: Page;\n sheet: SheetNode;\n head: SheetHead;\n labels: ViewerLabels;\n locale: Locale;\n icons?: IconSet;\n uid(id: string): string;\n fill(template: string, values: Record<string, string | number>): string;\n withIcon(name: string | undefined, text: string): (Node | string)[];\n press(button: HTMLElement, run: () => Promise<RunResult>): Promise<void>;\n say(message: string, tone: Tone): void;\n /** A field as the viewer draws one, where labels sit and what its group says of the quiet look. */\n fieldItem(node: FieldNode, place?: LabelPlace, around?: Pick<Place, 'quiet' | 'reason'>): HTMLElement;\n /** Any part, as the viewer draws one where it sits. */\n item(node: LayoutNode, place: Place): HTMLElement;\n buttonItem(node: ButtonNode): HTMLElement;\n /** Its updater, run at every change of the form. */\n watch(update: (state: FormState) => void): void;\n cleanups: (() => void)[];\n /** Show a tab by its id: false when it is hidden. */\n showTab(id: string): boolean;\n /** Unfold a folded group the part is in. */\n unfold(part: HTMLElement): void;\n /** The form's element, where its parts are found. */\n root(): HTMLElement;\n}\n\nexport interface RecordHead {\n element: HTMLElement;\n /** Where the tabs placed in the head go: at the band's bottom end. */\n tabs: HTMLElement;\n /** Where a dialog puts its \u2922 and \u00D7: the badge row's end. */\n window: HTMLElement;\n}\n\n/** The record's kind now: its look, its words, its number. */\ninterface KindNow {\n key: string;\n colour: string | null;\n icon: string | undefined;\n words: string;\n}\n\nexport function recordHead(context: RecordHeadContext): RecordHead {\n const { el, form, page, sheet, head, labels, doc } = context;\n installHeadStyles(doc);\n const id = context.uid('head');\n const watch = context.watch;\n\n // ---- the white part: the strip, the badge row, the title line, the row ----\n const strip = el('span', { class: 'fd-head-strip', 'aria-hidden': 'true' });\n const badgeWords = el('bdi', { class: 'fd-head-badge-words' });\n const badgeIcon = el('span', { class: 'fd-head-badge-icon', 'aria-hidden': 'true' });\n const badge = el('span', { class: 'fd-head-badge', id: `${id}-badge`, 'data-head-name': '' }, badgeIcon, badgeWords);\n const windowSlot = el('span', { class: 'fd-head-window' });\n const badgeRow = el('div', { class: 'fd-head-badge-row' }, head.kind ? badge : el('span'), windowSlot);\n const top = el('div', { class: 'fd-head-top' }, strip, badgeRow);\n\n // The title line: the number and what else stands before it, the title, its Copy button.\n const title = sheet.title;\n if (title) {\n const line = el('div', { class: 'fd-head-title' });\n // The record's number stands as words, as an id does: never grouped, never a box to type in.\n const numberField = head.kind?.numberField;\n const side = (part: FieldNode) => {\n if (part.field === numberField) {\n const words = el('span', { class: 'fd-head-number', 'data-node': part.id });\n watch((state) => {\n setHidden(words, form.node(part.id).invisible);\n setText(words, numberWords(state));\n });\n return words;\n }\n const drawn = context.fieldItem(part, 'hidden');\n drawn.classList.add('fd-title-side');\n return drawn;\n };\n const name = context.fieldItem({ type: 'field', id: '#title', field: title.field, placeholder: title.placeholder, ...(title.placeholderWhen ? { placeholderWhen: title.placeholderWhen } : {}), ...(title.focus ? { focus: true } : {}) }, 'hidden');\n name.classList.add('fd-title-name');\n line.append(...(title.before ?? []).map(side), name);\n // The record's name for a dialog round it: its title's words, kept up to date, out of sight.\n const named = el('span', { class: 'fd-sr-only', id: `${id}-title`, 'data-head-name': '' });\n watch((state) => setText(named, String(state.values[title.field] ?? '')));\n if (head.copyTitle !== false) {\n const copy = el('button', { type: 'button', class: 'fd-head-copy', 'aria-label': labels.copyTitle, title: labels.copyTitle });\n const icon = drawIcon(doc, 'copy', context.icons);\n if (icon) copy.append(icon);\n copy.addEventListener('click', () => void copyTitle(String(form.getState().values[title.field] ?? '')));\n line.append(copy);\n }\n line.append(...(title.after ?? []).map(side), named);\n top.append(line);\n }\n\n const row = el('div', { class: 'fd-head-row' });\n const meta = el('div', { class: 'fd-head-meta' }, ...(head.meta ?? []).map((part) => (part.type === 'link' ? headLink(part) : context.fieldItem(part, 'hidden'))));\n const actions = el('div', { class: 'fd-head-actions' }, ...(head.actions ?? []).map((button) => context.buttonItem(button)));\n // The record's gear menu, as \u22EE at the end.\n const menu = sheet.toolbar?.menu ?? [];\n if (menu.length) {\n const updaters: (() => void)[] = [];\n actions.append(recordMenu({ doc, el, form, labels, uid: context.uid, withIcon: context.withIcon, press: context.press }, menu as MenuItem[], updaters, context.cleanups, 'more'));\n watch(() => updaters.forEach((update) => update()));\n }\n row.append(meta, actions);\n top.append(row);\n\n // ---- the band: its fields, \"Updated by\", the tabs ----\n const band = head.band;\n const fields = el('div', { class: 'fd-head-fields' });\n const tracks = band?.tracks ?? ['1fr', '1fr'];\n fields.style.setProperty('--fd-head-tracks', tracks.join(' '));\n if (band?.labelWidth) fields.style.setProperty('--fd-head-label', `${band.labelWidth}px`);\n fields.append(...(band?.children ?? []).map((child) => context.item(child, { columns: tracks.length, onPage: false, labels: 'beside', quiet: true })));\n const aside = el('div', { class: 'fd-head-aside' });\n const updated = head.updated ? updatedBy(head.updated) : null;\n if (updated) aside.append(updated);\n const tabs = el('div', { class: 'fd-head-tabs' });\n aside.append(tabs);\n const bandBox = el('div', { class: 'fd-head-band' }, fields, aside);\n const element = el('div', { class: 'fd-head', id }, top, bandBox);\n\n // The kind's look, words and number, kept up to date.\n if (head.kind) {\n let drawnIcon = '';\n watch((state) => {\n const now = kindNow(state);\n // Its kind by the field's value; one kind with a colour of its own is a kind too, its strip shown.\n setAttr(element, 'data-kind', now.key || (now.colour ? '' : null));\n if (now.colour) element.style.setProperty('--fd-kind', now.colour);\n else element.style.removeProperty('--fd-kind');\n if (now.icon !== drawnIcon) {\n drawnIcon = now.icon ?? '';\n badgeIcon.replaceChildren(...[drawIcon(doc, now.icon, context.icons)].filter((icon): icon is SVGSVGElement => !!icon));\n }\n setText(badgeWords, now.words);\n });\n }\n\n return { element, tabs, window: windowSlot };\n\n /** The kind the record is now, as its field holds it, else the one kind the head names. */\n function kindNow(state: FormState): KindNow {\n const kind = head.kind ?? {};\n const value = kind.field ? state.values[kind.field] : undefined;\n const def = kind.field ? page.fields[kind.field] : undefined;\n const key = value === null || value === undefined ? '' : typeof value === 'object' && !Array.isArray(value) && 'id' in value ? String((value as { id: unknown }).id) : String(value);\n const look = key ? kind.looks?.[key] : undefined;\n const label = def && key ? displayValue(def as LineField, value, state.values as Values, context.locale) : '';\n const words = [(label || kind.label || '').toLocaleUpperCase(context.locale), numberWords(state)].filter(Boolean).join(' ');\n return { key, colour: look?.colour ?? kind.colour ?? null, icon: look?.icon ?? kind.icon, words };\n }\n\n /** The record's number as an id is written: its field's value as it is, else the record's id; nothing for a new record. */\n function numberWords(state: FormState): string {\n const field = head.kind?.numberField;\n const value = field ? state.values[field] : state.recordId;\n return value === null || value === undefined || value === '' ? '' : String(value);\n }\n\n /** \"1 Comment\": the number, then its words in the plural it needs; a press takes the reader to its part, or runs its steps. */\n function headLink(link: HeadLink): HTMLElement {\n const words = el('span', { class: 'fd-head-link-words' });\n // Going nowhere and doing nothing, it is its words alone, never a button that does nothing.\n const acts = !!link.target || !!link.steps?.length;\n const button = el(acts ? 'button' : 'span', { ...(acts ? { type: 'button' } : {}), class: 'fd-head-link', 'data-node': link.id }, ...[drawIcon(doc, link.icon, context.icons)].filter((icon): icon is SVGSVGElement => !!icon), words);\n const plural = new Intl.PluralRules(context.locale);\n button.addEventListener('click', () => {\n if (link.steps?.length) void context.press(button, () => form.runAction(link.id));\n if (link.target) reveal(link.target);\n });\n watch((state) => {\n setHidden(button, form.node(link.id).invisible);\n const raw = state.values[link.field];\n const count = typeof raw === 'number' ? raw : Number(raw ?? 0) || 0;\n const form_ = plural.select(count) as keyof HeadLink['words'];\n setText(words, `${count} ${link.words[form_] ?? link.words.other}`);\n });\n return button;\n }\n\n /** \"Updated by Mona Adel: Aug 25\", from who changed it and when; a press shows the tab it opens. */\n function updatedBy(updated: NonNullable<SheetHead['updated']>): HTMLElement {\n const tag = updated.opens ? 'button' : 'span';\n const box = el(tag, { class: 'fd-head-updated', ...(tag === 'button' ? { type: 'button' } : {}) });\n if (updated.opens) {\n const opens = updated.opens;\n box.addEventListener('click', () => {\n if (!context.showTab(opens)) return;\n context.root().querySelector<HTMLElement>(`.fd-tab[data-node=\"${opens}\"]`)?.focus();\n });\n }\n watch((state) => {\n const who = displayValue(page.fields[updated.byField] as LineField, state.values[updated.byField], state.values as Values, context.locale);\n const at = state.values[updated.atField];\n const when = typeof at === 'string' && at ? shortDate(at, context.locale) : '';\n setHidden(box, !who || !when);\n setText(box, who && when ? context.fill(labels.updatedBy, { name: who, date: when }) : '');\n });\n return box;\n }\n\n /** Copy the title's words, and say so; where the clipboard is out of reach, by the page's own copy. */\n async function copyTitle(words: string) {\n const clipboard = doc.defaultView?.navigator.clipboard;\n const done = clipboard ? await clipboard.writeText(words).then(() => true, () => pageCopy(words)) : pageCopy(words);\n if (done) context.say(labels.titleCopied, 'info');\n }\n\n /** The page's own copy, where the clipboard is out of reach: the words selected out of sight, the focus put back. */\n function pageCopy(words: string): boolean {\n const was = doc.activeElement as HTMLElement | null;\n const box = el('textarea', { class: 'fd-sr-only', 'aria-hidden': 'true', tabindex: '-1' });\n box.value = words;\n doc.body.append(box);\n box.select();\n let done = false;\n try {\n done = doc.execCommand('copy');\n } catch {\n // Not even that: nothing is said.\n }\n box.remove();\n was?.focus();\n return done;\n }\n\n /** Take the reader to a part: the tabs it is in shown, the groups it is in unfolded, scrolled into view, its first box focused. */\n function reveal(target: string) {\n for (const tab of tabsAround(page.layout, target)) context.showTab(tab);\n // An id is letters, digits, dots, dashes and underscores: nothing to escape in a selector's quotes.\n const part = context.root().querySelector<HTMLElement>(`[data-node=\"${target}\"]`);\n if (!part) return;\n context.unfold(part);\n part.scrollIntoView?.({ block: 'nearest', behavior: 'smooth' });\n const first = part.querySelector<HTMLElement>('input:not([type=\"hidden\"]), textarea, select, [contenteditable=\"true\"], button, [tabindex=\"0\"]');\n (first ?? part).focus?.({ preventScroll: true });\n }\n}\n\n/** The tabs a part stands in, outermost first, by their ids; none when it stands in no tab. */\nexport function tabsAround(root: RootLayout, target: string): string[] {\n const search = (nodes: readonly LayoutNode[], around: string[]): string[] | null => {\n for (const node of nodes) {\n if (node.id === target) return around;\n if (node.type === 'section') {\n const found = search(node.children, around);\n if (found) return found;\n }\n if (node.type === 'tabs') {\n for (const tab of node.children) {\n if (tab.id === target) return [...around, tab.id];\n const found = search(tab.children, [...around, tab.id]);\n if (found) return found;\n }\n }\n }\n return null;\n };\n if (root.type === 'list') return [];\n if (root.type === 'tabs') return search([root], []) ?? [];\n const nodes = root.type === 'wizard' ? root.children.flatMap((step) => step.children) : root.children;\n return search(nodes, []) ?? [];\n}\n\n/** A date as a work item's head says it: \"Aug 25\", with its year when that is not this year's. */\nexport function shortDate(iso: string, locale: Locale, now = new Date()): string {\n const day = /^\\d{4}-\\d{2}-\\d{2}$/.test(iso) ? new Date(`${iso}T12:00:00`) : new Date(iso);\n if (Number.isNaN(day.getTime())) return iso;\n const year = day.getFullYear() !== now.getFullYear();\n // Arabic in Latin digits, as the rest of a record's dates are written.\n const tag = locale === 'ar' ? 'ar-u-nu-latn' : locale;\n return new Intl.DateTimeFormat(tag, { month: 'short', day: 'numeric', ...(year ? { year: 'numeric' } : {}) }).format(day);\n}\n", "import { installPartStyles, PART_RANK } from '@fieldia/widgets';\n\n/**\n * A record's head as a work tracker draws a work item's, and the dialog round\n * it: measured from the work item's own window (fieldia's docs/plans,\n * work-item-replica.md \u00A72.3\u20132.5) and written in the form's tokens, so a\n * theme, a host's colours, the dark scheme and right to left all follow.\n * Greys that are no token of their own are mixed from the text and the\n * surface, in the shares the light window shows them: the band #f8f8f8, the\n * tabs' frame #dadada, a count's pill #ebebeb, a pressed button #d2d2d2.\n *\n * - The dialog of the `inset` size: 96px in from the window's sides and 46px\n * from its top and bottom, the whole window under 760px; with no dimmed\n * page behind (`clear`); maximised, the whole window; resized by its grip.\n * - The head: the kind's strip along its start edge through its white part,\n * the badge row (\u2922 and \u00D7 at its end), the title line, the row of people,\n * links and buttons, then the band of fields with \"Updated by\" and the\n * tabs at its end; the body under it scrolls on its own in a dialog.\n * - Buttons a head holds: quiet ones on a light fill, split ones with a rule\n * between their press and their chevron, ones shown by their icon alone.\n *\n * Logical properties throughout: right to left mirrors on its own.\n *\n * The head part's own sheet (head-part.ts), put in its place among Fieldia's\n * the first time a page draws a head, a split button, a work heading or the\n * inset dialog (installPartStyles, PART_RANK.head).\n */\nexport const HEAD_PART_CSS = /* css */ `.fd-dialog-backdrop.fd-backdrop-clear{background:transparent}.fd-form-dialog.fd-size-inset{position:fixed;inset:46px 96px;width:auto;height:auto;max-width:none;max-height:none;border-radius:4px;background:var(--fd-surface);box-shadow:0 0 0 1px var(--fd-edge, transparent),0 25.6px 57.6px #00000038,0 4.8px 14.4px #0000002e}@media(max-width:759.98px){.fd-form-dialog.fd-size-inset{inset:0;border-radius:0}.fd-form-dialog.fd-size-inset :is(.fd-dialog-max,.fd-dialog-grip){display:none!important}}.fd-form-dialog[data-resized]{position:fixed;max-width:none;max-height:none;margin:0}.fd-form-dialog[data-maximised]{position:fixed;inset:0!important;width:auto!important;height:auto!important;max-width:none;max-height:none;border-radius:0}.fd-form-dialog[data-maximised]>.fd-dialog-grip{display:none}.fd-dialog-max{display:inline-grid;place-items:center;border:none;background:none;cursor:pointer;padding:2px 8px;border-radius:4px;color:var(--fd-muted)}.fd-dialog-max:hover{background:var(--fd-page);color:var(--fd-text)}.fd-dialog-max .fd-icon{width:16px;height:16px;margin:0}.fd-form-dialog :is(.fd-dialog-max,.fd-head-window .fd-dialog-close){display:inline-grid;place-items:center;width:32px;height:32px;padding:0;font-size:16px;color:var(--fd-text);border-radius:2px}.fd-form-dialog :is(.fd-dialog-max,.fd-head-window .fd-dialog-close) .fd-icon{width:16px;height:16px;margin:0}.fd-dialog-grip{position:absolute;inset-inline-end:0;inset-block-end:0;width:16px;height:16px;padding:0;border:0;z-index:2;background:none;cursor:nwse-resize;color:color-mix(in srgb,var(--fd-text) 90%,var(--fd-surface));border-end-end-radius:4px}.fd-dialog-grip:dir(rtl){cursor:nesw-resize}.fd-dialog-grip:before{content:\"\";position:absolute;inset-inline-end:4px;inset-block-end:4px;box-sizing:border-box;width:7px;height:7px;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;background:linear-gradient(to top left,transparent calc(50% - .75px),currentColor calc(50% - .75px) calc(50% + .75px),transparent calc(50% + .75px))}.fd-dialog-grip:dir(rtl):before{background:linear-gradient(to top right,transparent calc(50% - .75px),currentColor calc(50% - .75px) calc(50% + .75px),transparent calc(50% + .75px))}.fd-form-dialog:has(>.fd-dialog-grip){position:relative}.fd-form-dialog[data-headed]:not([data-maximised]):has(>.fd-dialog-grip)>.fd-form-dialog-body{padding-block-end:18px;--fd-history-foot: 20px}@media(max-width:759.98px){.fd-form-dialog.fd-size-inset[data-headed]:has(>.fd-dialog-grip)>.fd-form-dialog-body{padding-block-end:0;--fd-history-foot: 38px}}.fd-form-dialog.fd-size-inset:has(>.fd-dialog-grip),.fd-form-dialog[data-resized]{position:fixed}.fd-form-dialog[data-headed]>.fd-form-dialog-body{display:flex;flex-direction:column;overflow:hidden;padding:0;background:var(--fd-surface)}.fd-form-dialog[data-headed]>.fd-form-dialog-body>.fd-form{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.fd-form-dialog[data-headed]>.fd-form-dialog-body>.fd-form>.fd-content{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.fd-form-dialog[data-headed] .fd-head-page{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.fd-form-dialog[data-headed] .fd-head-page>.fd-head{flex:none}.fd-form-dialog[data-headed] .fd-head-page>:is(.fd-head-body,.fd-head-layout){flex:1 1 auto;min-height:0;overflow:auto}.fd-head-page ::-webkit-scrollbar{width:15px;height:15px}.fd-head-page ::-webkit-scrollbar-track,.fd-head-page ::-webkit-scrollbar-corner{background:color-mix(in srgb,var(--fd-text) 2.2%,var(--fd-surface))}.fd-head-page ::-webkit-scrollbar-track:vertical{border-left:1px solid color-mix(in srgb,var(--fd-text) 10%,var(--fd-surface));border-right:1px solid color-mix(in srgb,var(--fd-text) 7.5%,var(--fd-surface))}[dir=rtl] .fd-head-page ::-webkit-scrollbar-track:vertical{border-left-color:color-mix(in srgb,var(--fd-text) 7.5%,var(--fd-surface));border-right-color:color-mix(in srgb,var(--fd-text) 10%,var(--fd-surface))}.fd-head-page ::-webkit-scrollbar-track:horizontal{border-top:1px solid color-mix(in srgb,var(--fd-text) 10%,var(--fd-surface));border-bottom:1px solid color-mix(in srgb,var(--fd-text) 7.5%,var(--fd-surface))}.fd-head-page ::-webkit-scrollbar-thumb{border:solid transparent;border-width:3px 3px 3px 4px;border-radius:8px;background:color-mix(in srgb,var(--fd-text) 24.5%,var(--fd-surface)) padding-box}.fd-head-page ::-webkit-scrollbar-thumb:horizontal{border-width:4px 3px 3px}[dir=rtl] .fd-head-page ::-webkit-scrollbar-thumb:vertical{border-width:3px 4px 3px 3px}.fd-head-page ::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--fd-text) 40%,var(--fd-surface))}.fd-head-page ::-webkit-scrollbar-button{display:none}.fd-head-page{padding:0;background:var(--fd-surface)}.fd-head{--fd-head-edge: color-mix(in srgb, var(--fd-text) 16.2%, var(--fd-surface));--fd-head-pill: color-mix(in srgb, var(--fd-text) 8.7%, var(--fd-surface));--fd-head-pressed: color-mix(in srgb, var(--fd-text) 19.7%, var(--fd-surface));--fd-head-fill: var(--fd-fill, color-mix(in srgb, var(--fd-text) 5.7%, var(--fd-surface)));--fd-head-icon: color-mix(in srgb, var(--fd-text) 79%, var(--fd-surface));--fd-head-link: var(--fd-link, var(--fd-accent));--fd-control-height: 32px;container:fd-head / inline-size;position:relative;background:var(--fd-surface);color:var(--fd-text);font-size:14px}.fd-head-top{position:relative;padding-block-end:6px}.fd-head-strip{position:absolute;inset-block:0;inset-inline-start:0;width:10px;background:var(--fd-kind, transparent)}.fd-head:not([data-kind]) .fd-head-strip{display:none}.fd-head-badge-row{display:flex;align-items:center;justify-content:space-between;gap:8px;height:42px;padding-inline:20px 4px}.fd-head-badge{display:inline-flex;align-items:center;gap:7px;font-size:12px;line-height:16px;color:var(--fd-head-link);white-space:nowrap}.fd-head-badge-icon{display:inline-grid;color:var(--fd-kind, var(--fd-head-link))}.fd-head-badge-icon .fd-icon{width:14px;height:14px;margin:0;margin-inline-start:-2px;stroke-width:2.2}.fd-head-window{display:inline-flex;align-items:center;gap:3px;margin-inline-start:auto}.fd-head-title{display:flex;align-items:center;min-height:32px;margin-block-start:1px;padding-inline:19px 8px}.fd-head-number{flex:none;min-inline-size:40px;margin-inline-end:5px;font-size:18px;line-height:24px;color:color-mix(in srgb,var(--fd-text) 85%,#000);font-variant-numeric:tabular-nums}.fd-form .fd-head-title>.fd-field{flex:1 1 auto;min-width:0;display:block}.fd-form .fd-head-title>.fd-title-side{flex:none}.fd-form .fd-head-title>.fd-field>.fd-input{width:100%;height:32px;font-size:18px;padding-inline:11px;color:var(--fd-text)}.fd-head-copy{flex:none;display:inline-grid;place-items:center;width:34px;height:32px;padding:0;border:0;border-radius:2px;background:var(--fd-head-fill);color:var(--fd-head-icon);cursor:pointer;visibility:hidden}.fd-head-copy .fd-icon{width:16px;height:16px;margin:0}.fd-head-title:focus-within>.fd-head-copy{visibility:visible}@media(hover:hover){.fd-head-title:hover>.fd-head-copy{visibility:visible}}@media(hover:none){.fd-head-copy{visibility:visible}}.fd-head-copy:hover{background:var(--fd-head-pressed)}.fd-head-row{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;min-height:32px;margin-block-start:9px;padding-inline:21px 6px}.fd-head-meta{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 auto}.fd-form .fd-head-meta>.fd-field{flex:0 1 269px;min-width:0}.fd-form .fd-head-meta>.fd-field:is([data-type=many2many],[data-widget=tags]){flex:0 1 auto}.fd-form .fd-head-meta .fd-field[data-quiet] .fd-tags:has(>.fd-tags-adder:not([hidden])){padding-inline:0}.fd-head-link{display:inline-flex;align-items:center;gap:2px;padding:0 2px;border:0;background:none;cursor:pointer;font:inherit;font-size:14px;color:var(--fd-head-link);white-space:nowrap;border-radius:2px}.fd-head-link .fd-icon{width:16px;height:16px;margin:0}.fd-head-link:has(>.fd-icon:first-child){padding-inline-start:0}button.fd-head-link:hover .fd-head-link-words{text-decoration:underline}span.fd-head-link{cursor:default;color:var(--fd-text)}.fd-head-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:10px;flex:none}.fd-head .fd-button,.fd-split>.fd-button{min-height:32px;height:32px;padding:0 12px;gap:10px;border:0;border-radius:2px;font-size:14px;font-weight:600;white-space:nowrap}.fd-head .fd-button .fd-icon,.fd-split>.fd-button .fd-icon{width:16px;height:16px;margin:0;flex:none}.fd-button.fd-button-subtle{background:var(--fd-head-fill, var(--fd-fill, var(--fd-page)));color:var(--fd-text);border-color:transparent}.fd-button.fd-button-subtle:hover{background:color-mix(in srgb,var(--fd-text) 9%,var(--fd-surface));color:var(--fd-text)}.fd-button.fd-button-subtle[aria-expanded=true],.fd-button.fd-button-subtle:active{background:var(--fd-head-pressed, var(--fd-border))}.fd-head .fd-button-secondary{background:var(--fd-head-fill);color:var(--fd-text)}.fd-head .fd-button-secondary:hover{background:color-mix(in srgb,var(--fd-text) 9%,var(--fd-surface));color:var(--fd-text)}.fd-head .fd-button-primary,.fd-split[data-look=primary]>.fd-button{background:var(--fd-accent);color:var(--fd-accent-text)}.fd-head .fd-button-primary:hover{filter:none;background:var(--fd-accent-hover, var(--fd-accent));color:var(--fd-accent-text)}.fd-button.fd-button-icon-only{width:34px;padding:0;justify-content:center}.fd-head .fd-button.fd-button-icon-only:not(.fd-button-primary){background:none;color:var(--fd-head-icon)}.fd-head .fd-button.fd-button-icon-only:not(.fd-button-primary):hover{background:var(--fd-head-fill)}.fd-head .fd-record-actions{position:relative}.fd-head .fd-head-more{width:34px;padding:0;background:none;color:var(--fd-head-icon)}.fd-head .fd-head-more:hover{background:var(--fd-head-fill)}.fd-head .fd-head-more[aria-expanded=true]{background:var(--fd-head-pressed)}.fd-head .fd-button.fd-button-icon-only[data-idle]:not(.fd-button-primary){color:color-mix(in srgb,var(--fd-text) 48%,var(--fd-surface))}.fd-head .fd-icon[data-icon=undo]:dir(rtl){transform:scaleX(-1)}.fd-head .fd-button[aria-pressed=true]:not(.fd-button-primary){color:var(--fd-text)}.fd-split{position:relative;display:inline-flex;align-items:stretch;flex:none}.fd-split>.fd-split-rule{width:1px;background:var(--fd-head-pressed, var(--fd-border))}.fd-split[data-look=primary]>.fd-split-rule{background:color-mix(in srgb,var(--fd-accent-text) 35%,var(--fd-accent))}.fd-split>.fd-button:first-child:not(:last-of-type){border-start-end-radius:0;border-end-end-radius:0}.fd-split>.fd-split-more{padding:0;width:30px;border-start-start-radius:0;border-end-start-radius:0}.fd-split>.fd-split-more:has(>.fd-icon:not([data-icon=chevron-down])){width:34px}.fd-split>.fd-split-more>.fd-icon[data-icon=chevron-down]{width:20px;height:20px;stroke-width:1.3}.fd-split>.fd-split-more>.fd-icon:not([data-icon=chevron-down]){width:13px;height:13px}.fd-split-alone>.fd-button .fd-split-icon{width:14px;height:14px}.fd-split>.fd-button-menu{position:absolute;inset-block-start:calc(100% + 2px);inset-inline-start:0;z-index:40}.fd-split>.fd-button-menu[data-end]{inset-inline-start:auto;inset-inline-end:0}.fd-head-band{display:flex;align-items:stretch;gap:9px;min-height:78px;background:var(--fd-band, color-mix(in srgb, var(--fd-text) 3%, var(--fd-surface)));padding-inline:16px 8px}.fd-head-fields{--fd-head-label: 76px;flex:1 1 auto;min-width:0;display:grid;grid-template-columns:var(--fd-head-tracks, 1fr 1fr);grid-auto-rows:minmax(32px,auto);column-gap:8px;row-gap:1px;align-content:start;padding-block:7px 6px}.fd-form .fd-head-fields>.fd-field[data-labels]{display:grid;grid-template-columns:calc(var(--fd-head-label) - 24px) 24px minmax(0,1fr);align-items:center;gap:0;container-type:normal;min-width:0}.fd-form .fd-head-fields>.fd-field[data-labels]>.fd-label{grid-column:1 / 3;grid-row:1;align-self:center;padding:0;margin:0;font-size:12px;line-height:16px;font-weight:400;color:var(--fd-muted);white-space:nowrap;overflow:hidden;text-overflow:clip}.fd-form .fd-head-fields>.fd-field[data-labels]>:not(.fd-label){grid-column:3}.fd-form .fd-head-fields>.fd-field[data-labels]>.fd-label+*{grid-row:1}.fd-form .fd-head-fields>.fd-field[data-labels]>.fd-lock-wrap{grid-column:2;grid-row:1;justify-self:center;margin:0;margin-inline-start:4px;z-index:1}.fd-form .fd-head-fields>.fd-field[data-labels]>.fd-lock-wrap+*{grid-row:1}.fd-head-fields .fd-lock .fd-icon{width:16px;height:16px}.fd-head-fields .fd-lock{color:var(--fd-text)}.fd-form .fd-head-fields>.fd-field>.fd-read-text{line-height:20px}.fd-form .fd-head :is(input,select).fd-input{box-sizing:border-box;height:32px;min-height:32px}.fd-form .fd-head .fd-field[data-quiet] :is(.fd-input:not(.fd-tags *),.fd-tags,.fd-dot-box){border-radius:2px}.fd-form .fd-head-fields>.fd-field[data-quiet]{--fd-quiet-pad: 11px;font-size:14px}.fd-form .fd-head-fields>.fd-field>.fd-input,.fd-form .fd-head-fields>.fd-field .fd-input{font-size:14px}.fd-form .fd-head-fields .fd-field[data-quiet] .fd-dot-box{box-sizing:border-box;gap:0;padding-inline-start:11px;height:32px;min-height:32px}.fd-form .fd-head-fields .fd-field[data-quiet] .fd-dot-button{width:24px;height:32px;margin-inline:-36px 12px}.fd-form .fd-head-fields .fd-dot-button>.fd-dot{width:10px;height:10px}@media(hover:hover){.fd-form .fd-head .fd-field[data-quiet]>:hover :is(.fd-input:not(.fd-tags *),.fd-tags):not([readonly],:disabled,[contenteditable=false],:focus,:focus-within),.fd-form .fd-head .fd-field[data-quiet]>:is(.fd-input,.fd-tags,.fd-dot-box:not(:has(:disabled))):not([readonly],:disabled,[contenteditable=false],:focus,:focus-within):hover{border-color:var(--fd-border-strong)}}.fd-head-aside{flex:none;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:4px;padding-block-start:4px;min-width:0}.fd-head-updated{font:inherit;font-size:12px;line-height:16px;color:var(--fd-muted);white-space:nowrap;padding:0;border:0;background:none}button.fd-head-updated{cursor:pointer;border-radius:2px}button.fd-head-updated:hover{text-decoration:underline}.fd-head-tabs{display:flex;min-width:0;max-width:100%}.fd-head-tabs .fd-tabbar{min-width:0}.fd-head-tabs .fd-tablist{gap:0;border:0}.fd-head-tabs .fd-tab{position:relative;display:inline-flex;align-items:center;gap:6px;height:36px;margin:0;padding:0 8px;border:1px solid var(--fd-head-edge);border-block-end:0;border-radius:0;background:transparent;font:inherit;font-size:14px;font-weight:400;color:var(--fd-text);white-space:nowrap}.fd-head-tabs .fd-tab:has(>.fd-tab-count){padding-inline-end:8px}.fd-head-tabs .fd-tab .fd-icon{width:16px;height:16px;margin:0}.fd-head-tabs .fd-tab-icon-only>.fd-icon{margin-block-end:3px;stroke-width:1.5}.fd-head-tabs .fd-tab-icon-only>.fd-icon[data-icon=link]{width:14px;height:14px;stroke-width:1.7}.fd-head-tabs .fd-tab-icon-only>.fd-icon[data-icon=attach]:not(:only-child){margin-inline-end:-2px}.fd-head-tabs .fd-tab-icon-only>.fd-icon:only-child{margin-inline:3px}.fd-head-tabs .fd-tab[aria-selected=true]{font-weight:600;color:var(--fd-text);border-color:var(--fd-head-edge)}.fd-head-tabs .fd-tab[aria-selected=true] .fd-icon{stroke-width:2.3}.fd-head-tabs .fd-tab[aria-selected=true]:after{content:\"\";position:absolute;inset-inline:8px;inset-block-end:4px;height:2px;background:var(--fd-accent);border-radius:1px}.fd-head-tabs .fd-tab:has(>.fd-tab-count)[aria-selected=true]:after{inset-inline-end:8px}.fd-head-tabs .fd-tab:hover{background:color-mix(in srgb,var(--fd-text) 4%,transparent)}.fd-tab-count{display:inline-grid;place-items:center;min-width:25px;height:19px;padding:0 6px;border-radius:10px;background:var(--fd-head-pill, var(--fd-accent-soft));font-size:12px;font-weight:600;line-height:19px;color:var(--fd-text)}.fd-tabs:not(.fd-tabs-in-head) .fd-tab-count{margin-inline-start:6px}.fd-head-body{padding:0 12px 12px;background:var(--fd-surface);min-width:0}.fd-head-body>.fd-alert{margin-block:12px 0}.fd-tabs.fd-tabs-in-head>.fd-tabpanel{padding-block:0}.fd-form-dialog[data-headed] .fd-tabs.fd-tabs-in-head>.fd-tabpanel:not(:has(.fd-history)){padding-block-end:30px}.fd-head-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}@media(min-width:1534px){.fd-head-layout:has(>.fd-side){grid-template-columns:minmax(0,1fr) minmax(320px,.6fr)}}.fd-form-dialog .fd-head-layout>.fd-side{display:none}@container fd-head (max-width: 760px){.fd-head-row{flex-wrap:wrap}.fd-head-meta{flex-wrap:wrap;flex-basis:100%}.fd-head-actions{flex:1 1 100%;justify-content:flex-start;gap:8px}.fd-head-band{flex-direction:column;gap:4px;padding-inline:12px 8px}.fd-head-fields{grid-template-columns:minmax(0,1fr);padding-block-end:0}.fd-head-aside{align-items:stretch;padding-block-start:0}.fd-head-updated{align-self:flex-start;white-space:normal;text-align:start}.fd-head-tabs{align-self:flex-start}}`;\n\n/** The sheet in a document, once, in its place among Fieldia's. */\nexport function installHeadStyles(doc: Document): void {\n installPartStyles(doc, 'fieldia-head-styles', HEAD_PART_CSS, PART_RANK.head);\n}\n", "import type { ActionStep, ButtonNode, MenuItem, RunResult } from '@fieldia/core';\nimport { drawIcon } from '@fieldia/widgets';\nimport { nothingToUndo, onlyResets, type ButtonContext } from './button-parts';\nimport { setAttr, setHidden, setText } from './dom';\nimport { installHeadStyles } from './head-styles';\nimport { hotkeyOn } from './hotkeys';\n\n/**\n * A button of the record's head, or one anywhere asking for the same: its\n * icon alone (named by its label, which is its tooltip too); a toggle,\n * pressed while its condition holds and showing its pressed words meanwhile;\n * a split button \u2014 its press, then a chevron (or its own icon, Follow's gear)\n * opening a menu of more; a menu button when it has nothing of its own to\n * run; the primary look while the record has changes, quiet but usable\n * otherwise \u2014 with nothing changed, Save and Close simply closes.\n */\nexport function richButton(context: ButtonContext, node: ButtonNode): HTMLElement {\n const { el, form, labels } = context;\n installHeadStyles(context.doc);\n const own = !!node.steps?.length || node.action !== undefined;\n const menu = node.menu?.length ? node.menu : null;\n const look = () => (node.primaryWhenChanged ? (form.getState().dirty.length ? 'primary' : 'subtle') : node.style ?? 'secondary');\n const words = el('bdi', { class: 'fd-button-words' }, node.label);\n const icon = drawIcon(context.doc, node.icon, context.icons);\n const main = el('button', { type: 'button', class: 'fd-button', 'data-node': menu && own ? undefined : node.id });\n if (icon) main.append(icon);\n if (node.iconOnly) {\n main.classList.add('fd-button-icon-only');\n main.setAttribute('aria-label', node.label);\n main.title = node.label;\n } else main.append(words);\n if (node.hotkey) hotkeyOn(main, node.hotkey, node.label);\n\n /** What a press of the button itself does: its steps and action \u2014 Save and Close with nothing to save only closes. */\n const run = (): Promise<RunResult> => {\n const state = form.getState();\n if (node.primaryWhenChanged && !state.dirty.length && state.recordId != null && node.steps?.some((step) => step.do === 'save')) {\n const steps: ActionStep[] = [...(node.steps ?? []).filter((step) => step.do !== 'save'), ...(node.action !== undefined ? [{ do: 'call' as const, action: node.action, ...(node.params ? { params: node.params } : {}) }] : [])];\n return form.run(steps, { id: node.id });\n }\n return form.runAction(node.id);\n };\n\n if (!menu) {\n main.classList.add(`fd-button-${look()}`);\n main.addEventListener('click', () => {\n if (!nothingToUndo(node, form, context.say, labels)) void context.press(main, run);\n });\n context.watch(() => paint(main));\n return main;\n }\n\n // ---- a menu beside it, or a menu alone ----\n const id = context.uid(`${node.id}-menu`);\n const chevron = drawIcon(context.doc, node.menuIcon ?? 'chevron-down', context.icons);\n const opener = own ? el('button', { type: 'button', class: 'fd-button fd-split-more', id: `${id}-button`, 'aria-haspopup': 'menu', 'aria-expanded': 'false', 'aria-controls': id }) : main;\n // Its own name, never the button's: a reader hears two buttons, not one twice.\n const menuName = node.menuLabel ?? labels.optionsFor.replace('{label}', node.label);\n if (own) {\n opener.setAttribute('aria-label', menuName);\n opener.title = menuName;\n } else {\n opener.id = `${id}-button`;\n for (const [name, value] of Object.entries({ 'aria-haspopup': 'menu', 'aria-expanded': 'false', 'aria-controls': id })) opener.setAttribute(name, value);\n }\n if (chevron) {\n chevron.classList.add('fd-split-icon');\n opener.append(chevron);\n }\n const list = el('div', { class: 'fd-record-menu fd-button-menu', role: 'menu', id, 'aria-labelledby': opener.id, hidden: '' });\n const items = menu.map((item: MenuItem) => {\n const button = el('button', { type: 'button', role: 'menuitem', tabindex: '-1', class: 'fd-record-menu-item', 'data-node': item.id }, ...context.withIcon(item.icon, item.label ?? item.id));\n button.addEventListener('click', () => {\n close(true);\n void context.press(opener, () => form.runAction(item.id));\n });\n return { item, button };\n });\n list.append(...items.map((i) => i.button));\n const parts: HTMLElement[] = own ? [main, el('span', { class: 'fd-split-rule', 'aria-hidden': 'true' }), opener] : [main];\n const box = el('div', { class: `fd-split${own ? '' : ' fd-split-alone'}`, 'data-node': node.id, role: own ? 'group' : undefined, 'aria-label': own ? node.label : undefined }, ...parts, list);\n\n const shown = () => items.filter((i) => !i.button.hidden).map((i) => i.button);\n const outside = (event: Event) => {\n if (!box.contains(event.target as Node)) close(false);\n };\n function open(at: 'first' | 'last') {\n if (!list.hidden) return;\n list.hidden = false;\n // Under the button's start, unless that runs past the window: then from its end.\n list.removeAttribute('data-end');\n const room = list.getBoundingClientRect();\n if (room.right > context.doc.documentElement.clientWidth - 4 || room.left < 4) list.setAttribute('data-end', '');\n opener.setAttribute('aria-expanded', 'true');\n context.doc.addEventListener('pointerdown', outside, true);\n const found = shown();\n (at === 'first' ? found[0] : found[found.length - 1])?.focus();\n }\n function close(refocus: boolean) {\n if (list.hidden) return;\n list.hidden = true;\n opener.setAttribute('aria-expanded', 'false');\n context.doc.removeEventListener('pointerdown', outside, true);\n if (refocus) opener.focus();\n }\n context.cleanups.push(() => context.doc.removeEventListener('pointerdown', outside, true));\n opener.addEventListener('click', () => (list.hidden ? open('first') : close(false)));\n opener.addEventListener('keydown', (event) => {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n event.preventDefault();\n open(event.key === 'ArrowDown' ? 'first' : 'last');\n });\n if (own) {\n main.addEventListener('click', () => {\n if (!nothingToUndo(node, form, context.say, labels)) void context.press(main, run);\n });\n }\n list.addEventListener('keydown', (event) => {\n const found = shown();\n const at = found.indexOf(context.doc.activeElement as HTMLButtonElement);\n const to = ({ ArrowDown: at + 1, ArrowUp: at - 1, Home: 0, End: found.length - 1 } as Record<string, number>)[event.key];\n if (to !== undefined) {\n event.preventDefault();\n found[(to + found.length) % found.length]?.focus();\n } else if (event.key === 'Escape') {\n // Escape closes the menu, not the dialog round the form.\n event.preventDefault();\n event.stopPropagation();\n close(true);\n } else if (event.key === 'Tab') close(false);\n });\n context.watch(() => {\n paint(main);\n if (own) paint(opener);\n box.setAttribute('data-look', look());\n for (const { item, button } of items) setHidden(button, form.node(item.id).invisible);\n // A menu with nothing in it shows no chevron.\n setHidden(opener, !items.some((i) => !i.button.hidden) && own);\n });\n return box;\n\n /**\n * Its look and its words now: primary or quiet, pressed or not, hidden by its condition. Undo with nothing changed is\n * drawn idle, its tooltip saying why, and a press says it too: still a button, never greyed out without a reason.\n */\n function paint(button: HTMLElement) {\n const at = form.node(node.id);\n if (button === main || !own) setHidden(menu ? box : button, at.invisible);\n for (const one of ['primary', 'secondary', 'subtle', 'danger', 'link']) button.classList.toggle(`fd-button-${one}`, one === look());\n if (button === main && onlyResets(node.steps, node.action)) {\n const idle = !form.getState().dirty.length;\n setAttr(main, 'data-idle', idle ? '' : null);\n if (node.iconOnly) main.title = idle ? `${node.label} \u2014 ${labels.nothingChanged}` : node.label;\n }\n if (node.pressed === undefined || button !== main) return;\n const pressed = at.pressed === true;\n setAttr(main, 'aria-pressed', String(pressed));\n const said = pressed && node.pressedLabel ? node.pressedLabel : node.label;\n if (node.iconOnly) {\n setAttr(main, 'aria-label', said);\n main.title = said;\n } else setText(words, said);\n }\n}\n", "import type { SectionNode } from '@fieldia/core';\nimport { drawIcon } from '@fieldia/widgets';\nimport { installGroupStyles } from './group-styles';\nimport type { HeadKit } from './section-head';\n\n/**\n * A group's heading as a work item draws it, with its tools at its end: \u2922 that\n * shows the group alone over the record's body, ^ and \u2304 that fold it, and the\n * tools of a field it holds alone. The head part's (head-part.ts).\n */\n\nconst fill = (template: string, values: Record<string, string>) => template.replace(/\\{(\\w+)\\}/g, (_, key: string) => values[key] ?? '');\n\n/**\n * The heading of a group with tools at its end. `show` folds and unfolds it;\n * the section is marked folded (`fd-section-folded`) and maximised\n * (`data-maximised`) for the stylesheet.\n */\nexport function sectionHeading(kit: HeadKit, node: SectionNode, section: HTMLElement, content: HTMLElement, description: HTMLElement | null, own: HTMLElement[]) {\n const { el, doc, labels } = kit;\n installGroupStyles(doc);\n const title = node.title ?? '';\n const tools = el('span', { class: 'fd-section-tools' });\n const legend = el('legend', { class: 'fd-section-title fd-section-head' }, el('span', { class: 'fd-section-name' }, ...kit.withIcon(node.icon, title)), tools);\n section.setAttribute('data-head', '');\n const icon = (name: string) => drawIcon(doc, name, kit.icons) ?? '';\n const tool = (name: string, words: string) => {\n const button = el('button', { type: 'button', class: 'fd-section-tool', 'data-tool': name, 'aria-label': words, title: words });\n return button;\n };\n\n // \u2922: the group alone over the record's body, until pressed again or Escape.\n let undo: (() => void) | null = null;\n const big = node.maximise ? tool('maximise', fill(labels.maximiseNamed, { name: title })) : null;\n const restore = () => {\n undo?.();\n undo = null;\n if (!big) return;\n big.setAttribute('aria-pressed', 'false');\n big.replaceChildren(icon('maximise'));\n };\n if (big) {\n big.setAttribute('aria-pressed', 'false');\n big.append(icon('maximise'));\n big.addEventListener('click', () => {\n if (undo) return restore();\n undo = maximise(section);\n big.setAttribute('aria-pressed', 'true');\n big.replaceChildren(icon('restore'));\n big.focus();\n });\n section.addEventListener('keydown', (event) => {\n if (event.key !== 'Escape' || !undo || event.defaultPrevented) return;\n event.preventDefault();\n event.stopPropagation();\n restore();\n big.focus();\n });\n tools.append(big);\n }\n\n // ^ and \u2304: the group folded and unfolded from its heading's end.\n let open = node.collapsed !== true;\n const fold = node.collapsible ? tool('fold', '') : null;\n const show = (next: boolean) => {\n open = next;\n if (fold) {\n const words = fill(open ? labels.foldNamed : labels.unfoldNamed, { name: title });\n fold.setAttribute('aria-label', words);\n fold.title = words;\n fold.setAttribute('aria-expanded', String(open));\n fold.replaceChildren(icon(open ? 'chevron-up' : 'chevron-down'));\n }\n content.hidden = !open;\n if (description) description.hidden = !open;\n section.classList.toggle('fd-section-folded', !open);\n if (!open && undo) restore();\n };\n if (fold) {\n fold.setAttribute('aria-controls', content.id);\n fold.addEventListener('click', () => show(!open));\n tools.append(fold);\n }\n // The tools of the field it holds alone, last.\n tools.append(...own);\n show(open);\n return { legend, show, isOpen: () => open };\n}\n\n/**\n * The group alone over the record's body: every part beside it, and beside\n * each part round it up to the body, out of sight; the grids round it give it\n * their whole width. Returns how to put it all back.\n */\nfunction maximise(section: HTMLElement): () => void {\n const host = section.closest<HTMLElement>('.fd-tabpanel') ?? section.closest<HTMLElement>('.fd-content') ?? section.closest<HTMLElement>('.fd-form');\n const unshown: HTMLElement[] = [];\n const grids: HTMLElement[] = [];\n let at: HTMLElement = section;\n while (at !== host && at.parentElement) {\n const parent: HTMLElement = at.parentElement;\n for (const sibling of [...parent.children] as HTMLElement[]) {\n if (sibling === at || sibling.tagName === 'LEGEND' || sibling.hasAttribute('data-unshown')) continue;\n sibling.setAttribute('data-unshown', '');\n unshown.push(sibling);\n }\n if (parent.classList.contains('fd-grid')) {\n parent.setAttribute('data-maximising', '');\n grids.push(parent);\n }\n at = parent;\n }\n section.setAttribute('data-maximised', '');\n section.scrollIntoView?.({ block: 'nearest' });\n return () => {\n for (const part of unshown) part.removeAttribute('data-unshown');\n for (const grid of grids) grid.removeAttribute('data-maximising');\n section.removeAttribute('data-maximised');\n };\n}\n", "import { installPartStyles, PART_RANK } from '@fieldia/widgets';\n\n/**\n * A group drawn as a work item draws one (section-tools.ts): its heading with\n * its tools at the end \u2014 \u2922, ^ and \u2304 \u2014 its fields under it, and the group shown\n * alone over the body. The head part's, put in its place among Fieldia's the\n * first time a page draws such a heading (installPartStyles, PART_RANK.groups).\n */\nexport const GROUP_CSS = /* css */ `.fd-form .fd-section[data-head]{gap:0;--fd-group-inset: 8px}.fd-form .fd-section[data-head]>.fd-section-title{display:flex;align-items:center;float:none;width:100%;box-sizing:border-box;min-height:51px;margin:0;padding:0;border-block-end:1px solid var(--fd-border);font-size:16px;font-weight:600;line-height:22px;color:var(--fd-heading, var(--fd-text));text-transform:none;letter-spacing:0}.fd-form .fd-section[data-head]>.fd-section-title>.fd-section-name{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}.fd-form .fd-section[data-head]>.fd-section-title .fd-icon{margin-inline-end:.4em}.fd-form .fd-section[data-head]>.fd-grid{padding:4px var(--fd-group-inset) 0;row-gap:7px}.fd-form .fd-section[data-head]{--fd-pad-x: 6px;--fd-control-height: 32px}.fd-form .fd-section[data-head]>.fd-grid>.fd-field{gap:0;line-height:20px}.fd-form .fd-section[data-head]>.fd-grid>.fd-field>.fd-label{font-size:12px;line-height:16px;font-weight:400;color:var(--fd-muted)}.fd-form .fd-section[data-head]>.fd-grid>.fd-field:is([data-type=integer],[data-type=float])>input.fd-input{height:22px;min-height:22px;padding-block:0}.fd-form .fd-section[data-head]>.fd-grid>.fd-field .fd-lock{color:var(--fd-text)}.fd-form .fd-section[data-head]>.fd-grid>.fd-field .fd-lock .fd-icon{width:15px;height:15px}.fd-form .fd-section[data-head]>.fd-grid>.fd-field[data-lock-at=value]>.fd-lock-wrap{margin-inline-start:-2px;inset-block-start:-1.5px}.fd-form .fd-grid:has(>.fd-section[data-head]){row-gap:11px}.fd-section-tools{display:flex;align-items:center;gap:2px;margin-inline-start:auto;flex:none;opacity:0;transition:opacity .1s ease}.fd-form .fd-section[data-head]>.fd-section-title .fd-section-tools{align-self:flex-end;margin-block-end:1px;margin-inline-end:-2px}.fd-form .fd-section[data-head]:is(:hover,:focus-within,.fd-section-folded,[data-maximised])>.fd-section-title .fd-section-tools{opacity:1}@media(hover:none){.fd-section-tools{opacity:1}}.fd-section-tool{display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:2px;background:none;color:var(--fd-text);cursor:pointer;font:inherit}.fd-section-tool:hover{background:var(--fd-text-hover)}.fd-section-tool:active{background:var(--fd-text-pressed)}.fd-section-tool:focus-visible{outline:1px solid var(--fd-focus);outline-offset:-1px}.fd-section-tool svg{width:18px;height:18px;stroke-width:1.34}.fd-section-title .fd-section-tools .fd-icon{color:inherit}.fd-form [data-unshown]{display:none!important}.fd-form .fd-grid[data-maximising]{grid-template-columns:minmax(0,1fr)!important}.fd-form .fd-grid[data-maximising]>*{grid-column:1 / -1!important}.fd-form .fd-section[data-maximised]{min-height:60vh}`;\n\n/** The sheet in a document, once, in its place among Fieldia's. */\nexport function installGroupStyles(doc: Document): void {\n installPartStyles(doc, 'fieldia-group-styles', GROUP_CSS, PART_RANK.groups);\n}\n", "import { drawIcon } from '@fieldia/widgets';\n\n/**\n * A dialog's window tools, as a work item's popup has them: \u2922 that fills the\n * window and Restore that puts it back, and a grip that resizes it. The head\n * part's (head-part.ts), with the inset size's and the clear backdrop's rules.\n */\n\n/** How far the grip's arrow keys resize a dialog, in pixels; and the least it is resized to. */\nconst RESIZE_STEP = 16;\nconst LEAST = { width: 320, height: 240 };\n\n/** \u2922: the dialog fills the window, and Restore puts it back where it was, at its size. */\nexport function wireMaximise(box: HTMLElement, button: HTMLElement, labels: { maximise: string; restoreSize: string }, doc: Document) {\n const face = (maximised: boolean) => {\n const name = maximised ? labels.restoreSize : labels.maximise;\n button.setAttribute('aria-label', name);\n button.title = name;\n button.replaceChildren(...[drawIcon(doc, maximised ? 'restore' : 'maximise')].filter((icon): icon is SVGSVGElement => !!icon));\n };\n face(false);\n button.addEventListener('click', () => {\n const maximised = !box.hasAttribute('data-maximised');\n box.toggleAttribute('data-maximised', maximised);\n face(maximised);\n });\n}\n\n/**\n * The grip at the dialog's end-bottom corner: dragged, the corner follows the\n * pointer; focused, the arrow keys move it by 16 pixels \u2014 the way the page\n * reads, so right to left ArrowLeft widens it. The other corner stays put.\n */\nexport function wireGrip(box: HTMLElement, grip: HTMLElement, doc: Document) {\n const view = doc.defaultView as Window;\n const rtl = () => getComputedStyle(box).direction === 'rtl';\n /** Held where it is, at the size it is: its own place from now on, not the window's inset. */\n const hold = () => {\n const at = box.getBoundingClientRect();\n box.setAttribute('data-resized', '');\n box.style.top = `${at.top}px`;\n if (rtl()) {\n box.style.right = `${view.innerWidth - at.right}px`;\n box.style.left = 'auto';\n } else {\n box.style.left = `${at.left}px`;\n box.style.right = 'auto';\n }\n box.style.bottom = 'auto';\n return at;\n };\n const size = (width: number, height: number) => {\n const at = box.getBoundingClientRect();\n const roomX = rtl() ? at.right : view.innerWidth - at.left;\n const roomY = view.innerHeight - at.top;\n box.style.width = `${Math.round(Math.max(LEAST.width, Math.min(width, roomX)))}px`;\n box.style.height = `${Math.round(Math.max(LEAST.height, Math.min(height, roomY)))}px`;\n };\n grip.addEventListener('pointerdown', (event) => {\n if (box.hasAttribute('data-maximised')) return;\n event.preventDefault();\n const start = hold();\n const from = { x: event.clientX, y: event.clientY };\n grip.setPointerCapture?.(event.pointerId);\n const move = (moved: PointerEvent) => size(start.width + (moved.clientX - from.x) * (rtl() ? -1 : 1), start.height + (moved.clientY - from.y));\n const up = () => {\n grip.removeEventListener('pointermove', move);\n grip.removeEventListener('pointerup', up);\n grip.removeEventListener('pointercancel', up);\n };\n grip.addEventListener('pointermove', move);\n grip.addEventListener('pointerup', up);\n grip.addEventListener('pointercancel', up);\n });\n grip.addEventListener('keydown', (event) => {\n const by = { ArrowRight: [1, 0], ArrowLeft: [-1, 0], ArrowDown: [0, 1], ArrowUp: [0, -1] }[event.key];\n if (!by || box.hasAttribute('data-maximised')) return;\n event.preventDefault();\n const start = hold();\n size(start.width + by[0] * RESIZE_STEP * (rtl() ? -1 : 1), start.height + by[1] * RESIZE_STEP);\n });\n}\n"],
5
+ "mappings": ";;mrBAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAA,GAAO,QAAU,UAAU,CAAC,ICA5B,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAA,GAAO,QAAU,UAAU,CAAC,ICA5B,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAA,GAAO,QAAU,UAAU,CAAC,ICA5B,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAA,GAAO,QAAU,UAAU,CAAC,ICA5B,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAAAA,GAAO,QAAU,UAAU,CAAC,ICA5B,IAAAC,GAAA,GAAAC,GAAAD,GAAA,wBAAAE,EAAA,sBAAAC,EAAA,eAAAC,GAAA,eAAAC,GAAA,mBAAAC,GAAA,aAAAC,GAAA,iBAAAC,KCAA,IAAAC,EAAqD,OAErDC,EAAqD,OAGrDC,GA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AAMM,EAAK,CAAE,WAAY,CAAC,EAAG,CAAC,EAAG,UAAW,CAAC,GAAI,CAAC,EAAG,UAAW,CAAC,EAAG,CAAC,EAAG,QAAS,CAAC,EAAG,EAAE,CAAE,EAAEN,EAAM,GAAG,EACpG,GAAI,CAACM,GAAMzB,EAAI,aAAa,gBAAgB,EAAG,OAC/CmB,EAAM,eAAe,EACrB,IAAMC,EAAQR,EAAK,EACnBE,EAAKM,EAAM,MAAQK,EAAG,CAAC,EAAI5B,IAAec,EAAI,EAAI,GAAK,GAAIS,EAAM,OAASK,EAAG,CAAC,EAAI5B,EAAW,CAC/F,CAAC,CACH",
6
+ "names": ["require__", "__commonJSMin", "exports", "module", "require__", "__commonJSMin", "exports", "module", "require__", "__commonJSMin", "exports", "module", "require__", "__commonJSMin", "exports", "module", "require__", "__commonJSMin", "exports", "module", "fieldia_head_exports", "__export", "installGroupStyles", "installHeadStyles", "recordHead", "richButton", "sectionHeading", "wireGrip", "wireMaximise", "import_widgets", "import_dom", "import_record_bar", "import_widgets", "HEAD_PART_CSS", "installHeadStyles", "doc", "recordHead", "context", "el", "form", "page", "sheet", "head", "labels", "doc", "installHeadStyles", "id", "watch", "strip", "badgeWords", "badgeIcon", "badge", "windowSlot", "badgeRow", "top", "title", "line", "numberField", "side", "part", "words", "state", "numberWords", "drawn", "name", "named", "copy", "icon", "copyTitle", "row", "meta", "headLink", "actions", "button", "menu", "updaters", "update", "band", "fields", "tracks", "child", "aside", "updated", "updatedBy", "tabs", "bandBox", "element", "drawnIcon", "now", "kindNow", "kind", "value", "def", "key", "look", "field", "link", "acts", "plural", "reveal", "raw", "count", "form_", "tag", "box", "opens", "who", "at", "when", "shortDate", "clipboard", "pageCopy", "was", "done", "target", "tab", "tabsAround", "root", "search", "nodes", "around", "node", "found", "step", "iso", "locale", "day", "year", "import_widgets", "import_button_parts", "import_dom", "import_hotkeys", "richButton", "context", "node", "el", "form", "labels", "installHeadStyles", "own", "menu", "look", "words", "icon", "main", "run", "state", "step", "steps", "paint", "id", "chevron", "opener", "menuName", "name", "value", "list", "items", "item", "button", "close", "i", "parts", "box", "shown", "outside", "event", "open", "at", "room", "found", "refocus", "to", "one", "idle", "pressed", "said", "import_widgets", "import_widgets", "GROUP_CSS", "installGroupStyles", "doc", "fill", "template", "values", "_", "key", "sectionHeading", "kit", "node", "section", "content", "description", "own", "el", "doc", "labels", "installGroupStyles", "title", "tools", "legend", "icon", "name", "tool", "words", "undo", "big", "restore", "maximise", "event", "open", "fold", "show", "next", "host", "unshown", "grids", "at", "parent", "sibling", "part", "grid", "import_widgets", "RESIZE_STEP", "LEAST", "wireMaximise", "box", "button", "labels", "doc", "face", "maximised", "name", "icon", "wireGrip", "grip", "view", "rtl", "hold", "at", "size", "width", "height", "roomX", "roomY", "event", "start", "from", "move", "moved", "up", "by"]
7
+ }