@nivaro/react 0.3.48 → 0.3.49
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/shared/components/CellCopyLayer.js +81 -44
- package/dist/shared/components/CollectionBrowserView.js +306 -297
- package/dist/shared/components/DataTable.js +3 -3
- package/dist/shared/components/FulfilmentPill.js +98 -78
- package/dist/shared/components/ItemEditForm.js +2830 -2815
- package/dist/shared/components/NotificationSourcesCard.js +151 -147
- package/dist/shared/components/ProfileView.js +72 -70
- package/dist/shared/components/QueryTable.js +3 -3
- package/dist/shared/components/imports/ImportConsole.js +4 -4
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
- package/dist/shared/components/item-edit/HeaderTools.js +118 -113
- package/dist/shared/components/item-edit/InlineTableField.js +874 -868
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
- package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
- package/dist/shared/components/notifications/DeliveryChips.js +9 -9
- package/dist/shared/components/panels/PipelinePanel.js +73 -71
- package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
- package/dist/shared/components/profile/PersonProfile.js +23 -21
- package/dist/shared/components/profile/SignedInDevices.js +126 -0
- package/dist/shared/components/queue/QueueItemSheet.js +38 -37
- package/dist/shared/components/support/SupportView.js +1 -1
- package/dist/shared/lib/edit-lock-fields.js +7 -0
- package/dist/shared/lib/reimport-visibility.js +10 -0
- package/package.json +1 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Lock as P, Smartphone as
|
|
4
|
-
import { useState as x, useEffect as
|
|
2
|
+
import { useQueryClient as U } from "@tanstack/react-query";
|
|
3
|
+
import { Lock as P, Smartphone as _, Tablet as j } from "lucide-react";
|
|
4
|
+
import { useState as x, useEffect as B } from "react";
|
|
5
5
|
import { toast as E } from "sonner";
|
|
6
|
-
import { useItemEditAuth as
|
|
7
|
-
import { post as
|
|
8
|
-
import { freezeOf as
|
|
6
|
+
import { useItemEditAuth as Q, useNivaroClient as G } from "../../../context.js";
|
|
7
|
+
import { post as H, patch as J } from "../../../lib/commands.js";
|
|
8
|
+
import { freezeOf as X, activeFreeze as Y, localDay as L, dayWords as k, freezePatch as I, activeWindowOf as Z, windowState as ee, windowWords as te, activeWindowPatch as ne, tabletOfPatch as oe, tabletOf as ae, phoneOfPatch as ie, phoneOf as le, screenVersionOf as re, conditionsWithKey as se } from "../../../lib/layout-resolve.js";
|
|
9
9
|
import { cn as g } from "../../../lib/utils.js";
|
|
10
|
-
import { useLayoutEditorHost as
|
|
11
|
-
import { useInvalidateLayouts as
|
|
12
|
-
import { amberStrip as
|
|
13
|
-
import { Setting as C, smallBtn as y, quietText as N, inputCls as
|
|
14
|
-
import { useCollectionLayoutList as
|
|
15
|
-
import { layoutKindOf as
|
|
16
|
-
const O = g(
|
|
17
|
-
function
|
|
18
|
-
const { layout:
|
|
19
|
-
|
|
10
|
+
import { useLayoutEditorHost as ce } from "../host.js";
|
|
11
|
+
import { useInvalidateLayouts as de, apiFailure as me } from "../overview/overview-api.js";
|
|
12
|
+
import { amberStrip as ue } from "../panel-style.js";
|
|
13
|
+
import { Setting as C, smallBtn as y, quietText as N, inputCls as R, PickList as fe } from "./controls.js";
|
|
14
|
+
import { useCollectionLayoutList as he, settingsKeys as pe } from "./settings-api.js";
|
|
15
|
+
import { layoutKindOf as q } from "./settings-registry.js";
|
|
16
|
+
const O = g(R, "h-8 w-[150px] font-mono dark:[color-scheme:dark]");
|
|
17
|
+
function Te(c) {
|
|
18
|
+
const { layout: r } = c, e = Z(r.conditions), [o, n] = x((e == null ? void 0 : e.from) ?? ""), [s, h] = x((e == null ? void 0 : e.until) ?? "");
|
|
19
|
+
B(() => {
|
|
20
20
|
n((e == null ? void 0 : e.from) ?? ""), h((e == null ? void 0 : e.until) ?? "");
|
|
21
21
|
}, [e == null ? void 0 : e.from, e == null ? void 0 : e.until]);
|
|
22
|
-
const u = !!o && !!
|
|
23
|
-
i && d && i > d || (i || null) === ((e == null ? void 0 : e.from) ?? null) && (d || null) === ((e == null ? void 0 : e.until) ?? null) ||
|
|
24
|
-
|
|
22
|
+
const u = !!o && !!s && o > s, m = (i, d) => {
|
|
23
|
+
i && d && i > d || (i || null) === ((e == null ? void 0 : e.from) ?? null) && (d || null) === ((e == null ? void 0 : e.until) ?? null) || c.set(
|
|
24
|
+
ne(r.conditions, { from: i || null, until: d || null }),
|
|
25
25
|
i || d ? "Set active dates" : "Clear active dates"
|
|
26
26
|
);
|
|
27
|
-
}, f =
|
|
27
|
+
}, f = ee(e, L());
|
|
28
28
|
return /* @__PURE__ */ t(
|
|
29
29
|
C,
|
|
30
30
|
{
|
|
31
31
|
k: "layout.conditions.active_window",
|
|
32
|
-
note: u ? /* @__PURE__ */ t("span", { className: "text-amber-700 dark:text-amber-300", children: "The end comes before the start." }) : e && f ? /* @__PURE__ */ t("span", { "data-active-window-state": f, children: f === "open" ? `In use now, ${
|
|
32
|
+
note: u ? /* @__PURE__ */ t("span", { className: "text-amber-700 dark:text-amber-300", children: "The end comes before the start." }) : e && f ? /* @__PURE__ */ t("span", { "data-active-window-state": f, children: f === "open" ? `In use now, ${te(e)}.` : f === "before" ? `Not in use yet: starts ${k(e.from)}.` : `No longer in use: ended ${k(e.until)}.` }) : null,
|
|
33
33
|
children: /* @__PURE__ */ l("div", { className: "flex flex-wrap items-end gap-2", children: [
|
|
34
34
|
/* @__PURE__ */ l("label", { className: "flex flex-col gap-1", children: [
|
|
35
35
|
/* @__PURE__ */ t("span", { className: N, children: "From" }),
|
|
@@ -39,9 +39,9 @@ function Fe(s) {
|
|
|
39
39
|
type: "date",
|
|
40
40
|
"aria-label": "Active from",
|
|
41
41
|
value: o,
|
|
42
|
-
max:
|
|
42
|
+
max: s || void 0,
|
|
43
43
|
onChange: (i) => {
|
|
44
|
-
n(i.target.value), m(i.target.value,
|
|
44
|
+
n(i.target.value), m(i.target.value, s);
|
|
45
45
|
},
|
|
46
46
|
className: O
|
|
47
47
|
}
|
|
@@ -54,7 +54,7 @@ function Fe(s) {
|
|
|
54
54
|
{
|
|
55
55
|
type: "date",
|
|
56
56
|
"aria-label": "Active until",
|
|
57
|
-
value:
|
|
57
|
+
value: s,
|
|
58
58
|
min: o || void 0,
|
|
59
59
|
onChange: (i) => {
|
|
60
60
|
h(i.target.value), m(o, i.target.value);
|
|
@@ -63,7 +63,7 @@ function Fe(s) {
|
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }),
|
|
66
|
-
(o ||
|
|
66
|
+
(o || s) && /* @__PURE__ */ t(
|
|
67
67
|
"button",
|
|
68
68
|
{
|
|
69
69
|
type: "button",
|
|
@@ -78,54 +78,54 @@ function Fe(s) {
|
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const K = {
|
|
82
82
|
phone: {
|
|
83
83
|
key: "phone_of",
|
|
84
|
-
of:
|
|
85
|
-
patch:
|
|
84
|
+
of: le,
|
|
85
|
+
patch: ie,
|
|
86
86
|
word: "phone",
|
|
87
87
|
where: "small screens"
|
|
88
88
|
},
|
|
89
89
|
tablet: {
|
|
90
90
|
key: "tablet_of",
|
|
91
|
-
of:
|
|
92
|
-
patch:
|
|
91
|
+
of: ae,
|
|
92
|
+
patch: oe,
|
|
93
93
|
word: "tablet",
|
|
94
94
|
where: "tablet-width screens"
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
function
|
|
98
|
-
return /* @__PURE__ */ t(
|
|
97
|
+
function Pe(c) {
|
|
98
|
+
return /* @__PURE__ */ t(V, { ...c, screen: "phone" });
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return /* @__PURE__ */ t(
|
|
100
|
+
function Ee(c) {
|
|
101
|
+
return /* @__PURE__ */ t(V, { ...c, screen: "tablet" });
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const { layout:
|
|
103
|
+
function V(c) {
|
|
104
|
+
const { layout: r, collection: e, screen: o } = c, n = K[o], s = K[o === "phone" ? "tablet" : "phone"], h = o === "phone" ? _ : j, u = Number(r.id), m = ce(), f = G(), i = U(), d = de(e), W = he(e), [F, T] = x(!1), A = q(r) === "summary" ? "summary" : "grouped", S = W.filter((a) => q(a) === A), p = n.of(r.conditions), D = s.of(r.conditions), w = S.find((a) => a.id !== u && n.of(a.conditions) === u) ?? null, b = p != null ? S.find((a) => a.id === p) ?? null : null, $ = (a) => {
|
|
105
105
|
m.layoutLink && m.navigate(m.layoutLink(e, a));
|
|
106
|
-
},
|
|
106
|
+
}, M = async () => {
|
|
107
107
|
T(!0);
|
|
108
108
|
try {
|
|
109
|
-
const a = String(
|
|
110
|
-
|
|
109
|
+
const a = String(r.name || "Form"), z = await f.request(
|
|
110
|
+
H(`/collection-layouts/${u}/clone`, { name: `${a} (${n.word})`.slice(0, 255) })
|
|
111
111
|
), v = z == null ? void 0 : z.data;
|
|
112
112
|
if (!(v != null && v.id)) throw new Error("No id came back");
|
|
113
113
|
await f.request(
|
|
114
|
-
|
|
115
|
-
conditions:
|
|
114
|
+
J(`/collection-layouts/${v.id}`, {
|
|
115
|
+
conditions: se(v.conditions, n.key, u)
|
|
116
116
|
})
|
|
117
|
-
), i.invalidateQueries({ queryKey:
|
|
117
|
+
), i.invalidateQueries({ queryKey: pe.layouts(e) }), d(), E.success(
|
|
118
118
|
o === "phone" ? "Phone version made: remove what a phone does not need" : "Tablet version made: arrange it for a tablet-width screen"
|
|
119
119
|
), $(Number(v.id));
|
|
120
120
|
} catch (a) {
|
|
121
|
-
E.error(
|
|
121
|
+
E.error(me(a, `Could not make the ${n.word} version`).message);
|
|
122
122
|
} finally {
|
|
123
123
|
T(!1);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
return
|
|
126
|
+
return D != null ? /* @__PURE__ */ t(C, { k: `layout.conditions.${n.key}`, children: /* @__PURE__ */ l("p", { className: N, "data-screen-version-blocked": o, children: [
|
|
127
127
|
"This form is the ",
|
|
128
|
-
|
|
128
|
+
s.word,
|
|
129
129
|
" version of another form, so it cannot have a ",
|
|
130
130
|
n.word,
|
|
131
131
|
" ",
|
|
@@ -164,15 +164,15 @@ function R(s) {
|
|
|
164
164
|
}
|
|
165
165
|
) : /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
166
166
|
/* @__PURE__ */ t(
|
|
167
|
-
|
|
167
|
+
fe,
|
|
168
168
|
{
|
|
169
169
|
ariaLabel: o === "phone" ? "Phone version of" : "Tablet version of",
|
|
170
170
|
value: p != null ? String(p) : null,
|
|
171
171
|
placeholder: `Not a ${n.word} version`,
|
|
172
172
|
clearLabel: `Not a ${n.word} version`,
|
|
173
|
-
options: S.filter((a) => a.id !== u &&
|
|
174
|
-
onChange: (a) =>
|
|
175
|
-
n.patch(
|
|
173
|
+
options: S.filter((a) => a.id !== u && re(a.conditions) == null).map((a) => ({ value: String(a.id), label: a.name })),
|
|
174
|
+
onChange: (a) => c.set(
|
|
175
|
+
n.patch(r.conditions, a ? Number(a) : null),
|
|
176
176
|
a ? `Make this a ${n.word} version` : `Stop being a ${n.word} version`
|
|
177
177
|
),
|
|
178
178
|
className: "w-[220px]"
|
|
@@ -185,7 +185,7 @@ function R(s) {
|
|
|
185
185
|
className: y,
|
|
186
186
|
disabled: F,
|
|
187
187
|
"data-action": `make-${n.word}-version`,
|
|
188
|
-
onClick: () => void
|
|
188
|
+
onClick: () => void M(),
|
|
189
189
|
children: [
|
|
190
190
|
/* @__PURE__ */ t(h, { className: "h-3.5 w-3.5" }),
|
|
191
191
|
F ? "Making…" : `Make a ${n.word} version`
|
|
@@ -200,16 +200,16 @@ function R(s) {
|
|
|
200
200
|
}
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
const { layout:
|
|
205
|
-
f && (
|
|
206
|
-
I(
|
|
207
|
-
until:
|
|
203
|
+
function Ie(c) {
|
|
204
|
+
const { layout: r } = c, { userId: e } = Q(), o = X(r.conditions), n = Y(r.conditions), [s, h] = x(""), [u, m] = x(""), f = s > L() && u.trim().length >= 3, i = () => {
|
|
205
|
+
f && (c.set(
|
|
206
|
+
I(r.conditions, {
|
|
207
|
+
until: s,
|
|
208
208
|
reason: u.trim().slice(0, 300),
|
|
209
209
|
by: e || null,
|
|
210
210
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
211
211
|
}),
|
|
212
|
-
`Freeze edits until ${k(
|
|
212
|
+
`Freeze edits until ${k(s)}`
|
|
213
213
|
), h(""), m(""));
|
|
214
214
|
};
|
|
215
215
|
return /* @__PURE__ */ t(C, { k: "layout.conditions.freeze", children: o ? /* @__PURE__ */ l(
|
|
@@ -218,7 +218,7 @@ function Ee(s) {
|
|
|
218
218
|
"data-layout-frozen": o.until,
|
|
219
219
|
className: g(
|
|
220
220
|
"flex flex-wrap items-center gap-2 rounded-md border px-2.5 py-2 text-[12.5px]",
|
|
221
|
-
n ?
|
|
221
|
+
n ? ue : "border-slate-200 text-slate-600 dark:border-border dark:text-muted-foreground"
|
|
222
222
|
),
|
|
223
223
|
children: [
|
|
224
224
|
/* @__PURE__ */ t(P, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
@@ -233,8 +233,8 @@ function Ee(s) {
|
|
|
233
233
|
type: "button",
|
|
234
234
|
className: y,
|
|
235
235
|
"data-action": "lift-freeze",
|
|
236
|
-
onClick: () =>
|
|
237
|
-
I(
|
|
236
|
+
onClick: () => c.set(
|
|
237
|
+
I(r.conditions, null),
|
|
238
238
|
n ? "Lift the edit freeze" : "Remove the ended freeze"
|
|
239
239
|
),
|
|
240
240
|
children: n ? "Lift" : "Remove"
|
|
@@ -250,7 +250,7 @@ function Ee(s) {
|
|
|
250
250
|
{
|
|
251
251
|
type: "date",
|
|
252
252
|
"aria-label": "Frozen until",
|
|
253
|
-
value:
|
|
253
|
+
value: s,
|
|
254
254
|
min: L(),
|
|
255
255
|
onChange: (d) => h(d.target.value),
|
|
256
256
|
className: O
|
|
@@ -269,7 +269,7 @@ function Ee(s) {
|
|
|
269
269
|
onKeyDown: (d) => {
|
|
270
270
|
d.key === "Enter" && i();
|
|
271
271
|
},
|
|
272
|
-
className: g(
|
|
272
|
+
className: g(R, "h-8")
|
|
273
273
|
}
|
|
274
274
|
)
|
|
275
275
|
] }),
|
|
@@ -290,8 +290,8 @@ function Ee(s) {
|
|
|
290
290
|
] }) });
|
|
291
291
|
}
|
|
292
292
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
Te as ActiveDatesSetting,
|
|
294
|
+
Ie as FreezeSetting,
|
|
295
|
+
Pe as PhoneVersionSetting,
|
|
296
|
+
Ee as TabletVersionSetting
|
|
297
297
|
};
|
|
@@ -66,16 +66,16 @@ const y = [
|
|
|
66
66
|
key: "layout.conditions.phone_of",
|
|
67
67
|
section: "who",
|
|
68
68
|
label: "Phone version",
|
|
69
|
-
effect: "A lighter copy of a form that opens instead of it on small screens; it never opens on its own.",
|
|
70
|
-
types: ["grouped"],
|
|
69
|
+
effect: "A lighter copy of a form (or Summary layout) that opens instead of it on small screens; it never opens on its own.",
|
|
70
|
+
types: ["grouped", "summary"],
|
|
71
71
|
keywords: "mobile small screen variant device lighter"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
key: "layout.conditions.tablet_of",
|
|
75
75
|
section: "who",
|
|
76
76
|
label: "Tablet version",
|
|
77
|
-
effect: "A copy of a form arranged for tablet-width screens that opens instead of it there (and on a phone without a phone version); it never opens on its own.",
|
|
78
|
-
types: ["grouped"],
|
|
77
|
+
effect: "A copy of a form (or Summary layout) arranged for tablet-width screens that opens instead of it there (and on a phone without a phone version); it never opens on its own.",
|
|
78
|
+
types: ["grouped", "summary"],
|
|
79
79
|
keywords: "ipad tablet medium screen variant device touch"
|
|
80
80
|
},
|
|
81
81
|
// ── How it's laid out ─────────────────────────────────────────────────────
|
|
@@ -10,14 +10,14 @@ function S(n) {
|
|
|
10
10
|
return c(n);
|
|
11
11
|
}
|
|
12
12
|
function c(n) {
|
|
13
|
-
var
|
|
14
|
-
const e = n ?? { inapp: { status: "delivered" } }, s = [],
|
|
13
|
+
var l, a, r, i;
|
|
14
|
+
const e = n ?? { inapp: { status: "delivered" } }, s = [], o = ((l = e.inapp) == null ? void 0 : l.status) ?? "delivered";
|
|
15
15
|
if (s.push({
|
|
16
16
|
key: "inapp",
|
|
17
17
|
icon: b,
|
|
18
18
|
label: "In-app",
|
|
19
|
-
tone:
|
|
20
|
-
tip:
|
|
19
|
+
tone: o === "delivered" ? "ok" : "muted",
|
|
20
|
+
tip: o === "delivered" ? "Landed in your inbox" : ((a = e.inapp) == null ? void 0 : a.reason) ?? "Skipped"
|
|
21
21
|
}), e.push) {
|
|
22
22
|
const t = e.push.status;
|
|
23
23
|
s.push({
|
|
@@ -25,7 +25,7 @@ function c(n) {
|
|
|
25
25
|
icon: u,
|
|
26
26
|
label: "Push",
|
|
27
27
|
tone: t === "sent" ? "ok" : t === "failed" ? "bad" : "muted",
|
|
28
|
-
tip: t === "sent" ? `Browser push sent${e.push.at ? ` · ${new Date(e.push.at).toLocaleString()}` : ""}` : t === "no_subscription" ? "No browser registered for push" : t === "failed" ? "Push failed" : e.push.reason ?? "Push skipped"
|
|
28
|
+
tip: t === "sent" ? `Browser push sent${e.push.at ? ` · ${new Date(e.push.at).toLocaleString()}` : ""}` : t === "no_subscription" ? "No browser or phone registered for push" : t === "failed" ? "Push failed" : e.push.reason ?? "Push skipped"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
if (e.email && e.email.status !== "not_requested") {
|
|
@@ -64,14 +64,14 @@ function c(n) {
|
|
|
64
64
|
tip: e.sms.status === "sent" ? "Text sent" : e.sms.reason ?? `SMS ${e.sms.status}`
|
|
65
65
|
}), s;
|
|
66
66
|
}
|
|
67
|
-
function w({ delivery: n, mailLogUrl: e, onNavigate: s, className:
|
|
68
|
-
const
|
|
67
|
+
function w({ delivery: n, mailLogUrl: e, onNavigate: s, className: o }) {
|
|
68
|
+
const l = c(n);
|
|
69
69
|
return /* @__PURE__ */ m(
|
|
70
70
|
"span",
|
|
71
71
|
{
|
|
72
|
-
className: `inline-flex flex-wrap items-center gap-1 ${
|
|
72
|
+
className: `inline-flex flex-wrap items-center gap-1 ${o ?? ""}`,
|
|
73
73
|
"data-nvr-delivery": !0,
|
|
74
|
-
children:
|
|
74
|
+
children: l.map((a) => {
|
|
75
75
|
const r = a.icon, i = a.mailLogId != null && e ? e(a.mailLogId) : null, t = /* @__PURE__ */ f(h, { children: [
|
|
76
76
|
/* @__PURE__ */ m(r, { className: "h-2.5 w-2.5", strokeWidth: 2 }),
|
|
77
77
|
a.label
|