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