@bigbinary/neeto-folders-frontend 2.0.41 → 2.0.43
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/dist/.ready +1 -1
- package/dist/cjs/v2/components.js +54 -19
- package/dist/cjs/v2/components.js.map +1 -1
- package/dist/v2/components.js +54 -19
- package/dist/v2/components.js.map +1 -1
- package/package.json +4 -4
package/dist/v2/components.js
CHANGED
|
@@ -566,14 +566,15 @@ var PaneBody = function PaneBody(_ref) {
|
|
|
566
566
|
}
|
|
567
567
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
568
568
|
children: [/*#__PURE__*/jsxs(Sheet.Header, {
|
|
569
|
-
className: "flex items-center justify-between",
|
|
569
|
+
className: "flex flex-row items-center justify-between",
|
|
570
570
|
children: [/*#__PURE__*/jsx(Sheet.Title, {
|
|
571
571
|
children: t("moveToFolder.title")
|
|
572
572
|
}), /*#__PURE__*/jsx(Button, {
|
|
573
|
-
className: "
|
|
573
|
+
className: "absolute end-12 top-3",
|
|
574
574
|
"data-testid": "add-new-folder-button",
|
|
575
575
|
label: t("folders.add"),
|
|
576
|
-
|
|
576
|
+
size: "sm",
|
|
577
|
+
variant: "outline",
|
|
577
578
|
onClick: onAddFolder
|
|
578
579
|
})]
|
|
579
580
|
}), /*#__PURE__*/jsx(Sheet.Body, {
|
|
@@ -821,7 +822,7 @@ var RearrangeFoldersPane = function RearrangeFoldersPane(_ref) {
|
|
|
821
822
|
});
|
|
822
823
|
var nodeProps = {
|
|
823
824
|
icon: /*#__PURE__*/jsx(GripVertical, {
|
|
824
|
-
className: "text-muted-foreground relative -start-[0.3125rem] flex-shrink-0"
|
|
825
|
+
className: "text-muted-foreground relative -start-[0.3125rem] size-4 flex-shrink-0"
|
|
825
826
|
})
|
|
826
827
|
};
|
|
827
828
|
if (isFetching) {
|
|
@@ -1102,7 +1103,7 @@ var ReorderFoldersPane = function ReorderFoldersPane(_ref) {
|
|
|
1102
1103
|
});
|
|
1103
1104
|
var nodeProps = {
|
|
1104
1105
|
icon: /*#__PURE__*/jsx(GripVertical, {
|
|
1105
|
-
className: "text-muted-foreground relative -start-[0.3125rem] flex-shrink-0"
|
|
1106
|
+
className: "text-muted-foreground relative -start-[0.3125rem] size-4 flex-shrink-0"
|
|
1106
1107
|
})
|
|
1107
1108
|
};
|
|
1108
1109
|
if (isFetching) {
|
|
@@ -1200,6 +1201,7 @@ var FoldersPane = function FoldersPane(_ref) {
|
|
|
1200
1201
|
onClose: onClose,
|
|
1201
1202
|
initialFocusRef: setFocusField,
|
|
1202
1203
|
isOpen: !!type,
|
|
1204
|
+
size: "large",
|
|
1203
1205
|
children: [(type === "edit" || type === "add") && /*#__PURE__*/jsx(AddEditPane, _objectSpread$c({}, _objectSpread$c({
|
|
1204
1206
|
setFocusField: setFocusField
|
|
1205
1207
|
}, commonProps))), type === "move" && /*#__PURE__*/jsx(MoveFolderPane, _objectSpread$c({}, commonProps)), type === "reorder" && /*#__PURE__*/jsx(ReorderPaneComponent, _objectSpread$c({}, commonProps))]
|
|
@@ -1308,13 +1310,16 @@ var FolderTile = function FolderTile(_ref) {
|
|
|
1308
1310
|
})]
|
|
1309
1311
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
1310
1312
|
menuItems: menuItems,
|
|
1311
|
-
dropdownButtonProps: {
|
|
1312
|
-
className: "absolute end-2 top-2"
|
|
1313
|
-
},
|
|
1314
1313
|
dropdownProps: {
|
|
1315
1314
|
onClick: function onClick(event) {
|
|
1316
1315
|
return event.preventDefault();
|
|
1317
1316
|
}
|
|
1317
|
+
},
|
|
1318
|
+
dropdownButtonProps: {
|
|
1319
|
+
className: "absolute end-2 top-2",
|
|
1320
|
+
onClick: function onClick(event) {
|
|
1321
|
+
return event.preventDefault();
|
|
1322
|
+
}
|
|
1318
1323
|
}
|
|
1319
1324
|
})]
|
|
1320
1325
|
}));
|
|
@@ -1409,7 +1414,7 @@ var FoldersList = function FoldersList(_ref) {
|
|
|
1409
1414
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1410
1415
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1411
1416
|
className: "my-3",
|
|
1412
|
-
variant: "
|
|
1417
|
+
variant: "h6",
|
|
1413
1418
|
children: t("folders.title")
|
|
1414
1419
|
}), /*#__PURE__*/jsx("div", {
|
|
1415
1420
|
className: "neeto-folders-grid-view-wrapper mb-10 grid w-full gap-4",
|
|
@@ -1462,6 +1467,7 @@ var MoveToFolderPane = function MoveToFolderPane(_ref) {
|
|
|
1462
1467
|
return /*#__PURE__*/jsx(Sheet, {
|
|
1463
1468
|
isOpen: isOpen,
|
|
1464
1469
|
onClose: onClose,
|
|
1470
|
+
size: "large",
|
|
1465
1471
|
children: /*#__PURE__*/jsx(PaneBody, _objectSpread$8({}, _objectSpread$8(_objectSpread$8({}, rest), {}, {
|
|
1466
1472
|
onClose: onClose
|
|
1467
1473
|
})))
|
|
@@ -1707,17 +1713,46 @@ var FoldersTree = function FoldersTree(_ref) {
|
|
|
1707
1713
|
var treeData = useMemo(function () {
|
|
1708
1714
|
return _toAtomsTreeData(buildTreeWithItems(folders, config));
|
|
1709
1715
|
}, [folders, config.items]);
|
|
1716
|
+
var treeMap = useMemo(function () {
|
|
1717
|
+
return treeData ? treeToMap(treeData, "sid") : {};
|
|
1718
|
+
}, [treeData]);
|
|
1719
|
+
|
|
1720
|
+
// Only hand react-arborist keys that actually exist in the current tree. A
|
|
1721
|
+
// missing/undefined selection — no folder in the URL, or a stale sid during
|
|
1722
|
+
// SPA navigation before the tree updates — makes its selectMulti call
|
|
1723
|
+
// identify(undefined) and throw "Cannot read properties of undefined".
|
|
1724
|
+
var selectedKeys = activeFolderSid && treeMap[activeFolderSid] ? [activeFolderSid] : [];
|
|
1710
1725
|
var updateExpandedKeys = function updateExpandedKeys() {
|
|
1711
|
-
var _activeFolder$meta;
|
|
1712
1726
|
if (!treeData) return;
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
var
|
|
1718
|
-
|
|
1719
|
-
|
|
1727
|
+
|
|
1728
|
+
// Expand every ancestor of the active folder (not just the immediate
|
|
1729
|
+
// parent) so the full path to it is visible — folders nest up to
|
|
1730
|
+
// config.maxDepth. Walk up via treeMap, guarding against cycles.
|
|
1731
|
+
var ancestorSids = [];
|
|
1732
|
+
var seen = new Set();
|
|
1733
|
+
var node = treeMap[activeFolderSid];
|
|
1734
|
+
while ((_node = node) !== null && _node !== void 0 && (_node = _node.meta) !== null && _node !== void 0 && (_node = _node.parent) !== null && _node !== void 0 && _node.sid && !seen.has(node.meta.parent.sid)) {
|
|
1735
|
+
var _node;
|
|
1736
|
+
var parentSid = node.meta.parent.sid;
|
|
1737
|
+
seen.add(parentSid);
|
|
1738
|
+
ancestorSids.push(parentSid);
|
|
1739
|
+
node = treeMap[parentSid];
|
|
1720
1740
|
}
|
|
1741
|
+
if (!ancestorSids.length) return;
|
|
1742
|
+
|
|
1743
|
+
// Functional update so the newly-expanded ancestors merge with the latest
|
|
1744
|
+
// expansion state (e.g. folders the user opened manually); bail out when
|
|
1745
|
+
// they're all already expanded to avoid a needless re-render.
|
|
1746
|
+
setExpandedKeysSet(function (prev) {
|
|
1747
|
+
if (ancestorSids.every(function (sid) {
|
|
1748
|
+
return prev.has(sid);
|
|
1749
|
+
})) return prev;
|
|
1750
|
+
var next = new Set(prev);
|
|
1751
|
+
ancestorSids.forEach(function (sid) {
|
|
1752
|
+
return next.add(sid);
|
|
1753
|
+
});
|
|
1754
|
+
return next;
|
|
1755
|
+
});
|
|
1721
1756
|
};
|
|
1722
1757
|
var handleExpand = function handleExpand(keys, _ref2) {
|
|
1723
1758
|
var expanded = _ref2.expanded,
|
|
@@ -1755,7 +1790,7 @@ var FoldersTree = function FoldersTree(_ref) {
|
|
|
1755
1790
|
className: "neeto-sidebar-folders-tree",
|
|
1756
1791
|
indent: 20,
|
|
1757
1792
|
rowHeight: 24,
|
|
1758
|
-
selectedKeys:
|
|
1793
|
+
selectedKeys: selectedKeys,
|
|
1759
1794
|
showLine: false,
|
|
1760
1795
|
switcherIcon: SwitcherIcon,
|
|
1761
1796
|
titleRender: function titleRender(node) {
|
|
@@ -1851,7 +1886,7 @@ var TreeSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1851
1886
|
});
|
|
1852
1887
|
TreeSelect.displayName = "TreeSelect";
|
|
1853
1888
|
|
|
1854
|
-
var css = ".neeto-sidebar-folders-tree__folder-node{color:inherit!important}.neeto-
|
|
1889
|
+
var css = ".neeto-sidebar-folders-tree__folder-node{color:inherit!important}.neeto-folders-grid-view-wrapper{grid-template-columns:repeat(auto-fill,minmax(256px,1fr))}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy92Mi9jb21wb25lbnRzL25lZXRvLWZvbGRlcnMtbmFuby5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBLHlDQUNFLHVCQVBGLENBVUEsaUNBQ0UseURBUEYiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGUgbmVldG8tYXRvbXMgVHJlZSBpcyByZWFjdC1hcmJvcmlzdCBiYXNlZCBhbmQgZW1pdHMgbm8gYC5hbnQtdHJlZWBcbi8vIG1hcmt1cCwgc28gdGhlIGFudGQtc2NvcGVkIHJ1bGVzIGZyb20gdGhlIG5lZXRvLXVpIHZlcnNpb24gKG5vZGUgc3BhY2luZyxcbi8vIHNlbGVjdGVkL2hvdmVyIHN0eWxpbmcsIHN3aXRjaGVyIHR3ZWFrcykgbm8gbG9uZ2VyIG1hdGNoIGFueXRoaW5nIGhlcmUuXG4vLyBUaGV5IGFsc28gY2FycmllZCB0aGUgbGFzdCBsZWdhY3kgbmVldG8tdWkgQ1NTIHZhcmlhYmxlcyBpbiB0aGlzIGZpbGU7IHRoZVxuLy8gYXRvbXMgVHJlZSBvd25zIGl0cyBvd24gc2VsZWN0aW9uL2hvdmVyIHN0eWxpbmcgYW5kIHRoZSBub2RlIGFjdGlvbnMgbm93IGZhZGUgaW5cbi8vIHZpYSBgb3BhY2l0eS0wIGdyb3VwLWhvdmVyOm9wYWNpdHktMTAwYCBvbiB0aGUgZWxlbWVudCBpdHNlbGYsIHNvIG9ubHkgdGhlXG4vLyB0d28gc2VsZWN0b3JzIGJlbG93IHJlbWFpbiBsaXZlLlxuXG4ubmVldG8tc2lkZWJhci1mb2xkZXJzLXRyZWVfX2ZvbGRlci1ub2RlIHtcbiAgY29sb3I6IGluaGVyaXQgIWltcG9ydGFudDtcbn1cblxuLm5lZXRvLWZvbGRlcnMtZ3JpZC12aWV3LXdyYXBwZXIge1xuICBncmlkLXRlbXBsYXRlLWNvbHVtbnM6IHJlcGVhdChhdXRvLWZpbGwsIG1pbm1heCgyNTZweCwgMWZyKSk7XG59XG4iXX0= */";
|
|
1855
1890
|
n(css,{});
|
|
1856
1891
|
|
|
1857
1892
|
export { AddEditPane, DraggableWrapper, FoldersContext, FoldersDnd, FoldersList, FoldersTree, MoveToFolderPane, TreeSelect };
|