@nivaro/react 0.2.54 → 0.2.55
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 +339 -2
- package/dist/index.js +644 -618
- 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/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as I } from "@tanstack/react-query";
|
|
3
|
+
import { Puzzle as O } from "lucide-react";
|
|
4
|
+
import { useState as v, useMemo as S } from "react";
|
|
5
|
+
import { toast as j } from "sonner";
|
|
6
|
+
import { useNivaroClient as B } from "../../context.js";
|
|
7
|
+
import { cn as $ } from "../../lib/utils.js";
|
|
8
|
+
import { Popover as L, PopoverTrigger as q, PopoverContent as z } from "../ui/popover.js";
|
|
9
|
+
import { Skeleton as h } from "../ui/skeleton.js";
|
|
10
|
+
import { fetchVersionBundle as V } from "./history-api.js";
|
|
11
|
+
import { restorablePieces as _ } from "./restore-piece.js";
|
|
12
|
+
function W({
|
|
13
|
+
layoutId: i,
|
|
14
|
+
version: o,
|
|
15
|
+
bundle: d,
|
|
16
|
+
onApply: t,
|
|
17
|
+
fieldLabel: s,
|
|
18
|
+
onDone: m,
|
|
19
|
+
className: P
|
|
20
|
+
}) {
|
|
21
|
+
const C = B(), [f, x] = v(!1), [p, g] = v(""), c = o.name ? `“${o.name}” (v${o.version})` : `v${o.version}`, {
|
|
22
|
+
data: l,
|
|
23
|
+
isLoading: F,
|
|
24
|
+
error: R
|
|
25
|
+
} = I({
|
|
26
|
+
queryKey: ["layout-editor", "version-bundle", i, o.id],
|
|
27
|
+
queryFn: () => V(C, i, o.id),
|
|
28
|
+
enabled: f,
|
|
29
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
30
|
+
retry: !1
|
|
31
|
+
}), n = S(
|
|
32
|
+
() => l ? _(d, l, s) : [],
|
|
33
|
+
[d, l, s]
|
|
34
|
+
), b = p.trim().toLowerCase(), u = b ? n.filter((r) => `${r.label} ${r.where ?? ""}`.toLowerCase().includes(b)) : n, k = u.filter((r) => r.piece.kind === "group"), N = u.filter((r) => r.piece.kind === "field"), y = (r) => {
|
|
35
|
+
const T = r.piece.kind === "group" ? `section ${r.label}` : r.label;
|
|
36
|
+
t(r.ops, `Restore ${T} from ${c}`), j.success(`${r.label} restored from ${c} as one change (undo with ⌘Z)`), x(!1), g(""), m == null || m();
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ a(L, { open: f, onOpenChange: x, children: [
|
|
39
|
+
/* @__PURE__ */ e(q, { asChild: !0, children: /* @__PURE__ */ e(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
"data-restore-piece": o.id,
|
|
44
|
+
"data-tip": "Bring back one section or field from this version, as one undoable change",
|
|
45
|
+
className: $(P, f && "border-nvr-cyan text-nvr-navy dark:text-nvr-cyan"),
|
|
46
|
+
children: "Piece"
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ a(
|
|
50
|
+
z,
|
|
51
|
+
{
|
|
52
|
+
align: "end",
|
|
53
|
+
className: "flex max-h-[min(60vh,520px)] w-[380px] flex-col gap-2 overflow-hidden p-3",
|
|
54
|
+
"data-restore-piece-popover": "",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2", children: [
|
|
57
|
+
/* @__PURE__ */ a("p", { className: "m-0 text-[12px] font-semibold text-slate-700 dark:text-foreground", children: [
|
|
58
|
+
"Restore a piece of ",
|
|
59
|
+
c
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ e(O, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-muted-foreground" })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ e("p", { className: "m-0 text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: "Only what differs from the form now. The rest of the form stays as it is." }),
|
|
64
|
+
n.length > 8 && /* @__PURE__ */ e(
|
|
65
|
+
"input",
|
|
66
|
+
{
|
|
67
|
+
"aria-label": "Find a section or field",
|
|
68
|
+
value: p,
|
|
69
|
+
placeholder: "Find a section or field…",
|
|
70
|
+
onChange: (r) => g(r.target.value),
|
|
71
|
+
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-500 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground"
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain", children: [
|
|
75
|
+
F && /* @__PURE__ */ a("div", { className: "space-y-1.5 py-1", "data-restore-piece-loading": "", children: [
|
|
76
|
+
/* @__PURE__ */ e(h, { className: "h-9 w-full" }),
|
|
77
|
+
/* @__PURE__ */ e(h, { className: "h-9 w-full" }),
|
|
78
|
+
/* @__PURE__ */ e(h, { className: "h-9 w-5/6" })
|
|
79
|
+
] }),
|
|
80
|
+
R != null && /* @__PURE__ */ e("p", { className: "m-0 py-1 text-[12px] text-[#9c2f47] dark:text-[#f08aa1]", children: "That version could not be read." }),
|
|
81
|
+
l && n.length === 0 && /* @__PURE__ */ a("p", { className: "m-0 py-1 text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
82
|
+
"Nothing in ",
|
|
83
|
+
c,
|
|
84
|
+
" differs from the form now."
|
|
85
|
+
] }),
|
|
86
|
+
l && n.length > 0 && u.length === 0 && /* @__PURE__ */ a("p", { className: "m-0 py-1 text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
87
|
+
"Nothing matches “",
|
|
88
|
+
p.trim(),
|
|
89
|
+
"”."
|
|
90
|
+
] }),
|
|
91
|
+
k.length > 0 && /* @__PURE__ */ e(w, { title: "Sections", rows: k, onRestore: y }),
|
|
92
|
+
N.length > 0 && /* @__PURE__ */ e(w, { title: "Fields", rows: N, onRestore: y })
|
|
93
|
+
] })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
function w({
|
|
100
|
+
title: i,
|
|
101
|
+
rows: o,
|
|
102
|
+
onRestore: d
|
|
103
|
+
}) {
|
|
104
|
+
return /* @__PURE__ */ a("div", { className: "mb-2 last:mb-0", children: [
|
|
105
|
+
/* @__PURE__ */ e("p", { className: "m-0 mb-0.5 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: i }),
|
|
106
|
+
/* @__PURE__ */ e("ul", { className: "m-0 list-none divide-y divide-slate-100 p-0 dark:divide-border/60", children: o.map((t) => {
|
|
107
|
+
const s = t.piece.kind === "group" ? `g:${t.piece.key}` : `f:${t.piece.field}:${t.piece.group_key ?? ""}`;
|
|
108
|
+
return /* @__PURE__ */ a("li", { className: "flex items-center gap-2 py-1.5", "data-restore-piece-row": s, children: [
|
|
109
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
110
|
+
/* @__PURE__ */ a("span", { className: "flex items-baseline gap-1.5 text-[12.5px] text-slate-800 dark:text-foreground", children: [
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "truncate font-medium", children: t.label }),
|
|
112
|
+
t.where && /* @__PURE__ */ e("span", { className: "shrink-0 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: t.where })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ e(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
className: $(
|
|
118
|
+
"block truncate text-[11.5px]",
|
|
119
|
+
t.error ? "text-amber-700 dark:text-amber-300" : "text-slate-500 dark:text-muted-foreground"
|
|
120
|
+
),
|
|
121
|
+
"data-tip": t.error ?? t.summary,
|
|
122
|
+
children: t.error ?? t.summary
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
"button",
|
|
128
|
+
{
|
|
129
|
+
type: "button",
|
|
130
|
+
disabled: !!t.error,
|
|
131
|
+
onClick: () => d(t),
|
|
132
|
+
"data-restore-piece-apply": s,
|
|
133
|
+
className: "inline-flex h-7 shrink-0 items-center rounded-md border border-slate-200 px-2 text-[11.5px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-40 dark:border-border dark:text-foreground dark:hover:bg-muted",
|
|
134
|
+
children: "Restore"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }, s);
|
|
138
|
+
}) })
|
|
139
|
+
] });
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
W as RestorePieceButton
|
|
143
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { PencilLine as r } from "lucide-react";
|
|
3
|
+
import { formatRelative as d } from "../../lib/utils.js";
|
|
4
|
+
function g({ others: e }) {
|
|
5
|
+
if (e.length === 0) return null;
|
|
6
|
+
const n = (t) => `${t.step_count} unsaved ${t.step_count === 1 ? "change" : "changes"}`, a = e.map((t) => `${t.name}: ${n(t)}, ${d(t.saved_at)}`), s = e.length === 1 ? `${e[0].name.split(" ")[0]} is drafting` : `${e.length} people are drafting`;
|
|
7
|
+
return /* @__PURE__ */ l(
|
|
8
|
+
"span",
|
|
9
|
+
{
|
|
10
|
+
"data-staged-others": e.length,
|
|
11
|
+
"data-tip": `${a.join(" · ")}. Only they see those changes until they save.`,
|
|
12
|
+
className: "inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap rounded-full bg-slate-100 px-2 text-[11px] font-medium text-slate-600 dark:bg-muted dark:text-muted-foreground",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ i(r, { className: "h-3 w-3" }),
|
|
15
|
+
s
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
g as StagedByOthers
|
|
22
|
+
};
|