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