viewkitjs 0.37.0 → 0.39.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 (220) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/MIGRATION.md +7 -0
  3. package/fields/dist/query/figure-kinds.d.ts +2 -2
  4. package/fields/dist/query/figure-kinds.js +3 -0
  5. package/fields/dist/query/figures.d.ts +5 -3
  6. package/fields/dist/query/figures.js +13 -0
  7. package/fields/docs/reference/query.md +3 -3
  8. package/package.json +1 -1
  9. package/postgres/docs/guides/field-map.md +1 -1
  10. package/views/dist/atoms/HeaderChrome.d.ts +7 -0
  11. package/views/dist/atoms/HeaderChrome.js +15 -0
  12. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  13. package/views/dist/atoms/ToolbarButton.js +2 -2
  14. package/views/dist/atoms/defaults.js +4 -0
  15. package/views/dist/atoms/types.d.ts +39 -2
  16. package/views/dist/contract.d.ts +25 -11
  17. package/views/dist/contract.js +41 -6
  18. package/views/dist/controls/field/looks.d.ts +1 -1
  19. package/views/dist/controls/field/looks.js +9 -3
  20. package/views/dist/controls/field/tokens.d.ts +4 -0
  21. package/views/dist/controls/field/tokens.js +1 -0
  22. package/views/dist/controls/field.css +93 -1
  23. package/views/dist/controls/filter-editor/block.d.ts +3 -1
  24. package/views/dist/controls/filter-editor/block.js +4 -3
  25. package/views/dist/controls/filter-editor/filter-editor.d.ts +13 -2
  26. package/views/dist/controls/filter-editor/filter-editor.js +45 -15
  27. package/views/dist/controls/filter-editor/how.d.ts +3 -1
  28. package/views/dist/controls/filter-editor/map-filter-body.js +5 -4
  29. package/views/dist/controls/filter-editor/map-rules.d.ts +2 -1
  30. package/views/dist/controls/filter-editor/map-rules.js +3 -3
  31. package/views/dist/controls/glyphs/glyphs.js +2 -0
  32. package/views/dist/controls/inline-input.css +3 -2
  33. package/views/dist/controls/internal/menu-items.d.ts +2 -0
  34. package/views/dist/controls/internal/menu-items.js +1 -1
  35. package/views/dist/controls/internal/part-slot.d.ts +1 -1
  36. package/views/dist/controls/internal/part-slot.js +1 -1
  37. package/views/dist/controls/internal/read-token.d.ts +2 -1
  38. package/views/dist/controls/internal/read-token.js +2 -1
  39. package/views/dist/controls/internal/row-actions.d.ts +33 -0
  40. package/views/dist/controls/internal/row-actions.js +28 -0
  41. package/views/dist/controls/menu/map-menu.js +1 -1
  42. package/views/dist/controls/number-editor/tokens.d.ts +8 -0
  43. package/views/dist/controls/number-editor/tokens.js +2 -0
  44. package/views/dist/controls/number-editor.css +20 -0
  45. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  46. package/views/dist/controls/popover/map-popover.js +2 -2
  47. package/views/dist/controls/sheet/map-sheet.js +9 -6
  48. package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
  49. package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
  50. package/views/dist/controls/sort-editor/sort-editor.js +41 -13
  51. package/views/dist/controls/text-editor/tokens.d.ts +8 -0
  52. package/views/dist/controls/text-editor/tokens.js +2 -0
  53. package/views/dist/controls/text-editor.css +44 -2
  54. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +1 -1
  55. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +2 -2
  56. package/views/dist/controls/tooltip/tooltip.js +2 -1
  57. package/views/dist/editors/EditorPanel.js +1 -1
  58. package/views/dist/field-row/FieldRow.js +46 -15
  59. package/views/dist/field-row/editors/RowChipsEditor.js +3 -1
  60. package/views/dist/field-row/editors/RowDateEditor.js +3 -1
  61. package/views/dist/field-row/editors/RowNameEditor.js +3 -1
  62. package/views/dist/field-row/editors/RowPlaceEditor.js +4 -2
  63. package/views/dist/field-row/editors/RowRangeEditor.js +3 -1
  64. package/views/dist/field-row/editors/RowRelationEditor.js +5 -2
  65. package/views/dist/field-row/editors/RowSelectEditor.js +3 -1
  66. package/views/dist/field-row/editors/RowTextEditor.d.ts +7 -1
  67. package/views/dist/field-row/editors/RowTextEditor.js +25 -4
  68. package/views/dist/field-row/editors/RowValueListEditor.js +4 -4
  69. package/views/dist/field-row/editors/row-place.d.ts +33 -0
  70. package/views/dist/field-row/editors/row-place.js +141 -0
  71. package/views/dist/field-row/field-row-button.d.ts +21 -6
  72. package/views/dist/field-row/field-row-button.js +8 -3
  73. package/views/dist/field-row/row-target.d.ts +4 -1
  74. package/views/dist/field-row/row-target.js +1 -1
  75. package/views/dist/fields/binding.d.ts +4 -0
  76. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +12 -11
  77. package/views/dist/grid/chrome/GridAggregateMenu.js +4 -3
  78. package/views/dist/grid/chrome/GridCellEditors.d.ts +1 -1
  79. package/views/dist/grid/chrome/GridCellOutline.d.ts +13 -1
  80. package/views/dist/grid/chrome/GridCellOutline.js +17 -0
  81. package/views/dist/grid/chrome/GridFooter.d.ts +12 -4
  82. package/views/dist/grid/chrome/GridFooter.js +11 -9
  83. package/views/dist/grid/chrome/GridHeader.js +4 -3
  84. package/views/dist/grid/chrome/GridNumberEditor.js +2 -1
  85. package/views/dist/grid/chrome/GridResizeHandle.d.ts +7 -3
  86. package/views/dist/grid/chrome/GridResizeHandle.js +2 -3
  87. package/views/dist/grid/chrome/GridRowCells.js +1 -1
  88. package/views/dist/grid/chrome/GridStructure.js +3 -3
  89. package/views/dist/grid/chrome/GridTable.js +1 -1
  90. package/views/dist/grid/chrome/GridTableSurface.js +1 -1
  91. package/views/dist/grid/chrome/GridTextEditor.js +3 -1
  92. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -4
  93. package/views/dist/grid/chrome/grid-body-place.js +4 -4
  94. package/views/dist/grid/chrome/grid-edit-session.d.ts +7 -3
  95. package/views/dist/grid/chrome/grid-edit-session.js +12 -3
  96. package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -4
  97. package/views/dist/grid/chrome/grid-figure-value.js +10 -4
  98. package/views/dist/grid/chrome/grid-row-props.d.ts +1 -1
  99. package/views/dist/grid/chrome/grid-table-props.d.ts +11 -3
  100. package/views/dist/grid/chrome/useGridKeyboard.d.ts +5 -1
  101. package/views/dist/grid/chrome/useGridKeyboard.js +9 -5
  102. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  103. package/views/dist/grid/chrome/useGridTableInteractionModel.js +8 -3
  104. package/views/dist/grid/grid.css +7 -3
  105. package/views/dist/internal/length.d.ts +2 -0
  106. package/views/dist/internal/length.js +16 -0
  107. package/views/dist/internal/over-cell.d.ts +8 -0
  108. package/views/dist/internal/over-cell.js +5 -0
  109. package/views/dist/list/bar-keys.d.ts +5 -0
  110. package/views/dist/list/bar-keys.js +2 -0
  111. package/views/dist/list/bar-parts.d.ts +27 -0
  112. package/views/dist/list/bar-parts.js +38 -0
  113. package/views/dist/list/buttons/clear-save.d.ts +7 -0
  114. package/views/dist/list/buttons/clear-save.js +15 -0
  115. package/views/dist/list/buttons/customize.d.ts +28 -0
  116. package/views/dist/list/buttons/customize.js +31 -0
  117. package/views/dist/list/buttons/filter.d.ts +32 -0
  118. package/views/dist/list/buttons/filter.js +60 -0
  119. package/views/dist/list/buttons/new.d.ts +18 -0
  120. package/views/dist/list/buttons/new.js +9 -0
  121. package/views/dist/list/buttons/quick.d.ts +15 -0
  122. package/views/dist/list/buttons/quick.js +24 -0
  123. package/views/dist/list/buttons/search.d.ts +18 -0
  124. package/views/dist/list/buttons/search.js +17 -0
  125. package/views/dist/list/buttons/shared.d.ts +91 -0
  126. package/views/dist/list/buttons/shared.js +131 -0
  127. package/views/dist/list/buttons/sort-filter.d.ts +6 -0
  128. package/views/dist/list/buttons/sort-filter.js +16 -0
  129. package/views/dist/list/buttons/sort.d.ts +17 -0
  130. package/views/dist/list/buttons/sort.js +34 -0
  131. package/views/dist/list/buttons/views.d.ts +21 -0
  132. package/views/dist/list/buttons/views.js +36 -0
  133. package/views/dist/list/editor-menus.d.ts +13 -0
  134. package/views/dist/list/editor-menus.js +13 -0
  135. package/views/dist/list/index.d.ts +41 -0
  136. package/views/dist/list/index.js +19 -0
  137. package/views/dist/list/line.d.ts +55 -0
  138. package/views/dist/list/line.js +221 -0
  139. package/views/dist/list/pane-box.d.ts +6 -0
  140. package/views/dist/list/pane-box.js +15 -0
  141. package/views/dist/list/panels/customize.d.ts +8 -0
  142. package/views/dist/list/panels/customize.js +23 -0
  143. package/views/dist/list/panels/filter-bar.d.ts +12 -0
  144. package/views/dist/list/panels/filter-bar.js +67 -0
  145. package/views/dist/list/panels/filter.d.ts +8 -0
  146. package/views/dist/list/panels/filter.js +23 -0
  147. package/views/dist/list/panels/quick.d.ts +7 -0
  148. package/views/dist/list/panels/quick.js +16 -0
  149. package/views/dist/list/panels/shared.d.ts +25 -0
  150. package/views/dist/list/panels/shared.js +33 -0
  151. package/views/dist/list/panels/sort.d.ts +8 -0
  152. package/views/dist/list/panels/sort.js +19 -0
  153. package/views/dist/list/panels/views.d.ts +13 -0
  154. package/views/dist/list/panels/views.js +27 -0
  155. package/views/dist/list/ready.d.ts +35 -0
  156. package/views/dist/list/ready.js +7 -0
  157. package/views/dist/list/root-base.d.ts +17 -0
  158. package/views/dist/list/root-base.js +9 -1
  159. package/views/dist/list/root.js +2 -2
  160. package/views/dist/list/store.d.ts +19 -0
  161. package/views/dist/list/store.js +40 -1
  162. package/views/dist/list/toolbar-model.d.ts +95 -0
  163. package/views/dist/list/toolbar-model.js +177 -0
  164. package/views/dist/list/toolbar.js +140 -328
  165. package/views/dist/list/views-axis.js +15 -4
  166. package/views/dist/model/aggregates.d.ts +18 -8
  167. package/views/dist/model/aggregates.js +16 -22
  168. package/views/dist/panels/react/filter/FilterEditor.d.ts +3 -1
  169. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  170. package/views/dist/panels/react/filter/filter-body.d.ts +3 -1
  171. package/views/dist/panels/react/filter/filter-body.js +2 -2
  172. package/views/dist/panels/react/sort/SortEditor.d.ts +3 -1
  173. package/views/dist/panels/react/sort/SortEditor.js +4 -4
  174. package/views/dist/panels/react/toolbar/Toolbar.d.ts +80 -3
  175. package/views/dist/panels/react/toolbar/Toolbar.js +85 -52
  176. package/views/dist/panels/react/toolbar/ToolbarBarSorts.d.ts +9 -0
  177. package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +57 -0
  178. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +4 -1
  179. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -2
  180. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +30 -0
  181. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -1
  182. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  183. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  184. package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +7 -1
  185. package/views/dist/panels/react/toolbar/ToolbarViews.js +4 -4
  186. package/views/dist/panels/react/toolbar/sheet-host.d.ts +3 -0
  187. package/views/dist/panels/react/toolbar/sheet-host.js +6 -0
  188. package/views/dist/panels/react/toolbar/use-give-way.d.ts +6 -0
  189. package/views/dist/panels/react/toolbar/use-give-way.js +8 -1
  190. package/views/dist/panels/react/views-row/ViewPicker.d.ts +8 -1
  191. package/views/dist/panels/react/views-row/ViewPicker.js +12 -7
  192. package/views/dist/panels/settings/filter-groups.js +7 -0
  193. package/views/dist/provider/components.d.ts +38 -3
  194. package/views/dist/react.d.ts +1 -1
  195. package/views/dist/selection/bar-overflow.d.ts +2 -0
  196. package/views/dist/selection/bar-overflow.js +2 -1
  197. package/views/dist/selection/bar-props.d.ts +1 -1
  198. package/views/dist/selection/verbs.d.ts +2 -2
  199. package/views/dist/styles.css +268 -5
  200. package/views/dist/styles.unlayered.css +268 -5
  201. package/views/docs/contract.md +29 -15
  202. package/views/docs/controls/field.md +1 -0
  203. package/views/docs/controls/filter-editor.md +1 -1
  204. package/views/docs/controls/menu.md +1 -1
  205. package/views/docs/controls/number-editor.md +2 -0
  206. package/views/docs/controls/sort-editor.md +1 -1
  207. package/views/docs/controls/text-editor.md +2 -0
  208. package/views/docs/guides/atoms.md +1 -0
  209. package/views/docs/guides/selection.md +1 -1
  210. package/views/docs/guides/the-grid.md +3 -3
  211. package/views/docs/reference/controls.md +3 -3
  212. package/views/docs/reference/field-row.md +1 -1
  213. package/views/docs/reference/grid.md +4 -4
  214. package/views/docs/reference/list.md +168 -6
  215. package/views/docs/reference/looks.md +1 -1
  216. package/views/docs/reference/panels-react.md +7 -7
  217. package/views/docs/reference/react.md +13 -10
  218. package/views/docs/reference/selection.md +1 -1
  219. package/views/docs/reference/views.md +9 -7
  220. package/views/skills/views/SKILL.md +2 -1
@@ -0,0 +1,221 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Children, createContext, isValidElement, useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, } from "react";
4
+ import { ToolbarRadioProvider } from "../panels/react/toolbar/context.js";
5
+ import { FoldItem, FoldOverflow, ToolbarSeparator, foldLineMark, useFoldLine, useLineName, } from "../panels/react/toolbar/Toolbar.js";
6
+ import { cx } from "../internal/cx.js";
7
+ export const LineForm = createContext("row");
8
+ export const LinePlace = createContext(null);
9
+ export const LineSeed = createContext(null);
10
+ export const SEED_GAP = "vk-gap";
11
+ const LineChild = createContext(null);
12
+ const LineContext = createContext(null);
13
+ let lastId = 0;
14
+ const nextId = () => `vk-line-item-${++lastId}`;
15
+ const NOTHING_LAID = { start: [], end: [], names: new Map(), order: [], signature: "" };
16
+ const slotOf = (id, meta) => ({
17
+ key: id,
18
+ fill: false,
19
+ ...(meta.shed && { shed: true }),
20
+ ...((meta.tabs ?? 0) > 0 && { tabs: meta.tabs }),
21
+ ...((meta.filters ?? 0) > 0 && { filters: meta.filters }),
22
+ ...(meta.fold && { fold: true }),
23
+ ...(meta.role === "separator" && { separator: true }),
24
+ ...(meta.role === "search" && { search: true }),
25
+ });
26
+ function laidOut(entries, before) {
27
+ const drawn = [...entries]
28
+ .map(([id, entry]) => ({ id, element: entry.element() }))
29
+ .filter((at) => !!at.element?.isConnected)
30
+ .sort((a, b) => (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1))
31
+ .map((at) => at.id);
32
+ const order = [...drawn];
33
+ for (const [i, id] of before.entries()) {
34
+ if (order.includes(id) || !entries.has(id))
35
+ continue;
36
+ const after = before.slice(0, i).reverse().find((prior) => order.includes(prior));
37
+ order.splice(after === undefined ? 0 : order.indexOf(after) + 1, 0, id);
38
+ }
39
+ for (const id of entries.keys())
40
+ if (!order.includes(id))
41
+ order.push(id);
42
+ const gap = order.findIndex((id) => entries.get(id).gap);
43
+ const slots = (ids) => ids.flatMap((id) => {
44
+ const meta = entries.get(id).meta;
45
+ return meta ? [slotOf(id, meta)] : [];
46
+ });
47
+ const start = slots(gap < 0 ? order : order.slice(0, gap));
48
+ const end = gap < 0 ? [] : slots(order.slice(gap + 1));
49
+ const names = new Map(order.flatMap((id) => {
50
+ const meta = entries.get(id).meta;
51
+ return meta ? [[id, meta.key]] : [];
52
+ }));
53
+ return { start, end, names, order, signature: JSON.stringify([start, end, order, [...names]]) };
54
+ }
55
+ function laidOf(seed) {
56
+ const ids = (slots) => slots.map((slot) => slot.key);
57
+ const order = [...ids(seed.start), SEED_GAP, ...ids(seed.end)];
58
+ const names = new Map([...ids(seed.start), ...ids(seed.end)].map((id) => [id, id]));
59
+ return { start: seed.start, end: seed.end, names, order, signature: JSON.stringify([seed.start, seed.end, order, [...names]]) };
60
+ }
61
+ const seededKey = (id) => `.$${id.replace(/[=:]/g, (c) => (c === "=" ? "=0" : "=2"))}`;
62
+ const childKey = (child, i) => (isValidElement(child) && child.key !== null ? String(child.key) : `vk-child-${i}`);
63
+ export function ListLine({ kind = "row", more: reshape, overflow, className, children }) {
64
+ const form = useContext(LineForm);
65
+ const seed = useContext(LineSeed);
66
+ const lineKind = seed?.kind ?? (kind === "bar" ? "bar" : "main");
67
+ const name = useLineName(lineKind);
68
+ const [element, setElement] = useState(null);
69
+ const [entries] = useState(() => new Map());
70
+ const [menus] = useState(() => new Map());
71
+ const [registered, setLaid] = useState(NOTHING_LAID);
72
+ const seeded = useMemo(() => (seed ? laidOf(seed) : null), [seed]);
73
+ const laid = seeded ?? registered;
74
+ const [, setVersion] = useState(0);
75
+ const lastLaid = useRef(NOTHING_LAID);
76
+ const recheck = useRef(() => { });
77
+ const register = useCallback((id, entry) => {
78
+ entries.set(id, entry);
79
+ setVersion((v) => v + 1);
80
+ return () => {
81
+ entries.delete(id);
82
+ menus.delete(id);
83
+ setVersion((v) => v + 1);
84
+ };
85
+ }, [entries, menus]);
86
+ const relayout = useCallback(() => {
87
+ if (seed)
88
+ return;
89
+ const next = laidOut(entries, lastLaid.current.order);
90
+ if (next.signature === lastLaid.current.signature)
91
+ return;
92
+ lastLaid.current = next;
93
+ setLaid(next);
94
+ }, [entries, seed]);
95
+ useLayoutEffect(() => relayout());
96
+ const touch = useCallback(({ grew, renamed }) => {
97
+ if (renamed)
98
+ setVersion((v) => v + 1);
99
+ relayout();
100
+ if (grew)
101
+ recheck.current();
102
+ }, [relayout]);
103
+ const line = { kind: lineKind, start: laid.start, end: laid.end, size: seed?.size ?? (kind === "bar" ? "sm" : "md") };
104
+ const view = useFoldLine(element, line, form);
105
+ useLayoutEffect(() => {
106
+ recheck.current = view.recheck;
107
+ });
108
+ const all = [...laid.start, ...laid.end];
109
+ const kids = Children.toArray(children);
110
+ const keys = kids.map(childKey);
111
+ const afterChild = (() => {
112
+ const at = view.state.moreAfter;
113
+ if (!at)
114
+ return null;
115
+ if (seed && !entries.has(at) && keys.includes(seededKey(at)))
116
+ return seededKey(at);
117
+ const child = entries.get(at)?.child ?? null;
118
+ if (child !== null && keys.includes(child)) {
119
+ const last = [...laid.order].reverse().find((id) => entries.get(id)?.child === child);
120
+ return last === at ? child : null;
121
+ }
122
+ for (const id of laid.order.slice(0, Math.max(0, laid.order.indexOf(at))).reverse()) {
123
+ const earlier = entries.get(id)?.child;
124
+ if (earlier && keys.includes(earlier))
125
+ return earlier;
126
+ }
127
+ return null;
128
+ })();
129
+ const value = {
130
+ register,
131
+ touch,
132
+ menus,
133
+ view,
134
+ slotOf: (id) => all.find((slot) => slot.key === id),
135
+ rows: () => {
136
+ const seen = new Map();
137
+ return all.flatMap((slot) => {
138
+ const menu = view.state.folded.has(slot.key) ? menus.get(slot.key) : undefined;
139
+ if (!menu)
140
+ return [];
141
+ const name = laid.names.get(slot.key) ?? slot.key;
142
+ const nth = (seen.get(name) ?? 0) + 1;
143
+ seen.set(name, nth);
144
+ return [{ ...menu, key: nth > 1 ? `${name}-${nth}` : name, onSelect: () => menus.get(slot.key)?.onSelect() }];
145
+ });
146
+ },
147
+ more: reshape,
148
+ overflow,
149
+ drawsMore: afterChild === null,
150
+ seeded: seed !== null,
151
+ };
152
+ const mark = foldLineMark(lineKind, form, name);
153
+ return (_jsx(ToolbarRadioProvider, { children: _jsx(LineContext.Provider, { value: value, children: _jsx("div", { ref: setElement, ...mark, className: cx(mark.className, className), children: kids.flatMap((kid, i) => [
154
+ _jsx(LineChild.Provider, { value: keys[i], children: _jsx(LineSeed.Provider, { value: null, children: kid }) }, keys[i]),
155
+ ...(keys[i] === afterChild
156
+ ? [_jsx(FoldOverflow, { view: view, rows: value.rows, reshape: reshape, overflow: overflow }, "vk-overflow")]
157
+ : []),
158
+ ]) }) }) }));
159
+ }
160
+ export function LineItem({ item, children }) {
161
+ const around = useContext(LineContext);
162
+ const placed = useContext(LinePlace);
163
+ const line = around && around.seeded && !placed ? null : around;
164
+ const child = useContext(LineChild);
165
+ const [own] = useState(nextId);
166
+ const id = placed?.id ?? own;
167
+ const element = useRef(null);
168
+ const register = line?.register;
169
+ const { tabs, filters, fold, role } = item;
170
+ const key = placed?.id ?? item.key;
171
+ const shed = placed?.shed ?? item.shed;
172
+ const drew = useRef(null);
173
+ useLayoutEffect(() => {
174
+ if (!line)
175
+ return;
176
+ const before = line.menus.get(id);
177
+ line.menus.set(id, item.menu);
178
+ const { state } = line.view;
179
+ const at = [state.iconAlone.has(id), state.tabsFolded.get(id) ?? 0, state.filtersFolded.get(id) ?? 0, state.folded.has(id)].join();
180
+ const el = element.current;
181
+ const width = el && !el.hidden ? el.getBoundingClientRect().width : -1;
182
+ const own = drew.current?.line === line;
183
+ const grew = drew.current !== null && drew.current.at === at && (width < 0 ? own : drew.current.width !== width);
184
+ drew.current = { at, width, line };
185
+ line.touch({ grew, renamed: before !== undefined && before?.label !== item.menu?.label });
186
+ });
187
+ useLayoutEffect(() => register?.(id, {
188
+ element: () => element.current,
189
+ gap: false,
190
+ meta: { key, ...(shed && { shed }), ...(tabs && { tabs }), ...(filters && { filters }), ...(fold && { fold }), ...(role && { role }) },
191
+ child,
192
+ }), [register, id, key, shed, tabs, filters, fold, role, child]);
193
+ if (!line)
194
+ return children;
195
+ return (_jsx(FoldItem, { view: line.view, slot: line.slotOf(id) ?? { key: id, fill: false }, name: key, place: { key, ...placed?.place }, rows: line.rows, reshape: line.more, overflow: line.overflow, more: line.drawsMore, itemRef: element, children: _jsx(LinePlace.Provider, { value: null, children: children }) }));
196
+ }
197
+ export function ListGap(_props) {
198
+ const line = useContext(LineContext);
199
+ const placed = useContext(LinePlace);
200
+ const child = useContext(LineChild);
201
+ const [own] = useState(nextId);
202
+ const id = placed?.id ?? own;
203
+ const element = useRef(null);
204
+ const register = line?.register;
205
+ useLayoutEffect(() => register?.(id, { element: () => element.current, gap: true, meta: null, child }), [register, id, child]);
206
+ if (line?.view.searchTakesLine)
207
+ return null;
208
+ return _jsx("span", { ref: element, "data-toolbar-spacer": true, "aria-hidden": true, className: "min-w-0 flex-1" });
209
+ }
210
+ export function useInLine() {
211
+ const line = useContext(LineContext);
212
+ const placed = useContext(LinePlace);
213
+ return line !== null && !(line.seeded && !placed);
214
+ }
215
+ export function useLineMore() {
216
+ return useContext(LineContext)?.view.more ?? null;
217
+ }
218
+ export function LineSep() {
219
+ return (_jsx(LineItem, { item: SEP_ITEM, children: _jsx(ToolbarSeparator, {}) }));
220
+ }
221
+ const SEP_ITEM = { key: "sep", role: "separator" };
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from "react";
2
+ export type ListPaneBoxProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ };
6
+ export declare function ListPaneBox({ className, children }: ListPaneBoxProps): ReactNode;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useCallback, useContext } from "react";
4
+ import { cx } from "../internal/cx.js";
5
+ import { ListPaneBoxContext } from "./root-base.js";
6
+ export function ListPaneBox({ className, children }) {
7
+ const held = useContext(ListPaneBoxContext);
8
+ if (!held)
9
+ throw new Error("ListPaneBox needs a ListRoot around it");
10
+ return _jsx(PaneBoxOf, { setBox: held.setBox, className: className, children: children });
11
+ }
12
+ function PaneBoxOf({ setBox, className, children }) {
13
+ const ref = useCallback((element) => setBox(element), [setBox]);
14
+ return (_jsx("div", { ref: ref, "data-slot": "vk-list-box", className: cx("relative isolate flex min-h-0 flex-1 flex-col", className), children: children }));
15
+ }
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ListCustomizeProps } from "../buttons/customize.js";
3
+ export type ListCustomizePanelProps = Pick<ListCustomizeProps, "viewName" | "onRenameView" | "onCopyLink" | "onExport" | "exportCount" | "fieldEditor"> & {
4
+ /** When it stands. Default `always`. */
5
+ shows?: "always" | "button";
6
+ className?: string;
7
+ };
8
+ export declare function ListCustomizePanel({ shows, className, viewName, onRenameView, onCopyLink, onExport, exportCount, fieldEditor, }: ListCustomizePanelProps): ReactNode;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { getViewOptionAvailability } from "../../panels/availability.js";
5
+ import { countActiveViewOptions } from "../../panels/model.js";
6
+ import { OptionsBody } from "../../panels/react/toolbar/ToolbarOptions.js";
7
+ import { useViews } from "../../provider/context.js";
8
+ import { useList } from "../root-base.js";
9
+ import { useToolbarModel } from "../toolbar-model.js";
10
+ import { usePartPhone } from "../buttons/shared.js";
11
+ import { PanelFrame, usePanelPlace } from "./shared.js";
12
+ export function ListCustomizePanel({ shows = "always", className, viewName, onRenameView, onCopyLink, onExport, exportCount, fieldEditor, }) {
13
+ const { messages } = useViews();
14
+ const phone = usePartPhone();
15
+ const fielded = useList((s) => s.columns !== null);
16
+ const { inputs, view, layered, clearable, resetAll, resets } = useToolbarModel({ phone, fromRoot: true });
17
+ const [page, setPage] = useState(null);
18
+ const drawn = fielded && getViewOptionAvailability(inputs).desktop;
19
+ const place = usePanelPlace("customize", shows, true, drawn);
20
+ if (!drawn)
21
+ return null;
22
+ return (_jsx(PanelFrame, { place: place, label: messages({ key: "views.panels.toolbar-options" }), head: false, panel: "customize", className: className, children: _jsx(OptionsBody, { ...inputs, page: page, onPageChange: setPage, count: view ? 0 : countActiveViewOptions(inputs), clear: resetAll, close: place.hide, closeButton: place.stands === "shown", fill: true, view: view, viewFoot: view ? undefined : "kit", footClear: clearable ? resetAll : undefined, resets: resets, layered: layered, fieldEditor: fieldEditor, viewName: viewName, onRenameView: onRenameView, onCopyLink: onCopyLink, onExport: onExport, exportCount: exportCount }) }));
23
+ }
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ListPanelShows } from "./shared.js";
3
+ export type ListFilterBarProps = {
4
+ /** When it stands. Default `filled`. */
5
+ shows?: ListPanelShows;
6
+ /** The sort on the bar: `no` (the default), the sort pill while it differs; `yes`, each rule standing, edited in place.
7
+ * Without several sorts, as `no`. */
8
+ sorts?: "no" | "yes";
9
+ /** On its region; in a `ListLine` its pieces stand as the line's items, with no region of their own, so it means nothing. */
10
+ className?: string;
11
+ };
12
+ export declare function ListFilterBar({ shows, sorts, className }: ListFilterBarProps): ReactNode;
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Fragment, useContext, useLayoutEffect } from "react";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { ToolbarBarSorts } from "../../panels/react/toolbar/ToolbarBarSorts.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ import { FILTER_BAR_BUTTON_KEY, FILTER_BAR_KEY, filterBarParts } from "../bar-parts.js";
8
+ import { LineItem, useInLine } from "../line.js";
9
+ import { ReadyPiece, useReadyParts } from "../ready.js";
10
+ import { useList, useListPanel, useListStore } from "../root-base.js";
11
+ import { useToolbarModel } from "../toolbar-model.js";
12
+ import { usePartKey, usePartPhone } from "../buttons/shared.js";
13
+ export function ListFilterBar({ shows = "filled", sorts = "no", className }) {
14
+ const { messages } = useViews();
15
+ const phone = usePartPhone();
16
+ const store = useListStore();
17
+ const ready = useReadyParts();
18
+ const piece = useContext(ReadyPiece);
19
+ const rooted = useList((s) => s.columns !== null);
20
+ const fielded = ready ? true : rooted;
21
+ const barOpen = useList((s) => s.panels.barOpen);
22
+ const model = useToolbarModel({ phone, fromRoot: true });
23
+ const sortState = useListPanel(usePartKey("barSort"));
24
+ const filterState = useListPanel(usePartKey("barFilters"));
25
+ const drawn = ready ? !phone : fielded && !phone && !!model.panels.filterTree;
26
+ const inLine = useInLine();
27
+ useLayoutEffect(() => {
28
+ if (!drawn || ready)
29
+ return;
30
+ const unbar = store.get().place("bar");
31
+ const unplace = store.get().place(FILTER_BAR_KEY);
32
+ const unbutton = shows === "button" ? store.get().place(FILTER_BAR_BUTTON_KEY) : undefined;
33
+ return () => {
34
+ unbar();
35
+ unplace();
36
+ unbutton?.();
37
+ };
38
+ }, [store, drawn, shows, ready]);
39
+ if (!drawn)
40
+ return null;
41
+ const always = ready ? ready.barAlways : shows !== "filled";
42
+ const { parts, holds } = filterBarParts({
43
+ panels: model.panels,
44
+ differs: model.differs,
45
+ held: model.held,
46
+ setHeld: model.setHeld,
47
+ savedFilter: model.savedFilter,
48
+ always,
49
+ sorts,
50
+ sortState,
51
+ filterState,
52
+ barSorts: (rules, state) => _jsx(ToolbarBarSorts, { sorts: rules, open: state.open, onOpenChange: state.onOpenChange }),
53
+ ...(ready && { hosts: { ...(ready.hosts.sort && { sort: ready.hosts.sort }), ...(ready.hosts.filter && { filter: ready.hosts.filter }) } }),
54
+ });
55
+ if (ready && piece) {
56
+ const part = parts.find((at) => at.key === piece);
57
+ if (!part)
58
+ return null;
59
+ return _jsx(LineItem, { item: { key: part.key, ...(part.role && { role: part.role }), ...(part.filters && { filters: part.filters }) }, children: part.node });
60
+ }
61
+ const stands = ready !== null || shows === "always" || (shows === "filled" ? holds : barOpen);
62
+ if (!stands)
63
+ return null;
64
+ if (inLine)
65
+ return (_jsx(_Fragment, { children: parts.map((part) => (_jsx(LineItem, { item: { key: part.key, ...(part.role && { role: part.role }), ...(part.filters && { filters: part.filters }) }, children: part.node }, part.key))) }));
66
+ return (_jsx("div", { role: "region", "aria-label": messages({ key: "views.panels.sort-filter" }), "data-slot": "vk-list-filter-bar", "data-shows": shows, className: cx("flex flex-wrap items-center gap-1", className), children: parts.map((part) => (_jsx(Fragment, { children: part.node }, part.key))) }));
67
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import { type ListPanelShows } from "./shared.js";
3
+ export type ListFilterPanelProps = {
4
+ /** When it stands. Default `always`. */
5
+ shows?: ListPanelShows;
6
+ className?: string;
7
+ };
8
+ export declare function ListFilterPanel({ shows, className }: ListFilterPanelProps): ReactNode;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { barItemsOf } from "../../filters/filter-tree.js";
4
+ import { heldStands } from "../../panels/react/filter/editor-ctx.js";
5
+ import { WholeFilterEditor } from "../../panels/react/filter/FilterEditor.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ import { useList } from "../root-base.js";
8
+ import { useToolbarModel } from "../toolbar-model.js";
9
+ import { usePartPhone } from "../buttons/shared.js";
10
+ import { PanelFrame, usePanelPlace } from "./shared.js";
11
+ export function ListFilterPanel({ shows = "always", className }) {
12
+ const { messages } = useViews();
13
+ const phone = usePartPhone();
14
+ const fielded = useList((s) => s.columns !== null);
15
+ const { panels, held } = useToolbarModel({ phone, fromRoot: true });
16
+ const tree = fielded ? panels.filterTree : undefined;
17
+ const holds = !!tree && (barItemsOf(tree.tree).length > 0 || !!heldStands(held, tree.tree));
18
+ const place = usePanelPlace("filter", shows, holds, !!tree);
19
+ if (!tree)
20
+ return null;
21
+ const label = tree.label ?? messages({ key: "views.panels.filter" });
22
+ return (_jsx(PanelFrame, { place: place, label: label, head: true, panel: "filter", className: className, children: _jsx(WholeFilterEditor, { filterTree: tree, empty: "editor", onDone: place.hide }) }));
23
+ }
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ export type ListQuickFiltersPanelProps = {
3
+ /** When it stands. Default `always`. */
4
+ shows?: "always" | "button";
5
+ className?: string;
6
+ };
7
+ export declare function ListQuickFiltersPanel({ shows, className }: ListQuickFiltersPanelProps): ReactNode;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { QuickFiltersPanel } from "../../panels/react/quick/QuickFiltersPanel.js";
4
+ import { useViews } from "../../provider/context.js";
5
+ import { useToolbarModel } from "../toolbar-model.js";
6
+ import { usePartPhone } from "../buttons/shared.js";
7
+ import { PanelFrame, usePanelPlace } from "./shared.js";
8
+ export function ListQuickFiltersPanel({ shows = "always", className }) {
9
+ const { messages } = useViews();
10
+ const phone = usePartPhone();
11
+ const { quick } = useToolbarModel({ phone, fromRoot: true });
12
+ const place = usePanelPlace("quick", shows, true, !!quick);
13
+ if (!quick)
14
+ return null;
15
+ return (_jsx(PanelFrame, { place: place, label: quick.label ?? messages({ key: "views.panels.quick-filters" }), head: false, panel: "quick", className: className, children: _jsx(QuickFiltersPanel, { quickFilters: quick, form: "computer", inHost: true, closeButton: place.stands === "shown", onDone: place.hide }) }));
16
+ }
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from "react";
2
+ import { type PartKeyName } from "../buttons/shared.js";
3
+ /** When a placed panel stands: always, once it holds something, or while its button shows it. */
4
+ export type ListPanelShows = "always" | "filled" | "button";
5
+ /** A placed panel's place in the root: its key, its region's id, whether and how it stands, and its way to go. One panel
6
+ * per key under a root, as every part: what stands is published by key, not counted. */
7
+ export type PanelPlace = {
8
+ key: string;
9
+ id: string;
10
+ stands: "alone" | "shown" | null;
11
+ hide: () => void;
12
+ };
13
+ /** A placed panel's place (VK-1092): placed under its key while `drawn`, standing as `shows` and `holds` say, published. */
14
+ export declare function usePanelPlace(name: PartKeyName, shows: ListPanelShows, holds: boolean, drawn: boolean): PanelPlace;
15
+ /** The region a standing panel draws in: named, focusable so its button can point to it, and, where its body draws no head
16
+ * of its own, the panels' header (its name, ✕ while it stands only by its button). Nothing while it doesn't stand. */
17
+ export declare function PanelFrame({ place, label, head, panel, className, children, }: {
18
+ place: PanelPlace;
19
+ label: string;
20
+ head: boolean;
21
+ /** Its name in `data-panel`: `views`, `filter`, `sort`, `quick`, `customize`. */
22
+ panel: string;
23
+ className?: string;
24
+ children: ReactNode;
25
+ }): ReactNode;
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useLayoutEffect } from "react";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { PanelHeader } from "../../panels/react/panel-header.js";
6
+ import { useList, useListStore } from "../root-base.js";
7
+ import { panelId, usePartKey } from "../buttons/shared.js";
8
+ export function usePanelPlace(name, shows, holds, drawn) {
9
+ const key = usePartKey(name);
10
+ const store = useListStore();
11
+ const listId = useList((s) => s.id);
12
+ const shown = useList((s) => !!s.panels.shown[key]);
13
+ const stands = !drawn ? null : shows === "always" || (shows === "filled" && holds) ? "alone" : shown ? "shown" : null;
14
+ useLayoutEffect(() => {
15
+ if (!drawn)
16
+ return;
17
+ const unplace = store.get().place(key);
18
+ return () => {
19
+ unplace();
20
+ store.get().setShown(key, false);
21
+ };
22
+ }, [store, key, drawn]);
23
+ useLayoutEffect(() => {
24
+ store.get().stand(key, stands);
25
+ return () => store.get().stand(key, null);
26
+ }, [store, key, stands]);
27
+ return { key, id: panelId(listId, key), stands, hide: () => store.get().setShown(key, false) };
28
+ }
29
+ export function PanelFrame({ place, label, head, panel, className, children, }) {
30
+ if (!place.stands)
31
+ return null;
32
+ return (_jsxs("section", { id: place.id, role: "region", "aria-label": label, tabIndex: -1, "data-slot": "vk-list-panel", "data-panel": panel, "data-stands": place.stands, className: cx("flex min-h-0 flex-col", className), children: [head && _jsx(PanelHeader, { title: label, ...(place.stands === "shown" && { onClose: place.hide }) }), children] }));
33
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from "react";
2
+ import { type ListPanelShows } from "./shared.js";
3
+ export type ListSortPanelProps = {
4
+ /** When it stands. Default `always`. */
5
+ shows?: ListPanelShows;
6
+ className?: string;
7
+ };
8
+ export declare function ListSortPanel({ shows, className }: ListSortPanelProps): ReactNode;
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { SortEditorHost } from "../../panels/react/sort/SortEditor.js";
4
+ import { useViews } from "../../provider/context.js";
5
+ import { useList } from "../root-base.js";
6
+ import { useToolbarModel } from "../toolbar-model.js";
7
+ import { usePartPhone } from "../buttons/shared.js";
8
+ import { PanelFrame, usePanelPlace } from "./shared.js";
9
+ export function ListSortPanel({ shows = "always", className }) {
10
+ const { messages } = useViews();
11
+ const phone = usePartPhone();
12
+ const fielded = useList((s) => s.columns !== null);
13
+ const { panels } = useToolbarModel({ phone, fromRoot: true });
14
+ const sorts = fielded ? panels.sorts : undefined;
15
+ const place = usePanelPlace("sort", shows, !!sorts && sorts.rules.length > 0, !!sorts && sorts.options.length > 0);
16
+ if (!sorts || sorts.options.length === 0)
17
+ return null;
18
+ return (_jsx(PanelFrame, { place: place, label: messages({ key: "views.panels.sort" }), head: true, panel: "sort", className: className, children: _jsx(SortEditorHost, { sorts: sorts, form: "computer", addSort: true, empty: "editor", onDone: place.hide }) }));
19
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ import type { ListLayout } from "viewkitjs/fields/query";
3
+ import { type CollectionViewsInput } from "../../panels/views-row/model.js";
4
+ export type ListViewsPanelProps = {
5
+ /** The app's own views; absent, the root's saved views. */
6
+ views?: CollectionViewsInput<string>;
7
+ /** The layouts a new view takes one of; absent, a table. */
8
+ layouts?: readonly ListLayout[];
9
+ /** When it stands. Default `always`. */
10
+ shows?: "always" | "button";
11
+ className?: string;
12
+ };
13
+ export declare function ListViewsPanel({ views: handed, layouts, shows, className }: ListViewsPanelProps): ReactNode;
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { toViewAxes, viewsListItemsOf, viewsListOrderFits, viewsListPickFits } from "../../panels/views-row/model.js";
4
+ import { useViews } from "../../provider/context.js";
5
+ import { useListViewsAxis } from "../views-axis.js";
6
+ import { PanelFrame, usePanelPlace } from "./shared.js";
7
+ export function ListViewsPanel({ views: handed, layouts, shows = "always", className }) {
8
+ const { components, messages } = useViews();
9
+ const { ViewsListBody } = components;
10
+ const stored = useListViewsAxis(layouts);
11
+ const axis = toViewAxes(handed ?? stored)?.[0];
12
+ const place = usePanelPlace("views", shows, true, !!axis);
13
+ if (!axis)
14
+ return null;
15
+ const label = messages({ key: "views.panels.views-list" });
16
+ const { onCreate, onReorder } = axis;
17
+ return (_jsx(PanelFrame, { place: place, label: label, head: true, panel: "views", className: className, children: _jsx(ViewsListBody, { label: label, views: viewsListItemsOf(axis), ...(axis.verbs && { verbs: axis.verbs }), value: axis.value, form: "computer", onViewChange: (value) => {
18
+ if (viewsListPickFits(axis.options, value))
19
+ axis.onChange(value);
20
+ }, ...(onCreate && { onCreate, createLabel: axis.createLabel ?? messages({ key: "views.panels.view-create" }) }), ...(onReorder && {
21
+ onReorder: (orderedIds) => {
22
+ if (viewsListOrderFits(axis.options, orderedIds))
23
+ onReorder(orderedIds);
24
+ },
25
+ ...(axis.canDrag && { canDrag: axis.canDrag }),
26
+ }), onDone: place.hide }) }));
27
+ }
@@ -0,0 +1,35 @@
1
+ import type { ToolbarPanelHost } from "../panels/react/toolbar/panel-part.js";
2
+ import type { ToolbarPanelState } from "../panels/react/toolbar/panel-state.js";
3
+ import type { ViewsLayout } from "../panels/views-row/model.js";
4
+ /** What the ready toolbar asks of the parts it draws (not on the door). `sort`: `row`, Mihai's row Sort (a placed Sort's);
5
+ * `line`, the pill of the bar's line, the phone and the row arrangement, + after it as `addAfter` says, its one-rule Sort lit
6
+ * by its own sort alone. `filter`: `add`, a placed Filter's; `plain`, Filter and its panel whatever the groups; `bar`, the bar
7
+ * form's filters, Filter alone while none stands. `customizeFoot`: `parts`, a placed Customize's; `none`, none (Clear and Save
8
+ * stand on the bar); `own`, the row arrangement's (Reset and Save for everyone, no Clear). `quickWord`: `icon`, the quick
9
+ * filters' icon alone; `own`, their button's own word. */
10
+ export type ReadyParts = {
11
+ phone: boolean;
12
+ hosts: {
13
+ options?: ToolbarPanelHost;
14
+ sort?: ToolbarPanelHost;
15
+ filter?: ToolbarPanelHost;
16
+ quick?: ToolbarPanelHost;
17
+ };
18
+ sort: "row" | "line";
19
+ addAfter?: boolean;
20
+ filter: "add" | "plain" | "bar";
21
+ customizeFoot: "parts" | "none" | "own";
22
+ quickWord: "icon" | "own";
23
+ quickState?: Pick<ToolbarPanelState, "open" | "onOpenChange">;
24
+ viewsLayout?: ViewsLayout;
25
+ barAlways: boolean;
26
+ };
27
+ /** The ready toolbar's asks (not on the door): null outside a `ListToolbar`, and for an app's own node inside one. */
28
+ export declare const ReadyPartsContext: import("react").Context<ReadyParts | null>;
29
+ /** The ready toolbar's asks, where the part stands in one (not on the door). */
30
+ export declare function useReadyParts(): ReadyParts | null;
31
+ /** Which piece of a part one item draws (not on the door): the stacked views, a half of Clear and Save, one of the filter bar's
32
+ * pieces. */
33
+ export type ReadyPieceName = "stacked" | "clear" | "save" | "sort-pill" | "sep" | "filters";
34
+ /** The piece one item draws (not on the door). */
35
+ export declare const ReadyPiece: import("react").Context<ReadyPieceName | null>;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ export const ReadyPartsContext = createContext(null);
4
+ export function useReadyParts() {
5
+ return useContext(ReadyPartsContext);
6
+ }
7
+ export const ReadyPiece = createContext(null);
@@ -1,5 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { ListLinkReading, ListSettings } from "viewkitjs/fields/query";
3
+ import type { QuickFiltersConfig } from "../panels/quick/model.js";
3
4
  import type { ToolbarPanelState } from "../panels/react/toolbar/panel-state.js";
4
5
  import { type ListState, type ListStore, type ListSync } from "./store.js";
5
6
  import type { ViewSeed, ViewsStore } from "./views-store.js";
@@ -34,7 +35,23 @@ export type ListRootBaseProps = {
34
35
  children?: ReactNode;
35
36
  share?: boolean;
36
37
  } & ListRootModes;
38
+ /** The model of the `ListToolbar` around a part (not on the door, VK-1105): a part placed inside what it draws reads it. Its
39
+ * value changes whenever that model is built again, so a part React skips still reads the new one; a root resets it, so a
40
+ * root drawn inside a toolbar never hands its parts another root's model. */
41
+ export declare const ToolbarModelProvided: import("react").Context<{
42
+ model: unknown;
43
+ } | null>;
37
44
  export declare function ListRootBase({ id, children, share, ...props }: ListRootBaseProps): ReactNode;
45
+ /** The quick filters `ListRoot` was handed, for a part placed under it (VK-1091): provided by the root that holds a list's
46
+ * data (./root.tsx), read here so the ready toolbar never loads that root's data path. Not on the door. */
47
+ export declare const RootQuickFilters: import("react").Context<QuickFiltersConfig | null>;
48
+ /** The quick filters of the root around this part; null where it was handed none (not on the door). */
49
+ export declare function useRootQuickFilters(): QuickFiltersConfig | null;
50
+ /** The box the root's `ListPaneBox` draws, where a placed button's Pane stands (VK-1091), and its setter. Not on the door. */
51
+ export declare const ListPaneBoxContext: import("react").Context<{
52
+ box: HTMLElement | null;
53
+ setBox: (box: HTMLElement | null) => void;
54
+ } | null>;
38
55
  /** The store of the list root around this part (not on the door). */
39
56
  export declare function useListStore(): ListStore;
40
57
  /** What this part selects of its list's state: it re-renders only when that changes (by `equal`, `Object.is` by