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