@epam/ai-dial-publish-panel 1.3.0-dev.364 → 1.3.0-dev.371
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/UnpublishConfirmationDialog/UnpublishConfirmationDialog.d.ts +10 -0
- package/components/UnpublishConfirmationDialog/UnpublishConfirmationDialog.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +588 -555
- package/models/unpublish-confirmation-dialog.d.ts +50 -0
- package/models/unpublish-confirmation-dialog.d.ts.map +1 -0
- package/package.json +2 -2
- package/utils/publish-folder-tree.d.ts +2 -0
- package/utils/publish-folder-tree.d.ts.map +1 -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 { BottomSheet as o, ButtonVariant as s, Checkbox as c,
|
|
3
|
-
import { ResourceSummary as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { IconFolder as
|
|
6
|
-
import { DialFileNodeType as
|
|
2
|
+
import { BottomSheet as o, ButtonVariant as s, Checkbox as c, ConfirmationPopupVariant as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, DialFileNodeType as f, ElementSize as p, ErrorText as m, FolderName as h, GhostButton as g, GhostIconButton as _, Highlight as v, Input as ee, LinkButton as y, LiveRegion as b, LiveRegionElement as x, LiveRegionPoliteness as S, NeutralButton as C, Notification as w, NotificationType as T, NotificationVariant as E, PrimaryButton as D, RadioGroup as O, Search as k, Select as A, SideDrawer as j, Spinner as M, Tag as te, TagInput as N } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { ConfirmationDialog as P, ResourceSummary as F, TAG_INPUT_TAG_CLASS_NAME as I, buildCssVars as ne, mergeClasses as L, useIsMobile as R } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
5
|
+
import { IconFolder as re, IconFolderPlus as ie, IconPlus as ae, IconTrashX as oe } from "@tabler/icons-react";
|
|
6
|
+
import { DialFileNodeType as se, DialFoldersTree as H } from "@epam/ai-dial-react-file-manager";
|
|
7
7
|
//#region src/models/publish.ts
|
|
8
|
-
var
|
|
8
|
+
var U = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
|
|
10
|
-
}({}),
|
|
10
|
+
}({}), W = /* @__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
|
+
}({}), G = (e) => e.isSubmitting ? {
|
|
13
|
+
calloutKind: W.None,
|
|
14
14
|
isSubmitDisabled: !0,
|
|
15
15
|
isSubmitLoading: !0
|
|
16
16
|
} : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
|
|
17
|
-
calloutKind:
|
|
17
|
+
calloutKind: W.SubmitError,
|
|
18
18
|
isSubmitDisabled: !1,
|
|
19
19
|
isSubmitLoading: !1
|
|
20
20
|
} : e.hasExistingPublicationInFolder ? {
|
|
21
|
-
calloutKind:
|
|
21
|
+
calloutKind: W.ReplaceWarning,
|
|
22
22
|
isSubmitDisabled: e.allowReplace === !1,
|
|
23
23
|
isSubmitLoading: !1
|
|
24
24
|
} : {
|
|
25
|
-
calloutKind:
|
|
25
|
+
calloutKind: W.Info,
|
|
26
26
|
isSubmitDisabled: !1,
|
|
27
27
|
isSubmitLoading: !1
|
|
28
28
|
} : {
|
|
29
|
-
calloutKind:
|
|
29
|
+
calloutKind: W.NoAccess,
|
|
30
30
|
isSubmitDisabled: !0,
|
|
31
31
|
isSubmitLoading: !1
|
|
32
32
|
} : {
|
|
33
|
-
calloutKind:
|
|
33
|
+
calloutKind: W.None,
|
|
34
34
|
isSubmitDisabled: !0,
|
|
35
35
|
isSubmitLoading: !1
|
|
36
|
-
},
|
|
37
|
-
let r = Math.floor((t - e) /
|
|
36
|
+
}, ce = 864e5, K = (e, t = Date.now(), n) => {
|
|
37
|
+
let r = Math.floor((t - e) / ce);
|
|
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
|
+
}, le = (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,22 +51,22 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
51
51
|
}]
|
|
52
52
|
} : {
|
|
53
53
|
...e,
|
|
54
|
-
children: e.children ?
|
|
55
|
-
}),
|
|
54
|
+
children: e.children ? le(e.children, t, n) : e.children
|
|
55
|
+
}), q = (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 ? q(e.children, t, n) : e.children
|
|
63
63
|
});
|
|
64
|
-
},
|
|
64
|
+
}, ue = ({ 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(), [v, ee] = a(!1), [y, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, A] = a(!1), [j, M] = a(!1);
|
|
70
70
|
t(() => {
|
|
71
71
|
j || O(c);
|
|
72
72
|
}, [c, j]);
|
|
@@ -99,21 +99,21 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
99
99
|
n.version,
|
|
100
100
|
g
|
|
101
101
|
]), P = e(async (e, t) => {
|
|
102
|
-
h((n) =>
|
|
102
|
+
h((n) => le(n, e, t));
|
|
103
103
|
try {
|
|
104
104
|
await l?.(e, t);
|
|
105
105
|
} catch {
|
|
106
|
-
h((n) =>
|
|
106
|
+
h((n) => q(n, e, t)), b(!0);
|
|
107
107
|
}
|
|
108
|
-
}, [l]),
|
|
108
|
+
}, [l]), F = e(async () => {
|
|
109
109
|
if (!g) return !1;
|
|
110
|
-
|
|
110
|
+
ee(!0), b(!1);
|
|
111
111
|
try {
|
|
112
112
|
return await u(n, g, x, D.trim(), k), d?.(n, g), !0;
|
|
113
113
|
} catch (e) {
|
|
114
114
|
return b(!0), f?.(n, g, e), !1;
|
|
115
115
|
} finally {
|
|
116
|
-
|
|
116
|
+
ee(!1);
|
|
117
117
|
}
|
|
118
118
|
}, [
|
|
119
119
|
D,
|
|
@@ -124,7 +124,7 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
124
124
|
k,
|
|
125
125
|
x,
|
|
126
126
|
g
|
|
127
|
-
]),
|
|
127
|
+
]), I = e(() => {
|
|
128
128
|
h(o), _(void 0), b(!1), S([]), E(!1), O(c), M(!1), A(!1);
|
|
129
129
|
}, [c, o]);
|
|
130
130
|
return {
|
|
@@ -134,10 +134,10 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
134
134
|
handleCreateFolder: P,
|
|
135
135
|
hasExistingPublicationInFolder: N,
|
|
136
136
|
hasWriteAccess: !g || s(g),
|
|
137
|
-
isSubmitting:
|
|
137
|
+
isSubmitting: v,
|
|
138
138
|
hasSubmitError: y,
|
|
139
|
-
handleSubmit:
|
|
140
|
-
reset:
|
|
139
|
+
handleSubmit: F,
|
|
140
|
+
reset: I,
|
|
141
141
|
rules: x,
|
|
142
142
|
setRules: S,
|
|
143
143
|
author: D,
|
|
@@ -147,94 +147,94 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
147
147
|
isRulesLoading: C,
|
|
148
148
|
hasRulesLoadError: T
|
|
149
149
|
};
|
|
150
|
-
},
|
|
150
|
+
}, J = /* @__PURE__ */ function(e) {
|
|
151
151
|
return e.Main = "main", e.ChangeFolder = "change-folder", e;
|
|
152
|
-
}({}),
|
|
153
|
-
let [i, o] = a(
|
|
152
|
+
}({}), de = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
|
|
153
|
+
let [i, o] = a(J.Main), [s, c] = a();
|
|
154
154
|
return t(() => {
|
|
155
|
-
e && o(
|
|
155
|
+
e && o(J.Main);
|
|
156
156
|
}, [e]), {
|
|
157
157
|
view: i,
|
|
158
158
|
pendingFolderPath: s,
|
|
159
159
|
setPendingFolderPath: c,
|
|
160
160
|
openFolderView: () => {
|
|
161
|
-
c(n), o(
|
|
161
|
+
c(n), o(J.ChangeFolder);
|
|
162
162
|
},
|
|
163
|
-
backToMain: () => o(
|
|
163
|
+
backToMain: () => o(J.Main),
|
|
164
164
|
selectFolder: () => {
|
|
165
|
-
s != null && r(s), o(
|
|
165
|
+
s != null && r(s), o(J.Main);
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
},
|
|
168
|
+
}, Y = (e, t) => {
|
|
169
169
|
let n = t.trim().toLowerCase();
|
|
170
170
|
return n ? e.reduce((e, r) => {
|
|
171
|
-
let i = r.children ?
|
|
171
|
+
let i = r.children ? Y(r.children, t) : void 0;
|
|
172
172
|
return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
|
|
173
173
|
...r,
|
|
174
174
|
children: i
|
|
175
175
|
}), e;
|
|
176
176
|
}, []) : e;
|
|
177
|
-
},
|
|
177
|
+
}, X = (e, t) => e.localeCompare(t, void 0, {
|
|
178
178
|
sensitivity: "base",
|
|
179
179
|
numeric: !0
|
|
180
|
-
}),
|
|
180
|
+
}), fe = (e) => [...e].sort((e, t) => X(e.name, t.name)).map((e) => e.children ? {
|
|
181
181
|
...e,
|
|
182
|
-
children:
|
|
183
|
-
} : e),
|
|
182
|
+
children: fe(e.children)
|
|
183
|
+
} : e), Z = (e, t, n) => {
|
|
184
184
|
let [r, ...i] = t;
|
|
185
185
|
if (r == null) return e;
|
|
186
186
|
let a = [...n, r], o = e.find((e) => e.name === r);
|
|
187
187
|
return o ? i.length ? e.map((e) => e === o ? {
|
|
188
188
|
...e,
|
|
189
|
-
children:
|
|
189
|
+
children: Z(e.children ?? [], i, a)
|
|
190
190
|
} : e) : e : [...e, {
|
|
191
191
|
path: a,
|
|
192
192
|
name: r,
|
|
193
|
-
children: i.length ?
|
|
193
|
+
children: i.length ? Z([], i, a) : void 0
|
|
194
194
|
}];
|
|
195
|
-
},
|
|
196
|
-
let t =
|
|
195
|
+
}, Q = (e, t) => t.reduce((e, t) => t.length ? Z(e, t, []) : e, e), pe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? pe(e.children) : []]), $ = (e) => e.join("/"), me = (e) => e.split("/").filter(Boolean), he = (e, t) => me(e).at(-1) ?? t, ge = (e) => e.map((e) => {
|
|
196
|
+
let t = $(e.path);
|
|
197
197
|
return {
|
|
198
198
|
path: t,
|
|
199
199
|
name: e.name,
|
|
200
200
|
folderId: t,
|
|
201
|
-
nodeType:
|
|
202
|
-
items: e.children ?
|
|
201
|
+
nodeType: f.FOLDER,
|
|
202
|
+
items: e.children ? ge(e.children) : void 0
|
|
203
203
|
};
|
|
204
|
-
}),
|
|
204
|
+
}), _e = /[/\\:;,={}&"]/, ve = (e, t, n) => {
|
|
205
205
|
let r = e.trim();
|
|
206
|
-
return r ? r.includes("..") ||
|
|
207
|
-
},
|
|
206
|
+
return r ? r.includes("..") || _e.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
|
|
207
|
+
}, ye = (e, t) => {
|
|
208
208
|
let n = new Set(t.map((e) => e.toLowerCase()));
|
|
209
209
|
if (!n.has(e.toLowerCase())) return e;
|
|
210
210
|
let r = 2;
|
|
211
211
|
for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
|
|
212
212
|
return `${e} ${r}`;
|
|
213
|
-
},
|
|
213
|
+
}, be = (e, t) => {
|
|
214
214
|
if (t.length === 0) return e.map((e) => e.name);
|
|
215
|
-
let n =
|
|
215
|
+
let n = $(t), r = (e) => {
|
|
216
216
|
for (let t of e) {
|
|
217
|
-
if (
|
|
217
|
+
if ($(t.path) === n) return t;
|
|
218
218
|
let e = t.children ? r(t.children) : void 0;
|
|
219
219
|
if (e) return e;
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
return (r(e)?.children ?? []).map((e) => e.name);
|
|
223
|
-
},
|
|
223
|
+
}, xe = {
|
|
224
224
|
sheet: "_sheet_1jbwn_3",
|
|
225
225
|
inline: "_inline_1jbwn_7",
|
|
226
226
|
selectField: "_selectField_1jbwn_21",
|
|
227
227
|
selectFieldOpen: "_selectFieldOpen_1jbwn_33"
|
|
228
|
-
},
|
|
228
|
+
}, Se = 20, Ce = 200, we = 8, Te = (e) => {
|
|
229
229
|
let t = e.trim();
|
|
230
|
-
if (t.length === 0 || t.length >
|
|
230
|
+
if (t.length === 0 || t.length > Ce) return !1;
|
|
231
231
|
try {
|
|
232
232
|
return new RegExp(t) instanceof RegExp;
|
|
233
233
|
} catch {
|
|
234
234
|
return !1;
|
|
235
235
|
}
|
|
236
|
-
},
|
|
237
|
-
let p =
|
|
236
|
+
}, Ee = ({ sourceOptions: e, onSave: s, onCancel: c, disabled: l = !1, maxTargets: u = Se, labels: d = {}, styles: f = {} }) => {
|
|
237
|
+
let p = R(), m = {
|
|
238
238
|
...ne({
|
|
239
239
|
"--pare-mobile-bg": f.colors?.mobileBackground,
|
|
240
240
|
"--pare-bg": f.colors?.background,
|
|
@@ -244,40 +244,40 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
244
244
|
"--pare-select-border-focus": f.colors?.selectBorderFocus
|
|
245
245
|
}),
|
|
246
246
|
...f.cssVars
|
|
247
|
-
}, { sourceLabel:
|
|
247
|
+
}, { sourceLabel: h = "Source", sourcePlaceholder: _ = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: S = "Regex", targetsLabel: w = "Targets", targetsPlaceholder: T = "Add a target", targetsHintLabel: E = "Press Enter or comma to add a target.", patternLabel: D = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: k = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: te = "Save", cancelLabel: P = "Cancel", dialogAriaLabel: F = "Add access rule" } = d, re = n(), ie = n(), ae = n(), oe = n(), se = i(null);
|
|
248
248
|
t(() => {
|
|
249
|
-
p ||
|
|
249
|
+
p || se.current?.focus();
|
|
250
250
|
}, [p]);
|
|
251
|
-
let [
|
|
251
|
+
let [H, W] = a(), [G, ce] = a(), [K, le] = a([]), [q, ue] = a(""), [J, de] = a(!1), [Y, X] = a(""), [fe, Z] = a(!1), [Q, pe] = a(!1), $ = L(xe.selectField, J && xe.selectFieldOpen), me = L(xe.selectField, fe && xe.selectFieldOpen), he = r(() => e.map((e) => ({
|
|
252
252
|
value: e,
|
|
253
253
|
label: e,
|
|
254
|
-
labelNode: Y.trim() ? /* @__PURE__ */
|
|
254
|
+
labelNode: Y.trim() ? /* @__PURE__ */ B(v, {
|
|
255
255
|
text: e,
|
|
256
256
|
query: Y,
|
|
257
257
|
maxLines: 1
|
|
258
258
|
}) : void 0
|
|
259
|
-
})), [e, Y]),
|
|
259
|
+
})), [e, Y]), ge = r(() => [
|
|
260
260
|
{
|
|
261
|
-
value:
|
|
261
|
+
value: U.Equal,
|
|
262
262
|
label: b
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
|
-
value:
|
|
265
|
+
value: U.Contain,
|
|
266
266
|
label: x
|
|
267
267
|
},
|
|
268
268
|
{
|
|
269
|
-
value:
|
|
270
|
-
label:
|
|
269
|
+
value: U.Regex,
|
|
270
|
+
label: S
|
|
271
271
|
}
|
|
272
272
|
], [
|
|
273
273
|
b,
|
|
274
274
|
x,
|
|
275
|
-
|
|
276
|
-
]),
|
|
275
|
+
S
|
|
276
|
+
]), _e = G === U.Regex, ve = Te(q), ye = H != null && G != null && (_e ? ve : K.length > 0), be = (e) => {
|
|
277
277
|
W(Array.isArray(e) ? e[0] : e), de(!1);
|
|
278
|
-
},
|
|
278
|
+
}, Ce = (e) => {
|
|
279
279
|
let t = Array.isArray(e) ? e[0] : e;
|
|
280
|
-
G ===
|
|
280
|
+
G === U.Regex != (t === U.Regex) && (le([]), ue("")), ce(t), Z(!1);
|
|
281
281
|
}, Ee = (e) => {
|
|
282
282
|
let t = [];
|
|
283
283
|
for (let n of e) {
|
|
@@ -286,103 +286,103 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
286
286
|
}
|
|
287
287
|
le(t);
|
|
288
288
|
}, De = () => {
|
|
289
|
-
!
|
|
290
|
-
source:
|
|
289
|
+
!ye || H == null || G == null ? pe(!0) : s({
|
|
290
|
+
source: H,
|
|
291
291
|
function: G,
|
|
292
|
-
targets:
|
|
292
|
+
targets: _e ? [q.trim()] : K
|
|
293
293
|
});
|
|
294
|
-
}, Oe = (q.length > 0 ||
|
|
294
|
+
}, Oe = (q.length > 0 || Q) && !ve, ke = (e) => {
|
|
295
295
|
e.key === "Escape" && (e.stopPropagation(), c());
|
|
296
|
-
}, Ae = /* @__PURE__ */ z
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
id:
|
|
299
|
-
labelProps: { label:
|
|
300
|
-
options:
|
|
301
|
-
value:
|
|
302
|
-
onChange:
|
|
303
|
-
placeholder:
|
|
304
|
-
searchable: e.length >
|
|
305
|
-
searchPlaceholder:
|
|
306
|
-
onSearchQueryChange:
|
|
296
|
+
}, Ae = /* @__PURE__ */ V(z, { children: [
|
|
297
|
+
/* @__PURE__ */ B(A, {
|
|
298
|
+
id: ie,
|
|
299
|
+
labelProps: { label: h },
|
|
300
|
+
options: he,
|
|
301
|
+
value: H,
|
|
302
|
+
onChange: be,
|
|
303
|
+
placeholder: _,
|
|
304
|
+
searchable: e.length > we,
|
|
305
|
+
searchPlaceholder: _,
|
|
306
|
+
onSearchQueryChange: X,
|
|
307
307
|
disabled: l,
|
|
308
308
|
open: J,
|
|
309
309
|
onOpenChange: de,
|
|
310
|
-
fieldClassName:
|
|
311
|
-
invalid:
|
|
312
|
-
error:
|
|
310
|
+
fieldClassName: $,
|
|
311
|
+
invalid: Q && H == null,
|
|
312
|
+
error: Q && H == null ? j : void 0
|
|
313
313
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ B(A, {
|
|
315
315
|
labelProps: { label: y },
|
|
316
|
-
id:
|
|
317
|
-
options:
|
|
316
|
+
id: ae,
|
|
317
|
+
options: ge,
|
|
318
318
|
value: G,
|
|
319
|
-
onChange:
|
|
319
|
+
onChange: Ce,
|
|
320
320
|
placeholder: y,
|
|
321
321
|
disabled: l,
|
|
322
|
-
open:
|
|
323
|
-
onOpenChange:
|
|
324
|
-
fieldClassName:
|
|
325
|
-
invalid:
|
|
326
|
-
error:
|
|
322
|
+
open: fe,
|
|
323
|
+
onOpenChange: Z,
|
|
324
|
+
fieldClassName: me,
|
|
325
|
+
invalid: Q && G == null,
|
|
326
|
+
error: Q && G == null ? j : void 0
|
|
327
327
|
}),
|
|
328
|
-
|
|
329
|
-
id:
|
|
328
|
+
_e ? /* @__PURE__ */ B(ee, {
|
|
329
|
+
id: re,
|
|
330
330
|
labelProps: { label: D },
|
|
331
331
|
placeholder: O,
|
|
332
332
|
value: q,
|
|
333
333
|
onChange: (e) => ue(e ?? ""),
|
|
334
|
-
error: Oe ?
|
|
334
|
+
error: Oe ? k : void 0,
|
|
335
335
|
disabled: l
|
|
336
|
-
}) : /* @__PURE__ */
|
|
337
|
-
id:
|
|
336
|
+
}) : /* @__PURE__ */ B(N, {
|
|
337
|
+
id: oe,
|
|
338
338
|
labelProps: { label: w },
|
|
339
339
|
placeholder: T,
|
|
340
|
-
caption:
|
|
341
|
-
error:
|
|
342
|
-
invalid:
|
|
340
|
+
caption: Q && K.length === 0 ? void 0 : E,
|
|
341
|
+
error: Q && K.length === 0 ? M : void 0,
|
|
342
|
+
invalid: Q && K.length === 0,
|
|
343
343
|
value: K,
|
|
344
344
|
onChange: Ee,
|
|
345
345
|
disabled: l,
|
|
346
|
-
tagClassName:
|
|
346
|
+
tagClassName: I
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ V("div", {
|
|
349
349
|
className: "mt-auto flex justify-end gap-2 desktop:mt-2",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
351
|
-
label:
|
|
350
|
+
children: [/* @__PURE__ */ B(g, {
|
|
351
|
+
label: P,
|
|
352
352
|
onClick: c,
|
|
353
353
|
disabled: l
|
|
354
|
-
}), /* @__PURE__ */
|
|
355
|
-
label:
|
|
354
|
+
}), /* @__PURE__ */ B(C, {
|
|
355
|
+
label: te,
|
|
356
356
|
onClick: De,
|
|
357
357
|
disabled: l
|
|
358
358
|
})]
|
|
359
359
|
})
|
|
360
360
|
] });
|
|
361
|
-
return p ? /* @__PURE__ */
|
|
361
|
+
return p ? /* @__PURE__ */ B(o, {
|
|
362
362
|
open: !0,
|
|
363
363
|
onClose: c,
|
|
364
|
-
ariaLabel:
|
|
364
|
+
ariaLabel: F,
|
|
365
365
|
style: m,
|
|
366
|
-
className:
|
|
366
|
+
className: xe.sheet,
|
|
367
367
|
bodyClassName: "flex flex-col gap-3 p-4",
|
|
368
368
|
children: Ae
|
|
369
|
-
}) : /* @__PURE__ */
|
|
370
|
-
ref:
|
|
369
|
+
}) : /* @__PURE__ */ B("div", {
|
|
370
|
+
ref: se,
|
|
371
371
|
role: "group",
|
|
372
|
-
"aria-label":
|
|
372
|
+
"aria-label": F,
|
|
373
373
|
tabIndex: -1,
|
|
374
374
|
onKeyDown: ke,
|
|
375
375
|
style: m,
|
|
376
|
-
className:
|
|
376
|
+
className: L("flex flex-none flex-col gap-3 rounded-lg p-3", xe.inline),
|
|
377
377
|
children: Ae
|
|
378
378
|
});
|
|
379
|
-
},
|
|
379
|
+
}, De = {
|
|
380
380
|
ruleRow: "_ruleRow_nx0en_1",
|
|
381
381
|
heading: "_heading_nx0en_5",
|
|
382
382
|
hint: "_hint_nx0en_9",
|
|
383
383
|
loading: "_loading_nx0en_13",
|
|
384
384
|
ruleText: "_ruleText_nx0en_17"
|
|
385
|
-
},
|
|
385
|
+
}, Oe = 20, ke = (e, t) => e === U.Equal ? t.equal : e === U.Contain ? t.contain : t.regex, Ae = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: c, disabled: l = !1, isLoading: f = !1, hasLoadError: p = !1, maxRules: m = Oe, maxTargetsPerRule: h, labels: v = {}, headingClassName: ee = "dial-body-semi-text", hintClassName: y = "dial-small-text", loadingClassName: S = "dial-small-text", ruleTextClassName: C = "dial-small-text", ruleSourceClassName: D = "dial-small-semi-text", styles: O = {} }) => {
|
|
386
386
|
let k = {
|
|
387
387
|
...ne({
|
|
388
388
|
"--par-rule-bg": O.colors?.ruleBackground,
|
|
@@ -392,147 +392,147 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
392
392
|
"--par-rule-text": O.colors?.ruleText
|
|
393
393
|
}),
|
|
394
394
|
...O.cssVars
|
|
395
|
-
}, { heading: A = "Allow access if all match", folderScopeHint:
|
|
395
|
+
}, { heading: A = "Allow access if all match", folderScopeHint: j = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: te = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: N = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: P = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: F = "Add rule", clearAllLabel: I = "Clear all", orSeparatorLabel: R = "Or", removeRuleAriaLabelTemplate: z = "Remove rule for {source}: {targets}", equalFunctionLabel: re = "Equal", containFunctionLabel: ie = "Contain", regexFunctionLabel: se = "Regex", loadingLabel: H = "Loading existing rules…", loadErrorLabel: U = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: W = "Rule added.", ruleRemovedAnnouncement: G = "Rule removed.", rulesClearedAnnouncement: ce = "All rules cleared.", rulesLoadedAnnouncement: K = "Existing rules loaded for the selected folder.", editorLabels: le } = v, q = n(), [ue, J] = a(!1), [de, Y] = a(""), X = i(null), fe = i(f);
|
|
396
396
|
t(() => {
|
|
397
|
-
|
|
397
|
+
fe.current && !f && e.length > 0 && Y(K), fe.current = f;
|
|
398
398
|
}, [
|
|
399
399
|
f,
|
|
400
400
|
e,
|
|
401
401
|
K
|
|
402
402
|
]);
|
|
403
|
-
let
|
|
404
|
-
|
|
405
|
-
},
|
|
406
|
-
J(!1),
|
|
407
|
-
},
|
|
408
|
-
r([...e, t]), Y(W),
|
|
409
|
-
},
|
|
403
|
+
let Z = () => {
|
|
404
|
+
X.current = document.activeElement, J(!0);
|
|
405
|
+
}, Q = () => {
|
|
406
|
+
J(!1), X.current?.focus?.();
|
|
407
|
+
}, pe = (t) => {
|
|
408
|
+
r([...e, t]), Y(W), Q();
|
|
409
|
+
}, $ = (t) => {
|
|
410
410
|
r(e.filter((e, n) => n !== t)), Y(G);
|
|
411
|
-
},
|
|
411
|
+
}, me = () => {
|
|
412
412
|
r([]), Y(ce);
|
|
413
|
-
},
|
|
414
|
-
equal:
|
|
415
|
-
contain:
|
|
416
|
-
regex:
|
|
417
|
-
},
|
|
418
|
-
return /* @__PURE__ */
|
|
413
|
+
}, he = {
|
|
414
|
+
equal: re,
|
|
415
|
+
contain: ie,
|
|
416
|
+
regex: se
|
|
417
|
+
}, ge = e.length >= m, _e = l || ge, ve = c != null && c !== "";
|
|
418
|
+
return /* @__PURE__ */ V("div", {
|
|
419
419
|
role: "group",
|
|
420
420
|
"aria-labelledby": q,
|
|
421
421
|
style: k,
|
|
422
|
-
className:
|
|
422
|
+
className: L(l && "pointer-events-none opacity-60"),
|
|
423
423
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ B(b, {
|
|
425
425
|
visuallyHidden: !0,
|
|
426
|
-
as:
|
|
426
|
+
as: x.Span,
|
|
427
427
|
children: de
|
|
428
428
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ V("div", {
|
|
430
430
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ B("div", {
|
|
432
432
|
id: q,
|
|
433
|
-
className:
|
|
433
|
+
className: L(ee, De.heading),
|
|
434
434
|
children: A
|
|
435
|
-
}), e.length > 0 && /* @__PURE__ */
|
|
435
|
+
}), e.length > 0 && /* @__PURE__ */ B(g, {
|
|
436
436
|
variant: s.Primary,
|
|
437
|
-
label:
|
|
438
|
-
onClick:
|
|
439
|
-
disabled:
|
|
437
|
+
label: I,
|
|
438
|
+
onClick: me,
|
|
439
|
+
disabled: l
|
|
440
440
|
})]
|
|
441
441
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
className:
|
|
444
|
-
children:
|
|
442
|
+
/* @__PURE__ */ B("p", {
|
|
443
|
+
className: L("mb-2", y, De.hint),
|
|
444
|
+
children: ve ? j.replace("{folder}", c) : te
|
|
445
445
|
}),
|
|
446
|
-
e.length > 0 && !
|
|
446
|
+
e.length > 0 && !ve && /* @__PURE__ */ B("div", {
|
|
447
447
|
className: "mb-2",
|
|
448
|
-
children: /* @__PURE__ */
|
|
449
|
-
type:
|
|
450
|
-
variant:
|
|
448
|
+
children: /* @__PURE__ */ B(w, {
|
|
449
|
+
type: T.SectionMessage,
|
|
450
|
+
variant: E.Warning,
|
|
451
451
|
message: N
|
|
452
452
|
})
|
|
453
453
|
}),
|
|
454
|
-
f && /* @__PURE__ */
|
|
455
|
-
className:
|
|
456
|
-
children: [/* @__PURE__ */
|
|
454
|
+
f && /* @__PURE__ */ V("div", {
|
|
455
|
+
className: L("mb-2 flex items-center gap-2", S, De.loading),
|
|
456
|
+
children: [/* @__PURE__ */ B(M, {
|
|
457
457
|
size: 16,
|
|
458
458
|
ariaLabel: H
|
|
459
|
-
}), /* @__PURE__ */
|
|
459
|
+
}), /* @__PURE__ */ B("span", { children: H })]
|
|
460
460
|
}),
|
|
461
|
-
p && /* @__PURE__ */
|
|
461
|
+
p && /* @__PURE__ */ B("div", {
|
|
462
462
|
className: "mb-2",
|
|
463
|
-
children: /* @__PURE__ */
|
|
464
|
-
type:
|
|
465
|
-
variant:
|
|
463
|
+
children: /* @__PURE__ */ B(w, {
|
|
464
|
+
type: T.SectionMessage,
|
|
465
|
+
variant: E.Warning,
|
|
466
466
|
message: U
|
|
467
467
|
})
|
|
468
468
|
}),
|
|
469
|
-
e.length > 0 && /* @__PURE__ */
|
|
469
|
+
e.length > 0 && /* @__PURE__ */ B("ul", {
|
|
470
470
|
className: "mb-3 flex flex-col gap-2",
|
|
471
471
|
children: e.map((e, t) => {
|
|
472
|
-
let n = e.targets.join(` ${
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
className:
|
|
475
|
-
children: [/* @__PURE__ */
|
|
476
|
-
className:
|
|
472
|
+
let n = e.targets.join(` ${R} `), r = z.replace("{source}", e.source).replace("{targets}", n);
|
|
473
|
+
return /* @__PURE__ */ V("li", {
|
|
474
|
+
className: L("flex items-center justify-between gap-2 rounded-lg px-3 py-2", De.ruleRow),
|
|
475
|
+
children: [/* @__PURE__ */ V("span", {
|
|
476
|
+
className: L("truncate", C, De.ruleText),
|
|
477
477
|
children: [
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ B("span", {
|
|
479
479
|
className: D,
|
|
480
480
|
children: e.source
|
|
481
481
|
}),
|
|
482
482
|
" ",
|
|
483
|
-
|
|
483
|
+
ke(e.function, he),
|
|
484
484
|
": ",
|
|
485
485
|
n
|
|
486
486
|
]
|
|
487
|
-
}), /* @__PURE__ */
|
|
488
|
-
icon: /* @__PURE__ */
|
|
489
|
-
size:
|
|
487
|
+
}), /* @__PURE__ */ B(_, {
|
|
488
|
+
icon: /* @__PURE__ */ B(oe, {
|
|
489
|
+
size: u.SM,
|
|
490
490
|
"aria-hidden": !0,
|
|
491
|
-
stroke:
|
|
491
|
+
stroke: d
|
|
492
492
|
}),
|
|
493
493
|
"aria-label": r,
|
|
494
|
-
onClick: () =>
|
|
495
|
-
disabled:
|
|
494
|
+
onClick: () => $(t),
|
|
495
|
+
disabled: l
|
|
496
496
|
})]
|
|
497
497
|
}, t);
|
|
498
498
|
})
|
|
499
499
|
}),
|
|
500
|
-
ue && /* @__PURE__ */
|
|
500
|
+
ue && /* @__PURE__ */ B(Ee, {
|
|
501
501
|
sourceOptions: o,
|
|
502
|
-
onSave:
|
|
503
|
-
onCancel:
|
|
504
|
-
disabled:
|
|
505
|
-
maxTargets:
|
|
502
|
+
onSave: pe,
|
|
503
|
+
onCancel: Q,
|
|
504
|
+
disabled: l,
|
|
505
|
+
maxTargets: h,
|
|
506
506
|
labels: le,
|
|
507
507
|
styles: O.editor
|
|
508
508
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ B("div", {
|
|
510
510
|
className: "flex flex-wrap items-center gap-2",
|
|
511
|
-
children: /* @__PURE__ */
|
|
512
|
-
label:
|
|
513
|
-
iconBefore: /* @__PURE__ */
|
|
514
|
-
size:
|
|
511
|
+
children: /* @__PURE__ */ B(g, {
|
|
512
|
+
label: F,
|
|
513
|
+
iconBefore: /* @__PURE__ */ B(ae, {
|
|
514
|
+
size: u.SM,
|
|
515
515
|
"aria-hidden": !0,
|
|
516
|
-
stroke:
|
|
516
|
+
stroke: d
|
|
517
517
|
}),
|
|
518
|
-
onClick:
|
|
519
|
-
disabled:
|
|
518
|
+
onClick: Z,
|
|
519
|
+
disabled: _e
|
|
520
520
|
})
|
|
521
521
|
}),
|
|
522
|
-
|
|
523
|
-
className:
|
|
522
|
+
ge && /* @__PURE__ */ B("p", {
|
|
523
|
+
className: L("mt-2", y, De.hint),
|
|
524
524
|
children: P.replace("{max}", String(m))
|
|
525
525
|
})
|
|
526
526
|
]
|
|
527
527
|
});
|
|
528
|
-
},
|
|
528
|
+
}, je = {
|
|
529
529
|
currentBadge: "_currentBadge_d0adf_1",
|
|
530
530
|
sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
|
|
531
531
|
version: "_version_d0adf_13",
|
|
532
532
|
date: "_date_d0adf_17",
|
|
533
533
|
emptyState: "_emptyState_d0adf_21",
|
|
534
534
|
stripedRow: "_stripedRow_d0adf_25"
|
|
535
|
-
},
|
|
535
|
+
}, Me = ({ 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 }) => {
|
|
536
536
|
let m = ne({
|
|
537
537
|
"--phl-badge-border": p?.currentBadgeBorder,
|
|
538
538
|
"--phl-badge-bg": p?.currentBadgeBackground,
|
|
@@ -544,209 +544,209 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
544
544
|
"--phl-date-text": p?.dateText,
|
|
545
545
|
"--phl-empty-text": p?.emptyStateText,
|
|
546
546
|
"--phl-striped-bg": p?.stripedBackground
|
|
547
|
-
}), h =
|
|
547
|
+
}), h = L(f, je.emptyState);
|
|
548
548
|
if (n || r || e.length === 0) {
|
|
549
549
|
let e = s;
|
|
550
|
-
return n ? e = c : r && (e = l), /* @__PURE__ */
|
|
551
|
-
as:
|
|
550
|
+
return n ? e = c : r && (e = l), /* @__PURE__ */ B(b, {
|
|
551
|
+
as: x.P,
|
|
552
552
|
style: m,
|
|
553
553
|
className: h,
|
|
554
554
|
children: e
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ B("ul", {
|
|
558
558
|
style: m,
|
|
559
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
560
|
-
className:
|
|
561
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: e.map((e, n) => /* @__PURE__ */ V("li", {
|
|
560
|
+
className: L("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && je.stripedRow),
|
|
561
|
+
children: [/* @__PURE__ */ V("span", {
|
|
562
562
|
className: "flex min-w-0 items-center gap-2",
|
|
563
563
|
style: m,
|
|
564
564
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
className:
|
|
565
|
+
/* @__PURE__ */ V("span", {
|
|
566
|
+
className: L(u, je.version),
|
|
567
567
|
children: [
|
|
568
568
|
i,
|
|
569
569
|
" ",
|
|
570
570
|
e.version
|
|
571
571
|
]
|
|
572
572
|
}),
|
|
573
|
-
e.version === t && /* @__PURE__ */
|
|
573
|
+
e.version === t && /* @__PURE__ */ B(te, {
|
|
574
574
|
label: a,
|
|
575
|
-
className:
|
|
575
|
+
className: L("shrink-0 whitespace-nowrap", je.currentBadge)
|
|
576
576
|
}),
|
|
577
|
-
e.publishCredentials === !0 && /* @__PURE__ */
|
|
577
|
+
e.publishCredentials === !0 && /* @__PURE__ */ B(te, {
|
|
578
578
|
label: o,
|
|
579
|
-
className:
|
|
579
|
+
className: L("shrink-0 whitespace-nowrap", je.sharedCredentialsBadge)
|
|
580
580
|
})
|
|
581
581
|
]
|
|
582
|
-
}), /* @__PURE__ */
|
|
583
|
-
className:
|
|
584
|
-
children:
|
|
582
|
+
}), /* @__PURE__ */ B("span", {
|
|
583
|
+
className: L(d, je.date),
|
|
584
|
+
children: K(e.publishedAt)
|
|
585
585
|
})]
|
|
586
586
|
}, `${e.version}-${n}`))
|
|
587
587
|
});
|
|
588
|
-
},
|
|
589
|
-
let [t, ...n] = e, r =
|
|
588
|
+
}, Ne = ":", Pe = (e) => `${Ne}${e}`, Fe = (e) => e?.startsWith(Ne) ? e.slice(1) : void 0, Ie = (e) => [Pe(e.rootKey), ...e.path], Le = (e) => {
|
|
589
|
+
let [t, ...n] = e, r = Fe(t);
|
|
590
590
|
return r == null ? void 0 : {
|
|
591
591
|
rootKey: r,
|
|
592
592
|
path: n
|
|
593
593
|
};
|
|
594
|
-
},
|
|
594
|
+
}, Re = (e, t) => e.map((e) => ({
|
|
595
595
|
...e,
|
|
596
596
|
path: [t, ...e.path],
|
|
597
|
-
children: e.children ?
|
|
598
|
-
})),
|
|
599
|
-
let t =
|
|
597
|
+
children: e.children ? Re(e.children, t) : void 0
|
|
598
|
+
})), ze = (e) => e.map((e) => {
|
|
599
|
+
let t = Pe(e.key);
|
|
600
600
|
return {
|
|
601
601
|
path: [t],
|
|
602
602
|
name: e.label,
|
|
603
|
-
children:
|
|
603
|
+
children: Re(fe(e.items), t)
|
|
604
604
|
};
|
|
605
|
-
}),
|
|
605
|
+
}), Be = (e) => e.map((e) => Pe(e.key)), Ve = (e, t) => {
|
|
606
606
|
let n = /* @__PURE__ */ new Set();
|
|
607
607
|
for (let r of e) {
|
|
608
|
-
let e =
|
|
608
|
+
let e = Pe(r.key);
|
|
609
609
|
for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
|
|
610
610
|
}
|
|
611
611
|
return n;
|
|
612
|
-
},
|
|
612
|
+
}, He = (e, t) => {
|
|
613
613
|
let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
|
|
614
614
|
for (let e of t) {
|
|
615
|
-
let [t, ...r] = e.split("/"), i =
|
|
616
|
-
i != null && r.length !== 0 && n.get(i)?.add(
|
|
615
|
+
let [t, ...r] = e.split("/"), i = Fe(t);
|
|
616
|
+
i != null && r.length !== 0 && n.get(i)?.add($(r));
|
|
617
617
|
}
|
|
618
618
|
return n;
|
|
619
|
-
},
|
|
619
|
+
}, Ue = {
|
|
620
620
|
divider: "_divider_1gs31_1",
|
|
621
621
|
tree: "_tree_1gs31_17"
|
|
622
|
-
},
|
|
622
|
+
}, We = "data-cancel-creating-folder", Ge = "", Ke = [], qe = ({ items: e = Ke, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: l, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: m, disabled: h = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: v = "Cancel", addSiblingFolderLabel: ee = "Add sibling", addChildFolderLabel: y = "Add child", newFolderDefaultName: b = "New folder", noResultsLabel: x = "No folders match \"{query}\".", emptyFolderNameError: S = "Folder name cannot be empty.", invalidFolderNameError: C = "Folder name contains invalid characters.", duplicateFolderNameError: w = "A folder with this name already exists.", rootLabel: T = "Organization", expandedPaths: E, onExpandedPathsChange: D, loadingPaths: O, styles: k = {} }) => {
|
|
623
623
|
let A = {
|
|
624
624
|
...ne({ "--pft-divider": k.colors?.divider }),
|
|
625
625
|
...k.cssVars
|
|
626
|
-
}, j = c != null, M = r(() => c ?
|
|
626
|
+
}, j = c != null, M = r(() => c ? ze(c) : e, [c, e]), te = i(M);
|
|
627
627
|
t(() => {
|
|
628
628
|
te.current = M;
|
|
629
629
|
}, [M]);
|
|
630
|
-
let N = r(() => c ?
|
|
631
|
-
j && (P =
|
|
632
|
-
let
|
|
633
|
-
j ? f?.(e ?
|
|
634
|
-
}, [
|
|
630
|
+
let N = r(() => c ? Be(c) : [Ge], [c]), P = n;
|
|
631
|
+
j && (P = l ? Ie(l) : void 0);
|
|
632
|
+
let F = (e) => {
|
|
633
|
+
j ? f?.(e ? Le(e) : void 0) : o?.(e);
|
|
634
|
+
}, [I, R] = a(() => new Set(P?.map((e, t) => $(P.slice(0, t + 1))) ?? [])), z = r(() => c ? /* @__PURE__ */ new Set([...I, ...Ve(c, (e) => e.expandedPaths)]) : void 0, [c, I]) ?? E ?? I, re = r(() => c ? Ve(c, (e) => e.loadingPaths) : O, [c, O]), oe = (e) => {
|
|
635
635
|
let t = new Set(e);
|
|
636
636
|
for (let e of N) t.delete(e);
|
|
637
637
|
if (c) {
|
|
638
|
-
|
|
639
|
-
let e =
|
|
638
|
+
R(t);
|
|
639
|
+
let e = He(c, t);
|
|
640
640
|
for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
|
|
641
|
-
} else D ? D(t) :
|
|
641
|
+
} else D ? D(t) : R(t);
|
|
642
642
|
}, [U, W] = a(null), [G, ce] = a(b), K = i(null), le = i(!1);
|
|
643
643
|
t(() => {
|
|
644
644
|
let e = (e) => {
|
|
645
|
-
e.target instanceof Element && e.target.closest(`[${
|
|
645
|
+
e.target instanceof Element && e.target.closest(`[${We}]`) && (le.current = !0);
|
|
646
646
|
};
|
|
647
647
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
648
648
|
}, []);
|
|
649
|
-
let q = m.trim(), ue = U != null,
|
|
650
|
-
let e = X ?
|
|
651
|
-
return j ? e :
|
|
649
|
+
let q = m.trim(), ue = U != null, J = r(() => Y(M, m), [M, m]), de = q.length > 0 && J.length === 0, X = !ue && q.length > 0, Z = r(() => {
|
|
650
|
+
let e = X ? J : M;
|
|
651
|
+
return j ? e : fe(e);
|
|
652
652
|
}, [
|
|
653
653
|
X,
|
|
654
|
-
|
|
654
|
+
J,
|
|
655
655
|
M,
|
|
656
656
|
j
|
|
657
|
-
]), Q = r(() => /* @__PURE__ */ new Set([...N, ...pe(
|
|
657
|
+
]), Q = r(() => /* @__PURE__ */ new Set([...N, ...pe(Z)]), [N, Z]), he = r(() => /* @__PURE__ */ new Set([...N, ...X ? Q : z]), [
|
|
658
658
|
N,
|
|
659
659
|
X,
|
|
660
660
|
Q,
|
|
661
|
-
|
|
662
|
-
]),
|
|
663
|
-
path:
|
|
661
|
+
z
|
|
662
|
+
]), _e = r(() => ge(Z), [Z]), xe = r(() => X && _e.length === 0 ? [] : j ? _e : [{
|
|
663
|
+
path: Ge,
|
|
664
664
|
name: T,
|
|
665
|
-
folderId:
|
|
666
|
-
nodeType:
|
|
667
|
-
items:
|
|
665
|
+
folderId: Ge,
|
|
666
|
+
nodeType: se.FOLDER,
|
|
667
|
+
items: _e
|
|
668
668
|
}], [
|
|
669
|
-
|
|
669
|
+
_e,
|
|
670
670
|
T,
|
|
671
671
|
X,
|
|
672
672
|
j
|
|
673
|
-
]),
|
|
673
|
+
]), Se = U ? $(U) : null, Ce = {
|
|
674
674
|
empty: S,
|
|
675
675
|
invalid: C,
|
|
676
676
|
duplicate: w
|
|
677
|
-
},
|
|
677
|
+
}, we = (e) => {
|
|
678
678
|
if (!c) return !0;
|
|
679
|
-
let t =
|
|
679
|
+
let t = Le(e), n = c.find((e) => e.key === t?.rootKey);
|
|
680
680
|
return n != null && n.canCreateFolders !== !1;
|
|
681
681
|
}, Te = (() => {
|
|
682
682
|
if (!c) return P ?? [];
|
|
683
|
-
if (P &&
|
|
683
|
+
if (P && we(P)) return P;
|
|
684
684
|
let e = c.find((e) => e.canCreateFolders !== !1);
|
|
685
|
-
return e ?
|
|
685
|
+
return e ? Ie({
|
|
686
686
|
rootKey: e.key,
|
|
687
687
|
path: []
|
|
688
688
|
}) : void 0;
|
|
689
|
-
})(), Ee = (e) =>
|
|
689
|
+
})(), Ee = (e) => ye(de && ve(q, [], Ce) == null ? q : b, be(M, e)), De = (e) => {
|
|
690
690
|
W(e), ce(Ee(e)), K.current = null, le.current = !1;
|
|
691
|
-
let t =
|
|
692
|
-
t &&
|
|
691
|
+
let t = $(e);
|
|
692
|
+
t && oe(new Set(z).add(t));
|
|
693
693
|
}, Oe = () => {
|
|
694
694
|
Te && De(Te);
|
|
695
695
|
}, ke = (e) => {
|
|
696
696
|
let t = me(e.path);
|
|
697
|
-
if (
|
|
697
|
+
if (!we(t)) return [];
|
|
698
698
|
let n = [{
|
|
699
699
|
key: "add-child",
|
|
700
700
|
label: y,
|
|
701
|
-
icon: /* @__PURE__ */
|
|
702
|
-
size:
|
|
701
|
+
icon: /* @__PURE__ */ B(ie, {
|
|
702
|
+
size: u.SM,
|
|
703
703
|
"aria-hidden": !0,
|
|
704
|
-
stroke:
|
|
704
|
+
stroke: d
|
|
705
705
|
}),
|
|
706
706
|
onClick: () => De(t)
|
|
707
707
|
}];
|
|
708
708
|
return N.includes(e.path) || n.push({
|
|
709
709
|
key: "add-sibling",
|
|
710
|
-
label:
|
|
711
|
-
icon: /* @__PURE__ */
|
|
712
|
-
size:
|
|
710
|
+
label: ee,
|
|
711
|
+
icon: /* @__PURE__ */ B(ae, {
|
|
712
|
+
size: u.SM,
|
|
713
713
|
"aria-hidden": !0,
|
|
714
|
-
stroke:
|
|
714
|
+
stroke: d
|
|
715
715
|
}),
|
|
716
716
|
onClick: () => De(t.slice(0, -1))
|
|
717
717
|
}), n;
|
|
718
718
|
}, Ae = (e) => {
|
|
719
719
|
if (!U) return null;
|
|
720
|
-
let t =
|
|
720
|
+
let t = ve(e, be(te.current, U), Ce);
|
|
721
721
|
return K.current = t, t;
|
|
722
722
|
}, je = (e) => {
|
|
723
723
|
if (!U || le.current) return;
|
|
724
724
|
let t = e.trim(), n = K.current;
|
|
725
725
|
if (!(Ae(e) ?? n)) {
|
|
726
|
-
let e = c ?
|
|
727
|
-
e ? p?.(e.rootKey, e.path, t) : s?.(U, t),
|
|
726
|
+
let e = c ? Le(U) : void 0;
|
|
727
|
+
e ? p?.(e.rootKey, e.path, t) : s?.(U, t), F([...U, t]);
|
|
728
728
|
}
|
|
729
729
|
W(null);
|
|
730
730
|
}, Me = () => W(null);
|
|
731
|
-
return /* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */ V("div", {
|
|
732
732
|
style: A,
|
|
733
|
-
className:
|
|
733
|
+
className: L(h && "pointer-events-none opacity-60", k.className),
|
|
734
734
|
children: [
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
className:
|
|
737
|
-
children: /* @__PURE__ */
|
|
738
|
-
items:
|
|
735
|
+
/* @__PURE__ */ B("div", {
|
|
736
|
+
className: L("w-full max-w-full min-w-0", Ue.tree),
|
|
737
|
+
children: /* @__PURE__ */ B(H, {
|
|
738
|
+
items: xe,
|
|
739
739
|
showFiles: !1,
|
|
740
|
-
selectedPath: P == null ? void 0 :
|
|
741
|
-
expandedPaths:
|
|
742
|
-
onExpandedPathsChange:
|
|
743
|
-
loadingPaths:
|
|
740
|
+
selectedPath: P == null ? void 0 : $(P),
|
|
741
|
+
expandedPaths: he,
|
|
742
|
+
onExpandedPathsChange: oe,
|
|
743
|
+
loadingPaths: re,
|
|
744
744
|
onItemClick: (e) => {
|
|
745
|
-
let t = P != null &&
|
|
746
|
-
|
|
745
|
+
let t = P != null && $(P) === e.path;
|
|
746
|
+
F(t ? void 0 : me(e.path));
|
|
747
747
|
},
|
|
748
748
|
getContextMenuItems: ke,
|
|
749
|
-
createdFolderPath:
|
|
749
|
+
createdFolderPath: Se,
|
|
750
750
|
newFolderDefaultName: G,
|
|
751
751
|
onCreateFolderSave: je,
|
|
752
752
|
onCreateFolderCancel: Me,
|
|
@@ -755,36 +755,36 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
755
755
|
emptyStateTitle: X ? x.replace("{query}", q) : void 0
|
|
756
756
|
})
|
|
757
757
|
}),
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
className:
|
|
758
|
+
/* @__PURE__ */ B("div", {
|
|
759
|
+
className: L("my-2 h-px", Ue.divider),
|
|
760
760
|
"aria-hidden": !0
|
|
761
761
|
}),
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ V("div", {
|
|
763
763
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
764
|
-
children: [/* @__PURE__ */
|
|
764
|
+
children: [/* @__PURE__ */ B(g, {
|
|
765
765
|
onClick: Oe,
|
|
766
766
|
label: _,
|
|
767
|
-
iconBefore: /* @__PURE__ */
|
|
768
|
-
size:
|
|
767
|
+
iconBefore: /* @__PURE__ */ B(ae, {
|
|
768
|
+
size: u.SM,
|
|
769
769
|
"aria-hidden": !0,
|
|
770
|
-
stroke:
|
|
770
|
+
stroke: d
|
|
771
771
|
}),
|
|
772
|
-
disabled:
|
|
773
|
-
}), ue && /* @__PURE__ */
|
|
774
|
-
label:
|
|
772
|
+
disabled: h || ue || !Te
|
|
773
|
+
}), ue && /* @__PURE__ */ B(g, {
|
|
774
|
+
label: v,
|
|
775
775
|
onClick: Me,
|
|
776
|
-
disabled:
|
|
777
|
-
[
|
|
776
|
+
disabled: h,
|
|
777
|
+
[We]: ""
|
|
778
778
|
})]
|
|
779
779
|
})
|
|
780
780
|
]
|
|
781
781
|
});
|
|
782
|
-
},
|
|
782
|
+
}, Je = { panel: "dial-publish-panel-panel" }, Ye = {
|
|
783
783
|
summaryTitle: "_summaryTitle_zj3gd_1",
|
|
784
784
|
sectionHeading: "_sectionHeading_zj3gd_5",
|
|
785
785
|
destination: "_destination_zj3gd_9"
|
|
786
|
-
},
|
|
787
|
-
let { colors: K, folderTree: le, accessRules:
|
|
786
|
+
}, Xe = 200, Ze = ({ view: e = J.Main, onChangeFolderClick: o, resource: s, renderSummary: l, folderItems: f, selectedFolderPath: m, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: y, expandedPaths: b, onExpandedPathsChange: x, loadingPaths: S, hasExistingPublicationInFolder: C, hasWriteAccess: E, isSubmitting: D, hasSubmitError: O = !1, allowReplace: A = !0, author: j, onAuthorChange: M, publishCredentials: te = !1, onPublishCredentialsChange: N, rules: P, onRulesChange: I, ruleSourceOptions: R, isRulesLoading: z = !1, hasRulesLoadError: ie = !1, labels: ae = {}, summaryTitleClassName: oe = "dial-body-semi-text", headingClassName: se = "dial-body-semi-text", destinationClassName: H = "dial-small-semi-text", calloutFolderNameClassName: U = "dial-small-paragraph-semi-text", styles: ce = {} }) => {
|
|
787
|
+
let { colors: K, folderTree: le, accessRules: q } = ce, ue = {
|
|
788
788
|
...ne({
|
|
789
789
|
"--pp-summary-title-text": K?.summaryTitleText,
|
|
790
790
|
"--pp-heading-text": K?.headingText,
|
|
@@ -794,48 +794,48 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
794
794
|
}, de = {
|
|
795
795
|
border: K?.summaryBorder,
|
|
796
796
|
background: K?.summaryBackground
|
|
797
|
-
}, { folderLabel: Y = "Publish to folder", destinationAriaLabel:
|
|
797
|
+
}, { folderLabel: Y = "Publish to folder", destinationAriaLabel: X = "Destination folder", noFolderSelectedLabel: fe = "No folder selected", changeFolderLabel: Z = "Change", chooseFolderLabel: Q = "Choose", replaceWarning: pe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: $ = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: me = "Publishing failed. Please try again.", folderEmptyStateLabel: he, addSiblingFolderLabel: ge, addChildFolderLabel: _e, cancelCreatingFolderLabel: ve, createFolderEmptyNameError: ye, createFolderInvalidNameError: be, createFolderDuplicateNameError: xe, rootFolderLabel: Se = "Organization", accessRulesLabels: Ce, searchPlaceholder: we, clearSearchAriaLabel: Te, authorLabel: Ee = "Author", authorPlaceholder: De = "Author name", authorHint: Oe = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: ke = "Publish with my credentials", credentialsHint: je = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ae, [Me, Ne] = a(""), Pe = n(), Fe = i(null), Ie = i(null), Le = (e) => {
|
|
798
798
|
Ne(e ?? "");
|
|
799
799
|
}, Re = i(e);
|
|
800
800
|
t(() => {
|
|
801
|
-
Re.current !== e && (Re.current = e, e ===
|
|
801
|
+
Re.current !== e && (Re.current = e, e === J.ChangeFolder ? Ie.current?.focus({ preventScroll: !0 }) : Fe.current?.focus({ preventScroll: !0 }));
|
|
802
802
|
}, [e]);
|
|
803
|
-
let ze =
|
|
803
|
+
let ze = m != null, Be = r(() => G({
|
|
804
804
|
hasSelectedFolder: ze,
|
|
805
|
-
hasExistingPublicationInFolder:
|
|
805
|
+
hasExistingPublicationInFolder: C,
|
|
806
806
|
hasWriteAccess: E,
|
|
807
807
|
isSubmitting: D,
|
|
808
|
-
hasSubmitError:
|
|
808
|
+
hasSubmitError: O,
|
|
809
809
|
allowReplace: A
|
|
810
810
|
}), [
|
|
811
811
|
ze,
|
|
812
|
-
|
|
812
|
+
C,
|
|
813
813
|
E,
|
|
814
814
|
D,
|
|
815
|
-
|
|
815
|
+
O,
|
|
816
816
|
A
|
|
817
|
-
]), Ve = ze ?
|
|
818
|
-
className:
|
|
817
|
+
]), Ve = ze ? m[m.length - 1] ?? Se : "", He = l ? l() : /* @__PURE__ */ B("span", {
|
|
818
|
+
className: L("truncate", oe, Ye.summaryTitle),
|
|
819
819
|
children: s?.title
|
|
820
820
|
});
|
|
821
|
-
if (e ===
|
|
821
|
+
if (e === J.ChangeFolder) return /* @__PURE__ */ V("div", {
|
|
822
822
|
ref: Ie,
|
|
823
823
|
tabIndex: -1,
|
|
824
824
|
role: "group",
|
|
825
825
|
"aria-label": Y,
|
|
826
|
-
className:
|
|
827
|
-
style:
|
|
828
|
-
children: [/* @__PURE__ */
|
|
826
|
+
className: L("flex flex-col gap-3 outline-none", Je.panel),
|
|
827
|
+
style: ue,
|
|
828
|
+
children: [/* @__PURE__ */ B("div", {
|
|
829
829
|
role: "search",
|
|
830
|
-
children: /* @__PURE__ */
|
|
830
|
+
children: /* @__PURE__ */ B(k, {
|
|
831
831
|
value: Me,
|
|
832
832
|
onChange: Le,
|
|
833
|
-
placeholder:
|
|
833
|
+
placeholder: we,
|
|
834
834
|
clearLabel: Te,
|
|
835
|
-
"aria-label":
|
|
835
|
+
"aria-label": we
|
|
836
836
|
})
|
|
837
|
-
}), /* @__PURE__ */
|
|
838
|
-
items:
|
|
837
|
+
}), /* @__PURE__ */ B(qe, {
|
|
838
|
+
items: f,
|
|
839
839
|
selectedPath: _,
|
|
840
840
|
onSelectedPathChange: v,
|
|
841
841
|
onCreateFolder: y,
|
|
@@ -844,25 +844,25 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
844
844
|
loadingPaths: S,
|
|
845
845
|
searchQuery: Me,
|
|
846
846
|
disabled: D,
|
|
847
|
-
noResultsLabel:
|
|
848
|
-
addSiblingFolderLabel:
|
|
849
|
-
addChildFolderLabel:
|
|
850
|
-
cancelCreatingFolderLabel:
|
|
851
|
-
emptyFolderNameError:
|
|
852
|
-
invalidFolderNameError:
|
|
853
|
-
duplicateFolderNameError:
|
|
854
|
-
rootLabel:
|
|
847
|
+
noResultsLabel: he,
|
|
848
|
+
addSiblingFolderLabel: ge,
|
|
849
|
+
addChildFolderLabel: _e,
|
|
850
|
+
cancelCreatingFolderLabel: ve,
|
|
851
|
+
emptyFolderNameError: ye,
|
|
852
|
+
invalidFolderNameError: be,
|
|
853
|
+
duplicateFolderNameError: xe,
|
|
854
|
+
rootLabel: Se,
|
|
855
855
|
styles: le
|
|
856
856
|
})]
|
|
857
857
|
});
|
|
858
|
-
let Ue =
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
-
className:
|
|
861
|
-
style:
|
|
862
|
-
children: [s?.type == null ? /* @__PURE__ */
|
|
858
|
+
let Ue = L(H, Ye.destination);
|
|
859
|
+
return /* @__PURE__ */ V("div", {
|
|
860
|
+
className: L("flex flex-col gap-5", Je.panel),
|
|
861
|
+
style: ue,
|
|
862
|
+
children: [s?.type == null ? /* @__PURE__ */ B(F, {
|
|
863
863
|
colors: de,
|
|
864
864
|
children: He
|
|
865
|
-
}) : /* @__PURE__ */
|
|
865
|
+
}) : /* @__PURE__ */ B(F, {
|
|
866
866
|
item: {
|
|
867
867
|
type: s.type,
|
|
868
868
|
name: s.title,
|
|
@@ -871,146 +871,146 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
871
871
|
},
|
|
872
872
|
hasVersionTag: !1,
|
|
873
873
|
colors: de
|
|
874
|
-
}), /* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
className:
|
|
874
|
+
}), /* @__PURE__ */ V("section", { children: [
|
|
875
|
+
/* @__PURE__ */ B("h2", {
|
|
876
|
+
className: L("mb-2", se, Ye.sectionHeading),
|
|
877
877
|
children: Y
|
|
878
878
|
}),
|
|
879
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ V("div", {
|
|
880
880
|
className: "flex min-w-0 items-center gap-2",
|
|
881
|
-
children: [/* @__PURE__ */
|
|
881
|
+
children: [/* @__PURE__ */ B("div", {
|
|
882
882
|
role: "group",
|
|
883
|
-
"aria-label":
|
|
883
|
+
"aria-label": X,
|
|
884
884
|
className: "min-w-0 flex-1",
|
|
885
|
-
children: ze ? /* @__PURE__ */
|
|
886
|
-
name: [
|
|
885
|
+
children: ze ? /* @__PURE__ */ B(h, {
|
|
886
|
+
name: [Se, ...m].join(" / "),
|
|
887
887
|
nameClassName: Ue
|
|
888
|
-
}) : /* @__PURE__ */
|
|
889
|
-
className:
|
|
890
|
-
children:
|
|
888
|
+
}) : /* @__PURE__ */ B("span", {
|
|
889
|
+
className: L("block truncate", Ue),
|
|
890
|
+
children: fe
|
|
891
891
|
})
|
|
892
|
-
}), /* @__PURE__ */
|
|
892
|
+
}), /* @__PURE__ */ B(g, {
|
|
893
893
|
ref: Fe,
|
|
894
|
-
size:
|
|
895
|
-
label: ze ?
|
|
896
|
-
iconBefore: /* @__PURE__ */
|
|
897
|
-
size:
|
|
898
|
-
stroke:
|
|
894
|
+
size: p.Small,
|
|
895
|
+
label: ze ? Z : Q,
|
|
896
|
+
iconBefore: /* @__PURE__ */ B(re, {
|
|
897
|
+
size: u.SM,
|
|
898
|
+
stroke: d,
|
|
899
899
|
"aria-hidden": !0
|
|
900
900
|
}),
|
|
901
901
|
disabled: D,
|
|
902
902
|
onClick: o
|
|
903
903
|
})]
|
|
904
904
|
}),
|
|
905
|
-
Be.calloutKind !==
|
|
905
|
+
Be.calloutKind !== W.None && Be.calloutKind !== W.Info && /* @__PURE__ */ B("div", {
|
|
906
906
|
className: "mt-3",
|
|
907
|
-
children: /* @__PURE__ */
|
|
908
|
-
type:
|
|
909
|
-
variant:
|
|
910
|
-
message:
|
|
911
|
-
replaceWarning:
|
|
912
|
-
noAccessError:
|
|
913
|
-
submitError:
|
|
907
|
+
children: /* @__PURE__ */ B(w, {
|
|
908
|
+
type: T.SectionMessage,
|
|
909
|
+
variant: Qe(Be.calloutKind),
|
|
910
|
+
message: et(Be.calloutKind, {
|
|
911
|
+
replaceWarning: pe,
|
|
912
|
+
noAccessError: $,
|
|
913
|
+
submitError: me,
|
|
914
914
|
folderName: Ve,
|
|
915
915
|
version: s?.version,
|
|
916
|
-
folderNameClassName:
|
|
916
|
+
folderNameClassName: U
|
|
917
917
|
})
|
|
918
918
|
})
|
|
919
919
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ B("div", {
|
|
921
921
|
className: "mt-4",
|
|
922
|
-
children: /* @__PURE__ */
|
|
922
|
+
children: /* @__PURE__ */ B(ee, {
|
|
923
923
|
id: Pe,
|
|
924
924
|
labelProps: { label: Ee },
|
|
925
|
-
placeholder:
|
|
926
|
-
caption:
|
|
925
|
+
placeholder: De,
|
|
926
|
+
caption: Oe,
|
|
927
927
|
value: j,
|
|
928
928
|
onChange: (e) => M(e ?? ""),
|
|
929
|
-
maxLength:
|
|
929
|
+
maxLength: Xe,
|
|
930
930
|
disabled: D
|
|
931
931
|
})
|
|
932
932
|
}),
|
|
933
|
-
|
|
933
|
+
N != null && /* @__PURE__ */ B("div", {
|
|
934
934
|
className: "mt-4",
|
|
935
|
-
children: /* @__PURE__ */
|
|
936
|
-
labelProps: { label:
|
|
935
|
+
children: /* @__PURE__ */ B(c, {
|
|
936
|
+
labelProps: { label: ke },
|
|
937
937
|
caption: je,
|
|
938
938
|
isSelected: te,
|
|
939
|
-
onChange:
|
|
939
|
+
onChange: N,
|
|
940
940
|
disabled: D
|
|
941
941
|
})
|
|
942
942
|
}),
|
|
943
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ B("div", {
|
|
944
944
|
className: "mt-4",
|
|
945
|
-
children: /* @__PURE__ */
|
|
946
|
-
rules:
|
|
947
|
-
onRulesChange:
|
|
948
|
-
sourceOptions:
|
|
945
|
+
children: /* @__PURE__ */ B(Ae, {
|
|
946
|
+
rules: P,
|
|
947
|
+
onRulesChange: I,
|
|
948
|
+
sourceOptions: R,
|
|
949
949
|
folderName: ze ? Ve : void 0,
|
|
950
950
|
disabled: D,
|
|
951
|
-
isLoading:
|
|
952
|
-
hasLoadError:
|
|
953
|
-
labels:
|
|
954
|
-
styles:
|
|
951
|
+
isLoading: z,
|
|
952
|
+
hasLoadError: ie,
|
|
953
|
+
labels: Ce,
|
|
954
|
+
styles: q
|
|
955
955
|
})
|
|
956
956
|
})
|
|
957
957
|
] })]
|
|
958
958
|
});
|
|
959
|
-
},
|
|
959
|
+
}, Qe = (e) => e === W.ReplaceWarning ? E.Warning : E.Error, $e = (e, t, n) => {
|
|
960
960
|
let [r, i, ...a] = e.split("{folder}");
|
|
961
|
-
return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ z
|
|
961
|
+
return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ V(z, { children: [
|
|
962
962
|
r,
|
|
963
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ B("strong", {
|
|
964
964
|
className: n,
|
|
965
965
|
children: t
|
|
966
966
|
}),
|
|
967
967
|
i
|
|
968
968
|
] });
|
|
969
|
-
},
|
|
970
|
-
let p = ne({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel:
|
|
971
|
-
return /* @__PURE__ */
|
|
969
|
+
}, et = (e, t) => e === W.ReplaceWarning ? $e(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === W.NoAccess ? $e(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, tt = { footer: "_footer_dks1v_1" }, nt = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = J.Main, onSelectFolder: c, isSelectFolderDisabled: l = !1, labels: d = {}, colors: f }) => {
|
|
970
|
+
let p = ne({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: _ = "Update version {version}", publishingInProgressLabel: v = "Publishing…", selectFolderLabel: ee = "Select" } = d, y = s === J.ChangeFolder, b = i ? v : n && t && e != null ? _.replace("{version}", e) : h;
|
|
971
|
+
return /* @__PURE__ */ V("div", {
|
|
972
972
|
style: p,
|
|
973
|
-
className:
|
|
974
|
-
children: [/* @__PURE__ */
|
|
973
|
+
className: L("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", tt.footer),
|
|
974
|
+
children: [/* @__PURE__ */ B(g, {
|
|
975
975
|
label: m,
|
|
976
976
|
className: "mobile:flex-1",
|
|
977
977
|
disabled: i,
|
|
978
978
|
onClick: a
|
|
979
|
-
}), y ? /* @__PURE__ */
|
|
980
|
-
label:
|
|
979
|
+
}), y ? /* @__PURE__ */ B(C, {
|
|
980
|
+
label: ee,
|
|
981
981
|
className: "mobile:flex-1",
|
|
982
|
-
disabled:
|
|
982
|
+
disabled: l,
|
|
983
983
|
onClick: c
|
|
984
|
-
}) : /* @__PURE__ */
|
|
984
|
+
}) : /* @__PURE__ */ B(C, {
|
|
985
985
|
label: b,
|
|
986
986
|
className: "mobile:flex-1",
|
|
987
987
|
disabled: r,
|
|
988
|
-
iconBefore: i ? /* @__PURE__ */
|
|
988
|
+
iconBefore: i ? /* @__PURE__ */ B("span", {
|
|
989
989
|
"aria-hidden": !0,
|
|
990
|
-
children: /* @__PURE__ */
|
|
990
|
+
children: /* @__PURE__ */ B(M, { size: u.SM })
|
|
991
991
|
}) : void 0,
|
|
992
992
|
onClick: o
|
|
993
993
|
})]
|
|
994
994
|
});
|
|
995
|
-
},
|
|
995
|
+
}, rt = {
|
|
996
996
|
backdrop: "_backdrop_16jmd_6",
|
|
997
997
|
panel: "_panel_16jmd_10",
|
|
998
998
|
divider: "_divider_16jmd_15",
|
|
999
999
|
content: "_content_16jmd_19",
|
|
1000
1000
|
title: "_title_16jmd_24"
|
|
1001
|
-
},
|
|
1002
|
-
let
|
|
1003
|
-
"--spp-backdrop-bg":
|
|
1004
|
-
"--spp-panel-bg":
|
|
1005
|
-
"--spp-panel-border":
|
|
1006
|
-
"--spp-divider-border":
|
|
1007
|
-
"--spp-scrollbar-thumb":
|
|
1008
|
-
"--spp-title-text":
|
|
1009
|
-
}), [
|
|
1001
|
+
}, it = ({ 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: v, onAuthorChange: ee, rules: y, onRulesChange: b, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: C = !1, onClose: w, returnFocusRef: T, onSubmit: E, panelLabels: D, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: A, panelCalloutFolderNameClassName: M, footerLabels: te, labels: N = {}, titleClassName: P = "dial-body-semi-text", colors: F }) => {
|
|
1002
|
+
let I = ne({
|
|
1003
|
+
"--spp-backdrop-bg": F?.backdropBackground,
|
|
1004
|
+
"--spp-panel-bg": F?.panelBackground,
|
|
1005
|
+
"--spp-panel-border": F?.panelBorder,
|
|
1006
|
+
"--spp-divider-border": F?.dividerBorder,
|
|
1007
|
+
"--spp-scrollbar-thumb": F?.scrollbarThumb,
|
|
1008
|
+
"--spp-title-text": F?.titleText
|
|
1009
|
+
}), [R, z] = a(null), { title: re = "Publish", changeFolderTitle: ie = "Change folder", backAriaLabel: ae = "Back", ariaLabel: oe = "Publish", closeAriaLabel: se = "Close" } = N, H = de({
|
|
1010
1010
|
isOpen: e,
|
|
1011
1011
|
selectedFolderPath: s,
|
|
1012
1012
|
onSelectedFolderPathChange: c
|
|
1013
|
-
}),
|
|
1013
|
+
}), U = H.view === J.ChangeFolder, W = r(() => G({
|
|
1014
1014
|
hasSelectedFolder: s != null,
|
|
1015
1015
|
hasExistingPublicationInFolder: p,
|
|
1016
1016
|
hasWriteAccess: m,
|
|
@@ -1026,7 +1026,7 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1026
1026
|
_
|
|
1027
1027
|
]);
|
|
1028
1028
|
return t(() => {
|
|
1029
|
-
let t =
|
|
1029
|
+
let t = R?.closest("[role=\"dialog\"]");
|
|
1030
1030
|
if (!e || !t) return;
|
|
1031
1031
|
let n = () => t.focus({ preventScroll: !0 });
|
|
1032
1032
|
n();
|
|
@@ -1042,33 +1042,33 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1042
1042
|
};
|
|
1043
1043
|
}, [
|
|
1044
1044
|
e,
|
|
1045
|
-
|
|
1045
|
+
R,
|
|
1046
1046
|
T
|
|
1047
|
-
]), /* @__PURE__ */
|
|
1047
|
+
]), /* @__PURE__ */ V(j, {
|
|
1048
1048
|
open: e,
|
|
1049
1049
|
onClose: w,
|
|
1050
|
-
header: /* @__PURE__ */
|
|
1051
|
-
className:
|
|
1052
|
-
children:
|
|
1050
|
+
header: /* @__PURE__ */ B("span", {
|
|
1051
|
+
className: L("block truncate text-center", P, rt.title),
|
|
1052
|
+
children: U ? ie : re
|
|
1053
1053
|
}),
|
|
1054
|
-
ariaLabel:
|
|
1055
|
-
onBack:
|
|
1056
|
-
backAriaLabel:
|
|
1054
|
+
ariaLabel: oe,
|
|
1055
|
+
onBack: U ? H.backToMain : void 0,
|
|
1056
|
+
backAriaLabel: ae,
|
|
1057
1057
|
backDisabled: h,
|
|
1058
|
-
closeAriaLabel:
|
|
1058
|
+
closeAriaLabel: se,
|
|
1059
1059
|
closeDisabled: h,
|
|
1060
|
-
style:
|
|
1061
|
-
overlayStyle:
|
|
1062
|
-
className:
|
|
1063
|
-
overlayClassName:
|
|
1064
|
-
headerClassName:
|
|
1060
|
+
style: I,
|
|
1061
|
+
overlayStyle: I,
|
|
1062
|
+
className: L(rt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
|
|
1063
|
+
overlayClassName: rt.backdrop,
|
|
1064
|
+
headerClassName: L("px-[22px]", rt.divider),
|
|
1065
1065
|
bodyClassName: "flex flex-col overflow-hidden",
|
|
1066
|
-
children: [/* @__PURE__ */
|
|
1067
|
-
ref:
|
|
1068
|
-
className:
|
|
1069
|
-
children: /* @__PURE__ */
|
|
1066
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1067
|
+
ref: z,
|
|
1068
|
+
className: L("min-h-0 flex-1 overflow-y-auto", rt.content),
|
|
1069
|
+
children: /* @__PURE__ */ B("div", {
|
|
1070
1070
|
className: "p-[22px]",
|
|
1071
|
-
children: /* @__PURE__ */
|
|
1071
|
+
children: /* @__PURE__ */ B(Ze, {
|
|
1072
1072
|
resource: n,
|
|
1073
1073
|
renderSummary: i,
|
|
1074
1074
|
view: H.view,
|
|
@@ -1086,8 +1086,8 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1086
1086
|
isSubmitting: h,
|
|
1087
1087
|
hasSubmitError: g,
|
|
1088
1088
|
allowReplace: _,
|
|
1089
|
-
author:
|
|
1090
|
-
onAuthorChange:
|
|
1089
|
+
author: v,
|
|
1090
|
+
onAuthorChange: ee,
|
|
1091
1091
|
rules: y,
|
|
1092
1092
|
onRulesChange: b,
|
|
1093
1093
|
ruleSourceOptions: x,
|
|
@@ -1096,17 +1096,17 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1096
1096
|
labels: D,
|
|
1097
1097
|
styles: O,
|
|
1098
1098
|
summaryTitleClassName: k,
|
|
1099
|
-
headingClassName:
|
|
1099
|
+
headingClassName: A,
|
|
1100
1100
|
calloutFolderNameClassName: M
|
|
1101
1101
|
})
|
|
1102
1102
|
})
|
|
1103
|
-
}), /* @__PURE__ */
|
|
1103
|
+
}), /* @__PURE__ */ B(nt, {
|
|
1104
1104
|
version: n?.version,
|
|
1105
1105
|
hasExistingPublicationInFolder: p,
|
|
1106
1106
|
allowReplace: _,
|
|
1107
|
-
isSubmitDisabled:
|
|
1108
|
-
isSubmitLoading:
|
|
1109
|
-
onCancel:
|
|
1107
|
+
isSubmitDisabled: W.isSubmitDisabled,
|
|
1108
|
+
isSubmitLoading: W.isSubmitLoading,
|
|
1109
|
+
onCancel: U ? H.backToMain : w,
|
|
1110
1110
|
onSubmit: E,
|
|
1111
1111
|
view: H.view,
|
|
1112
1112
|
onSelectFolder: H.selectFolder,
|
|
@@ -1114,54 +1114,87 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1114
1114
|
labels: te
|
|
1115
1115
|
})]
|
|
1116
1116
|
});
|
|
1117
|
-
},
|
|
1117
|
+
}, at = { option: "_option_skygm_1" }, ot = (e, t) => `Unpublish "${e}" from "${t}"?`, st = (e) => `Choose which folder to unpublish "${e}" from.`, ct = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: c, onConfirm: u, onClose: d }) => {
|
|
1118
|
+
let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = ot, selectFolderMessage: ee = st } = o ?? {}, y = n.length > 1;
|
|
1119
|
+
return /* @__PURE__ */ B(P, {
|
|
1120
|
+
open: e,
|
|
1121
|
+
title: f,
|
|
1122
|
+
confirmLabel: p,
|
|
1123
|
+
cancelLabel: m,
|
|
1124
|
+
variant: l.Danger,
|
|
1125
|
+
isLoading: a,
|
|
1126
|
+
isConfirmDisabled: y && r == null,
|
|
1127
|
+
loadingStatusLabel: _,
|
|
1128
|
+
message: /* @__PURE__ */ B("span", {
|
|
1129
|
+
className: "wrap-break-word",
|
|
1130
|
+
children: y ? ee(t) : v(t, he(n[0] ?? "", h))
|
|
1131
|
+
}),
|
|
1132
|
+
onConfirm: u,
|
|
1133
|
+
onClose: d,
|
|
1134
|
+
children: y && /* @__PURE__ */ B("div", {
|
|
1135
|
+
className: "mt-3",
|
|
1136
|
+
style: ne({ "--ucd-option-text": c?.optionText }),
|
|
1137
|
+
children: /* @__PURE__ */ B(O, {
|
|
1138
|
+
ariaLabel: g,
|
|
1139
|
+
value: r ?? void 0,
|
|
1140
|
+
onChange: i,
|
|
1141
|
+
disabled: a,
|
|
1142
|
+
items: n.map((e) => ({
|
|
1143
|
+
value: e,
|
|
1144
|
+
label: he(e, h)
|
|
1145
|
+
})),
|
|
1146
|
+
radioClassName: L(s, at.option)
|
|
1147
|
+
})
|
|
1148
|
+
})
|
|
1149
|
+
});
|
|
1150
|
+
}, lt = /* @__PURE__ */ function(e) {
|
|
1118
1151
|
return e.Keep = "keep", e.New = "new", e;
|
|
1119
|
-
}({}),
|
|
1152
|
+
}({}), ut = /* @__PURE__ */ function(e) {
|
|
1120
1153
|
return e.Main = "main", e.ChangeFolder = "change-folder", e;
|
|
1121
|
-
}({}),
|
|
1154
|
+
}({}), dt = {
|
|
1122
1155
|
heading: "_heading_vk731_1",
|
|
1123
1156
|
destination: "_destination_vk731_5"
|
|
1124
|
-
},
|
|
1125
|
-
let { saveToFolderHeading: te = "Save to folder", changeFolderLabel:
|
|
1157
|
+
}, ft = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: c, changeFolderButtonRef: l, pendingDestination: f, onPendingDestinationChange: _, version: v, accessRules: x, isSubmitting: C = !1, submitError: w, foldersError: T, onRetryFolders: E, panelLabels: D = {}, panelStyles: A = {}, headingClassName: j = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
|
|
1158
|
+
let { saveToFolderHeading: te = "Save to folder", changeFolderLabel: N = "Change", destinationAriaLabel: P = "Destination folder", versionHeading: I = "Version", keepVersionLabel: R = "Keep version {version}", saveAsNewVersionLabel: z = "Save as new version", newVersionLabel: ie = "Version", newVersionPlaceholder: ae = "Enter new version", searchPlaceholder: oe = "Search folders", clearSearchAriaLabel: se = "Clear search", folderEmptyStateLabel: H, createFolderLabel: U, cancelCreatingFolderLabel: W, addSiblingFolderLabel: G, addChildFolderLabel: ce, createFolderEmptyNameError: K, createFolderInvalidNameError: le, createFolderDuplicateNameError: q, retryLabel: ue = "Retry" } = D, { colors: J, folderTree: de } = A, Y = {
|
|
1126
1159
|
...ne({
|
|
1127
1160
|
"--stf-heading-text": J?.headingText,
|
|
1128
1161
|
"--stf-destination-text": J?.destinationText
|
|
1129
1162
|
}),
|
|
1130
1163
|
...A.cssVars
|
|
1131
|
-
},
|
|
1164
|
+
}, X = {
|
|
1132
1165
|
border: J?.summaryBorder,
|
|
1133
1166
|
background: J?.summaryBackground
|
|
1134
|
-
}, [
|
|
1135
|
-
if (e ===
|
|
1167
|
+
}, [fe, Z] = a(""), Q = n(), pe = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), $ = i.find((e) => e.key === f?.rootKey), me = f ? f.path[f.path.length - 1] ?? $?.label : void 0, he = L(j, dt.heading);
|
|
1168
|
+
if (e === ut.ChangeFolder) return /* @__PURE__ */ V("div", {
|
|
1136
1169
|
className: "flex flex-col gap-3",
|
|
1137
1170
|
style: Y,
|
|
1138
1171
|
children: [
|
|
1139
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ B("div", {
|
|
1140
1173
|
role: "search",
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1142
|
-
value:
|
|
1143
|
-
onChange: (e) =>
|
|
1144
|
-
placeholder:
|
|
1145
|
-
clearLabel:
|
|
1146
|
-
"aria-label":
|
|
1174
|
+
children: /* @__PURE__ */ B(k, {
|
|
1175
|
+
value: fe,
|
|
1176
|
+
onChange: (e) => Z(e ?? ""),
|
|
1177
|
+
placeholder: oe,
|
|
1178
|
+
clearLabel: se,
|
|
1179
|
+
"aria-label": oe
|
|
1147
1180
|
})
|
|
1148
1181
|
}),
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
politeness:
|
|
1151
|
-
children: T && /* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ B(b, {
|
|
1183
|
+
politeness: S.Assertive,
|
|
1184
|
+
children: T && /* @__PURE__ */ V("div", {
|
|
1152
1185
|
className: "flex flex-wrap items-center gap-2",
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1186
|
+
children: [/* @__PURE__ */ B(m, { text: T }), E && /* @__PURE__ */ B(y, {
|
|
1154
1187
|
label: ue,
|
|
1155
1188
|
onClick: E
|
|
1156
1189
|
})]
|
|
1157
1190
|
})
|
|
1158
1191
|
}),
|
|
1159
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ B(qe, {
|
|
1160
1193
|
roots: i,
|
|
1161
|
-
destination:
|
|
1194
|
+
destination: f,
|
|
1162
1195
|
onDestinationChange: _,
|
|
1163
1196
|
onCreateDestinationFolder: s,
|
|
1164
|
-
searchQuery:
|
|
1197
|
+
searchQuery: fe,
|
|
1165
1198
|
disabled: C,
|
|
1166
1199
|
noResultsLabel: H,
|
|
1167
1200
|
createFolderLabel: U,
|
|
@@ -1173,54 +1206,54 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1173
1206
|
duplicateFolderNameError: q,
|
|
1174
1207
|
styles: de
|
|
1175
1208
|
}),
|
|
1176
|
-
|
|
1209
|
+
x && $?.hasAccessRules && /* @__PURE__ */ B("div", {
|
|
1177
1210
|
className: "mt-1",
|
|
1178
|
-
children: /* @__PURE__ */
|
|
1179
|
-
rules:
|
|
1180
|
-
onRulesChange:
|
|
1181
|
-
sourceOptions:
|
|
1182
|
-
folderName:
|
|
1211
|
+
children: /* @__PURE__ */ B(Ae, {
|
|
1212
|
+
rules: x.rules,
|
|
1213
|
+
onRulesChange: x.onRulesChange,
|
|
1214
|
+
sourceOptions: x.sourceOptions,
|
|
1215
|
+
folderName: me,
|
|
1183
1216
|
disabled: C,
|
|
1184
|
-
isLoading:
|
|
1185
|
-
hasLoadError:
|
|
1186
|
-
labels:
|
|
1187
|
-
styles:
|
|
1217
|
+
isLoading: x.isLoading,
|
|
1218
|
+
hasLoadError: x.hasLoadError,
|
|
1219
|
+
labels: x.labels,
|
|
1220
|
+
styles: x.styles
|
|
1188
1221
|
})
|
|
1189
1222
|
})
|
|
1190
1223
|
]
|
|
1191
1224
|
});
|
|
1192
|
-
let
|
|
1193
|
-
value:
|
|
1194
|
-
label:
|
|
1225
|
+
let ge = v ? [{
|
|
1226
|
+
value: lt.Keep,
|
|
1227
|
+
label: R.replace("{version}", v.currentVersion)
|
|
1195
1228
|
}, {
|
|
1196
|
-
value:
|
|
1197
|
-
label:
|
|
1198
|
-
content: /* @__PURE__ */
|
|
1199
|
-
id:
|
|
1200
|
-
value:
|
|
1201
|
-
onChange: (e) =>
|
|
1202
|
-
onBlur:
|
|
1229
|
+
value: lt.New,
|
|
1230
|
+
label: z,
|
|
1231
|
+
content: /* @__PURE__ */ B(ee, {
|
|
1232
|
+
id: Q,
|
|
1233
|
+
value: v.newVersion,
|
|
1234
|
+
onChange: (e) => v.onNewVersionChange(e ?? ""),
|
|
1235
|
+
onBlur: v.onNewVersionBlur,
|
|
1203
1236
|
labelProps: {
|
|
1204
|
-
label:
|
|
1237
|
+
label: ie,
|
|
1205
1238
|
required: !0
|
|
1206
1239
|
},
|
|
1207
|
-
placeholder:
|
|
1208
|
-
error:
|
|
1209
|
-
invalid: !!
|
|
1240
|
+
placeholder: ae,
|
|
1241
|
+
error: v.newVersionError,
|
|
1242
|
+
invalid: !!v.newVersionError,
|
|
1210
1243
|
disabled: C
|
|
1211
1244
|
})
|
|
1212
1245
|
}] : [];
|
|
1213
|
-
return /* @__PURE__ */
|
|
1246
|
+
return /* @__PURE__ */ V("div", {
|
|
1214
1247
|
className: "flex flex-col gap-5",
|
|
1215
1248
|
style: Y,
|
|
1216
1249
|
children: [
|
|
1217
|
-
t.type == null ? /* @__PURE__ */
|
|
1218
|
-
colors:
|
|
1219
|
-
children: /* @__PURE__ */
|
|
1220
|
-
className:
|
|
1250
|
+
t.type == null ? /* @__PURE__ */ B(F, {
|
|
1251
|
+
colors: X,
|
|
1252
|
+
children: /* @__PURE__ */ B("span", {
|
|
1253
|
+
className: L("truncate", he),
|
|
1221
1254
|
children: t.title
|
|
1222
1255
|
})
|
|
1223
|
-
}) : /* @__PURE__ */
|
|
1256
|
+
}) : /* @__PURE__ */ B(F, {
|
|
1224
1257
|
item: {
|
|
1225
1258
|
type: t.type,
|
|
1226
1259
|
name: t.title,
|
|
@@ -1228,30 +1261,30 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1228
1261
|
iconUrl: t.iconUrl
|
|
1229
1262
|
},
|
|
1230
1263
|
hasVersionTag: !1,
|
|
1231
|
-
colors:
|
|
1264
|
+
colors: X
|
|
1232
1265
|
}),
|
|
1233
|
-
/* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ V("section", {
|
|
1234
1267
|
className: "flex flex-col gap-2",
|
|
1235
|
-
children: [/* @__PURE__ */
|
|
1236
|
-
className:
|
|
1268
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
1269
|
+
className: he,
|
|
1237
1270
|
children: te
|
|
1238
|
-
}), /* @__PURE__ */
|
|
1271
|
+
}), /* @__PURE__ */ V("div", {
|
|
1239
1272
|
className: "flex min-w-0 items-center gap-2",
|
|
1240
|
-
children: [/* @__PURE__ */
|
|
1273
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1241
1274
|
role: "group",
|
|
1242
|
-
"aria-label":
|
|
1275
|
+
"aria-label": P,
|
|
1243
1276
|
className: "min-w-0 flex-1",
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1245
|
-
name:
|
|
1246
|
-
nameClassName:
|
|
1277
|
+
children: /* @__PURE__ */ B(h, {
|
|
1278
|
+
name: pe.join(" / "),
|
|
1279
|
+
nameClassName: L(M, dt.destination)
|
|
1247
1280
|
})
|
|
1248
|
-
}), /* @__PURE__ */
|
|
1249
|
-
ref:
|
|
1250
|
-
size:
|
|
1251
|
-
label:
|
|
1252
|
-
iconBefore: /* @__PURE__ */
|
|
1253
|
-
size:
|
|
1254
|
-
stroke:
|
|
1281
|
+
}), /* @__PURE__ */ B(g, {
|
|
1282
|
+
ref: l,
|
|
1283
|
+
size: p.Small,
|
|
1284
|
+
label: N,
|
|
1285
|
+
iconBefore: /* @__PURE__ */ B(re, {
|
|
1286
|
+
size: u.SM,
|
|
1287
|
+
stroke: d,
|
|
1255
1288
|
"aria-hidden": !0
|
|
1256
1289
|
}),
|
|
1257
1290
|
disabled: C,
|
|
@@ -1259,115 +1292,115 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1259
1292
|
})]
|
|
1260
1293
|
})]
|
|
1261
1294
|
}),
|
|
1262
|
-
|
|
1295
|
+
v && /* @__PURE__ */ V("section", {
|
|
1263
1296
|
className: "flex flex-col gap-2",
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1265
|
-
className:
|
|
1266
|
-
children:
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1268
|
-
ariaLabel:
|
|
1269
|
-
value:
|
|
1270
|
-
onChange: (e) =>
|
|
1271
|
-
items:
|
|
1297
|
+
children: [/* @__PURE__ */ B("h2", {
|
|
1298
|
+
className: he,
|
|
1299
|
+
children: I
|
|
1300
|
+
}), /* @__PURE__ */ B(O, {
|
|
1301
|
+
ariaLabel: I,
|
|
1302
|
+
value: v.versionMode,
|
|
1303
|
+
onChange: (e) => v.onVersionModeChange(e),
|
|
1304
|
+
items: ge,
|
|
1272
1305
|
disabled: C
|
|
1273
1306
|
})]
|
|
1274
1307
|
}),
|
|
1275
|
-
/* @__PURE__ */
|
|
1276
|
-
politeness:
|
|
1277
|
-
children: w && /* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ B(b, {
|
|
1309
|
+
politeness: S.Assertive,
|
|
1310
|
+
children: w && /* @__PURE__ */ B(m, { text: w })
|
|
1278
1311
|
})
|
|
1279
1312
|
]
|
|
1280
1313
|
});
|
|
1281
|
-
},
|
|
1314
|
+
}, pt = {
|
|
1282
1315
|
backdrop: "_backdrop_1ie8s_6",
|
|
1283
1316
|
panel: "_panel_1ie8s_10",
|
|
1284
1317
|
divider: "_divider_1ie8s_15",
|
|
1285
1318
|
footer: "_footer_1ie8s_19",
|
|
1286
1319
|
content: "_content_1ie8s_23",
|
|
1287
1320
|
title: "_title_1ie8s_28"
|
|
1288
|
-
},
|
|
1289
|
-
let { title:
|
|
1290
|
-
"--sstf-backdrop-bg":
|
|
1291
|
-
"--sstf-panel-bg":
|
|
1292
|
-
"--sstf-panel-border":
|
|
1293
|
-
"--sstf-divider-border":
|
|
1294
|
-
"--sstf-scrollbar-thumb":
|
|
1295
|
-
"--sstf-title-text":
|
|
1296
|
-
}), [O, k] = a(
|
|
1321
|
+
}, mt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: l, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: h, ..._ }) => {
|
|
1322
|
+
let { title: v = "Save", changeFolderTitle: ee = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: b = "Back", cancelLabel: x = "Cancel", saveLabel: S = "Save", savingLabel: w = "Saving…", selectLabel: T = "Select" } = c, E = ne({
|
|
1323
|
+
"--sstf-backdrop-bg": l?.backdropBackground,
|
|
1324
|
+
"--sstf-panel-bg": l?.panelBackground,
|
|
1325
|
+
"--sstf-panel-border": l?.panelBorder,
|
|
1326
|
+
"--sstf-divider-border": l?.dividerBorder,
|
|
1327
|
+
"--sstf-scrollbar-thumb": l?.scrollbarThumb,
|
|
1328
|
+
"--sstf-title-text": l?.titleText
|
|
1329
|
+
}), [O, k] = a(ut.Main), [A, te] = a(f), N = i(null), P = i(null);
|
|
1297
1330
|
t(() => {
|
|
1298
|
-
e && k(
|
|
1331
|
+
e && k(ut.Main);
|
|
1299
1332
|
}, [e]);
|
|
1300
|
-
let
|
|
1333
|
+
let F = i(O);
|
|
1301
1334
|
t(() => {
|
|
1302
|
-
|
|
1335
|
+
F.current !== O && (F.current = O, O === ut.ChangeFolder ? N.current?.focus({ preventScroll: !0 }) : P.current?.focus({ preventScroll: !0 }));
|
|
1303
1336
|
}, [O]);
|
|
1304
|
-
let
|
|
1337
|
+
let I = i(e);
|
|
1305
1338
|
t(() => {
|
|
1306
|
-
let t =
|
|
1307
|
-
|
|
1339
|
+
let t = I.current;
|
|
1340
|
+
I.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
|
|
1308
1341
|
}, [e, s]);
|
|
1309
|
-
let
|
|
1310
|
-
te(e),
|
|
1342
|
+
let R = O === ut.ChangeFolder, z = (e) => {
|
|
1343
|
+
te(e), h?.(e);
|
|
1344
|
+
}, re = () => {
|
|
1345
|
+
z(f), k(ut.ChangeFolder);
|
|
1311
1346
|
}, ie = () => {
|
|
1312
|
-
|
|
1347
|
+
h?.(f), k(ut.Main);
|
|
1313
1348
|
}, ae = () => {
|
|
1314
|
-
|
|
1315
|
-
}, oe = () => {
|
|
1316
|
-
M && p(M), k(rt.Main);
|
|
1349
|
+
A && p(A), k(ut.Main);
|
|
1317
1350
|
};
|
|
1318
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ V(j, {
|
|
1319
1352
|
open: e,
|
|
1320
1353
|
onClose: n,
|
|
1321
|
-
header: /* @__PURE__ */
|
|
1354
|
+
header: /* @__PURE__ */ B("span", {
|
|
1322
1355
|
ref: N,
|
|
1323
1356
|
tabIndex: -1,
|
|
1324
|
-
className:
|
|
1325
|
-
children:
|
|
1357
|
+
className: L("block truncate outline-none", d, pt.title),
|
|
1358
|
+
children: R ? ee : v
|
|
1326
1359
|
}),
|
|
1327
|
-
ariaLabel:
|
|
1328
|
-
onBack:
|
|
1360
|
+
ariaLabel: v,
|
|
1361
|
+
onBack: R ? ie : void 0,
|
|
1329
1362
|
backAriaLabel: b,
|
|
1330
1363
|
backDisabled: m,
|
|
1331
1364
|
closeAriaLabel: y,
|
|
1332
1365
|
closeDisabled: m,
|
|
1333
|
-
style:
|
|
1334
|
-
overlayStyle:
|
|
1335
|
-
className:
|
|
1336
|
-
overlayClassName:
|
|
1337
|
-
headerClassName:
|
|
1366
|
+
style: E,
|
|
1367
|
+
overlayStyle: E,
|
|
1368
|
+
className: L(pt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
|
|
1369
|
+
overlayClassName: pt.backdrop,
|
|
1370
|
+
headerClassName: L("px-[22px]", pt.divider),
|
|
1338
1371
|
bodyClassName: "flex flex-col overflow-hidden",
|
|
1339
|
-
children: [/* @__PURE__ */
|
|
1340
|
-
className:
|
|
1341
|
-
children: /* @__PURE__ */
|
|
1372
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1373
|
+
className: L("min-h-0 flex-1 overflow-y-auto p-[22px]", pt.content),
|
|
1374
|
+
children: /* @__PURE__ */ B(ft, {
|
|
1342
1375
|
..._,
|
|
1343
1376
|
view: O,
|
|
1344
1377
|
destination: f,
|
|
1345
1378
|
onDestinationChange: p,
|
|
1346
1379
|
isSubmitting: m,
|
|
1347
|
-
onChangeFolderClick:
|
|
1380
|
+
onChangeFolderClick: re,
|
|
1348
1381
|
changeFolderButtonRef: P,
|
|
1349
|
-
pendingDestination:
|
|
1350
|
-
onPendingDestinationChange:
|
|
1382
|
+
pendingDestination: A,
|
|
1383
|
+
onPendingDestinationChange: z
|
|
1351
1384
|
})
|
|
1352
|
-
}), /* @__PURE__ */
|
|
1353
|
-
className:
|
|
1354
|
-
children: [/* @__PURE__ */
|
|
1385
|
+
}), /* @__PURE__ */ V("div", {
|
|
1386
|
+
className: L("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", pt.footer),
|
|
1387
|
+
children: [/* @__PURE__ */ B(g, {
|
|
1355
1388
|
label: x,
|
|
1356
1389
|
className: "mobile:flex-1",
|
|
1357
1390
|
disabled: m,
|
|
1358
|
-
onClick:
|
|
1359
|
-
}),
|
|
1391
|
+
onClick: R ? ie : n
|
|
1392
|
+
}), R ? /* @__PURE__ */ B(C, {
|
|
1360
1393
|
label: T,
|
|
1361
1394
|
className: "mobile:flex-1",
|
|
1362
|
-
disabled:
|
|
1363
|
-
onClick:
|
|
1364
|
-
}) : /* @__PURE__ */
|
|
1365
|
-
label: m ? w :
|
|
1395
|
+
disabled: A == null,
|
|
1396
|
+
onClick: ae
|
|
1397
|
+
}) : /* @__PURE__ */ B(D, {
|
|
1398
|
+
label: m ? w : S,
|
|
1366
1399
|
className: "mobile:flex-1",
|
|
1367
1400
|
disabled: o || m,
|
|
1368
|
-
iconBefore: m ? /* @__PURE__ */
|
|
1401
|
+
iconBefore: m ? /* @__PURE__ */ B("span", {
|
|
1369
1402
|
"aria-hidden": !0,
|
|
1370
|
-
children: /* @__PURE__ */
|
|
1403
|
+
children: /* @__PURE__ */ B(M, { size: u.SM })
|
|
1371
1404
|
}) : void 0,
|
|
1372
1405
|
onClick: r
|
|
1373
1406
|
})]
|
|
@@ -1375,4 +1408,4 @@ var V = /* @__PURE__ */ function(e) {
|
|
|
1375
1408
|
});
|
|
1376
1409
|
};
|
|
1377
1410
|
//#endregion
|
|
1378
|
-
export {
|
|
1411
|
+
export { Je as PUBLISH_PANEL_CLASS, U as PublicationRuleFunction, Ee as PublishAccessRuleEditor, Ae as PublishAccessRules, W as PublishCalloutKind, qe as PublishFoldersTree, nt as PublishFooter, Me as PublishHistoryList, Ze as PublishPanel, J as PublishPanelView, ft as SaveToFolderPanel, ut as SaveToFolderView, lt as SaveVersionMode, it as StandalonePublishPanel, mt as StandaloneSaveToFolderPanel, ct as UnpublishConfirmationDialog, pe as collectFolderKeys, G as derivePublishState, Y as filterFolderTree, K as formatPublishedDate, me as fromFolderPathKey, be as getSiblingFolderNames, ye as getUniqueFolderName, Q as mergeFolderPaths, fe as sortFolderTree, ge as toDialFileTree, $ as toFolderPathKey, ue as usePublishFlow, de as usePublishFolderView, ve as validateFolderName };
|