@epam/ai-dial-publish-panel 1.2.0-dev.274 → 1.2.0-dev.276
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/components/PublishPanel/PublishPanel.d.ts +8 -24
- package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
- package/components/PublishPanel/StandalonePublishPanel.d.ts +2 -8
- package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
- package/index.js +499 -502
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
-
import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, GhostButton as d, GhostIconButton as f, Input as p, NeutralButton as m, Notification as h, NotificationType as g, NotificationVariant as _, Search as
|
|
3
|
-
import { ResourceSummary as C, TAG_INPUT_TAG_CLASS_NAME as w, buildCssVars as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { IconFolderPlus as
|
|
6
|
-
import { DialFileNodeType as
|
|
2
|
+
import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, GhostButton as d, GhostIconButton as f, Input as p, NeutralButton as m, Notification as h, NotificationType as g, NotificationVariant as _, Search as ee, Select as v, SideDrawer as y, Spinner as b, Tag as x, TagInput as S } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { ResourceSummary as C, TAG_INPUT_TAG_CLASS_NAME as w, buildCssVars as te, mergeClasses as T } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
5
|
+
import { IconFolderPlus as ne, IconPlus as k, IconTrashX as re } from "@tabler/icons-react";
|
|
6
|
+
import { DialFileNodeType as A, DialFoldersTree as ie } from "@epam/ai-dial-react-file-manager";
|
|
7
7
|
//#region src/models/publish.ts
|
|
8
|
-
var
|
|
8
|
+
var j = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
|
|
10
|
-
}({}),
|
|
10
|
+
}({}), M = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
|
|
12
|
-
}({}),
|
|
13
|
-
calloutKind:
|
|
12
|
+
}({}), N = (e) => e.isSubmitting ? {
|
|
13
|
+
calloutKind: M.None,
|
|
14
14
|
isSubmitDisabled: !0,
|
|
15
15
|
isSubmitLoading: !0
|
|
16
16
|
} : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
|
|
17
|
-
calloutKind:
|
|
17
|
+
calloutKind: M.SubmitError,
|
|
18
18
|
isSubmitDisabled: !1,
|
|
19
19
|
isSubmitLoading: !1
|
|
20
20
|
} : e.hasExistingPublicationInFolder ? {
|
|
21
|
-
calloutKind:
|
|
21
|
+
calloutKind: M.ReplaceWarning,
|
|
22
22
|
isSubmitDisabled: e.allowReplace === !1,
|
|
23
23
|
isSubmitLoading: !1
|
|
24
24
|
} : {
|
|
25
|
-
calloutKind:
|
|
25
|
+
calloutKind: M.Info,
|
|
26
26
|
isSubmitDisabled: !1,
|
|
27
27
|
isSubmitLoading: !1
|
|
28
28
|
} : {
|
|
29
|
-
calloutKind:
|
|
29
|
+
calloutKind: M.NoAccess,
|
|
30
30
|
isSubmitDisabled: !0,
|
|
31
31
|
isSubmitLoading: !1
|
|
32
32
|
} : {
|
|
33
|
-
calloutKind:
|
|
33
|
+
calloutKind: M.None,
|
|
34
34
|
isSubmitDisabled: !0,
|
|
35
35
|
isSubmitLoading: !1
|
|
36
|
-
},
|
|
37
|
-
let r = Math.floor((t - e) /
|
|
36
|
+
}, P = 1440 * 60 * 1e3, F = (e, t = Date.now(), n) => {
|
|
37
|
+
let r = Math.floor((t - e) / P);
|
|
38
38
|
return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
|
|
39
39
|
month: "short",
|
|
40
40
|
day: "numeric",
|
|
41
41
|
year: "numeric"
|
|
42
42
|
});
|
|
43
|
-
},
|
|
43
|
+
}, I = (e, t, n) => t.length === 0 ? [...e, {
|
|
44
44
|
path: [n],
|
|
45
45
|
name: n
|
|
46
46
|
}] : e.map((e) => e.path.join("/") === t.join("/") ? {
|
|
@@ -51,46 +51,46 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
51
51
|
}]
|
|
52
52
|
} : {
|
|
53
53
|
...e,
|
|
54
|
-
children: e.children ?
|
|
55
|
-
}),
|
|
54
|
+
children: e.children ? I(e.children, t, n) : e.children
|
|
55
|
+
}), L = (e, t, n) => {
|
|
56
56
|
let r = [...t, n].join("/");
|
|
57
57
|
return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
|
|
58
58
|
...e,
|
|
59
59
|
children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
|
|
60
60
|
} : {
|
|
61
61
|
...e,
|
|
62
|
-
children: e.children ?
|
|
62
|
+
children: e.children ? L(e.children, t, n) : e.children
|
|
63
63
|
});
|
|
64
|
-
},
|
|
64
|
+
}, R = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
|
|
65
65
|
let [m, h] = a(o);
|
|
66
66
|
t(() => {
|
|
67
67
|
h(o);
|
|
68
68
|
}, [o]);
|
|
69
|
-
let [g, _] = a(), [
|
|
69
|
+
let [g, _] = a(), [ee, v] = a(!1), [y, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [te, T] = a(!1), [E, D] = a(c), [O, ne] = a(!1), [k, re] = a(!1);
|
|
70
70
|
t(() => {
|
|
71
|
-
|
|
72
|
-
}, [c,
|
|
73
|
-
let
|
|
74
|
-
|
|
71
|
+
k || D(c);
|
|
72
|
+
}, [c, k]);
|
|
73
|
+
let A = e((e) => {
|
|
74
|
+
re(!0), D(e);
|
|
75
75
|
}, []);
|
|
76
76
|
t(() => {
|
|
77
77
|
if (g == null) {
|
|
78
|
-
S([]),
|
|
78
|
+
S([]), T(!1);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
if (!p) return;
|
|
82
82
|
let e = !1;
|
|
83
|
-
return w(!0),
|
|
83
|
+
return w(!0), T(!1), p(g).then((t) => {
|
|
84
84
|
e || S(t);
|
|
85
85
|
}).catch(() => {
|
|
86
|
-
e ||
|
|
86
|
+
e || T(!0);
|
|
87
87
|
}).finally(() => {
|
|
88
88
|
e || w(!1);
|
|
89
89
|
}), () => {
|
|
90
90
|
e = !0;
|
|
91
91
|
};
|
|
92
92
|
}, [g]);
|
|
93
|
-
let
|
|
93
|
+
let ie = r(() => {
|
|
94
94
|
if (!g) return !1;
|
|
95
95
|
let e = g.join("/");
|
|
96
96
|
return i.some((t) => t.folderPath.join("/") === e ? n.version == null ? !0 : t.version === n.version : !1);
|
|
@@ -98,126 +98,126 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
98
98
|
i,
|
|
99
99
|
n.version,
|
|
100
100
|
g
|
|
101
|
-
]),
|
|
102
|
-
h((n) =>
|
|
101
|
+
]), j = e(async (e, t) => {
|
|
102
|
+
h((n) => I(n, e, t));
|
|
103
103
|
try {
|
|
104
104
|
await l?.(e, t);
|
|
105
105
|
} catch {
|
|
106
|
-
h((n) =>
|
|
106
|
+
h((n) => L(n, e, t)), b(!0);
|
|
107
107
|
}
|
|
108
|
-
}, [l]),
|
|
108
|
+
}, [l]), M = e(async () => {
|
|
109
109
|
if (!g) return !1;
|
|
110
|
-
|
|
110
|
+
v(!0), b(!1);
|
|
111
111
|
try {
|
|
112
|
-
return await u(n, g, x,
|
|
112
|
+
return await u(n, g, x, E.trim(), O), d?.(n, g), !0;
|
|
113
113
|
} catch (e) {
|
|
114
114
|
return b(!0), f?.(n, g, e), !1;
|
|
115
115
|
} finally {
|
|
116
|
-
|
|
116
|
+
v(!1);
|
|
117
117
|
}
|
|
118
118
|
}, [
|
|
119
|
-
|
|
119
|
+
E,
|
|
120
120
|
n,
|
|
121
121
|
u,
|
|
122
122
|
f,
|
|
123
123
|
d,
|
|
124
|
-
|
|
124
|
+
O,
|
|
125
125
|
x,
|
|
126
126
|
g
|
|
127
|
-
]),
|
|
128
|
-
h(o), _(void 0), b(!1), S([]),
|
|
127
|
+
]), N = e(() => {
|
|
128
|
+
h(o), _(void 0), b(!1), S([]), T(!1), D(c), re(!1), ne(!1);
|
|
129
129
|
}, [c, o]);
|
|
130
130
|
return {
|
|
131
131
|
folderItems: m,
|
|
132
132
|
selectedFolderPath: g,
|
|
133
133
|
setSelectedFolderPath: _,
|
|
134
|
-
handleCreateFolder:
|
|
135
|
-
hasExistingPublicationInFolder:
|
|
134
|
+
handleCreateFolder: j,
|
|
135
|
+
hasExistingPublicationInFolder: ie,
|
|
136
136
|
hasWriteAccess: g ? s(g) : !0,
|
|
137
|
-
isSubmitting:
|
|
138
|
-
hasSubmitError:
|
|
139
|
-
handleSubmit:
|
|
140
|
-
reset:
|
|
137
|
+
isSubmitting: ee,
|
|
138
|
+
hasSubmitError: y,
|
|
139
|
+
handleSubmit: M,
|
|
140
|
+
reset: N,
|
|
141
141
|
rules: x,
|
|
142
142
|
setRules: S,
|
|
143
|
-
author:
|
|
144
|
-
setAuthor:
|
|
145
|
-
publishCredentials:
|
|
146
|
-
setPublishCredentials:
|
|
143
|
+
author: E,
|
|
144
|
+
setAuthor: A,
|
|
145
|
+
publishCredentials: O,
|
|
146
|
+
setPublishCredentials: ne,
|
|
147
147
|
isRulesLoading: C,
|
|
148
|
-
hasRulesLoadError:
|
|
148
|
+
hasRulesLoadError: te
|
|
149
149
|
};
|
|
150
|
-
},
|
|
150
|
+
}, ae = (e, t) => {
|
|
151
151
|
let n = t.trim().toLowerCase();
|
|
152
152
|
return n ? e.reduce((e, r) => {
|
|
153
|
-
let i = r.children ?
|
|
153
|
+
let i = r.children ? ae(r.children, t) : void 0;
|
|
154
154
|
return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
|
|
155
155
|
...r,
|
|
156
156
|
children: i
|
|
157
157
|
}), e;
|
|
158
158
|
}, []) : e;
|
|
159
|
-
},
|
|
159
|
+
}, z = (e, t) => e.localeCompare(t, void 0, {
|
|
160
160
|
sensitivity: "base",
|
|
161
161
|
numeric: !0
|
|
162
|
-
}),
|
|
162
|
+
}), B = (e) => [...e].sort((e, t) => z(e.name, t.name)).map((e) => e.children ? {
|
|
163
163
|
...e,
|
|
164
|
-
children:
|
|
165
|
-
} : e),
|
|
164
|
+
children: B(e.children)
|
|
165
|
+
} : e), V = (e, t, n) => {
|
|
166
166
|
let [r, ...i] = t;
|
|
167
167
|
if (r == null) return e;
|
|
168
168
|
let a = [...n, r], o = e.find((e) => e.name === r);
|
|
169
169
|
return o ? i.length ? e.map((e) => e === o ? {
|
|
170
170
|
...e,
|
|
171
|
-
children:
|
|
171
|
+
children: V(e.children ?? [], i, a)
|
|
172
172
|
} : e) : e : [...e, {
|
|
173
173
|
path: a,
|
|
174
174
|
name: r,
|
|
175
|
-
children: i.length ?
|
|
175
|
+
children: i.length ? V([], i, a) : void 0
|
|
176
176
|
}];
|
|
177
|
-
},
|
|
178
|
-
let t =
|
|
177
|
+
}, oe = (e, t) => t.reduce((e, t) => t.length ? V(e, t, []) : e, e), H = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? H(e.children) : []]), U = (e) => e.join("/"), W = (e) => e.split("/").filter(Boolean), se = (e) => e.map((e) => {
|
|
178
|
+
let t = U(e.path);
|
|
179
179
|
return {
|
|
180
180
|
path: t,
|
|
181
181
|
name: e.name,
|
|
182
182
|
folderId: t,
|
|
183
183
|
nodeType: u.FOLDER,
|
|
184
|
-
items: e.children ?
|
|
184
|
+
items: e.children ? se(e.children) : void 0
|
|
185
185
|
};
|
|
186
|
-
}),
|
|
186
|
+
}), G = /[/\\:;,={}&"]/, ce = (e, t, n) => {
|
|
187
187
|
let r = e.trim();
|
|
188
|
-
return r ? r.includes("..") ||
|
|
189
|
-
},
|
|
188
|
+
return r ? r.includes("..") || G.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
|
|
189
|
+
}, le = (e, t) => {
|
|
190
190
|
let n = new Set(t.map((e) => e.toLowerCase()));
|
|
191
191
|
if (!n.has(e.toLowerCase())) return e;
|
|
192
192
|
let r = 2;
|
|
193
193
|
for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
|
|
194
194
|
return `${e} ${r}`;
|
|
195
|
-
},
|
|
195
|
+
}, ue = (e, t) => {
|
|
196
196
|
if (t.length === 0) return e.map((e) => e.name);
|
|
197
|
-
let n =
|
|
197
|
+
let n = U(t), r = (e) => {
|
|
198
198
|
for (let t of e) {
|
|
199
|
-
if (
|
|
199
|
+
if (U(t.path) === n) return t;
|
|
200
200
|
let e = t.children ? r(t.children) : void 0;
|
|
201
201
|
if (e) return e;
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
return (r(e)?.children ?? []).map((e) => e.name);
|
|
205
|
-
},
|
|
205
|
+
}, K = {
|
|
206
206
|
dialog: "_dialog_jqcm2_5",
|
|
207
207
|
error: "_error_jqcm2_14",
|
|
208
208
|
selectField: "_selectField_jqcm2_28",
|
|
209
209
|
selectFieldOpen: "_selectFieldOpen_jqcm2_40"
|
|
210
|
-
},
|
|
210
|
+
}, q = 20, J = 200, de = 8, Y = (e) => {
|
|
211
211
|
let t = e.trim();
|
|
212
|
-
if (t.length === 0 || t.length >
|
|
212
|
+
if (t.length === 0 || t.length > J) return !1;
|
|
213
213
|
try {
|
|
214
214
|
return new RegExp(t) instanceof RegExp;
|
|
215
215
|
} catch {
|
|
216
216
|
return !1;
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, fe = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = q, labels: u = {}, errorClassName: f = "dial-small-text", styles: h = {} }) => {
|
|
219
219
|
let g = {
|
|
220
|
-
...
|
|
220
|
+
...te({
|
|
221
221
|
"--pare-mobile-bg": h.colors?.mobileBackground,
|
|
222
222
|
"--pare-bg": h.colors?.background,
|
|
223
223
|
"--pare-error-text": h.colors?.errorText,
|
|
@@ -227,128 +227,128 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
227
227
|
"--pare-select-border-focus": h.colors?.selectBorderFocus
|
|
228
228
|
}),
|
|
229
229
|
...h.cssVars
|
|
230
|
-
}, { sourceLabel: _ = "Source", sourcePlaceholder:
|
|
230
|
+
}, { sourceLabel: _ = "Source", sourcePlaceholder: ee = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: E = "Targets", targetsPlaceholder: ne = "Add a target", targetsHintLabel: k = "Press Enter or comma to add a target.", patternLabel: re = "Pattern", patternPlaceholder: A = "Enter a regular expression", invalidRegexError: ie = "Enter a valid regular expression.", requiredFieldError: M = "This field is required.", targetsRequiredError: N = "Add at least one target.", saveLabel: P = "Save", cancelLabel: F = "Cancel", dialogAriaLabel: I = "Add access rule" } = u, L = n(), R = n(), ae = n(), z = n(), B = i(null);
|
|
231
231
|
t(() => {
|
|
232
|
-
|
|
232
|
+
B.current?.focus();
|
|
233
233
|
}, []);
|
|
234
|
-
let [
|
|
234
|
+
let [V, oe] = a(), [H, U] = a(), [W, se] = a([]), [G, ce] = a(""), [le, ue] = a(!1), [J, fe] = a(!1), [X, pe] = a(!1), me = T(K.selectField, le && K.selectFieldOpen), he = T(K.selectField, J && K.selectFieldOpen), Z = r(() => e.map((e) => ({
|
|
235
235
|
value: e,
|
|
236
236
|
label: e
|
|
237
|
-
})), [e]),
|
|
237
|
+
})), [e]), ge = r(() => [
|
|
238
238
|
{
|
|
239
|
-
value:
|
|
239
|
+
value: j.Equal,
|
|
240
240
|
label: b
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
|
-
value:
|
|
243
|
+
value: j.Contain,
|
|
244
244
|
label: x
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
value:
|
|
247
|
+
value: j.Regex,
|
|
248
248
|
label: C
|
|
249
249
|
}
|
|
250
250
|
], [
|
|
251
251
|
b,
|
|
252
252
|
x,
|
|
253
253
|
C
|
|
254
|
-
]),
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
ref:
|
|
254
|
+
]), _e = H === j.Regex, Q = Y(G), ve = V != null && H != null && (_e ? Q : W.length > 0);
|
|
255
|
+
return /* @__PURE__ */ O("div", {
|
|
256
|
+
ref: B,
|
|
257
257
|
role: "dialog",
|
|
258
258
|
"aria-modal": "true",
|
|
259
|
-
"aria-label":
|
|
259
|
+
"aria-label": I,
|
|
260
260
|
tabIndex: -1,
|
|
261
261
|
onKeyDown: (e) => {
|
|
262
262
|
e.key === "Escape" && (e.stopPropagation(), s());
|
|
263
263
|
},
|
|
264
264
|
style: g,
|
|
265
|
-
className:
|
|
265
|
+
className: T("fixed inset-0 z-[60] flex flex-col gap-3 overflow-y-auto p-4", "desktop:static desktop:z-auto desktop:flex-none desktop:overflow-visible desktop:rounded-lg desktop:p-3", K.dialog),
|
|
266
266
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
id:
|
|
267
|
+
/* @__PURE__ */ D(v, {
|
|
268
|
+
id: R,
|
|
269
269
|
labelProps: { label: _ },
|
|
270
|
-
options:
|
|
271
|
-
value:
|
|
270
|
+
options: Z,
|
|
271
|
+
value: V,
|
|
272
272
|
onChange: (e) => {
|
|
273
|
-
|
|
273
|
+
oe(Array.isArray(e) ? e[0] : e), ue(!1);
|
|
274
274
|
},
|
|
275
|
-
placeholder:
|
|
276
|
-
searchable: e.length >
|
|
277
|
-
searchPlaceholder:
|
|
275
|
+
placeholder: ee,
|
|
276
|
+
searchable: e.length > de,
|
|
277
|
+
searchPlaceholder: ee,
|
|
278
278
|
disabled: c,
|
|
279
|
-
open:
|
|
280
|
-
onOpenChange:
|
|
281
|
-
fieldClassName:
|
|
282
|
-
invalid:
|
|
283
|
-
error:
|
|
279
|
+
open: le,
|
|
280
|
+
onOpenChange: ue,
|
|
281
|
+
fieldClassName: me,
|
|
282
|
+
invalid: X && V == null,
|
|
283
|
+
error: X && V == null ? M : void 0
|
|
284
284
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
labelProps: { label:
|
|
287
|
-
id:
|
|
288
|
-
options:
|
|
289
|
-
value:
|
|
285
|
+
/* @__PURE__ */ D(v, {
|
|
286
|
+
labelProps: { label: y },
|
|
287
|
+
id: ae,
|
|
288
|
+
options: ge,
|
|
289
|
+
value: H,
|
|
290
290
|
onChange: (e) => {
|
|
291
291
|
let t = Array.isArray(e) ? e[0] : e;
|
|
292
|
-
|
|
292
|
+
H === j.Regex != (t === j.Regex) && (se([]), ce("")), U(t), fe(!1);
|
|
293
293
|
},
|
|
294
|
-
placeholder:
|
|
294
|
+
placeholder: y,
|
|
295
295
|
disabled: c,
|
|
296
|
-
open:
|
|
297
|
-
onOpenChange:
|
|
298
|
-
fieldClassName:
|
|
299
|
-
invalid:
|
|
300
|
-
error:
|
|
296
|
+
open: J,
|
|
297
|
+
onOpenChange: fe,
|
|
298
|
+
fieldClassName: he,
|
|
299
|
+
invalid: X && H == null,
|
|
300
|
+
error: X && H == null ? M : void 0
|
|
301
301
|
}),
|
|
302
|
-
|
|
303
|
-
id: `${
|
|
304
|
-
labelProps: { label:
|
|
305
|
-
placeholder:
|
|
306
|
-
value:
|
|
307
|
-
onChange: (e) =>
|
|
308
|
-
invalid: (
|
|
309
|
-
"aria-describedby": (
|
|
302
|
+
_e ? /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D(p, {
|
|
303
|
+
id: `${L}-input`,
|
|
304
|
+
labelProps: { label: re },
|
|
305
|
+
placeholder: A,
|
|
306
|
+
value: G,
|
|
307
|
+
onChange: (e) => ce(e ?? ""),
|
|
308
|
+
invalid: (G.length > 0 || X) && !Q,
|
|
309
|
+
"aria-describedby": (G.length > 0 || X) && !Q ? L : void 0,
|
|
310
310
|
disabled: c
|
|
311
|
-
}), (
|
|
312
|
-
id:
|
|
311
|
+
}), (G.length > 0 || X) && !Q && /* @__PURE__ */ D("span", {
|
|
312
|
+
id: L,
|
|
313
313
|
role: "alert",
|
|
314
|
-
className:
|
|
315
|
-
children:
|
|
316
|
-
})] }) : /* @__PURE__ */
|
|
317
|
-
id:
|
|
318
|
-
labelProps: { label:
|
|
319
|
-
placeholder:
|
|
320
|
-
caption:
|
|
321
|
-
error:
|
|
322
|
-
invalid:
|
|
323
|
-
value:
|
|
314
|
+
className: T("mt-1 block", f, K.error),
|
|
315
|
+
children: ie
|
|
316
|
+
})] }) : /* @__PURE__ */ D(S, {
|
|
317
|
+
id: z,
|
|
318
|
+
labelProps: { label: E },
|
|
319
|
+
placeholder: ne,
|
|
320
|
+
caption: X && W.length === 0 ? void 0 : k,
|
|
321
|
+
error: X && W.length === 0 ? N : void 0,
|
|
322
|
+
invalid: X && W.length === 0,
|
|
323
|
+
value: W,
|
|
324
324
|
onChange: (e) => {
|
|
325
325
|
let t = [];
|
|
326
326
|
for (let n of e) {
|
|
327
327
|
let e = n.trim();
|
|
328
328
|
if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
se(t);
|
|
331
331
|
},
|
|
332
332
|
disabled: c,
|
|
333
333
|
tagClassName: w
|
|
334
334
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ O("div", {
|
|
336
336
|
className: "mt-auto flex justify-end gap-2 desktop:mt-2",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
338
|
-
label:
|
|
337
|
+
children: [/* @__PURE__ */ D(d, {
|
|
338
|
+
label: F,
|
|
339
339
|
onClick: s,
|
|
340
340
|
disabled: c
|
|
341
|
-
}), /* @__PURE__ */
|
|
342
|
-
label:
|
|
341
|
+
}), /* @__PURE__ */ D(m, {
|
|
342
|
+
label: P,
|
|
343
343
|
onClick: () => {
|
|
344
|
-
if (!
|
|
345
|
-
|
|
344
|
+
if (!ve || V == null || H == null) {
|
|
345
|
+
pe(!0);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
o({
|
|
349
|
-
source:
|
|
350
|
-
function:
|
|
351
|
-
targets:
|
|
349
|
+
source: V,
|
|
350
|
+
function: H,
|
|
351
|
+
targets: _e ? [G.trim()] : W
|
|
352
352
|
});
|
|
353
353
|
},
|
|
354
354
|
disabled: c
|
|
@@ -356,165 +356,165 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
356
356
|
})
|
|
357
357
|
]
|
|
358
358
|
});
|
|
359
|
-
},
|
|
359
|
+
}, X = {
|
|
360
360
|
ruleRow: "_ruleRow_nx0en_1",
|
|
361
361
|
heading: "_heading_nx0en_5",
|
|
362
362
|
hint: "_hint_nx0en_9",
|
|
363
363
|
loading: "_loading_nx0en_13",
|
|
364
364
|
ruleText: "_ruleText_nx0en_17"
|
|
365
|
-
},
|
|
366
|
-
let
|
|
367
|
-
...
|
|
368
|
-
"--par-rule-bg":
|
|
369
|
-
"--par-heading-text":
|
|
370
|
-
"--par-hint-text":
|
|
371
|
-
"--par-loading-text":
|
|
372
|
-
"--par-rule-text":
|
|
365
|
+
}, pe = 20, me = (e, t) => e === j.Equal ? t.equal : e === j.Contain ? t.contain : t.regex, he = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: p = !1, isLoading: m = !1, hasLoadError: ee = !1, maxRules: v = pe, maxTargetsPerRule: y, labels: x = {}, headingClassName: S = "dial-body-semi-text", hintClassName: C = "dial-small-text", loadingClassName: w = "dial-small-text", ruleTextClassName: E = "dial-small-text", ruleSourceClassName: ne = "dial-small-semi-text", styles: A = {} }) => {
|
|
366
|
+
let ie = {
|
|
367
|
+
...te({
|
|
368
|
+
"--par-rule-bg": A.colors?.ruleBackground,
|
|
369
|
+
"--par-heading-text": A.colors?.headingText,
|
|
370
|
+
"--par-hint-text": A.colors?.hintText,
|
|
371
|
+
"--par-loading-text": A.colors?.loadingText,
|
|
372
|
+
"--par-rule-text": A.colors?.ruleText
|
|
373
373
|
}),
|
|
374
|
-
...
|
|
375
|
-
}, { heading:
|
|
374
|
+
...A.cssVars
|
|
375
|
+
}, { heading: j = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: F = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: R = "Or", removeRuleAriaLabelTemplate: ae = "Remove rule for {source}: {targets}", equalFunctionLabel: z = "Equal", containFunctionLabel: B = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: oe = "Loading existing rules…", loadErrorLabel: H = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: U = "Rule added.", ruleRemovedAnnouncement: W = "Rule removed.", rulesClearedAnnouncement: se = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: ce } = x, le = n(), [ue, K] = a(!1), [q, J] = a(""), de = i(null), Y = i(m);
|
|
376
376
|
t(() => {
|
|
377
|
-
|
|
377
|
+
Y.current && !m && e.length > 0 && J(G), Y.current = m;
|
|
378
378
|
}, [
|
|
379
379
|
m,
|
|
380
380
|
e,
|
|
381
|
-
|
|
381
|
+
G
|
|
382
382
|
]);
|
|
383
|
-
let
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
}, he = (t) => {
|
|
388
|
-
r([...e, t]), X(K), Q();
|
|
383
|
+
let he = () => {
|
|
384
|
+
de.current = document.activeElement, K(!0);
|
|
385
|
+
}, Z = () => {
|
|
386
|
+
K(!1), de.current?.focus?.();
|
|
389
387
|
}, ge = (t) => {
|
|
390
|
-
r(e
|
|
391
|
-
},
|
|
392
|
-
r(
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
388
|
+
r([...e, t]), J(U), Z();
|
|
389
|
+
}, _e = (t) => {
|
|
390
|
+
r(e.filter((e, n) => n !== t)), J(W);
|
|
391
|
+
}, Q = () => {
|
|
392
|
+
r([]), J(se);
|
|
393
|
+
}, ve = {
|
|
394
|
+
equal: z,
|
|
395
|
+
contain: B,
|
|
396
|
+
regex: V
|
|
397
|
+
}, ye = e.length >= v, be = p || ye, xe = u != null && u !== "";
|
|
398
|
+
return /* @__PURE__ */ O("div", {
|
|
399
399
|
role: "group",
|
|
400
|
-
"aria-labelledby":
|
|
401
|
-
style:
|
|
402
|
-
className:
|
|
400
|
+
"aria-labelledby": le,
|
|
401
|
+
style: ie,
|
|
402
|
+
className: T(p && "pointer-events-none opacity-60"),
|
|
403
403
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ D("span", {
|
|
405
405
|
role: "status",
|
|
406
406
|
"aria-live": "polite",
|
|
407
407
|
className: "sr-only",
|
|
408
|
-
children:
|
|
408
|
+
children: q
|
|
409
409
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ O("div", {
|
|
411
411
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
413
|
-
id:
|
|
414
|
-
className:
|
|
415
|
-
children:
|
|
416
|
-
}), e.length > 0 && /* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ D("div", {
|
|
413
|
+
id: le,
|
|
414
|
+
className: T(S, X.heading),
|
|
415
|
+
children: j
|
|
416
|
+
}), e.length > 0 && /* @__PURE__ */ D(d, {
|
|
417
417
|
variant: o.Primary,
|
|
418
|
-
label:
|
|
419
|
-
onClick:
|
|
418
|
+
label: L,
|
|
419
|
+
onClick: Q,
|
|
420
420
|
disabled: p
|
|
421
421
|
})]
|
|
422
422
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
className:
|
|
425
|
-
children:
|
|
423
|
+
/* @__PURE__ */ D("p", {
|
|
424
|
+
className: T("mb-2", C, X.hint),
|
|
425
|
+
children: xe ? M.replace("{folder}", u) : N
|
|
426
426
|
}),
|
|
427
|
-
e.length > 0 && !
|
|
427
|
+
e.length > 0 && !xe && /* @__PURE__ */ D("div", {
|
|
428
428
|
className: "mb-2",
|
|
429
|
-
children: /* @__PURE__ */
|
|
429
|
+
children: /* @__PURE__ */ D(h, {
|
|
430
430
|
type: g.SectionMessage,
|
|
431
431
|
variant: _.Warning,
|
|
432
|
-
message:
|
|
432
|
+
message: P
|
|
433
433
|
})
|
|
434
434
|
}),
|
|
435
|
-
m && /* @__PURE__ */
|
|
436
|
-
className:
|
|
437
|
-
children: [/* @__PURE__ */
|
|
435
|
+
m && /* @__PURE__ */ O("div", {
|
|
436
|
+
className: T("mb-2 flex items-center gap-2", w, X.loading),
|
|
437
|
+
children: [/* @__PURE__ */ D(b, {
|
|
438
438
|
size: 16,
|
|
439
|
-
ariaLabel:
|
|
440
|
-
}), /* @__PURE__ */
|
|
439
|
+
ariaLabel: oe
|
|
440
|
+
}), /* @__PURE__ */ D("span", { children: oe })]
|
|
441
441
|
}),
|
|
442
|
-
|
|
442
|
+
ee && /* @__PURE__ */ D("div", {
|
|
443
443
|
className: "mb-2",
|
|
444
|
-
children: /* @__PURE__ */
|
|
444
|
+
children: /* @__PURE__ */ D(h, {
|
|
445
445
|
type: g.SectionMessage,
|
|
446
446
|
variant: _.Warning,
|
|
447
|
-
message:
|
|
447
|
+
message: H
|
|
448
448
|
})
|
|
449
449
|
}),
|
|
450
|
-
e.length > 0 && /* @__PURE__ */
|
|
450
|
+
e.length > 0 && /* @__PURE__ */ D("ul", {
|
|
451
451
|
className: "mb-3 flex flex-col gap-2",
|
|
452
452
|
children: e.map((e, t) => {
|
|
453
|
-
let n = e.targets.join(` ${
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
className:
|
|
456
|
-
children: [/* @__PURE__ */
|
|
457
|
-
className:
|
|
453
|
+
let n = e.targets.join(` ${R} `), r = ae.replace("{source}", e.source).replace("{targets}", n);
|
|
454
|
+
return /* @__PURE__ */ O("li", {
|
|
455
|
+
className: T("flex items-center justify-between gap-2 rounded-lg px-3 py-2", X.ruleRow),
|
|
456
|
+
children: [/* @__PURE__ */ O("span", {
|
|
457
|
+
className: T("truncate", E, X.ruleText),
|
|
458
458
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
className:
|
|
459
|
+
/* @__PURE__ */ D("span", {
|
|
460
|
+
className: ne,
|
|
461
461
|
children: e.source
|
|
462
462
|
}),
|
|
463
463
|
" ",
|
|
464
|
-
|
|
464
|
+
me(e.function, ve),
|
|
465
465
|
": ",
|
|
466
466
|
n
|
|
467
467
|
]
|
|
468
|
-
}), /* @__PURE__ */
|
|
469
|
-
icon: /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ D(f, {
|
|
469
|
+
icon: /* @__PURE__ */ D(re, {
|
|
470
470
|
size: c.SM,
|
|
471
471
|
"aria-hidden": !0,
|
|
472
472
|
stroke: l
|
|
473
473
|
}),
|
|
474
474
|
"aria-label": r,
|
|
475
|
-
onClick: () =>
|
|
475
|
+
onClick: () => _e(t),
|
|
476
476
|
disabled: p
|
|
477
477
|
})]
|
|
478
478
|
}, t);
|
|
479
479
|
})
|
|
480
480
|
}),
|
|
481
|
-
|
|
481
|
+
ue && /* @__PURE__ */ D(fe, {
|
|
482
482
|
sourceOptions: s,
|
|
483
|
-
onSave:
|
|
484
|
-
onCancel:
|
|
483
|
+
onSave: ge,
|
|
484
|
+
onCancel: Z,
|
|
485
485
|
disabled: p,
|
|
486
|
-
maxTargets:
|
|
487
|
-
labels:
|
|
488
|
-
styles:
|
|
486
|
+
maxTargets: y,
|
|
487
|
+
labels: ce,
|
|
488
|
+
styles: A.editor
|
|
489
489
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ D("div", {
|
|
491
491
|
className: "flex flex-wrap items-center gap-2",
|
|
492
|
-
children: /* @__PURE__ */
|
|
493
|
-
label:
|
|
494
|
-
iconBefore: /* @__PURE__ */
|
|
492
|
+
children: /* @__PURE__ */ D(d, {
|
|
493
|
+
label: I,
|
|
494
|
+
iconBefore: /* @__PURE__ */ D(k, {
|
|
495
495
|
size: c.SM,
|
|
496
496
|
"aria-hidden": !0,
|
|
497
497
|
stroke: l
|
|
498
498
|
}),
|
|
499
|
-
onClick:
|
|
500
|
-
disabled:
|
|
499
|
+
onClick: he,
|
|
500
|
+
disabled: be
|
|
501
501
|
})
|
|
502
502
|
}),
|
|
503
|
-
|
|
504
|
-
className:
|
|
505
|
-
children:
|
|
503
|
+
ye && /* @__PURE__ */ D("p", {
|
|
504
|
+
className: T("mt-2", C, X.hint),
|
|
505
|
+
children: F.replace("{max}", String(v))
|
|
506
506
|
})
|
|
507
507
|
]
|
|
508
508
|
});
|
|
509
|
-
},
|
|
509
|
+
}, Z = {
|
|
510
510
|
currentBadge: "_currentBadge_d0adf_1",
|
|
511
511
|
sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
|
|
512
512
|
version: "_version_d0adf_13",
|
|
513
513
|
date: "_date_d0adf_17",
|
|
514
514
|
emptyState: "_emptyState_d0adf_21",
|
|
515
515
|
stripedRow: "_stripedRow_d0adf_25"
|
|
516
|
-
},
|
|
517
|
-
let m =
|
|
516
|
+
}, ge = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
|
|
517
|
+
let m = te({
|
|
518
518
|
"--phl-badge-border": p?.currentBadgeBorder,
|
|
519
519
|
"--phl-badge-bg": p?.currentBadgeBackground,
|
|
520
520
|
"--phl-badge-text": p?.currentBadgeText,
|
|
@@ -525,362 +525,362 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
525
525
|
"--phl-date-text": p?.dateText,
|
|
526
526
|
"--phl-empty-text": p?.emptyStateText,
|
|
527
527
|
"--phl-striped-bg": p?.stripedBackground
|
|
528
|
-
}), h =
|
|
529
|
-
return n ? /* @__PURE__ */
|
|
528
|
+
}), h = T(f, Z.emptyState);
|
|
529
|
+
return n ? /* @__PURE__ */ D("p", {
|
|
530
530
|
style: m,
|
|
531
531
|
className: h,
|
|
532
532
|
children: c
|
|
533
|
-
}) : r ? /* @__PURE__ */
|
|
533
|
+
}) : r ? /* @__PURE__ */ D("p", {
|
|
534
534
|
style: m,
|
|
535
535
|
className: h,
|
|
536
536
|
role: "alert",
|
|
537
537
|
children: l
|
|
538
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
538
|
+
}) : e.length === 0 ? /* @__PURE__ */ D("p", {
|
|
539
539
|
style: m,
|
|
540
540
|
className: h,
|
|
541
541
|
children: s
|
|
542
|
-
}) : /* @__PURE__ */
|
|
542
|
+
}) : /* @__PURE__ */ D("ul", {
|
|
543
543
|
style: m,
|
|
544
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
545
|
-
className:
|
|
546
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: e.map((e, n) => /* @__PURE__ */ O("li", {
|
|
545
|
+
className: T("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Z.stripedRow),
|
|
546
|
+
children: [/* @__PURE__ */ O("span", {
|
|
547
547
|
className: "flex min-w-0 items-center gap-2",
|
|
548
548
|
style: m,
|
|
549
549
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
className:
|
|
550
|
+
/* @__PURE__ */ O("span", {
|
|
551
|
+
className: T(u, Z.version),
|
|
552
552
|
children: [
|
|
553
553
|
i,
|
|
554
554
|
" ",
|
|
555
555
|
e.version
|
|
556
556
|
]
|
|
557
557
|
}),
|
|
558
|
-
e.version === t && /* @__PURE__ */
|
|
558
|
+
e.version === t && /* @__PURE__ */ D(x, {
|
|
559
559
|
label: a,
|
|
560
|
-
className:
|
|
560
|
+
className: T("shrink-0 whitespace-nowrap", Z.currentBadge)
|
|
561
561
|
}),
|
|
562
|
-
e.publishCredentials === !0 && /* @__PURE__ */
|
|
562
|
+
e.publishCredentials === !0 && /* @__PURE__ */ D(x, {
|
|
563
563
|
label: o,
|
|
564
|
-
className:
|
|
564
|
+
className: T("shrink-0 whitespace-nowrap", Z.sharedCredentialsBadge)
|
|
565
565
|
})
|
|
566
566
|
]
|
|
567
|
-
}), /* @__PURE__ */
|
|
568
|
-
className:
|
|
569
|
-
children:
|
|
567
|
+
}), /* @__PURE__ */ D("span", {
|
|
568
|
+
className: T(d, Z.date),
|
|
569
|
+
children: F(e.publishedAt)
|
|
570
570
|
})]
|
|
571
571
|
}, `${e.version}-${n}`))
|
|
572
572
|
});
|
|
573
|
-
},
|
|
573
|
+
}, _e = {
|
|
574
574
|
divider: "_divider_1gs31_1",
|
|
575
575
|
tree: "_tree_1gs31_17"
|
|
576
|
-
},
|
|
577
|
-
let
|
|
578
|
-
...
|
|
576
|
+
}, Q = ({ items: e, selectedPath: t, onSelectedPathChange: n, onCreateFolder: o, searchQuery: s, disabled: u = !1, createFolderLabel: f = "Create new folder", cancelCreatingFolderLabel: p = "Cancel", addSiblingFolderLabel: m = "Add sibling", addChildFolderLabel: h = "Add child", newFolderDefaultName: g = "New folder", noResultsLabel: _ = "No folders match \"{query}\".", emptyFolderNameError: ee = "Folder name cannot be empty.", invalidFolderNameError: v = "Folder name contains invalid characters.", duplicateFolderNameError: y = "A folder with this name already exists.", rootLabel: b = "Organization", expandedPaths: x, onExpandedPathsChange: S, loadingPaths: C, styles: w = {} }) => {
|
|
577
|
+
let E = {
|
|
578
|
+
...te({ "--pft-divider": w.colors?.divider }),
|
|
579
579
|
...w.cssVars
|
|
580
|
-
}, [
|
|
580
|
+
}, [re, j] = a(() => new Set(t?.map((e, n) => U(t.slice(0, n + 1))) ?? [])), M = x ?? re, N = (e) => {
|
|
581
581
|
let t = new Set(e);
|
|
582
|
-
t.delete(""), S ? S(t) :
|
|
583
|
-
}, [
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
t.delete(""), S ? S(t) : j(t);
|
|
583
|
+
}, [P, F] = a(null), [I, L] = a(g), R = i(null), z = s.trim(), V = P != null, oe = r(() => ae(e, s), [e, s]), G = z.length > 0 && oe.length === 0, K = !V && z.length > 0, q = r(() => B(K ? oe : e), [
|
|
584
|
+
K,
|
|
585
|
+
oe,
|
|
586
586
|
e
|
|
587
|
-
]),
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
]),
|
|
587
|
+
]), J = r(() => new Set(["", ...H(q)]), [q]), de = r(() => new Set(["", ...K ? J : M]), [
|
|
588
|
+
K,
|
|
589
|
+
J,
|
|
590
|
+
M
|
|
591
|
+
]), Y = r(() => se(q), [q]), fe = r(() => K && Y.length === 0 ? [] : [{
|
|
592
592
|
path: "",
|
|
593
593
|
name: b,
|
|
594
594
|
folderId: "",
|
|
595
|
-
nodeType:
|
|
596
|
-
items:
|
|
595
|
+
nodeType: A.FOLDER,
|
|
596
|
+
items: Y
|
|
597
597
|
}], [
|
|
598
|
-
|
|
598
|
+
Y,
|
|
599
599
|
b,
|
|
600
|
-
|
|
601
|
-
]),
|
|
602
|
-
empty:
|
|
603
|
-
invalid:
|
|
604
|
-
duplicate:
|
|
605
|
-
},
|
|
606
|
-
|
|
607
|
-
let t =
|
|
608
|
-
t &&
|
|
609
|
-
},
|
|
610
|
-
let t =
|
|
600
|
+
K
|
|
601
|
+
]), X = P ? U(P) : null, pe = {
|
|
602
|
+
empty: ee,
|
|
603
|
+
invalid: v,
|
|
604
|
+
duplicate: y
|
|
605
|
+
}, me = (t) => le(G && ce(z, [], pe) == null ? z : g, ue(e, t)), he = (e) => {
|
|
606
|
+
F(e), L(me(e)), R.current = null;
|
|
607
|
+
let t = U(e);
|
|
608
|
+
t && N(new Set(M).add(t));
|
|
609
|
+
}, Z = () => he(t ?? []), ge = (e) => {
|
|
610
|
+
let t = W(e.path), n = [{
|
|
611
611
|
key: "add-child",
|
|
612
612
|
label: h,
|
|
613
|
-
icon: /* @__PURE__ */
|
|
613
|
+
icon: /* @__PURE__ */ D(ne, {
|
|
614
614
|
size: c.SM,
|
|
615
615
|
"aria-hidden": !0,
|
|
616
616
|
stroke: l
|
|
617
617
|
}),
|
|
618
|
-
onClick: () =>
|
|
618
|
+
onClick: () => he(t)
|
|
619
619
|
}];
|
|
620
620
|
return e.path !== "" && n.push({
|
|
621
621
|
key: "add-sibling",
|
|
622
622
|
label: m,
|
|
623
|
-
icon: /* @__PURE__ */
|
|
623
|
+
icon: /* @__PURE__ */ D(k, {
|
|
624
624
|
size: c.SM,
|
|
625
625
|
"aria-hidden": !0,
|
|
626
626
|
stroke: l
|
|
627
627
|
}),
|
|
628
|
-
onClick: () =>
|
|
628
|
+
onClick: () => he(t.slice(0, -1))
|
|
629
629
|
}), n;
|
|
630
|
-
},
|
|
631
|
-
if (!
|
|
632
|
-
let n =
|
|
633
|
-
return
|
|
634
|
-
},
|
|
635
|
-
if (!
|
|
636
|
-
let t = e.trim(), r =
|
|
637
|
-
(
|
|
638
|
-
},
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
style:
|
|
641
|
-
className:
|
|
630
|
+
}, Q = (t) => {
|
|
631
|
+
if (!P) return null;
|
|
632
|
+
let n = ce(t, ue(e, P), pe);
|
|
633
|
+
return R.current = n, n;
|
|
634
|
+
}, ve = (e) => {
|
|
635
|
+
if (!P) return;
|
|
636
|
+
let t = e.trim(), r = R.current;
|
|
637
|
+
(Q(e) ?? r) || (o(P, t), n([...P, t])), F(null);
|
|
638
|
+
}, ye = () => F(null);
|
|
639
|
+
return /* @__PURE__ */ O("div", {
|
|
640
|
+
style: E,
|
|
641
|
+
className: T(u && "pointer-events-none opacity-60", w.className),
|
|
642
642
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
644
|
-
className:
|
|
645
|
-
children: /* @__PURE__ */
|
|
646
|
-
items:
|
|
643
|
+
/* @__PURE__ */ D("div", {
|
|
644
|
+
className: T("w-full min-w-0 max-w-full", _e.tree),
|
|
645
|
+
children: /* @__PURE__ */ D(ie, {
|
|
646
|
+
items: fe,
|
|
647
647
|
showFiles: !1,
|
|
648
|
-
selectedPath: t == null ? void 0 :
|
|
649
|
-
expandedPaths:
|
|
650
|
-
onExpandedPathsChange:
|
|
648
|
+
selectedPath: t == null ? void 0 : U(t),
|
|
649
|
+
expandedPaths: de,
|
|
650
|
+
onExpandedPathsChange: N,
|
|
651
651
|
loadingPaths: C,
|
|
652
652
|
onItemClick: (e) => {
|
|
653
|
-
n(t != null &&
|
|
653
|
+
n(t != null && U(t) === e.path ? void 0 : W(e.path));
|
|
654
654
|
},
|
|
655
|
-
getContextMenuItems:
|
|
656
|
-
createdFolderPath:
|
|
657
|
-
newFolderDefaultName:
|
|
658
|
-
onCreateFolderSave:
|
|
659
|
-
onCreateFolderCancel:
|
|
660
|
-
onRenameValidate: (e) =>
|
|
661
|
-
emptyStateTitle:
|
|
655
|
+
getContextMenuItems: ge,
|
|
656
|
+
createdFolderPath: X,
|
|
657
|
+
newFolderDefaultName: I,
|
|
658
|
+
onCreateFolderSave: ve,
|
|
659
|
+
onCreateFolderCancel: ye,
|
|
660
|
+
onRenameValidate: (e) => Q(e),
|
|
661
|
+
emptyStateTitle: K ? _.replace("{query}", z) : void 0
|
|
662
662
|
})
|
|
663
663
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
className:
|
|
664
|
+
/* @__PURE__ */ D("div", {
|
|
665
|
+
className: T("my-2 h-px", _e.divider),
|
|
666
666
|
"aria-hidden": !0
|
|
667
667
|
}),
|
|
668
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ O("div", {
|
|
669
669
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
670
|
-
children: [/* @__PURE__ */
|
|
671
|
-
onClick:
|
|
670
|
+
children: [/* @__PURE__ */ D(d, {
|
|
671
|
+
onClick: Z,
|
|
672
672
|
label: f,
|
|
673
|
-
iconBefore: /* @__PURE__ */
|
|
673
|
+
iconBefore: /* @__PURE__ */ D(k, {
|
|
674
674
|
size: c.SM,
|
|
675
675
|
"aria-hidden": !0,
|
|
676
676
|
stroke: l
|
|
677
677
|
}),
|
|
678
|
-
disabled: u ||
|
|
679
|
-
}),
|
|
678
|
+
disabled: u || V
|
|
679
|
+
}), V && /* @__PURE__ */ D(d, {
|
|
680
680
|
label: p,
|
|
681
|
-
onClick:
|
|
681
|
+
onClick: ye,
|
|
682
682
|
disabled: u
|
|
683
683
|
})]
|
|
684
684
|
})
|
|
685
685
|
]
|
|
686
686
|
});
|
|
687
|
-
},
|
|
687
|
+
}, ve = { panel: "dial-publish-panel-panel" }, ye = {
|
|
688
688
|
summaryTitle: "_summaryTitle_tf20a_1",
|
|
689
689
|
sectionHeading: "_sectionHeading_tf20a_5"
|
|
690
|
-
},
|
|
691
|
-
let { colors:
|
|
692
|
-
...
|
|
693
|
-
"--pp-summary-title-text":
|
|
694
|
-
"--pp-heading-text":
|
|
690
|
+
}, be = 200, xe = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: m, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, allowReplace: b = !0, author: x, onAuthorChange: S, publishCredentials: w = !1, onPublishCredentialsChange: E, rules: ne, onRulesChange: k, ruleSourceOptions: re, isRulesLoading: A = !1, hasRulesLoadError: ie = !1, labels: j = {}, summaryTitleClassName: P = "dial-body-semi-text", headingClassName: F = "dial-body-semi-text", styles: I = {} }) => {
|
|
691
|
+
let { colors: L, folderTree: R, accessRules: ae } = I, z = {
|
|
692
|
+
...te({
|
|
693
|
+
"--pp-summary-title-text": L?.summaryTitleText,
|
|
694
|
+
"--pp-heading-text": L?.headingText
|
|
695
695
|
}),
|
|
696
|
-
...
|
|
697
|
-
},
|
|
698
|
-
border:
|
|
699
|
-
background:
|
|
700
|
-
versionTagBorder:
|
|
701
|
-
versionTagBackground:
|
|
702
|
-
versionTagText:
|
|
703
|
-
}, { folderLabel:
|
|
704
|
-
|
|
705
|
-
},
|
|
706
|
-
hasSelectedFolder:
|
|
707
|
-
hasExistingPublicationInFolder:
|
|
708
|
-
hasWriteAccess:
|
|
709
|
-
isSubmitting:
|
|
710
|
-
hasSubmitError:
|
|
711
|
-
allowReplace:
|
|
696
|
+
...I.cssVars
|
|
697
|
+
}, B = {
|
|
698
|
+
border: L?.summaryBorder,
|
|
699
|
+
background: L?.summaryBackground,
|
|
700
|
+
versionTagBorder: L?.summaryVersionTagBorder,
|
|
701
|
+
versionTagBackground: L?.summaryVersionTagBackground,
|
|
702
|
+
versionTagText: L?.summaryVersionTagText
|
|
703
|
+
}, { folderLabel: V = "Publish to folder", replaceWarning: oe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: H = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: U = "Publishing failed. Please try again.", folderEmptyStateLabel: W, addSiblingFolderLabel: se, addChildFolderLabel: G, cancelCreatingFolderLabel: ce, createFolderEmptyNameError: le, createFolderInvalidNameError: ue, createFolderDuplicateNameError: K, rootFolderLabel: q = "Organization", summaryVersionLabel: J, accessRulesLabels: de, searchPlaceholder: Y, clearSearchAriaLabel: fe, authorLabel: X = "Author", authorPlaceholder: pe = "Author name", authorHint: me = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Z = "Publish with my credentials", credentialsHint: ge = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = j, [_e, xe] = a(""), Ce = n(), Te = (e) => {
|
|
704
|
+
xe(e ?? "");
|
|
705
|
+
}, Ee = o != null, $ = r(() => N({
|
|
706
|
+
hasSelectedFolder: Ee,
|
|
707
|
+
hasExistingPublicationInFolder: m,
|
|
708
|
+
hasWriteAccess: _,
|
|
709
|
+
isSubmitting: v,
|
|
710
|
+
hasSubmitError: y,
|
|
711
|
+
allowReplace: b
|
|
712
712
|
}), [
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
]),
|
|
720
|
-
className:
|
|
713
|
+
Ee,
|
|
714
|
+
m,
|
|
715
|
+
_,
|
|
716
|
+
v,
|
|
717
|
+
y,
|
|
718
|
+
b
|
|
719
|
+
]), De = Ee ? o[o.length - 1] ?? q : "", Oe = t ? t() : /* @__PURE__ */ D("span", {
|
|
720
|
+
className: T("truncate", P, ye.summaryTitle),
|
|
721
721
|
children: e?.title
|
|
722
722
|
});
|
|
723
|
-
return /* @__PURE__ */
|
|
724
|
-
className:
|
|
725
|
-
style:
|
|
726
|
-
children: [e?.type == null ? /* @__PURE__ */
|
|
727
|
-
colors:
|
|
728
|
-
children:
|
|
729
|
-
}) : /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ O("div", {
|
|
724
|
+
className: T("flex flex-col gap-5", ve.panel),
|
|
725
|
+
style: z,
|
|
726
|
+
children: [e?.type == null ? /* @__PURE__ */ D(C, {
|
|
727
|
+
colors: B,
|
|
728
|
+
children: Oe
|
|
729
|
+
}) : /* @__PURE__ */ D(C, {
|
|
730
730
|
item: {
|
|
731
731
|
type: e.type,
|
|
732
732
|
name: e.title,
|
|
733
733
|
version: e.version ?? "",
|
|
734
734
|
iconUrl: e.iconUrl
|
|
735
735
|
},
|
|
736
|
-
versionLabel:
|
|
737
|
-
colors:
|
|
738
|
-
}), /* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
className:
|
|
741
|
-
children:
|
|
736
|
+
versionLabel: J,
|
|
737
|
+
colors: B
|
|
738
|
+
}), /* @__PURE__ */ O("div", { children: [
|
|
739
|
+
/* @__PURE__ */ D("div", {
|
|
740
|
+
className: T("mb-2", F, ye.sectionHeading),
|
|
741
|
+
children: V
|
|
742
742
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
743
|
+
/* @__PURE__ */ D("div", {
|
|
744
744
|
role: "search",
|
|
745
745
|
className: "mb-3",
|
|
746
|
-
children: /* @__PURE__ */
|
|
747
|
-
value:
|
|
748
|
-
onChange:
|
|
749
|
-
placeholder:
|
|
750
|
-
clearLabel:
|
|
751
|
-
"aria-label":
|
|
746
|
+
children: /* @__PURE__ */ D(ee, {
|
|
747
|
+
value: _e,
|
|
748
|
+
onChange: Te,
|
|
749
|
+
placeholder: Y,
|
|
750
|
+
clearLabel: fe,
|
|
751
|
+
"aria-label": Y
|
|
752
752
|
})
|
|
753
753
|
}),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
items:
|
|
756
|
-
selectedPath:
|
|
757
|
-
onSelectedPathChange:
|
|
758
|
-
onCreateFolder:
|
|
759
|
-
expandedPaths:
|
|
760
|
-
onExpandedPathsChange:
|
|
761
|
-
loadingPaths:
|
|
762
|
-
searchQuery:
|
|
763
|
-
disabled:
|
|
764
|
-
noResultsLabel:
|
|
765
|
-
addSiblingFolderLabel:
|
|
766
|
-
addChildFolderLabel:
|
|
767
|
-
cancelCreatingFolderLabel:
|
|
768
|
-
emptyFolderNameError:
|
|
769
|
-
invalidFolderNameError:
|
|
770
|
-
duplicateFolderNameError:
|
|
771
|
-
rootLabel:
|
|
772
|
-
styles:
|
|
754
|
+
/* @__PURE__ */ D(Q, {
|
|
755
|
+
items: i,
|
|
756
|
+
selectedPath: o,
|
|
757
|
+
onSelectedPathChange: c,
|
|
758
|
+
onCreateFolder: l,
|
|
759
|
+
expandedPaths: u,
|
|
760
|
+
onExpandedPathsChange: d,
|
|
761
|
+
loadingPaths: f,
|
|
762
|
+
searchQuery: _e,
|
|
763
|
+
disabled: v,
|
|
764
|
+
noResultsLabel: W,
|
|
765
|
+
addSiblingFolderLabel: se,
|
|
766
|
+
addChildFolderLabel: G,
|
|
767
|
+
cancelCreatingFolderLabel: ce,
|
|
768
|
+
emptyFolderNameError: le,
|
|
769
|
+
invalidFolderNameError: ue,
|
|
770
|
+
duplicateFolderNameError: K,
|
|
771
|
+
rootLabel: q,
|
|
772
|
+
styles: R
|
|
773
773
|
}),
|
|
774
|
-
|
|
774
|
+
$.calloutKind !== M.None && $.calloutKind !== M.Info && /* @__PURE__ */ D("div", {
|
|
775
775
|
className: "mt-3",
|
|
776
|
-
children: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ D(h, {
|
|
777
777
|
type: g.SectionMessage,
|
|
778
|
-
variant:
|
|
779
|
-
message:
|
|
780
|
-
replaceWarning:
|
|
781
|
-
noAccessError:
|
|
782
|
-
submitError:
|
|
783
|
-
folderName:
|
|
778
|
+
variant: Se($.calloutKind),
|
|
779
|
+
message: we($.calloutKind, {
|
|
780
|
+
replaceWarning: oe,
|
|
781
|
+
noAccessError: H,
|
|
782
|
+
submitError: U,
|
|
783
|
+
folderName: De,
|
|
784
784
|
version: e?.version
|
|
785
785
|
})
|
|
786
786
|
})
|
|
787
787
|
}),
|
|
788
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ D("div", {
|
|
789
789
|
className: "mt-4",
|
|
790
|
-
children: /* @__PURE__ */
|
|
791
|
-
id:
|
|
792
|
-
labelProps: { label:
|
|
793
|
-
placeholder:
|
|
794
|
-
caption:
|
|
795
|
-
value:
|
|
796
|
-
onChange: (e) =>
|
|
797
|
-
maxLength:
|
|
798
|
-
disabled:
|
|
790
|
+
children: /* @__PURE__ */ D(p, {
|
|
791
|
+
id: Ce,
|
|
792
|
+
labelProps: { label: X },
|
|
793
|
+
placeholder: pe,
|
|
794
|
+
caption: me,
|
|
795
|
+
value: x,
|
|
796
|
+
onChange: (e) => S(e ?? ""),
|
|
797
|
+
maxLength: be,
|
|
798
|
+
disabled: v
|
|
799
799
|
})
|
|
800
800
|
}),
|
|
801
|
-
|
|
801
|
+
E != null && /* @__PURE__ */ D("div", {
|
|
802
802
|
className: "mt-4",
|
|
803
|
-
children: /* @__PURE__ */
|
|
804
|
-
labelProps: { label:
|
|
805
|
-
caption:
|
|
806
|
-
isSelected:
|
|
807
|
-
onChange:
|
|
808
|
-
disabled:
|
|
803
|
+
children: /* @__PURE__ */ D(s, {
|
|
804
|
+
labelProps: { label: Z },
|
|
805
|
+
caption: ge,
|
|
806
|
+
isSelected: w,
|
|
807
|
+
onChange: E,
|
|
808
|
+
disabled: v
|
|
809
809
|
})
|
|
810
810
|
}),
|
|
811
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ D("div", {
|
|
812
812
|
className: "mt-4",
|
|
813
|
-
children: /* @__PURE__ */
|
|
814
|
-
rules:
|
|
815
|
-
onRulesChange:
|
|
816
|
-
sourceOptions:
|
|
817
|
-
folderName:
|
|
818
|
-
disabled:
|
|
819
|
-
isLoading:
|
|
820
|
-
hasLoadError:
|
|
821
|
-
labels:
|
|
822
|
-
styles:
|
|
813
|
+
children: /* @__PURE__ */ D(he, {
|
|
814
|
+
rules: ne,
|
|
815
|
+
onRulesChange: k,
|
|
816
|
+
sourceOptions: re,
|
|
817
|
+
folderName: Ee ? De : void 0,
|
|
818
|
+
disabled: v,
|
|
819
|
+
isLoading: A,
|
|
820
|
+
hasLoadError: ie,
|
|
821
|
+
labels: de,
|
|
822
|
+
styles: ae
|
|
823
823
|
})
|
|
824
824
|
})
|
|
825
825
|
] })]
|
|
826
826
|
});
|
|
827
|
-
},
|
|
827
|
+
}, Se = (e) => e === M.ReplaceWarning ? _.Warning : _.Error, Ce = (e, t) => {
|
|
828
828
|
let [n, r, ...i] = e.split("{folder}");
|
|
829
|
-
return r === void 0 || i.length > 0 ? e : /* @__PURE__ */
|
|
829
|
+
return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ O(E, { children: [
|
|
830
830
|
n,
|
|
831
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ D("strong", {
|
|
832
832
|
className: "font-semibold",
|
|
833
833
|
children: t
|
|
834
834
|
}),
|
|
835
835
|
r
|
|
836
836
|
] });
|
|
837
|
-
},
|
|
838
|
-
let l =
|
|
839
|
-
return /* @__PURE__ */
|
|
837
|
+
}, we = (e, t) => e === M.ReplaceWarning ? Ce(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName) : e === M.NoAccess ? Ce(t.noAccessError, t.folderName) : t.submitError, Te = { footer: "_footer_dks1v_1" }, Ee = ({ version: e, hasExistingPublicationInFolder: t, isSubmitDisabled: n, isSubmitLoading: r, onCancel: i, onSubmit: a, labels: o = {}, colors: s }) => {
|
|
838
|
+
let l = te({ "--pf-border": s?.border }), { cancelLabel: u = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = o, g = r ? h : t && e != null ? p.replace("{version}", e) : f;
|
|
839
|
+
return /* @__PURE__ */ O("div", {
|
|
840
840
|
style: l,
|
|
841
|
-
className:
|
|
842
|
-
children: [/* @__PURE__ */
|
|
841
|
+
className: T("flex items-center justify-end gap-2 border-t px-3.5 py-4 rtl:flex-row-reverse rtl:justify-start", Te.footer),
|
|
842
|
+
children: [/* @__PURE__ */ D(d, {
|
|
843
843
|
label: u,
|
|
844
844
|
disabled: r,
|
|
845
845
|
onClick: i
|
|
846
|
-
}), /* @__PURE__ */
|
|
846
|
+
}), /* @__PURE__ */ D(m, {
|
|
847
847
|
label: g,
|
|
848
848
|
disabled: n,
|
|
849
|
-
iconBefore: r ? /* @__PURE__ */
|
|
849
|
+
iconBefore: r ? /* @__PURE__ */ D(b, { size: c.SM }) : void 0,
|
|
850
850
|
onClick: a
|
|
851
851
|
})]
|
|
852
852
|
});
|
|
853
|
-
},
|
|
853
|
+
}, $ = {
|
|
854
854
|
backdrop: "_backdrop_16jmd_6",
|
|
855
855
|
panel: "_panel_16jmd_10",
|
|
856
856
|
divider: "_divider_16jmd_15",
|
|
857
857
|
content: "_content_16jmd_19",
|
|
858
858
|
title: "_title_16jmd_24"
|
|
859
|
-
}, De = ({ isOpen: e, resource: n, renderSummary: i,
|
|
860
|
-
let
|
|
861
|
-
"--spp-backdrop-bg":
|
|
862
|
-
"--spp-panel-bg":
|
|
863
|
-
"--spp-panel-border":
|
|
864
|
-
"--spp-divider-border":
|
|
865
|
-
"--spp-scrollbar-thumb":
|
|
866
|
-
"--spp-title-text":
|
|
867
|
-
}), [
|
|
868
|
-
hasSelectedFolder:
|
|
869
|
-
hasExistingPublicationInFolder:
|
|
870
|
-
hasWriteAccess:
|
|
871
|
-
isSubmitting:
|
|
872
|
-
hasSubmitError:
|
|
873
|
-
allowReplace:
|
|
859
|
+
}, De = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: b, onRulesChange: x, ruleSourceOptions: S, isRulesLoading: C = !1, hasRulesLoadError: w = !1, onClose: E, returnFocusRef: ne, onSubmit: k, panelLabels: re, panelStyles: A, footerLabels: ie, labels: j = {}, titleClassName: M = "dial-body-semi-text", colors: P }) => {
|
|
860
|
+
let F = te({
|
|
861
|
+
"--spp-backdrop-bg": P?.backdropBackground,
|
|
862
|
+
"--spp-panel-bg": P?.panelBackground,
|
|
863
|
+
"--spp-panel-border": P?.panelBorder,
|
|
864
|
+
"--spp-divider-border": P?.dividerBorder,
|
|
865
|
+
"--spp-scrollbar-thumb": P?.scrollbarThumb,
|
|
866
|
+
"--spp-title-text": P?.titleText
|
|
867
|
+
}), [I, L] = a(null), { title: R = "Publish", ariaLabel: ae = "Publish", closeAriaLabel: z = "Close" } = j, B = r(() => N({
|
|
868
|
+
hasSelectedFolder: s != null,
|
|
869
|
+
hasExistingPublicationInFolder: p,
|
|
870
|
+
hasWriteAccess: m,
|
|
871
|
+
isSubmitting: h,
|
|
872
|
+
hasSubmitError: g,
|
|
873
|
+
allowReplace: _
|
|
874
874
|
}), [
|
|
875
|
-
|
|
875
|
+
s,
|
|
876
|
+
p,
|
|
877
|
+
m,
|
|
878
|
+
h,
|
|
876
879
|
g,
|
|
877
|
-
_
|
|
878
|
-
v,
|
|
879
|
-
y,
|
|
880
|
-
b
|
|
880
|
+
_
|
|
881
881
|
]);
|
|
882
882
|
return t(() => {
|
|
883
|
-
let t =
|
|
883
|
+
let t = I?.closest("[role=\"dialog\"]");
|
|
884
884
|
if (!e || !t) return;
|
|
885
885
|
let n = () => t.focus({ preventScroll: !0 });
|
|
886
886
|
n();
|
|
@@ -890,74 +890,71 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
890
890
|
document.addEventListener("focusin", r);
|
|
891
891
|
let i = requestAnimationFrame(() => {
|
|
892
892
|
document.removeEventListener("focusin", r);
|
|
893
|
-
}), a =
|
|
893
|
+
}), a = ne?.current;
|
|
894
894
|
return () => {
|
|
895
895
|
cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
|
|
896
896
|
};
|
|
897
897
|
}, [
|
|
898
898
|
e,
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
]), /* @__PURE__ */
|
|
899
|
+
I,
|
|
900
|
+
ne
|
|
901
|
+
]), /* @__PURE__ */ O(y, {
|
|
902
902
|
open: e,
|
|
903
|
-
onClose:
|
|
904
|
-
header: /* @__PURE__ */
|
|
905
|
-
className:
|
|
906
|
-
children:
|
|
903
|
+
onClose: E,
|
|
904
|
+
header: /* @__PURE__ */ D("span", {
|
|
905
|
+
className: T("block truncate text-center", M, $.title),
|
|
906
|
+
children: R
|
|
907
907
|
}),
|
|
908
|
-
ariaLabel:
|
|
909
|
-
closeAriaLabel:
|
|
910
|
-
closeDisabled:
|
|
911
|
-
style:
|
|
912
|
-
overlayStyle:
|
|
913
|
-
className:
|
|
914
|
-
overlayClassName:
|
|
915
|
-
headerClassName:
|
|
908
|
+
ariaLabel: ae,
|
|
909
|
+
closeAriaLabel: z,
|
|
910
|
+
closeDisabled: h,
|
|
911
|
+
style: F,
|
|
912
|
+
overlayStyle: F,
|
|
913
|
+
className: $.panel,
|
|
914
|
+
overlayClassName: $.backdrop,
|
|
915
|
+
headerClassName: T("px-[22px]", $.divider),
|
|
916
916
|
bodyClassName: "flex flex-col overflow-hidden",
|
|
917
|
-
children: [/* @__PURE__ */
|
|
918
|
-
ref:
|
|
919
|
-
className:
|
|
920
|
-
children: /* @__PURE__ */
|
|
917
|
+
children: [/* @__PURE__ */ D("div", {
|
|
918
|
+
ref: L,
|
|
919
|
+
className: T("min-h-0 flex-1 overflow-y-auto", $.content),
|
|
920
|
+
children: /* @__PURE__ */ D("div", {
|
|
921
921
|
className: "p-[22px]",
|
|
922
|
-
children: /* @__PURE__ */
|
|
922
|
+
children: /* @__PURE__ */ D(xe, {
|
|
923
923
|
resource: n,
|
|
924
924
|
renderSummary: i,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
hasRulesLoadError: A,
|
|
947
|
-
labels: N,
|
|
948
|
-
styles: P
|
|
925
|
+
folderItems: o,
|
|
926
|
+
selectedFolderPath: s,
|
|
927
|
+
onSelectedFolderPathChange: c,
|
|
928
|
+
onCreateFolder: l,
|
|
929
|
+
expandedPaths: u,
|
|
930
|
+
onExpandedPathsChange: d,
|
|
931
|
+
loadingPaths: f,
|
|
932
|
+
hasExistingPublicationInFolder: p,
|
|
933
|
+
hasWriteAccess: m,
|
|
934
|
+
isSubmitting: h,
|
|
935
|
+
hasSubmitError: g,
|
|
936
|
+
allowReplace: _,
|
|
937
|
+
author: ee,
|
|
938
|
+
onAuthorChange: v,
|
|
939
|
+
rules: b,
|
|
940
|
+
onRulesChange: x,
|
|
941
|
+
ruleSourceOptions: S,
|
|
942
|
+
isRulesLoading: C,
|
|
943
|
+
hasRulesLoadError: w,
|
|
944
|
+
labels: re,
|
|
945
|
+
styles: A
|
|
949
946
|
})
|
|
950
947
|
})
|
|
951
|
-
}), /* @__PURE__ */
|
|
948
|
+
}), /* @__PURE__ */ D(Ee, {
|
|
952
949
|
version: n?.version,
|
|
953
|
-
hasExistingPublicationInFolder:
|
|
954
|
-
isSubmitDisabled:
|
|
955
|
-
isSubmitLoading:
|
|
956
|
-
onCancel:
|
|
957
|
-
onSubmit:
|
|
958
|
-
labels:
|
|
950
|
+
hasExistingPublicationInFolder: p,
|
|
951
|
+
isSubmitDisabled: B.isSubmitDisabled,
|
|
952
|
+
isSubmitLoading: B.isSubmitLoading,
|
|
953
|
+
onCancel: E,
|
|
954
|
+
onSubmit: k,
|
|
955
|
+
labels: ie
|
|
959
956
|
})]
|
|
960
957
|
});
|
|
961
958
|
};
|
|
962
959
|
//#endregion
|
|
963
|
-
export {
|
|
960
|
+
export { ve as PUBLISH_PANEL_CLASS, j as PublicationRuleFunction, fe as PublishAccessRuleEditor, he as PublishAccessRules, M as PublishCalloutKind, Q as PublishFoldersTree, Ee as PublishFooter, ge as PublishHistoryList, xe as PublishPanel, De as StandalonePublishPanel, H as collectFolderKeys, N as derivePublishState, ae as filterFolderTree, F as formatPublishedDate, W as fromFolderPathKey, ue as getSiblingFolderNames, le as getUniqueFolderName, oe as mergeFolderPaths, B as sortFolderTree, se as toDialFileTree, U as toFolderPathKey, R as usePublishFlow, ce as validateFolderName };
|