@nivaro/react 0.3.36 → 0.3.37
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/components/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +11 -10
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const u = 3, p = 50, E = 16, A = 20, g = 200, a = [
|
|
2
2
|
"slate",
|
|
3
3
|
"blue",
|
|
4
4
|
"cyan",
|
|
@@ -7,15 +7,15 @@ const p = 3, u = 50, E = 16, A = 20, g = 200, l = [
|
|
|
7
7
|
"orange",
|
|
8
8
|
"rose",
|
|
9
9
|
"violet"
|
|
10
|
-
],
|
|
10
|
+
], l = ["width", "required", "help", "placeholder", "input", "lock"], o = (e) => !!e && typeof e == "object" && !Array.isArray(e), _ = /^[A-Za-z_][A-Za-z0-9_.]*$/;
|
|
11
11
|
function f(e) {
|
|
12
12
|
if (!o(e)) return null;
|
|
13
|
-
const t = typeof e.name == "string" ? e.name.replace(/\s+/g, " ").trim().slice(0, 60) : "",
|
|
14
|
-
if (!t || !
|
|
13
|
+
const t = typeof e.name == "string" ? e.name.replace(/\s+/g, " ").trim().slice(0, 60) : "", n = typeof e.id == "string" ? e.id.replace(/[^A-Za-z0-9_-]/g, "").slice(0, 40) : "";
|
|
14
|
+
if (!t || !n) return null;
|
|
15
15
|
const r = (Array.isArray(e.parts) ? e.parts : []).filter(
|
|
16
|
-
(c) =>
|
|
17
|
-
),
|
|
18
|
-
return (e.col_span === null || typeof e.col_span == "number") && (
|
|
16
|
+
(c) => l.includes(c)
|
|
17
|
+
), s = { id: n, name: t, parts: [...new Set(r)] };
|
|
18
|
+
return (e.col_span === null || typeof e.col_span == "number") && (s.col_span = e.col_span === null ? null : Math.min(12, Math.max(1, Math.round(e.col_span)))), o(e.overrides) && (s.overrides = e.overrides), (e.lock_conditions === null || typeof e.lock_conditions == "string") && (s.lock_conditions = e.lock_conditions), s;
|
|
19
19
|
}
|
|
20
20
|
function d(e) {
|
|
21
21
|
let t = e;
|
|
@@ -26,30 +26,30 @@ function d(e) {
|
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
if (!o(t)) return null;
|
|
29
|
-
const
|
|
30
|
-
if (t.focus_first === !0 && (
|
|
29
|
+
const n = {};
|
|
30
|
+
if (t.focus_first === !0 && (n.focus_first = !0), t.enter_next === !0 && (n.enter_next = !0), t.adaptive === !0 && (n.adaptive = !0), t.glossary === !1 && (n.glossary = !1), t.density === "compact" && (n.density = "compact"), t.tour === !0 && (n.tour = !0), typeof t.adaptive_threshold == "number" && Number.isFinite(t.adaptive_threshold)) {
|
|
31
31
|
const r = Math.min(50, Math.max(1, Math.round(t.adaptive_threshold)));
|
|
32
|
-
r !== 3 && (
|
|
32
|
+
r !== 3 && (n.adaptive_threshold = r);
|
|
33
33
|
}
|
|
34
34
|
if (Array.isArray(t.tab_order)) {
|
|
35
35
|
const r = [
|
|
36
|
-
...new Set(t.tab_order.filter((
|
|
36
|
+
...new Set(t.tab_order.filter((s) => typeof s == "string" && _.test(s)))
|
|
37
37
|
].slice(0, 200);
|
|
38
|
-
r.length && (
|
|
38
|
+
r.length && (n.tab_order = r);
|
|
39
39
|
}
|
|
40
40
|
if (o(t.badge)) {
|
|
41
|
-
const r = typeof t.badge.tag == "string" ? t.badge.tag.replace(/\s+/g, " ").trim().slice(0, 16) : "",
|
|
42
|
-
r && (
|
|
41
|
+
const r = typeof t.badge.tag == "string" ? t.badge.tag.replace(/\s+/g, " ").trim().slice(0, 16) : "", s = a.includes(t.badge.color) ? t.badge.color : "slate";
|
|
42
|
+
r && (n.badge = { tag: r, color: s });
|
|
43
43
|
}
|
|
44
44
|
if (Array.isArray(t.presets)) {
|
|
45
|
-
const r = /* @__PURE__ */ new Set(),
|
|
45
|
+
const r = /* @__PURE__ */ new Set(), s = [];
|
|
46
46
|
for (const c of t.presets) {
|
|
47
47
|
const i = f(c);
|
|
48
|
-
if (i && !r.has(i.id) && (r.add(i.id),
|
|
48
|
+
if (i && !r.has(i.id) && (r.add(i.id), s.push(i)), s.length >= 20) break;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
s.length && (n.presets = s);
|
|
51
51
|
}
|
|
52
|
-
return Object.keys(
|
|
52
|
+
return Object.keys(n).length ? n : null;
|
|
53
53
|
}
|
|
54
54
|
function T(e) {
|
|
55
55
|
return d(e == null ? void 0 : e.entry_config) ?? {};
|
|
@@ -58,13 +58,13 @@ function h(e, t) {
|
|
|
58
58
|
return e < (t.adaptive_threshold ?? 3);
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
a as BADGE_COLORS,
|
|
62
62
|
E as ENTRY_BADGE_TAG_MAX,
|
|
63
63
|
A as ENTRY_PRESETS_MAX,
|
|
64
64
|
g as ENTRY_TAB_ORDER_MAX,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
u as ENTRY_THRESHOLD_DEFAULT,
|
|
66
|
+
p as ENTRY_THRESHOLD_MAX,
|
|
67
|
+
l as PRESET_PARTS,
|
|
68
68
|
T as entryConfigOf,
|
|
69
69
|
h as isBeginner,
|
|
70
70
|
d as sanitizeEntryConfig
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
let h = null,
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
if (
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var g = (t, e, n) => e in t ? w(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var o = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
const l = [];
|
|
5
|
+
let h = null, c = null, p = !1;
|
|
6
|
+
const v = 20, m = 15e3;
|
|
7
|
+
function a() {
|
|
8
|
+
if (c && (clearTimeout(c), c = null), !h || l.length === 0) return;
|
|
9
9
|
const { apiBase: t, authHeaders: e, credentials: n } = h;
|
|
10
|
-
for (;
|
|
11
|
-
const
|
|
10
|
+
for (; l.length; ) {
|
|
11
|
+
const i = JSON.stringify({ events: l.splice(0, v) });
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
14
|
-
!(Object.keys(e).length > 0) && typeof navigator < "u" && typeof navigator.sendBeacon == "function" && navigator.sendBeacon(
|
|
13
|
+
const s = `${t}/layout-usage/beacon`;
|
|
14
|
+
!(Object.keys(e).length > 0) && typeof navigator < "u" && typeof navigator.sendBeacon == "function" && navigator.sendBeacon(s, new Blob([i], { type: "application/json" })) || fetch(s, {
|
|
15
15
|
method: "POST",
|
|
16
16
|
credentials: n,
|
|
17
17
|
headers: { "Content-Type": "application/json", ...e },
|
|
18
|
-
body:
|
|
18
|
+
body: i,
|
|
19
19
|
keepalive: !0
|
|
20
20
|
}).catch(() => {
|
|
21
21
|
});
|
|
@@ -23,20 +23,20 @@ function l() {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
document.visibilityState === "hidden" &&
|
|
26
|
+
function y() {
|
|
27
|
+
p || typeof window > "u" || (p = !0, window.addEventListener("pagehide", a), document.addEventListener("visibilitychange", () => {
|
|
28
|
+
document.visibilityState === "hidden" && a();
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
h = e,
|
|
31
|
+
function O(t, e) {
|
|
32
|
+
h = e, l.push(t), y(), l.length >= v ? a() : c || (c = setTimeout(a, m));
|
|
33
33
|
}
|
|
34
|
-
class
|
|
35
|
-
constructor(e, n,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.current = e, this.since =
|
|
34
|
+
class _ {
|
|
35
|
+
constructor(e, n, i = !0) {
|
|
36
|
+
o(this, "steps", {});
|
|
37
|
+
o(this, "current");
|
|
38
|
+
o(this, "since");
|
|
39
|
+
this.current = e, this.since = i ? n : null;
|
|
40
40
|
}
|
|
41
41
|
settle(e) {
|
|
42
42
|
if (this.since == null) return;
|
|
@@ -58,53 +58,88 @@ class k {
|
|
|
58
58
|
/** The time so far in this chunk, without starting afresh. */
|
|
59
59
|
peek(e) {
|
|
60
60
|
const n = this.since == null ? 0 : Math.max(0, e - this.since);
|
|
61
|
-
return Object.values(this.steps).reduce((
|
|
61
|
+
return Object.values(this.steps).reduce((i, s) => i + s, 0) + n;
|
|
62
62
|
}
|
|
63
63
|
/** The time so far, and start counting afresh (the clock keeps running). */
|
|
64
64
|
take(e) {
|
|
65
65
|
this.settle(e);
|
|
66
66
|
const n = this.steps;
|
|
67
|
-
return this.steps = {}, { steps: n, total: Object.values(n).reduce((
|
|
67
|
+
return this.steps = {}, { steps: n, total: Object.values(n).reduce((i, s) => i + s, 0) };
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
class A {
|
|
71
|
+
constructor() {
|
|
72
|
+
o(this, "tries", 0);
|
|
73
|
+
o(this, "fields", {});
|
|
74
|
+
}
|
|
75
|
+
note(e, n) {
|
|
76
|
+
const i = Object.keys(e).filter((s) => /^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(s));
|
|
77
|
+
if (i.length !== 0) {
|
|
78
|
+
this.tries++;
|
|
79
|
+
for (const s of i.slice(0, 60)) {
|
|
80
|
+
this.fields[s] || (this.fields[s] = { required: 0, invalid: 0 });
|
|
81
|
+
const d = this.fields[s], u = e[s] ?? "";
|
|
82
|
+
n === "required" || n == null && (u === "This field is required" || /^At least one .+ is required$/.test(u)) ? d.required++ : d.invalid++;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** What to send, and start counting afresh; null when nothing was refused. */
|
|
87
|
+
take() {
|
|
88
|
+
if (this.tries === 0) return null;
|
|
89
|
+
const e = { tries: this.tries, fields: this.fields };
|
|
90
|
+
return this.tries = 0, this.fields = {}, e;
|
|
91
|
+
}
|
|
92
|
+
/** Put an unsent chunk back (the event was not sent). */
|
|
93
|
+
restore(e) {
|
|
94
|
+
if (e) {
|
|
95
|
+
this.tries += e.tries;
|
|
96
|
+
for (const [n, i] of Object.entries(e.fields)) {
|
|
97
|
+
this.fields[n] || (this.fields[n] = { required: 0, invalid: 0 });
|
|
98
|
+
const s = this.fields[n];
|
|
99
|
+
s.required += i.required, s.invalid += i.invalid;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const b = 400, M = 3e3;
|
|
105
|
+
function T(t) {
|
|
106
|
+
const e = t.refused && t.refused.tries > 0 ? t.refused : null;
|
|
107
|
+
if (!t.saved && !e && !t.openSent && t.elapsed < b || !t.saved && !e && t.openSent && t.total <= 0) return null;
|
|
108
|
+
const n = {
|
|
74
109
|
layout_id: t.layoutId,
|
|
75
110
|
collection: t.collection,
|
|
76
111
|
item: t.item,
|
|
77
112
|
open: !t.openSent,
|
|
78
113
|
saved: t.saved,
|
|
79
|
-
abandoned_step: t.final && t.item == null && !t.saved && t.elapsed >=
|
|
114
|
+
abandoned_step: t.final && t.item == null && !t.saved && t.elapsed >= M ? t.step : null,
|
|
80
115
|
steps: t.steps
|
|
81
116
|
};
|
|
82
|
-
return t.sections && (t.sections.shown.length || t.sections.opened.length) && (
|
|
117
|
+
return t.sections && (t.sections.shown.length || t.sections.opened.length) && (n.sections = t.sections), t.saved && t.saveMs != null && t.saveMs > 0 && (n.save_ms = Math.round(t.saveMs)), e && (n.refused = e), n;
|
|
83
118
|
}
|
|
84
|
-
const
|
|
85
|
-
function
|
|
119
|
+
const f = /* @__PURE__ */ new Set(), r = [], S = 5e3;
|
|
120
|
+
function j(t) {
|
|
86
121
|
const e = Date.now();
|
|
87
|
-
for (
|
|
88
|
-
|
|
89
|
-
for (const n of
|
|
122
|
+
for (r.push({ ...t, at: e }); r.length > 200 || r[0] && e - r[0].at > S; )
|
|
123
|
+
r.shift();
|
|
124
|
+
for (const n of f)
|
|
90
125
|
try {
|
|
91
126
|
n(t);
|
|
92
127
|
} catch {
|
|
93
128
|
}
|
|
94
129
|
}
|
|
95
|
-
function
|
|
130
|
+
function B(t) {
|
|
96
131
|
const e = Date.now();
|
|
97
|
-
for (const n of
|
|
98
|
-
return
|
|
99
|
-
|
|
132
|
+
for (const n of r) n.kind === "shown" && e - n.at <= S && t(n);
|
|
133
|
+
return f.add(t), () => {
|
|
134
|
+
f.delete(t);
|
|
100
135
|
};
|
|
101
136
|
}
|
|
102
|
-
class
|
|
137
|
+
class N {
|
|
103
138
|
constructor() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
139
|
+
o(this, "shown", /* @__PURE__ */ new Set());
|
|
140
|
+
o(this, "opened", /* @__PURE__ */ new Set());
|
|
141
|
+
o(this, "sentShown", /* @__PURE__ */ new Set());
|
|
142
|
+
o(this, "sentOpened", /* @__PURE__ */ new Set());
|
|
108
143
|
}
|
|
109
144
|
note(e, n) {
|
|
110
145
|
e === "opened" ? (this.shown.add(n), this.opened.add(n)) : this.shown.add(n);
|
|
@@ -121,13 +156,14 @@ class j {
|
|
|
121
156
|
}
|
|
122
157
|
}
|
|
123
158
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
159
|
+
M as MIN_ABANDON_MS,
|
|
160
|
+
b as MIN_SESSION_MS,
|
|
161
|
+
A as RefusalTally,
|
|
162
|
+
N as SectionTally,
|
|
163
|
+
_ as StepClock,
|
|
164
|
+
a as flushFormUsage,
|
|
165
|
+
B as onSectionUse,
|
|
166
|
+
O as queueFormUsage,
|
|
167
|
+
j as reportSectionUse,
|
|
168
|
+
T as sessionEvent
|
|
133
169
|
};
|