@epam/ai-dial-publish-panel 1.3.0-dev.16 → 1.3.0-dev.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts.map +1 -1
- package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +1 -1
- package/components/PublishPanel/PublishFooter.d.ts +2 -0
- package/components/PublishPanel/PublishFooter.d.ts.map +1 -1
- package/components/PublishPanel/PublishPanel.d.ts +2 -2
- package/components/PublishPanel/StandalonePublishPanel.d.ts +2 -1
- package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
- package/index.css +2 -1
- package/index.js +514 -510
- package/models/publish-access-rule-editor.d.ts +1 -1
- package/models/publish-access-rule-editor.d.ts.map +1 -1
- package/models/publish.d.ts +3 -3
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
-
import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u,
|
|
3
|
-
import { ResourceSummary as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { IconFolderPlus as
|
|
6
|
-
import { DialFileNodeType as
|
|
2
|
+
import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, ErrorText as d, GhostButton as f, GhostIconButton as p, Highlight as m, Input as h, NeutralButton as g, Notification as _, NotificationType as ee, NotificationVariant as v, Search as te, Select as y, SideDrawer as b, Spinner as x, Tag as S, TagInput as ne } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { ResourceSummary as C, TAG_INPUT_TAG_CLASS_NAME as w, buildCssVars as T, mergeClasses as E } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
5
|
+
import { 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 A = /* @__PURE__ */ function(e) {
|
|
9
9
|
return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
|
|
10
|
-
}({}),
|
|
10
|
+
}({}), j = /* @__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
|
+
}({}), M = (e) => e.isSubmitting ? {
|
|
13
|
+
calloutKind: j.None,
|
|
14
14
|
isSubmitDisabled: !0,
|
|
15
15
|
isSubmitLoading: !0
|
|
16
16
|
} : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
|
|
17
|
-
calloutKind:
|
|
17
|
+
calloutKind: j.SubmitError,
|
|
18
18
|
isSubmitDisabled: !1,
|
|
19
19
|
isSubmitLoading: !1
|
|
20
20
|
} : e.hasExistingPublicationInFolder ? {
|
|
21
|
-
calloutKind:
|
|
21
|
+
calloutKind: j.ReplaceWarning,
|
|
22
22
|
isSubmitDisabled: e.allowReplace === !1,
|
|
23
23
|
isSubmitLoading: !1
|
|
24
24
|
} : {
|
|
25
|
-
calloutKind:
|
|
25
|
+
calloutKind: j.Info,
|
|
26
26
|
isSubmitDisabled: !1,
|
|
27
27
|
isSubmitLoading: !1
|
|
28
28
|
} : {
|
|
29
|
-
calloutKind:
|
|
29
|
+
calloutKind: j.NoAccess,
|
|
30
30
|
isSubmitDisabled: !0,
|
|
31
31
|
isSubmitLoading: !1
|
|
32
32
|
} : {
|
|
33
|
-
calloutKind:
|
|
33
|
+
calloutKind: j.None,
|
|
34
34
|
isSubmitDisabled: !0,
|
|
35
35
|
isSubmitLoading: !1
|
|
36
|
-
},
|
|
37
|
-
let r = Math.floor((t - e) /
|
|
36
|
+
}, N = 864e5, P = (e, t = Date.now(), n) => {
|
|
37
|
+
let r = Math.floor((t - e) / N);
|
|
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
|
+
}, ce = (e, t, n) => t.length === 0 ? [...e, {
|
|
44
44
|
path: [n],
|
|
45
45
|
name: n
|
|
46
46
|
}] : e.map((e) => e.path.join("/") === t.join("/") ? {
|
|
@@ -51,310 +51,305 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
51
51
|
}]
|
|
52
52
|
} : {
|
|
53
53
|
...e,
|
|
54
|
-
children: e.children ?
|
|
55
|
-
}),
|
|
54
|
+
children: e.children ? ce(e.children, t, n) : e.children
|
|
55
|
+
}), F = (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 ? F(e.children, t, n) : e.children
|
|
63
63
|
});
|
|
64
|
-
},
|
|
64
|
+
}, I = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
|
|
65
65
|
let [m, h] = a(o);
|
|
66
66
|
t(() => {
|
|
67
67
|
h(o);
|
|
68
68
|
}, [o]);
|
|
69
|
-
let [g, _] = a(), [
|
|
69
|
+
let [g, _] = a(), [ee, v] = a(!1), [te, y] = a(!1), [b, x] = a([]), [S, ne] = a(!1), [C, w] = a(!1), [T, E] = a(c), [D, O] = a(!1), [k, re] = a(!1);
|
|
70
70
|
t(() => {
|
|
71
|
-
|
|
72
|
-
}, [c,
|
|
73
|
-
let
|
|
74
|
-
|
|
71
|
+
k || E(c);
|
|
72
|
+
}, [c, k]);
|
|
73
|
+
let ie = e((e) => {
|
|
74
|
+
re(!0), E(e);
|
|
75
75
|
}, []);
|
|
76
76
|
t(() => {
|
|
77
77
|
if (g == null) {
|
|
78
|
-
|
|
78
|
+
x([]), w(!1);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
if (!p) return;
|
|
82
82
|
let e = !1;
|
|
83
|
-
return
|
|
84
|
-
e ||
|
|
83
|
+
return ne(!0), w(!1), p(g).then((t) => {
|
|
84
|
+
e || x(t);
|
|
85
85
|
}).catch(() => {
|
|
86
|
-
e ||
|
|
86
|
+
e || w(!0);
|
|
87
87
|
}).finally(() => {
|
|
88
|
-
e ||
|
|
88
|
+
e || ne(!1);
|
|
89
89
|
}), () => {
|
|
90
90
|
e = !0;
|
|
91
91
|
};
|
|
92
92
|
}, [g]);
|
|
93
|
-
let
|
|
93
|
+
let ae = 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
|
+
]), oe = e(async (e, t) => {
|
|
102
|
+
h((n) => ce(n, e, t));
|
|
103
103
|
try {
|
|
104
104
|
await l?.(e, t);
|
|
105
105
|
} catch {
|
|
106
|
-
h((n) =>
|
|
106
|
+
h((n) => F(n, e, t)), y(!0);
|
|
107
107
|
}
|
|
108
|
-
}, [l]),
|
|
108
|
+
}, [l]), se = e(async () => {
|
|
109
109
|
if (!g) return !1;
|
|
110
|
-
|
|
110
|
+
v(!0), y(!1);
|
|
111
111
|
try {
|
|
112
|
-
return await u(n, g,
|
|
112
|
+
return await u(n, g, b, T.trim(), D), d?.(n, g), !0;
|
|
113
113
|
} catch (e) {
|
|
114
|
-
return
|
|
114
|
+
return y(!0), f?.(n, g, e), !1;
|
|
115
115
|
} finally {
|
|
116
|
-
|
|
116
|
+
v(!1);
|
|
117
117
|
}
|
|
118
118
|
}, [
|
|
119
|
-
|
|
119
|
+
T,
|
|
120
120
|
n,
|
|
121
121
|
u,
|
|
122
122
|
f,
|
|
123
123
|
d,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
D,
|
|
125
|
+
b,
|
|
126
126
|
g
|
|
127
|
-
]),
|
|
128
|
-
h(o), _(void 0),
|
|
127
|
+
]), A = e(() => {
|
|
128
|
+
h(o), _(void 0), y(!1), x([]), w(!1), E(c), re(!1), O(!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:
|
|
143
|
-
author:
|
|
144
|
-
setAuthor:
|
|
145
|
-
publishCredentials:
|
|
146
|
-
setPublishCredentials:
|
|
147
|
-
isRulesLoading:
|
|
148
|
-
hasRulesLoadError:
|
|
134
|
+
handleCreateFolder: oe,
|
|
135
|
+
hasExistingPublicationInFolder: ae,
|
|
136
|
+
hasWriteAccess: !g || s(g),
|
|
137
|
+
isSubmitting: ee,
|
|
138
|
+
hasSubmitError: te,
|
|
139
|
+
handleSubmit: se,
|
|
140
|
+
reset: A,
|
|
141
|
+
rules: b,
|
|
142
|
+
setRules: x,
|
|
143
|
+
author: T,
|
|
144
|
+
setAuthor: ie,
|
|
145
|
+
publishCredentials: D,
|
|
146
|
+
setPublishCredentials: O,
|
|
147
|
+
isRulesLoading: S,
|
|
148
|
+
hasRulesLoadError: C
|
|
149
149
|
};
|
|
150
|
-
},
|
|
150
|
+
}, L = (e, t) => {
|
|
151
151
|
let n = t.trim().toLowerCase();
|
|
152
152
|
return n ? e.reduce((e, r) => {
|
|
153
|
-
let i = r.children ?
|
|
153
|
+
let i = r.children ? L(r.children, t) : void 0;
|
|
154
154
|
return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
|
|
155
155
|
...r,
|
|
156
156
|
children: i
|
|
157
157
|
}), e;
|
|
158
158
|
}, []) : e;
|
|
159
|
-
},
|
|
159
|
+
}, R = (e, t) => e.localeCompare(t, void 0, {
|
|
160
160
|
sensitivity: "base",
|
|
161
161
|
numeric: !0
|
|
162
|
-
}),
|
|
162
|
+
}), z = (e) => [...e].sort((e, t) => R(e.name, t.name)).map((e) => e.children ? {
|
|
163
163
|
...e,
|
|
164
|
-
children:
|
|
165
|
-
} : e),
|
|
164
|
+
children: z(e.children)
|
|
165
|
+
} : e), B = (e, t, n) => {
|
|
166
166
|
let [r, ...i] = t;
|
|
167
167
|
if (r == null) return e;
|
|
168
168
|
let a = [...n, r], o = e.find((e) => e.name === r);
|
|
169
169
|
return o ? i.length ? e.map((e) => e === o ? {
|
|
170
170
|
...e,
|
|
171
|
-
children:
|
|
171
|
+
children: B(e.children ?? [], i, a)
|
|
172
172
|
} : e) : e : [...e, {
|
|
173
173
|
path: a,
|
|
174
174
|
name: r,
|
|
175
|
-
children: i.length ?
|
|
175
|
+
children: i.length ? B([], i, a) : void 0
|
|
176
176
|
}];
|
|
177
|
-
},
|
|
178
|
-
let t =
|
|
177
|
+
}, le = (e, t) => t.reduce((e, t) => t.length ? B(e, t, []) : e, e), V = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? V(e.children) : []]), H = (e) => e.join("/"), U = (e) => e.split("/").filter(Boolean), ue = (e) => e.map((e) => {
|
|
178
|
+
let t = H(e.path);
|
|
179
179
|
return {
|
|
180
180
|
path: t,
|
|
181
181
|
name: e.name,
|
|
182
182
|
folderId: t,
|
|
183
183
|
nodeType: u.FOLDER,
|
|
184
|
-
items: e.children ?
|
|
184
|
+
items: e.children ? ue(e.children) : void 0
|
|
185
185
|
};
|
|
186
|
-
}),
|
|
186
|
+
}), W = /[/\\:;,={}&"]/, de = (e, t, n) => {
|
|
187
187
|
let r = e.trim();
|
|
188
|
-
return r ? r.includes("..") ||
|
|
189
|
-
},
|
|
188
|
+
return r ? r.includes("..") || W.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
|
|
189
|
+
}, fe = (e, t) => {
|
|
190
190
|
let n = new Set(t.map((e) => e.toLowerCase()));
|
|
191
191
|
if (!n.has(e.toLowerCase())) return e;
|
|
192
192
|
let r = 2;
|
|
193
193
|
for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
|
|
194
194
|
return `${e} ${r}`;
|
|
195
|
-
},
|
|
195
|
+
}, G = (e, t) => {
|
|
196
196
|
if (t.length === 0) return e.map((e) => e.name);
|
|
197
|
-
let n =
|
|
197
|
+
let n = H(t), r = (e) => {
|
|
198
198
|
for (let t of e) {
|
|
199
|
-
if (
|
|
199
|
+
if (H(t.path) === n) return t;
|
|
200
200
|
let e = t.children ? r(t.children) : void 0;
|
|
201
201
|
if (e) return e;
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
return (r(e)?.children ?? []).map((e) => e.name);
|
|
205
|
-
},
|
|
205
|
+
}, K = {
|
|
206
206
|
dialog: "_dialog_jqcm2_5",
|
|
207
207
|
error: "_error_jqcm2_14",
|
|
208
208
|
selectField: "_selectField_jqcm2_28",
|
|
209
209
|
selectFieldOpen: "_selectFieldOpen_jqcm2_40"
|
|
210
|
-
},
|
|
210
|
+
}, q = 20, J = 200, pe = 8, me = (e) => {
|
|
211
211
|
let t = e.trim();
|
|
212
|
-
if (t.length === 0 || t.length >
|
|
212
|
+
if (t.length === 0 || t.length > J) return !1;
|
|
213
213
|
try {
|
|
214
214
|
return new RegExp(t) instanceof RegExp;
|
|
215
215
|
} catch {
|
|
216
216
|
return !1;
|
|
217
217
|
}
|
|
218
|
-
},
|
|
219
|
-
let
|
|
220
|
-
...
|
|
221
|
-
"--pare-mobile-bg":
|
|
222
|
-
"--pare-bg":
|
|
223
|
-
"--pare-error-text":
|
|
224
|
-
"--pare-select-border":
|
|
225
|
-
"--pare-select-border-hover":
|
|
226
|
-
"--pare-select-border-open":
|
|
227
|
-
"--pare-select-border-focus":
|
|
218
|
+
}, he = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = q, labels: u = {}, errorClassName: p = "dial-tiny-text", styles: _ = {} }) => {
|
|
219
|
+
let ee = {
|
|
220
|
+
...T({
|
|
221
|
+
"--pare-mobile-bg": _.colors?.mobileBackground,
|
|
222
|
+
"--pare-bg": _.colors?.background,
|
|
223
|
+
"--pare-error-text": _.colors?.errorText,
|
|
224
|
+
"--pare-select-border": _.colors?.selectBorder,
|
|
225
|
+
"--pare-select-border-hover": _.colors?.selectBorderHover,
|
|
226
|
+
"--pare-select-border-open": _.colors?.selectBorderOpen,
|
|
227
|
+
"--pare-select-border-focus": _.colors?.selectBorderFocus
|
|
228
228
|
}),
|
|
229
|
-
...
|
|
230
|
-
}, { sourceLabel: v = "Source", sourcePlaceholder:
|
|
229
|
+
..._.cssVars
|
|
230
|
+
}, { sourceLabel: v = "Source", sourcePlaceholder: te = "Select...", functionLabel: b = "Function", equalOptionLabel: x = "Equal", containOptionLabel: S = "Contain", regexOptionLabel: C = "Regex", targetsLabel: D = "Targets", targetsPlaceholder: re = "Add a target", targetsHintLabel: ie = "Press Enter or comma to add a target.", patternLabel: ae = "Pattern", patternPlaceholder: oe = "Enter a regular expression", invalidRegexError: se = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: N = "Save", cancelLabel: P = "Cancel", dialogAriaLabel: ce = "Add access rule" } = u, F = n(), I = n(), L = n(), R = n(), z = i(null);
|
|
231
231
|
t(() => {
|
|
232
|
-
|
|
232
|
+
z.current?.focus();
|
|
233
233
|
}, []);
|
|
234
|
-
let [
|
|
234
|
+
let [B, le] = a(), [V, H] = a(), [U, ue] = a([]), [W, de] = a(""), [fe, G] = a(!1), [J, he] = a(""), [Y, ge] = a(!1), [X, _e] = a(!1), Z = E(K.selectField, fe && K.selectFieldOpen), ve = E(K.selectField, Y && K.selectFieldOpen), ye = r(() => e.map((e) => ({
|
|
235
235
|
value: e,
|
|
236
236
|
label: e,
|
|
237
|
-
labelNode:
|
|
237
|
+
labelNode: J.trim() ? /* @__PURE__ */ O(m, {
|
|
238
238
|
text: e,
|
|
239
|
-
query:
|
|
239
|
+
query: J,
|
|
240
240
|
maxLines: 1
|
|
241
241
|
}) : void 0
|
|
242
|
-
})), [e,
|
|
242
|
+
})), [e, J]), be = r(() => [
|
|
243
243
|
{
|
|
244
|
-
value:
|
|
245
|
-
label:
|
|
244
|
+
value: A.Equal,
|
|
245
|
+
label: x
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
|
-
value:
|
|
249
|
-
label:
|
|
248
|
+
value: A.Contain,
|
|
249
|
+
label: S
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
|
-
value:
|
|
253
|
-
label:
|
|
252
|
+
value: A.Regex,
|
|
253
|
+
label: C
|
|
254
254
|
}
|
|
255
255
|
], [
|
|
256
|
+
x,
|
|
256
257
|
S,
|
|
257
|
-
C
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
ref: oe,
|
|
258
|
+
C
|
|
259
|
+
]), Q = V === A.Regex, $ = me(W), xe = B != null && V != null && (Q ? $ : U.length > 0);
|
|
260
|
+
return /* @__PURE__ */ k("div", {
|
|
261
|
+
ref: z,
|
|
262
262
|
role: "dialog",
|
|
263
263
|
"aria-modal": "true",
|
|
264
|
-
"aria-label":
|
|
264
|
+
"aria-label": ce,
|
|
265
265
|
tabIndex: -1,
|
|
266
266
|
onKeyDown: (e) => {
|
|
267
267
|
e.key === "Escape" && (e.stopPropagation(), s());
|
|
268
268
|
},
|
|
269
|
-
style:
|
|
270
|
-
className:
|
|
269
|
+
style: ee,
|
|
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", K.dialog),
|
|
271
271
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
id:
|
|
272
|
+
/* @__PURE__ */ O(y, {
|
|
273
|
+
id: I,
|
|
274
274
|
labelProps: { label: v },
|
|
275
|
-
options:
|
|
276
|
-
value:
|
|
275
|
+
options: ye,
|
|
276
|
+
value: B,
|
|
277
277
|
onChange: (e) => {
|
|
278
|
-
|
|
278
|
+
le(Array.isArray(e) ? e[0] : e), G(!1);
|
|
279
279
|
},
|
|
280
|
-
placeholder:
|
|
281
|
-
searchable: e.length >
|
|
282
|
-
searchPlaceholder:
|
|
283
|
-
onSearchQueryChange:
|
|
280
|
+
placeholder: te,
|
|
281
|
+
searchable: e.length > pe,
|
|
282
|
+
searchPlaceholder: te,
|
|
283
|
+
onSearchQueryChange: he,
|
|
284
284
|
disabled: c,
|
|
285
|
-
open:
|
|
286
|
-
onOpenChange:
|
|
287
|
-
fieldClassName:
|
|
288
|
-
invalid:
|
|
289
|
-
error:
|
|
285
|
+
open: fe,
|
|
286
|
+
onOpenChange: G,
|
|
287
|
+
fieldClassName: Z,
|
|
288
|
+
invalid: X && B == null,
|
|
289
|
+
error: X && B == null ? j : void 0
|
|
290
290
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
labelProps: { label:
|
|
293
|
-
id:
|
|
294
|
-
options:
|
|
295
|
-
value:
|
|
291
|
+
/* @__PURE__ */ O(y, {
|
|
292
|
+
labelProps: { label: b },
|
|
293
|
+
id: L,
|
|
294
|
+
options: be,
|
|
295
|
+
value: V,
|
|
296
296
|
onChange: (e) => {
|
|
297
297
|
let t = Array.isArray(e) ? e[0] : e;
|
|
298
|
-
|
|
298
|
+
V === A.Regex != (t === A.Regex) && (ue([]), de("")), H(t), ge(!1);
|
|
299
299
|
},
|
|
300
|
-
placeholder:
|
|
300
|
+
placeholder: b,
|
|
301
301
|
disabled: c,
|
|
302
|
-
open:
|
|
303
|
-
onOpenChange:
|
|
304
|
-
fieldClassName:
|
|
305
|
-
invalid:
|
|
306
|
-
error:
|
|
302
|
+
open: Y,
|
|
303
|
+
onOpenChange: ge,
|
|
304
|
+
fieldClassName: ve,
|
|
305
|
+
invalid: X && V == null,
|
|
306
|
+
error: X && V == null ? j : void 0
|
|
307
307
|
}),
|
|
308
|
-
|
|
309
|
-
id: `${
|
|
310
|
-
labelProps: { label:
|
|
311
|
-
placeholder:
|
|
312
|
-
value:
|
|
313
|
-
onChange: (e) =>
|
|
314
|
-
invalid: (
|
|
315
|
-
"aria-describedby": (
|
|
308
|
+
Q ? /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(h, {
|
|
309
|
+
id: `${F}-input`,
|
|
310
|
+
labelProps: { label: ae },
|
|
311
|
+
placeholder: oe,
|
|
312
|
+
value: W,
|
|
313
|
+
onChange: (e) => de(e ?? ""),
|
|
314
|
+
invalid: (W.length > 0 || X) && !$,
|
|
315
|
+
"aria-describedby": (W.length > 0 || X) && !$ ? F : void 0,
|
|
316
316
|
disabled: c
|
|
317
|
-
}), (
|
|
317
|
+
}), (W.length > 0 || X) && !$ && /* @__PURE__ */ O(d, {
|
|
318
|
+
id: F,
|
|
319
|
+
className: E("mt-1 block", p, K.error),
|
|
320
|
+
text: se
|
|
321
|
+
})] }) : /* @__PURE__ */ O(ne, {
|
|
318
322
|
id: R,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
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,
|
|
323
|
+
labelProps: { label: D },
|
|
324
|
+
placeholder: re,
|
|
325
|
+
caption: X && U.length === 0 ? void 0 : ie,
|
|
326
|
+
error: X && U.length === 0 ? M : void 0,
|
|
327
|
+
invalid: X && U.length === 0,
|
|
328
|
+
value: U,
|
|
330
329
|
onChange: (e) => {
|
|
331
330
|
let t = [];
|
|
332
331
|
for (let n of e) {
|
|
333
332
|
let e = n.trim();
|
|
334
333
|
if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
|
|
335
334
|
}
|
|
336
|
-
|
|
335
|
+
ue(t);
|
|
337
336
|
},
|
|
338
337
|
disabled: c,
|
|
339
|
-
tagClassName:
|
|
338
|
+
tagClassName: w
|
|
340
339
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ k("div", {
|
|
342
341
|
className: "mt-auto flex justify-end gap-2 desktop:mt-2",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
344
|
-
label:
|
|
342
|
+
children: [/* @__PURE__ */ O(f, {
|
|
343
|
+
label: P,
|
|
345
344
|
onClick: s,
|
|
346
345
|
disabled: c
|
|
347
|
-
}), /* @__PURE__ */
|
|
348
|
-
label:
|
|
346
|
+
}), /* @__PURE__ */ O(g, {
|
|
347
|
+
label: N,
|
|
349
348
|
onClick: () => {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
o({
|
|
355
|
-
source: V,
|
|
356
|
-
function: H,
|
|
357
|
-
targets: $ ? [K.trim()] : W
|
|
349
|
+
!xe || B == null || V == null ? _e(!0) : o({
|
|
350
|
+
source: B,
|
|
351
|
+
function: V,
|
|
352
|
+
targets: Q ? [W.trim()] : U
|
|
358
353
|
});
|
|
359
354
|
},
|
|
360
355
|
disabled: c
|
|
@@ -362,165 +357,165 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
362
357
|
})
|
|
363
358
|
]
|
|
364
359
|
});
|
|
365
|
-
},
|
|
360
|
+
}, Y = {
|
|
366
361
|
ruleRow: "_ruleRow_nx0en_1",
|
|
367
362
|
heading: "_heading_nx0en_5",
|
|
368
363
|
hint: "_hint_nx0en_9",
|
|
369
364
|
loading: "_loading_nx0en_13",
|
|
370
365
|
ruleText: "_ruleText_nx0en_17"
|
|
371
|
-
},
|
|
366
|
+
}, ge = 20, X = (e, t) => e === A.Equal ? t.equal : e === A.Contain ? t.contain : t.regex, _e = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: d = !1, isLoading: m = !1, hasLoadError: h = !1, maxRules: g = ge, maxTargetsPerRule: te, labels: y = {}, headingClassName: b = "dial-body-semi-text", hintClassName: S = "dial-small-text", loadingClassName: ne = "dial-small-text", ruleTextClassName: C = "dial-small-text", ruleSourceClassName: w = "dial-small-semi-text", styles: D = {} }) => {
|
|
372
367
|
let re = {
|
|
373
|
-
...
|
|
374
|
-
"--par-rule-bg":
|
|
375
|
-
"--par-heading-text":
|
|
376
|
-
"--par-hint-text":
|
|
377
|
-
"--par-loading-text":
|
|
378
|
-
"--par-rule-text":
|
|
368
|
+
...T({
|
|
369
|
+
"--par-rule-bg": D.colors?.ruleBackground,
|
|
370
|
+
"--par-heading-text": D.colors?.headingText,
|
|
371
|
+
"--par-hint-text": D.colors?.hintText,
|
|
372
|
+
"--par-loading-text": D.colors?.loadingText,
|
|
373
|
+
"--par-rule-text": D.colors?.ruleText
|
|
379
374
|
}),
|
|
380
|
-
...
|
|
381
|
-
}, { heading:
|
|
375
|
+
...D.cssVars
|
|
376
|
+
}, { heading: oe = "Allow access if all match", folderScopeHint: se = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: A = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: j = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: M = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: N = "Add rule", clearAllLabel: P = "Clear all", orSeparatorLabel: ce = "Or", removeRuleAriaLabelTemplate: F = "Remove rule for {source}: {targets}", equalFunctionLabel: I = "Equal", containFunctionLabel: L = "Contain", regexFunctionLabel: R = "Regex", loadingLabel: z = "Loading existing rules…", loadErrorLabel: B = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: le = "Rule added.", ruleRemovedAnnouncement: V = "Rule removed.", rulesClearedAnnouncement: H = "All rules cleared.", rulesLoadedAnnouncement: U = "Existing rules loaded for the selected folder.", editorLabels: ue } = y, W = n(), [de, fe] = a(!1), [G, K] = a(""), q = i(null), J = i(m);
|
|
382
377
|
t(() => {
|
|
383
|
-
|
|
378
|
+
J.current && !m && e.length > 0 && K(U), J.current = m;
|
|
384
379
|
}, [
|
|
385
380
|
m,
|
|
386
381
|
e,
|
|
387
|
-
|
|
382
|
+
U
|
|
388
383
|
]);
|
|
389
|
-
let
|
|
390
|
-
|
|
391
|
-
},
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
r([...e, t]), le
|
|
395
|
-
},
|
|
396
|
-
r(e.filter((e, n) => n !== t)),
|
|
397
|
-
},
|
|
398
|
-
r([]),
|
|
399
|
-
},
|
|
400
|
-
equal:
|
|
401
|
-
contain:
|
|
402
|
-
regex:
|
|
403
|
-
},
|
|
404
|
-
return /* @__PURE__ */
|
|
384
|
+
let pe = () => {
|
|
385
|
+
q.current = document.activeElement, fe(!0);
|
|
386
|
+
}, me = () => {
|
|
387
|
+
fe(!1), q.current?.focus?.();
|
|
388
|
+
}, _e = (t) => {
|
|
389
|
+
r([...e, t]), K(le), me();
|
|
390
|
+
}, Z = (t) => {
|
|
391
|
+
r(e.filter((e, n) => n !== t)), K(V);
|
|
392
|
+
}, ve = () => {
|
|
393
|
+
r([]), K(H);
|
|
394
|
+
}, ye = {
|
|
395
|
+
equal: I,
|
|
396
|
+
contain: L,
|
|
397
|
+
regex: R
|
|
398
|
+
}, be = e.length >= g, Q = d || be, $ = u != null && u !== "";
|
|
399
|
+
return /* @__PURE__ */ k("div", {
|
|
405
400
|
role: "group",
|
|
406
|
-
"aria-labelledby":
|
|
401
|
+
"aria-labelledby": W,
|
|
407
402
|
style: re,
|
|
408
|
-
className:
|
|
403
|
+
className: E(d && "pointer-events-none opacity-60"),
|
|
409
404
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ O("span", {
|
|
411
406
|
role: "status",
|
|
412
407
|
"aria-live": "polite",
|
|
413
408
|
className: "sr-only",
|
|
414
|
-
children:
|
|
409
|
+
children: G
|
|
415
410
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ k("div", {
|
|
417
412
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
419
|
-
id:
|
|
420
|
-
className:
|
|
421
|
-
children:
|
|
422
|
-
}), e.length > 0 && /* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ O("div", {
|
|
414
|
+
id: W,
|
|
415
|
+
className: E(b, Y.heading),
|
|
416
|
+
children: oe
|
|
417
|
+
}), e.length > 0 && /* @__PURE__ */ O(f, {
|
|
423
418
|
variant: o.Primary,
|
|
424
|
-
label:
|
|
425
|
-
onClick:
|
|
426
|
-
disabled:
|
|
419
|
+
label: P,
|
|
420
|
+
onClick: ve,
|
|
421
|
+
disabled: d
|
|
427
422
|
})]
|
|
428
423
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
className:
|
|
431
|
-
children:
|
|
424
|
+
/* @__PURE__ */ O("p", {
|
|
425
|
+
className: E("mb-2", S, Y.hint),
|
|
426
|
+
children: $ ? se.replace("{folder}", u) : A
|
|
432
427
|
}),
|
|
433
|
-
e.length > 0 &&
|
|
428
|
+
e.length > 0 && !$ && /* @__PURE__ */ O("div", {
|
|
434
429
|
className: "mb-2",
|
|
435
|
-
children: /* @__PURE__ */
|
|
436
|
-
type:
|
|
430
|
+
children: /* @__PURE__ */ O(_, {
|
|
431
|
+
type: ee.SectionMessage,
|
|
437
432
|
variant: v.Warning,
|
|
438
|
-
message:
|
|
433
|
+
message: j
|
|
439
434
|
})
|
|
440
435
|
}),
|
|
441
|
-
m && /* @__PURE__ */
|
|
442
|
-
className:
|
|
443
|
-
children: [/* @__PURE__ */
|
|
436
|
+
m && /* @__PURE__ */ k("div", {
|
|
437
|
+
className: E("mb-2 flex items-center gap-2", ne, Y.loading),
|
|
438
|
+
children: [/* @__PURE__ */ O(x, {
|
|
444
439
|
size: 16,
|
|
445
|
-
ariaLabel:
|
|
446
|
-
}), /* @__PURE__ */
|
|
440
|
+
ariaLabel: z
|
|
441
|
+
}), /* @__PURE__ */ O("span", { children: z })]
|
|
447
442
|
}),
|
|
448
|
-
h && /* @__PURE__ */
|
|
443
|
+
h && /* @__PURE__ */ O("div", {
|
|
449
444
|
className: "mb-2",
|
|
450
|
-
children: /* @__PURE__ */
|
|
451
|
-
type:
|
|
445
|
+
children: /* @__PURE__ */ O(_, {
|
|
446
|
+
type: ee.SectionMessage,
|
|
452
447
|
variant: v.Warning,
|
|
453
|
-
message:
|
|
448
|
+
message: B
|
|
454
449
|
})
|
|
455
450
|
}),
|
|
456
|
-
e.length > 0 && /* @__PURE__ */
|
|
451
|
+
e.length > 0 && /* @__PURE__ */ O("ul", {
|
|
457
452
|
className: "mb-3 flex flex-col gap-2",
|
|
458
453
|
children: e.map((e, t) => {
|
|
459
|
-
let n = e.targets.join(` ${
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
className:
|
|
462
|
-
children: [/* @__PURE__ */
|
|
463
|
-
className:
|
|
454
|
+
let n = e.targets.join(` ${ce} `), r = F.replace("{source}", e.source).replace("{targets}", n);
|
|
455
|
+
return /* @__PURE__ */ k("li", {
|
|
456
|
+
className: E("flex items-center justify-between gap-2 rounded-lg px-3 py-2", Y.ruleRow),
|
|
457
|
+
children: [/* @__PURE__ */ k("span", {
|
|
458
|
+
className: E("truncate", C, Y.ruleText),
|
|
464
459
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
className:
|
|
460
|
+
/* @__PURE__ */ O("span", {
|
|
461
|
+
className: w,
|
|
467
462
|
children: e.source
|
|
468
463
|
}),
|
|
469
464
|
" ",
|
|
470
|
-
|
|
465
|
+
X(e.function, ye),
|
|
471
466
|
": ",
|
|
472
467
|
n
|
|
473
468
|
]
|
|
474
|
-
}), /* @__PURE__ */
|
|
475
|
-
icon: /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ O(p, {
|
|
470
|
+
icon: /* @__PURE__ */ O(ae, {
|
|
476
471
|
size: c.SM,
|
|
477
472
|
"aria-hidden": !0,
|
|
478
473
|
stroke: l
|
|
479
474
|
}),
|
|
480
475
|
"aria-label": r,
|
|
481
|
-
onClick: () =>
|
|
482
|
-
disabled:
|
|
476
|
+
onClick: () => Z(t),
|
|
477
|
+
disabled: d
|
|
483
478
|
})]
|
|
484
479
|
}, t);
|
|
485
480
|
})
|
|
486
481
|
}),
|
|
487
|
-
|
|
482
|
+
de && /* @__PURE__ */ O(he, {
|
|
488
483
|
sourceOptions: s,
|
|
489
|
-
onSave:
|
|
490
|
-
onCancel:
|
|
491
|
-
disabled:
|
|
492
|
-
maxTargets:
|
|
493
|
-
labels:
|
|
494
|
-
styles:
|
|
484
|
+
onSave: _e,
|
|
485
|
+
onCancel: me,
|
|
486
|
+
disabled: d,
|
|
487
|
+
maxTargets: te,
|
|
488
|
+
labels: ue,
|
|
489
|
+
styles: D.editor
|
|
495
490
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ O("div", {
|
|
497
492
|
className: "flex flex-wrap items-center gap-2",
|
|
498
|
-
children: /* @__PURE__ */
|
|
499
|
-
label:
|
|
500
|
-
iconBefore: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ O(f, {
|
|
494
|
+
label: N,
|
|
495
|
+
iconBefore: /* @__PURE__ */ O(ie, {
|
|
501
496
|
size: c.SM,
|
|
502
497
|
"aria-hidden": !0,
|
|
503
498
|
stroke: l
|
|
504
499
|
}),
|
|
505
|
-
onClick:
|
|
506
|
-
disabled:
|
|
500
|
+
onClick: pe,
|
|
501
|
+
disabled: Q
|
|
507
502
|
})
|
|
508
503
|
}),
|
|
509
|
-
|
|
510
|
-
className:
|
|
511
|
-
children:
|
|
504
|
+
be && /* @__PURE__ */ O("p", {
|
|
505
|
+
className: E("mt-2", S, Y.hint),
|
|
506
|
+
children: M.replace("{max}", String(g))
|
|
512
507
|
})
|
|
513
508
|
]
|
|
514
509
|
});
|
|
515
|
-
},
|
|
510
|
+
}, Z = {
|
|
516
511
|
currentBadge: "_currentBadge_d0adf_1",
|
|
517
512
|
sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
|
|
518
513
|
version: "_version_d0adf_13",
|
|
519
514
|
date: "_date_d0adf_17",
|
|
520
515
|
emptyState: "_emptyState_d0adf_21",
|
|
521
516
|
stripedRow: "_stripedRow_d0adf_25"
|
|
522
|
-
},
|
|
523
|
-
let m =
|
|
517
|
+
}, ve = ({ 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 }) => {
|
|
518
|
+
let m = T({
|
|
524
519
|
"--phl-badge-border": p?.currentBadgeBorder,
|
|
525
520
|
"--phl-badge-bg": p?.currentBadgeBackground,
|
|
526
521
|
"--phl-badge-text": p?.currentBadgeText,
|
|
@@ -531,233 +526,241 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
531
526
|
"--phl-date-text": p?.dateText,
|
|
532
527
|
"--phl-empty-text": p?.emptyStateText,
|
|
533
528
|
"--phl-striped-bg": p?.stripedBackground
|
|
534
|
-
}), h =
|
|
535
|
-
return n ? /* @__PURE__ */
|
|
529
|
+
}), h = E(f, Z.emptyState);
|
|
530
|
+
return n ? /* @__PURE__ */ O("p", {
|
|
536
531
|
style: m,
|
|
537
532
|
className: h,
|
|
538
533
|
children: c
|
|
539
|
-
}) : r ? /* @__PURE__ */
|
|
534
|
+
}) : r ? /* @__PURE__ */ O("p", {
|
|
540
535
|
style: m,
|
|
541
536
|
className: h,
|
|
542
537
|
role: "alert",
|
|
543
538
|
children: l
|
|
544
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
539
|
+
}) : e.length === 0 ? /* @__PURE__ */ O("p", {
|
|
545
540
|
style: m,
|
|
546
541
|
className: h,
|
|
547
542
|
children: s
|
|
548
|
-
}) : /* @__PURE__ */
|
|
543
|
+
}) : /* @__PURE__ */ O("ul", {
|
|
549
544
|
style: m,
|
|
550
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
551
|
-
className:
|
|
552
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: e.map((e, n) => /* @__PURE__ */ k("li", {
|
|
546
|
+
className: E("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Z.stripedRow),
|
|
547
|
+
children: [/* @__PURE__ */ k("span", {
|
|
553
548
|
className: "flex min-w-0 items-center gap-2",
|
|
554
549
|
style: m,
|
|
555
550
|
children: [
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
className:
|
|
551
|
+
/* @__PURE__ */ k("span", {
|
|
552
|
+
className: E(u, Z.version),
|
|
558
553
|
children: [
|
|
559
554
|
i,
|
|
560
555
|
" ",
|
|
561
556
|
e.version
|
|
562
557
|
]
|
|
563
558
|
}),
|
|
564
|
-
e.version === t && /* @__PURE__ */
|
|
559
|
+
e.version === t && /* @__PURE__ */ O(S, {
|
|
565
560
|
label: a,
|
|
566
|
-
className:
|
|
561
|
+
className: E("shrink-0 whitespace-nowrap", Z.currentBadge)
|
|
567
562
|
}),
|
|
568
|
-
e.publishCredentials === !0 && /* @__PURE__ */
|
|
563
|
+
e.publishCredentials === !0 && /* @__PURE__ */ O(S, {
|
|
569
564
|
label: o,
|
|
570
|
-
className:
|
|
565
|
+
className: E("shrink-0 whitespace-nowrap", Z.sharedCredentialsBadge)
|
|
571
566
|
})
|
|
572
567
|
]
|
|
573
|
-
}), /* @__PURE__ */
|
|
574
|
-
className:
|
|
575
|
-
children:
|
|
568
|
+
}), /* @__PURE__ */ O("span", {
|
|
569
|
+
className: E(d, Z.date),
|
|
570
|
+
children: P(e.publishedAt)
|
|
576
571
|
})]
|
|
577
572
|
}, `${e.version}-${n}`))
|
|
578
573
|
});
|
|
579
|
-
},
|
|
574
|
+
}, ye = {
|
|
580
575
|
divider: "_divider_1gs31_1",
|
|
581
576
|
tree: "_tree_1gs31_17"
|
|
582
|
-
},
|
|
583
|
-
let
|
|
584
|
-
...
|
|
585
|
-
...
|
|
586
|
-
}, [
|
|
577
|
+
}, be = "data-cancel-creating-folder", Q = ({ items: e, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, searchQuery: u, disabled: d = !1, createFolderLabel: p = "Create new folder", cancelCreatingFolderLabel: m = "Cancel", addSiblingFolderLabel: h = "Add sibling", addChildFolderLabel: g = "Add child", newFolderDefaultName: _ = "New folder", noResultsLabel: ee = "No folders match \"{query}\".", emptyFolderNameError: v = "Folder name cannot be empty.", invalidFolderNameError: te = "Folder name contains invalid characters.", duplicateFolderNameError: y = "A folder with this name already exists.", rootLabel: b = "Organization", expandedPaths: x, onExpandedPathsChange: S, loadingPaths: ne, styles: C = {} }) => {
|
|
578
|
+
let w = {
|
|
579
|
+
...T({ "--pft-divider": C.colors?.divider }),
|
|
580
|
+
...C.cssVars
|
|
581
|
+
}, [D, ae] = a(() => new Set(n?.map((e, t) => H(n.slice(0, t + 1))) ?? [])), A = x ?? D, j = (e) => {
|
|
587
582
|
let t = new Set(e);
|
|
588
|
-
t.delete(""),
|
|
589
|
-
}, [
|
|
583
|
+
t.delete(""), S ? S(t) : ae(t);
|
|
584
|
+
}, [M, N] = a(null), [P, ce] = a(_), F = i(null), I = i(!1);
|
|
585
|
+
t(() => {
|
|
586
|
+
let e = (e) => {
|
|
587
|
+
e.target instanceof Element && e.target.closest(`[${be}]`) && (I.current = !0);
|
|
588
|
+
};
|
|
589
|
+
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
590
|
+
}, []);
|
|
591
|
+
let R = u.trim(), B = M != null, le = r(() => L(e, u), [e, u]), W = R.length > 0 && le.length === 0, K = !B && R.length > 0, q = r(() => z(K ? le : e), [
|
|
590
592
|
K,
|
|
591
|
-
|
|
593
|
+
le,
|
|
592
594
|
e
|
|
593
|
-
]),
|
|
595
|
+
]), J = r(() => /* @__PURE__ */ new Set(["", ...V(q)]), [q]), pe = r(() => /* @__PURE__ */ new Set(["", ...K ? J : A]), [
|
|
594
596
|
K,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
]),
|
|
597
|
+
J,
|
|
598
|
+
A
|
|
599
|
+
]), me = r(() => ue(q), [q]), he = r(() => K && me.length === 0 ? [] : [{
|
|
598
600
|
path: "",
|
|
599
|
-
name:
|
|
601
|
+
name: b,
|
|
600
602
|
folderId: "",
|
|
601
|
-
nodeType:
|
|
602
|
-
items:
|
|
603
|
+
nodeType: oe.FOLDER,
|
|
604
|
+
items: me
|
|
603
605
|
}], [
|
|
604
|
-
|
|
605
|
-
|
|
606
|
+
me,
|
|
607
|
+
b,
|
|
606
608
|
K
|
|
607
|
-
]),
|
|
609
|
+
]), Y = M ? H(M) : null, ge = {
|
|
608
610
|
empty: v,
|
|
609
|
-
invalid:
|
|
610
|
-
duplicate:
|
|
611
|
-
},
|
|
612
|
-
|
|
613
|
-
let t =
|
|
614
|
-
t &&
|
|
615
|
-
},
|
|
616
|
-
let t =
|
|
611
|
+
invalid: te,
|
|
612
|
+
duplicate: y
|
|
613
|
+
}, X = (t) => fe(W && de(R, [], ge) == null ? R : _, G(e, t)), _e = (e) => {
|
|
614
|
+
N(e), ce(X(e)), F.current = null, I.current = !1;
|
|
615
|
+
let t = H(e);
|
|
616
|
+
t && j(new Set(A).add(t));
|
|
617
|
+
}, Z = () => _e(n ?? []), ve = (e) => {
|
|
618
|
+
let t = U(e.path), n = [{
|
|
617
619
|
key: "add-child",
|
|
618
|
-
label:
|
|
619
|
-
icon: /* @__PURE__ */
|
|
620
|
+
label: g,
|
|
621
|
+
icon: /* @__PURE__ */ O(re, {
|
|
620
622
|
size: c.SM,
|
|
621
623
|
"aria-hidden": !0,
|
|
622
624
|
stroke: l
|
|
623
625
|
}),
|
|
624
|
-
onClick: () =>
|
|
626
|
+
onClick: () => _e(t)
|
|
625
627
|
}];
|
|
626
628
|
return e.path !== "" && n.push({
|
|
627
629
|
key: "add-sibling",
|
|
628
|
-
label:
|
|
629
|
-
icon: /* @__PURE__ */
|
|
630
|
+
label: h,
|
|
631
|
+
icon: /* @__PURE__ */ O(ie, {
|
|
630
632
|
size: c.SM,
|
|
631
633
|
"aria-hidden": !0,
|
|
632
634
|
stroke: l
|
|
633
635
|
}),
|
|
634
|
-
onClick: () =>
|
|
636
|
+
onClick: () => _e(t.slice(0, -1))
|
|
635
637
|
}), n;
|
|
636
|
-
},
|
|
637
|
-
if (!
|
|
638
|
-
let n =
|
|
639
|
-
return
|
|
640
|
-
},
|
|
641
|
-
if (!
|
|
642
|
-
let t = e.trim(),
|
|
643
|
-
(
|
|
644
|
-
},
|
|
645
|
-
return /* @__PURE__ */
|
|
646
|
-
style:
|
|
647
|
-
className:
|
|
638
|
+
}, Q = (t) => {
|
|
639
|
+
if (!M) return null;
|
|
640
|
+
let n = de(t, G(e, M), ge);
|
|
641
|
+
return F.current = n, n;
|
|
642
|
+
}, $ = (e) => {
|
|
643
|
+
if (!M || I.current) return;
|
|
644
|
+
let t = e.trim(), n = F.current;
|
|
645
|
+
(Q(e) ?? n) || (s(M, t), o([...M, t])), N(null);
|
|
646
|
+
}, xe = () => N(null);
|
|
647
|
+
return /* @__PURE__ */ k("div", {
|
|
648
|
+
style: w,
|
|
649
|
+
className: E(d && "pointer-events-none opacity-60", C.className),
|
|
648
650
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
className:
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
items:
|
|
651
|
+
/* @__PURE__ */ O("div", {
|
|
652
|
+
className: E("w-full max-w-full min-w-0", ye.tree),
|
|
653
|
+
children: /* @__PURE__ */ O(se, {
|
|
654
|
+
items: he,
|
|
653
655
|
showFiles: !1,
|
|
654
|
-
selectedPath:
|
|
655
|
-
expandedPaths:
|
|
656
|
-
onExpandedPathsChange:
|
|
657
|
-
loadingPaths:
|
|
656
|
+
selectedPath: n == null ? void 0 : H(n),
|
|
657
|
+
expandedPaths: pe,
|
|
658
|
+
onExpandedPathsChange: j,
|
|
659
|
+
loadingPaths: ne,
|
|
658
660
|
onItemClick: (e) => {
|
|
659
|
-
n
|
|
661
|
+
o(n != null && H(n) === e.path ? void 0 : U(e.path));
|
|
660
662
|
},
|
|
661
|
-
getContextMenuItems:
|
|
662
|
-
createdFolderPath:
|
|
663
|
-
newFolderDefaultName:
|
|
664
|
-
onCreateFolderSave:
|
|
665
|
-
onCreateFolderCancel:
|
|
666
|
-
onRenameValidate: (e) =>
|
|
667
|
-
emptyStateTitle: K ?
|
|
663
|
+
getContextMenuItems: ve,
|
|
664
|
+
createdFolderPath: Y,
|
|
665
|
+
newFolderDefaultName: P,
|
|
666
|
+
onCreateFolderSave: $,
|
|
667
|
+
onCreateFolderCancel: xe,
|
|
668
|
+
onRenameValidate: (e) => Q(e),
|
|
669
|
+
emptyStateTitle: K ? ee.replace("{query}", R) : void 0
|
|
668
670
|
})
|
|
669
671
|
}),
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
className:
|
|
672
|
+
/* @__PURE__ */ O("div", {
|
|
673
|
+
className: E("my-2 h-px", ye.divider),
|
|
672
674
|
"aria-hidden": !0
|
|
673
675
|
}),
|
|
674
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ k("div", {
|
|
675
677
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
676
|
-
children: [/* @__PURE__ */
|
|
677
|
-
onClick:
|
|
678
|
-
label:
|
|
679
|
-
iconBefore: /* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ O(f, {
|
|
679
|
+
onClick: Z,
|
|
680
|
+
label: p,
|
|
681
|
+
iconBefore: /* @__PURE__ */ O(ie, {
|
|
680
682
|
size: c.SM,
|
|
681
683
|
"aria-hidden": !0,
|
|
682
684
|
stroke: l
|
|
683
685
|
}),
|
|
684
|
-
disabled:
|
|
685
|
-
}), B && /* @__PURE__ */
|
|
686
|
-
label:
|
|
687
|
-
onClick:
|
|
688
|
-
disabled:
|
|
686
|
+
disabled: d || B
|
|
687
|
+
}), B && /* @__PURE__ */ O(f, {
|
|
688
|
+
label: m,
|
|
689
|
+
onClick: xe,
|
|
690
|
+
disabled: d,
|
|
691
|
+
[be]: ""
|
|
689
692
|
})]
|
|
690
693
|
})
|
|
691
694
|
]
|
|
692
695
|
});
|
|
693
|
-
}, $ = { panel: "dial-publish-panel-panel" },
|
|
696
|
+
}, $ = { panel: "dial-publish-panel-panel" }, xe = {
|
|
694
697
|
summaryTitle: "_summaryTitle_tf20a_1",
|
|
695
698
|
sectionHeading: "_sectionHeading_tf20a_5"
|
|
696
|
-
},
|
|
697
|
-
let { colors:
|
|
698
|
-
...
|
|
699
|
-
"--pp-summary-title-text":
|
|
700
|
-
"--pp-heading-text":
|
|
699
|
+
}, Se = 200, Ce = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: g, hasSubmitError: v = !1, allowReplace: y = !0, author: b, onAuthorChange: x, publishCredentials: S = !1, onPublishCredentialsChange: ne, rules: w, onRulesChange: D, ruleSourceOptions: re, isRulesLoading: ie = !1, hasRulesLoadError: ae = !1, labels: oe = {}, summaryTitleClassName: se = "dial-body-semi-text", headingClassName: A = "dial-body-semi-text", styles: N = {} }) => {
|
|
700
|
+
let { colors: P, folderTree: ce, accessRules: F } = N, I = {
|
|
701
|
+
...T({
|
|
702
|
+
"--pp-summary-title-text": P?.summaryTitleText,
|
|
703
|
+
"--pp-heading-text": P?.headingText
|
|
701
704
|
}),
|
|
702
|
-
...
|
|
703
|
-
},
|
|
704
|
-
border:
|
|
705
|
-
background:
|
|
706
|
-
versionTagBorder:
|
|
707
|
-
versionTagBackground:
|
|
708
|
-
versionTagText:
|
|
709
|
-
}, { folderLabel:
|
|
710
|
-
|
|
711
|
-
},
|
|
712
|
-
hasSelectedFolder:
|
|
705
|
+
...N.cssVars
|
|
706
|
+
}, L = {
|
|
707
|
+
border: P?.summaryBorder,
|
|
708
|
+
background: P?.summaryBackground,
|
|
709
|
+
versionTagBorder: P?.summaryVersionTagBorder,
|
|
710
|
+
versionTagBackground: P?.summaryVersionTagBackground,
|
|
711
|
+
versionTagText: P?.summaryVersionTagText
|
|
712
|
+
}, { folderLabel: R = "Publish to folder", replaceWarning: z = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: B = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: le = "Publishing failed. Please try again.", folderEmptyStateLabel: V, addSiblingFolderLabel: H, addChildFolderLabel: U, cancelCreatingFolderLabel: ue, createFolderEmptyNameError: W, createFolderInvalidNameError: de, createFolderDuplicateNameError: fe, rootFolderLabel: G = "Organization", summaryVersionLabel: K, accessRulesLabels: q, searchPlaceholder: J, clearSearchAriaLabel: pe, authorLabel: me = "Author", authorPlaceholder: he = "Author name", authorHint: Y = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: ge = "Publish with my credentials", credentialsHint: X = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [Z, ve] = a(""), ye = n(), be = (e) => {
|
|
713
|
+
ve(e ?? "");
|
|
714
|
+
}, Ce = o != null, Te = r(() => M({
|
|
715
|
+
hasSelectedFolder: Ce,
|
|
713
716
|
hasExistingPublicationInFolder: p,
|
|
714
|
-
hasWriteAccess:
|
|
715
|
-
isSubmitting:
|
|
716
|
-
hasSubmitError:
|
|
717
|
-
allowReplace:
|
|
717
|
+
hasWriteAccess: m,
|
|
718
|
+
isSubmitting: g,
|
|
719
|
+
hasSubmitError: v,
|
|
720
|
+
allowReplace: y
|
|
718
721
|
}), [
|
|
719
|
-
|
|
722
|
+
Ce,
|
|
720
723
|
p,
|
|
721
|
-
|
|
724
|
+
m,
|
|
725
|
+
g,
|
|
722
726
|
v,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
className: D("truncate", M, ye.summaryTitle),
|
|
727
|
+
y
|
|
728
|
+
]), De = Ce ? o[o.length - 1] ?? G : "", Oe = t ? t() : /* @__PURE__ */ O("span", {
|
|
729
|
+
className: E("truncate", se, xe.summaryTitle),
|
|
727
730
|
children: e?.title
|
|
728
731
|
});
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
className:
|
|
731
|
-
style:
|
|
732
|
-
children: [e?.type == null ? /* @__PURE__ */
|
|
733
|
-
colors:
|
|
732
|
+
return /* @__PURE__ */ k("div", {
|
|
733
|
+
className: E("flex flex-col gap-5", $.panel),
|
|
734
|
+
style: I,
|
|
735
|
+
children: [e?.type == null ? /* @__PURE__ */ O(C, {
|
|
736
|
+
colors: L,
|
|
734
737
|
children: Oe
|
|
735
|
-
}) : /* @__PURE__ */
|
|
738
|
+
}) : /* @__PURE__ */ O(C, {
|
|
736
739
|
item: {
|
|
737
740
|
type: e.type,
|
|
738
741
|
name: e.title,
|
|
739
742
|
version: e.version ?? "",
|
|
740
743
|
iconUrl: e.iconUrl
|
|
741
744
|
},
|
|
742
|
-
versionLabel:
|
|
743
|
-
colors:
|
|
744
|
-
}), /* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
className:
|
|
747
|
-
children:
|
|
745
|
+
versionLabel: K,
|
|
746
|
+
colors: L
|
|
747
|
+
}), /* @__PURE__ */ k("div", { children: [
|
|
748
|
+
/* @__PURE__ */ O("div", {
|
|
749
|
+
className: E("mb-2", A, xe.sectionHeading),
|
|
750
|
+
children: R
|
|
748
751
|
}),
|
|
749
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ O("div", {
|
|
750
753
|
role: "search",
|
|
751
754
|
className: "mb-3",
|
|
752
|
-
children: /* @__PURE__ */
|
|
753
|
-
value:
|
|
754
|
-
onChange:
|
|
755
|
-
placeholder:
|
|
756
|
-
clearLabel:
|
|
757
|
-
"aria-label":
|
|
755
|
+
children: /* @__PURE__ */ O(te, {
|
|
756
|
+
value: Z,
|
|
757
|
+
onChange: be,
|
|
758
|
+
placeholder: J,
|
|
759
|
+
clearLabel: pe,
|
|
760
|
+
"aria-label": J
|
|
758
761
|
})
|
|
759
762
|
}),
|
|
760
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ O(Q, {
|
|
761
764
|
items: i,
|
|
762
765
|
selectedPath: o,
|
|
763
766
|
onSelectedPathChange: c,
|
|
@@ -765,114 +768,114 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
765
768
|
expandedPaths: u,
|
|
766
769
|
onExpandedPathsChange: d,
|
|
767
770
|
loadingPaths: f,
|
|
768
|
-
searchQuery:
|
|
769
|
-
disabled:
|
|
770
|
-
noResultsLabel:
|
|
771
|
-
addSiblingFolderLabel:
|
|
772
|
-
addChildFolderLabel:
|
|
773
|
-
cancelCreatingFolderLabel:
|
|
774
|
-
emptyFolderNameError:
|
|
775
|
-
invalidFolderNameError:
|
|
776
|
-
duplicateFolderNameError:
|
|
777
|
-
rootLabel:
|
|
778
|
-
styles:
|
|
771
|
+
searchQuery: Z,
|
|
772
|
+
disabled: g,
|
|
773
|
+
noResultsLabel: V,
|
|
774
|
+
addSiblingFolderLabel: H,
|
|
775
|
+
addChildFolderLabel: U,
|
|
776
|
+
cancelCreatingFolderLabel: ue,
|
|
777
|
+
emptyFolderNameError: W,
|
|
778
|
+
invalidFolderNameError: de,
|
|
779
|
+
duplicateFolderNameError: fe,
|
|
780
|
+
rootLabel: G,
|
|
781
|
+
styles: ce
|
|
779
782
|
}),
|
|
780
|
-
|
|
783
|
+
Te.calloutKind !== j.None && Te.calloutKind !== j.Info && /* @__PURE__ */ O("div", {
|
|
781
784
|
className: "mt-3",
|
|
782
|
-
children: /* @__PURE__ */
|
|
783
|
-
type:
|
|
784
|
-
variant:
|
|
785
|
-
message:
|
|
786
|
-
replaceWarning:
|
|
787
|
-
noAccessError:
|
|
788
|
-
submitError:
|
|
785
|
+
children: /* @__PURE__ */ O(_, {
|
|
786
|
+
type: ee.SectionMessage,
|
|
787
|
+
variant: we(Te.calloutKind),
|
|
788
|
+
message: Ee(Te.calloutKind, {
|
|
789
|
+
replaceWarning: z,
|
|
790
|
+
noAccessError: B,
|
|
791
|
+
submitError: le,
|
|
789
792
|
folderName: De,
|
|
790
793
|
version: e?.version
|
|
791
794
|
})
|
|
792
795
|
})
|
|
793
796
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ O("div", {
|
|
795
798
|
className: "mt-4",
|
|
796
|
-
children: /* @__PURE__ */
|
|
797
|
-
id:
|
|
798
|
-
labelProps: { label:
|
|
799
|
-
placeholder:
|
|
800
|
-
caption:
|
|
801
|
-
value:
|
|
802
|
-
onChange: (e) =>
|
|
803
|
-
maxLength:
|
|
804
|
-
disabled:
|
|
799
|
+
children: /* @__PURE__ */ O(h, {
|
|
800
|
+
id: ye,
|
|
801
|
+
labelProps: { label: me },
|
|
802
|
+
placeholder: he,
|
|
803
|
+
caption: Y,
|
|
804
|
+
value: b,
|
|
805
|
+
onChange: (e) => x(e ?? ""),
|
|
806
|
+
maxLength: Se,
|
|
807
|
+
disabled: g
|
|
805
808
|
})
|
|
806
809
|
}),
|
|
807
|
-
|
|
810
|
+
ne != null && /* @__PURE__ */ O("div", {
|
|
808
811
|
className: "mt-4",
|
|
809
|
-
children: /* @__PURE__ */
|
|
810
|
-
labelProps: { label:
|
|
811
|
-
caption:
|
|
812
|
-
isSelected:
|
|
813
|
-
onChange:
|
|
814
|
-
disabled:
|
|
812
|
+
children: /* @__PURE__ */ O(s, {
|
|
813
|
+
labelProps: { label: ge },
|
|
814
|
+
caption: X,
|
|
815
|
+
isSelected: S,
|
|
816
|
+
onChange: ne,
|
|
817
|
+
disabled: g
|
|
815
818
|
})
|
|
816
819
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ O("div", {
|
|
818
821
|
className: "mt-4",
|
|
819
|
-
children: /* @__PURE__ */
|
|
820
|
-
rules:
|
|
821
|
-
onRulesChange:
|
|
822
|
-
sourceOptions:
|
|
823
|
-
folderName:
|
|
824
|
-
disabled:
|
|
825
|
-
isLoading:
|
|
826
|
-
hasLoadError:
|
|
827
|
-
labels:
|
|
828
|
-
styles:
|
|
822
|
+
children: /* @__PURE__ */ O(_e, {
|
|
823
|
+
rules: w,
|
|
824
|
+
onRulesChange: D,
|
|
825
|
+
sourceOptions: re,
|
|
826
|
+
folderName: Ce ? De : void 0,
|
|
827
|
+
disabled: g,
|
|
828
|
+
isLoading: ie,
|
|
829
|
+
hasLoadError: ae,
|
|
830
|
+
labels: q,
|
|
831
|
+
styles: F
|
|
829
832
|
})
|
|
830
833
|
})
|
|
831
834
|
] })]
|
|
832
835
|
});
|
|
833
|
-
},
|
|
836
|
+
}, we = (e) => e === j.ReplaceWarning ? v.Warning : v.Error, Te = (e, t) => {
|
|
834
837
|
let [n, r, ...i] = e.split("{folder}");
|
|
835
|
-
return r === void 0 || i.length > 0 ? e : /* @__PURE__ */
|
|
838
|
+
return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ k(D, { children: [
|
|
836
839
|
n,
|
|
837
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ O("strong", {
|
|
838
841
|
className: "font-semibold",
|
|
839
842
|
children: t
|
|
840
843
|
}),
|
|
841
844
|
r
|
|
842
845
|
] });
|
|
843
|
-
},
|
|
844
|
-
let
|
|
845
|
-
return /* @__PURE__ */
|
|
846
|
-
style:
|
|
847
|
-
className:
|
|
848
|
-
children: [/* @__PURE__ */
|
|
849
|
-
label:
|
|
846
|
+
}, Ee = (e, t) => e === j.ReplaceWarning ? Te(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName) : e === j.NoAccess ? Te(t.noAccessError, t.folderName) : t.submitError, De = { footer: "_footer_dks1v_1" }, Oe = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, labels: s = {}, colors: l }) => {
|
|
847
|
+
let u = T({ "--pf-border": l?.border }), { cancelLabel: d = "Cancel", publishDefaultLabel: p = "Publish", updateLabel: m = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = s, _ = i ? h : n && t && e != null ? m.replace("{version}", e) : p;
|
|
848
|
+
return /* @__PURE__ */ k("div", {
|
|
849
|
+
style: u,
|
|
850
|
+
className: E("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", De.footer),
|
|
851
|
+
children: [/* @__PURE__ */ O(f, {
|
|
852
|
+
label: d,
|
|
850
853
|
className: "mobile:flex-1",
|
|
851
|
-
disabled:
|
|
852
|
-
onClick: i
|
|
853
|
-
}), /* @__PURE__ */ k(h, {
|
|
854
|
-
label: g,
|
|
855
|
-
className: "mobile:flex-1",
|
|
856
|
-
disabled: n,
|
|
857
|
-
iconBefore: r ? /* @__PURE__ */ k(S, { size: c.SM }) : void 0,
|
|
854
|
+
disabled: i,
|
|
858
855
|
onClick: a
|
|
856
|
+
}), /* @__PURE__ */ O(g, {
|
|
857
|
+
label: _,
|
|
858
|
+
className: "mobile:flex-1",
|
|
859
|
+
disabled: r,
|
|
860
|
+
iconBefore: i ? /* @__PURE__ */ O(x, { size: c.SM }) : void 0,
|
|
861
|
+
onClick: o
|
|
859
862
|
})]
|
|
860
863
|
});
|
|
861
|
-
},
|
|
864
|
+
}, ke = {
|
|
862
865
|
backdrop: "_backdrop_16jmd_6",
|
|
863
866
|
panel: "_panel_16jmd_10",
|
|
864
867
|
divider: "_divider_16jmd_15",
|
|
865
868
|
content: "_content_16jmd_19",
|
|
866
869
|
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
|
-
}), [
|
|
870
|
+
}, Ae = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: te, onRulesChange: y, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: ne = !1, onClose: C, returnFocusRef: w, onSubmit: D, panelLabels: re, panelStyles: ie, footerLabels: ae, labels: oe = {}, titleClassName: se = "dial-body-semi-text", colors: A }) => {
|
|
871
|
+
let j = T({
|
|
872
|
+
"--spp-backdrop-bg": A?.backdropBackground,
|
|
873
|
+
"--spp-panel-bg": A?.panelBackground,
|
|
874
|
+
"--spp-panel-border": A?.panelBorder,
|
|
875
|
+
"--spp-divider-border": A?.dividerBorder,
|
|
876
|
+
"--spp-scrollbar-thumb": A?.scrollbarThumb,
|
|
877
|
+
"--spp-title-text": A?.titleText
|
|
878
|
+
}), [N, P] = a(null), { title: ce = "Publish", ariaLabel: F = "Publish", closeAriaLabel: I = "Close" } = oe, L = r(() => M({
|
|
876
879
|
hasSelectedFolder: s != null,
|
|
877
880
|
hasExistingPublicationInFolder: p,
|
|
878
881
|
hasWriteAccess: m,
|
|
@@ -888,7 +891,7 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
888
891
|
_
|
|
889
892
|
]);
|
|
890
893
|
return t(() => {
|
|
891
|
-
let t =
|
|
894
|
+
let t = N?.closest("[role=\"dialog\"]");
|
|
892
895
|
if (!e || !t) return;
|
|
893
896
|
let n = () => t.focus({ preventScroll: !0 });
|
|
894
897
|
n();
|
|
@@ -898,36 +901,36 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
898
901
|
document.addEventListener("focusin", r);
|
|
899
902
|
let i = requestAnimationFrame(() => {
|
|
900
903
|
document.removeEventListener("focusin", r);
|
|
901
|
-
}), a =
|
|
904
|
+
}), a = w?.current;
|
|
902
905
|
return () => {
|
|
903
906
|
cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
|
|
904
907
|
};
|
|
905
908
|
}, [
|
|
906
909
|
e,
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
]), /* @__PURE__ */
|
|
910
|
+
N,
|
|
911
|
+
w
|
|
912
|
+
]), /* @__PURE__ */ k(b, {
|
|
910
913
|
open: e,
|
|
911
|
-
onClose:
|
|
912
|
-
header: /* @__PURE__ */
|
|
913
|
-
className:
|
|
914
|
-
children:
|
|
914
|
+
onClose: C,
|
|
915
|
+
header: /* @__PURE__ */ O("span", {
|
|
916
|
+
className: E("block truncate text-center", se, ke.title),
|
|
917
|
+
children: ce
|
|
915
918
|
}),
|
|
916
|
-
ariaLabel:
|
|
917
|
-
closeAriaLabel:
|
|
919
|
+
ariaLabel: F,
|
|
920
|
+
closeAriaLabel: I,
|
|
918
921
|
closeDisabled: h,
|
|
919
|
-
style:
|
|
920
|
-
overlayStyle:
|
|
921
|
-
className:
|
|
922
|
-
overlayClassName:
|
|
923
|
-
headerClassName:
|
|
922
|
+
style: j,
|
|
923
|
+
overlayStyle: j,
|
|
924
|
+
className: ke.panel,
|
|
925
|
+
overlayClassName: ke.backdrop,
|
|
926
|
+
headerClassName: E("px-[22px]", ke.divider),
|
|
924
927
|
bodyClassName: "flex flex-col overflow-hidden",
|
|
925
|
-
children: [/* @__PURE__ */
|
|
926
|
-
ref:
|
|
927
|
-
className:
|
|
928
|
-
children: /* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ O("div", {
|
|
929
|
+
ref: P,
|
|
930
|
+
className: E("min-h-0 flex-1 overflow-y-auto", ke.content),
|
|
931
|
+
children: /* @__PURE__ */ O("div", {
|
|
929
932
|
className: "p-[22px]",
|
|
930
|
-
children: /* @__PURE__ */
|
|
933
|
+
children: /* @__PURE__ */ O(Ce, {
|
|
931
934
|
resource: n,
|
|
932
935
|
renderSummary: i,
|
|
933
936
|
folderItems: o,
|
|
@@ -942,27 +945,28 @@ var M = /* @__PURE__ */ function(e) {
|
|
|
942
945
|
isSubmitting: h,
|
|
943
946
|
hasSubmitError: g,
|
|
944
947
|
allowReplace: _,
|
|
945
|
-
author:
|
|
946
|
-
onAuthorChange:
|
|
947
|
-
rules:
|
|
948
|
-
onRulesChange:
|
|
949
|
-
ruleSourceOptions:
|
|
950
|
-
isRulesLoading:
|
|
951
|
-
hasRulesLoadError:
|
|
952
|
-
labels:
|
|
953
|
-
styles:
|
|
948
|
+
author: ee,
|
|
949
|
+
onAuthorChange: v,
|
|
950
|
+
rules: te,
|
|
951
|
+
onRulesChange: y,
|
|
952
|
+
ruleSourceOptions: x,
|
|
953
|
+
isRulesLoading: S,
|
|
954
|
+
hasRulesLoadError: ne,
|
|
955
|
+
labels: re,
|
|
956
|
+
styles: ie
|
|
954
957
|
})
|
|
955
958
|
})
|
|
956
|
-
}), /* @__PURE__ */
|
|
959
|
+
}), /* @__PURE__ */ O(Oe, {
|
|
957
960
|
version: n?.version,
|
|
958
961
|
hasExistingPublicationInFolder: p,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
962
|
+
allowReplace: _,
|
|
963
|
+
isSubmitDisabled: L.isSubmitDisabled,
|
|
964
|
+
isSubmitLoading: L.isSubmitLoading,
|
|
965
|
+
onCancel: C,
|
|
966
|
+
onSubmit: D,
|
|
967
|
+
labels: ae
|
|
964
968
|
})]
|
|
965
969
|
});
|
|
966
970
|
};
|
|
967
971
|
//#endregion
|
|
968
|
-
export { $ as PUBLISH_PANEL_CLASS,
|
|
972
|
+
export { $ as PUBLISH_PANEL_CLASS, A as PublicationRuleFunction, he as PublishAccessRuleEditor, _e as PublishAccessRules, j as PublishCalloutKind, Q as PublishFoldersTree, Oe as PublishFooter, ve as PublishHistoryList, Ce as PublishPanel, Ae as StandalonePublishPanel, V as collectFolderKeys, M as derivePublishState, L as filterFolderTree, P as formatPublishedDate, U as fromFolderPathKey, G as getSiblingFolderNames, fe as getUniqueFolderName, le as mergeFolderPaths, z as sortFolderTree, ue as toDialFileTree, H as toFolderPathKey, I as usePublishFlow, de as validateFolderName };
|