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