@nivaro/react 0.2.54 → 0.2.56
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { isCanvasSlot as R, UNGROUPED_KEY as S, applyLayoutOps as C, GROUP_PATCH_KEYS as Y } from "../../lib/layout-ops.js";
|
|
2
|
+
import { withGroupStructure as j } from "../../lib/form-structure.js";
|
|
2
3
|
import { titleCase as I } from "../../lib/utils.js";
|
|
3
4
|
import { newGroupKey as H } from "./add-target.js";
|
|
4
|
-
import { normalizedBundle as T, inPageOrder as K, plural as g, selectedPlacements as
|
|
5
|
-
import { readOverrides as D, withKey as
|
|
6
|
-
import { isPinned as F, withPin as
|
|
7
|
-
import { PIN_KEY as
|
|
8
|
-
import { humanizeOpError as
|
|
5
|
+
import { normalizedBundle as T, inPageOrder as K, plural as g, selectedPlacements as J, moveToZoneOps as Z, zoneItems as U, FIELD_HOLDERS as X } from "./field-zones.js";
|
|
6
|
+
import { readOverrides as D, withKey as q, asArray as P, placementPatchOf as Q } from "./inspector/model.js";
|
|
7
|
+
import { isPinned as F, withPin as G } from "./pin.js";
|
|
8
|
+
import { PIN_KEY as Ue, pinLocked as Ae, pinnedZone as Le } from "./pin.js";
|
|
9
|
+
import { humanizeOpError as V } from "./useLayoutDraft.js";
|
|
9
10
|
const y = (o) => ({ ok: !1, reason: o });
|
|
10
11
|
function m(o, e) {
|
|
11
12
|
if (e.ops.length === 0) return y("Nothing would change");
|
|
12
13
|
try {
|
|
13
14
|
return C(o, e.ops), e;
|
|
14
15
|
} catch (t) {
|
|
15
|
-
return y(
|
|
16
|
+
return y(V(t.message));
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
const d = (o) => o.label || I(o.key), _ = (o, e) => o.groups.find((t) => t.key === e) ?? null, O = (o, e) => o.groups.filter((t) => t.parent_key === e).sort((t, n) => t.sort - n.sort);
|
|
@@ -20,40 +21,40 @@ function x(o, e) {
|
|
|
20
21
|
const t = e.parent_key ? _(o, e.parent_key) : null;
|
|
21
22
|
return (t ? t.tab_mode : o.layout.tab_mode) === "steps" ? "steps" : "tabs";
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function ee(o, e) {
|
|
24
25
|
return e.type === "tab" ? x(o, e) === "steps" ? "step" : "tab" : e.type === "container" ? e.tab_mode === "steps" ? "steps holder" : "tabs holder" : e.type === "content" ? "text block" : e.type === "metadata" ? "record info section" : "section";
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function _e(o, e, t) {
|
|
27
28
|
const n = _(o, e);
|
|
28
29
|
return n ? F(n) === t ? y(t ? "Already pinned" : "Not pinned") : m(o, {
|
|
29
30
|
ok: !0,
|
|
30
|
-
ops: [{ op: "group_update", key: e, patch: { swap_config:
|
|
31
|
+
ops: [{ op: "group_update", key: e, patch: { swap_config: G(n.swap_config, t) } }],
|
|
31
32
|
label: `${t ? "Pin" : "Unpin"} ${d(n)}`,
|
|
32
33
|
notes: []
|
|
33
34
|
}) : y("That section is no longer on this form");
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function te(o) {
|
|
36
37
|
const e = {};
|
|
37
38
|
for (const t of Y) t !== "label" && (e[t] = o[t]);
|
|
38
39
|
return e;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function oe(o, e) {
|
|
41
42
|
return e ? e.kind === "header" ? "A header tile shows once in the header strip" : e.kind === "slot" && R(e) ? "This panel shows once on a form" : e.kind === "field" || e.kind === "slot" ? "A field shows once per section. Duplicate its section, or add the field to another section from Add" : e.key === S ? "Ungrouped is not a section" : _(o, e.key) ? null : "This comes from the parent form: override it here first" : "Select a section or field first";
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
const t =
|
|
44
|
+
function be(o, e) {
|
|
45
|
+
const t = oe(o, e);
|
|
45
46
|
if (t) return y(t);
|
|
46
47
|
const n = T(o), a = _(n, e.key), r = new Set(n.groups.map((c) => c.key)), i = [];
|
|
47
48
|
let l = 0;
|
|
48
|
-
const u = (c, p, v,
|
|
49
|
+
const u = (c, p, v, w) => {
|
|
49
50
|
let h = `${c.key}_copy`;
|
|
50
51
|
for (let k = 2; r.has(h); k++) h = `${c.key}_copy_${k}`;
|
|
51
52
|
r.add(h);
|
|
52
|
-
const b =
|
|
53
|
-
return b.swap_config =
|
|
53
|
+
const b = te(c);
|
|
54
|
+
return b.swap_config = j(G(c.swap_config, !1), { sticky: !1 }), i.push({
|
|
54
55
|
op: "group_create",
|
|
55
56
|
key: h,
|
|
56
|
-
label:
|
|
57
|
+
label: w,
|
|
57
58
|
group_type: c.type,
|
|
58
59
|
parent_key: p,
|
|
59
60
|
index: v,
|
|
@@ -64,7 +65,7 @@ function ye(o, e) {
|
|
|
64
65
|
field: k.field,
|
|
65
66
|
group_key: h,
|
|
66
67
|
index: M,
|
|
67
|
-
patch:
|
|
68
|
+
patch: Q(k)
|
|
68
69
|
});
|
|
69
70
|
}), O(n, c.key).forEach((k, M) => {
|
|
70
71
|
u(k, h, M, k.label);
|
|
@@ -78,10 +79,10 @@ function ye(o, e) {
|
|
|
78
79
|
select: { kind: "group", key: f }
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function ge(o, e) {
|
|
82
83
|
const t = T(o);
|
|
83
84
|
if (t.layout.layout_type === "table") return y("Table layouts have no sections");
|
|
84
|
-
const n = K(t,
|
|
85
|
+
const n = K(t, J(t, e));
|
|
85
86
|
if (n.length === 0) return y("Select one or more fields first");
|
|
86
87
|
const a = n[0], r = a.group_key ? _(t, a.group_key) : null;
|
|
87
88
|
if (a.group_key && !r) return y("Those fields are not in a section of this form");
|
|
@@ -92,7 +93,7 @@ function _e(o, e) {
|
|
|
92
93
|
group_type: i ? "tab" : "section",
|
|
93
94
|
parent_key: l,
|
|
94
95
|
index: c
|
|
95
|
-
},
|
|
96
|
+
}, w = C(t, [v]), h = Z(w, n, p), b = [], k = n.length - h.ops.length;
|
|
96
97
|
return k > 0 && b.push(`${g(k, "field")} placed twice ${k === 1 ? "goes" : "go"} in once`), m(o, {
|
|
97
98
|
ok: !0,
|
|
98
99
|
ops: [v, ...h.ops],
|
|
@@ -101,13 +102,13 @@ function _e(o, e) {
|
|
|
101
102
|
select: { kind: "group", key: p }
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function ne(o, e) {
|
|
105
106
|
if (e === S) return "Ungrouped is not a section";
|
|
106
107
|
const t = _(o, e);
|
|
107
|
-
return t ? t.type === "container" ? "Use Convert to turn its tabs into sections" :
|
|
108
|
+
return t ? t.type === "container" ? "Use Convert to turn its tabs into sections" : X.has(t.type) ? null : "Only sections, tabs and steps hold fields" : "This comes from the parent form: override it here first";
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
-
const t =
|
|
110
|
+
function me(o, e) {
|
|
111
|
+
const t = ne(o, e);
|
|
111
112
|
if (t) return y(t);
|
|
112
113
|
const n = T(o), a = _(n, e), r = U(n, e), i = new Set(U(n, null).map((c) => c.field)), l = [], u = [], f = a.parent_key === null && i.size === 0 && !!_(n, S);
|
|
113
114
|
f && r.length > 0 && l.push({ op: "group_move", key: S, parent_key: null, index: a.sort }), l.push({ op: "group_remove", key: e, placements: "ungroup" }), r.length === 0 ? u.push("It holds no fields") : f ? u.push("Its fields stay where they are, as ungrouped fields") : u.push(`Its ${g(r.length, "field")} move to the end of Ungrouped`);
|
|
@@ -122,16 +123,16 @@ function be(o, e) {
|
|
|
122
123
|
select: { kind: "group", key: S }
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function se(o) {
|
|
126
127
|
const e = [];
|
|
127
128
|
return o.is_collapsed && e.push("“Starts collapsed” does not apply to tabs or steps (kept, unused)"), P(o.summary_fields).length && e.push("The collapsed summary does not apply to tabs or steps (kept, unused)"), e;
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function B(o) {
|
|
130
131
|
const e = [];
|
|
131
132
|
return P(o.visible_when).length && e.push("Its “Only when” rule works on steps and tabs only (kept, unused)"), P(o.skip_if_filled).length && e.push("“Skip when filled” works on steps only (kept, unused)"), e;
|
|
132
133
|
}
|
|
133
134
|
function A(o, e, t) {
|
|
134
|
-
const n = t === "steps" ? "step" : "tab", a = o.groups.filter((u) => u.parent_key === null).sort((u, f) => u.sort - f.sort), r = a[a.indexOf(e) - 1], i =
|
|
135
|
+
const n = t === "steps" ? "step" : "tab", a = o.groups.filter((u) => u.parent_key === null).sort((u, f) => u.sort - f.sort), r = a[a.indexOf(e) - 1], i = se(e), l = [{ op: "group_update", key: e.key, patch: { type: "tab" } }];
|
|
135
136
|
if ((r == null ? void 0 : r.type) === "container" && (r.tab_mode === "steps" ? "steps" : "tabs") === t && !F(r))
|
|
136
137
|
l.push({
|
|
137
138
|
op: "group_move",
|
|
@@ -165,7 +166,7 @@ function L(o, e, t) {
|
|
|
165
166
|
r.push({ op: "group_move", key: f.key, parent_key: null, index: e.sort + 1 + s }), r.push({ op: "group_update", key: f.key, patch: { type: "section" } });
|
|
166
167
|
});
|
|
167
168
|
const i = a.flatMap(
|
|
168
|
-
(f) =>
|
|
169
|
+
(f) => B(f).map((s) => a.length > 1 ? `${d(f)}: ${s}` : s)
|
|
169
170
|
);
|
|
170
171
|
a.length === n.length && (r.push({ op: "group_remove", key: e.key, placements: "ungroup" }), i.unshift(`${d(e)} is removed: it would be empty`)), t ? i.unshift(`Moves out of ${d(e)}, just below it`) : i.unshift(`${g(n.length, "tab")} become sections below one another`);
|
|
171
172
|
const u = t ? `Make ${d(t)} a section` : `Turn the ${x(o, n[0] ?? e) === "steps" ? "steps" : "tabs"} of ${d(e)} into sections`;
|
|
@@ -191,7 +192,7 @@ function E(o, e, t, n) {
|
|
|
191
192
|
select: { kind: "group", key: e.key }
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
+
function we(o, e) {
|
|
195
196
|
const t = T(o), n = _(t, e);
|
|
196
197
|
if (!n) return [];
|
|
197
198
|
const a = n.parent_key ? _(t, n.parent_key) : null, r = [];
|
|
@@ -206,7 +207,7 @@ function ge(o, e) {
|
|
|
206
207
|
ok: !0,
|
|
207
208
|
ops: [{ op: "group_update", key: n.key, patch: { type: "section" } }],
|
|
208
209
|
label: `Make ${d(n)} a section`,
|
|
209
|
-
notes:
|
|
210
|
+
notes: B(n),
|
|
210
211
|
select: { kind: "group", key: n.key }
|
|
211
212
|
})
|
|
212
213
|
}), r.push(
|
|
@@ -224,20 +225,20 @@ function ge(o, e) {
|
|
|
224
225
|
}
|
|
225
226
|
return r;
|
|
226
227
|
}
|
|
227
|
-
const
|
|
228
|
+
const re = ["visible_when", "hidden_for_roles", "locked_for_roles"], $e = {
|
|
228
229
|
visible_when: "Only when (step conditions)",
|
|
229
230
|
hidden_for_roles: "Hidden for roles",
|
|
230
231
|
locked_for_roles: "Read-only for roles"
|
|
231
|
-
}, W = /* @__PURE__ */ new Set(["section", "metadata", "tab"]),
|
|
232
|
-
function
|
|
233
|
-
return W.has(o.type) ?
|
|
232
|
+
}, W = /* @__PURE__ */ new Set(["section", "metadata", "tab"]), ve = (o, e) => P(o[e]).length > 0, N = (o) => JSON.stringify(P(o));
|
|
233
|
+
function Se(o) {
|
|
234
|
+
return W.has(o.type) ? re.filter((e) => e !== "visible_when" || o.type === "tab") : [];
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
+
function Te(o, e) {
|
|
236
237
|
return z(T(o)).filter(
|
|
237
238
|
(t) => t.key !== e && W.has(t.type)
|
|
238
239
|
);
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
+
function Oe(o, e, t, n) {
|
|
241
242
|
const a = _(o, e);
|
|
242
243
|
if (!a) return y("That section is no longer on this form");
|
|
243
244
|
if (n.length === 0) return y("Pick at least one rule");
|
|
@@ -266,7 +267,7 @@ function Se(o, e, t, n) {
|
|
|
266
267
|
notes: i
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
|
-
const
|
|
270
|
+
const Pe = {
|
|
270
271
|
group_label: "Section name",
|
|
271
272
|
text_block: "Text block",
|
|
272
273
|
label: "Field label on this form",
|
|
@@ -274,13 +275,13 @@ const Te = {
|
|
|
274
275
|
help: "Help text on this form",
|
|
275
276
|
field_label: "Field label (sets this form’s own)",
|
|
276
277
|
field_help: "Help text (sets this form’s own)"
|
|
277
|
-
},
|
|
278
|
-
function
|
|
279
|
-
return o ? new RegExp(
|
|
278
|
+
}, ie = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
279
|
+
function le(o, e) {
|
|
280
|
+
return o ? new RegExp(ie(o), e ? "g" : "gi") : null;
|
|
280
281
|
}
|
|
281
|
-
const
|
|
282
|
-
function
|
|
283
|
-
const a =
|
|
282
|
+
const $ = (o) => typeof o == "string" && o !== "" ? o : null;
|
|
283
|
+
function Ee(o, e, t, n = {}) {
|
|
284
|
+
const a = le(e, !!n.matchCase);
|
|
284
285
|
if (!a) return [];
|
|
285
286
|
const r = T(o), i = [], l = (s) => {
|
|
286
287
|
var p;
|
|
@@ -292,9 +293,9 @@ function Oe(o, e, t, n = {}) {
|
|
|
292
293
|
id: `group:${s.key}`,
|
|
293
294
|
kind: "group_label",
|
|
294
295
|
group: s.key,
|
|
295
|
-
where:
|
|
296
|
+
where: ae(r, s),
|
|
296
297
|
before: s.label
|
|
297
|
-
}), s.type === "content" &&
|
|
298
|
+
}), s.type === "content" && $(s.content) && l({
|
|
298
299
|
id: `content:${s.key}`,
|
|
299
300
|
kind: "text_block",
|
|
300
301
|
group: s.key,
|
|
@@ -311,31 +312,31 @@ function Oe(o, e, t, n = {}) {
|
|
|
311
312
|
r,
|
|
312
313
|
r.placements.filter((c) => !R(c))
|
|
313
314
|
)) {
|
|
314
|
-
const c = D(s), p = u.get(s.field),
|
|
315
|
-
|
|
315
|
+
const c = D(s), p = u.get(s.field), w = `${$(c.label) ?? $(s.label_override) ?? $(p == null ? void 0 : p.label) ?? I(s.field)} · ${f(s.group_key)}`, h = { field: s.field, group_key: s.group_key }, b = (k) => `${k}:${s.field}:${s.group_key ?? ""}`;
|
|
316
|
+
$(c.label) ? l({ id: b("label"), kind: "label", at: h, where: w, before: c.label }) : $(s.label_override) ? l({
|
|
316
317
|
id: b("label_override"),
|
|
317
318
|
kind: "label_override",
|
|
318
319
|
at: h,
|
|
319
|
-
where:
|
|
320
|
+
where: w,
|
|
320
321
|
before: s.label_override
|
|
321
|
-
}) :
|
|
322
|
+
}) : $(p == null ? void 0 : p.label) && !s.field.startsWith("__") && l({
|
|
322
323
|
id: b("field_label"),
|
|
323
324
|
kind: "field_label",
|
|
324
325
|
at: h,
|
|
325
|
-
where:
|
|
326
|
+
where: w,
|
|
326
327
|
before: p == null ? void 0 : p.label
|
|
327
|
-
}),
|
|
328
|
+
}), $(c.note) ? l({ id: b("help"), kind: "help", at: h, where: w, before: c.note }) : $(p == null ? void 0 : p.note) && !s.field.startsWith("__") && l({ id: b("field_help"), kind: "field_help", at: h, where: w, before: p == null ? void 0 : p.note });
|
|
328
329
|
}
|
|
329
330
|
return i;
|
|
330
331
|
}
|
|
331
332
|
function z(o) {
|
|
332
333
|
return o.groups.filter((t) => t.parent_key === null && t.key !== S).sort((t, n) => t.sort - n.sort).flatMap((t) => [t, ...O(o, t.key)]);
|
|
333
334
|
}
|
|
334
|
-
function
|
|
335
|
-
const t =
|
|
335
|
+
function ae(o, e) {
|
|
336
|
+
const t = ee(o, e);
|
|
336
337
|
return `${t[0].toUpperCase()}${t.slice(1)}`;
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
+
function xe(o, e) {
|
|
339
340
|
if (e.length === 0) return y("Pick at least one match");
|
|
340
341
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
341
342
|
for (const i of e)
|
|
@@ -360,7 +361,7 @@ function Pe(o, e) {
|
|
|
360
361
|
if (p.kind === "label_override") s.label_override = p.after;
|
|
361
362
|
else {
|
|
362
363
|
const v = p.kind === "label" || p.kind === "field_label" ? "label" : "note";
|
|
363
|
-
f =
|
|
364
|
+
f = q(f ?? {}, v, p.after === "" ? void 0 : p.after), c = !0;
|
|
364
365
|
}
|
|
365
366
|
c && (s.overrides = f), a.push({ op: "update_placement", at: l, patch: s });
|
|
366
367
|
}
|
|
@@ -373,27 +374,30 @@ function Pe(o, e) {
|
|
|
373
374
|
});
|
|
374
375
|
}
|
|
375
376
|
export {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
377
|
+
Pe as HIT_KIND_LABELS,
|
|
378
|
+
Ue as PIN_KEY,
|
|
379
|
+
re as RULE_KEYS,
|
|
380
|
+
$e as RULE_LABELS,
|
|
381
|
+
m as checked,
|
|
382
|
+
we as convertChoices,
|
|
383
|
+
Oe as copyRulesPlan,
|
|
384
|
+
oe as duplicateBlocked,
|
|
385
|
+
be as duplicatePlan,
|
|
386
|
+
Ee as findHits,
|
|
385
387
|
d as groupName,
|
|
388
|
+
z as groupsInPageOrder,
|
|
386
389
|
F as isPinned,
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
ve as
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
390
|
+
ee as kindWord,
|
|
391
|
+
Ae as pinLocked,
|
|
392
|
+
_e as pinPlan,
|
|
393
|
+
Le as pinnedZone,
|
|
394
|
+
y as refuse,
|
|
395
|
+
xe as replacePlan,
|
|
396
|
+
ve as ruleSet,
|
|
397
|
+
Te as ruleTargets,
|
|
398
|
+
Se as rulesOf,
|
|
399
|
+
ne as unwrapBlocked,
|
|
400
|
+
me as unwrapPlan,
|
|
401
|
+
G as withPin,
|
|
402
|
+
ge as wrapPlan
|
|
399
403
|
};
|