@nivaro/react 0.3.140 → 0.3.141
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 +3 -0
- package/dist/shared/components/CollectionBrowserView.js +842 -830
- package/dist/shared/components/ItemEditForm.js +825 -819
- package/dist/shared/components/RowPresence.js +83 -76
- package/dist/shared/components/UnseenDot.js +183 -22
- package/dist/shared/components/delivery-analytics/drill.js +32 -32
- package/dist/shared/components/item-edit/InlineTableField.js +338 -338
- package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
- package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
- package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
- package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
- package/dist/shared/components/layout-editor/settings/controls.js +98 -90
- package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
- package/dist/shared/components/queue/QueueWorklist.js +556 -545
- package/dist/shared/components/support/RequestList.js +2 -2
- package/dist/shared/lib/layout-resolve.js +64 -48
- package/package.json +1 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Lock as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useItemEditAuth as
|
|
7
|
-
import { post as
|
|
8
|
-
import { freezeOf as
|
|
9
|
-
import { cn as
|
|
10
|
-
import { useLayoutEditorHost as
|
|
11
|
-
import { useInvalidateLayouts as
|
|
12
|
-
import { amberStrip as
|
|
13
|
-
import { Setting as
|
|
14
|
-
import { useCollectionLayoutList as
|
|
15
|
-
import { layoutKindOf as
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
const { layout: r } =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as G } from "@tanstack/react-query";
|
|
3
|
+
import { Lock as q, Smartphone as H, Tablet as I } from "lucide-react";
|
|
4
|
+
import { useState as F, useEffect as J } from "react";
|
|
5
|
+
import { toast as D } from "sonner";
|
|
6
|
+
import { useItemEditAuth as X, useNivaroClient as Y } from "../../../context.js";
|
|
7
|
+
import { post as Z, patch as ee } from "../../../lib/commands.js";
|
|
8
|
+
import { freezeOf as te, activeFreeze as ne, localDay as R, dayWords as A, freezePatch as K, activeWindowOf as oe, windowState as ae, windowWords as ie, screenVersionOf as T, summaryForOf as P, activeWindowPatch as se, tabletOfPatch as re, tabletOf as le, phoneOfPatch as ce, phoneOf as de, summaryForPatch as me, conditionsWithKey as ue } from "../../../lib/layout-resolve.js";
|
|
9
|
+
import { cn as $ } from "../../../lib/utils.js";
|
|
10
|
+
import { useLayoutEditorHost as he } from "../host.js";
|
|
11
|
+
import { useInvalidateLayouts as fe, apiFailure as pe } from "../overview/overview-api.js";
|
|
12
|
+
import { amberStrip as ye } from "../panel-style.js";
|
|
13
|
+
import { Setting as z, smallBtn as k, quietText as L, inputCls as V, Chip as be, PickList as j } from "./controls.js";
|
|
14
|
+
import { useCollectionLayoutList as B, settingsKeys as ge } from "./settings-api.js";
|
|
15
|
+
import { layoutKindOf as C } from "./settings-registry.js";
|
|
16
|
+
const _ = $(V, "h-8 w-[150px] font-mono dark:[color-scheme:dark]");
|
|
17
|
+
function We(m) {
|
|
18
|
+
const { layout: r } = m, t = oe(r.conditions), [i, o] = F((t == null ? void 0 : t.from) ?? ""), [s, y] = F((t == null ? void 0 : t.until) ?? "");
|
|
19
|
+
J(() => {
|
|
20
|
+
o((t == null ? void 0 : t.from) ?? ""), y((t == null ? void 0 : t.until) ?? "");
|
|
21
|
+
}, [t == null ? void 0 : t.from, t == null ? void 0 : t.until]);
|
|
22
|
+
const b = !!i && !!s && i > s, f = (l, p) => {
|
|
23
|
+
l && p && l > p || (l || null) === ((t == null ? void 0 : t.from) ?? null) && (p || null) === ((t == null ? void 0 : t.until) ?? null) || m.set(
|
|
24
|
+
se(r.conditions, { from: l || null, until: p || null }),
|
|
25
|
+
l || p ? "Set active dates" : "Clear active dates"
|
|
26
26
|
);
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
27
|
+
}, g = ae(t, R());
|
|
28
|
+
return /* @__PURE__ */ n(
|
|
29
|
+
z,
|
|
30
30
|
{
|
|
31
31
|
k: "layout.conditions.active_window",
|
|
32
|
-
note:
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
32
|
+
note: b ? /* @__PURE__ */ n("span", { className: "text-amber-700 dark:text-amber-300", children: "The end comes before the start." }) : t && g ? /* @__PURE__ */ n("span", { "data-active-window-state": g, children: g === "open" ? `In use now, ${ie(t)}.` : g === "before" ? `Not in use yet: starts ${A(t.from)}.` : `No longer in use: ended ${A(t.until)}.` }) : null,
|
|
33
|
+
children: /* @__PURE__ */ c("div", { className: "flex flex-wrap items-end gap-2", children: [
|
|
34
|
+
/* @__PURE__ */ c("label", { className: "flex flex-col gap-1", children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { className: L, children: "From" }),
|
|
36
|
+
/* @__PURE__ */ n(
|
|
37
37
|
"input",
|
|
38
38
|
{
|
|
39
39
|
type: "date",
|
|
40
40
|
"aria-label": "Active from",
|
|
41
|
-
value:
|
|
41
|
+
value: i,
|
|
42
42
|
max: s || void 0,
|
|
43
|
-
onChange: (
|
|
44
|
-
|
|
43
|
+
onChange: (l) => {
|
|
44
|
+
o(l.target.value), f(l.target.value, s);
|
|
45
45
|
},
|
|
46
|
-
className:
|
|
46
|
+
className: _
|
|
47
47
|
}
|
|
48
48
|
)
|
|
49
49
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ c("label", { className: "flex flex-col gap-1", children: [
|
|
51
|
+
/* @__PURE__ */ n("span", { className: L, children: "Until" }),
|
|
52
|
+
/* @__PURE__ */ n(
|
|
53
53
|
"input",
|
|
54
54
|
{
|
|
55
55
|
type: "date",
|
|
56
56
|
"aria-label": "Active until",
|
|
57
57
|
value: s,
|
|
58
|
-
min:
|
|
59
|
-
onChange: (
|
|
60
|
-
|
|
58
|
+
min: i || void 0,
|
|
59
|
+
onChange: (l) => {
|
|
60
|
+
y(l.target.value), f(i, l.target.value);
|
|
61
61
|
},
|
|
62
|
-
className:
|
|
62
|
+
className: _
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }),
|
|
66
|
-
(
|
|
66
|
+
(i || s) && /* @__PURE__ */ n(
|
|
67
67
|
"button",
|
|
68
68
|
{
|
|
69
69
|
type: "button",
|
|
70
|
-
className:
|
|
70
|
+
className: $(k, "mb-0.5"),
|
|
71
71
|
onClick: () => {
|
|
72
|
-
|
|
72
|
+
o(""), y(""), f("", "");
|
|
73
73
|
},
|
|
74
74
|
children: "Clear"
|
|
75
75
|
}
|
|
@@ -78,211 +78,279 @@ function Te(c) {
|
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const U = {
|
|
82
82
|
phone: {
|
|
83
83
|
key: "phone_of",
|
|
84
|
-
of:
|
|
85
|
-
patch:
|
|
84
|
+
of: de,
|
|
85
|
+
patch: ce,
|
|
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: le,
|
|
92
|
+
patch: re,
|
|
93
93
|
word: "tablet",
|
|
94
94
|
where: "tablet-width screens"
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
function
|
|
98
|
-
return /* @__PURE__ */
|
|
97
|
+
function Ee(m) {
|
|
98
|
+
return /* @__PURE__ */ n(Q, { ...m, screen: "phone" });
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return /* @__PURE__ */
|
|
100
|
+
function Me(m) {
|
|
101
|
+
return /* @__PURE__ */ n(Q, { ...m, screen: "tablet" });
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const { layout: r, collection:
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
|
|
103
|
+
function Q(m) {
|
|
104
|
+
const { layout: r, collection: t, screen: i } = m, o = U[i], s = U[i === "phone" ? "tablet" : "phone"], y = i === "phone" ? H : I, b = Number(r.id), f = he(), g = Y(), l = G(), p = fe(t), O = B(t), [x, S] = F(!1), W = C(r) === "summary" ? "summary" : "grouped", w = O.filter((a) => C(a) === W), v = o.of(r.conditions), e = s.of(r.conditions), d = w.find((a) => a.id !== b && o.of(a.conditions) === b) ?? null, u = v != null ? w.find((a) => a.id === v) ?? null : null, h = (a) => {
|
|
105
|
+
f.layoutLink && f.navigate(f.layoutLink(t, a));
|
|
106
|
+
}, E = async () => {
|
|
107
|
+
S(!0);
|
|
108
108
|
try {
|
|
109
|
-
const a = String(r.name || "Form"),
|
|
110
|
-
|
|
111
|
-
),
|
|
112
|
-
if (!(
|
|
113
|
-
await
|
|
114
|
-
|
|
115
|
-
conditions:
|
|
109
|
+
const a = String(r.name || "Form"), M = await g.request(
|
|
110
|
+
Z(`/collection-layouts/${b}/clone`, { name: `${a} (${o.word})`.slice(0, 255) })
|
|
111
|
+
), N = M == null ? void 0 : M.data;
|
|
112
|
+
if (!(N != null && N.id)) throw new Error("No id came back");
|
|
113
|
+
await g.request(
|
|
114
|
+
ee(`/collection-layouts/${N.id}`, {
|
|
115
|
+
conditions: ue(N.conditions, o.key, b)
|
|
116
116
|
})
|
|
117
|
-
),
|
|
118
|
-
|
|
119
|
-
),
|
|
117
|
+
), l.invalidateQueries({ queryKey: ge.layouts(t) }), p(), D.success(
|
|
118
|
+
i === "phone" ? "Phone version made: remove what a phone does not need" : "Tablet version made: arrange it for a tablet-width screen"
|
|
119
|
+
), h(Number(N.id));
|
|
120
120
|
} catch (a) {
|
|
121
|
-
|
|
121
|
+
D.error(pe(a, `Could not make the ${o.word} version`).message);
|
|
122
122
|
} finally {
|
|
123
|
-
|
|
123
|
+
S(!1);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
return
|
|
126
|
+
return e != null ? /* @__PURE__ */ n(z, { k: `layout.conditions.${o.key}`, children: /* @__PURE__ */ c("p", { className: L, "data-screen-version-blocked": i, children: [
|
|
127
127
|
"This form is the ",
|
|
128
128
|
s.word,
|
|
129
129
|
" version of another form, so it cannot have a ",
|
|
130
|
-
|
|
130
|
+
o.word,
|
|
131
131
|
" ",
|
|
132
132
|
"version."
|
|
133
|
-
] }) }) : /* @__PURE__ */
|
|
134
|
-
|
|
133
|
+
] }) }) : /* @__PURE__ */ n(
|
|
134
|
+
z,
|
|
135
135
|
{
|
|
136
|
-
k: `layout.conditions.${
|
|
137
|
-
note:
|
|
136
|
+
k: `layout.conditions.${o.key}`,
|
|
137
|
+
note: v != null ? /* @__PURE__ */ c(
|
|
138
138
|
"span",
|
|
139
139
|
{
|
|
140
|
-
"data-phone-of":
|
|
141
|
-
"data-tablet-of":
|
|
140
|
+
"data-phone-of": i === "phone" ? v : void 0,
|
|
141
|
+
"data-tablet-of": i === "tablet" ? v : void 0,
|
|
142
142
|
children: [
|
|
143
143
|
"This form opens instead of",
|
|
144
144
|
" ",
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ n("strong", { className: "font-medium text-slate-700 dark:text-foreground", children: (u == null ? void 0 : u.name) ?? `form ${v}` }),
|
|
146
146
|
" ",
|
|
147
147
|
"on ",
|
|
148
|
-
|
|
148
|
+
o.where,
|
|
149
149
|
", for the records and roles that form gets."
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
) : null,
|
|
153
|
-
children:
|
|
153
|
+
children: d ? /* @__PURE__ */ c(
|
|
154
154
|
"div",
|
|
155
155
|
{
|
|
156
|
-
"data-phone-version":
|
|
157
|
-
"data-tablet-version":
|
|
156
|
+
"data-phone-version": i === "phone" ? d.id : void 0,
|
|
157
|
+
"data-tablet-version": i === "tablet" ? d.id : void 0,
|
|
158
158
|
className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-700 dark:text-foreground",
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
|
|
160
|
+
/* @__PURE__ */ n(y, { className: "h-3.5 w-3.5 shrink-0 text-slate-500 dark:text-muted-foreground" }),
|
|
161
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: d.name }),
|
|
162
|
+
f.layoutLink && /* @__PURE__ */ n("button", { type: "button", className: k, onClick: () => h(d.id), children: "Open" })
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
|
-
) : /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
|
|
165
|
+
) : /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
166
|
+
/* @__PURE__ */ n(
|
|
167
|
+
j,
|
|
168
168
|
{
|
|
169
|
-
ariaLabel:
|
|
170
|
-
value:
|
|
171
|
-
placeholder: `Not a ${
|
|
172
|
-
clearLabel: `Not a ${
|
|
173
|
-
options:
|
|
174
|
-
onChange: (a) =>
|
|
175
|
-
|
|
176
|
-
a ? `Make this a ${
|
|
169
|
+
ariaLabel: i === "phone" ? "Phone version of" : "Tablet version of",
|
|
170
|
+
value: v != null ? String(v) : null,
|
|
171
|
+
placeholder: `Not a ${o.word} version`,
|
|
172
|
+
clearLabel: `Not a ${o.word} version`,
|
|
173
|
+
options: w.filter((a) => a.id !== b && T(a.conditions) == null).map((a) => ({ value: String(a.id), label: a.name })),
|
|
174
|
+
onChange: (a) => m.set(
|
|
175
|
+
o.patch(r.conditions, a ? Number(a) : null),
|
|
176
|
+
a ? `Make this a ${o.word} version` : `Stop being a ${o.word} version`
|
|
177
177
|
),
|
|
178
|
-
className: "w-[220px]"
|
|
178
|
+
className: "w-[220px]",
|
|
179
|
+
matchTriggerWidth: !0
|
|
179
180
|
}
|
|
180
181
|
),
|
|
181
|
-
|
|
182
|
+
v == null && /* @__PURE__ */ c(
|
|
182
183
|
"button",
|
|
183
184
|
{
|
|
184
185
|
type: "button",
|
|
185
|
-
className:
|
|
186
|
-
disabled:
|
|
187
|
-
"data-action": `make-${
|
|
188
|
-
onClick: () => void
|
|
186
|
+
className: k,
|
|
187
|
+
disabled: x,
|
|
188
|
+
"data-action": `make-${o.word}-version`,
|
|
189
|
+
onClick: () => void E(),
|
|
189
190
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
191
|
+
/* @__PURE__ */ n(y, { className: "h-3.5 w-3.5" }),
|
|
192
|
+
x ? "Making…" : `Make a ${o.word} version`
|
|
192
193
|
]
|
|
193
194
|
}
|
|
194
195
|
),
|
|
195
|
-
|
|
196
|
+
u && f.layoutLink && /* @__PURE__ */ c("button", { type: "button", className: k, onClick: () => h(u.id), children: [
|
|
196
197
|
"Open ",
|
|
197
|
-
|
|
198
|
+
u.name
|
|
198
199
|
] })
|
|
199
200
|
] })
|
|
200
201
|
}
|
|
201
202
|
);
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
const { layout: r
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
function Re(m) {
|
|
205
|
+
const { layout: r, collection: t } = m, i = B(t);
|
|
206
|
+
if (C(r) !== "summary" || T(r.conditions) != null) return null;
|
|
207
|
+
const o = Number(r.id), s = P(r.conditions), y = i.filter(
|
|
208
|
+
(e) => C(e) === "grouped" && T(e.conditions) == null
|
|
209
|
+
), b = i.filter((e) => e.id !== o && C(e) === "summary"), f = (e, d) => m.set(me(r.conditions, e), d), g = (e) => [e.is_active ? 0 : 1, Number(e.sort ?? 0), Number(e.id)], l = (e, d) => {
|
|
210
|
+
const [u, h] = [g(e), g(d)];
|
|
211
|
+
return u[0] - h[0] || u[1] - h[1] || u[2] - h[2];
|
|
212
|
+
}, p = (e, d) => l(e, d) < 0, O = [r, ...b.filter((e) => T(e.conditions) == null)].sort(
|
|
213
|
+
l
|
|
214
|
+
), x = O.find((e) => !!e.is_active || P(e.conditions).length === 0) ?? null, S = x != null && Number(x.id) === o, W = new Set(O.flatMap((e) => P(e.conditions))), w = s.length > 0 && !x ? y.filter((e) => !W.has(e.id)).length : 0, v = s.length > 0 ? S ? "Also the default: forms without their own Summary get this one." : null : S ? "This is the default Summary: every form without its own Summary gets it." : "Pick forms to give them this Summary instead of the default.";
|
|
215
|
+
return /* @__PURE__ */ n(z, { k: "layout.conditions.summary_for", note: v, children: /* @__PURE__ */ c("div", { className: "space-y-1.5", "data-summary-for": s.join(","), children: [
|
|
216
|
+
s.map((e) => {
|
|
217
|
+
const d = y.find((a) => a.id === e), u = (d == null ? void 0 : d.name) ?? `Form ${e}`, h = b.find((a) => P(a.conditions).includes(e)), E = h ? p(h, r) : !1;
|
|
218
|
+
return /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-0.5", children: [
|
|
219
|
+
/* @__PURE__ */ n(
|
|
220
|
+
be,
|
|
221
|
+
{
|
|
222
|
+
label: u,
|
|
223
|
+
onRemove: () => f(
|
|
224
|
+
s.filter((a) => a !== e),
|
|
225
|
+
`Stop using for “${u}”`
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
h && /* @__PURE__ */ n(
|
|
230
|
+
"span",
|
|
231
|
+
{
|
|
232
|
+
"data-summary-clash": e,
|
|
233
|
+
className: "basis-full text-[11.5px] text-amber-700 dark:text-amber-400",
|
|
234
|
+
children: E ? `Also pinned to “${h.name}”, which comes first, so “${h.name}” is used` : `Also pinned to “${h.name}”; this Summary comes first, so it is used`
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] }, e);
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ n(
|
|
240
|
+
j,
|
|
241
|
+
{
|
|
242
|
+
ariaLabel: "Add a form",
|
|
243
|
+
value: null,
|
|
244
|
+
placeholder: s.length ? "Add another form" : "Pick forms",
|
|
245
|
+
emptyText: "No more forms",
|
|
246
|
+
options: y.filter((e) => !s.includes(e.id)).map((e) => ({ value: String(e.id), label: e.name })),
|
|
247
|
+
onChange: (e) => {
|
|
248
|
+
var u;
|
|
249
|
+
if (!e) return;
|
|
250
|
+
const d = ((u = y.find((h) => String(h.id) === e)) == null ? void 0 : u.name) ?? `Form ${e}`;
|
|
251
|
+
f([...s, Number(e)], `Use for “${d}”`);
|
|
252
|
+
},
|
|
253
|
+
className: "w-[220px]",
|
|
254
|
+
matchTriggerWidth: !0
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
w > 0 && /* @__PURE__ */ c(
|
|
258
|
+
"p",
|
|
259
|
+
{
|
|
260
|
+
"data-summary-orphans": w,
|
|
261
|
+
className: "text-[11.5px] text-amber-700 dark:text-amber-400",
|
|
262
|
+
children: [
|
|
263
|
+
w === 1 ? "Pinning this leaves 1 form with no Summary — it opens read-only." : `Pinning this leaves ${w} forms with no Summary — they open read-only.`,
|
|
264
|
+
" ",
|
|
265
|
+
"Make another Summary the default, or make this one the default to keep it for them."
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] }) });
|
|
270
|
+
}
|
|
271
|
+
function _e(m) {
|
|
272
|
+
const { layout: r } = m, { userId: t } = X(), i = te(r.conditions), o = ne(r.conditions), [s, y] = F(""), [b, f] = F(""), g = s > R() && b.trim().length >= 3, l = () => {
|
|
273
|
+
g && (m.set(
|
|
274
|
+
K(r.conditions, {
|
|
207
275
|
until: s,
|
|
208
|
-
reason:
|
|
209
|
-
by:
|
|
276
|
+
reason: b.trim().slice(0, 300),
|
|
277
|
+
by: t || null,
|
|
210
278
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
211
279
|
}),
|
|
212
|
-
`Freeze edits until ${
|
|
213
|
-
),
|
|
280
|
+
`Freeze edits until ${A(s)}`
|
|
281
|
+
), y(""), f(""));
|
|
214
282
|
};
|
|
215
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ n(z, { k: "layout.conditions.freeze", children: i ? /* @__PURE__ */ c(
|
|
216
284
|
"div",
|
|
217
285
|
{
|
|
218
|
-
"data-layout-frozen":
|
|
219
|
-
className:
|
|
286
|
+
"data-layout-frozen": i.until,
|
|
287
|
+
className: $(
|
|
220
288
|
"flex flex-wrap items-center gap-2 rounded-md border px-2.5 py-2 text-[12.5px]",
|
|
221
|
-
|
|
289
|
+
o ? ye : "border-slate-200 text-slate-600 dark:border-border dark:text-muted-foreground"
|
|
222
290
|
),
|
|
223
291
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
292
|
+
/* @__PURE__ */ n(q, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
293
|
+
/* @__PURE__ */ c("span", { className: "min-w-0 flex-1", children: [
|
|
294
|
+
o ? "Frozen until " : "The freeze ended on ",
|
|
295
|
+
A(i.until),
|
|
296
|
+
i.reason ? `: ${i.reason}` : ""
|
|
229
297
|
] }),
|
|
230
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ n(
|
|
231
299
|
"button",
|
|
232
300
|
{
|
|
233
301
|
type: "button",
|
|
234
|
-
className:
|
|
302
|
+
className: k,
|
|
235
303
|
"data-action": "lift-freeze",
|
|
236
|
-
onClick: () =>
|
|
237
|
-
|
|
238
|
-
|
|
304
|
+
onClick: () => m.set(
|
|
305
|
+
K(r.conditions, null),
|
|
306
|
+
o ? "Lift the edit freeze" : "Remove the ended freeze"
|
|
239
307
|
),
|
|
240
|
-
children:
|
|
308
|
+
children: o ? "Lift" : "Remove"
|
|
241
309
|
}
|
|
242
310
|
)
|
|
243
311
|
]
|
|
244
312
|
}
|
|
245
|
-
) : /* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
313
|
+
) : /* @__PURE__ */ c("div", { className: "flex flex-wrap items-end gap-2", children: [
|
|
314
|
+
/* @__PURE__ */ c("label", { className: "flex flex-col gap-1", children: [
|
|
315
|
+
/* @__PURE__ */ n("span", { className: L, children: "Until" }),
|
|
316
|
+
/* @__PURE__ */ n(
|
|
249
317
|
"input",
|
|
250
318
|
{
|
|
251
319
|
type: "date",
|
|
252
320
|
"aria-label": "Frozen until",
|
|
253
321
|
value: s,
|
|
254
|
-
min:
|
|
255
|
-
onChange: (
|
|
256
|
-
className:
|
|
322
|
+
min: R(),
|
|
323
|
+
onChange: (p) => y(p.target.value),
|
|
324
|
+
className: _
|
|
257
325
|
}
|
|
258
326
|
)
|
|
259
327
|
] }),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ c("label", { className: "flex min-w-[180px] flex-1 flex-col gap-1", children: [
|
|
329
|
+
/* @__PURE__ */ n("span", { className: L, children: "Reason people see" }),
|
|
330
|
+
/* @__PURE__ */ n(
|
|
263
331
|
"input",
|
|
264
332
|
{
|
|
265
|
-
value:
|
|
333
|
+
value: b,
|
|
266
334
|
maxLength: 300,
|
|
267
335
|
placeholder: "e.g. Go-live on Monday",
|
|
268
|
-
onChange: (
|
|
269
|
-
onKeyDown: (
|
|
270
|
-
|
|
336
|
+
onChange: (p) => f(p.target.value),
|
|
337
|
+
onKeyDown: (p) => {
|
|
338
|
+
p.key === "Enter" && l();
|
|
271
339
|
},
|
|
272
|
-
className:
|
|
340
|
+
className: $(V, "h-8")
|
|
273
341
|
}
|
|
274
342
|
)
|
|
275
343
|
] }),
|
|
276
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ c(
|
|
277
345
|
"button",
|
|
278
346
|
{
|
|
279
347
|
type: "button",
|
|
280
|
-
className:
|
|
281
|
-
disabled: !
|
|
348
|
+
className: $(k, "mb-0.5"),
|
|
349
|
+
disabled: !g,
|
|
282
350
|
"data-action": "freeze",
|
|
283
|
-
onClick:
|
|
351
|
+
onClick: l,
|
|
284
352
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ n(q, { className: "h-3.5 w-3.5" }),
|
|
286
354
|
"Freeze"
|
|
287
355
|
]
|
|
288
356
|
}
|
|
@@ -290,8 +358,9 @@ function Ie(c) {
|
|
|
290
358
|
] }) });
|
|
291
359
|
}
|
|
292
360
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
361
|
+
We as ActiveDatesSetting,
|
|
362
|
+
_e as FreezeSetting,
|
|
363
|
+
Ee as PhoneVersionSetting,
|
|
364
|
+
Re as SummaryForSetting,
|
|
365
|
+
Me as TabletVersionSetting
|
|
297
366
|
};
|