@nivaro/react 0.3.0 → 0.3.2
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 +341 -0
- package/dist/index.js +764 -723
- package/dist/shared/components/ClientChaosToolbar.js +410 -0
- package/dist/shared/components/LoadErrorNote.js +49 -0
- package/dist/shared/components/PretendDown.js +258 -0
- package/dist/shared/components/ProfileView.js +54 -49
- package/dist/shared/components/QueryErrorState.js +16 -0
- package/dist/shared/components/ReportView.js +1351 -1338
- package/dist/shared/components/WidgetSlot.js +438 -418
- package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
- package/dist/shared/components/chaos/DrillBanner.js +119 -0
- package/dist/shared/components/chaos/DrillTag.js +62 -0
- package/dist/shared/components/chaos/GameDayStrip.js +61 -0
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +95 -92
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +69 -64
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +40 -39
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +30 -27
- package/dist/shared/components/chat/huddle/huddle-dismiss.js +12 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +25 -20
- package/dist/shared/components/client-chaos-gate.js +51 -0
- package/dist/shared/components/integrations/console/SignalCard.js +172 -167
- package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
- package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
- package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
- package/dist/shared/components/pipeline/TeamsView.js +184 -169
- package/dist/shared/lib/client-chaos.js +359 -0
- package/dist/shared/lib/load-error.js +26 -0
- package/dist/shared/lib/socket-realtime.js +31 -30
- package/dist/shared/lib/worker-socket.js +108 -89
- package/package.json +1 -1
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
2
|
-
import { ChevronLeft as de, Undo2 as ie, Redo2 as ce, Wrench as me, Sparkles as he, History as pe, MoreHorizontal as ue, Save as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft as de, Undo2 as ie, Redo2 as ce, Wrench as me, Sparkles as he, History as pe, MoreHorizontal as ue, Save as z, GitCompare as be, ChevronDown as q, Eye as Y, X as xe } from "lucide-react";
|
|
3
|
+
import { useState as W, useMemo as ve, useCallback as ge } from "react";
|
|
4
4
|
import { useNivaroClient as we } from "../../context.js";
|
|
5
5
|
import { useDebounced as fe } from "../../hooks/useDebounced.js";
|
|
6
6
|
import { useRelationOptions as ke } from "../../hooks/useRelationOptions.js";
|
|
7
7
|
import { titleCase as Ne, cn as h } from "../../lib/utils.js";
|
|
8
|
-
import {
|
|
8
|
+
import { usePretendDownIds as ye, LAYOUT_PRETEND_SCOPE as Ce } from "../PretendDown.js";
|
|
9
|
+
import { useOverflowTip as Se } from "../TipLayer.js";
|
|
9
10
|
import { Popover as K, PopoverTrigger as Q, PopoverContent as V } from "../ui/popover.js";
|
|
10
|
-
import { SimpleSelect as
|
|
11
|
-
import { AiChangeCheck as
|
|
12
|
-
import { ShareButton as
|
|
13
|
-
import { HistoryPanel as
|
|
14
|
-
import { useRuleChoiceLabels as
|
|
15
|
-
import { rowPill as
|
|
11
|
+
import { SimpleSelect as Oe } from "../ui/SimpleSelect.js";
|
|
12
|
+
import { AiChangeCheck as Re } from "./ai/ChangeCheck.js";
|
|
13
|
+
import { ShareButton as Pe, WatchButton as Ae } from "./collab/FormFollowShare.js";
|
|
14
|
+
import { HistoryPanel as Te } from "./HistoryPanel.js";
|
|
15
|
+
import { useRuleChoiceLabels as Be, useDisplayTemplate as Le, useRoleNames as Ue } from "./overview/overview-api.js";
|
|
16
|
+
import { rowPill as Ee, purposeSegments as De, TYPE_USE as G, Pill as $e, Sentence as Me } from "./overview/purpose.js";
|
|
16
17
|
import { ScheduleChange as je } from "./ScheduleChange.js";
|
|
17
|
-
import { barIconBtn as
|
|
18
|
-
import { unsavedText as
|
|
19
|
-
const
|
|
18
|
+
import { barIconBtn as j, BarMenu as A, barIconOn as He, MenuSeparator as H, ToolButton as J, barBtnOn as Ie, barBtn as We } from "./toolbar-kit.js";
|
|
19
|
+
import { unsavedText as Z } from "./UnsavedConfirm.js";
|
|
20
|
+
const Ze = "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-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground", X = "mb-1 block text-[11.5px] font-semibold text-slate-600 dark:text-muted-foreground", _e = `
|
|
20
21
|
[data-editor-topbar]{container-type:inline-size;container-name:letb}
|
|
21
22
|
@container letb (max-width: 1499px){[data-editor-topbar] [data-tb-sentence]{display:none}}
|
|
22
23
|
@container letb (max-width: 1399px){[data-editor-topbar] [data-tb-xwide]{display:none}}
|
|
23
24
|
@container letb (max-width: 1099px){[data-editor-topbar] [data-tb-wide],[data-editor-topbar] [data-tb-menu-label]{display:none}}
|
|
24
25
|
@container letb (min-width: 1100px){[data-editor-topbar] [data-tb-name]{min-width:140px}}
|
|
25
26
|
`;
|
|
26
|
-
function
|
|
27
|
+
function Fe({
|
|
27
28
|
draft: i,
|
|
28
29
|
onOpen: a,
|
|
29
30
|
pendingTip: c
|
|
30
31
|
}) {
|
|
31
|
-
const { status: n, error: s } = i, l = i.unsavedCount ?? 0, t = l > 0 && (n === "idle" || n === "saved"), m = n === "saving" ? "Saving…" : n === "error" ? s ?? "Not saved" : n === "conflict" ? l > 0 ? "Not saved — someone else saved" : "Reloaded — someone else saved" : t ?
|
|
32
|
+
const { status: n, error: s } = i, l = i.unsavedCount ?? 0, t = l > 0 && (n === "idle" || n === "saved"), m = n === "saving" ? "Saving…" : n === "error" ? s ?? "Not saved" : n === "conflict" ? l > 0 ? "Not saved — someone else saved" : "Reloaded — someone else saved" : t ? Z(l) : "Saved", u = /* @__PURE__ */ r(
|
|
32
33
|
"span",
|
|
33
34
|
{
|
|
34
35
|
role: "status",
|
|
@@ -54,14 +55,14 @@ function Ze({
|
|
|
54
55
|
{
|
|
55
56
|
type: "button",
|
|
56
57
|
"data-unsaved-list-open": "",
|
|
57
|
-
"aria-label": `${
|
|
58
|
+
"aria-label": `${Z(l)} — list them`,
|
|
58
59
|
onClick: (b) => a(b.currentTarget),
|
|
59
60
|
className: "inline-flex rounded-full transition-opacity hover:opacity-80",
|
|
60
61
|
children: u
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function ze({
|
|
65
66
|
icon: i,
|
|
66
67
|
label: a,
|
|
67
68
|
hint: c,
|
|
@@ -101,7 +102,7 @@ function Fe({
|
|
|
101
102
|
)
|
|
102
103
|
] });
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function Ye({
|
|
105
106
|
collection: i,
|
|
106
107
|
value: a,
|
|
107
108
|
onChange: c,
|
|
@@ -109,37 +110,39 @@ function ze({
|
|
|
109
110
|
onShowHidden: s,
|
|
110
111
|
extra: l
|
|
111
112
|
}) {
|
|
112
|
-
var
|
|
113
|
-
const t = we(), [m, u] =
|
|
114
|
-
search:
|
|
113
|
+
var S, O, R, f;
|
|
114
|
+
const t = we(), [m, u] = W(!1), [b, T] = W(""), B = fe(b, 250), { data: g } = Le(i, m), { data: x = [] } = Ue(!0), { options: N, loading: L } = ke(m ? t : null, i, {
|
|
115
|
+
search: B,
|
|
115
116
|
limit: 8,
|
|
116
117
|
displayTemplate: g ?? null,
|
|
117
118
|
enabled: m && g !== void 0
|
|
118
|
-
}), w = ((
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
(
|
|
119
|
+
}), y = ye(Ce).length, w = ((S = x.find((o) => o.id === a.roleId)) == null ? void 0 : S.name) ?? null, C = ((O = x.find((o) => o.id === a.compareRoleId)) == null ? void 0 : O.name) ?? null, U = [
|
|
120
|
+
(R = a.record) == null ? void 0 : R.label,
|
|
121
|
+
C && w ? `${w} | ${C}` : w,
|
|
122
|
+
(f = a.state) == null ? void 0 : f.label,
|
|
122
123
|
a.values && Object.keys(a.values).length > 0 ? "What if" : null,
|
|
123
124
|
a.device && a.device !== "desktop" ? a.device === "phone" ? "Phone" : "Tablet" : null,
|
|
124
|
-
a.who ? "Who sees" : null
|
|
125
|
+
a.who ? "Who sees" : null,
|
|
126
|
+
// #2858 — pretending something is down is a preview mode too: never forgotten on screen.
|
|
127
|
+
y > 0 ? `${y} down` : null
|
|
125
128
|
].filter(Boolean).join(" · ") || "No record";
|
|
126
129
|
return /* @__PURE__ */ r(K, { open: m, onOpenChange: u, children: [
|
|
127
130
|
/* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ r(
|
|
128
131
|
"button",
|
|
129
132
|
{
|
|
130
133
|
type: "button",
|
|
131
|
-
className: h(
|
|
134
|
+
className: h(We, "min-w-[110px] max-w-[260px] shrink", m && Ie),
|
|
132
135
|
"aria-label": "Preview as",
|
|
133
136
|
"data-preview-as": "",
|
|
134
137
|
"data-tip": "Show the form with a real record’s values, as a role sees it",
|
|
135
138
|
children: [
|
|
136
|
-
/* @__PURE__ */ e(
|
|
139
|
+
/* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
137
140
|
/* @__PURE__ */ r("span", { className: "min-w-0 truncate", children: [
|
|
138
141
|
"Preview",
|
|
139
142
|
/* @__PURE__ */ r("span", { "data-tb-wide": "", children: [
|
|
140
143
|
":",
|
|
141
144
|
" ",
|
|
142
|
-
/* @__PURE__ */ e("span", { "data-preview-summary": "", className: "text-slate-500 dark:text-muted-foreground", children:
|
|
145
|
+
/* @__PURE__ */ e("span", { "data-preview-summary": "", className: "text-slate-500 dark:text-muted-foreground", children: U })
|
|
143
146
|
] })
|
|
144
147
|
] }),
|
|
145
148
|
n && /* @__PURE__ */ e(
|
|
@@ -160,7 +163,7 @@ function ze({
|
|
|
160
163
|
align: "end",
|
|
161
164
|
className: "max-h-[min(80vh,640px)] w-[320px] overflow-y-auto overscroll-contain p-3",
|
|
162
165
|
children: [
|
|
163
|
-
/* @__PURE__ */ e("p", { className:
|
|
166
|
+
/* @__PURE__ */ e("p", { className: X, children: "Record" }),
|
|
164
167
|
a.record ? /* @__PURE__ */ r("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-slate-800 dark:text-foreground", children: [
|
|
165
168
|
/* @__PURE__ */ e("span", { className: "truncate", children: a.record.label }),
|
|
166
169
|
/* @__PURE__ */ e(
|
|
@@ -173,19 +176,19 @@ function ze({
|
|
|
173
176
|
children: /* @__PURE__ */ e(xe, { className: "h-3 w-3" })
|
|
174
177
|
}
|
|
175
178
|
)
|
|
176
|
-
] }) : /* @__PURE__ */ r(
|
|
179
|
+
] }) : /* @__PURE__ */ r(I, { children: [
|
|
177
180
|
/* @__PURE__ */ e(
|
|
178
181
|
"input",
|
|
179
182
|
{
|
|
180
183
|
value: b,
|
|
181
|
-
onChange: (o) =>
|
|
184
|
+
onChange: (o) => T(o.target.value),
|
|
182
185
|
placeholder: "Search records…",
|
|
183
186
|
"aria-label": "Search records",
|
|
184
|
-
className:
|
|
187
|
+
className: Ze
|
|
185
188
|
}
|
|
186
189
|
),
|
|
187
190
|
/* @__PURE__ */ r("div", { className: "mt-1 max-h-[220px] overflow-y-auto overscroll-contain", children: [
|
|
188
|
-
|
|
191
|
+
N.map((o) => /* @__PURE__ */ e(
|
|
189
192
|
"button",
|
|
190
193
|
{
|
|
191
194
|
type: "button",
|
|
@@ -195,12 +198,12 @@ function ze({
|
|
|
195
198
|
},
|
|
196
199
|
String(o.id)
|
|
197
200
|
)),
|
|
198
|
-
!
|
|
201
|
+
!L && N.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No records match." })
|
|
199
202
|
] })
|
|
200
203
|
] }),
|
|
201
|
-
/* @__PURE__ */ e("p", { className: h(
|
|
204
|
+
/* @__PURE__ */ e("p", { className: h(X, "mt-3"), children: "As a role" }),
|
|
202
205
|
/* @__PURE__ */ e(
|
|
203
|
-
|
|
206
|
+
Oe,
|
|
204
207
|
{
|
|
205
208
|
value: a.roleId ?? "",
|
|
206
209
|
onChange: (o) => c({ ...a, roleId: o || null }),
|
|
@@ -214,9 +217,9 @@ function ze({
|
|
|
214
217
|
),
|
|
215
218
|
/* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: "The form shows this record’s values, steps and rules. Nothing you do here changes the record." }),
|
|
216
219
|
/* @__PURE__ */ e("div", { className: "mt-3 border-t border-slate-100 pt-3 dark:border-border", children: /* @__PURE__ */ e(
|
|
217
|
-
|
|
220
|
+
ze,
|
|
218
221
|
{
|
|
219
|
-
icon: /* @__PURE__ */ e(
|
|
222
|
+
icon: /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5" }),
|
|
220
223
|
label: "Show hidden",
|
|
221
224
|
hint: "Fields and sections the preview would hide, faintly, so you can select them",
|
|
222
225
|
on: n,
|
|
@@ -230,7 +233,7 @@ function ze({
|
|
|
230
233
|
)
|
|
231
234
|
] });
|
|
232
235
|
}
|
|
233
|
-
function
|
|
236
|
+
function ht({
|
|
234
237
|
collection: i,
|
|
235
238
|
layoutId: a,
|
|
236
239
|
layoutName: c,
|
|
@@ -241,48 +244,48 @@ function it({
|
|
|
241
244
|
preview: m,
|
|
242
245
|
onPreview: u,
|
|
243
246
|
showHidden: b,
|
|
244
|
-
onShowHidden:
|
|
245
|
-
onBack:
|
|
247
|
+
onShowHidden: T,
|
|
248
|
+
onBack: B,
|
|
246
249
|
backLabel: g = "Forms",
|
|
247
250
|
view: x,
|
|
248
|
-
tools:
|
|
249
|
-
ai:
|
|
250
|
-
previewExtra:
|
|
251
|
-
problems:
|
|
252
|
-
more:
|
|
253
|
-
presence:
|
|
254
|
-
onOpenUnsaved:
|
|
255
|
-
pendingTip:
|
|
256
|
-
onSelectField:
|
|
257
|
-
onShowOnCanvas:
|
|
258
|
-
onReviewChanges:
|
|
251
|
+
tools: N,
|
|
252
|
+
ai: L,
|
|
253
|
+
previewExtra: y,
|
|
254
|
+
problems: w,
|
|
255
|
+
more: C,
|
|
256
|
+
presence: U,
|
|
257
|
+
onOpenUnsaved: S,
|
|
258
|
+
pendingTip: O,
|
|
259
|
+
onSelectField: R,
|
|
260
|
+
onShowOnCanvas: f,
|
|
261
|
+
onReviewChanges: o,
|
|
259
262
|
reviewing: ee = !1,
|
|
260
263
|
testing: te,
|
|
261
264
|
beforeSave: ae
|
|
262
265
|
}) {
|
|
263
|
-
const [
|
|
266
|
+
const [E, D] = W(
|
|
264
267
|
() => typeof window < "u" && new URLSearchParams(window.location.search).get("history") === "1"
|
|
265
|
-
), p = t.unsavedCount ?? 0, $ = s ?
|
|
268
|
+
), p = t.unsavedCount ?? 0, $ = s ? Ee(s) : null, ne = ve(() => s ? [s] : [], [s]), re = Be(i, l, ne), _ = s ? De(s, l, re) : G[n] ? [{ text: G[n] }] : [], P = !!t.save && !t.autosave, M = P && p > 0, oe = ge(
|
|
266
269
|
(d) => {
|
|
267
|
-
var v,
|
|
268
|
-
return ((
|
|
270
|
+
var v, F;
|
|
271
|
+
return ((F = (v = l.find((le) => le.field === d)) == null ? void 0 : v.label) == null ? void 0 : F.trim()) || Ne(d);
|
|
269
272
|
},
|
|
270
273
|
[l]
|
|
271
|
-
), se =
|
|
274
|
+
), se = Se(c);
|
|
272
275
|
return /* @__PURE__ */ r(
|
|
273
276
|
"header",
|
|
274
277
|
{
|
|
275
278
|
"data-editor-topbar": "",
|
|
276
279
|
className: "flex shrink-0 flex-nowrap items-center gap-1.5 overflow-hidden border-b border-slate-200 bg-white px-3 py-2 dark:border-border dark:bg-card",
|
|
277
280
|
children: [
|
|
278
|
-
/* @__PURE__ */ e("style", { children:
|
|
281
|
+
/* @__PURE__ */ e("style", { children: _e }),
|
|
279
282
|
/* @__PURE__ */ r(
|
|
280
283
|
"button",
|
|
281
284
|
{
|
|
282
285
|
type: "button",
|
|
283
286
|
"aria-label": g,
|
|
284
287
|
"data-editor-back": "",
|
|
285
|
-
onClick: (d) =>
|
|
288
|
+
onClick: (d) => B(d.currentTarget),
|
|
286
289
|
className: "inline-flex h-8 shrink-0 items-center gap-0.5 rounded-md pl-1 pr-2 text-[12px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
|
|
287
290
|
children: [
|
|
288
291
|
/* @__PURE__ */ e(de, { className: "h-4 w-4" }),
|
|
@@ -290,7 +293,7 @@ function it({
|
|
|
290
293
|
]
|
|
291
294
|
}
|
|
292
295
|
),
|
|
293
|
-
/* @__PURE__ */ e(
|
|
296
|
+
/* @__PURE__ */ e(k, {}),
|
|
294
297
|
/* @__PURE__ */ r("div", { "data-tb-name": "", className: "flex min-w-[64px] flex-1 items-center gap-2", children: [
|
|
295
298
|
/* @__PURE__ */ e(
|
|
296
299
|
"h2",
|
|
@@ -300,28 +303,28 @@ function it({
|
|
|
300
303
|
children: c
|
|
301
304
|
}
|
|
302
305
|
),
|
|
303
|
-
$ && /* @__PURE__ */ e("span", { className: "shrink-0", children: /* @__PURE__ */ e(
|
|
304
|
-
|
|
306
|
+
$ && /* @__PURE__ */ e("span", { className: "shrink-0", children: /* @__PURE__ */ e($e, { tone: $.tone, children: $.text }) }),
|
|
307
|
+
_.length > 0 && /* @__PURE__ */ r(
|
|
305
308
|
"span",
|
|
306
309
|
{
|
|
307
310
|
"data-tb-sentence": "",
|
|
308
311
|
className: "min-w-0 truncate text-[12px] text-slate-500 dark:text-muted-foreground",
|
|
309
312
|
children: [
|
|
310
313
|
"· ",
|
|
311
|
-
/* @__PURE__ */ e(
|
|
314
|
+
/* @__PURE__ */ e(Me, { segs: _, muted: !0 })
|
|
312
315
|
]
|
|
313
316
|
}
|
|
314
317
|
),
|
|
315
|
-
|
|
318
|
+
U
|
|
316
319
|
] }),
|
|
317
|
-
/* @__PURE__ */ e(
|
|
320
|
+
/* @__PURE__ */ e(k, {}),
|
|
318
321
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
319
322
|
/* @__PURE__ */ e(
|
|
320
323
|
"button",
|
|
321
324
|
{
|
|
322
325
|
type: "button",
|
|
323
326
|
"aria-label": "Undo",
|
|
324
|
-
className:
|
|
327
|
+
className: j,
|
|
325
328
|
disabled: !t.canUndo,
|
|
326
329
|
onClick: t.undo,
|
|
327
330
|
"data-tip": t.undoLabel ? `Undo ${t.undoLabel} (⌘Z)` : "Undo (⌘Z)",
|
|
@@ -333,7 +336,7 @@ function it({
|
|
|
333
336
|
{
|
|
334
337
|
type: "button",
|
|
335
338
|
"aria-label": "Redo",
|
|
336
|
-
className:
|
|
339
|
+
className: j,
|
|
337
340
|
disabled: !t.canRedo,
|
|
338
341
|
onClick: t.redo,
|
|
339
342
|
"data-tip": t.redoLabel ? `Redo ${t.redoLabel} (⇧⌘Z)` : "Redo (⇧⌘Z)",
|
|
@@ -341,20 +344,20 @@ function it({
|
|
|
341
344
|
}
|
|
342
345
|
)
|
|
343
346
|
] }),
|
|
344
|
-
x && /* @__PURE__ */ r(
|
|
345
|
-
/* @__PURE__ */ e(
|
|
347
|
+
x && /* @__PURE__ */ r(I, { children: [
|
|
348
|
+
/* @__PURE__ */ e(k, {}),
|
|
346
349
|
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: x })
|
|
347
350
|
] }),
|
|
348
|
-
/* @__PURE__ */ e(
|
|
351
|
+
/* @__PURE__ */ e(k, {}),
|
|
349
352
|
/* @__PURE__ */ e(
|
|
350
|
-
|
|
353
|
+
Ye,
|
|
351
354
|
{
|
|
352
355
|
collection: i,
|
|
353
356
|
value: m,
|
|
354
357
|
onChange: u,
|
|
355
358
|
showHidden: b,
|
|
356
|
-
onShowHidden:
|
|
357
|
-
extra:
|
|
359
|
+
onShowHidden: T,
|
|
360
|
+
extra: y
|
|
358
361
|
}
|
|
359
362
|
),
|
|
360
363
|
/* @__PURE__ */ e(
|
|
@@ -363,7 +366,7 @@ function it({
|
|
|
363
366
|
label: "Tools",
|
|
364
367
|
icon: /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" }),
|
|
365
368
|
tip: "Arrange, find, outline, every form, form map and shortcuts",
|
|
366
|
-
children:
|
|
369
|
+
children: N
|
|
367
370
|
}
|
|
368
371
|
),
|
|
369
372
|
/* @__PURE__ */ e(
|
|
@@ -373,16 +376,16 @@ function it({
|
|
|
373
376
|
icon: /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
|
|
374
377
|
tip: "Rebuild, review and ask about this form with AI; type a change",
|
|
375
378
|
width: "w-[320px]",
|
|
376
|
-
children:
|
|
379
|
+
children: L
|
|
377
380
|
}
|
|
378
381
|
),
|
|
379
|
-
|
|
380
|
-
/* @__PURE__ */ r(K, { open:
|
|
382
|
+
w,
|
|
383
|
+
/* @__PURE__ */ r(K, { open: E, onOpenChange: D, children: [
|
|
381
384
|
/* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(
|
|
382
385
|
"button",
|
|
383
386
|
{
|
|
384
387
|
type: "button",
|
|
385
|
-
className: h(
|
|
388
|
+
className: h(j, E && He),
|
|
386
389
|
"aria-label": "History",
|
|
387
390
|
"data-tip": "History: saved versions, this session’s steps, restore",
|
|
388
391
|
"data-editor-history": "",
|
|
@@ -394,11 +397,11 @@ function it({
|
|
|
394
397
|
{
|
|
395
398
|
align: "end",
|
|
396
399
|
className: "max-h-[min(75vh,640px)] w-[460px] overflow-y-auto overscroll-contain p-3",
|
|
397
|
-
children:
|
|
398
|
-
|
|
400
|
+
children: E && /* @__PURE__ */ e(
|
|
401
|
+
Te,
|
|
399
402
|
{
|
|
400
403
|
layoutId: a,
|
|
401
|
-
onRestored: () =>
|
|
404
|
+
onRestored: () => D(!1),
|
|
402
405
|
unsavedCount: p,
|
|
403
406
|
onDiscardUnsaved: t.discard,
|
|
404
407
|
session: t.session,
|
|
@@ -406,8 +409,8 @@ function it({
|
|
|
406
409
|
bundle: t.bundle,
|
|
407
410
|
onApply: (d, v) => t.apply(d, { label: v }),
|
|
408
411
|
fieldLabel: oe,
|
|
409
|
-
onShowOnCanvas:
|
|
410
|
-
|
|
412
|
+
onShowOnCanvas: f ? (d, v) => {
|
|
413
|
+
D(!1), f(d, v);
|
|
411
414
|
} : void 0
|
|
412
415
|
}
|
|
413
416
|
)
|
|
@@ -426,17 +429,17 @@ function it({
|
|
|
426
429
|
children: [
|
|
427
430
|
te,
|
|
428
431
|
/* @__PURE__ */ e(H, {}),
|
|
429
|
-
/* @__PURE__ */ e(
|
|
430
|
-
/* @__PURE__ */ e(
|
|
432
|
+
/* @__PURE__ */ e(Pe, { layoutId: a, fields: l, onSelectField: R }),
|
|
433
|
+
/* @__PURE__ */ e(Ae, { layoutId: a }),
|
|
431
434
|
/* @__PURE__ */ e(H, {}),
|
|
432
|
-
|
|
435
|
+
C
|
|
433
436
|
]
|
|
434
437
|
}
|
|
435
438
|
),
|
|
436
|
-
/* @__PURE__ */ e(
|
|
437
|
-
/* @__PURE__ */ e(
|
|
439
|
+
/* @__PURE__ */ e(k, {}),
|
|
440
|
+
/* @__PURE__ */ e(Fe, { draft: t, onOpen: S, pendingTip: O }),
|
|
438
441
|
/* @__PURE__ */ r("div", { "data-save-split": "", className: "flex shrink-0 items-center", children: [
|
|
439
|
-
|
|
442
|
+
P && /* @__PURE__ */ r(
|
|
440
443
|
"button",
|
|
441
444
|
{
|
|
442
445
|
type: "button",
|
|
@@ -446,13 +449,13 @@ function it({
|
|
|
446
449
|
var d;
|
|
447
450
|
return void ((d = t.save) == null ? void 0 : d.call(t));
|
|
448
451
|
},
|
|
449
|
-
"data-tip": p > 0 ? `Save ${
|
|
452
|
+
"data-tip": p > 0 ? `Save ${Z(p)} (⌘S)` : "Nothing to save",
|
|
450
453
|
className: h(
|
|
451
454
|
"inline-flex h-8 items-center gap-1.5 rounded-l-md px-3 text-[12.5px] font-medium transition-opacity disabled:pointer-events-none disabled:opacity-40",
|
|
452
455
|
p > 0 ? "bg-nvr-cyan text-white hover:opacity-90" : "border border-slate-200 text-slate-700 dark:border-border dark:text-foreground"
|
|
453
456
|
),
|
|
454
457
|
children: [
|
|
455
|
-
/* @__PURE__ */ e(
|
|
458
|
+
/* @__PURE__ */ e(z, { className: "h-3.5 w-3.5" }),
|
|
456
459
|
"Save"
|
|
457
460
|
]
|
|
458
461
|
}
|
|
@@ -465,26 +468,26 @@ function it({
|
|
|
465
468
|
iconOnly: !0,
|
|
466
469
|
align: "end",
|
|
467
470
|
width: "w-[300px]",
|
|
468
|
-
tip:
|
|
471
|
+
tip: P ? "Review, check or schedule the changes; Autosave" : "Autosave",
|
|
469
472
|
className: h(
|
|
470
|
-
|
|
473
|
+
P ? "rounded-l-none border border-l-0 border-slate-200 dark:border-border" : "border border-slate-200 dark:border-border"
|
|
471
474
|
),
|
|
472
475
|
data: { "data-save-menu": "" },
|
|
473
476
|
children: [
|
|
474
|
-
|
|
475
|
-
|
|
477
|
+
o && M && /* @__PURE__ */ e(
|
|
478
|
+
J,
|
|
476
479
|
{
|
|
477
480
|
label: "Review changes on canvas",
|
|
478
481
|
icon: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" }),
|
|
479
482
|
hint: "Mark the unsaved changes on the form",
|
|
480
483
|
checked: ee,
|
|
481
|
-
onClick:
|
|
484
|
+
onClick: o,
|
|
482
485
|
data: { "data-editor-review": "" }
|
|
483
486
|
}
|
|
484
487
|
),
|
|
485
|
-
|
|
486
|
-
/* @__PURE__ */ e(
|
|
487
|
-
t.unsavedOps && t.discard &&
|
|
488
|
+
M && ae,
|
|
489
|
+
/* @__PURE__ */ e(Re, { layoutId: a, draft: t }),
|
|
490
|
+
t.unsavedOps && t.discard && M && /* @__PURE__ */ e(
|
|
488
491
|
je,
|
|
489
492
|
{
|
|
490
493
|
collection: i,
|
|
@@ -496,13 +499,13 @@ function it({
|
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
501
|
),
|
|
499
|
-
t.setAutosave && /* @__PURE__ */ r(
|
|
502
|
+
t.setAutosave && /* @__PURE__ */ r(I, { children: [
|
|
500
503
|
/* @__PURE__ */ e(H, {}),
|
|
501
504
|
/* @__PURE__ */ e(
|
|
502
|
-
|
|
505
|
+
J,
|
|
503
506
|
{
|
|
504
507
|
label: "Autosave",
|
|
505
|
-
icon: /* @__PURE__ */ e(
|
|
508
|
+
icon: /* @__PURE__ */ e(z, { className: "h-3.5 w-3.5" }),
|
|
506
509
|
hint: t.autosave ? "Every change saves as you make it, until you close the editor" : "Off: changes wait for Save",
|
|
507
510
|
checked: !!t.autosave,
|
|
508
511
|
onClick: () => {
|
|
@@ -521,9 +524,9 @@ function it({
|
|
|
521
524
|
}
|
|
522
525
|
);
|
|
523
526
|
}
|
|
524
|
-
function
|
|
527
|
+
function k() {
|
|
525
528
|
return /* @__PURE__ */ e("span", { "aria-hidden": !0, "data-tb-wide": "", className: "h-5 w-px shrink-0 bg-slate-200 dark:bg-border" });
|
|
526
529
|
}
|
|
527
530
|
export {
|
|
528
|
-
|
|
531
|
+
ht as EditorTopBar
|
|
529
532
|
};
|