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