@nivaro/react 0.2.52 → 0.2.54

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 (191) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +116 -2
  4. package/dist/layout-editor.d.ts +248 -2
  5. package/dist/shared/components/FormWhatsNew.js +60 -0
  6. package/dist/shared/components/ItemEditForm.js +3994 -3876
  7. package/dist/shared/components/RecordReadView.js +219 -211
  8. package/dist/shared/components/TipLayer.js +27 -27
  9. package/dist/shared/components/help-videos/api.js +51 -41
  10. package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
  11. package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
  12. package/dist/shared/components/item-edit/FieldRow.js +353 -304
  13. package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
  14. package/dist/shared/components/item-edit/GroupSection.js +419 -396
  15. package/dist/shared/components/item-edit/HeaderTools.js +59 -56
  16. package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
  17. package/dist/shared/components/item-edit/lock-why.js +87 -0
  18. package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
  19. package/dist/shared/components/layout-editor/AddPanel.js +204 -146
  20. package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
  21. package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
  22. package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
  23. package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
  24. package/dist/shared/components/layout-editor/CollabParts.js +170 -0
  25. package/dist/shared/components/layout-editor/DesignNode.js +304 -115
  26. package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
  27. package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
  28. package/dist/shared/components/layout-editor/FindReplace.js +188 -0
  29. package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
  30. package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
  31. package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
  32. package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
  33. package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
  34. package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
  35. package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
  36. package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
  37. package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
  38. package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
  39. package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
  40. package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
  41. package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
  42. package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
  43. package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
  44. package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
  45. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
  46. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
  47. package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
  48. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
  49. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
  50. package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
  51. package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
  52. package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
  53. package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
  54. package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
  55. package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
  56. package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
  57. package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
  58. package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
  59. package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
  60. package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
  61. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
  62. package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
  63. package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
  64. package/dist/shared/components/layout-editor/assist/jump.js +142 -0
  65. package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
  66. package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
  67. package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
  68. package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
  69. package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
  70. package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
  71. package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
  72. package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
  73. package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
  74. package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
  75. package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
  76. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
  77. package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
  78. package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
  79. package/dist/shared/components/layout-editor/commands/intents.js +214 -0
  80. package/dist/shared/components/layout-editor/commands/parse.js +242 -0
  81. package/dist/shared/components/layout-editor/design-context.js +26 -6
  82. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
  83. package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
  84. package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
  85. package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
  86. package/dist/shared/components/layout-editor/editor-notes.js +78 -0
  87. package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
  88. package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
  89. package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
  90. package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
  91. package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
  92. package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
  93. package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
  94. package/dist/shared/components/layout-editor/field-zones.js +116 -0
  95. package/dist/shared/components/layout-editor/form-map.js +138 -0
  96. package/dist/shared/components/layout-editor/history-api.js +87 -0
  97. package/dist/shared/components/layout-editor/inheritance.js +55 -0
  98. package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
  99. package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
  100. package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
  101. package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
  102. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
  103. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
  104. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
  105. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
  106. package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
  107. package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
  108. package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
  109. package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
  110. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
  111. package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
  112. package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
  113. package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
  114. package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
  115. package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
  116. package/dist/shared/components/layout-editor/is-typing.js +9 -0
  117. package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
  118. package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
  119. package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
  120. package/dist/shared/components/layout-editor/load-error.js +37 -0
  121. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
  122. package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
  123. package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
  124. package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
  125. package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
  126. package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
  127. package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
  128. package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
  129. package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
  130. package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
  131. package/dist/shared/components/layout-editor/nav/find.js +20 -0
  132. package/dist/shared/components/layout-editor/nav/tree.js +142 -0
  133. package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
  134. package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
  135. package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
  136. package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
  137. package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
  138. package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
  139. package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
  140. package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
  141. package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
  142. package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
  143. package/dist/shared/components/layout-editor/panel-style.js +8 -7
  144. package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
  145. package/dist/shared/components/layout-editor/pin.js +25 -0
  146. package/dist/shared/components/layout-editor/presence.js +111 -0
  147. package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
  148. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
  149. package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
  150. package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
  151. package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
  152. package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
  153. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
  154. package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
  155. package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
  156. package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
  157. package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
  158. package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
  159. package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
  160. package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
  161. package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
  162. package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
  163. package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
  164. package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
  165. package/dist/shared/components/layout-editor/settings/controls.js +8 -8
  166. package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
  167. package/dist/shared/components/layout-editor/shortcuts.js +88 -0
  168. package/dist/shared/components/layout-editor/show-when.js +35 -0
  169. package/dist/shared/components/layout-editor/slot-names.js +4 -3
  170. package/dist/shared/components/layout-editor/structure-ops.js +399 -0
  171. package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
  172. package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
  173. package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
  174. package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
  175. package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
  176. package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
  177. package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
  178. package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
  179. package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
  180. package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
  181. package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
  182. package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
  183. package/dist/shared/components/support/SuggestFormChange.js +143 -0
  184. package/dist/shared/lib/ai-fill.js +37 -0
  185. package/dist/shared/lib/form-usage-beacon.js +84 -0
  186. package/dist/shared/lib/layout-i18n.js +66 -0
  187. package/dist/shared/lib/layout-lint.js +490 -0
  188. package/dist/shared/lib/layout-ops.js +110 -106
  189. package/dist/shared/lib/screenshot.js +54 -28
  190. package/dist/shared/lib/visible-when.js +34 -0
  191. package/package.json +1 -1
@@ -0,0 +1,393 @@
1
+ import { TABLE_FORM_GROUP_KEYS as Z } from "../../../lib/layout-ops.js";
2
+ import { parseVisibleWhen as oe, matchesVisibleWhen as le } from "../../../lib/visible-when.js";
3
+ import { SYSTEM_FIELDS as K } from "../../item-edit/helpers.js";
4
+ import { fieldAccessForRole as re } from "../preview/preview-model.js";
5
+ const H = 5, ke = 40;
6
+ function q(t) {
7
+ let n = t;
8
+ if (typeof n == "string")
9
+ try {
10
+ n = JSON.parse(n);
11
+ } catch {
12
+ return null;
13
+ }
14
+ return n && typeof n == "object" && !Array.isArray(n) ? n : null;
15
+ }
16
+ function ve(t) {
17
+ var a;
18
+ const n = q((a = q(t)) == null ? void 0 : a.testing), l = [];
19
+ if (Array.isArray(n == null ? void 0 : n.records))
20
+ for (const r of n.records) {
21
+ if ((r == null ? void 0 : r.item) == null || r.item === "") continue;
22
+ const d = { item: String(r.item), role_id: r.role_id ? String(r.role_id) : null };
23
+ l.some((c) => de(c, d)) || l.push(d);
24
+ }
25
+ const s = Number(n == null ? void 0 : n.cost_limit);
26
+ return {
27
+ records: l.slice(0, H),
28
+ cost_limit: Number.isFinite(s) && s > 0 ? Math.round(s) : null
29
+ };
30
+ }
31
+ const de = (t, n) => t.item === n.item && (t.role_id ?? "").toUpperCase() === (n.role_id ?? "").toUpperCase();
32
+ function X(t, n, l) {
33
+ const s = { ...q(t) ?? {} };
34
+ return l == null ? delete s[n] : s[n] = l, Object.keys(s).length > 0 ? s : null;
35
+ }
36
+ function we(t, n) {
37
+ const l = n.records.length === 0 && n.cost_limit == null;
38
+ return {
39
+ conditions: X(
40
+ t,
41
+ "testing",
42
+ l ? null : {
43
+ records: n.records.slice(0, H),
44
+ ...n.cost_limit != null ? { cost_limit: n.cost_limit } : {}
45
+ }
46
+ )
47
+ };
48
+ }
49
+ function $e(t, n) {
50
+ return { conditions: X(t, "role_ids", n.length ? n : null) };
51
+ }
52
+ const M = (t) => new Map(t.groups.map((n) => [n.key, n]));
53
+ function Q(t, n) {
54
+ if (!n || t == null || t === "") return !1;
55
+ try {
56
+ const l = typeof t == "string" ? JSON.parse(t) : t;
57
+ return Array.isArray(l) && l.some((s) => String(s).toUpperCase() === n.toUpperCase());
58
+ } catch {
59
+ return !1;
60
+ }
61
+ }
62
+ const Y = (t, n) => t == null ? void 0 : t[n];
63
+ function L(t, n, l) {
64
+ const s = new Map(n.groups.map((d) => [d.id, d]));
65
+ let a = t;
66
+ const r = /* @__PURE__ */ new Set();
67
+ for (; a; ) {
68
+ if (a.type === "tab" && a.container_id == null)
69
+ return le(a.visible_when, l);
70
+ if (a.container_id == null || r.has(a.id)) return !0;
71
+ r.add(a.id), a = s.get(a.container_id);
72
+ }
73
+ return !0;
74
+ }
75
+ function Se(t, n, l) {
76
+ const s = M(t), a = l && !l.role.admin_access ? re(l, t) : null, r = /* @__PURE__ */ new Map();
77
+ for (const d of t.assignments) {
78
+ if (d.field.startsWith("__") || d.is_visible === !1 || d.is_visible === 0 || ee(d.overrides)) continue;
79
+ const c = d.group_key ?? null;
80
+ if (c != null && c !== "__header__") {
81
+ if (Z.includes(c)) continue;
82
+ const i = s.get(c);
83
+ if (!i || !L(i, t, n)) continue;
84
+ }
85
+ let _ = "editable";
86
+ l && !l.role.admin_access && (_ = (a == null ? void 0 : a.get(d.field)) ?? "hidden"), _ !== "hidden" && r.get(d.field) !== "editable" && r.set(d.field, _);
87
+ }
88
+ return r;
89
+ }
90
+ function ee(t) {
91
+ if (t == null || t === "") return !1;
92
+ try {
93
+ const n = typeof t == "string" ? JSON.parse(t) : t;
94
+ return !!n && typeof n == "object" && n.hidden === !0;
95
+ } catch {
96
+ return !1;
97
+ }
98
+ }
99
+ function Ae(...t) {
100
+ const n = /* @__PURE__ */ new Set();
101
+ for (const l of t)
102
+ for (const s of (l == null ? void 0 : l.groups) ?? [])
103
+ if (s.type === "tab" && s.container_id == null)
104
+ for (const a of oe(s.visible_when))
105
+ a.field && /^[A-Za-z_][A-Za-z0-9_]*$/.test(a.field) && n.add(a.field);
106
+ return [...n];
107
+ }
108
+ function ae(t, n = 3) {
109
+ return t.length <= 1 ? t[0] ?? "" : t.length <= n ? `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}` : `${t.slice(0, n).join(", ")} and ${t.length - n} more`;
110
+ }
111
+ const O = (t) => t ? `“${t.name}”` : "no form";
112
+ function Oe(t, n, l) {
113
+ var p, m;
114
+ const s = [], a = ((p = t.form) == null ? void 0 : p.layout_id) ?? null, r = ((m = n.form) == null ? void 0 : m.layout_id) ?? null;
115
+ if (a !== r)
116
+ return t.view && !n.view ? s.push({ kind: "form", text: `lands on another form: ${O(n.form)}` }) : !t.view && n.view ? s.push({ kind: "form", text: `now opens on this form (was ${O(t.form)})` }) : s.push({
117
+ kind: "form",
118
+ text: `moves from ${O(t.form)} to ${O(n.form)}`
119
+ }), s;
120
+ if (!t.view || !n.view) return s;
121
+ const d = [], c = [], _ = [], i = [];
122
+ for (const [g, b] of t.view) {
123
+ const k = n.view.get(g);
124
+ k ? b === "editable" && k === "readonly" ? _.push(g) : b === "readonly" && k === "editable" && i.push(g) : d.push(g);
125
+ }
126
+ for (const g of n.view.keys()) t.view.has(g) || c.push(g);
127
+ const u = (g) => ae(g.map(l));
128
+ return d.length && s.push({
129
+ kind: "lost",
130
+ fields: d,
131
+ text: d.length === 1 ? `loses the ${u(d)} field` : `loses ${u(d)} fields`
132
+ }), c.length && s.push({
133
+ kind: "gained",
134
+ fields: c,
135
+ text: c.length === 1 ? `gains the ${u(c)} field` : `gains ${u(c)} fields`
136
+ }), _.length && s.push({
137
+ kind: "readonly",
138
+ fields: _,
139
+ text: `can no longer edit ${u(_)}`
140
+ }), i.length && s.push({ kind: "editable", fields: i, text: `can now edit ${u(i)}` }), s;
141
+ }
142
+ const fe = (t) => t != null && t !== "" && !(Array.isArray(t) && t.length === 0);
143
+ function Te(t) {
144
+ var D, x, B;
145
+ const { layout: n, rows: l, access: s, thisLayoutId: a } = t, r = n.layout, d = s.role && !s.role.admin_access ? s.role.id : null, c = [], _ = [], i = [], u = (e) => {
146
+ var f;
147
+ const o = l.find((h) => h.field === e);
148
+ return (o == null ? void 0 : o.label) || ((f = t.label) == null ? void 0 : f.call(t, e)) || e;
149
+ }, p = {}, m = r == null ? void 0 : r.default_values;
150
+ for (const [e, o] of Object.entries(m ?? {})) p[e] = o;
151
+ for (const [e, o] of Object.entries(t.values ?? {})) p[e] = o;
152
+ const g = (e) => fe(p[e.field]) || !!e.default_formula || s.column_defaults.some((o) => o.toLowerCase() === e.field.toLowerCase());
153
+ if (s.new_record_form && s.new_record_form.layout_id !== a && c.push(
154
+ `New records open on “${s.new_record_form.name}” for ${((D = s.role) == null ? void 0 : D.name) ?? "administrators"} unless they pick this form.`
155
+ ), !s.role_may_open)
156
+ return {
157
+ steps: i,
158
+ skipped: _,
159
+ notes: c,
160
+ blocker: {
161
+ step: -1,
162
+ where: "Opening the form",
163
+ reason: `${((x = s.role) == null ? void 0 : x.name) ?? "This role"} is not on this form’s role list, so it never opens it.`
164
+ }
165
+ };
166
+ if (!s.can_create)
167
+ return {
168
+ steps: i,
169
+ skipped: _,
170
+ notes: c,
171
+ blocker: {
172
+ step: -1,
173
+ where: "Opening the form",
174
+ reason: `${((B = s.role) == null ? void 0 : B.name) ?? "This role"} may not create records in this collection.`
175
+ }
176
+ };
177
+ const b = M(n), k = new Set(s.hidden_fields), v = s.create_fields ? new Set(s.create_fields) : null, y = (e, o) => e.sort - o.sort, w = new Map(n.groups.map((e) => [e.id, e])), T = n.groups.filter((e) => e.type === "tab" && e.container_id == null).sort(y), N = n.groups.filter((e) => e.type === "container").sort(y).flatMap(
178
+ (e) => n.groups.filter((o) => o.type === "tab" && o.container_id === e.id).sort(y)
179
+ ), R = T.length > 0 && (r == null ? void 0 : r.tab_mode) === "steps", C = R && !!(r != null && r.validate_before_next), te = (e) => {
180
+ let o = e ? b.get(e) : void 0;
181
+ const f = /* @__PURE__ */ new Set();
182
+ for (; o; ) {
183
+ if (o.type === "tab") return o.key;
184
+ if (o.container_id == null || f.has(o.id)) return null;
185
+ f.add(o.id), o = w.get(o.container_id);
186
+ }
187
+ return null;
188
+ }, j = T.length + N.length > 0, ne = j ? [
189
+ { key: "__general__", label: "General", group: null, validates: C },
190
+ ...N.map((e) => ({
191
+ key: e.key,
192
+ label: e.label || e.key,
193
+ group: e,
194
+ validates: !1
195
+ })),
196
+ ...T.map((e) => ({
197
+ key: e.key,
198
+ label: e.label || e.key,
199
+ group: e,
200
+ validates: C
201
+ }))
202
+ ] : [{ key: "__form__", label: "The form", group: null, validates: !1 }], U = "__float__", I = (e) => {
203
+ if (!j) return "__form__";
204
+ const o = te(e);
205
+ return o || (!e || e === "__header__" ? "__general__" : R ? U : "__general__");
206
+ }, E = [], W = /* @__PURE__ */ new Set(), se = (e) => {
207
+ var A, J, G, V;
208
+ if (!e.required || K.has(e.field) || e.field.startsWith("__")) return null;
209
+ const o = { field: e.field, label: u(e.field) }, f = e.group_key ? b.get(e.group_key) : void 0;
210
+ if (e.hidden) return { ...o, status: "skipped", reason: "hidden on this form" };
211
+ if (k.has(e.field) || Q(Y(f, "hidden_for_roles"), d))
212
+ return {
213
+ ...o,
214
+ status: "skipped",
215
+ reason: `${((A = s.role) == null ? void 0 : A.name) ?? "the role"} cannot see it`
216
+ };
217
+ if (f && !L(f, n, p))
218
+ return {
219
+ ...o,
220
+ status: "blocked",
221
+ reason: `its section “${f.label || f.key}” is hidden for these values`
222
+ };
223
+ if (g(e)) return { ...o, status: "prefilled" };
224
+ if (v && !v.has(e.field))
225
+ return { ...o, status: "blocked", reason: `${(J = s.role) == null ? void 0 : J.name} may not write it` };
226
+ if (Q(Y(f, "locked_for_roles"), d))
227
+ return {
228
+ ...o,
229
+ status: "blocked",
230
+ reason: `its section is locked for ${(G = s.role) == null ? void 0 : G.name}`
231
+ };
232
+ const h = n.assignments.find(
233
+ (z) => z.field === e.field && (z.group_key ?? null) === (e.group_key ?? null)
234
+ );
235
+ return d && ce(h == null ? void 0 : h.lock_conditions).includes(d.toUpperCase()) ? { ...o, status: "blocked", reason: `it is locked for ${(V = s.role) == null ? void 0 : V.name}` } : e.readonly ? { ...o, status: "blocked", reason: "it is read-only on this form" } : { ...o, status: "fill" };
236
+ }, $ = /* @__PURE__ */ new Map();
237
+ for (const e of l) {
238
+ if (e.layout_assigned === !1) {
239
+ e.required && !e.hidden && !K.has(e.field) && !e.field.startsWith("__") && _.push({
240
+ field: e.field,
241
+ label: u(e.field),
242
+ status: "skipped",
243
+ reason: "not on this form"
244
+ });
245
+ continue;
246
+ }
247
+ const o = `${e.field}\0${e.group_key ?? ""}`;
248
+ if (W.has(o)) continue;
249
+ W.add(o);
250
+ const f = se(e);
251
+ if (!f) continue;
252
+ if (f.status === "skipped") {
253
+ _.some((A) => A.field === f.field) || _.push(f);
254
+ continue;
255
+ }
256
+ const h = I(e.group_key);
257
+ h === U ? E.push(f) : $.set(h, [...$.get(h) ?? [], f]);
258
+ }
259
+ const F = new Set(
260
+ [...$.values(), E].flat().filter((e) => e.status !== "blocked").map((e) => e.field)
261
+ ), ie = new Set(
262
+ n.assignments.filter((e) => !e.field.startsWith("__") && e.is_visible !== !1 && e.is_visible !== 0).map((e) => I(e.group_key))
263
+ ), P = /* @__PURE__ */ new Set();
264
+ for (const e of ne) {
265
+ const o = e.group ? !L(e.group, n, p) : !1, f = ($.get(e.key) ?? []).map(
266
+ (h) => h.status === "blocked" && F.has(h.field) ? { ...h, status: "fill", reason: void 0 } : o && h.status !== "prefilled" ? {
267
+ ...h,
268
+ status: "blocked",
269
+ reason: `its step “${e.label}” is hidden for these values`
270
+ } : h
271
+ );
272
+ e.key === "__general__" && !ie.has(e.key) || (i.push({ key: e.key, label: e.label, hidden: o, fields: f }), e.validates && P.add(e.key));
273
+ }
274
+ for (let e = 0; e < i.length; e++) {
275
+ const o = i[e];
276
+ if (o.hidden) continue;
277
+ const f = o.fields.find((h) => h.status === "blocked");
278
+ if (f && P.has(o.key) && e < i.length - 1)
279
+ return {
280
+ steps: i,
281
+ skipped: _,
282
+ notes: c,
283
+ blocker: {
284
+ step: e,
285
+ where: `Next on “${o.label}”`,
286
+ field: f.field,
287
+ reason: `${f.label} is required, but ${f.reason}.`
288
+ }
289
+ };
290
+ }
291
+ const S = [...i.flatMap((e) => e.fields), ...E].find(
292
+ (e) => e.status === "blocked" && !F.has(e.field)
293
+ ) ?? null;
294
+ return S ? {
295
+ steps: i,
296
+ skipped: _,
297
+ notes: c,
298
+ blocker: {
299
+ step: i.length,
300
+ where: "Save",
301
+ field: S.field,
302
+ reason: `${S.label} is required, but ${S.reason}.`
303
+ }
304
+ } : { steps: i, skipped: _, notes: c, blocker: null };
305
+ }
306
+ function ce(t) {
307
+ if (t == null || t === "") return [];
308
+ try {
309
+ const n = typeof t == "string" ? JSON.parse(t) : t;
310
+ return Array.isArray(n) ? n.flatMap(
311
+ (l) => (l == null ? void 0 : l.type) === "role" && Array.isArray(l.role_ids) ? l.role_ids.map((s) => String(s).toUpperCase()) : []
312
+ ) : [];
313
+ } catch {
314
+ return [];
315
+ }
316
+ }
317
+ const ue = 5, _e = /* @__PURE__ */ new Set(["inline-table", "inline-grid", "list-o2m", "relation-list"]), pe = {
318
+ __pipeline__: 2,
319
+ __tasks__: 1,
320
+ __comments__: 1,
321
+ __addendums__: 1,
322
+ __referenced_by__: 1,
323
+ __related_records__: 1,
324
+ __owners__: 1,
325
+ __pdf__: 0
326
+ }, he = {
327
+ __pipeline__: "Workflow",
328
+ __tasks__: "Tasks",
329
+ __comments__: "Comments",
330
+ __addendums__: "Addendums",
331
+ __referenced_by__: "Referenced by",
332
+ __related_records__: "Related records",
333
+ __owners__: "Owners",
334
+ __pdf__: "PDF"
335
+ };
336
+ function Ee(t) {
337
+ const { layout: n, rows: l, relations: s, collection: a } = t, r = [
338
+ { kind: "base", key: "__base__", label: "The record page itself", requests: ue }
339
+ ], d = M(n), c = (i, u) => l.find((p) => p.field === i && (p.group_key ?? null) === u) ?? l.find((p) => p.field === i);
340
+ for (const i of n.assignments) {
341
+ if (i.is_visible === !1 || i.is_visible === 0) continue;
342
+ const u = i.group_key ?? null;
343
+ if (u && Z.includes(u) || u && u !== "__header__" && !d.has(u)) continue;
344
+ const p = `${i.field}\0${u ?? ""}`;
345
+ if (i.widget_id != null) {
346
+ r.push({
347
+ kind: "widget",
348
+ key: p,
349
+ label: i.label_override || `Widget ${i.widget_id}`,
350
+ requests: 1
351
+ });
352
+ continue;
353
+ }
354
+ if (i.field.startsWith("__")) {
355
+ const y = /^__ext_/.test(i.field), w = y ? 1 : pe[i.field] ?? 0;
356
+ w > 0 && r.push({
357
+ kind: y ? "widget" : "panel",
358
+ key: p,
359
+ label: he[i.field] ?? i.field.replace(/^__ext_|__$/g, ""),
360
+ requests: w
361
+ });
362
+ continue;
363
+ }
364
+ const m = c(i.field, u);
365
+ if (m != null && m.hidden || ee(i.overrides)) continue;
366
+ const g = i.label_override || (m == null ? void 0 : m.label) || i.field;
367
+ if (i.field.includes(".")) {
368
+ r.push({ kind: "query", key: p, label: g, requests: 1 });
369
+ continue;
370
+ }
371
+ const b = (m == null ? void 0 : m.interface) ?? "", k = s.find((y) => y.one_collection === a && y.one_field === i.field), v = s.some((y) => y.many_collection === a && y.many_field === i.field);
372
+ _e.has(b) || k && !k.junction_field && b !== "files-m2m" ? r.push({ kind: "grid", key: p, label: g, requests: 3 }) : k || v || /user|file|m2o|m2m/.test(b) ? r.push({ kind: "picker", key: p, label: g, requests: 1 }) : m != null && m.remote_options_config && r.push({ kind: "query", key: p, label: g, requests: 1 });
373
+ }
374
+ const _ = { picker: 0, grid: 0, widget: 0, panel: 0, query: 0 };
375
+ for (const i of r) i.kind !== "base" && _[i.kind]++;
376
+ return { total: r.reduce((i, u) => i + u.requests, 0), items: r, counts: _ };
377
+ }
378
+ export {
379
+ ue as BASE_REQUESTS,
380
+ ke as DEFAULT_COST_LIMIT,
381
+ H as MAX_PINNED,
382
+ Oe as compareOutcomes,
383
+ Ae as conditionFields,
384
+ Ee as formCost,
385
+ Se as formView,
386
+ L as groupShown,
387
+ ae as nameList,
388
+ ve as readTesting,
389
+ $e as roleIdsPatch,
390
+ de as samePin,
391
+ we as testingPatch,
392
+ Te as walkthrough
393
+ };
@@ -0,0 +1,44 @@
1
+ import { useState as y, useEffect as N, useCallback as O } from "react";
2
+ import { useNivaroClient as P } from "../../../context.js";
3
+ import { bundleToActiveLayout as T } from "../bundle-to-active.js";
4
+ import { useLayoutBundle as S } from "../useLayoutDraft.js";
5
+ import { checkTestRecords as V, draftResolution as j } from "./testing-api.js";
6
+ import { conditionFields as k, formView as q, samePin as z, compareOutcomes as G } from "./testing-model.js";
7
+ const i = /* @__PURE__ */ new Map();
8
+ function X(x) {
9
+ const { layoutId: t, bundle: r, parent: d, pins: u, dirty: h, label: g } = x, R = P(), { data: f = null } = S(t), [E, b] = y(() => i.get(t) ?? null), [L, w] = y(!1), [B, _] = y(null);
10
+ N(() => b(i.get(t) ?? null), [t]);
11
+ const D = O(async () => {
12
+ if (!r || u.length === 0) return null;
13
+ w(!0), _(null);
14
+ try {
15
+ const s = T(r, d).active, o = f ? T(f, d).active : s, F = await V(R, t, {
16
+ records: u,
17
+ draft: j(r.layout),
18
+ fields: k(s, o)
19
+ }), a = i.get(t) ?? null, m = h ? "saved" : a ? "previous" : "none", p = (e, l, n) => ({
20
+ form: e ? { layout_id: e.layout_id, name: e.name } : null,
21
+ view: l.found && (e == null ? void 0 : e.layout_id) === t ? q(n, l.values ?? {}, l.access ?? null) : null
22
+ }), I = u.map((e, l) => {
23
+ var C;
24
+ const n = F[l] ?? {
25
+ item: e.item,
26
+ role_id: e.role_id,
27
+ found: !1,
28
+ role: null
29
+ }, c = p(n.draft ?? null, n, s), A = m === "saved" ? p(n.saved ?? null, n, o) : m === "previous" ? ((C = a == null ? void 0 : a.checks.find((M) => z(M.pin, e))) == null ? void 0 : C.after) ?? c : c;
30
+ return { pin: e, result: n, before: A, after: c, changes: G(A, c, g) };
31
+ }), v = { at: Date.now(), against: m, checks: I };
32
+ return i.set(t, v), b(v), v;
33
+ } catch (s) {
34
+ const o = s;
35
+ return _((o == null ? void 0 : o.message) || "The check could not run"), null;
36
+ } finally {
37
+ w(!1);
38
+ }
39
+ }, [r, d, f, u, h, g, R, t]);
40
+ return { run: E, running: L, error: B, check: D };
41
+ }
42
+ export {
43
+ X as useRecordCheck
44
+ };
@@ -0,0 +1,242 @@
1
+ import { jsx as t, jsxs as x, Fragment as G } from "react/jsx-runtime";
2
+ import { ChevronDown as J, Check as Q } from "lucide-react";
3
+ import { useId as V, useEffect as W, useState as j, useMemo as R, useRef as X, useCallback as T, useContext as Y, createContext as Z } from "react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { cn as m } from "../../lib/utils.js";
6
+ import { PopoverTrigger as I, Popover as $, PopoverContent as ee, PopoverAnchor as te } from "../ui/popover.js";
7
+ const S = "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-2.5 text-[12.5px] font-medium text-slate-700 transition-colors hover:bg-slate-50 disabled:pointer-events-none disabled:opacity-40 dark:border-border dark:bg-card dark:text-foreground dark:hover:bg-muted", H = "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-slate-600 transition-colors hover:bg-muted hover:text-slate-900 disabled:pointer-events-none disabled:opacity-40 dark:text-muted-foreground dark:hover:text-foreground", L = "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-foreground", q = "bg-accent text-slate-900 dark:text-foreground", C = "inline-flex min-w-[18px] items-center justify-center rounded-full bg-nvr-cyan/15 px-1 text-[11px] font-semibold tabular-nums text-slate-800 dark:text-foreground", re = "flex min-h-8 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-[12.5px] text-slate-700 outline-none transition-colors hover:bg-muted focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40 dark:text-foreground", K = Z(null);
8
+ function O() {
9
+ return Y(K);
10
+ }
11
+ function ne(e) {
12
+ var i;
13
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
14
+ const r = [
15
+ ...e.currentTarget.querySelectorAll('[role^="menuitem"]:not([disabled])')
16
+ ];
17
+ if (r.length === 0) return;
18
+ e.preventDefault();
19
+ const s = r.indexOf(document.activeElement), n = e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : e.key === "ArrowDown" ? (s + 1) % r.length : (s - 1 + r.length) % r.length;
20
+ (i = r[n]) == null || i.focus();
21
+ }
22
+ function fe({
23
+ label: e,
24
+ icon: l,
25
+ tip: r,
26
+ children: s,
27
+ iconOnly: n = !1,
28
+ align: i = "start",
29
+ width: b = "w-[288px]",
30
+ className: o,
31
+ data: N
32
+ }) {
33
+ const [c, d] = j(!1), [g, u] = j(null), [v, f] = j(null), w = R(() => ({ current: v }), [v]), p = X(!1), [h, D] = j({}), B = T((a, k) => {
34
+ D((y) => {
35
+ if (k == null) {
36
+ if (!(a in y)) return y;
37
+ const { [a]: oe, ...z } = y;
38
+ return z;
39
+ }
40
+ const M = y[a];
41
+ return M && M.badge === k.badge && M.dot === k.dot ? y : { ...y, [a]: k };
42
+ });
43
+ }, []), A = T((a) => {
44
+ p.current = !!a, d(!1), a == null || a();
45
+ }, []), U = R(
46
+ () => ({ open: c, list: g, anchor: w, pick: A, report: B }),
47
+ [c, g, w, A, B]
48
+ ), E = Object.values(h), P = E.reduce((a, k) => a + (k.badge ?? 0), 0), _ = E.some((a) => a.dot);
49
+ return /* @__PURE__ */ x(K.Provider, { value: U, children: [
50
+ s,
51
+ E.length > 0 && /* @__PURE__ */ x($, { open: c, onOpenChange: d, children: [
52
+ /* @__PURE__ */ t(I, { asChild: !0, children: /* @__PURE__ */ x(
53
+ "button",
54
+ {
55
+ ref: f,
56
+ type: "button",
57
+ "aria-haspopup": "menu",
58
+ "aria-label": n ? e : void 0,
59
+ "data-tip": r,
60
+ "data-bar-menu": e,
61
+ ...N,
62
+ className: m(
63
+ n ? H : S,
64
+ "relative",
65
+ c && (n ? q : L),
66
+ o
67
+ ),
68
+ children: [
69
+ l,
70
+ !n && /* @__PURE__ */ t("span", { "data-tb-menu-label": "", children: e }),
71
+ P > 0 && /* @__PURE__ */ t(
72
+ "span",
73
+ {
74
+ "data-bar-menu-badge": P,
75
+ className: m(
76
+ C,
77
+ n && "absolute -right-1 -top-1 h-4 min-w-4 bg-white px-0.5 text-[10px] ring-1 ring-slate-200 dark:bg-card dark:ring-border"
78
+ ),
79
+ children: P
80
+ }
81
+ ),
82
+ _ && /* @__PURE__ */ t(
83
+ "span",
84
+ {
85
+ "data-bar-menu-dot": "",
86
+ className: m(
87
+ "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-rose-500",
88
+ n && "absolute right-1 top-1"
89
+ )
90
+ }
91
+ ),
92
+ !n && /* @__PURE__ */ t(J, { className: "h-3 w-3 shrink-0 text-slate-500 dark:text-muted-foreground" })
93
+ ]
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ t(
97
+ ee,
98
+ {
99
+ ref: u,
100
+ role: "menu",
101
+ "aria-label": e,
102
+ align: i,
103
+ "data-bar-menu-list": e,
104
+ onKeyDown: ne,
105
+ onCloseAutoFocus: (a) => {
106
+ p.current && (a.preventDefault(), p.current = !1);
107
+ },
108
+ className: m(
109
+ "flex max-h-[min(80vh,560px)] flex-col gap-px overflow-y-auto overscroll-contain p-1",
110
+ // Separators of sections that offer nothing here (a host without AI) fold away.
111
+ "[&>hr:first-child]:hidden [&>hr:last-child]:hidden [&>hr+hr]:hidden",
112
+ b
113
+ )
114
+ }
115
+ )
116
+ ] })
117
+ ] });
118
+ }
119
+ function pe() {
120
+ const e = O();
121
+ return !(e != null && e.open) || !e.list ? null : F(
122
+ /* @__PURE__ */ t("hr", { className: "my-1 h-px shrink-0 border-0 bg-slate-100 dark:bg-border" }),
123
+ e.list
124
+ );
125
+ }
126
+ function he(e) {
127
+ const l = O(), r = V(), s = l == null ? void 0 : l.report, { badge: n, dot: i } = e;
128
+ if (W(() => {
129
+ if (s)
130
+ return s(r, { badge: n, dot: i }), () => s(r, null);
131
+ }, [s, r, n, i]), l) return /* @__PURE__ */ t(ae, { ...e, menu: l });
132
+ const {
133
+ label: b,
134
+ icon: o,
135
+ tip: N,
136
+ popover: c,
137
+ onClick: d,
138
+ disabled: g,
139
+ checked: u,
140
+ active: v,
141
+ iconOnly: f,
142
+ trailing: w,
143
+ ariaLabel: p,
144
+ className: h,
145
+ buttonRef: D,
146
+ data: B
147
+ } = e, A = /* @__PURE__ */ x(
148
+ "button",
149
+ {
150
+ ref: D,
151
+ type: "button",
152
+ "aria-label": p ?? (f ? b : void 0),
153
+ "aria-pressed": u,
154
+ "data-tip": N,
155
+ disabled: g,
156
+ onClick: d,
157
+ ...B,
158
+ className: m(
159
+ f ? H : S,
160
+ (v || u) && (f ? q : L),
161
+ h
162
+ ),
163
+ children: [
164
+ o,
165
+ !f && b,
166
+ w
167
+ ]
168
+ }
169
+ );
170
+ return c ? /* @__PURE__ */ t(I, { asChild: !0, children: A }) : A;
171
+ }
172
+ function ae({
173
+ menu: e,
174
+ label: l,
175
+ icon: r,
176
+ hint: s,
177
+ kbd: n,
178
+ popover: i,
179
+ onOpen: b,
180
+ onClick: o,
181
+ opensDialog: N,
182
+ disabled: c,
183
+ checked: d,
184
+ active: g,
185
+ badge: u,
186
+ dot: v,
187
+ ariaLabel: f,
188
+ data: w
189
+ }) {
190
+ const p = e.open && e.list ? F(
191
+ /* @__PURE__ */ x(
192
+ "button",
193
+ {
194
+ type: "button",
195
+ ...d === void 0 ? { role: "menuitem" } : { role: "menuitemcheckbox", "aria-checked": d },
196
+ "aria-label": f,
197
+ disabled: c,
198
+ ...w,
199
+ onClick: (h) => {
200
+ if (i) return e.pick(b);
201
+ if (d !== void 0) return o == null ? void 0 : o(h);
202
+ if (N) return e.pick(() => o == null ? void 0 : o(h));
203
+ o == null || o(h), e.pick();
204
+ },
205
+ className: m(re, g && "bg-accent"),
206
+ children: [
207
+ /* @__PURE__ */ t("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-slate-500 dark:text-muted-foreground [&>svg]:h-3.5 [&>svg]:w-3.5", children: r }),
208
+ /* @__PURE__ */ x("span", { className: "flex min-w-0 flex-1 flex-col", children: [
209
+ /* @__PURE__ */ t("span", { className: "truncate font-medium text-slate-900 dark:text-foreground", children: l }),
210
+ s && /* @__PURE__ */ t("span", { className: "text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: s })
211
+ ] }),
212
+ v && /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-rose-500" }),
213
+ !!u && u > 0 && /* @__PURE__ */ t("span", { className: C, children: u }),
214
+ n && /* @__PURE__ */ t("kbd", { className: "shrink-0 font-sans text-[11px] text-slate-500 dark:text-muted-foreground", children: n }),
215
+ d !== void 0 && /* @__PURE__ */ t(
216
+ Q,
217
+ {
218
+ "aria-hidden": !0,
219
+ className: m("h-3.5 w-3.5 shrink-0 text-nvr-cyan", !d && "invisible")
220
+ }
221
+ )
222
+ ]
223
+ }
224
+ ),
225
+ e.list
226
+ ) : null;
227
+ return /* @__PURE__ */ x(G, { children: [
228
+ i && /* @__PURE__ */ t(te, { virtualRef: e.anchor }),
229
+ p
230
+ ] });
231
+ }
232
+ export {
233
+ fe as BarMenu,
234
+ pe as MenuSeparator,
235
+ he as ToolButton,
236
+ S as barBtn,
237
+ L as barBtnOn,
238
+ C as barCount,
239
+ H as barIconBtn,
240
+ q as barIconOn,
241
+ O as useBarMenu
242
+ };