@epam/ai-dial-react-file-manager 0.1.0-dev.22 → 0.1.0-dev.23

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.
@@ -458,7 +458,16 @@ const lr = (e) => {
458
458
  return a ?? (t?.length ? `Unsupported file type. Supported types: ${rr(t)}.` : "Unsupported file type.");
459
459
  if (!s)
460
460
  return n ?? `File is too large. Maximum size: ${rn(r)}.`;
461
- }, ur = (e) => e.replace(/\/+$/, "").split("/").filter(Boolean).length, Kt = (e) => {
461
+ }, ur = new Intl.Collator(void 0, {
462
+ sensitivity: "base",
463
+ numeric: !0
464
+ }), hr = (e, t, r, a, n) => {
465
+ if (typeof e == "string" && typeof t == "string" && e && t) {
466
+ const s = ur.compare(e, t);
467
+ return s === 0 ? 0 : s > 0 ? 1 : -1;
468
+ }
469
+ return e === t ? 0 : e ? t ? e > t ? 1 : -1 : n ? 1 : -1 : n ? -1 : 1;
470
+ }, pr = (e) => e.replace(/\/+$/, "").split("/").filter(Boolean).length, Kt = (e) => {
462
471
  const t = `${sa} `, r = new RegExp(`^${sa} (\\d+)$`), a = new Set(
463
472
  e.map((i) => i.name.toLowerCase())
464
473
  ), n = e.map((i) => {
@@ -469,7 +478,7 @@ const lr = (e) => {
469
478
  for (; a.has(s.toLowerCase()); )
470
479
  l++, s = `${t}${l}`;
471
480
  return s;
472
- }, hr = (e) => {
481
+ }, fr = (e) => {
473
482
  const [t, r] = z(e?.showHiddenFiles ?? !1), a = !!e?.onShowHiddenFilesChange, n = a ? e.showHiddenFiles ?? !1 : t, s = d(
474
483
  (i) => {
475
484
  a ? e?.onShowHiddenFilesChange?.(i) : r(i);
@@ -484,7 +493,7 @@ const lr = (e) => {
484
493
  toggleHiddenFilesVisibility: l,
485
494
  setAreHiddenFilesVisible: s
486
495
  };
487
- }, pr = (e) => {
496
+ }, mr = (e) => {
488
497
  const [t, r] = z(
489
498
  e?.collapsed ?? !1
490
499
  ), a = !!e?.onCollapseChange, n = a ? e.collapsed ?? !1 : t, s = d(
@@ -652,7 +661,7 @@ const lr = (e) => {
652
661
  handleCancelAll: D,
653
662
  handleDecideForEach: h
654
663
  };
655
- }, fr = ({
664
+ }, Cr = ({
656
665
  getDestinationFiles: e,
657
666
  onCopyFiles: t,
658
667
  onMoveToFiles: r,
@@ -799,7 +808,7 @@ const lr = (e) => {
799
808
  handleConflictDecideForEach: we,
800
809
  sourceFolder: b
801
810
  };
802
- }, mr = ({
811
+ }, gr = ({
803
812
  path: e,
804
813
  defaultPath: t,
805
814
  onPathChange: r,
@@ -823,7 +832,7 @@ const lr = (e) => {
823
832
  setCurrentPath: p,
824
833
  handlePathChange: C
825
834
  };
826
- }, Cr = ({
835
+ }, vr = ({
827
836
  onDeleteFiles: e,
828
837
  onDeleteSuccess: t
829
838
  }) => {
@@ -857,7 +866,7 @@ const lr = (e) => {
857
866
  closeDeleteConfirmation: C,
858
867
  confirmDelete: c
859
868
  };
860
- }, gr = ({
869
+ }, yr = ({
861
870
  onDownloadFiles: e,
862
871
  customDownloadItemsAction: t,
863
872
  onDownloadSuccess: r
@@ -868,7 +877,7 @@ const lr = (e) => {
868
877
  },
869
878
  [e, r, t]
870
879
  )
871
- }), vr = (e) => "dataTransfer" in e && e.dataTransfer !== null, yr = ({
880
+ }), wr = (e) => "dataTransfer" in e && e.dataTransfer !== null, Nr = ({
872
881
  onUploadFiles: e,
873
882
  onValidateUpload: t,
874
883
  maxFileSize: r,
@@ -933,7 +942,7 @@ const lr = (e) => {
933
942
  if (!i || !h) return;
934
943
  let R = 0;
935
944
  const H = (me) => {
936
- vr(me) && me.dataTransfer.types.includes(Zs) && (R++, u(!0));
945
+ wr(me) && me.dataTransfer.types.includes(Zs) && (R++, u(!0));
937
946
  }, $ = () => {
938
947
  R--, R === 0 && u(!1);
939
948
  }, J = () => {
@@ -1210,22 +1219,22 @@ const lr = (e) => {
1210
1219
  hiddenItemWarning: `${Eo.Warning}__A dot at the start of the name will make the item hidden`
1211
1220
  }, Ea = {
1212
1221
  consecutiveDotsError: "Name cannot contain consecutive dots"
1213
- }, wr = {
1222
+ }, Dr = {
1214
1223
  emptyName: "Name cannot be empty",
1215
1224
  duplicateName: "An item with this name already exists",
1216
1225
  hiddenItemWarning: Fa.hiddenItemWarning,
1217
1226
  consecutiveDotsError: Ea.consecutiveDotsError
1218
1227
  };
1219
- function Nr(e) {
1228
+ function xr(e) {
1220
1229
  let t = e.length;
1221
1230
  for (; t > 0 && e[t - 1] === "/"; ) t--;
1222
1231
  return e.slice(0, t);
1223
1232
  }
1224
- function Dr(e, t) {
1225
- const r = Nr(e), a = r.lastIndexOf("/");
1233
+ function br(e, t) {
1234
+ const r = xr(e), a = r.lastIndexOf("/");
1226
1235
  return a === -1 ? t : r.slice(0, a + 1) + t;
1227
1236
  }
1228
- function xr(e) {
1237
+ function Tr(e) {
1229
1238
  const t = e.lastIndexOf(".");
1230
1239
  return t === -1 || t === 0 ? e : e.substring(0, t);
1231
1240
  }
@@ -1233,7 +1242,7 @@ function ca(e) {
1233
1242
  const t = e.lastIndexOf(".");
1234
1243
  return t === -1 || t === 0 ? "" : e.substring(t);
1235
1244
  }
1236
- const br = ({
1245
+ const Rr = ({
1237
1246
  items: e,
1238
1247
  onRenameValidate: t,
1239
1248
  validationMessages: r,
@@ -1241,7 +1250,7 @@ const br = ({
1241
1250
  }) => {
1242
1251
  const [n, s] = z(), l = j(
1243
1252
  () => ({
1244
- ...wr,
1253
+ ...Dr,
1245
1254
  ...r
1246
1255
  }),
1247
1256
  [r]
@@ -1269,7 +1278,7 @@ const br = ({
1269
1278
  s(void 0);
1270
1279
  return;
1271
1280
  }
1272
- const b = Dr(
1281
+ const b = br(
1273
1282
  n.path,
1274
1283
  m
1275
1284
  ), D = n.parentPath;
@@ -1316,7 +1325,7 @@ const br = ({
1316
1325
  return null;
1317
1326
  },
1318
1327
  [t, l, e]
1319
- ), u = d((y) => y.nodeType === L.ITEM ? xr(y.name) : y.name, []);
1328
+ ), u = d((y) => y.nodeType === L.ITEM ? Tr(y.name) : y.name, []);
1320
1329
  return {
1321
1330
  renamedPath: i,
1322
1331
  renamedItem: n,
@@ -1372,7 +1381,7 @@ const br = ({
1372
1381
  collapsePath: C,
1373
1382
  isControlled: a
1374
1383
  };
1375
- }, Tr = ({
1384
+ }, Ir = ({
1376
1385
  newActions: e,
1377
1386
  currentFolder: t,
1378
1387
  onUploadFiles: r,
@@ -1430,12 +1439,12 @@ const br = ({
1430
1439
  isNewButtonVisible: p,
1431
1440
  isNewButtonDisabled: C
1432
1441
  };
1433
- }, Rr = {
1442
+ }, Fr = {
1434
1443
  emptyName: "Folder name cannot be empty",
1435
1444
  duplicateName: "A folder with this name already exists",
1436
1445
  hiddenItemWarning: Fa.hiddenItemWarning,
1437
1446
  consecutiveDotsError: Ea.consecutiveDotsError
1438
- }, Ir = ({
1447
+ }, Er = ({
1439
1448
  currentFolder: e,
1440
1449
  onCreateFolder: t,
1441
1450
  onValidateFolderName: r,
@@ -1448,7 +1457,7 @@ const br = ({
1448
1457
  null
1449
1458
  ), [m, b] = z(""), D = ce(e?.path), h = j(
1450
1459
  () => ({
1451
- ...Rr,
1460
+ ...Fr,
1452
1461
  ...a
1453
1462
  }),
1454
1463
  [a]
@@ -1571,7 +1580,7 @@ const br = ({
1571
1580
  saveFolderCreation: V,
1572
1581
  validateFolderName: M
1573
1582
  };
1574
- }, Fr = ({
1583
+ }, Sr = ({
1575
1584
  additionalButtons: e,
1576
1585
  expandedPathsLength: t,
1577
1586
  collapseAll: r
@@ -1592,7 +1601,7 @@ const br = ({
1592
1601
  )
1593
1602
  ] }), [e, a, r])
1594
1603
  };
1595
- }, Er = ({ onGetInfo: e }) => {
1604
+ }, Ar = ({ onGetInfo: e }) => {
1596
1605
  const [t, r] = z(!1), [a, n] = z(void 0), s = d(
1597
1606
  async (i) => {
1598
1607
  n(i), r(!0), e && await e(i);
@@ -1608,7 +1617,7 @@ const br = ({
1608
1617
  closeMetadataPopup: l
1609
1618
  };
1610
1619
  };
1611
- function Sr(e) {
1620
+ function Pr(e) {
1612
1621
  const t = [];
1613
1622
  function r(a) {
1614
1623
  for (const n of a)
@@ -1620,7 +1629,7 @@ function da(e, t) {
1620
1629
  const r = Ft(t);
1621
1630
  return e.filter((a) => Ft(a.name).includes(r));
1622
1631
  }
1623
- function Ar({
1632
+ function Mr({
1624
1633
  onSearchFiles: e,
1625
1634
  clearSearchResults: t,
1626
1635
  currentPath: r,
@@ -1673,7 +1682,7 @@ function Ar({
1673
1682
  }
1674
1683
  if (!b || !i.length)
1675
1684
  return [];
1676
- const F = Sr(i);
1685
+ const F = Pr(i);
1677
1686
  return da(F, b);
1678
1687
  }, [
1679
1688
  e,
@@ -1693,7 +1702,7 @@ function Ar({
1693
1702
  searchResultsRows: x
1694
1703
  };
1695
1704
  }
1696
- function Pr({
1705
+ function kr({
1697
1706
  selectedPaths: e,
1698
1707
  defaultSelectedPaths: t,
1699
1708
  onSelectedPathsChange: r
@@ -1717,7 +1726,7 @@ function Pr({
1717
1726
  isControlled: a
1718
1727
  };
1719
1728
  }
1720
- const Mr = ({
1729
+ const Or = ({
1721
1730
  managerLabel: e,
1722
1731
  children: t,
1723
1732
  className: r,
@@ -1808,7 +1817,7 @@ const Mr = ({
1808
1817
  selectedPaths: Ze,
1809
1818
  clearSelection: Xe,
1810
1819
  setSelectedPaths: it
1811
- } = Pr({
1820
+ } = kr({
1812
1821
  selectedPaths: p,
1813
1822
  defaultSelectedPaths: C,
1814
1823
  onSelectedPathsChange: c
@@ -1862,7 +1871,7 @@ const Mr = ({
1862
1871
  it(K);
1863
1872
  }
1864
1873
  }, [a, Ze, it]);
1865
- const { currentPath: de, setCurrentPath: Fe, handlePathChange: qe } = mr({
1874
+ const { currentPath: de, setCurrentPath: Fe, handlePathChange: qe } = gr({
1866
1875
  path: s,
1867
1876
  defaultPath: l,
1868
1877
  onPathChange: F,
@@ -1879,10 +1888,10 @@ const Mr = ({
1879
1888
  T?.setDestinationFolderPath ? T.setDestinationFolderPath(E) : no(E);
1880
1889
  },
1881
1890
  [T]
1882
- ), { areHiddenFilesVisible: lt, toggleHiddenFilesVisibility: yn } = hr({
1891
+ ), { areHiddenFilesVisible: lt, toggleHiddenFilesVisibility: yn } = fr({
1883
1892
  showHiddenFiles: v,
1884
1893
  onShowHiddenFilesChange: u
1885
- }), { isTreeCollapsed: wn, toggleTreeCollapse: vt, setIsTreeCollapsed: oo } = pr({
1894
+ }), { isTreeCollapsed: wn, toggleTreeCollapse: vt, setIsTreeCollapsed: oo } = mr({
1886
1895
  collapsed: y?.collapsed,
1887
1896
  onCollapseChange: y?.onCollapseChange
1888
1897
  }), {
@@ -1893,7 +1902,7 @@ const Mr = ({
1893
1902
  renameCancelHandler: io,
1894
1903
  renameValidateHandler: lo,
1895
1904
  getDisplayName: Ot
1896
- } = br({
1905
+ } = Rr({
1897
1906
  items: a,
1898
1907
  onRenameValidate: B,
1899
1908
  validationMessages: k,
@@ -1906,7 +1915,7 @@ const Mr = ({
1906
1915
  handleSearchChange: _t,
1907
1916
  handleSearchClear: le,
1908
1917
  searchResultsRows: Dn
1909
- } = Ar({
1918
+ } = Mr({
1910
1919
  onSearchFiles: Se,
1911
1920
  clearSearchResults: $,
1912
1921
  currentPath: de,
@@ -1920,7 +1929,7 @@ const Mr = ({
1920
1929
  () => It(a, de) ?? a[0],
1921
1930
  [a, de]
1922
1931
  ), Le = d(
1923
- (E, K) => !K || !E ? !1 : ur(E.path) > K,
1932
+ (E, K) => !K || !E ? !1 : pr(E.path) > K,
1924
1933
  []
1925
1934
  ), Me = d(() => {
1926
1935
  Pt?.();
@@ -1943,7 +1952,7 @@ const Mr = ({
1943
1952
  handleConflictCancel: fo,
1944
1953
  handleConflictDecideForEach: mo,
1945
1954
  sourceFolder: Co
1946
- } = fr({
1955
+ } = Cr({
1947
1956
  getDestinationFiles: (E) => It(a, E)?.items ?? [],
1948
1957
  onCopyFiles: M,
1949
1958
  onMoveToFiles: V,
@@ -1962,10 +1971,10 @@ const Mr = ({
1962
1971
  openDeleteConfirmation: Pn,
1963
1972
  closeDeleteConfirmation: Mn,
1964
1973
  confirmDelete: Dt
1965
- } = Cr({
1974
+ } = vr({
1966
1975
  onDeleteFiles: A,
1967
1976
  onDeleteSuccess: Xe
1968
- }), { handleDownloadFiles: ot } = gr({
1977
+ }), { handleDownloadFiles: ot } = yr({
1969
1978
  onDownloadFiles: _,
1970
1979
  customDownloadItemsAction: un,
1971
1980
  onDownloadSuccess: Xe
@@ -1988,7 +1997,7 @@ const Mr = ({
1988
1997
  handleUploadConflictDuplicate: Do,
1989
1998
  handleUploadConflictCancel: xo,
1990
1999
  handleUploadConflictDecideForEach: $t
1991
- } = yr({
2000
+ } = Nr({
1992
2001
  onUploadFiles: Jn,
1993
2002
  onValidateUpload: Y,
1994
2003
  maxFileSize: xe,
@@ -2040,7 +2049,7 @@ const Mr = ({
2040
2049
  cancelFolderCreation: Aa,
2041
2050
  saveFolderCreation: Pa,
2042
2051
  validateFolderName: Ma
2043
- } = Ir({
2052
+ } = Er({
2044
2053
  currentFolder: se,
2045
2054
  onCreateFolder: Qn,
2046
2055
  onValidateFolderName: W,
@@ -2059,7 +2068,7 @@ const Mr = ({
2059
2068
  ve,
2060
2069
  Le,
2061
2070
  Me
2062
- ]), { newActions: ka, isNewButtonVisible: Oa, isNewButtonDisabled: La } = Tr(
2071
+ ]), { newActions: ka, isNewButtonVisible: Oa, isNewButtonDisabled: La } = Ir(
2063
2072
  {
2064
2073
  newActions: h?.newActions,
2065
2074
  currentFolder: se,
@@ -2197,7 +2206,7 @@ const Mr = ({
2197
2206
  ), { expandedPaths: bt, setExpandedPaths: jt, collapseAll: Ha } = Sa({
2198
2207
  expandedPaths: y?.expandedPaths,
2199
2208
  onExpandedPathsChange: y?.onExpandedPathsChange
2200
- }), { additionalButtons: Ua } = Fr({
2209
+ }), { additionalButtons: Ua } = Sr({
2201
2210
  collapseAll: Ha,
2202
2211
  expandedPathsLength: bt.size,
2203
2212
  additionalButtons: y?.additionalButtons
@@ -2280,7 +2289,7 @@ const Mr = ({
2280
2289
  selectedFileForMetadata: Xa,
2281
2290
  openMetadataPopup: qa,
2282
2291
  closeMetadataPopup: Yo
2283
- } = Er({ onGetInfo: G }), Ya = d(() => {
2292
+ } = Ar({ onGetInfo: G }), Ya = d(() => {
2284
2293
  Yo(), De?.clearMetadata?.();
2285
2294
  }, [Yo, De]), Ka = j(() => {
2286
2295
  if (Q)
@@ -2446,7 +2455,7 @@ const Mr = ({
2446
2455
  onNewFolderDepthExceeded: Pt
2447
2456
  };
2448
2457
  return /* @__PURE__ */ o(Ia.Provider, { value: Qa, children: t });
2449
- }, kr = ({
2458
+ }, Lr = ({
2450
2459
  disabledGridRowIds: e,
2451
2460
  gridRows: t,
2452
2461
  getDisabledTooltip: r,
@@ -2533,7 +2542,7 @@ const Mr = ({
2533
2542
  const r = () => t(ua());
2534
2543
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
2535
2544
  }, []), e;
2536
- }, Or = ({
2545
+ }, zr = ({
2537
2546
  onClose: e,
2538
2547
  onConfirm: t,
2539
2548
  onFolderPopupPathChange: r,
@@ -2667,7 +2676,7 @@ const Mr = ({
2667
2676
  children: /* @__PURE__ */ X("div", { className: "bg-layer-sunken h-full flex flex-col", children: [
2668
2677
  T && /* @__PURE__ */ o("div", { className: "px-6 mb-4 pt-4", children: /* @__PURE__ */ o(ws, { ...T }) }),
2669
2678
  /* @__PURE__ */ o("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ o(
2670
- di,
2679
+ hi,
2671
2680
  {
2672
2681
  ...F,
2673
2682
  gridClassName: "size-full",
@@ -2700,7 +2709,7 @@ const Mr = ({
2700
2709
  }
2701
2710
  );
2702
2711
  };
2703
- function Lr({
2712
+ function _r({
2704
2713
  actions: e,
2705
2714
  direction: t = tn.Normal,
2706
2715
  moreButtonWidth: r = ya,
@@ -2766,17 +2775,17 @@ function Lr({
2766
2775
  }
2767
2776
  };
2768
2777
  }
2769
- const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, actions: r, selectedCount: a }) => {
2778
+ const Br = 12, Wr = 8, Hr = ({ getSelectionLabel: e, onClearSelection: t, actions: r, selectedCount: a }) => {
2770
2779
  const n = Vo(), {
2771
2780
  refs: { containerRef: s, leftSectionRef: l, measureRef: i },
2772
2781
  visibleActions: p,
2773
2782
  hiddenActions: C
2774
- } = Lr({
2783
+ } = _r({
2775
2784
  actions: r,
2776
2785
  direction: tn.Reverse,
2777
2786
  dependencies: [n],
2778
- actionsGap: zr,
2779
- containerPadding: _r
2787
+ actionsGap: Br,
2788
+ containerPadding: Wr
2780
2789
  }), c = e(a);
2781
2790
  return /* @__PURE__ */ X(Ie, { children: [
2782
2791
  /* @__PURE__ */ o(
@@ -2839,7 +2848,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
2839
2848
  }
2840
2849
  )
2841
2850
  ] });
2842
- }, Wr = ({
2851
+ }, Ur = ({
2843
2852
  open: e,
2844
2853
  itemsToDelete: t,
2845
2854
  onClose: r,
@@ -2888,7 +2897,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
2888
2897
  children: u
2889
2898
  }
2890
2899
  );
2891
- }, ha = (e) => e.split("/").map((t) => t.trim()).filter(Boolean), Hr = "w-full flex items-center justify-between gap-4", Ur = "min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-raised px-3 flex items-center rounded", Gr = "w-[260px]", Vr = ({
2900
+ }, ha = (e) => e.split("/").map((t) => t.trim()).filter(Boolean), Gr = "w-full flex items-center justify-between gap-4", Vr = "min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-raised px-3 flex items-center rounded", $r = "w-[260px]", jr = ({
2892
2901
  ariaLabel: e = "Breadcrumb",
2893
2902
  labelClassName: t,
2894
2903
  onItemClick: r,
@@ -2982,7 +2991,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
2982
2991
  x(!1), m?.("");
2983
2992
  }
2984
2993
  }
2985
- ) : /* @__PURE__ */ o("div", { className: Ur, children: /* @__PURE__ */ o(
2994
+ ) : /* @__PURE__ */ o("div", { className: Vr, children: /* @__PURE__ */ o(
2986
2995
  xs,
2987
2996
  {
2988
2997
  pathItems: f,
@@ -3003,7 +3012,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3003
3012
  "div",
3004
3013
  {
3005
3014
  className: Ee(
3006
- Hr,
3015
+ Gr,
3007
3016
  {
3008
3017
  "gap-3": h
3009
3018
  },
@@ -3015,7 +3024,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3015
3024
  c && /* @__PURE__ */ o(
3016
3025
  "div",
3017
3026
  {
3018
- className: Ee(Gr, {
3027
+ className: Ee($r, {
3019
3028
  "w-[40px]": h && !T,
3020
3029
  "w-full": h && T
3021
3030
  }),
@@ -3041,7 +3050,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3041
3050
  ]
3042
3051
  }
3043
3052
  );
3044
- }, $r = ({
3053
+ }, Zr = ({
3045
3054
  tabs: e,
3046
3055
  activeTab: t,
3047
3056
  onTabChange: r,
@@ -3137,7 +3146,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3137
3146
  /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: D() }),
3138
3147
  /* @__PURE__ */ o("div", { className: "flex gap-2 shrink-0 items-center", children: m ? f() : h() })
3139
3148
  ] });
3140
- }, jr = 100, Qt = 16, Ue = "text-secondary", Hn = "text-primary min-w-0", Zr = "text-primary break-words min-w-0", Jt = "bg-layer-sunken", Xr = ({
3149
+ }, Xr = 100, Qt = 16, Ue = "text-secondary", Hn = "text-primary min-w-0", qr = "text-primary break-words min-w-0", Jt = "bg-layer-sunken", Yr = ({
3141
3150
  open: e,
3142
3151
  onClose: t,
3143
3152
  fileMetadata: r,
@@ -3162,7 +3171,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3162
3171
  "div",
3163
3172
  {
3164
3173
  className: "grid gap-4 items-center dial-small-text",
3165
- style: { gridTemplateColumns: `${jr}px 1fr` },
3174
+ style: { gridTemplateColumns: `${Xr}px 1fr` },
3166
3175
  children: a ? /* @__PURE__ */ X(Ie, { children: [
3167
3176
  /* @__PURE__ */ o("div", { className: Ue, children: s }),
3168
3177
  /* @__PURE__ */ o(
@@ -3238,15 +3247,15 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3238
3247
  /* @__PURE__ */ o("div", { className: Ue, children: C }),
3239
3248
  /* @__PURE__ */ o("div", { className: Hn, children: /* @__PURE__ */ o(Tt, { text: r.author || "—" }) }),
3240
3249
  /* @__PURE__ */ o("div", { className: Ue, children: l }),
3241
- /* @__PURE__ */ o("div", { className: Zr, children: decodeURIComponent(r.path) })
3250
+ /* @__PURE__ */ o("div", { className: qr, children: decodeURIComponent(r.path) })
3242
3251
  ] }) : null
3243
3252
  }
3244
3253
  ) })
3245
3254
  }
3246
- ), qr = {
3255
+ ), Kr = {
3247
3256
  size: 10,
3248
3257
  stroke: 2
3249
- }, Yr = 26, en = "__new_folder", Kr = ({
3258
+ }, Qr = 26, en = "__new_folder", Jr = ({
3250
3259
  name: e,
3251
3260
  type: t,
3252
3261
  shared: r = !1,
@@ -3303,7 +3312,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3303
3312
  }
3304
3313
  )
3305
3314
  ) : null;
3306
- }, Qr = ({
3315
+ }, ei = ({
3307
3316
  name: e,
3308
3317
  type: t,
3309
3318
  elementId: r,
@@ -3351,7 +3360,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3351
3360
  };
3352
3361
  return /* @__PURE__ */ X("div", { className: "flex gap-2 items-center", ...Ss, children: [
3353
3362
  /* @__PURE__ */ o(
3354
- Kr,
3363
+ Jr,
3355
3364
  {
3356
3365
  name: e,
3357
3366
  type: t,
@@ -3455,7 +3464,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3455
3464
  );
3456
3465
  }
3457
3466
  return /* @__PURE__ */ o(
3458
- Qr,
3467
+ ei,
3459
3468
  {
3460
3469
  type: t,
3461
3470
  name: x,
@@ -3471,7 +3480,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3471
3480
  sharedIndicatorClassName: m
3472
3481
  }
3473
3482
  );
3474
- }, Jr = ({
3483
+ }, ti = ({
3475
3484
  items: e,
3476
3485
  showFiles: t = !1,
3477
3486
  expandedPaths: r,
@@ -3537,7 +3546,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3537
3546
  children: /* @__PURE__ */ X(
3538
3547
  "div",
3539
3548
  {
3540
- style: { paddingLeft: `${k * Yr}px` },
3549
+ style: { paddingLeft: `${k * Qr}px` },
3541
3550
  className: Ee(
3542
3551
  "py-1 pr-3 gap-2 dial-small-paragraph-text flex justify-between hover:bg-control-accent-alpha-hover rounded group/item w-full relative",
3543
3552
  Oe
@@ -3560,7 +3569,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3560
3569
  ue && /* @__PURE__ */ o(
3561
3570
  cs,
3562
3571
  {
3563
- ...qr,
3572
+ ...Kr,
3564
3573
  className: an(
3565
3574
  "flex-shrink-0",
3566
3575
  Ne && "rotate-90 transition-all",
@@ -3631,7 +3640,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3631
3640
  icon: C
3632
3641
  }
3633
3642
  ) });
3634
- }, ei = ({
3643
+ }, ni = ({
3635
3644
  selectedFiles: e,
3636
3645
  actionLabels: t,
3637
3646
  onDuplicate: r,
@@ -3760,7 +3769,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3760
3769
  u,
3761
3770
  v,
3762
3771
  y
3763
- ]), ti = ({
3772
+ ]), oi = ({
3764
3773
  id: e,
3765
3774
  name: t,
3766
3775
  nodeType: r,
@@ -3800,7 +3809,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3800
3809
  ) }) : null
3801
3810
  ] })
3802
3811
  }
3803
- ) }) }), ni = (e) => (t, r, a) => ({
3812
+ ) }) }), ai = (e) => (t, r, a) => ({
3804
3813
  colId: ye.Name,
3805
3814
  field: "name",
3806
3815
  headerName: e,
@@ -3879,7 +3888,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3879
3888
  }
3880
3889
  if (a)
3881
3890
  return /* @__PURE__ */ o(
3882
- ti,
3891
+ oi,
3883
3892
  {
3884
3893
  id: n.data.id,
3885
3894
  name: n.data.name,
@@ -3927,7 +3936,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3927
3936
  }
3928
3937
  );
3929
3938
  }
3930
- }), oi = (e) => (t, r) => ({
3939
+ }), si = (e) => (t, r) => ({
3931
3940
  colId: ye.UpdatedAt,
3932
3941
  field: "updatedAt",
3933
3942
  headerName: e,
@@ -3948,7 +3957,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3948
3957
  r || Os
3949
3958
  ).format(s) : "";
3950
3959
  }
3951
- }), ai = (e) => ({
3960
+ }), ri = (e) => ({
3952
3961
  colId: ye.Size,
3953
3962
  field: "size",
3954
3963
  headerName: e,
@@ -3956,7 +3965,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3956
3965
  suppressSizeToFit: !0,
3957
3966
  cellRenderer: (t) => t.data.nodeType === L.ITEM ? rn(t.data.contentLength) : "",
3958
3967
  filterValueGetter: (t) => t.data.nodeType === L.ITEM ? rn(t.data.contentLength) : ""
3959
- }), si = (e) => {
3968
+ }), ii = (e) => {
3960
3969
  const t = e.event;
3961
3970
  if (!(t?.target ?? null)?.closest("input") || !t) return !1;
3962
3971
  switch (t.key) {
@@ -3971,7 +3980,7 @@ const zr = 12, _r = 8, Br = ({ getSelectionLabel: e, onClearSelection: t, action
3971
3980
  return !1;
3972
3981
  }
3973
3982
  };
3974
- function ri({
3983
+ function li({
3975
3984
  userColumnDefs: e,
3976
3985
  filterable: t,
3977
3986
  dateLocale: r,
@@ -3984,7 +3993,7 @@ function ri({
3984
3993
  rootItemPath: C
3985
3994
  }) {
3986
3995
  const c = j(() => [
3987
- ni("Name")(r, a, s),
3996
+ ai("Name")(r, a, s),
3988
3997
  {
3989
3998
  colId: ye.Path,
3990
3999
  field: "path",
@@ -4006,8 +4015,8 @@ function ri({
4006
4015
  return /* @__PURE__ */ o(Tt, { text: m, hideTooltip: y });
4007
4016
  }
4008
4017
  },
4009
- oi("Modified Date")(r, a),
4010
- ai("Size"),
4018
+ si("Modified Date")(r, a),
4019
+ ri("Size"),
4011
4020
  {
4012
4021
  colId: ye.Author,
4013
4022
  field: "author",
@@ -4040,7 +4049,7 @@ function ri({
4040
4049
  filter: t ? m.filter : !1,
4041
4050
  floatingFilter: t ? m.floatingFilter : !1
4042
4051
  };
4043
- return g(m) && !m.suppressKeyboardEvent && (b.suppressKeyboardEvent = si), b;
4052
+ return g(m) && !m.suppressKeyboardEvent && (b.suppressKeyboardEvent = ii), b;
4044
4053
  });
4045
4054
  }, [
4046
4055
  i,
@@ -4054,14 +4063,14 @@ function ri({
4054
4063
  e
4055
4064
  ]) };
4056
4065
  }
4057
- const ii = () => {
4066
+ const ci = () => {
4058
4067
  const e = fs(Ia);
4059
4068
  if (!e)
4060
4069
  throw new Error(
4061
4070
  "useFileManagerContext must be used within <FileManagerProvider>"
4062
4071
  );
4063
4072
  return e;
4064
- }, li = ({
4073
+ }, di = ({
4065
4074
  actionLabels: e,
4066
4075
  onDuplicate: t,
4067
4076
  onCopy: r,
@@ -4232,7 +4241,7 @@ const ii = () => {
4232
4241
  h,
4233
4242
  T,
4234
4243
  f
4235
- ]), ci = ({
4244
+ ]), ui = ({
4236
4245
  onGridAddSibling: e,
4237
4246
  onGridAddChild: t,
4238
4247
  onTreeAddSibling: r,
@@ -4268,7 +4277,7 @@ const ii = () => {
4268
4277
  onGridCreateChildFolder: p,
4269
4278
  onTreeCreateChildFolder: C
4270
4279
  };
4271
- }, di = (e) => /* @__PURE__ */ o(Mr, { ...e, children: /* @__PURE__ */ o(ui, {}) }), ui = () => {
4280
+ }, hi = (e) => /* @__PURE__ */ o(Or, { ...e, children: /* @__PURE__ */ o(pi, {}) }), pi = () => {
4272
4281
  const {
4273
4282
  managerLabel: e,
4274
4283
  className: t,
@@ -4394,7 +4403,7 @@ const ii = () => {
4394
4403
  showHiddenFileSwitcherInDestinationPopup: le,
4395
4404
  showCreateFolderButtonInDestinationPopup: Dn,
4396
4405
  newFolderDefaultName: se
4397
- } = ii(), {
4406
+ } = ci(), {
4398
4407
  width: Le = $s,
4399
4408
  header: Me = js,
4400
4409
  containerClassName: xn = Us,
@@ -4406,7 +4415,7 @@ const ii = () => {
4406
4415
  onTreeCreateSiblingFolder: En,
4407
4416
  onGridCreateChildFolder: ho,
4408
4417
  onTreeCreateChildFolder: Sn
4409
- } = ci({
4418
+ } = ui({
4410
4419
  onGridAddSibling: G,
4411
4420
  onGridAddChild: ne,
4412
4421
  onTreeAddSibling: he,
@@ -4598,7 +4607,7 @@ const ii = () => {
4598
4607
  A(N), U?.(ee);
4599
4608
  },
4600
4609
  [U, A]
4601
- ), On = ei({
4610
+ ), On = ni({
4602
4611
  selectedFiles: M,
4603
4612
  actionLabels: c?.actionLabels,
4604
4613
  onDuplicate: W,
@@ -4631,7 +4640,7 @@ const ii = () => {
4631
4640
  children: [
4632
4641
  e,
4633
4642
  /* @__PURE__ */ o(
4634
- $r,
4643
+ Zr,
4635
4644
  {
4636
4645
  ...C,
4637
4646
  onTabChange: Gt,
@@ -4651,7 +4660,7 @@ const ii = () => {
4651
4660
  role: "toolbar",
4652
4661
  "aria-label": "File Manager Toolbar",
4653
4662
  children: /* @__PURE__ */ o(
4654
- Br,
4663
+ Hr,
4655
4664
  {
4656
4665
  ...c,
4657
4666
  selectedCount: O.size,
@@ -4708,7 +4717,7 @@ const ii = () => {
4708
4717
  isOpened: !x,
4709
4718
  onToggle: F,
4710
4719
  children: /* @__PURE__ */ o(
4711
- Jr,
4720
+ ti,
4712
4721
  {
4713
4722
  ...Tn,
4714
4723
  items: r,
@@ -4765,7 +4774,7 @@ const ii = () => {
4765
4774
  Qe,
4766
4775
  Ct,
4767
4776
  se
4768
- ]), Ln = li({
4777
+ ]), Ln = di({
4769
4778
  actionLabels: p?.actionLabels,
4770
4779
  onDuplicate: (N) => W([N]),
4771
4780
  onCopy: (N) => {
@@ -4805,7 +4814,7 @@ const ii = () => {
4805
4814
  isRowDisabled: Do,
4806
4815
  allowedFileTypes: D,
4807
4816
  buttonClassName: ze ? "" : Vs
4808
- }), { columnDefs: $t } = ri({
4817
+ }), { columnDefs: $t } = li({
4809
4818
  userColumnDefs: fo,
4810
4819
  filterable: mo,
4811
4820
  dateLocale: Co,
@@ -4858,6 +4867,7 @@ const ii = () => {
4858
4867
  rowHeight: ra,
4859
4868
  rowClass: "group/grid-row",
4860
4869
  defaultColDef: {
4870
+ comparator: hr,
4861
4871
  ...ot.additionalGridOptions?.defaultColDef,
4862
4872
  floatingFilter: i?.searchable ? !1 : ot.additionalGridOptions?.defaultColDef?.floatingFilter
4863
4873
  },
@@ -4980,7 +4990,7 @@ const ii = () => {
4980
4990
  }),
4981
4991
  children: [
4982
4992
  l && /* @__PURE__ */ o(
4983
- Vr,
4993
+ jr,
4984
4994
  {
4985
4995
  ...i ?? {},
4986
4996
  makeHref: (N) => N.join("/"),
@@ -5007,7 +5017,7 @@ const ii = () => {
5007
5017
  children: [
5008
5018
  bo,
5009
5019
  /* @__PURE__ */ o(
5010
- kr,
5020
+ Lr,
5011
5021
  {
5012
5022
  disabledGridRowIds: ct,
5013
5023
  gridRows: S,
@@ -5025,7 +5035,7 @@ const ii = () => {
5025
5035
  )
5026
5036
  ] }),
5027
5037
  /* @__PURE__ */ o(
5028
- Wr,
5038
+ Ur,
5029
5039
  {
5030
5040
  ...v,
5031
5041
  open: $,
@@ -5035,7 +5045,7 @@ const ii = () => {
5035
5045
  }
5036
5046
  ),
5037
5047
  /* @__PURE__ */ o(
5038
- Or,
5048
+ zr,
5039
5049
  {
5040
5050
  ...u,
5041
5051
  open: xe,
@@ -5093,7 +5103,7 @@ const ii = () => {
5093
5103
  }
5094
5104
  ),
5095
5105
  /* @__PURE__ */ o(
5096
- Xr,
5106
+ Yr,
5097
5107
  {
5098
5108
  open: qe,
5099
5109
  onClose: kt,
@@ -5112,7 +5122,7 @@ const ii = () => {
5112
5122
  ]
5113
5123
  }
5114
5124
  ) });
5115
- }, yi = (e, t = nn.MyFiles) => {
5125
+ }, Ni = (e, t = nn.MyFiles) => {
5116
5126
  const r = Object.values(nn).includes(
5117
5127
  t
5118
5128
  ) ? t : nn.MyFiles, [a, n] = z(r), s = (i) => {
@@ -5132,8 +5142,8 @@ const ii = () => {
5132
5142
  };
5133
5143
  export {
5134
5144
  ge as DestinationFolderMode,
5135
- Or as DialDestinationFolderPopup,
5136
- di as DialFileManager,
5145
+ zr as DialDestinationFolderPopup,
5146
+ hi as DialFileManager,
5137
5147
  w as DialFileManagerActions,
5138
5148
  Ce as DialFileManagerConflictActions,
5139
5149
  ke as DialFileManagerConflictStrategies,
@@ -5141,16 +5151,16 @@ export {
5141
5151
  L as DialFileNodeType,
5142
5152
  St as DialFilePermission,
5143
5153
  Qs as DialFileResourceType,
5144
- Jr as DialFoldersTree,
5154
+ ti as DialFoldersTree,
5145
5155
  ye as FileManagerColumnKey,
5146
5156
  ut as FileManagerCreateFolderTriggerView,
5147
5157
  Be as FileManagerCreateFolderType,
5148
- Mr as FileManagerProvider,
5158
+ Or as FileManagerProvider,
5149
5159
  Rt as FileManagerRenameTriggerView,
5150
5160
  nr as GridSelectionMode,
5151
- ni as NAME_COLUMN,
5152
- ai as SIZE_COLUMN,
5153
- oi as UPDATED_AT_COLUMN,
5154
- yi as useDialFileManagerTabs,
5155
- ii as useFileManagerContext
5161
+ ai as NAME_COLUMN,
5162
+ ri as SIZE_COLUMN,
5163
+ si as UPDATED_AT_COLUMN,
5164
+ Ni as useDialFileManagerTabs,
5165
+ ci as useFileManagerContext
5156
5166
  };
@@ -54,5 +54,6 @@ export declare const splitPathAndName: (fullPath: string) => {
54
54
  };
55
55
  export declare const isFileSelectable: (file: Pick<DialFile, "contentLength" | "contentType" | "name">, allowedFileTypes?: DialFileAcceptType[], maxSelectableFileSize?: number) => boolean;
56
56
  export declare const getRowTooltip: (file: FileManagerGridRow, allowedFileTypes?: DialFileAcceptType[], maxSelectableFileSize?: number, unsupportedFileTypeTooltip?: string, fileTooLargeTooltip?: string) => string | undefined;
57
+ export declare const baseColumnComparator: (a: string | number | undefined, b: string | number | undefined, _nodeA?: unknown, _nodeB?: unknown, isInverted?: boolean) => number;
57
58
  export declare const getFolderNestingDepth: (folderPath: string) => number;
58
59
  export declare const getNextFolderName: (existingFolders: DialFile[]) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-react-file-manager",
3
- "version": "0.1.0-dev.22",
3
+ "version": "0.1.0-dev.23",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "React file manager package for AI DIAL interfaces",