@epam/ai-dial-publish-panel 1.3.0-dev.353 → 1.3.0-dev.355

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PublishFoldersTree.d.ts","sourceRoot":"","sources":["../../../src/components/PublishFoldersTree/PublishFoldersTree.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAAwC,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AA6BjF,+MAA+M;AAC/M,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAwa1D,CAAC"}
1
+ {"version":3,"file":"PublishFoldersTree.d.ts","sourceRoot":"","sources":["../../../src/components/PublishFoldersTree/PublishFoldersTree.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAAwC,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AA6BjF,+MAA+M;AAC/M,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAmb1D,CAAC"}
package/index.js CHANGED
@@ -1,6 +1,6 @@
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 { BottomSheet as o, ButtonVariant as s, Checkbox as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, ElementSize as f, ErrorText as p, FolderName as m, GhostButton as h, GhostIconButton as g, Highlight as _, Input as ee, LinkButton as v, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Notification as C, NotificationType as w, NotificationVariant as T, PrimaryButton as E, RadioGroup as D, Search as O, Select as k, SideDrawer as A, Spinner as j, Tag as M, TagInput as N } from "@epam/ai-dial-ui-kit";
3
- import { ResourceSummary as P, TAG_INPUT_TAG_CLASS_NAME as te, buildCssVars as ne, mergeClasses as F, useIsMobile as I } from "@epam/ai-dial-chat-shared";
2
+ import { BottomSheet as o, ButtonVariant as s, Checkbox as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, ElementSize as f, ErrorText as p, FolderName as m, GhostButton as h, GhostIconButton as g, Highlight as _, Input as ee, LinkButton as v, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Notification as C, NotificationType as w, NotificationVariant as T, PrimaryButton as E, RadioGroup as D, Search as O, Select as k, SideDrawer as A, Spinner as j, Tag as M, TagInput as te } from "@epam/ai-dial-ui-kit";
3
+ import { ResourceSummary as N, TAG_INPUT_TAG_CLASS_NAME as P, buildCssVars as ne, mergeClasses as F, useIsMobile as I } from "@epam/ai-dial-chat-shared";
4
4
  import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
5
5
  import { IconFolder as B, IconFolderPlus as re, IconPlus as ie, IconTrashX as ae } from "@tabler/icons-react";
6
6
  import { DialFileNodeType as oe, DialFoldersTree as se } from "@epam/ai-dial-react-file-manager";
@@ -33,14 +33,14 @@ var V = /* @__PURE__ */ function(e) {
33
33
  calloutKind: H.None,
34
34
  isSubmitDisabled: !0,
35
35
  isSubmitLoading: !1
36
- }, ce = 864e5, W = (e, t = Date.now(), n) => {
37
- let r = Math.floor((t - e) / ce);
36
+ }, W = 864e5, G = (e, t = Date.now(), n) => {
37
+ let r = Math.floor((t - e) / W);
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
- }, le = (e, t, n) => t.length === 0 ? [...e, {
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,17 +51,17 @@ var V = /* @__PURE__ */ function(e) {
51
51
  }]
52
52
  } : {
53
53
  ...e,
54
- children: e.children ? le(e.children, t, n) : e.children
55
- }), G = (e, t, n) => {
54
+ children: e.children ? ce(e.children, t, n) : e.children
55
+ }), K = (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 ? G(e.children, t, n) : e.children
62
+ children: e.children ? K(e.children, t, n) : e.children
63
63
  });
64
- }, K = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
64
+ }, le = ({ 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);
@@ -70,7 +70,7 @@ var V = /* @__PURE__ */ function(e) {
70
70
  t(() => {
71
71
  j || O(c);
72
72
  }, [c, j]);
73
- let N = e((e) => {
73
+ let te = e((e) => {
74
74
  M(!0), O(e);
75
75
  }, []);
76
76
  t(() => {
@@ -90,7 +90,7 @@ var V = /* @__PURE__ */ function(e) {
90
90
  e = !0;
91
91
  };
92
92
  }, [g]);
93
- let P = r(() => {
93
+ let N = r(() => {
94
94
  if (!g) return !1;
95
95
  let e = g.join("/");
96
96
  return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
@@ -98,12 +98,12 @@ var V = /* @__PURE__ */ function(e) {
98
98
  i,
99
99
  n.version,
100
100
  g
101
- ]), te = e(async (e, t) => {
102
- h((n) => le(n, e, t));
101
+ ]), P = 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) => G(n, e, t)), b(!0);
106
+ h((n) => K(n, e, t)), b(!0);
107
107
  }
108
108
  }, [l]), ne = e(async () => {
109
109
  if (!g) return !1;
@@ -131,8 +131,8 @@ var V = /* @__PURE__ */ function(e) {
131
131
  folderItems: m,
132
132
  selectedFolderPath: g,
133
133
  setSelectedFolderPath: _,
134
- handleCreateFolder: te,
135
- hasExistingPublicationInFolder: P,
134
+ handleCreateFolder: P,
135
+ hasExistingPublicationInFolder: N,
136
136
  hasWriteAccess: !g || s(g),
137
137
  isSubmitting: ee,
138
138
  hasSubmitError: y,
@@ -141,7 +141,7 @@ var V = /* @__PURE__ */ function(e) {
141
141
  rules: x,
142
142
  setRules: S,
143
143
  author: D,
144
- setAuthor: N,
144
+ setAuthor: te,
145
145
  publishCredentials: k,
146
146
  setPublishCredentials: A,
147
147
  isRulesLoading: C,
@@ -180,47 +180,47 @@ var V = /* @__PURE__ */ function(e) {
180
180
  }), Y = (e) => [...e].sort((e, t) => de(e.name, t.name)).map((e) => e.children ? {
181
181
  ...e,
182
182
  children: Y(e.children)
183
- } : e), X = (e, t, n) => {
183
+ } : e), fe = (e, t, n) => {
184
184
  let [r, ...i] = t;
185
185
  if (r == null) return e;
186
186
  let a = [...n, r], o = e.find((e) => e.name === r);
187
187
  return o ? i.length ? e.map((e) => e === o ? {
188
188
  ...e,
189
- children: X(e.children ?? [], i, a)
189
+ children: fe(e.children ?? [], i, a)
190
190
  } : e) : e : [...e, {
191
191
  path: a,
192
192
  name: r,
193
- children: i.length ? X([], i, a) : void 0
193
+ children: i.length ? fe([], i, a) : void 0
194
194
  }];
195
- }, Z = (e, t) => t.reduce((e, t) => t.length ? X(e, t, []) : e, e), fe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? fe(e.children) : []]), Q = (e) => e.join("/"), pe = (e) => e.split("/").filter(Boolean), me = (e) => e.map((e) => {
196
- let t = Q(e.path);
195
+ }, X = (e, t) => t.reduce((e, t) => t.length ? fe(e, t, []) : e, e), pe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? pe(e.children) : []]), Z = (e) => e.join("/"), me = (e) => e.split("/").filter(Boolean), he = (e) => e.map((e) => {
196
+ let t = Z(e.path);
197
197
  return {
198
198
  path: t,
199
199
  name: e.name,
200
200
  folderId: t,
201
201
  nodeType: d.FOLDER,
202
- items: e.children ? me(e.children) : void 0
202
+ items: e.children ? he(e.children) : void 0
203
203
  };
204
- }), he = /[/\\:;,={}&"]/, ge = (e, t, n) => {
204
+ }), ge = /[/\\:;,={}&"]/, _e = (e, t, n) => {
205
205
  let r = e.trim();
206
- return r ? r.includes("..") || he.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
207
- }, _e = (e, t) => {
206
+ return r ? r.includes("..") || ge.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
207
+ }, ve = (e, t) => {
208
208
  let n = new Set(t.map((e) => e.toLowerCase()));
209
209
  if (!n.has(e.toLowerCase())) return e;
210
210
  let r = 2;
211
211
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
212
212
  return `${e} ${r}`;
213
- }, ve = (e, t) => {
213
+ }, ye = (e, t) => {
214
214
  if (t.length === 0) return e.map((e) => e.name);
215
- let n = Q(t), r = (e) => {
215
+ let n = Z(t), r = (e) => {
216
216
  for (let t of e) {
217
- if (Q(t.path) === n) return t;
217
+ if (Z(t.path) === n) return t;
218
218
  let e = t.children ? r(t.children) : void 0;
219
219
  if (e) return e;
220
220
  }
221
221
  };
222
222
  return (r(e)?.children ?? []).map((e) => e.name);
223
- }, ye = {
223
+ }, Q = {
224
224
  sheet: "_sheet_1jbwn_3",
225
225
  inline: "_inline_1jbwn_7",
226
226
  selectField: "_selectField_1jbwn_21",
@@ -244,11 +244,11 @@ var V = /* @__PURE__ */ function(e) {
244
244
  "--pare-select-border-focus": f.colors?.selectBorderFocus
245
245
  }),
246
246
  ...f.cssVars
247
- }, { sourceLabel: g = "Source", sourcePlaceholder: v = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: w = "Targets", targetsPlaceholder: T = "Add a target", targetsHintLabel: E = "Press Enter or comma to add a target.", patternLabel: D = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: A = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: P = "Save", cancelLabel: B = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, ie = n(), ae = n(), oe = n(), se = n(), H = i(null);
247
+ }, { sourceLabel: g = "Source", sourcePlaceholder: v = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: w = "Targets", targetsPlaceholder: T = "Add a target", targetsHintLabel: E = "Press Enter or comma to add a target.", patternLabel: D = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: A = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: N = "Save", cancelLabel: B = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, ie = n(), ae = n(), oe = n(), se = n(), H = i(null);
248
248
  t(() => {
249
249
  p || H.current?.focus();
250
250
  }, [p]);
251
- let [U, ce] = a(), [W, le] = a(), [G, K] = a([]), [q, ue] = a(""), [J, de] = a(!1), [Y, X] = a(""), [Z, fe] = a(!1), [Q, pe] = a(!1), me = F(ye.selectField, J && ye.selectFieldOpen), he = F(ye.selectField, Z && ye.selectFieldOpen), ge = r(() => e.map((e) => ({
251
+ let [U, W] = a(), [G, ce] = a(), [K, le] = a([]), [q, ue] = a(""), [J, de] = a(!1), [Y, fe] = a(""), [X, pe] = a(!1), [Z, me] = a(!1), he = F(Q.selectField, J && Q.selectFieldOpen), ge = F(Q.selectField, X && Q.selectFieldOpen), _e = r(() => e.map((e) => ({
252
252
  value: e,
253
253
  label: e,
254
254
  labelNode: Y.trim() ? /* @__PURE__ */ R(_, {
@@ -256,7 +256,7 @@ var V = /* @__PURE__ */ function(e) {
256
256
  query: Y,
257
257
  maxLines: 1
258
258
  }) : void 0
259
- })), [e, Y]), _e = r(() => [
259
+ })), [e, Y]), ve = r(() => [
260
260
  {
261
261
  value: V.Equal,
262
262
  label: b
@@ -273,59 +273,59 @@ var V = /* @__PURE__ */ function(e) {
273
273
  b,
274
274
  x,
275
275
  C
276
- ]), ve = W === V.Regex, xe = Ce(q), we = U != null && W != null && (ve ? xe : G.length > 0), $ = (e) => {
277
- ce(Array.isArray(e) ? e[0] : e), de(!1);
276
+ ]), ye = G === V.Regex, xe = Ce(q), we = U != null && G != null && (ye ? xe : K.length > 0), $ = (e) => {
277
+ W(Array.isArray(e) ? e[0] : e), de(!1);
278
278
  }, Te = (e) => {
279
279
  let t = Array.isArray(e) ? e[0] : e;
280
- W === V.Regex != (t === V.Regex) && (K([]), ue("")), le(t), fe(!1);
280
+ G === V.Regex != (t === V.Regex) && (le([]), ue("")), ce(t), pe(!1);
281
281
  }, Ee = (e) => {
282
282
  let t = [];
283
283
  for (let n of e) {
284
284
  let e = n.trim();
285
285
  if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= u)) break;
286
286
  }
287
- K(t);
287
+ le(t);
288
288
  }, De = () => {
289
- !we || U == null || W == null ? pe(!0) : s({
289
+ !we || U == null || G == null ? me(!0) : s({
290
290
  source: U,
291
- function: W,
292
- targets: ve ? [q.trim()] : G
291
+ function: G,
292
+ targets: ye ? [q.trim()] : K
293
293
  });
294
- }, Oe = (q.length > 0 || Q) && !xe, ke = (e) => {
294
+ }, Oe = (q.length > 0 || Z) && !xe, ke = (e) => {
295
295
  e.key === "Escape" && (e.stopPropagation(), c());
296
296
  }, Ae = /* @__PURE__ */ z(L, { children: [
297
297
  /* @__PURE__ */ R(k, {
298
298
  id: ae,
299
299
  labelProps: { label: g },
300
- options: ge,
300
+ options: _e,
301
301
  value: U,
302
302
  onChange: $,
303
303
  placeholder: v,
304
304
  searchable: e.length > Se,
305
305
  searchPlaceholder: v,
306
- onSearchQueryChange: X,
306
+ onSearchQueryChange: fe,
307
307
  disabled: l,
308
308
  open: J,
309
309
  onOpenChange: de,
310
- fieldClassName: me,
311
- invalid: Q && U == null,
312
- error: Q && U == null ? j : void 0
310
+ fieldClassName: he,
311
+ invalid: Z && U == null,
312
+ error: Z && U == null ? j : void 0
313
313
  }),
314
314
  /* @__PURE__ */ R(k, {
315
315
  labelProps: { label: y },
316
316
  id: oe,
317
- options: _e,
318
- value: W,
317
+ options: ve,
318
+ value: G,
319
319
  onChange: Te,
320
320
  placeholder: y,
321
321
  disabled: l,
322
- open: Z,
323
- onOpenChange: fe,
324
- fieldClassName: he,
325
- invalid: Q && W == null,
326
- error: Q && W == null ? j : void 0
322
+ open: X,
323
+ onOpenChange: pe,
324
+ fieldClassName: ge,
325
+ invalid: Z && G == null,
326
+ error: Z && G == null ? j : void 0
327
327
  }),
328
- ve ? /* @__PURE__ */ R(ee, {
328
+ ye ? /* @__PURE__ */ R(ee, {
329
329
  id: ie,
330
330
  labelProps: { label: D },
331
331
  placeholder: O,
@@ -333,17 +333,17 @@ var V = /* @__PURE__ */ function(e) {
333
333
  onChange: (e) => ue(e ?? ""),
334
334
  error: Oe ? A : void 0,
335
335
  disabled: l
336
- }) : /* @__PURE__ */ R(N, {
336
+ }) : /* @__PURE__ */ R(te, {
337
337
  id: se,
338
338
  labelProps: { label: w },
339
339
  placeholder: T,
340
- caption: Q && G.length === 0 ? void 0 : E,
341
- error: Q && G.length === 0 ? M : void 0,
342
- invalid: Q && G.length === 0,
343
- value: G,
340
+ caption: Z && K.length === 0 ? void 0 : E,
341
+ error: Z && K.length === 0 ? M : void 0,
342
+ invalid: Z && K.length === 0,
343
+ value: K,
344
344
  onChange: Ee,
345
345
  disabled: l,
346
- tagClassName: te
346
+ tagClassName: P
347
347
  }),
348
348
  /* @__PURE__ */ z("div", {
349
349
  className: "mt-auto flex justify-end gap-2 desktop:mt-2",
@@ -352,7 +352,7 @@ var V = /* @__PURE__ */ function(e) {
352
352
  onClick: c,
353
353
  disabled: l
354
354
  }), /* @__PURE__ */ R(S, {
355
- label: P,
355
+ label: N,
356
356
  onClick: De,
357
357
  disabled: l
358
358
  })]
@@ -363,7 +363,7 @@ var V = /* @__PURE__ */ function(e) {
363
363
  onClose: c,
364
364
  ariaLabel: re,
365
365
  style: m,
366
- className: ye.sheet,
366
+ className: Q.sheet,
367
367
  bodyClassName: "flex flex-col gap-3 p-4",
368
368
  children: Ae
369
369
  }) : /* @__PURE__ */ R("div", {
@@ -373,7 +373,7 @@ var V = /* @__PURE__ */ function(e) {
373
373
  tabIndex: -1,
374
374
  onKeyDown: ke,
375
375
  style: m,
376
- className: F("flex flex-none flex-col gap-3 rounded-lg p-3", ye.inline),
376
+ className: F("flex flex-none flex-col gap-3 rounded-lg p-3", Q.inline),
377
377
  children: Ae
378
378
  });
379
379
  }, $ = {
@@ -392,29 +392,29 @@ var V = /* @__PURE__ */ function(e) {
392
392
  "--par-rule-text": O.colors?.ruleText
393
393
  }),
394
394
  ...O.cssVars
395
- }, { heading: A = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: te = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: B = "Or", removeRuleAriaLabelTemplate: re = "Remove rule for {source}: {targets}", equalFunctionLabel: oe = "Equal", containFunctionLabel: se = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: H = "Loading existing rules…", loadErrorLabel: U = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: ce = "Rule added.", ruleRemovedAnnouncement: W = "Rule removed.", rulesClearedAnnouncement: le = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: K } = ee, q = n(), [ue, J] = a(!1), [de, Y] = a(""), X = i(null), Z = i(f);
395
+ }, { heading: A = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: 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: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: B = "Or", removeRuleAriaLabelTemplate: re = "Remove rule for {source}: {targets}", equalFunctionLabel: oe = "Equal", containFunctionLabel: se = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: H = "Loading existing rules…", loadErrorLabel: U = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: W = "Rule added.", ruleRemovedAnnouncement: G = "Rule removed.", rulesClearedAnnouncement: ce = "All rules cleared.", rulesLoadedAnnouncement: K = "Existing rules loaded for the selected folder.", editorLabels: le } = ee, q = n(), [ue, J] = a(!1), [de, Y] = a(""), fe = i(null), X = i(f);
396
396
  t(() => {
397
- Z.current && !f && e.length > 0 && Y(G), Z.current = f;
397
+ X.current && !f && e.length > 0 && Y(K), X.current = f;
398
398
  }, [
399
399
  f,
400
400
  e,
401
- G
401
+ K
402
402
  ]);
403
- let fe = () => {
404
- X.current = document.activeElement, J(!0);
405
- }, Q = () => {
406
- J(!1), X.current?.focus?.();
407
- }, pe = (t) => {
408
- r([...e, t]), Y(ce), Q();
403
+ let pe = () => {
404
+ fe.current = document.activeElement, J(!0);
405
+ }, Z = () => {
406
+ J(!1), fe.current?.focus?.();
409
407
  }, me = (t) => {
410
- r(e.filter((e, n) => n !== t)), Y(W);
411
- }, he = () => {
412
- r([]), Y(le);
413
- }, ge = {
408
+ r([...e, t]), Y(W), Z();
409
+ }, he = (t) => {
410
+ r(e.filter((e, n) => n !== t)), Y(G);
411
+ }, ge = () => {
412
+ r([]), Y(ce);
413
+ }, _e = {
414
414
  equal: oe,
415
415
  contain: se,
416
416
  regex: V
417
- }, _e = e.length >= m, ve = d || _e, ye = c != null && c !== "";
417
+ }, ve = e.length >= m, ye = d || ve, Q = c != null && c !== "";
418
418
  return /* @__PURE__ */ z("div", {
419
419
  role: "group",
420
420
  "aria-labelledby": q,
@@ -435,20 +435,20 @@ var V = /* @__PURE__ */ function(e) {
435
435
  }), e.length > 0 && /* @__PURE__ */ R(h, {
436
436
  variant: s.Primary,
437
437
  label: L,
438
- onClick: he,
438
+ onClick: ge,
439
439
  disabled: d
440
440
  })]
441
441
  }),
442
442
  /* @__PURE__ */ R("p", {
443
443
  className: F("mb-2", x, $.hint),
444
- children: ye ? M.replace("{folder}", c) : N
444
+ children: Q ? M.replace("{folder}", c) : te
445
445
  }),
446
- e.length > 0 && !ye && /* @__PURE__ */ R("div", {
446
+ e.length > 0 && !Q && /* @__PURE__ */ R("div", {
447
447
  className: "mb-2",
448
448
  children: /* @__PURE__ */ R(C, {
449
449
  type: w.SectionMessage,
450
450
  variant: T.Warning,
451
- message: P
451
+ message: N
452
452
  })
453
453
  }),
454
454
  f && /* @__PURE__ */ z("div", {
@@ -480,7 +480,7 @@ var V = /* @__PURE__ */ function(e) {
480
480
  children: e.source
481
481
  }),
482
482
  " ",
483
- Ee(e.function, ge),
483
+ Ee(e.function, _e),
484
484
  ": ",
485
485
  n
486
486
  ]
@@ -491,7 +491,7 @@ var V = /* @__PURE__ */ function(e) {
491
491
  stroke: u
492
492
  }),
493
493
  "aria-label": r,
494
- onClick: () => me(t),
494
+ onClick: () => he(t),
495
495
  disabled: d
496
496
  })]
497
497
  }, t);
@@ -499,11 +499,11 @@ var V = /* @__PURE__ */ function(e) {
499
499
  }),
500
500
  ue && /* @__PURE__ */ R(we, {
501
501
  sourceOptions: o,
502
- onSave: pe,
503
- onCancel: Q,
502
+ onSave: me,
503
+ onCancel: Z,
504
504
  disabled: d,
505
505
  maxTargets: _,
506
- labels: K,
506
+ labels: le,
507
507
  styles: O.editor
508
508
  }),
509
509
  /* @__PURE__ */ R("div", {
@@ -515,13 +515,13 @@ var V = /* @__PURE__ */ function(e) {
515
515
  "aria-hidden": !0,
516
516
  stroke: u
517
517
  }),
518
- onClick: fe,
519
- disabled: ve
518
+ onClick: pe,
519
+ disabled: ye
520
520
  })
521
521
  }),
522
- _e && /* @__PURE__ */ R("p", {
522
+ ve && /* @__PURE__ */ R("p", {
523
523
  className: F("mt-2", x, $.hint),
524
- children: te.replace("{max}", String(m))
524
+ children: P.replace("{max}", String(m))
525
525
  })
526
526
  ]
527
527
  });
@@ -581,7 +581,7 @@ var V = /* @__PURE__ */ function(e) {
581
581
  ]
582
582
  }), /* @__PURE__ */ R("span", {
583
583
  className: F(d, Oe.date),
584
- children: W(e.publishedAt)
584
+ children: G(e.publishedAt)
585
585
  })]
586
586
  }, `${e.version}-${n}`))
587
587
  });
@@ -613,7 +613,7 @@ var V = /* @__PURE__ */ function(e) {
613
613
  let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
614
614
  for (let e of t) {
615
615
  let [t, ...r] = e.split("/"), i = Me(t);
616
- i != null && r.length !== 0 && n.get(i)?.add(Q(r));
616
+ i != null && r.length !== 0 && n.get(i)?.add(Z(r));
617
617
  }
618
618
  return n;
619
619
  }, Be = {
@@ -623,74 +623,78 @@ var V = /* @__PURE__ */ function(e) {
623
623
  let A = {
624
624
  ...ne({ "--pft-divider": k.colors?.divider }),
625
625
  ...k.cssVars
626
- }, j = c != null, M = r(() => c ? Ie(c) : e, [c, e]), N = r(() => c ? Le(c) : [He], [c]), P = n;
626
+ }, j = c != null, M = r(() => c ? Ie(c) : e, [c, e]), te = i(M);
627
+ t(() => {
628
+ te.current = M;
629
+ }, [M]);
630
+ let N = r(() => c ? Le(c) : [He], [c]), P = n;
627
631
  j && (P = d ? Ne(d) : void 0);
628
- let te = (e) => {
632
+ let I = (e) => {
629
633
  j ? f?.(e ? Pe(e) : void 0) : o?.(e);
630
- }, [I, L] = a(() => new Set(P?.map((e, t) => Q(P.slice(0, t + 1))) ?? [])), B = r(() => c ? /* @__PURE__ */ new Set([...I, ...Re(c, (e) => e.expandedPaths)]) : void 0, [c, I]) ?? E ?? I, ae = r(() => c ? Re(c, (e) => e.loadingPaths) : O, [c, O]), V = (e) => {
634
+ }, [L, B] = a(() => new Set(P?.map((e, t) => Z(P.slice(0, t + 1))) ?? [])), ae = r(() => c ? /* @__PURE__ */ new Set([...L, ...Re(c, (e) => e.expandedPaths)]) : void 0, [c, L]) ?? E ?? L, V = r(() => c ? Re(c, (e) => e.loadingPaths) : O, [c, O]), H = (e) => {
631
635
  let t = new Set(e);
632
636
  for (let e of N) t.delete(e);
633
637
  if (c) {
634
- L(t);
638
+ B(t);
635
639
  let e = ze(c, t);
636
640
  for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
637
- } else D ? D(t) : L(t);
638
- }, [H, U] = a(null), [ce, W] = a(b), le = i(null), G = i(!1);
641
+ } else D ? D(t) : B(t);
642
+ }, [U, W] = a(null), [G, ce] = a(b), K = i(null), le = i(!1);
639
643
  t(() => {
640
644
  let e = (e) => {
641
- e.target instanceof Element && e.target.closest(`[${Ve}]`) && (G.current = !0);
645
+ e.target instanceof Element && e.target.closest(`[${Ve}]`) && (le.current = !0);
642
646
  };
643
647
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
644
648
  }, []);
645
- let K = m.trim(), q = H != null, ue = r(() => J(M, m), [M, m]), de = K.length > 0 && ue.length === 0, X = !q && K.length > 0, Z = r(() => {
646
- let e = X ? ue : M;
649
+ let q = m.trim(), ue = U != null, de = r(() => J(M, m), [M, m]), fe = q.length > 0 && de.length === 0, X = !ue && q.length > 0, ge = r(() => {
650
+ let e = X ? de : M;
647
651
  return j ? e : Y(e);
648
652
  }, [
649
653
  X,
650
- ue,
654
+ de,
651
655
  M,
652
656
  j
653
- ]), he = r(() => /* @__PURE__ */ new Set([...N, ...fe(Z)]), [N, Z]), ye = r(() => /* @__PURE__ */ new Set([...N, ...X ? he : B]), [
657
+ ]), Q = r(() => /* @__PURE__ */ new Set([...N, ...pe(ge)]), [N, ge]), be = r(() => /* @__PURE__ */ new Set([...N, ...X ? Q : ae]), [
654
658
  N,
655
659
  X,
656
- he,
657
- B
658
- ]), be = r(() => me(Z), [Z]), xe = r(() => X && be.length === 0 ? [] : j ? be : [{
660
+ Q,
661
+ ae
662
+ ]), xe = r(() => he(ge), [ge]), Se = r(() => X && xe.length === 0 ? [] : j ? xe : [{
659
663
  path: He,
660
664
  name: T,
661
665
  folderId: He,
662
666
  nodeType: oe.FOLDER,
663
- items: be
667
+ items: xe
664
668
  }], [
665
- be,
669
+ xe,
666
670
  T,
667
671
  X,
668
672
  j
669
- ]), Se = H ? Q(H) : null, Ce = {
673
+ ]), Ce = U ? Z(U) : null, we = {
670
674
  empty: S,
671
675
  invalid: C,
672
676
  duplicate: w
673
- }, we = (e) => {
677
+ }, $ = (e) => {
674
678
  if (!c) return !0;
675
679
  let t = Pe(e), n = c.find((e) => e.key === t?.rootKey);
676
680
  return n != null && n.canCreateFolders !== !1;
677
- }, $ = (() => {
681
+ }, Te = (() => {
678
682
  if (!c) return P ?? [];
679
- if (P && we(P)) return P;
683
+ if (P && $(P)) return P;
680
684
  let e = c.find((e) => e.canCreateFolders !== !1);
681
685
  return e ? Ne({
682
686
  rootKey: e.key,
683
687
  path: []
684
688
  }) : void 0;
685
- })(), Te = (e) => _e(de && ge(K, [], Ce) == null ? K : b, ve(M, e)), Ee = (e) => {
686
- U(e), W(Te(e)), le.current = null, G.current = !1;
687
- let t = Q(e);
688
- t && V(new Set(B).add(t));
689
- }, De = () => {
690
- $ && Ee($);
691
- }, Oe = (e) => {
692
- let t = pe(e.path);
693
- if (!we(t)) return [];
689
+ })(), Ee = (e) => ve(fe && _e(q, [], we) == null ? q : b, ye(M, e)), De = (e) => {
690
+ W(e), ce(Ee(e)), K.current = null, le.current = !1;
691
+ let t = Z(e);
692
+ t && H(new Set(ae).add(t));
693
+ }, Oe = () => {
694
+ Te && De(Te);
695
+ }, ke = (e) => {
696
+ let t = me(e.path);
697
+ if (!$(t)) return [];
694
698
  let n = [{
695
699
  key: "add-child",
696
700
  label: y,
@@ -699,7 +703,7 @@ var V = /* @__PURE__ */ function(e) {
699
703
  "aria-hidden": !0,
700
704
  stroke: u
701
705
  }),
702
- onClick: () => Ee(t)
706
+ onClick: () => De(t)
703
707
  }];
704
708
  return N.includes(e.path) || n.push({
705
709
  key: "add-sibling",
@@ -709,21 +713,21 @@ var V = /* @__PURE__ */ function(e) {
709
713
  "aria-hidden": !0,
710
714
  stroke: u
711
715
  }),
712
- onClick: () => Ee(t.slice(0, -1))
716
+ onClick: () => De(t.slice(0, -1))
713
717
  }), n;
714
- }, ke = (e) => {
715
- if (!H) return null;
716
- let t = ge(e, ve(M, H), Ce);
717
- return le.current = t, t;
718
718
  }, Ae = (e) => {
719
- if (!H || G.current) return;
720
- let t = e.trim(), n = le.current;
721
- if (!(ke(e) ?? n)) {
722
- let e = c ? Pe(H) : void 0;
723
- e ? p?.(e.rootKey, e.path, t) : s?.(H, t), te([...H, t]);
719
+ if (!U) return null;
720
+ let t = _e(e, ye(te.current, U), we);
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 ? Pe(U) : void 0;
727
+ e ? p?.(e.rootKey, e.path, t) : s?.(U, t), I([...U, t]);
724
728
  }
725
- U(null);
726
- }, je = () => U(null);
729
+ W(null);
730
+ }, Me = () => W(null);
727
731
  return /* @__PURE__ */ z("div", {
728
732
  style: A,
729
733
  className: F(g && "pointer-events-none opacity-60", k.className),
@@ -731,23 +735,24 @@ var V = /* @__PURE__ */ function(e) {
731
735
  /* @__PURE__ */ R("div", {
732
736
  className: F("w-full max-w-full min-w-0", Be.tree),
733
737
  children: /* @__PURE__ */ R(se, {
734
- items: xe,
738
+ items: Se,
735
739
  showFiles: !1,
736
- selectedPath: P == null ? void 0 : Q(P),
737
- expandedPaths: ye,
738
- onExpandedPathsChange: V,
739
- loadingPaths: ae,
740
+ selectedPath: P == null ? void 0 : Z(P),
741
+ expandedPaths: be,
742
+ onExpandedPathsChange: H,
743
+ loadingPaths: V,
740
744
  onItemClick: (e) => {
741
- let t = P != null && Q(P) === e.path;
742
- te(t ? void 0 : pe(e.path));
745
+ let t = P != null && Z(P) === e.path;
746
+ I(t ? void 0 : me(e.path));
743
747
  },
744
- getContextMenuItems: Oe,
745
- createdFolderPath: Se,
746
- newFolderDefaultName: ce,
747
- onCreateFolderSave: Ae,
748
- onCreateFolderCancel: je,
749
- onRenameValidate: (e) => ke(e),
750
- emptyStateTitle: X ? x.replace("{query}", K) : void 0
748
+ getContextMenuItems: ke,
749
+ createdFolderPath: Ce,
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
751
756
  })
752
757
  }),
753
758
  /* @__PURE__ */ R("div", {
@@ -757,17 +762,17 @@ var V = /* @__PURE__ */ function(e) {
757
762
  /* @__PURE__ */ z("div", {
758
763
  className: "mb-4 flex flex-wrap items-center gap-2",
759
764
  children: [/* @__PURE__ */ R(h, {
760
- onClick: De,
765
+ onClick: Oe,
761
766
  label: _,
762
767
  iconBefore: /* @__PURE__ */ R(ie, {
763
768
  size: l.SM,
764
769
  "aria-hidden": !0,
765
770
  stroke: u
766
771
  }),
767
- disabled: g || q || !$
768
- }), q && /* @__PURE__ */ R(h, {
772
+ disabled: g || ue || !Te
773
+ }), ue && /* @__PURE__ */ R(h, {
769
774
  label: ee,
770
- onClick: je,
775
+ onClick: Me,
771
776
  disabled: g,
772
777
  [Ve]: ""
773
778
  })]
@@ -778,18 +783,18 @@ var V = /* @__PURE__ */ function(e) {
778
783
  summaryTitle: "_summaryTitle_zj3gd_1",
779
784
  sectionHeading: "_sectionHeading_zj3gd_5",
780
785
  destination: "_destination_zj3gd_9"
781
- }, qe = 200, Je = ({ view: e = q.Main, onChangeFolderClick: o, resource: s, renderSummary: d, folderItems: p, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: y, expandedPaths: b, onExpandedPathsChange: x, loadingPaths: S, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: D, hasSubmitError: k = !1, allowReplace: A = !0, author: j, onAuthorChange: M, publishCredentials: N = !1, onPublishCredentialsChange: te, rules: I, onRulesChange: L, ruleSourceOptions: re, isRulesLoading: ie = !1, hasRulesLoadError: ae = !1, labels: oe = {}, summaryTitleClassName: se = "dial-body-semi-text", headingClassName: V = "dial-body-semi-text", destinationClassName: ce = "dial-small-semi-text", calloutFolderNameClassName: W = "dial-small-paragraph-semi-text", styles: le = {} }) => {
782
- let { colors: G, folderTree: K, accessRules: ue } = le, J = {
786
+ }, qe = 200, Je = ({ view: e = q.Main, onChangeFolderClick: o, resource: s, renderSummary: d, folderItems: p, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: y, expandedPaths: b, onExpandedPathsChange: x, loadingPaths: S, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: D, hasSubmitError: k = !1, allowReplace: A = !0, author: j, onAuthorChange: M, publishCredentials: te = !1, onPublishCredentialsChange: P, rules: I, onRulesChange: L, ruleSourceOptions: re, isRulesLoading: ie = !1, hasRulesLoadError: ae = !1, labels: oe = {}, summaryTitleClassName: se = "dial-body-semi-text", headingClassName: V = "dial-body-semi-text", destinationClassName: W = "dial-small-semi-text", calloutFolderNameClassName: G = "dial-small-paragraph-semi-text", styles: ce = {} }) => {
787
+ let { colors: K, folderTree: le, accessRules: ue } = ce, J = {
783
788
  ...ne({
784
- "--pp-summary-title-text": G?.summaryTitleText,
785
- "--pp-heading-text": G?.headingText,
786
- "--pp-destination-text": G?.destinationText
789
+ "--pp-summary-title-text": K?.summaryTitleText,
790
+ "--pp-heading-text": K?.headingText,
791
+ "--pp-destination-text": K?.destinationText
787
792
  }),
788
- ...le.cssVars
793
+ ...ce.cssVars
789
794
  }, de = {
790
- border: G?.summaryBorder,
791
- background: G?.summaryBackground
792
- }, { folderLabel: Y = "Publish to folder", destinationAriaLabel: X = "Destination folder", noFolderSelectedLabel: Z = "No folder selected", changeFolderLabel: fe = "Change", chooseFolderLabel: Q = "Choose", replaceWarning: pe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: me = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: he = "Publishing failed. Please try again.", folderEmptyStateLabel: ge, addSiblingFolderLabel: _e, addChildFolderLabel: ve, cancelCreatingFolderLabel: ye, createFolderEmptyNameError: be, createFolderInvalidNameError: xe, createFolderDuplicateNameError: Se, rootFolderLabel: Ce = "Organization", accessRulesLabels: we, searchPlaceholder: $, clearSearchAriaLabel: Te, authorLabel: Ee = "Author", authorPlaceholder: Oe = "Author name", authorHint: ke = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ae = "Publish with my credentials", credentialsHint: je = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [Me, Ne] = a(""), Pe = n(), Fe = i(null), Ie = i(null), Le = (e) => {
795
+ border: K?.summaryBorder,
796
+ background: K?.summaryBackground
797
+ }, { folderLabel: Y = "Publish to folder", destinationAriaLabel: fe = "Destination folder", noFolderSelectedLabel: X = "No folder selected", changeFolderLabel: pe = "Change", chooseFolderLabel: Z = "Choose", replaceWarning: me = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: he = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: ge = "Publishing failed. Please try again.", folderEmptyStateLabel: _e, addSiblingFolderLabel: ve, addChildFolderLabel: ye, cancelCreatingFolderLabel: Q, createFolderEmptyNameError: be, createFolderInvalidNameError: xe, createFolderDuplicateNameError: Se, rootFolderLabel: Ce = "Organization", accessRulesLabels: we, searchPlaceholder: $, clearSearchAriaLabel: Te, authorLabel: Ee = "Author", authorPlaceholder: Oe = "Author name", authorHint: ke = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ae = "Publish with my credentials", credentialsHint: je = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [Me, Ne] = a(""), Pe = n(), Fe = i(null), Ie = i(null), Le = (e) => {
793
798
  Ne(e ?? "");
794
799
  }, Re = i(e);
795
800
  t(() => {
@@ -839,25 +844,25 @@ var V = /* @__PURE__ */ function(e) {
839
844
  loadingPaths: S,
840
845
  searchQuery: Me,
841
846
  disabled: D,
842
- noResultsLabel: ge,
843
- addSiblingFolderLabel: _e,
844
- addChildFolderLabel: ve,
845
- cancelCreatingFolderLabel: ye,
847
+ noResultsLabel: _e,
848
+ addSiblingFolderLabel: ve,
849
+ addChildFolderLabel: ye,
850
+ cancelCreatingFolderLabel: Q,
846
851
  emptyFolderNameError: be,
847
852
  invalidFolderNameError: xe,
848
853
  duplicateFolderNameError: Se,
849
854
  rootLabel: Ce,
850
- styles: K
855
+ styles: le
851
856
  })]
852
857
  });
853
- let Ue = F(ce, Ke.destination);
858
+ let Ue = F(W, Ke.destination);
854
859
  return /* @__PURE__ */ z("div", {
855
860
  className: F("flex flex-col gap-5", Ge.panel),
856
861
  style: J,
857
- children: [s?.type == null ? /* @__PURE__ */ R(P, {
862
+ children: [s?.type == null ? /* @__PURE__ */ R(N, {
858
863
  colors: de,
859
864
  children: He
860
- }) : /* @__PURE__ */ R(P, {
865
+ }) : /* @__PURE__ */ R(N, {
861
866
  item: {
862
867
  type: s.type,
863
868
  name: s.title,
@@ -875,19 +880,19 @@ var V = /* @__PURE__ */ function(e) {
875
880
  className: "flex min-w-0 items-center gap-2",
876
881
  children: [/* @__PURE__ */ R("div", {
877
882
  role: "group",
878
- "aria-label": X,
883
+ "aria-label": fe,
879
884
  className: "min-w-0 flex-1",
880
885
  children: ze ? /* @__PURE__ */ R(m, {
881
886
  name: [Ce, ...g].join(" / "),
882
887
  nameClassName: Ue
883
888
  }) : /* @__PURE__ */ R("span", {
884
889
  className: F("block truncate", Ue),
885
- children: Z
890
+ children: X
886
891
  })
887
892
  }), /* @__PURE__ */ R(h, {
888
893
  ref: Fe,
889
894
  size: f.Small,
890
- label: ze ? fe : Q,
895
+ label: ze ? pe : Z,
891
896
  iconBefore: /* @__PURE__ */ R(B, {
892
897
  size: l.SM,
893
898
  stroke: u,
@@ -903,12 +908,12 @@ var V = /* @__PURE__ */ function(e) {
903
908
  type: w.SectionMessage,
904
909
  variant: Ye(Be.calloutKind),
905
910
  message: Ze(Be.calloutKind, {
906
- replaceWarning: pe,
907
- noAccessError: me,
908
- submitError: he,
911
+ replaceWarning: me,
912
+ noAccessError: he,
913
+ submitError: ge,
909
914
  folderName: Ve,
910
915
  version: s?.version,
911
- folderNameClassName: W
916
+ folderNameClassName: G
912
917
  })
913
918
  })
914
919
  }),
@@ -925,13 +930,13 @@ var V = /* @__PURE__ */ function(e) {
925
930
  disabled: D
926
931
  })
927
932
  }),
928
- te != null && /* @__PURE__ */ R("div", {
933
+ P != null && /* @__PURE__ */ R("div", {
929
934
  className: "mt-4",
930
935
  children: /* @__PURE__ */ R(c, {
931
936
  labelProps: { label: Ae },
932
937
  caption: je,
933
- isSelected: N,
934
- onChange: te,
938
+ isSelected: te,
939
+ onChange: P,
935
940
  disabled: D
936
941
  })
937
942
  }),
@@ -993,7 +998,7 @@ var V = /* @__PURE__ */ function(e) {
993
998
  divider: "_divider_16jmd_15",
994
999
  content: "_content_16jmd_19",
995
1000
  title: "_title_16jmd_24"
996
- }, tt = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: y, onRulesChange: b, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: C = !1, onClose: w, returnFocusRef: T, onSubmit: E, panelLabels: D, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: N, labels: P = {}, titleClassName: te = "dial-body-semi-text", colors: I }) => {
1001
+ }, tt = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: y, onRulesChange: b, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: C = !1, onClose: w, returnFocusRef: T, onSubmit: E, panelLabels: D, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: te, labels: N = {}, titleClassName: P = "dial-body-semi-text", colors: I }) => {
997
1002
  let L = ne({
998
1003
  "--spp-backdrop-bg": I?.backdropBackground,
999
1004
  "--spp-panel-bg": I?.panelBackground,
@@ -1001,11 +1006,11 @@ var V = /* @__PURE__ */ function(e) {
1001
1006
  "--spp-divider-border": I?.dividerBorder,
1002
1007
  "--spp-scrollbar-thumb": I?.scrollbarThumb,
1003
1008
  "--spp-title-text": I?.titleText
1004
- }), [B, re] = a(null), { title: ie = "Publish", changeFolderTitle: ae = "Change folder", backAriaLabel: oe = "Back", ariaLabel: se = "Publish", closeAriaLabel: V = "Close" } = P, H = ue({
1009
+ }), [B, re] = a(null), { title: ie = "Publish", changeFolderTitle: ae = "Change folder", backAriaLabel: oe = "Back", ariaLabel: se = "Publish", closeAriaLabel: V = "Close" } = N, H = ue({
1005
1010
  isOpen: e,
1006
1011
  selectedFolderPath: s,
1007
1012
  onSelectedFolderPathChange: c
1008
- }), ce = H.view === q.ChangeFolder, W = r(() => U({
1013
+ }), W = H.view === q.ChangeFolder, G = r(() => U({
1009
1014
  hasSelectedFolder: s != null,
1010
1015
  hasExistingPublicationInFolder: p,
1011
1016
  hasWriteAccess: m,
@@ -1043,11 +1048,11 @@ var V = /* @__PURE__ */ function(e) {
1043
1048
  open: e,
1044
1049
  onClose: w,
1045
1050
  header: /* @__PURE__ */ R("span", {
1046
- className: F("block truncate text-center", te, et.title),
1047
- children: ce ? ae : ie
1051
+ className: F("block truncate text-center", P, et.title),
1052
+ children: W ? ae : ie
1048
1053
  }),
1049
1054
  ariaLabel: se,
1050
- onBack: ce ? H.backToMain : void 0,
1055
+ onBack: W ? H.backToMain : void 0,
1051
1056
  backAriaLabel: oe,
1052
1057
  backDisabled: h,
1053
1058
  closeAriaLabel: V,
@@ -1099,14 +1104,14 @@ var V = /* @__PURE__ */ function(e) {
1099
1104
  version: n?.version,
1100
1105
  hasExistingPublicationInFolder: p,
1101
1106
  allowReplace: _,
1102
- isSubmitDisabled: W.isSubmitDisabled,
1103
- isSubmitLoading: W.isSubmitLoading,
1104
- onCancel: ce ? H.backToMain : w,
1107
+ isSubmitDisabled: G.isSubmitDisabled,
1108
+ isSubmitLoading: G.isSubmitLoading,
1109
+ onCancel: W ? H.backToMain : w,
1105
1110
  onSubmit: E,
1106
1111
  view: H.view,
1107
1112
  onSelectFolder: H.selectFolder,
1108
1113
  isSelectFolderDisabled: H.pendingFolderPath == null,
1109
- labels: N
1114
+ labels: te
1110
1115
  })]
1111
1116
  });
1112
1117
  }, nt = /* @__PURE__ */ function(e) {
@@ -1117,16 +1122,16 @@ var V = /* @__PURE__ */ function(e) {
1117
1122
  heading: "_heading_vk731_1",
1118
1123
  destination: "_destination_vk731_5"
1119
1124
  }, at = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: c, changeFolderButtonRef: d, pendingDestination: g, onPendingDestinationChange: _, version: b, accessRules: S, isSubmitting: C = !1, submitError: w, foldersError: T, onRetryFolders: E, panelLabels: k = {}, panelStyles: A = {}, headingClassName: j = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
1120
- let { saveToFolderHeading: N = "Save to folder", changeFolderLabel: te = "Change", destinationAriaLabel: I = "Destination folder", versionHeading: L = "Version", keepVersionLabel: re = "Keep version {version}", saveAsNewVersionLabel: ie = "Save as new version", newVersionLabel: ae = "Version", newVersionPlaceholder: oe = "Enter new version", searchPlaceholder: se = "Search folders", clearSearchAriaLabel: V = "Clear search", folderEmptyStateLabel: H, createFolderLabel: U, cancelCreatingFolderLabel: ce, addSiblingFolderLabel: W, addChildFolderLabel: le, createFolderEmptyNameError: G, createFolderInvalidNameError: K, createFolderDuplicateNameError: q, retryLabel: ue = "Retry" } = k, { colors: J, folderTree: de } = A, Y = {
1125
+ let { saveToFolderHeading: te = "Save to folder", changeFolderLabel: P = "Change", destinationAriaLabel: I = "Destination folder", versionHeading: L = "Version", keepVersionLabel: re = "Keep version {version}", saveAsNewVersionLabel: ie = "Save as new version", newVersionLabel: ae = "Version", newVersionPlaceholder: oe = "Enter new version", searchPlaceholder: se = "Search folders", clearSearchAriaLabel: V = "Clear search", folderEmptyStateLabel: H, createFolderLabel: U, cancelCreatingFolderLabel: W, addSiblingFolderLabel: G, addChildFolderLabel: ce, createFolderEmptyNameError: K, createFolderInvalidNameError: le, createFolderDuplicateNameError: q, retryLabel: ue = "Retry" } = k, { colors: J, folderTree: de } = A, Y = {
1121
1126
  ...ne({
1122
1127
  "--stf-heading-text": J?.headingText,
1123
1128
  "--stf-destination-text": J?.destinationText
1124
1129
  }),
1125
1130
  ...A.cssVars
1126
- }, X = {
1131
+ }, fe = {
1127
1132
  border: J?.summaryBorder,
1128
1133
  background: J?.summaryBackground
1129
- }, [Z, fe] = a(""), Q = n(), pe = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), me = i.find((e) => e.key === g?.rootKey), he = g ? g.path[g.path.length - 1] ?? me?.label : void 0, ge = F(j, it.heading);
1134
+ }, [X, pe] = a(""), Z = n(), me = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), he = i.find((e) => e.key === g?.rootKey), ge = g ? g.path[g.path.length - 1] ?? he?.label : void 0, _e = F(j, it.heading);
1130
1135
  if (e === rt.ChangeFolder) return /* @__PURE__ */ z("div", {
1131
1136
  className: "flex flex-col gap-3",
1132
1137
  style: Y,
@@ -1134,8 +1139,8 @@ var V = /* @__PURE__ */ function(e) {
1134
1139
  /* @__PURE__ */ R("div", {
1135
1140
  role: "search",
1136
1141
  children: /* @__PURE__ */ R(O, {
1137
- value: Z,
1138
- onChange: (e) => fe(e ?? ""),
1142
+ value: X,
1143
+ onChange: (e) => pe(e ?? ""),
1139
1144
  placeholder: se,
1140
1145
  clearLabel: V,
1141
1146
  "aria-label": se
@@ -1156,25 +1161,25 @@ var V = /* @__PURE__ */ function(e) {
1156
1161
  destination: g,
1157
1162
  onDestinationChange: _,
1158
1163
  onCreateDestinationFolder: s,
1159
- searchQuery: Z,
1164
+ searchQuery: X,
1160
1165
  disabled: C,
1161
1166
  noResultsLabel: H,
1162
1167
  createFolderLabel: U,
1163
- cancelCreatingFolderLabel: ce,
1164
- addSiblingFolderLabel: W,
1165
- addChildFolderLabel: le,
1166
- emptyFolderNameError: G,
1167
- invalidFolderNameError: K,
1168
+ cancelCreatingFolderLabel: W,
1169
+ addSiblingFolderLabel: G,
1170
+ addChildFolderLabel: ce,
1171
+ emptyFolderNameError: K,
1172
+ invalidFolderNameError: le,
1168
1173
  duplicateFolderNameError: q,
1169
1174
  styles: de
1170
1175
  }),
1171
- S && me?.hasAccessRules && /* @__PURE__ */ R("div", {
1176
+ S && he?.hasAccessRules && /* @__PURE__ */ R("div", {
1172
1177
  className: "mt-1",
1173
1178
  children: /* @__PURE__ */ R(De, {
1174
1179
  rules: S.rules,
1175
1180
  onRulesChange: S.onRulesChange,
1176
1181
  sourceOptions: S.sourceOptions,
1177
- folderName: he,
1182
+ folderName: ge,
1178
1183
  disabled: C,
1179
1184
  isLoading: S.isLoading,
1180
1185
  hasLoadError: S.hasLoadError,
@@ -1184,14 +1189,14 @@ var V = /* @__PURE__ */ function(e) {
1184
1189
  })
1185
1190
  ]
1186
1191
  });
1187
- let _e = b ? [{
1192
+ let ve = b ? [{
1188
1193
  value: nt.Keep,
1189
1194
  label: re.replace("{version}", b.currentVersion)
1190
1195
  }, {
1191
1196
  value: nt.New,
1192
1197
  label: ie,
1193
1198
  content: /* @__PURE__ */ R(ee, {
1194
- id: Q,
1199
+ id: Z,
1195
1200
  value: b.newVersion,
1196
1201
  onChange: (e) => b.onNewVersionChange(e ?? ""),
1197
1202
  onBlur: b.onNewVersionBlur,
@@ -1209,13 +1214,13 @@ var V = /* @__PURE__ */ function(e) {
1209
1214
  className: "flex flex-col gap-5",
1210
1215
  style: Y,
1211
1216
  children: [
1212
- t.type == null ? /* @__PURE__ */ R(P, {
1213
- colors: X,
1217
+ t.type == null ? /* @__PURE__ */ R(N, {
1218
+ colors: fe,
1214
1219
  children: /* @__PURE__ */ R("span", {
1215
- className: F("truncate", ge),
1220
+ className: F("truncate", _e),
1216
1221
  children: t.title
1217
1222
  })
1218
- }) : /* @__PURE__ */ R(P, {
1223
+ }) : /* @__PURE__ */ R(N, {
1219
1224
  item: {
1220
1225
  type: t.type,
1221
1226
  name: t.title,
@@ -1223,13 +1228,13 @@ var V = /* @__PURE__ */ function(e) {
1223
1228
  iconUrl: t.iconUrl
1224
1229
  },
1225
1230
  hasVersionTag: !1,
1226
- colors: X
1231
+ colors: fe
1227
1232
  }),
1228
1233
  /* @__PURE__ */ z("section", {
1229
1234
  className: "flex flex-col gap-2",
1230
1235
  children: [/* @__PURE__ */ R("h2", {
1231
- className: ge,
1232
- children: N
1236
+ className: _e,
1237
+ children: te
1233
1238
  }), /* @__PURE__ */ z("div", {
1234
1239
  className: "flex min-w-0 items-center gap-2",
1235
1240
  children: [/* @__PURE__ */ R("div", {
@@ -1237,13 +1242,13 @@ var V = /* @__PURE__ */ function(e) {
1237
1242
  "aria-label": I,
1238
1243
  className: "min-w-0 flex-1",
1239
1244
  children: /* @__PURE__ */ R(m, {
1240
- name: pe.join(" / "),
1245
+ name: me.join(" / "),
1241
1246
  nameClassName: F(M, it.destination)
1242
1247
  })
1243
1248
  }), /* @__PURE__ */ R(h, {
1244
1249
  ref: d,
1245
1250
  size: f.Small,
1246
- label: te,
1251
+ label: P,
1247
1252
  iconBefore: /* @__PURE__ */ R(B, {
1248
1253
  size: l.SM,
1249
1254
  stroke: u,
@@ -1257,13 +1262,13 @@ var V = /* @__PURE__ */ function(e) {
1257
1262
  b && /* @__PURE__ */ z("section", {
1258
1263
  className: "flex flex-col gap-2",
1259
1264
  children: [/* @__PURE__ */ R("h2", {
1260
- className: ge,
1265
+ className: _e,
1261
1266
  children: L
1262
1267
  }), /* @__PURE__ */ R(D, {
1263
1268
  ariaLabel: L,
1264
1269
  value: b.versionMode,
1265
1270
  onChange: (e) => b.onVersionModeChange(e),
1266
- items: _e,
1271
+ items: ve,
1267
1272
  disabled: C
1268
1273
  })]
1269
1274
  }),
@@ -1288,13 +1293,13 @@ var V = /* @__PURE__ */ function(e) {
1288
1293
  "--sstf-divider-border": u?.dividerBorder,
1289
1294
  "--sstf-scrollbar-thumb": u?.scrollbarThumb,
1290
1295
  "--sstf-title-text": u?.titleText
1291
- }), [O, k] = a(rt.Main), [M, N] = a(f), P = i(null), te = i(null);
1296
+ }), [O, k] = a(rt.Main), [M, te] = a(f), N = i(null), P = i(null);
1292
1297
  t(() => {
1293
1298
  e && k(rt.Main);
1294
1299
  }, [e]);
1295
1300
  let I = i(O);
1296
1301
  t(() => {
1297
- I.current !== O && (I.current = O, O === rt.ChangeFolder ? P.current?.focus({ preventScroll: !0 }) : te.current?.focus({ preventScroll: !0 }));
1302
+ I.current !== O && (I.current = O, O === rt.ChangeFolder ? N.current?.focus({ preventScroll: !0 }) : P.current?.focus({ preventScroll: !0 }));
1298
1303
  }, [O]);
1299
1304
  let L = i(e);
1300
1305
  t(() => {
@@ -1302,7 +1307,7 @@ var V = /* @__PURE__ */ function(e) {
1302
1307
  L.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1303
1308
  }, [e, s]);
1304
1309
  let B = O === rt.ChangeFolder, re = (e) => {
1305
- N(e), g?.(e);
1310
+ te(e), g?.(e);
1306
1311
  }, ie = () => {
1307
1312
  re(f), k(rt.ChangeFolder);
1308
1313
  }, ae = () => {
@@ -1314,7 +1319,7 @@ var V = /* @__PURE__ */ function(e) {
1314
1319
  open: e,
1315
1320
  onClose: n,
1316
1321
  header: /* @__PURE__ */ R("span", {
1317
- ref: P,
1322
+ ref: N,
1318
1323
  tabIndex: -1,
1319
1324
  className: F("block truncate outline-none", d, ot.title),
1320
1325
  children: B ? v : ee
@@ -1340,7 +1345,7 @@ var V = /* @__PURE__ */ function(e) {
1340
1345
  onDestinationChange: p,
1341
1346
  isSubmitting: m,
1342
1347
  onChangeFolderClick: ie,
1343
- changeFolderButtonRef: te,
1348
+ changeFolderButtonRef: P,
1344
1349
  pendingDestination: M,
1345
1350
  onPendingDestinationChange: re
1346
1351
  })
@@ -1370,4 +1375,4 @@ var V = /* @__PURE__ */ function(e) {
1370
1375
  });
1371
1376
  };
1372
1377
  //#endregion
1373
- export { Ge as PUBLISH_PANEL_CLASS, V as PublicationRuleFunction, we as PublishAccessRuleEditor, De as PublishAccessRules, H as PublishCalloutKind, We as PublishFoldersTree, $e as PublishFooter, ke as PublishHistoryList, Je as PublishPanel, q as PublishPanelView, at as SaveToFolderPanel, rt as SaveToFolderView, nt as SaveVersionMode, tt as StandalonePublishPanel, st as StandaloneSaveToFolderPanel, fe as collectFolderKeys, U as derivePublishState, J as filterFolderTree, W as formatPublishedDate, pe as fromFolderPathKey, ve as getSiblingFolderNames, _e as getUniqueFolderName, Z as mergeFolderPaths, Y as sortFolderTree, me as toDialFileTree, Q as toFolderPathKey, K as usePublishFlow, ue as usePublishFolderView, ge as validateFolderName };
1378
+ export { Ge as PUBLISH_PANEL_CLASS, V as PublicationRuleFunction, we as PublishAccessRuleEditor, De as PublishAccessRules, H as PublishCalloutKind, We as PublishFoldersTree, $e as PublishFooter, ke as PublishHistoryList, Je as PublishPanel, q as PublishPanelView, at as SaveToFolderPanel, rt as SaveToFolderView, nt as SaveVersionMode, tt as StandalonePublishPanel, st as StandaloneSaveToFolderPanel, pe as collectFolderKeys, U as derivePublishState, J as filterFolderTree, G as formatPublishedDate, me as fromFolderPathKey, ye as getSiblingFolderNames, ve as getUniqueFolderName, X as mergeFolderPaths, Y as sortFolderTree, he as toDialFileTree, Z as toFolderPathKey, le as usePublishFlow, ue as usePublishFolderView, _e as validateFolderName };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-publish-panel",
3
3
  "description": "Publish-to-folder UI and state flow shared by catalog entity publish and conversation publish",
4
- "version": "1.3.0-dev.353",
4
+ "version": "1.3.0-dev.355",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -25,9 +25,9 @@
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^19.2.8",
28
- "@epam/ai-dial-chat-shared": "1.3.0-dev.353",
28
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.355",
29
29
  "@epam/ai-dial-ui-kit": "^0.16.0",
30
- "@epam/ai-dial-react-file-manager": "^0.4.0"
30
+ "@epam/ai-dial-react-file-manager": "^0.4.1"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",