@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,40 +1,41 @@
|
|
|
1
|
-
import { jsx as i, Fragment as
|
|
2
|
-
import { EyeOff as
|
|
3
|
-
import { isValidElement as
|
|
4
|
-
import { cn as f, formatRelative as
|
|
5
|
-
import { useLayoutDesign as
|
|
6
|
-
import { useDesignDndNode as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { jsx as i, Fragment as S, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { EyeOff as xe, Lock as ye, Pin as Ne } from "lucide-react";
|
|
3
|
+
import { isValidElement as re, Fragment as _e, cloneElement as De } from "react";
|
|
4
|
+
import { cn as f, formatRelative as we } from "../../lib/utils.js";
|
|
5
|
+
import { useLayoutDesign as oe, targetKey as Ce, isSelectedIn as $e } from "./design-context.js";
|
|
6
|
+
import { useDesignDndNode as Te, NO_DND as Re, useDesignDropBody as ze } from "./dnd/node.js";
|
|
7
|
+
import { ResizeHandle as je } from "./grid-guides.js";
|
|
8
|
+
import { NoteMarker as Fe } from "./NoteMarker.js";
|
|
9
|
+
import { FillChip as Me } from "./usage/FillChip.js";
|
|
10
|
+
const te = (e, a) => {
|
|
10
11
|
typeof e == "function" ? e(a) : e && typeof e == "object" && (e.current = a);
|
|
11
12
|
};
|
|
12
|
-
function
|
|
13
|
+
function ne(...e) {
|
|
13
14
|
const a = {};
|
|
14
15
|
for (const o of e)
|
|
15
16
|
for (const [r, d] of Object.entries(o)) {
|
|
16
17
|
const c = a[r];
|
|
17
18
|
d !== void 0 && (c === void 0 ? a[r] = d : r === "className" ? a[r] = `${c} ${d}` : r === "style" ? a[r] = { ...c, ...d } : r === "ref" ? a[r] = (n) => {
|
|
18
|
-
|
|
19
|
+
te(c, n), te(d, n);
|
|
19
20
|
} : /^on[A-Z]/.test(r) && typeof c == "function" && typeof d == "function" ? a[r] = (...n) => {
|
|
20
21
|
c(...n), d(...n);
|
|
21
22
|
} : a[r] = d);
|
|
22
23
|
}
|
|
23
24
|
return a;
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
+
const Ae = {
|
|
26
27
|
violet: "bg-violet-50 text-violet-800 ring-violet-200 dark:bg-violet-500/15 dark:text-violet-200 dark:ring-violet-500/30",
|
|
27
28
|
emerald: "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-200 dark:ring-emerald-500/30",
|
|
28
29
|
amber: "bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-500/30",
|
|
29
30
|
slate: "bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-800 dark:text-slate-200 dark:ring-slate-700"
|
|
30
|
-
},
|
|
31
|
+
}, Ie = "inline-block max-w-[260px] truncate rounded px-1 text-left text-[11px] ring-1", Oe = [
|
|
31
32
|
"data-[rule-dependent]:outline-dashed data-[rule-dependent]:outline-2 data-[rule-dependent]:outline-amber-400 dark:data-[rule-dependent]:outline-amber-400/80",
|
|
32
33
|
"data-[rule-drives]:after:pointer-events-none data-[rule-drives]:after:absolute data-[rule-drives]:after:-bottom-2 data-[rule-drives]:after:right-1 data-[rule-drives]:after:z-10 data-[rule-drives]:after:rounded data-[rule-drives]:after:bg-amber-50 data-[rule-drives]:after:px-1 data-[rule-drives]:after:text-[11px] data-[rule-drives]:after:text-amber-800 data-[rule-drives]:after:ring-1 data-[rule-drives]:after:ring-amber-200 data-[rule-drives]:after:content-[attr(data-rule-drives)] dark:data-[rule-drives]:after:bg-[#413727] dark:data-[rule-drives]:after:text-amber-200 dark:data-[rule-drives]:after:ring-amber-500/30"
|
|
33
|
-
].join(" "),
|
|
34
|
+
].join(" "), ie = {
|
|
34
35
|
before: { top: -5, left: 0, right: 0, height: 3 },
|
|
35
36
|
after: { bottom: -5, left: 0, right: 0, height: 3 }
|
|
36
37
|
};
|
|
37
|
-
function
|
|
38
|
+
function Ee({
|
|
38
39
|
target: e,
|
|
39
40
|
children: a,
|
|
40
41
|
inline: o,
|
|
@@ -42,66 +43,66 @@ function ze({
|
|
|
42
43
|
pass: d,
|
|
43
44
|
...c
|
|
44
45
|
}) {
|
|
45
|
-
var G,
|
|
46
|
-
const n =
|
|
47
|
-
if (!n) return /* @__PURE__ */ i(
|
|
48
|
-
const
|
|
49
|
-
!
|
|
46
|
+
var G, H, U, V, Z, X, q, J, Q, Y;
|
|
47
|
+
const n = oe(), g = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, se = c["data-design-copy"] !== void 0, le = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, _ = (l == null ? void 0 : l.kind) === "removed", v = !n || !!g || se || _, D = Te((n == null ? void 0 : n.dnd) ?? Re, e, { disabled: v, noDrop: le });
|
|
48
|
+
if (!n) return /* @__PURE__ */ i(S, { children: a });
|
|
49
|
+
const ce = Ce(e), w = $e(n, e), s = ((H = n.roleMark) == null ? void 0 : H.call(n, e)) ?? null, R = ((U = n.marks) == null ? void 0 : U.call(n, e)) ?? [], b = ((V = n.overlay) == null ? void 0 : V.call(n, e)) ?? null, L = ((Z = n.unsaved) == null ? void 0 : Z.call(n, e)) ?? !1, k = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], ue = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ i(Fe, { note: B }) : null, j = v ? {} : D.props, pe = D.dragging, C = v ? null : D.slot, p = r && re(a) ? a : null, ge = (p == null ? void 0 : p.props.className) ?? "", me = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(ge), he = f(
|
|
50
|
+
!me && "relative",
|
|
50
51
|
"cursor-pointer rounded-md outline-offset-2",
|
|
51
|
-
!
|
|
52
|
-
|
|
52
|
+
!p && (o ? "inline-block" : "block"),
|
|
53
|
+
w ? "outline outline-2 outline-nvr-cyan" : k.length > 0 ? `outline outline-2 ${k[0].outline}` : ue ? "outline-dashed outline-2 outline-violet-400 dark:outline-violet-400/70" : "hover:outline hover:outline-1 hover:outline-slate-300 dark:hover:outline-slate-600",
|
|
53
54
|
b == null ? void 0 : b.className,
|
|
54
55
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
|
|
55
|
-
|
|
56
|
+
Oe,
|
|
56
57
|
// The section's "Changed by" shows while the pointer is over it.
|
|
57
58
|
"[&:hover>[data-design-last-change]]:visible",
|
|
58
|
-
|
|
59
|
+
pe && "opacity-40",
|
|
59
60
|
// Hidden for the previewed role: faint, its tags not.
|
|
60
61
|
(s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
|
|
61
|
-
l &&
|
|
62
|
-
|
|
63
|
-
),
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
62
|
+
l && Ge[l.kind],
|
|
63
|
+
_ && "cursor-default [&>:not([data-design-badges])]:opacity-40"
|
|
64
|
+
), fe = (t) => {
|
|
65
|
+
const u = t.target;
|
|
66
|
+
if (u.closest("[data-design-target]") !== t.currentTarget) return;
|
|
67
|
+
if (_) {
|
|
67
68
|
t.preventDefault(), t.stopPropagation();
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
70
71
|
t.shiftKey || t.metaKey || t.ctrlKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
t.key !== "Enter" || t.target !== t.currentTarget ||
|
|
75
|
-
},
|
|
76
|
-
"data-design-target":
|
|
77
|
-
"data-selected":
|
|
72
|
+
const N = u.closest("[data-design-pass]");
|
|
73
|
+
N && t.currentTarget.contains(N) || (t.preventDefault(), t.stopPropagation());
|
|
74
|
+
}, be = (t) => {
|
|
75
|
+
t.key !== "Enter" || t.target !== t.currentTarget || _ || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
|
|
76
|
+
}, x = c["data-design-tab"] !== void 0 || ((J = p == null ? void 0 : p.props) == null ? void 0 : J["data-design-tab"]) !== void 0, F = {
|
|
77
|
+
"data-design-target": ce,
|
|
78
|
+
"data-selected": w ? "true" : void 0,
|
|
78
79
|
"data-design-pass": d ? "" : void 0,
|
|
79
|
-
"data-drop-slot":
|
|
80
|
+
"data-drop-slot": C ?? void 0,
|
|
80
81
|
"data-role-mark": s == null ? void 0 : s.kind,
|
|
81
|
-
"data-unsaved":
|
|
82
|
+
"data-unsaved": L ? "" : void 0,
|
|
82
83
|
"data-diff": l == null ? void 0 : l.kind,
|
|
83
84
|
// Locked nodes get no dnd attributes; they still take focus to be selected.
|
|
84
85
|
// So do nodes drag and drop leaves out (a pinned section, #2628).
|
|
85
|
-
...
|
|
86
|
-
...
|
|
87
|
-
className:
|
|
88
|
-
onClickCapture:
|
|
89
|
-
onKeyDown:
|
|
90
|
-
},
|
|
86
|
+
...v || !("tabIndex" in j) ? { role: "button", tabIndex: 0 } : {},
|
|
87
|
+
...x && g ? { "data-tip": `From ${g}` } : {},
|
|
88
|
+
className: he,
|
|
89
|
+
onClickCapture: fe,
|
|
90
|
+
onKeyDown: be
|
|
91
|
+
}, ke = (s == null ? void 0 : s.kind) === "hidden" ? xe : ye, M = e.kind === "field" || e.kind === "header" ? ((Q = n.fillRate) == null ? void 0 : Q.call(n, e.field)) ?? null : null, y = e.kind === "group" && !x ? ((Y = n.lastChange) == null ? void 0 : Y.call(n, e)) ?? null : null, P = y && [y.by ? `by ${y.by}` : null, y.at ? we(y.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ m(
|
|
91
92
|
"span",
|
|
92
93
|
{
|
|
93
94
|
"data-design-last-change": "",
|
|
94
95
|
className: f(
|
|
95
96
|
"pointer-events-none absolute -bottom-2 right-1 z-10 rounded bg-white px-1 text-[10.5px] text-slate-500 dark:bg-card dark:text-muted-foreground",
|
|
96
|
-
!
|
|
97
|
+
!w && "invisible"
|
|
97
98
|
),
|
|
98
99
|
children: [
|
|
99
100
|
"Changed ",
|
|
100
|
-
|
|
101
|
+
P
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
104
|
) : null, h = [];
|
|
104
|
-
l && h.push({ rank: 0, text:
|
|
105
|
+
l && h.push({ rank: 0, text: We(l), node: /* @__PURE__ */ i(ae, { diff: l }) }), s && h.push({
|
|
105
106
|
rank: 1,
|
|
106
107
|
text: `${s.kind === "hidden" ? "Hidden" : "Read-only"} for ${s.role}`,
|
|
107
108
|
node: /* @__PURE__ */ m(
|
|
@@ -110,7 +111,7 @@ function ze({
|
|
|
110
111
|
"data-design-role-tag": s.kind,
|
|
111
112
|
className: "inline-flex items-center gap-0.5 rounded bg-amber-50 px-1 text-[11px] text-amber-800 ring-1 ring-amber-200 dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-500/30",
|
|
112
113
|
children: [
|
|
113
|
-
/* @__PURE__ */ i(
|
|
114
|
+
/* @__PURE__ */ i(ke, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
114
115
|
s.kind === "hidden" ? "Hidden" : "Read-only",
|
|
115
116
|
" for ",
|
|
116
117
|
s.role
|
|
@@ -121,19 +122,19 @@ function ze({
|
|
|
121
122
|
rank: 1,
|
|
122
123
|
text: "Who sees it",
|
|
123
124
|
node: /* @__PURE__ */ i("span", { "data-design-pass": "", className: "pointer-events-auto", children: b.chip })
|
|
124
|
-
}), R.forEach((t,
|
|
125
|
-
const
|
|
126
|
-
|
|
125
|
+
}), R.forEach((t, u) => {
|
|
126
|
+
const N = f(
|
|
127
|
+
Ie,
|
|
127
128
|
t.icon && "inline-flex items-center gap-0.5",
|
|
128
129
|
t.onClick || t.tip ? "pointer-events-auto" : null,
|
|
129
130
|
t.onClick && "hover:brightness-95",
|
|
130
|
-
|
|
131
|
-
),
|
|
132
|
-
t.icon === "pin" && /* @__PURE__ */ i(
|
|
131
|
+
Ae[t.tone]
|
|
132
|
+
), ee = /* @__PURE__ */ m(S, { children: [
|
|
133
|
+
t.icon === "pin" && /* @__PURE__ */ i(Ne, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
133
134
|
t.text
|
|
134
135
|
] });
|
|
135
136
|
h.push({
|
|
136
|
-
rank:
|
|
137
|
+
rank: Le(t),
|
|
137
138
|
text: t.text,
|
|
138
139
|
node: t.onClick ? /* @__PURE__ */ i(
|
|
139
140
|
"button",
|
|
@@ -143,51 +144,51 @@ function ze({
|
|
|
143
144
|
"data-design-pass": "",
|
|
144
145
|
"data-tip": t.tip,
|
|
145
146
|
onClick: t.onClick,
|
|
146
|
-
className:
|
|
147
|
-
children:
|
|
147
|
+
className: N,
|
|
148
|
+
children: ee
|
|
148
149
|
},
|
|
149
|
-
`${
|
|
150
|
+
`${u}:${t.text}`
|
|
150
151
|
) : /* @__PURE__ */ i(
|
|
151
152
|
"span",
|
|
152
153
|
{
|
|
153
154
|
"data-design-mark": "",
|
|
154
155
|
"data-tip": t.tip,
|
|
155
|
-
className:
|
|
156
|
-
children:
|
|
156
|
+
className: N,
|
|
157
|
+
children: ee
|
|
157
158
|
},
|
|
158
|
-
`${
|
|
159
|
+
`${u}:${t.text}`
|
|
159
160
|
)
|
|
160
161
|
});
|
|
161
|
-
}),
|
|
162
|
+
}), g && h.push({
|
|
162
163
|
rank: 5,
|
|
163
|
-
text: `from ${
|
|
164
|
+
text: `from ${g}`,
|
|
164
165
|
node: /* @__PURE__ */ m("span", { className: "rounded bg-slate-100 px-1 text-[11px] text-slate-600 dark:bg-slate-800 dark:text-slate-300", children: [
|
|
165
166
|
"from ",
|
|
166
|
-
|
|
167
|
+
g
|
|
167
168
|
] })
|
|
168
169
|
});
|
|
169
|
-
const { shown: ve, rest: $ } =
|
|
170
|
-
|
|
171
|
-
const
|
|
170
|
+
const { shown: ve, rest: $ } = Be(h), W = R.length > 0 || b != null || k.length > 0, T = x && !l ? [...h.map((t) => t.text), ...k.map((t) => t.name)] : [];
|
|
171
|
+
T.length > 0 && (F["data-tip"] = g && !s && !W ? `From ${g}` : T.join(" · "));
|
|
172
|
+
const I = x && l ? /* @__PURE__ */ i("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ i(ae, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ i(
|
|
172
173
|
"span",
|
|
173
174
|
{
|
|
174
175
|
"data-design-badges": "",
|
|
175
176
|
className: f(
|
|
176
177
|
"pointer-events-none absolute left-1/2 top-1 z-10 h-1.5 w-1.5 -translate-x-1/2 rounded-full",
|
|
177
|
-
|
|
178
|
+
g && !s && !W ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
|
|
178
179
|
),
|
|
179
|
-
children: /* @__PURE__ */ i("span", { className: "sr-only", children:
|
|
180
|
+
children: /* @__PURE__ */ i("span", { className: "sr-only", children: T.join(" · ") })
|
|
180
181
|
}
|
|
181
|
-
) : h.length > 0 ||
|
|
182
|
+
) : h.length > 0 || k.length > 0 || M != null ? /* @__PURE__ */ m(
|
|
182
183
|
"span",
|
|
183
184
|
{
|
|
184
185
|
"data-design-badges": "",
|
|
185
186
|
className: "pointer-events-none absolute -top-2 right-1 z-10 flex items-center gap-1",
|
|
186
187
|
children: [
|
|
187
|
-
|
|
188
|
-
ve.map((t,
|
|
188
|
+
M != null && /* @__PURE__ */ i(Me, { pct: M }),
|
|
189
|
+
ve.map((t, u) => (
|
|
189
190
|
// biome-ignore lint/suspicious/noArrayIndexKey: ranked tags of one node, rebuilt each render
|
|
190
|
-
/* @__PURE__ */ i(
|
|
191
|
+
/* @__PURE__ */ i(_e, { children: t.node }, u)
|
|
191
192
|
)),
|
|
192
193
|
$.length > 0 && /* @__PURE__ */ m(
|
|
193
194
|
"span",
|
|
@@ -201,7 +202,7 @@ function ze({
|
|
|
201
202
|
]
|
|
202
203
|
}
|
|
203
204
|
),
|
|
204
|
-
|
|
205
|
+
k.map((t) => /* @__PURE__ */ i(
|
|
205
206
|
"span",
|
|
206
207
|
{
|
|
207
208
|
"data-design-peer": t.id,
|
|
@@ -210,68 +211,73 @@ function ze({
|
|
|
210
211
|
"pointer-events-auto inline-flex h-4 w-4 items-center justify-center rounded-full text-[9px] font-semibold ring-1",
|
|
211
212
|
t.chip
|
|
212
213
|
),
|
|
213
|
-
children:
|
|
214
|
+
children: Pe(t.name)
|
|
214
215
|
},
|
|
215
216
|
t.id
|
|
216
217
|
))
|
|
217
218
|
]
|
|
218
219
|
}
|
|
219
|
-
) : null, O =
|
|
220
|
+
) : null, O = L ? /* @__PURE__ */ i(
|
|
220
221
|
"span",
|
|
221
222
|
{
|
|
222
223
|
"data-unsaved-dot": "",
|
|
223
224
|
className: f(
|
|
224
225
|
"pointer-events-none absolute z-10 h-2 w-2 rounded-full bg-nvr-cyan ring-2 ring-white dark:ring-slate-900",
|
|
225
226
|
// A step clips its corners away: the dot sits inside, before the arrow.
|
|
226
|
-
|
|
227
|
+
x ? "right-4 top-1" : "-left-1 -top-1"
|
|
227
228
|
),
|
|
228
229
|
children: /* @__PURE__ */ i("span", { className: "sr-only", children: "unsaved change" })
|
|
229
230
|
}
|
|
230
|
-
) : null, E =
|
|
231
|
+
) : null, E = C ? /* @__PURE__ */ i(
|
|
231
232
|
"span",
|
|
232
233
|
{
|
|
233
234
|
"aria-hidden": !0,
|
|
234
|
-
"data-design-drop-indicator":
|
|
235
|
+
"data-design-drop-indicator": C,
|
|
235
236
|
className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
|
|
236
|
-
style:
|
|
237
|
+
style: D.indicator ?? ie[C]
|
|
237
238
|
}
|
|
238
|
-
) : null
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
) : null, K = w && !v && n.resizeWidth && (e.kind === "field" || e.kind === "slot") && e.group_key !== null ? /* @__PURE__ */ i(je, { onCommit: (t) => {
|
|
240
|
+
var u;
|
|
241
|
+
return (u = n.resizeWidth) == null ? void 0 : u.call(n, e, t);
|
|
242
|
+
} }) : null;
|
|
243
|
+
if (p) {
|
|
244
|
+
const { children: t, ...u } = p.props;
|
|
241
245
|
return De(
|
|
242
|
-
|
|
246
|
+
p,
|
|
243
247
|
// The child's own classes, style, ref and handlers are kept and merged.
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
ne(u, c, j, F),
|
|
249
|
+
I || A || E || O || z || K ? /* @__PURE__ */ m(S, { children: [
|
|
246
250
|
O,
|
|
247
|
-
z,
|
|
248
251
|
I,
|
|
249
|
-
|
|
252
|
+
A,
|
|
253
|
+
z,
|
|
250
254
|
E,
|
|
255
|
+
K,
|
|
251
256
|
t
|
|
252
257
|
] }) : t
|
|
253
258
|
);
|
|
254
259
|
}
|
|
255
|
-
return /* @__PURE__ */ m(o ? "span" : "div", { ...
|
|
260
|
+
return /* @__PURE__ */ m(o ? "span" : "div", { ...ne(c, j, F), children: [
|
|
256
261
|
O,
|
|
257
|
-
z,
|
|
258
262
|
I,
|
|
259
|
-
|
|
263
|
+
A,
|
|
264
|
+
z,
|
|
260
265
|
E,
|
|
266
|
+
K,
|
|
261
267
|
a
|
|
262
268
|
] });
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function Ke(e, a, o, r = {}) {
|
|
265
271
|
if (!e || o == null || o === !1) return o;
|
|
266
|
-
const d =
|
|
267
|
-
return /* @__PURE__ */ i(
|
|
272
|
+
const d = re(o) ? o.key ?? void 0 : void 0;
|
|
273
|
+
return /* @__PURE__ */ i(Ee, { target: a, ...r, children: o }, d);
|
|
268
274
|
}
|
|
269
|
-
function
|
|
270
|
-
const e =
|
|
271
|
-
return (a, o, r) =>
|
|
275
|
+
function tt() {
|
|
276
|
+
const e = oe();
|
|
277
|
+
return (a, o, r) => Ke(e, a, o, r);
|
|
272
278
|
}
|
|
273
|
-
function
|
|
274
|
-
const { ref: a, slot: o, indicator: r } =
|
|
279
|
+
function nt({ groupKey: e }) {
|
|
280
|
+
const { ref: a, slot: o, indicator: r } = ze(e);
|
|
275
281
|
return /* @__PURE__ */ i(
|
|
276
282
|
"span",
|
|
277
283
|
{
|
|
@@ -281,11 +287,11 @@ function Ye({ groupKey: e }) {
|
|
|
281
287
|
"data-design-drop-body": e,
|
|
282
288
|
"data-design-drop-indicator": o ?? void 0,
|
|
283
289
|
className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
|
|
284
|
-
style: o ? r ??
|
|
290
|
+
style: o ? r ?? ie[o] : void 0
|
|
285
291
|
}
|
|
286
292
|
);
|
|
287
293
|
}
|
|
288
|
-
function
|
|
294
|
+
function at() {
|
|
289
295
|
return /* @__PURE__ */ i(
|
|
290
296
|
"div",
|
|
291
297
|
{
|
|
@@ -295,30 +301,30 @@ function et() {
|
|
|
295
301
|
}
|
|
296
302
|
);
|
|
297
303
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
304
|
+
const Se = 2;
|
|
305
|
+
function Le(e) {
|
|
300
306
|
return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.highlight ? 2 : 3;
|
|
301
307
|
}
|
|
302
|
-
function
|
|
308
|
+
function Be(e, a = Se) {
|
|
303
309
|
const o = e.map((r, d) => ({ c: r, i: d })).sort((r, d) => r.c.rank - d.c.rank || r.i - d.i).map((r) => r.c);
|
|
304
310
|
return { shown: o.slice(0, a), rest: o.slice(a) };
|
|
305
311
|
}
|
|
306
|
-
function
|
|
312
|
+
function Pe(e) {
|
|
307
313
|
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((o) => {
|
|
308
314
|
var r;
|
|
309
315
|
return ((r = o[0]) == null ? void 0 : r.toUpperCase()) ?? "";
|
|
310
316
|
}).join("") || "?";
|
|
311
317
|
}
|
|
312
|
-
function
|
|
313
|
-
const a =
|
|
318
|
+
function We(e) {
|
|
319
|
+
const a = de[e.kind].text;
|
|
314
320
|
return e.kind === "moved" && e.detail ? `Moved ${e.detail}` : e.kind === "changed" && e.detail ? `${a}: ${e.detail}` : a;
|
|
315
321
|
}
|
|
316
|
-
const
|
|
322
|
+
const Ge = {
|
|
317
323
|
added: "ring-2 ring-emerald-500/70 dark:ring-emerald-400/60",
|
|
318
324
|
moved: "ring-2 ring-amber-500/70 dark:ring-amber-400/60",
|
|
319
325
|
changed: "ring-1 ring-violet-500/60 dark:ring-violet-400/50",
|
|
320
326
|
removed: "ring-1 ring-rose-400/70 dark:ring-rose-400/50"
|
|
321
|
-
},
|
|
327
|
+
}, de = {
|
|
322
328
|
added: {
|
|
323
329
|
text: "Added",
|
|
324
330
|
cls: "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-200 dark:ring-emerald-500/30"
|
|
@@ -336,8 +342,8 @@ const Pe = {
|
|
|
336
342
|
cls: "bg-rose-50 text-rose-800 ring-rose-200 line-through dark:bg-rose-500/15 dark:text-rose-200 dark:ring-rose-500/30"
|
|
337
343
|
}
|
|
338
344
|
};
|
|
339
|
-
function
|
|
340
|
-
const a =
|
|
345
|
+
function ae({ diff: e }) {
|
|
346
|
+
const a = de[e.kind];
|
|
341
347
|
return /* @__PURE__ */ m(
|
|
342
348
|
"span",
|
|
343
349
|
{
|
|
@@ -351,12 +357,12 @@ function ne({ diff: e }) {
|
|
|
351
357
|
);
|
|
352
358
|
}
|
|
353
359
|
export {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
nt as DesignDropBody,
|
|
361
|
+
at as DesignDropZone,
|
|
362
|
+
Ee as DesignNode,
|
|
363
|
+
Se as MAX_NODE_TAGS,
|
|
364
|
+
Ke as designWrap,
|
|
365
|
+
Le as markRank,
|
|
366
|
+
Be as rankChips,
|
|
367
|
+
tt as useDesignWrap
|
|
362
368
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import { ItemEditForm as x } from "../ItemEditForm.js";
|
|
4
|
+
import { PlacementTextContext as h } from "../item-edit/placement-behaviour.js";
|
|
5
|
+
import { RecordReadView as C } from "../RecordReadView.js";
|
|
6
|
+
import { PdfCanvas as P } from "./canvases/PdfCanvas.js";
|
|
7
|
+
import { TableColumnsCanvas as w } from "./canvases/TableColumnsCanvas.js";
|
|
8
|
+
import { LayoutDesignContext as f } from "./design-context.js";
|
|
9
|
+
import { useOverviewFields as s } from "./overview/overview-api.js";
|
|
10
|
+
function T(e) {
|
|
9
11
|
switch (e) {
|
|
10
12
|
case "summary":
|
|
11
13
|
case "detail":
|
|
@@ -18,36 +20,37 @@ function x(e) {
|
|
|
18
20
|
return "item-edit-form";
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
const { data:
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
function F(e) {
|
|
24
|
+
const { data: t = [] } = s(e.collection);
|
|
25
|
+
return /* @__PURE__ */ r(w, { ...e, fields: t });
|
|
24
26
|
}
|
|
25
|
-
function
|
|
26
|
-
const { data:
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
function b(e) {
|
|
28
|
+
const { data: t = [] } = s(e.collection);
|
|
29
|
+
return /* @__PURE__ */ r(P, { ...e, fields: t });
|
|
28
30
|
}
|
|
29
|
-
function
|
|
31
|
+
function N({
|
|
30
32
|
collection: e,
|
|
31
|
-
bundle:
|
|
32
|
-
layout:
|
|
33
|
+
bundle: t,
|
|
34
|
+
layout: l,
|
|
33
35
|
record: d,
|
|
34
|
-
stateKey:
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
stateKey: n = null,
|
|
37
|
+
roleId: m = null,
|
|
38
|
+
design: o,
|
|
39
|
+
apply: c,
|
|
37
40
|
whenIdle: u
|
|
38
41
|
}) {
|
|
39
|
-
const
|
|
42
|
+
const a = T(String(t.layout.layout_type ?? "grouped")), v = p(() => ({ stateKey: n, roleId: m }), [n, m]);
|
|
40
43
|
let i;
|
|
41
|
-
return
|
|
42
|
-
|
|
44
|
+
return a === "item-edit-form" ? i = /* @__PURE__ */ r(
|
|
45
|
+
x,
|
|
43
46
|
{
|
|
44
47
|
collection: e,
|
|
45
48
|
documentTitle: !1,
|
|
46
|
-
design: { layout:
|
|
49
|
+
design: { layout: l, record: d, context: o, stateKey: n }
|
|
47
50
|
}
|
|
48
|
-
) :
|
|
51
|
+
) : a === "read-view" ? i = /* @__PURE__ */ r(C, { collection: e, design: { layout: l, record: d, context: o } }) : a === "pdf" ? i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(b, { bundle: t, collection: e, whenIdle: u }) }) : i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(F, { bundle: t, apply: c, collection: e }) }), /* @__PURE__ */ r("div", { "data-editor-canvas": "", "data-renderer": a, className: "flex min-h-full flex-col", children: /* @__PURE__ */ r(h.Provider, { value: v, children: i }) });
|
|
49
52
|
}
|
|
50
53
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
N as EditorCanvas,
|
|
55
|
+
T as canvasRenderer
|
|
53
56
|
};
|