@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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +116 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3994 -3876
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var j = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var x = (t, e,
|
|
4
|
-
const
|
|
2
|
+
var I = (t, e, r) => e in t ? j(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var x = (t, e, r) => I(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
const R = [
|
|
5
5
|
"label_override",
|
|
6
6
|
"is_visible",
|
|
7
7
|
"default_expanded",
|
|
@@ -13,7 +13,7 @@ const P = [
|
|
|
13
13
|
"input_bindings",
|
|
14
14
|
"widget_id",
|
|
15
15
|
"show_approval_chain"
|
|
16
|
-
],
|
|
16
|
+
], W = 4e3, L = [
|
|
17
17
|
"label",
|
|
18
18
|
"type",
|
|
19
19
|
"icon",
|
|
@@ -30,8 +30,10 @@ const P = [
|
|
|
30
30
|
"visible_when",
|
|
31
31
|
"hidden_for_roles",
|
|
32
32
|
"locked_for_roles",
|
|
33
|
-
"read_width"
|
|
34
|
-
|
|
33
|
+
"read_width",
|
|
34
|
+
"editor_note",
|
|
35
|
+
"i18n"
|
|
36
|
+
], Y = [
|
|
35
37
|
"name",
|
|
36
38
|
"slug",
|
|
37
39
|
"create_label",
|
|
@@ -79,18 +81,19 @@ const P = [
|
|
|
79
81
|
"quick_picker",
|
|
80
82
|
"sheet_width",
|
|
81
83
|
"header_fields",
|
|
82
|
-
"hide_empty"
|
|
83
|
-
|
|
84
|
+
"hide_empty",
|
|
85
|
+
"change_note"
|
|
86
|
+
], m = ["section", "tab", "metadata", "container", "content"], d = "__ungrouped__", z = "__header__", C = [
|
|
84
87
|
"__apply_values__",
|
|
85
88
|
"__create_with_defaults__"
|
|
86
|
-
],
|
|
89
|
+
], D = [
|
|
87
90
|
"__pipeline__",
|
|
88
91
|
"__tasks__",
|
|
89
92
|
"__comments__",
|
|
90
93
|
"__addendums__",
|
|
91
94
|
"__referenced_by__",
|
|
92
95
|
"__related_records__"
|
|
93
|
-
],
|
|
96
|
+
], G = /^__ext_[a-z][a-z0-9-]{1,60}__$/, M = ["__ungrouped_pos__"], F = /* @__PURE__ */ new Map([
|
|
94
97
|
[d, 1],
|
|
95
98
|
["__pipeline__", 2],
|
|
96
99
|
["__tasks__", 3],
|
|
@@ -100,18 +103,18 @@ const P = [
|
|
|
100
103
|
["__addendums__", 7],
|
|
101
104
|
["__referenced_by__", 8],
|
|
102
105
|
["__related_records__", 9]
|
|
103
|
-
]),
|
|
104
|
-
class
|
|
105
|
-
constructor(
|
|
106
|
-
super(
|
|
106
|
+
]), P = (t) => F.get(t) ?? (G.test(t) ? 8 : 0);
|
|
107
|
+
class N extends Error {
|
|
108
|
+
constructor(r, s) {
|
|
109
|
+
super(r);
|
|
107
110
|
x(this, "op_index");
|
|
108
111
|
this.name = "LayoutOpError", this.op_index = s;
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
function f(t) {
|
|
112
|
-
return t.group_key !== null ? !1 :
|
|
115
|
+
return t.group_key !== null ? !1 : D.includes(t.field) || t.field === "__owners__" || t.field === "__pdf__" || G.test(t.field);
|
|
113
116
|
}
|
|
114
|
-
function
|
|
117
|
+
function X(t, e) {
|
|
115
118
|
return {
|
|
116
119
|
field: t,
|
|
117
120
|
group_key: e,
|
|
@@ -129,11 +132,11 @@ function H(t, e) {
|
|
|
129
132
|
show_approval_chain: !1
|
|
130
133
|
};
|
|
131
134
|
}
|
|
132
|
-
function
|
|
135
|
+
function H(t, e, r, s) {
|
|
133
136
|
return {
|
|
134
137
|
key: t,
|
|
135
138
|
label: e,
|
|
136
|
-
type:
|
|
139
|
+
type: r,
|
|
137
140
|
parent_key: s,
|
|
138
141
|
sort: 0,
|
|
139
142
|
icon: null,
|
|
@@ -154,151 +157,151 @@ function K(t, e, o, s) {
|
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
159
|
const g = (t, e) => t < e ? -1 : t > e ? 1 : 0, h = (t, e) => (t.id ?? Number.MAX_SAFE_INTEGER) - (e.id ?? Number.MAX_SAFE_INTEGER);
|
|
157
|
-
function
|
|
160
|
+
function K(t) {
|
|
158
161
|
return {
|
|
159
162
|
...t,
|
|
160
163
|
groups: [...t.groups].sort(
|
|
161
|
-
(e,
|
|
164
|
+
(e, r) => g(e.parent_key ?? "", r.parent_key ?? "") || e.sort - r.sort || h(e, r) || g(e.key, r.key)
|
|
162
165
|
),
|
|
163
166
|
placements: [...t.placements].sort(
|
|
164
|
-
(e,
|
|
167
|
+
(e, r) => g(e.group_key ?? "", r.group_key ?? "") || e.sort - r.sort || h(e, r) || g(e.field, r.field)
|
|
165
168
|
)
|
|
166
169
|
};
|
|
167
170
|
}
|
|
168
171
|
function p(t, e) {
|
|
169
|
-
return t.placements.map((
|
|
172
|
+
return t.placements.map((r, s) => ({ p: r, i: s })).filter(({ p: r }) => r.group_key === e && !f(r)).sort((r, s) => r.p.sort - s.p.sort || h(r.p, s.p) || r.i - s.i).map(({ p: r }) => r);
|
|
170
173
|
}
|
|
171
174
|
function u(t, e) {
|
|
172
|
-
const
|
|
173
|
-
return t.groups.forEach((s,
|
|
174
|
-
s.parent_key === e &&
|
|
175
|
-
}), e === null && t.placements.forEach((s,
|
|
176
|
-
f(s) &&
|
|
177
|
-
}),
|
|
175
|
+
const r = [];
|
|
176
|
+
return t.groups.forEach((s, l) => {
|
|
177
|
+
s.parent_key === e && r.push({ m: s, tie: P(s.key), i: l });
|
|
178
|
+
}), e === null && t.placements.forEach((s, l) => {
|
|
179
|
+
f(s) && r.push({ m: s, tie: P(s.field), i: t.groups.length + l });
|
|
180
|
+
}), r.sort((s, l) => s.m.sort - l.m.sort || s.tie - l.tie || h(s.m, l.m) || s.i - l.i).map((s) => s.m);
|
|
178
181
|
}
|
|
179
182
|
function c(t) {
|
|
180
|
-
t.forEach((e,
|
|
181
|
-
e.sort =
|
|
183
|
+
t.forEach((e, r) => {
|
|
184
|
+
e.sort = r;
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
|
-
function
|
|
187
|
+
function V(t) {
|
|
185
188
|
const e = /* @__PURE__ */ new Set();
|
|
186
189
|
for (const s of t.placements) f(s) || e.add(s.group_key);
|
|
187
190
|
for (const s of e) c(p(t, s));
|
|
188
|
-
const
|
|
189
|
-
for (const s of t.groups)
|
|
190
|
-
for (const s of
|
|
191
|
+
const r = /* @__PURE__ */ new Set([null]);
|
|
192
|
+
for (const s of t.groups) r.add(s.parent_key);
|
|
193
|
+
for (const s of r) c(u(t, s));
|
|
191
194
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
195
|
+
function J(t, e) {
|
|
196
|
+
const r = {
|
|
194
197
|
layout: { ...t.layout },
|
|
195
198
|
groups: t.groups.map((s) => ({ ...s })),
|
|
196
199
|
placements: t.placements.map((s) => ({ ...s }))
|
|
197
200
|
};
|
|
198
|
-
if (!Array.isArray(e)) throw new
|
|
199
|
-
return e.forEach((s,
|
|
200
|
-
B(
|
|
201
|
-
}),
|
|
201
|
+
if (!Array.isArray(e)) throw new N("ops must be an array", 0);
|
|
202
|
+
return e.forEach((s, l) => {
|
|
203
|
+
B(r, s, l), V(r);
|
|
204
|
+
}), K({ ...r, rev: t.rev });
|
|
202
205
|
}
|
|
203
|
-
function B(t, e,
|
|
206
|
+
function B(t, e, r) {
|
|
204
207
|
const s = (n) => {
|
|
205
|
-
throw new
|
|
208
|
+
throw new N(n, r);
|
|
206
209
|
};
|
|
207
210
|
(!e || typeof e != "object") && s("Each op must be an object");
|
|
208
|
-
const
|
|
211
|
+
const l = (n, o, i) => {
|
|
209
212
|
(typeof i != "number" || !Number.isFinite(i)) && s("index must be a number");
|
|
210
|
-
const
|
|
211
|
-
return [...n.slice(0,
|
|
212
|
-
}, y = (n,
|
|
213
|
+
const _ = Math.max(0, Math.min(n.length, Math.floor(i)));
|
|
214
|
+
return [...n.slice(0, _), o, ...n.slice(_)];
|
|
215
|
+
}, y = (n, o) => {
|
|
213
216
|
if (n == null) return {};
|
|
214
217
|
(typeof n != "object" || Array.isArray(n)) && s("patch must be an object");
|
|
215
218
|
for (const i of Object.keys(n))
|
|
216
|
-
|
|
219
|
+
o.includes(i) || s(`Unknown setting "${i}"`);
|
|
217
220
|
return n;
|
|
218
221
|
}, A = (n) => {
|
|
219
|
-
const
|
|
220
|
-
return
|
|
222
|
+
const o = y(n, L);
|
|
223
|
+
return o.type !== void 0 && !m.includes(o.type) && s(`Group type must be one of ${m.join(", ")}`), o.read_width != null && !["full", "half", "third"].includes(o.read_width) && s("read_width must be 'full', 'half', 'third' or null"), o.editor_note != null && (typeof o.editor_note != "string" || o.editor_note.length > 4e3) && s("A note must be text of at most 4000 characters"), o;
|
|
221
224
|
}, k = (n) => {
|
|
222
225
|
(!n || typeof n.field != "string") && s("A placement needs a field");
|
|
223
|
-
const
|
|
224
|
-
|
|
226
|
+
const o = n;
|
|
227
|
+
M.includes(o.field) && s(`"${o.field}" is a reserved name`);
|
|
225
228
|
const i = t.placements.find(
|
|
226
|
-
(
|
|
229
|
+
(_) => _.field === o.field && _.group_key === (o.group_key ?? null)
|
|
227
230
|
);
|
|
228
|
-
return i || s(`"${
|
|
231
|
+
return i || s(`"${o.field}" is not placed in ${o.group_key ?? "Ungrouped"}`), i;
|
|
229
232
|
}, b = (n) => {
|
|
230
233
|
n === d && s("The Ungrouped zone can only be moved");
|
|
231
|
-
const
|
|
232
|
-
return
|
|
234
|
+
const o = t.groups.find((i) => i.key === n);
|
|
235
|
+
return o || s(`No group "${String(n)}"`), o;
|
|
233
236
|
}, O = (n) => {
|
|
234
|
-
if (n === null || n ===
|
|
235
|
-
const
|
|
236
|
-
(!
|
|
237
|
-
},
|
|
237
|
+
if (n === null || n === z || t.layout.layout_type === "table" && C.includes(n)) return;
|
|
238
|
+
const o = t.groups.find((i) => i.key === n);
|
|
239
|
+
(!o || o.key === d) && s(`No group "${n}"`), o.type === "container" && s("Fields go in the tabs of a container"), o.type === "content" && s("A text block holds text, not fields");
|
|
240
|
+
}, T = (n, o) => {
|
|
238
241
|
if (n === null) return;
|
|
239
|
-
const i = t.groups.find((
|
|
240
|
-
(i == null ? void 0 : i.type) !== "container" && s(`"${n}" is not a container`),
|
|
241
|
-
},
|
|
242
|
-
const i = f(n) ? u(t, null).filter((
|
|
243
|
-
c(
|
|
242
|
+
const i = t.groups.find((_) => _.key === n);
|
|
243
|
+
(i == null ? void 0 : i.type) !== "container" && s(`"${n}" is not a container`), o !== "tab" && s("Only tabs go inside a container");
|
|
244
|
+
}, S = (n, o) => {
|
|
245
|
+
const i = f(n) ? u(t, null).filter((_) => _ !== n) : p(t, n.group_key).filter((_) => _ !== n);
|
|
246
|
+
c(l(i, n, o));
|
|
244
247
|
};
|
|
245
248
|
switch (e.op) {
|
|
246
249
|
case "place": {
|
|
247
|
-
(typeof e.field != "string" || !e.field) && s("place needs a field"),
|
|
250
|
+
(typeof e.field != "string" || !e.field) && s("place needs a field"), M.includes(e.field) && s(`"${e.field}" is a reserved name`);
|
|
248
251
|
const n = e.group_key ?? null;
|
|
249
252
|
O(n), t.placements.some((i) => i.field === e.field && i.group_key === n) && s(`"${e.field}" is already in ${n ?? "Ungrouped"}`);
|
|
250
|
-
const
|
|
251
|
-
...
|
|
252
|
-
...y(e.patch,
|
|
253
|
+
const o = {
|
|
254
|
+
...X(e.field, n),
|
|
255
|
+
...y(e.patch, R)
|
|
253
256
|
};
|
|
254
|
-
t.placements.push(
|
|
257
|
+
t.placements.push(o), S(o, e.index);
|
|
255
258
|
return;
|
|
256
259
|
}
|
|
257
260
|
case "move": {
|
|
258
|
-
const n = k(e.from),
|
|
259
|
-
|
|
261
|
+
const n = k(e.from), o = e.to_group_key ?? null;
|
|
262
|
+
o !== n.group_key && (O(o), t.placements.some((i) => i.field === n.field && i.group_key === o) && s(`"${n.field}" is already in ${o ?? "Ungrouped"}`), n.group_key = o), S(n, e.index);
|
|
260
263
|
return;
|
|
261
264
|
}
|
|
262
265
|
case "update_placement": {
|
|
263
266
|
const n = k(e.at);
|
|
264
|
-
Object.assign(n, y(e.patch,
|
|
267
|
+
Object.assign(n, y(e.patch, R));
|
|
265
268
|
return;
|
|
266
269
|
}
|
|
267
270
|
case "remove": {
|
|
268
271
|
const n = k(e.at);
|
|
269
|
-
t.placements = t.placements.filter((
|
|
272
|
+
t.placements = t.placements.filter((o) => o !== n);
|
|
270
273
|
return;
|
|
271
274
|
}
|
|
272
275
|
case "group_create": {
|
|
273
276
|
(typeof e.key != "string" || !e.key.trim()) && s("A group needs a key"), e.key.startsWith("__") && s("Group keys starting with __ are reserved"), t.groups.some((v) => v.key === e.key) && s(`A group "${e.key}" already exists`), typeof e.label != "string" && s("A group needs a label");
|
|
274
|
-
const n = A(e.patch),
|
|
275
|
-
m.includes(
|
|
277
|
+
const n = A(e.patch), o = n.type ?? e.group_type;
|
|
278
|
+
m.includes(o) || s(`Group type must be one of ${m.join(", ")}`);
|
|
276
279
|
const i = e.parent_key ?? null;
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
t.groups.push(
|
|
280
|
+
T(i, o);
|
|
281
|
+
const _ = { ...H(e.key, e.label, o, i), ...n }, w = u(t, i);
|
|
282
|
+
t.groups.push(_), c(l(w, _, e.index));
|
|
280
283
|
return;
|
|
281
284
|
}
|
|
282
285
|
case "group_update": {
|
|
283
|
-
const n = b(e.key),
|
|
284
|
-
|
|
286
|
+
const n = b(e.key), o = A(e.patch);
|
|
287
|
+
o.type !== void 0 && o.type !== n.type && (n.parent_key !== null && o.type !== "tab" && s("Only tabs go inside a container"), n.type === "container" && t.groups.some((i) => i.parent_key === n.key) && s("Move the tabs out of this container first"), (o.type === "container" || o.type === "content") && p(t, n.key).length && s("Move the fields out of this section first")), Object.assign(n, o);
|
|
285
288
|
return;
|
|
286
289
|
}
|
|
287
290
|
case "group_move": {
|
|
288
291
|
const n = e.parent_key ?? null;
|
|
289
|
-
let
|
|
292
|
+
let o;
|
|
290
293
|
if (e.key === d || f({ field: e.key, group_key: null })) {
|
|
291
294
|
n !== null && s("This stays at the top level of the form");
|
|
292
|
-
const i = e.key === d ? t.groups.find((
|
|
293
|
-
i || s(`"${e.key}" is not on this form`),
|
|
295
|
+
const i = e.key === d ? t.groups.find((_) => _.key === d) : t.placements.find((_) => _.field === e.key && _.group_key === null);
|
|
296
|
+
i || s(`"${e.key}" is not on this form`), o = i;
|
|
294
297
|
} else {
|
|
295
298
|
const i = b(e.key);
|
|
296
|
-
|
|
299
|
+
T(n, i.type), i.parent_key = n, o = i;
|
|
297
300
|
}
|
|
298
301
|
c(
|
|
299
|
-
|
|
300
|
-
u(t, n).filter((i) => i !==
|
|
301
|
-
|
|
302
|
+
l(
|
|
303
|
+
u(t, n).filter((i) => i !== o),
|
|
304
|
+
o,
|
|
302
305
|
e.index
|
|
303
306
|
)
|
|
304
307
|
);
|
|
@@ -307,22 +310,22 @@ function B(t, e, o) {
|
|
|
307
310
|
case "group_remove": {
|
|
308
311
|
const n = b(e.key);
|
|
309
312
|
e.placements !== "ungroup" && e.placements !== "delete" && s("placements must be 'ungroup' or 'delete'");
|
|
310
|
-
const
|
|
313
|
+
const o = u(t, n.parent_key), i = u(t, n.key);
|
|
311
314
|
for (const a of i) a.parent_key = n.parent_key;
|
|
312
|
-
const
|
|
313
|
-
c([...
|
|
315
|
+
const _ = o.indexOf(n);
|
|
316
|
+
c([...o.slice(0, _), ...i, ...o.slice(_ + 1)]), t.groups = t.groups.filter((a) => a !== n);
|
|
314
317
|
const w = p(t, n.key);
|
|
315
318
|
if (t.placements = t.placements.filter((a) => a.group_key !== n.key), e.placements === "delete") return;
|
|
316
|
-
const v = p(t, null),
|
|
317
|
-
(a) => !t.placements.some((
|
|
319
|
+
const v = p(t, null), U = u(t, null), E = w.filter(
|
|
320
|
+
(a) => !t.placements.some(($) => $.field === a.field && $.group_key === null)
|
|
318
321
|
);
|
|
319
322
|
for (const a of E)
|
|
320
323
|
a.group_key = null, t.placements.push(a);
|
|
321
|
-
c([...v, ...E.filter((a) => !f(a))]), c([...
|
|
324
|
+
c([...v, ...E.filter((a) => !f(a))]), c([...U, ...E.filter((a) => f(a))]);
|
|
322
325
|
return;
|
|
323
326
|
}
|
|
324
327
|
case "layout_update": {
|
|
325
|
-
Object.assign(t.layout, y(e.patch,
|
|
328
|
+
Object.assign(t.layout, y(e.patch, Y));
|
|
326
329
|
return;
|
|
327
330
|
}
|
|
328
331
|
default:
|
|
@@ -330,19 +333,20 @@ function B(t, e, o) {
|
|
|
330
333
|
}
|
|
331
334
|
}
|
|
332
335
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
D as CANVAS_SLOT_KEYS,
|
|
337
|
+
W as EDITOR_NOTE_MAX,
|
|
338
|
+
L as GROUP_PATCH_KEYS,
|
|
335
339
|
m as GROUP_TYPES,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
z as HEADER_GROUP_KEY,
|
|
341
|
+
Y as LAYOUT_PATCH_KEYS,
|
|
342
|
+
N as LayoutOpError,
|
|
343
|
+
R as PLACEMENT_PATCH_KEYS,
|
|
344
|
+
M as RESERVED_FIELDS,
|
|
345
|
+
C as TABLE_FORM_GROUP_KEYS,
|
|
342
346
|
d as UNGROUPED_KEY,
|
|
343
|
-
|
|
347
|
+
J as applyLayoutOps,
|
|
344
348
|
f as isCanvasSlot,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
349
|
+
H as newGroup,
|
|
350
|
+
X as newPlacement,
|
|
351
|
+
K as sortBundleRows
|
|
348
352
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = "••••••", f = /* @__PURE__ */ new Set([
|
|
2
2
|
"button",
|
|
3
3
|
"submit",
|
|
4
4
|
"reset",
|
|
@@ -9,54 +9,80 @@ const r = "••••••", c = /* @__PURE__ */ new Set([
|
|
|
9
9
|
"image",
|
|
10
10
|
"hidden"
|
|
11
11
|
]);
|
|
12
|
-
function
|
|
13
|
-
for (const t of Array.from(
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
|
|
12
|
+
function u(e) {
|
|
13
|
+
for (const t of Array.from(e.querySelectorAll("input"))) {
|
|
14
|
+
const n = t;
|
|
15
|
+
if (f.has((n.type || "text").toLowerCase())) continue;
|
|
16
|
+
const r = n.value !== "";
|
|
17
|
+
n.value = r ? a : "", n.setAttribute("value", r ? a : "");
|
|
18
18
|
}
|
|
19
|
-
for (const t of Array.from(
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
for (const t of Array.from(e.querySelectorAll("textarea"))) {
|
|
20
|
+
const n = t, r = n.value !== "";
|
|
21
|
+
n.value = r ? a : "", n.textContent = r ? a : "";
|
|
22
22
|
}
|
|
23
|
-
for (const t of Array.from(
|
|
24
|
-
const
|
|
25
|
-
for (const
|
|
23
|
+
for (const t of Array.from(e.querySelectorAll("select"))) {
|
|
24
|
+
const n = t;
|
|
25
|
+
for (const r of Array.from(n.options)) r.textContent = a;
|
|
26
26
|
}
|
|
27
27
|
for (const t of Array.from(
|
|
28
|
-
|
|
28
|
+
e.querySelectorAll('[contenteditable=""], [contenteditable="true"]')
|
|
29
29
|
))
|
|
30
|
-
t.textContent = t.textContent ?
|
|
31
|
-
for (const t of Array.from(
|
|
30
|
+
t.textContent = t.textContent ? a : "";
|
|
31
|
+
for (const t of Array.from(e.querySelectorAll(".nvr-no-record")))
|
|
32
32
|
t.style.visibility = "hidden";
|
|
33
33
|
}
|
|
34
34
|
async function s() {
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const e = await import("html2canvas");
|
|
37
|
+
return e.default ?? e;
|
|
38
38
|
} catch {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
async function
|
|
42
|
+
async function m(e = {}) {
|
|
43
43
|
if (typeof document > "u") return null;
|
|
44
44
|
const t = await s();
|
|
45
45
|
if (!t) return null;
|
|
46
|
-
const
|
|
46
|
+
const n = e.ignoreAttr ?? "data-report-problem";
|
|
47
47
|
try {
|
|
48
|
-
const
|
|
48
|
+
const r = await t(document.body, {
|
|
49
49
|
logging: !1,
|
|
50
|
-
scale: Math.min(1, (
|
|
51
|
-
ignoreElements: (
|
|
52
|
-
onclone: (
|
|
53
|
-
}),
|
|
54
|
-
return
|
|
50
|
+
scale: Math.min(1, (e.maxWidth ?? 1280) / Math.max(1, window.innerWidth)),
|
|
51
|
+
ignoreElements: (l) => l.hasAttribute(n),
|
|
52
|
+
onclone: (l) => u(l)
|
|
53
|
+
}), i = r.toDataURL("image/jpeg", 0.7);
|
|
54
|
+
return i.length > 24e5 ? r.toDataURL("image/jpeg", 0.4) : i;
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function d(e, t = {}) {
|
|
60
|
+
if (typeof document > "u") return null;
|
|
61
|
+
const n = await s();
|
|
62
|
+
if (!n) return null;
|
|
63
|
+
const r = Math.max(1, e.scrollWidth || e.clientWidth);
|
|
64
|
+
try {
|
|
65
|
+
const i = await n(e, {
|
|
66
|
+
logging: !1,
|
|
67
|
+
backgroundColor: null,
|
|
68
|
+
scale: Math.min(1, (t.maxWidth ?? 1200) / r),
|
|
69
|
+
ignoreElements: (o) => {
|
|
70
|
+
var c;
|
|
71
|
+
return !!t.ignoreSelector && ((c = o.matches) == null ? void 0 : c.call(o, t.ignoreSelector));
|
|
72
|
+
},
|
|
73
|
+
onclone: (o) => u(o)
|
|
74
|
+
}), l = t.maxChars ?? 19e5;
|
|
75
|
+
for (const o of [0.7, 0.5, 0.35]) {
|
|
76
|
+
const c = i.toDataURL("image/jpeg", o);
|
|
77
|
+
if (c.length <= l) return c;
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
55
80
|
} catch {
|
|
56
81
|
return null;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
84
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
d as captureElementImage,
|
|
86
|
+
m as captureMaskedScreenshot,
|
|
87
|
+
u as maskInputsIn
|
|
62
88
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function s(e) {
|
|
2
|
+
if (e == null || e === "") return [];
|
|
3
|
+
try {
|
|
4
|
+
const u = typeof e == "string" ? JSON.parse(e) : e;
|
|
5
|
+
return Array.isArray(u) ? u.filter((r) => r && typeof r == "object") : [];
|
|
6
|
+
} catch {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function c(e, u) {
|
|
11
|
+
const r = s(e);
|
|
12
|
+
return r.length === 0 ? !0 : r.every((n) => {
|
|
13
|
+
if (!(n != null && n.field)) return !0;
|
|
14
|
+
const t = u[n.field], i = n.value;
|
|
15
|
+
switch (n.op ?? "eq") {
|
|
16
|
+
case "eq":
|
|
17
|
+
return String(t ?? "") === String(i ?? "");
|
|
18
|
+
case "neq":
|
|
19
|
+
return String(t ?? "") !== String(i ?? "");
|
|
20
|
+
case "null":
|
|
21
|
+
return t == null || t === "";
|
|
22
|
+
case "nnull":
|
|
23
|
+
return t != null && t !== "";
|
|
24
|
+
case "in":
|
|
25
|
+
return String(i ?? "").split(",").map((l) => l.trim()).includes(String(t ?? ""));
|
|
26
|
+
default:
|
|
27
|
+
return !0;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
c as matchesVisibleWhen,
|
|
33
|
+
s as parseVisibleWhen
|
|
34
|
+
};
|