@tristan2828/ui-foundation 4.136.1 → 4.137.1

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 (165) hide show
  1. package/README.md +7 -6
  2. package/bin/ui-foundation.mjs +1 -1
  3. package/conventions/agents/skills/new-entity/SKILL.md +5 -2
  4. package/conventions/agents/spec-tester.md +3 -3
  5. package/conventions/docs/add-an-entity.md +722 -714
  6. package/conventions/docs/cell-patterns.md +206 -378
  7. package/conventions/docs/column-options.md +6 -12
  8. package/conventions/docs/design-language.md +294 -516
  9. package/conventions/docs/entity-plan-template.md +9 -7
  10. package/conventions/docs/reminders.md +12 -17
  11. package/conventions/docs/timed-screens.md +17 -20
  12. package/dist/components/app/action-error.js +1 -1
  13. package/dist/components/app/action-hint.js +1 -1
  14. package/dist/components/app/app-shell-bottom-bar.js +4 -4
  15. package/dist/components/app/app-shell-nav.d.ts +1 -1
  16. package/dist/components/app/app-shell-nav.js +1 -1
  17. package/dist/components/app/app-shell.d.ts +1 -1
  18. package/dist/components/app/app-shell.js +9 -9
  19. package/dist/components/app/board.d.ts +13 -13
  20. package/dist/components/app/board.js +3 -3
  21. package/dist/components/app/choice-buttons.d.ts +1 -1
  22. package/dist/components/app/data-table-tools.d.ts +3 -3
  23. package/dist/components/app/data-table.d.ts +11 -13
  24. package/dist/components/app/data-table.js +5 -5
  25. package/dist/components/app/date-field.js +1 -1
  26. package/dist/components/app/delete-action.d.ts +1 -1
  27. package/dist/components/app/delete-action.js +4 -4
  28. package/dist/components/app/edit-caret.js +1 -1
  29. package/dist/components/app/edit-in-place-presets.d.ts +4 -4
  30. package/dist/components/app/edit-in-place-store.d.ts +3 -3
  31. package/dist/components/app/edit-in-place-store.js +7 -7
  32. package/dist/components/app/editable-list.js +2 -3
  33. package/dist/components/app/editable-value.d.ts +2 -2
  34. package/dist/components/app/editable-value.js +20 -20
  35. package/dist/components/app/entity-form.js +2 -2
  36. package/dist/components/app/entity-view-facts.d.ts +12 -12
  37. package/dist/components/app/entity-view-facts.js +1 -1
  38. package/dist/components/app/entity-view.d.ts +16 -16
  39. package/dist/components/app/entity-view.js +28 -33
  40. package/dist/components/app/equal-items.js +4 -4
  41. package/dist/components/app/fact-extras.js +5 -5
  42. package/dist/components/app/field-rows.js +5 -5
  43. package/dist/components/app/fill-in-queue.js +2 -3
  44. package/dist/components/app/filter-bar.d.ts +1 -1
  45. package/dist/components/app/filter-date.js +1 -1
  46. package/dist/components/app/filter-name.js +1 -1
  47. package/dist/components/app/form-dialog.js +2 -2
  48. package/dist/components/app/form-leave-guard.js +2 -2
  49. package/dist/components/app/form-section.js +1 -1
  50. package/dist/components/app/icon-action.d.ts +1 -1
  51. package/dist/components/app/icon-action.js +2 -2
  52. package/dist/components/app/image-field.js +0 -1
  53. package/dist/components/app/keep-pencil-room.js +1 -1
  54. package/dist/components/app/key-stats.d.ts +3 -3
  55. package/dist/components/app/line-chart.d.ts +1 -1
  56. package/dist/components/app/line-chart.js +4 -4
  57. package/dist/components/app/list-editor-rows.js +1 -1
  58. package/dist/components/app/list-editor.js +1 -1
  59. package/dist/components/app/list-header.d.ts +6 -6
  60. package/dist/components/app/list-header.js +8 -8
  61. package/dist/components/app/markdown.js +30 -37
  62. package/dist/components/app/milkdown-editor.js +37 -62
  63. package/dist/components/app/module-card.js +6 -7
  64. package/dist/components/app/month-calendar.d.ts +46 -0
  65. package/dist/components/app/month-calendar.js +160 -0
  66. package/dist/components/app/month-day-field.js +0 -1
  67. package/dist/components/app/multi-choice.d.ts +1 -1
  68. package/dist/components/app/multi-choice.js +3 -3
  69. package/dist/components/app/multi-line-chart.js +5 -5
  70. package/dist/components/app/multi-pick.js +9 -10
  71. package/dist/components/app/multi-reference.js +2 -2
  72. package/dist/components/app/notes-outline.js +0 -1
  73. package/dist/components/app/notify.js +2 -2
  74. package/dist/components/app/offline-notice.js +1 -1
  75. package/dist/components/app/option-icon.js +1 -1
  76. package/dist/components/app/option-select.d.ts +1 -1
  77. package/dist/components/app/overview-page.d.ts +2 -2
  78. package/dist/components/app/overview-page.js +1 -1
  79. package/dist/components/app/page-trail-context.js +1 -1
  80. package/dist/components/app/pill-filter.d.ts +2 -2
  81. package/dist/components/app/prose-look.js +1 -1
  82. package/dist/components/app/quick-add-input.js +1 -1
  83. package/dist/components/app/rating-input.js +1 -1
  84. package/dist/components/app/rating-score.js +1 -1
  85. package/dist/components/app/record-dialog.js +25 -40
  86. package/dist/components/app/recurrence-field.js +6 -6
  87. package/dist/components/app/reference-combobox.js +1 -2
  88. package/dist/components/app/rich-text-box-anchor.js +0 -1
  89. package/dist/components/app/rich-text-edges.js +2 -2
  90. package/dist/components/app/rich-text-editor.d.ts +2 -3
  91. package/dist/components/app/rich-text-editor.js +19 -32
  92. package/dist/components/app/rich-text-empty-paragraph.d.ts +6 -7
  93. package/dist/components/app/rich-text-empty-paragraph.js +6 -7
  94. package/dist/components/app/rich-text-floating-toolbar.js +0 -1
  95. package/dist/components/app/rich-text-formats.js +2 -2
  96. package/dist/components/app/rich-text-input-rules.js +1 -2
  97. package/dist/components/app/rich-text-keyboard-bar.js +6 -7
  98. package/dist/components/app/rich-text-node-views.js +1 -2
  99. package/dist/components/app/rich-text-shortcuts.js +8 -8
  100. package/dist/components/app/rich-text-slash-menu.js +4 -6
  101. package/dist/components/app/rich-text-slash.d.ts +2 -2
  102. package/dist/components/app/rich-text-slash.js +2 -2
  103. package/dist/components/app/rich-text-table-grips.d.ts +1 -1
  104. package/dist/components/app/rich-text-table-grips.js +1 -2
  105. package/dist/components/app/rich-text-tasks.d.ts +1 -1
  106. package/dist/components/app/rich-text-tasks.js +1 -1
  107. package/dist/components/app/rich-text-touch.js +1 -1
  108. package/dist/components/app/search-palette.js +1 -2
  109. package/dist/components/app/secondary-filters.js +2 -3
  110. package/dist/components/app/session-view.js +1 -1
  111. package/dist/components/app/stacked-area-chart.js +1 -1
  112. package/dist/components/app/step-track.d.ts +1 -1
  113. package/dist/components/app/step-track.js +3 -3
  114. package/dist/components/app/widget-card.js +26 -30
  115. package/dist/components/app/widget-layout-sheet.js +1 -1
  116. package/dist/components/ui/calendar.js +2 -2
  117. package/dist/components/ui/combobox.d.ts +1 -1
  118. package/dist/components/ui/combobox.js +2 -2
  119. package/dist/components/ui/field.d.ts +1 -1
  120. package/dist/components/ui/field.js +6 -6
  121. package/dist/components/ui/skeleton.js +1 -1
  122. package/dist/components/ui/sonner.js +1 -1
  123. package/dist/components/ui/tabs.js +1 -1
  124. package/dist/error-reporting/reporter.d.ts +1 -1
  125. package/dist/error-reporting/reporter.js +1 -1
  126. package/dist/hooks/table-url-changes.d.ts +2 -2
  127. package/dist/hooks/table-url-changes.js +5 -6
  128. package/dist/hooks/use-action.js +1 -1
  129. package/dist/hooks/use-record-update.js +1 -1
  130. package/dist/hooks/use-table-url-state.d.ts +1 -1
  131. package/dist/hooks/use-table-url-state.js +2 -2
  132. package/dist/index.d.ts +1 -0
  133. package/dist/index.js +3 -2
  134. package/dist/lib/audio-cues.js +2 -2
  135. package/dist/lib/connection.js +1 -1
  136. package/dist/lib/date-filter.js +1 -1
  137. package/dist/lib/entity-view-tab.js +1 -1
  138. package/dist/lib/field-rows.js +2 -2
  139. package/dist/lib/form-errors.d.ts +1 -1
  140. package/dist/lib/form-errors.js +1 -1
  141. package/dist/lib/keep-audio-alive.js +1 -1
  142. package/dist/lib/line-chart-layout.js +4 -4
  143. package/dist/lib/markdown-inline.js +0 -2
  144. package/dist/lib/markdown-merge.js +2 -2
  145. package/dist/lib/markdown-table-widths.js +1 -1
  146. package/dist/lib/markdown-table.js +1 -2
  147. package/dist/lib/markdown-toggle.js +1 -1
  148. package/dist/lib/page-leaving.js +1 -1
  149. package/dist/lib/recurrence-format.d.ts +2 -2
  150. package/dist/lib/recurrence-format.js +1 -1
  151. package/dist/lib/recurrence-phrase.d.ts +1 -1
  152. package/dist/lib/recurrence-phrase.js +2 -2
  153. package/dist/lib/recurrence.d.ts +1 -1
  154. package/dist/lib/recurrence.js +2 -2
  155. package/dist/lib/stale-chunk-reload.js +1 -1
  156. package/dist/lib/status-kinds.d.ts +1 -1
  157. package/dist/lib/status-kinds.js +2 -2
  158. package/dist/mocks/start-worker.js +2 -2
  159. package/dist/routes/login.js +1 -1
  160. package/dist/testing/index.d.ts +7 -4
  161. package/dist/testing/index.js +10 -13
  162. package/package.json +2 -2
  163. package/styles/index.css +4 -4
  164. package/styles/theme.css +14 -20
  165. package/vite/pwa.js +1 -1
@@ -22,15 +22,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  // - Keyboard: the filter box first; Down goes to the chips, Left/Right
23
23
  // (Home/End) move along them, Up goes back to the box, and Space or
24
24
  // Enter toggles a chip.
25
- // - Every multi-pick (4.88, the form standard's F13): the chips wrap at
26
- // every width, under the filter box. Past `limit` options (30) it shows
27
- // the picked ones and the first 30, then "Show all N"; a filter searches
28
- // them all. The options can be the app's list of records (its query's
29
- // rows as `{ id, label }`, `loading` while it loads), so a link to
30
- // several other records uses it too.
31
- // - `onCreate` (4.102): when what's typed names no option, Create "<typed>"
32
- // shows under the chips (Enter in the box does the same when nothing
33
- // matches; Down reaches it when there are no chips). It calls the app's
25
+ // - Every multi-pick: the chips wrap at every width, under the filter box
26
+ // (the form standard). Past `limit` options (30) it shows the picked ones
27
+ // and the first 30, then "Show all N"; a filter searches them all. The
28
+ // options can be the app's list of records (its query's rows as
29
+ // `{ id, label }`, `loading` while it loads), so a link to several other
30
+ // records uses it too.
31
+ // - `onCreate`: when what's typed names no option, Create "<typed>" shows
32
+ // under the chips (Enter in the box does the same when nothing matches;
33
+ // Down reaches it when there are no chips). It calls the app's
34
34
  // `onCreate(name)`: its small create form with the name filled in, or a
35
35
  // save straight away. While that's out the button reads Creating
36
36
  // "<typed>"… (`aria-busy`), the box can't change, and an edit in place
@@ -104,7 +104,6 @@ export function MultiPick({ options, value, onValueChange, onPick, 'aria-label':
104
104
  next.set(option, { ...entry, inFlight });
105
105
  return next;
106
106
  });
107
- // Edited in place: one pick saved on its own.
108
107
  const savePick = (option, picked, save) => {
109
108
  setRefused((current) => without(current, option.id));
110
109
  setPending((current) => new Map(current).set(option.id, { picked, inFlight: (current.get(option.id)?.inFlight ?? 0) + 1 }));
@@ -17,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  // results, its first still highlighted. `searching` says so: Enter
18
18
  // waits rather than picking from the old list (where it could even
19
19
  // remove a pick: the highlighted item may be one already picked).
20
- // - `onCreate` (4.88, F14): Create "<typed>" as the list's last item when
20
+ // - `onCreate`: Create "<typed>" as the list's last item when
21
21
  // what's typed names no option; the app's create form resolves with the
22
22
  // new record, which joins the picks (its name kept here until the app's
23
23
  // lookup has it).
@@ -59,7 +59,7 @@ export function MultiReference({ options, value, onValueChange, getLabel, onSear
59
59
  // with Object.is, so the items must have the value's own shape.
60
60
  items: items, value: value, onValueChange: (next, details) => {
61
61
  // Base UI empties the value on Escape while the list is closed, so
62
- // a second Escape after a pick wiped every chip (issue #123). Escape
62
+ // a second Escape after a pick wiped every chip. Escape
63
63
  // never removes picks here: a chip's remove button, Backspace or
64
64
  // unpicking in the list does. Let the key go on, so a dialog or an
65
65
  // edit in place gets its own Escape.
@@ -17,7 +17,6 @@ import { Button } from '../ui/button.js';
17
17
  import { useFolds } from '../../hooks/fold-store.js';
18
18
  import { usePrefersReducedMotion } from '../../hooks/use-prefers-reduced-motion.js';
19
19
  import { allFoldable, markdownFoldPlan, openTo } from '../../lib/markdown-fold.js';
20
- // Each level's indent, from the highest listed.
21
20
  const INDENT = ['pl-2', 'pl-6', 'pl-10', 'pl-14', 'pl-18', 'pl-22'];
22
21
  // The element showing the heading `id` in the text under `foldKey`.
23
22
  function headingElement(foldKey, id) {
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // The words and the lifetimes of the app's toasts (4.90, the dialogs and
2
+ // The words and the lifetimes of the app's toasts (the dialogs and
3
3
  // feedback standard D5, D6). A toast is for what happened out of sight: a
4
4
  // delete (with Undo), a record made somewhere else, a job that finished
5
5
  // after the page was left. Never after an edit in place, which shows its
6
- // own "Saved" (cell-patterns.md, add-an-entity.md "When a toast shows").
6
+ // own "Saved" (cell-patterns.md, add-an-entity.md "Toasts and feedback").
7
7
  //
8
8
  // - `notify.done("Deleted", "The Long Walk", { undo })`: "Deleted The Long
9
9
  // Walk", the verb first, the same way everywhere, for 4 seconds. With
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // "You're offline" across the top of the app (4.90, the dialogs and
2
+ // "You're offline" across the top of the app (the dialogs and
3
3
  // feedback standard D9), while the server can't be reached: the browser
4
4
  // says it's offline, or a request got no answer at all. Gone as soon as
5
5
  // the browser is back online or any request gets an answer. AppShell
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // An option's icon, shared by ChoiceButtons and OptionSelect (4.109): a
2
+ // An option's icon, shared by ChoiceButtons and OptionSelect: a
3
3
  // status kind's icon in its colour (StatusMark's, lib/status-kinds.ts), or
4
4
  // the option's own icon, uncoloured without a kind. Decorative: the
5
5
  // option's word says it.
@@ -4,7 +4,7 @@ import type { IconComponent } from './icon-component.js';
4
4
  export type OptionSelectOption<T> = {
5
5
  value: T;
6
6
  label: string;
7
- /** A status kind (4.109): its icon, in its colour, before the words, as StatusMark and ChoiceButtons draw it. */
7
+ /** A status kind: its icon, in its colour, before the words, as StatusMark and ChoiceButtons draw it. */
8
8
  kind?: StatusKind;
9
9
  /** An icon before the words; with `kind`, in place of the kind's. Uncoloured without a `kind`. */
10
10
  icon?: IconComponent;
@@ -27,7 +27,7 @@ export type OverviewPart = {
27
27
  error?: AppError | null;
28
28
  onRetry?: () => void;
29
29
  };
30
- /** A page outside the app (4.120), in the overview's Links section. */
30
+ /** A page outside the app, in the overview's Links section. */
31
31
  export type OverviewLink = {
32
32
  label: string;
33
33
  /** The page's address: opened in a new tab. */
@@ -45,7 +45,7 @@ export type OverviewPageProps = {
45
45
  stats?: ReactNode;
46
46
  /** Controls at the title's end. */
47
47
  actions?: ReactNode;
48
- /** Pages outside the app (4.120): one section after the parts, each opening in a new tab. */
48
+ /** Pages outside the app: one section after the parts, each opening in a new tab. */
49
49
  links?: readonly OverviewLink[];
50
50
  /** The links section's heading. Defaults to "Links". */
51
51
  linksTitle?: string;
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
19
19
  // `onRetry` in the card), and `empty` (a part with nothing yet: "Nothing
20
20
  // yet" in the tile, PartEmpty with its one way to start in the card).
21
21
  //
22
- // `links` (4.120) are a short list of pages outside the app (the
22
+ // `links` are a short list of pages outside the app (the
23
23
  // module's account page, a supplier's site): one section after the parts,
24
24
  // titled `linksTitle` ("Links"), each link its label with its icon if it
25
25
  // has one and the external-link mark, opening in a new tab. In a row of
@@ -1,4 +1,4 @@
1
- // The trail in AppShell's bar (#N5): a page names where it is with
1
+ // The trail in AppShell's bar: a page names where it is with
2
2
  // `usePageTrail`, and the shell draws it between the menu button and the
3
3
  // search box. Pages that set none get their nav entry's (navTrail).
4
4
  import { createContext, useContext, useLayoutEffect } from 'react';
@@ -16,8 +16,8 @@ export type PillFilterProps = {
16
16
  };
17
17
  export declare function PillFilter({ label, options, value, onValueChange, allLabel, className }: PillFilterProps): import("react").JSX.Element;
18
18
  /**
19
- * One pill as PillGroup draws it: a PillFilterOption, and for DataTable's
20
- * views (4.127) a count after the label, "Needs a Look · 3".
19
+ * One pill as PillGroup draws it: a PillFilterOption, and, for DataTable's
20
+ * views, a count after the label, "Needs a Look · 3".
21
21
  */
22
22
  export type PillGroupOption = PillFilterOption & {
23
23
  /** The number shown after the label; null, undefined or 0 shows none, past 99 "99+". */
@@ -38,7 +38,7 @@ export const PROSE = {
38
38
  * down while the section shows and right while it's folded.
39
39
  */
40
40
  export const FOLD_BUTTON = '-ml-1 flex h-[1lh] w-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50' +
41
- // On a touch screen, an invisible 40px square round it takes the tap (review F11).
41
+ // On a touch screen, an invisible 40px square round it takes the tap.
42
42
  " relative pointer-coarse:before:absolute pointer-coarse:before:top-1/2 pointer-coarse:before:left-1/2 pointer-coarse:before:size-10 pointer-coarse:before:-translate-1/2 pointer-coarse:before:content-['']";
43
43
  /** A heading with a fold button: the button and the words side by side, the look on both. */
44
44
  export const FOLD_HEADING = 'flex items-start gap-1';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- // A quick add's one line (F1, look I4): what parseQuickAdd reads is
2
+ // A quick add's one line: what parseQuickAdd reads is
3
3
  // marked in the box as you type and shown under it as chips, so a misread
4
4
  // is seen at once. ✕ on a read chip gives its words back to the title
5
5
  // (the "sun" that wasn't Sunday). The app passes its own chips, the ones
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // A score out of a few, set by clicking a star (cell pattern 9, 4.127):
2
+ // A score out of a few, set by clicking a star (cell pattern 9):
3
3
  // RatingScore's glyphs and tokens, as a control. "My Rating" as ★★★★☆,
4
4
  // where a click on the second star makes it 2.
5
5
  //
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // A score out of a few (cell pattern 9, 4.117): `max` stars or hearts,
2
+ // A score out of a few (cell pattern 9): `max` stars or hearts,
3
3
  // the first `value` filled. "My Rating: 4 of 5" as ★★★★☆. The count of
4
4
  // filled glyphs carries the value, so it survives greyscale.
5
5
  //
@@ -28,47 +28,32 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
28
28
  // another page opens the dialog over its own list, at the list's plain
29
29
  // address.
30
30
  //
31
- // A list that isn't the record's parent route (`listPath`, 4.71): the
32
- // list at /things/list, the record at /things/12, siblings. The route the
33
- // two share wraps them, its `list` drawn at `listPath` (whose own route
34
- // has no element) and every other child the record:
31
+ // Variants, all the same route shape:
32
+ // - `listPath`: a list that isn't the record's parent route (the list at
33
+ // /things/list, the record at /things/12). The shared route wraps both,
34
+ // its `list` drawn at `listPath` (whose own route has no element) and
35
+ // every other child the record:
36
+ // `{ path: 'things', element: <RecordDialogRoute list={<ThingsList />} listPath="list" label="Thing" />, children: [{ path: 'list' }, { path: ':id', element: <ThingView /> }] }`
37
+ // - A sub-record over its parent's page: the parent's page is the `list`,
38
+ // the sub-record its child, with `fullPage={false}`, so a reload of
39
+ // /parents/7/children/31 is the dialog over the parent again.
40
+ // - `newPath`: the list's `new` child route (`/widgets/new`) is the create
41
+ // form, drawn as its own FormDialog over the list, always (a form of up
42
+ // to about 8 fields has no page of its own). It has no record dialog
43
+ // round it; FormDialog opens itself from the route's context
44
+ // (useNewRecordDialog), closing goes back as a record's dialog does, and
45
+ // `openRecord` after the save swaps the entry for the new record over
46
+ // the same list.
35
47
  //
36
- // { path: 'things', element: <RecordDialogRoute list={<ThingsList />} listPath="list" label="Thing" />,
37
- // children: [{ path: 'list' }, { path: ':id', element: <ThingView /> }] }
48
+ // The record dialog is 1,120px (DialogContent `size="record"`), so an
49
+ // EntityView with `layout="rail"` keeps its rail beside the main column, as
50
+ // on its page; a narrower screen stacks them.
38
51
  //
39
- // Opened from the list, /things/12 is the dialog over /things/list, and
40
- // closing goes back to it; a deep link is the full page, as above.
41
- //
42
- // A sub-record over its parent's page (4.71) is the same route one level
43
- // down: the parent's page is the `list`, the sub-record its child, and
44
- // `fullPage={false}`, so a reload of /parents/7/children/31 is the dialog
45
- // over the parent again:
46
- //
47
- // { path: 'parents/:id', element: <RecordDialogRoute list={<ParentView />} label="Document" fullPage={false} />,
48
- // children: [{ path: 'children/:childId', element: <ChildView /> }] }
49
- //
50
- // A new record over its list (4.82, `newPath`): the list's `new` child
51
- // route (`/widgets/new`) is the create form, drawn as its own FormDialog
52
- // over the list, always: opened from the list, from anywhere else, or a
53
- // deep link (a form of up to about 8 fields has no page of its own). It
54
- // has no record dialog round it; FormDialog opens itself from the
55
- // route's context (useNewRecordDialog), closing goes back as a record's
56
- // dialog does, and `openRecord` after the save swaps the entry for the new
57
- // record over the same list:
58
- //
59
- // { path: 'widgets', element: <RecordDialogRoute list={<WidgetsTableRoute />} label="Widget" newPath="new" />,
60
- // children: [{ path: 'new', element: <NewWidgetRoute /> }, { path: ':id', element: <WidgetViewRoute /> }] }
61
- //
62
- // The record dialog is 1,120px (DialogContent `size="record"`, 4.82), so
63
- // an EntityView with `layout="rail"` keeps its rail beside the main
64
- // column, as on its page; a narrower screen stacks them.
65
- //
66
- // A tiny record (4.98, record standard 8A: a few fields and no notes)
67
- // opens as a small card instead, `look="card"`: a 420px dialog (a bottom
68
- // sheet on a phone, DialogContent `size="confirm"`) with no bar. The
69
- // record's title, its actions (Delete as an icon), Open full page (an
70
- // icon, when it has a page) and Close share one line, and its facts are
71
- // plain rows under it, with no cards.
52
+ // A tiny record (record standard 8A: a few fields and no notes) opens as a
53
+ // small card instead, `look="card"`: a 420px dialog (a bottom sheet on a
54
+ // phone, DialogContent `size="confirm"`) with no bar. The record's title,
55
+ // its actions (Delete as an icon), Open full page (an icon, when it has a
56
+ // page) and Close share one line, and its facts are plain rows under it.
72
57
  //
73
58
  // Inside, the record's route renders as it always does. EntityView sees
74
59
  // the dialog (useRecordDialog): its heading names the dialog, its back link
@@ -163,7 +148,7 @@ export function RecordDialogRoute({ list, label, className, look = 'record', ful
163
148
  close();
164
149
  }, children: _jsxs(DialogContent, { showCloseButton: false, "aria-labelledby": titleId, "aria-label": label, "data-slot": "record-dialog", size: card ? 'confirm' : 'record', "data-look": look, className: cn('gap-0 overflow-hidden p-0 data-closed:hidden', card && 'flex max-h-[calc(100dvh-2rem)] flex-col', className), children: [!card && (_jsxs("div", { className: cn('flex items-center gap-2 border-b px-2 py-2', fullPage ? 'justify-between' : 'justify-end'), children: [fullPage && (_jsxs(Link, { to: { pathname: location.pathname, search: location.search, hash: location.hash }, replace: true, className: buttonVariants({ variant: 'ghost', size: 'sm' }), children: [_jsx(Maximize2Icon, { "aria-hidden": "true" }), "Open Full Page"] })), _jsxs(DialogClose, { render: _jsx(Button, { variant: "ghost", size: "icon-sm" }), children: [_jsx(XIcon, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })), _jsx("div", { "data-slot": "record-dialog-body", className: cn('min-h-0 overflow-y-auto',
165
150
  // A record's tab bar sticks to the body's top edge, not inside
166
- // its padding (4.101): minus the padding, for EntityView.
151
+ // its padding: minus the padding, for EntityView.
167
152
  card
168
153
  ? 'p-4 pb-[calc(1rem+env(safe-area-inset-bottom))] [--entity-view-sticky-top:-1rem] md:p-5 md:[--entity-view-sticky-top:-1.25rem]'
169
154
  : 'p-4 [--entity-view-sticky-top:-1rem] sm:p-6 sm:[--entity-view-sticky-top:-1.5rem]'), children: _jsx(RecordDialogContext.Provider, { value: dialog, children: open && outlet }) })] }) })] }));
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- // How something repeats (#326): a reminder's or a task's schedule. The
2
+ // How something repeats: a reminder's or a task's schedule. The
3
3
  // value is the contract's `Recurrence` (`lib/recurrence.ts`), or `null`
4
4
  // for none.
5
5
  //
6
6
  // Three parts, one under the other:
7
- // - **Presets**, a row of toggle buttons: Daily, Weekdays, Weekly on Thu,
8
- // Monthly on the 12th, Monthly on the 2nd Thu, Yearly on Nov 12 (each
9
- // from the start day) and Custom. The one the value is stays pressed;
10
- // Custom is pressed for anything else, and moves to the phrase box.
7
+ // - **Presets**, a row of toggle buttons: Daily, Weekdays, Weekly, Monthly
8
+ // (on the day or the nth weekday), Yearly (each from the start day) and
9
+ // Custom. The one the value is stays pressed; Custom is pressed for
10
+ // anything else, and moves to the phrase box.
11
11
  // - **The phrase box**, read as you type (`parseRecurrencePhrase`): "every
12
12
  // 2nd tue at 9am", "every! 3 days", "every jan 1 until mar 1". What it
13
13
  // can't read is said under it, and the field gives `null`, so a form
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
15
15
  // - **The preview**: the rule's label ("Every 2nd Tue at 9:00 AM") and its
16
16
  // next five occurrences, in the rule's zone, or why it can't be read.
17
17
  //
18
- // Two options an app's own records may want (4.114):
18
+ // Two options an app's own records may want:
19
19
  // - `times={false}`, for a record whose times are fields of its own (a
20
20
  // calendar's events): the preview lists dates only ("Tue, Dec 8", from
21
21
  // today on), the label and the box say no times, and typing "at 9am" is
@@ -7,7 +7,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  // `label`, so a pick the current search no longer returns still shows its
8
8
  // name.
9
9
  //
10
- // `onCreate` (4.88, the form standard's F14): when what's typed matches no
10
+ // `onCreate` (the form standard): when what's typed matches no
11
11
  // record's name, Create "<typed>" is the list's last item. Picking it
12
12
  // calls the app's `onCreate(name)`, which opens its small create form (a
13
13
  // FormDialog) with the name filled in and resolves with the new record
@@ -20,7 +20,6 @@ import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem,
20
20
  const NONE = '__none__';
21
21
  /** The Create "<typed>" item. */
22
22
  const CREATE = '__create__';
23
- // How long typing pauses before the search runs.
24
23
  const SEARCH_DELAY_MS = 200;
25
24
  export function ReferenceCombobox({ id, value, onValueChange, search, label, required = false, emptyLabel = 'Not set', placeholder = 'Search', emptyText = 'No matches.', onCreate, readOnly = false, defaultOpen = false, invalid = false, ...aria }) {
26
25
  const [text, setText] = useState('');
@@ -1,4 +1,3 @@
1
- // A box's place: a point in the text.
2
1
  export function anchorAt(view, pos) {
3
2
  const point = view.coordsAtPos(pos);
4
3
  return {
@@ -1,4 +1,4 @@
1
- // The note's two edges (4.126, the RichTextEditor review's F10): a code
1
+ // The note's two edges: a code
2
2
  // block, a table, a quote, a callout or a divider that ends a note had no
3
3
  // way past it (Ctrl+Enter, shown nowhere, and none on a phone), and one
4
4
  // that starts it nothing above it.
@@ -10,7 +10,7 @@
10
10
  // a short note) puts the caret on a line under it: a new one, unless the
11
11
  // last block is already a paragraph. A click above the first block, a
12
12
  // line above it when that block isn't one.
13
- // - Ticking a task's box keeps focus in the text (the review's F24), so
13
+ // - Ticking a task's box keeps focus in the text, so
14
14
  // Ctrl+Z takes the tick back: from outside, the caret lands in that item.
15
15
  // No trailing-paragraph rule: a note isn't given a line nobody typed, so
16
16
  // nothing is saved until one is asked for. And no gap cursor, which can't
@@ -60,9 +60,8 @@ export type RichTextEditorProps = {
60
60
  * Images uploaded into the text: pasted, dropped, or picked with an
61
61
  * Image button (on the fixed toolbar; with `toolbar="floating"`, on the
62
62
  * "Editor tools" strip shown while the field has focus; on a phone, in
63
- * the row pinned to the keyboard) or the slash menu's Image ("/image",
64
- * 4.123). Each file goes through this (the
65
- * app's own storage: the package knows no endpoint) and goes in as
63
+ * the row pinned to the keyboard) or the slash menu's Image ("/image"). Each file goes
64
+ * through this (the app's own storage: the package knows no endpoint) and goes in as
66
65
  * `![](url)`, from the result's `url`, else its `thumbUrl`. A
67
66
  * placeholder shows where it will go while it uploads (it isn't saved);
68
67
  * a refused file or a failed upload takes it away and says why in a
@@ -11,42 +11,29 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
11
11
  // stays on screen, nothing is saved in its place), the editor marks itself
12
12
  // invalid, and `onProblem` says why; with no `onProblem`, the editor says
13
13
  // it itself, inside the field. A form gives `onProblem` and holds its
14
- // submit on it (add-an-entity.md "The form"), or Save would send the last
14
+ // submit on it (add-an-entity.md "Forms"), or Save would send the last
15
15
  // text that could be saved and say it worked.
16
16
  //
17
17
  // Raw HTML in the text shows as its characters, as <Markdown> shows it,
18
18
  // and nothing pasted or typed can add markup.
19
19
  //
20
- // Headings in the text sit under the page's outline (`headingLevel`, from
21
- // <h3> by default), as <Markdown>'s do. A table wider than the field
22
- // scrolls sideways, and while it does, its box is a tab stop the arrow
23
- // keys scroll.
24
- //
25
- // Images in the text (`![alt](url)`) show, at most the field's width.
26
- // With `upload`, an image pasted, dropped or picked with an Image button
27
- // (the fixed toolbar's, or the tools strip's with `toolbar="floating"`) is
28
- // uploaded through the app's own storage and goes in as
29
- // `![](url)`; while it uploads, a placeholder shows where it will go.
30
- //
31
- // A table's columns fit their words. Grips on its column and row (or a
32
- // right-click, or Shift+F10, in a cell) open menus to insert, move,
33
- // delete, align, sort and colour; a header column and cell colours are
34
- // kept as Markdown already writes them (src/lib/markdown-table.ts).
35
- // `tableLook` picks compact (the default) or boxed, as on <Markdown>.
36
- //
37
- // With `foldKey`, the text folds by its toggle headings (NotesOutline
38
- // lists every heading beside it), the Markdown untouched. A toggle heading
20
+ // Headings, tables, page links, `foldKey` and `tableLook` follow
21
+ // <Markdown>'s (`headingLevel`, from <h3> by default; a table wider than
22
+ // the field scrolls in a tab stop the arrow keys scroll). Grips on a
23
+ // table's column and row (or a right-click, or Shift+F10, in a cell) open
24
+ // menus to insert, move, delete, align, sort and colour. A toggle heading
39
25
  // is `## Safety {toggle="true"}` in the Markdown: typed as `>## `, picked
40
- // from the slash menu (Toggle heading 1 to 3) or made from the heading the
41
- // caret is in with the toolbar's Toggle heading. Plain is the default.
26
+ // from the slash menu or made with the toolbar's Toggle heading.
27
+ //
28
+ // Images in the text (`![alt](url)`) show, at most the field's width. With
29
+ // `upload`, an image pasted, dropped or picked with an Image button is
30
+ // uploaded through the app's own storage and goes in as `![](url)`; while
31
+ // it uploads, a placeholder shows where it will go.
42
32
  //
43
- // With `pageLink`, links the app marks as its pages (src/lib/page-link.ts)
44
- // draw as page links, as on <Markdown>: the page icon, a row of their own
45
- // when alone in a paragraph, "Page removed" with Restore. A click opens the
46
- // page in this tab. With `onCreatePage`, "/page" (or Turn into page on
47
- // selected words) asks for a title, has the app make the page, and puts
48
- // in `[title](href)`. Pages may nest to any depth: a page's own note takes
49
- // the same props. The Markdown stays plain links.
33
+ // With `onCreatePage`, "/page" (or Turn into page on selected words) asks
34
+ // for a title, has the app make the page, and puts in `[title](href)`.
35
+ // Pages may nest to any depth: a page's own note takes the same props.
36
+ // The Markdown stays plain links.
50
37
  //
51
38
  // `defaultValue` is read when it mounts, then followed: a new value the
52
39
  // editor didn't report itself (a form's loaded record arriving after the
@@ -56,8 +43,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
56
43
  //
57
44
  // The editor (Milkdown) is loaded on first use, so a page that only reads
58
45
  // Markdown never downloads it. Until it arrives the text shows as
59
- // <Markdown> draws it (4.123), the field's size, so nothing moves when the
60
- // editor takes its place; an empty one shows skeleton lines.
46
+ // <Markdown> draws it, the field's size, so nothing moves when the editor
47
+ // takes its place; an empty one shows skeleton lines.
61
48
  import { lazy, Suspense, useLayoutEffect, useRef, useState } from 'react';
62
49
  import { cn } from 'cn';
63
50
  import { Skeleton } from '../ui/skeleton.js';
@@ -83,7 +70,7 @@ function useOpenings(defaultValue) {
83
70
  export function RichTextEditor(props) {
84
71
  const { opening, report } = useOpenings(props.defaultValue);
85
72
  const { onChange } = props;
86
- // The editor reports what was typed as it unmounts (F6); one replaced
73
+ // The editor reports what was typed as it unmounts; one replaced
87
74
  // by a new value (a reset) has nothing left to say.
88
75
  const live = useRef(opening);
89
76
  useLayoutEffect(() => {
@@ -6,13 +6,12 @@ import type { NodeSchema } from '@milkdown/kit/transformer';
6
6
  * and closes the node with nothing in it, and its serializer then leaves
7
7
  * `children` out. mdast says a paragraph always has the array, and
8
8
  * mdast-util-gfm-task-list-item 2.0.1 reads its length: an empty task item
9
- * ("- [ ] ", Enter at a list's end) threw there, and the edit was never
10
- * saved.
9
+ * ("- [ ] ", Enter at a list's end) would throw there and the edit would
10
+ * never be saved.
11
11
  *
12
- * And a paragraph's spaces at its end are left out (4.126, the
13
- * RichTextEditor review's F22). Markdown drops them on reading, so a pause
14
- * after a space saved a note that read back without it (and remark-stringify
15
- * sometimes wrote it as `&#x20;`). A hard break's spaces aren't these: it is
16
- * a node of its own.
12
+ * And a paragraph's spaces at its end are left out: Markdown drops them on
13
+ * reading, so a pause after a space would save a note that reads back
14
+ * without it, and remark-stringify sometimes writes it as `&#x20;`. A hard
15
+ * break's spaces aren't these: it is a node of its own.
17
16
  */
18
17
  export declare function withEmptyParagraphChildren<Ctx>(previous: (ctx: Ctx) => NodeSchema): (ctx: Ctx) => NodeSchema;
@@ -5,14 +5,13 @@
5
5
  * and closes the node with nothing in it, and its serializer then leaves
6
6
  * `children` out. mdast says a paragraph always has the array, and
7
7
  * mdast-util-gfm-task-list-item 2.0.1 reads its length: an empty task item
8
- * ("- [ ] ", Enter at a list's end) threw there, and the edit was never
9
- * saved.
8
+ * ("- [ ] ", Enter at a list's end) would throw there and the edit would
9
+ * never be saved.
10
10
  *
11
- * And a paragraph's spaces at its end are left out (4.126, the
12
- * RichTextEditor review's F22). Markdown drops them on reading, so a pause
13
- * after a space saved a note that read back without it (and remark-stringify
14
- * sometimes wrote it as `&#x20;`). A hard break's spaces aren't these: it is
15
- * a node of its own.
11
+ * And a paragraph's spaces at its end are left out: Markdown drops them on
12
+ * reading, so a pause after a space would save a note that reads back
13
+ * without it, and remark-stringify sometimes writes it as `&#x20;`. A hard
14
+ * break's spaces aren't these: it is a node of its own.
16
15
  */
17
16
  export function withEmptyParagraphChildren(previous) {
18
17
  return (ctx) => {
@@ -24,7 +24,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { useLayoutEffect, useState } from 'react';
25
25
  import { cn } from 'cn';
26
26
  import { FormatButtons } from './rich-text-toolbar.js';
27
- // Its gap from the words.
28
27
  const GAP = 8;
29
28
  // The selection's box on screen: the words themselves on one line, the
30
29
  // text's width over several.
@@ -253,7 +253,7 @@ export function toggleFormat(state, dispatch, id) {
253
253
  return true;
254
254
  };
255
255
  // A heading or a code block is made a plain line first: a list
256
- // item starts with one (Ctrl+Shift+5 on a heading, the review's F24).
256
+ // item starts with one (Ctrl+Shift+5 on a heading).
257
257
  const parent = state.selection.$from.parent;
258
258
  if (parent.type !== paragraph && parent.isTextblock)
259
259
  return chain(state, dispatch, [setBlockType(paragraph), toList]);
@@ -285,7 +285,7 @@ function chain(state, dispatch, commands) {
285
285
  }
286
286
  // `command` on the caret's line once it's out of every list it's in: a
287
287
  // list item's line can't be a heading or a code block (Ctrl+Shift+1 on an
288
- // item, the review's F24).
288
+ // item).
289
289
  function outOfLists(state, dispatch, command) {
290
290
  if (!ancestor(state, isList))
291
291
  return command(state, dispatch);
@@ -1,6 +1,5 @@
1
1
  // The rich-text editor's typed Markdown: Milkdown's input rules, three of
2
- // them swapped for the editor's own (4.126, the RichTextEditor review's
3
- // F15, F16 and F22).
2
+ // them swapped for the editor's own:
4
3
  // - `---` (or `***`, `___` and a space) on an empty line puts in a divider
5
4
  // the way the Divider button does: a line under it, the caret there.
6
5
  // Milkdown's left the rule selected, and the next key replaced it.
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- // The rich-text editor's toolbar on a touch screen (review F11, picked
3
- // 2026-11-18 as 1A and 4A): a short row pinned to the top of the phone's
4
- // keyboard, in place of the rows above the text, which scroll away and
2
+ // The rich-text editor's toolbar on a touch screen: a short row pinned to the top of the
3
+ // phone's keyboard, in place of the rows above the text, which scroll away and
5
4
  // take a third of what's left of the note while the keyboard is open.
6
5
  //
7
6
  // - Shown while the field has focus (or is full screen), on a coarse
@@ -19,7 +18,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
19
18
  // the keyboard button in its place brings the keyboard back. Focus stays
20
19
  // in the text the whole time (`inputmode="none"` hides the keyboard), so
21
20
  // the selection and the caret are kept.
22
- // - Its buttons are 40px (the review's floor), on semantic tokens only.
21
+ // - Its buttons are 40px, on semantic tokens only.
23
22
  //
24
23
  // Placed inside the field's element, not in a portal, like the floating
25
24
  // toolbar (rich-text-floating-toolbar.tsx says why): `position: fixed`,
@@ -139,8 +138,8 @@ export function RichTextKeyboardBar({ view, state, readOnly, controls, onFormat,
139
138
  }, [panel, view]);
140
139
  // The caret stays in sight above the bar (and the panel): the browser
141
140
  // keeps it above the keyboard only. Checked on each edit and caret move
142
- // in the text itself, as `state` only follows what the bar draws (F6:
143
- // typing doesn't re-render it).
141
+ // in the text itself, as `state` only follows what the bar draws (typing
142
+ // doesn't re-render it).
144
143
  useLayoutEffect(() => {
145
144
  if (!edge || !ready)
146
145
  return;
@@ -196,7 +195,7 @@ export function RichTextKeyboardBar({ view, state, readOnly, controls, onFormat,
196
195
  virtualKeyboard()?.show();
197
196
  view.focus();
198
197
  }, children: panel ? _jsx(KeyboardIcon, { "aria-hidden": "true" }) : 'Aa' }), _jsx(Separator, { orientation: "vertical", className: "mx-1 h-6 data-vertical:self-center" }), _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]", children: [_jsx(FormatButtons, { formats: words ? 'keyboardWords' : 'keyboard', state: state, readOnly: readOnly, onFormat: onFormat, text: text, touch: true }), !words && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "icon-lg", "aria-label": "Insert Block", disabled: readOnly || inCode, className: "[&_svg]:size-5", onMouseDown: keep, onClick: () => insertBlock(view), children: _jsx(PlusIcon, { "aria-hidden": "true" }) }), onImage && (_jsx(Button, { variant: "ghost", size: "icon-lg", "aria-label": "Image", disabled: readOnly, className: "[&_svg]:size-5", onMouseDown: keep, onClick: onImage, children: _jsx(ImageIcon, { "aria-hidden": "true" }) })), _jsx(Button, { variant: "ghost", size: "icon-lg", "aria-label": "Undo",
199
- // Always on: `state` doesn't follow typing (F6), and with nothing
198
+ // Always on: `state` doesn't follow typing, and with nothing
200
199
  // to undo it does nothing.
201
200
  disabled: readOnly, className: "[&_svg]:size-5", onMouseDown: keep, onClick: press(() => undo(view.state, view.dispatch)), children: _jsx(Undo2Icon, { "aria-hidden": "true" }) })] }))] }), _jsx(Button, { variant: "ghost", size: "icon-lg", "aria-label": "Hide Keyboard", className: "[&_svg]:size-5", onMouseDown: keep, onClick: () => {
202
201
  setPanel(false);
@@ -59,7 +59,6 @@ function columnsOf(node) {
59
59
  header.forEach((cell) => columns.push(cell.textContent));
60
60
  return columns;
61
61
  }
62
- // How far an arrow key scrolls the table's box.
63
62
  const SCROLL_STEP = 40;
64
63
  // The keys a focused table box takes: the arrow keys, Home and End scroll
65
64
  // it, as a box that isn't editable scrolls by itself, and any other plain
@@ -98,7 +97,7 @@ export function tableView(node, view, getPos, registry) {
98
97
  const dom = document.createElement('div');
99
98
  dom.dataset.slot = 'rich-text-table';
100
99
  // As wide as the table (its columns fit their words), never wider than the text.
101
- // On a touch screen, room above for the column grip's tap area (review F11).
100
+ // On a touch screen, room above for the column grip's tap area.
102
101
  dom.className = 'group/table relative grid w-fit max-w-full grid-cols-[minmax(0,auto)_auto] gap-1 pointer-coarse:pt-3';
103
102
  const scroll = document.createElement('div');
104
103
  // Its look: styles/index.css "Tables in written text".