ode-explorer 1.4.13-develop-pedago.202407161739 → 1.4.13-develop-pedago.202407171558
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/index.js +345 -398
- package/dist/version.txt +1 -1
- package/lib/FoldersList.js +62 -60
- package/lib/ResourcesList.js +12 -12
- package/lib/config/dndkit.d.ts +1 -1
- package/lib/features/ActionBar/Move/useMoveModal.d.ts +1 -1
- package/lib/index2.js +596 -724
- package/lib/providers/index.d.ts +6 -0
- package/lib/store/index.d.ts +61 -26
- package/package.json +1 -1
- package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
- package/lib/utils/addNode.d.ts +0 -6
- package/lib/utils/deleteNode.d.ts +0 -4
- package/lib/utils/findNodeById.d.ts +0 -2
- package/lib/utils/findParentNode.d.ts +0 -2
- package/lib/utils/getAncestors.d.ts +0 -2
- package/lib/utils/hasChildren.d.ts +0 -2
- package/lib/utils/modifyNode.d.ts +0 -2
- package/lib/utils/moveNode.d.ts +0 -5
- package/lib/utils/updateNode.d.ts +0 -6
- package/lib/utils/wrapTreeNode.d.ts +0 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
2
|
var __commonJS = (cb, mod) => function __require() {
|
|
5
3
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
6
4
|
};
|
|
7
|
-
var __publicField = (obj, key, value) => {
|
|
8
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
-
return value;
|
|
10
|
-
};
|
|
11
5
|
var __accessCheck = (obj, member, msg) => {
|
|
12
6
|
if (!member.has(obj))
|
|
13
7
|
throw TypeError("Cannot " + msg);
|
|
@@ -2103,11 +2097,11 @@ var require_index = __commonJS({
|
|
|
2103
2097
|
}
|
|
2104
2098
|
}
|
|
2105
2099
|
class Connector extends EventEmitter$1 {
|
|
2106
|
-
constructor(backend,
|
|
2100
|
+
constructor(backend, store2, services) {
|
|
2107
2101
|
let options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
2108
2102
|
super();
|
|
2109
2103
|
this.backend = backend;
|
|
2110
|
-
this.store =
|
|
2104
|
+
this.store = store2;
|
|
2111
2105
|
this.services = services;
|
|
2112
2106
|
this.languageUtils = services.languageUtils;
|
|
2113
2107
|
this.options = options;
|
|
@@ -3873,7 +3867,7 @@ var require_index = __commonJS({
|
|
|
3873
3867
|
}
|
|
3874
3868
|
}, {
|
|
3875
3869
|
key: "create",
|
|
3876
|
-
value: function
|
|
3870
|
+
value: function create(languages, namespace, key, fallbackValue, callback) {
|
|
3877
3871
|
var _this4 = this;
|
|
3878
3872
|
if (!this.options.addPath)
|
|
3879
3873
|
return;
|
|
@@ -11467,6 +11461,12 @@ var require_index = __commonJS({
|
|
|
11467
11461
|
reactDom.exports = reactDom_production_min;
|
|
11468
11462
|
}
|
|
11469
11463
|
var reactDomExports = reactDom.exports;
|
|
11464
|
+
var createRoot;
|
|
11465
|
+
var m$3 = reactDomExports;
|
|
11466
|
+
{
|
|
11467
|
+
createRoot = m$3.createRoot;
|
|
11468
|
+
m$3.hydrateRoot;
|
|
11469
|
+
}
|
|
11470
11470
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
11471
11471
|
var isDateObject = (value) => value instanceof Date;
|
|
11472
11472
|
var isNullOrUndefined = (value) => value == null;
|
|
@@ -16760,7 +16760,7 @@ var require_index = __commonJS({
|
|
|
16760
16760
|
let d$1, f$1, g$1;
|
|
16761
16761
|
u$4.bind({ g: 1 });
|
|
16762
16762
|
let h$4 = u$4.bind({ k: 1 });
|
|
16763
|
-
function m$
|
|
16763
|
+
function m$2(e2, t2, r2, l2) {
|
|
16764
16764
|
o$1.p = t2, d$1 = e2, f$1 = r2, g$1 = l2;
|
|
16765
16765
|
}
|
|
16766
16766
|
function j$2(e2, t2) {
|
|
@@ -17073,7 +17073,7 @@ to {
|
|
|
17073
17073
|
let a2 = e2.height ? Ae$1(e2.position || t2 || "top-center", e2.visible) : { opacity: 0 }, r2 = reactExports.createElement(M$2, { toast: e2 }), c6 = reactExports.createElement(Se$1, { ...e2.ariaProps }, T$1(e2.message, e2));
|
|
17074
17074
|
return reactExports.createElement(be$1, { className: e2.className, style: { ...a2, ...o2, ...e2.style } }, typeof s2 == "function" ? s2({ icon: r2, message: c6 }) : reactExports.createElement(reactExports.Fragment, null, r2, c6));
|
|
17075
17075
|
});
|
|
17076
|
-
m$
|
|
17076
|
+
m$2(reactExports.createElement);
|
|
17077
17077
|
var Ee$1 = ({ id: e2, className: t2, style: o2, onHeightUpdate: s2, children: a2 }) => {
|
|
17078
17078
|
let r2 = reactExports.useCallback((c6) => {
|
|
17079
17079
|
if (c6) {
|
|
@@ -26799,11 +26799,11 @@ Deprecated since v${version}`), console.warn(stack))), warnings[message] = true;
|
|
|
26799
26799
|
}, c = function(r2) {
|
|
26800
26800
|
return { h: (t2 = h$2(r2)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a };
|
|
26801
26801
|
var t2, n2, e2, u2;
|
|
26802
|
-
}, l$1 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, p$2 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, v$1 = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, m$
|
|
26802
|
+
}, l$1 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, p$2 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, v$1 = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, m$1 = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, y = { string: [[function(r2) {
|
|
26803
26803
|
var t2 = i$1.exec(r2);
|
|
26804
26804
|
return t2 ? (r2 = t2[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n$2(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n$2(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
26805
26805
|
}, "hex"], [function(r2) {
|
|
26806
|
-
var t2 = v$1.exec(r2) || m$
|
|
26806
|
+
var t2 = v$1.exec(r2) || m$1.exec(r2);
|
|
26807
26807
|
return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null;
|
|
26808
26808
|
}, "rgb"], [function(t2) {
|
|
26809
26809
|
var n2 = l$1.exec(t2) || p$2.exec(t2);
|
|
@@ -53736,10 +53736,10 @@ void main()
|
|
|
53736
53736
|
_HTMLText.defaultMaxWidth = 2024, /** Default maxHeight, set at construction */
|
|
53737
53737
|
_HTMLText.defaultMaxHeight = 2024, /** Default autoResolution for all HTMLText objects */
|
|
53738
53738
|
_HTMLText.defaultAutoResolution = true;
|
|
53739
|
-
var
|
|
53739
|
+
var __defProp$1 = Object.defineProperty;
|
|
53740
53740
|
var __export = (target, all) => {
|
|
53741
53741
|
for (var name in all)
|
|
53742
|
-
|
|
53742
|
+
__defProp$1(target, name, { get: all[name], enumerable: true });
|
|
53743
53743
|
};
|
|
53744
53744
|
var globals_exports = {};
|
|
53745
53745
|
__export(globals_exports, {
|
|
@@ -56468,10 +56468,10 @@ void main()
|
|
|
56468
56468
|
}
|
|
56469
56469
|
return spring;
|
|
56470
56470
|
}
|
|
56471
|
-
function prepareSprings(springs, props,
|
|
56471
|
+
function prepareSprings(springs, props, create) {
|
|
56472
56472
|
if (props.keys) {
|
|
56473
56473
|
each(props.keys, (key) => {
|
|
56474
|
-
const spring = springs[key] || (springs[key] =
|
|
56474
|
+
const spring = springs[key] || (springs[key] = create(key));
|
|
56475
56475
|
spring["_prepareNode"](props);
|
|
56476
56476
|
});
|
|
56477
56477
|
}
|
|
@@ -59893,8 +59893,8 @@ void main()
|
|
|
59893
59893
|
modifiers,
|
|
59894
59894
|
...props
|
|
59895
59895
|
} = _ref;
|
|
59896
|
-
const
|
|
59897
|
-
const [state, dispatch] =
|
|
59896
|
+
const store2 = reactExports.useReducer(reducer$2, void 0, getInitialState);
|
|
59897
|
+
const [state, dispatch] = store2;
|
|
59898
59898
|
const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider();
|
|
59899
59899
|
const [status, setStatus] = reactExports.useState(Status.Uninitialized);
|
|
59900
59900
|
const isInitialized = status === Status.Initialized;
|
|
@@ -66276,10 +66276,10 @@ void main()
|
|
|
66276
66276
|
return node2.type === domelementtype_1.ElementType.Root;
|
|
66277
66277
|
}
|
|
66278
66278
|
node.isDocument = isDocument;
|
|
66279
|
-
function hasChildren
|
|
66279
|
+
function hasChildren(node2) {
|
|
66280
66280
|
return Object.prototype.hasOwnProperty.call(node2, "children");
|
|
66281
66281
|
}
|
|
66282
|
-
node.hasChildren = hasChildren
|
|
66282
|
+
node.hasChildren = hasChildren;
|
|
66283
66283
|
function cloneNode(node2, recursive) {
|
|
66284
66284
|
if (recursive === void 0) {
|
|
66285
66285
|
recursive = false;
|
|
@@ -68193,6 +68193,9 @@ void main()
|
|
|
68193
68193
|
HTMLReactParser$1.Element;
|
|
68194
68194
|
HTMLReactParser$1.ProcessingInstruction;
|
|
68195
68195
|
HTMLReactParser$1.Text;
|
|
68196
|
+
var __defProp = Object.defineProperty;
|
|
68197
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
68198
|
+
var __publicField = (obj, key, value) => (__defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), value);
|
|
68196
68199
|
const getOnboardingTrash = async (key) => await odeServices.conf().getPreference(key), saveOnboardingTrash = async (key) => await odeServices.conf().savePreference(key, JSON.stringify({
|
|
68197
68200
|
key: false
|
|
68198
68201
|
})), useOnboardingModal = (id2) => {
|
|
@@ -69537,10 +69540,10 @@ void main()
|
|
|
69537
69540
|
}
|
|
69538
69541
|
return "00:00";
|
|
69539
69542
|
}, padTo2Digits = (val) => val.toString().padStart(2, "0");
|
|
69540
|
-
function findNodeById
|
|
69543
|
+
function findNodeById(data, id2) {
|
|
69541
69544
|
if (Array.isArray(data))
|
|
69542
69545
|
for (const node2 of data) {
|
|
69543
|
-
const result = findNodeById
|
|
69546
|
+
const result = findNodeById(node2, id2);
|
|
69544
69547
|
if (result)
|
|
69545
69548
|
return result;
|
|
69546
69549
|
}
|
|
@@ -69549,12 +69552,105 @@ void main()
|
|
|
69549
69552
|
return data;
|
|
69550
69553
|
if (data.children)
|
|
69551
69554
|
for (const child of data.children) {
|
|
69552
|
-
const result = findNodeById
|
|
69555
|
+
const result = findNodeById(child, id2);
|
|
69553
69556
|
if (result)
|
|
69554
69557
|
return result;
|
|
69555
69558
|
}
|
|
69556
69559
|
}
|
|
69557
69560
|
}
|
|
69561
|
+
function addNode(node2, {
|
|
69562
|
+
parentId,
|
|
69563
|
+
newFolder
|
|
69564
|
+
}) {
|
|
69565
|
+
return modifyNode(node2, (node22) => {
|
|
69566
|
+
var _a2;
|
|
69567
|
+
if (node22.id === parentId) {
|
|
69568
|
+
const parentAncestors = [...((_a2 = node22.folder) == null ? void 0 : _a2.ancestors) || []], ancestors = arrayUnique([...parentAncestors, node22.id]);
|
|
69569
|
+
return {
|
|
69570
|
+
...node22,
|
|
69571
|
+
children: [...node22.children || [], new TreeNodeFolderWrapper({
|
|
69572
|
+
...newFolder,
|
|
69573
|
+
ancestors
|
|
69574
|
+
})]
|
|
69575
|
+
};
|
|
69576
|
+
} else
|
|
69577
|
+
return node22;
|
|
69578
|
+
});
|
|
69579
|
+
}
|
|
69580
|
+
function arrayUnique(array) {
|
|
69581
|
+
return array.filter((item, index2) => array.indexOf(item) === index2);
|
|
69582
|
+
}
|
|
69583
|
+
function deleteNode(node2, {
|
|
69584
|
+
folders
|
|
69585
|
+
}) {
|
|
69586
|
+
return modifyNode(node2, (node22) => {
|
|
69587
|
+
if (!folders.includes(node22.id))
|
|
69588
|
+
return node22;
|
|
69589
|
+
});
|
|
69590
|
+
}
|
|
69591
|
+
const findParentNode = (parentNode, childId) => {
|
|
69592
|
+
if (parentNode.children)
|
|
69593
|
+
for (const child of parentNode.children) {
|
|
69594
|
+
if (child.id === childId)
|
|
69595
|
+
return parentNode;
|
|
69596
|
+
const foundNode = findParentNode(child, childId);
|
|
69597
|
+
if (foundNode)
|
|
69598
|
+
return foundNode;
|
|
69599
|
+
}
|
|
69600
|
+
};
|
|
69601
|
+
function modifyNode(data, callback) {
|
|
69602
|
+
return doModify(data, callback) || data;
|
|
69603
|
+
}
|
|
69604
|
+
function doModify(current, callback, parent) {
|
|
69605
|
+
var _a2;
|
|
69606
|
+
const result = callback(current, parent);
|
|
69607
|
+
if ((_a2 = result == null ? void 0 : result.children) != null && _a2.length) {
|
|
69608
|
+
const children = [];
|
|
69609
|
+
for (const child of (result == null ? void 0 : result.children) || []) {
|
|
69610
|
+
const res = doModify(child, callback, result);
|
|
69611
|
+
res && children.push(res);
|
|
69612
|
+
}
|
|
69613
|
+
return {
|
|
69614
|
+
...result,
|
|
69615
|
+
children
|
|
69616
|
+
};
|
|
69617
|
+
}
|
|
69618
|
+
return result;
|
|
69619
|
+
}
|
|
69620
|
+
function moveNode(node2, {
|
|
69621
|
+
destinationId,
|
|
69622
|
+
folders
|
|
69623
|
+
}) {
|
|
69624
|
+
return modifyNode(node2, (node22, parent) => {
|
|
69625
|
+
var _a2, _b2;
|
|
69626
|
+
if (destinationId === node22.id) {
|
|
69627
|
+
const parentAncestors = [...((_a2 = node22.folder) == null ? void 0 : _a2.ancestors) || []], ancestors = arrayUnique([...parentAncestors, node22.id]), newChildren = [...node22.children || []], childrenIds = ((_b2 = node22.children) == null ? void 0 : _b2.map((child) => child.id)) || [];
|
|
69628
|
+
for (const folder of folders)
|
|
69629
|
+
if (!childrenIds.includes(folder)) {
|
|
69630
|
+
const item = findNodeById(node22, folder);
|
|
69631
|
+
item && newChildren.push({
|
|
69632
|
+
...item,
|
|
69633
|
+
folder: {
|
|
69634
|
+
...item == null ? void 0 : item.folder,
|
|
69635
|
+
ancestors
|
|
69636
|
+
}
|
|
69637
|
+
});
|
|
69638
|
+
}
|
|
69639
|
+
return {
|
|
69640
|
+
...node22,
|
|
69641
|
+
children: newChildren
|
|
69642
|
+
};
|
|
69643
|
+
} else
|
|
69644
|
+
return folders.includes(node22.id) && destinationId !== (parent == null ? void 0 : parent.id) ? void 0 : node22;
|
|
69645
|
+
});
|
|
69646
|
+
}
|
|
69647
|
+
const wrapTreeNode = (node2, folders, parentId) => modifyNode(node2, (node22) => (node22.id === parentId && (node22.children = folders == null ? void 0 : folders.map((e2) => new TreeNodeFolderWrapper(e2))), node22));
|
|
69648
|
+
function updateNode(node2, {
|
|
69649
|
+
folderId,
|
|
69650
|
+
newFolder
|
|
69651
|
+
}) {
|
|
69652
|
+
return modifyNode(node2, (node22) => node22.id === folderId ? new TreeNodeFolderWrapper(newFolder) : node22);
|
|
69653
|
+
}
|
|
69558
69654
|
function findPathById(tree, nodeId) {
|
|
69559
69655
|
let path2 = [];
|
|
69560
69656
|
function traverse(node2, currentPath) {
|
|
@@ -69577,6 +69673,16 @@ void main()
|
|
|
69577
69673
|
}
|
|
69578
69674
|
return startTraverse(tree), path2;
|
|
69579
69675
|
}
|
|
69676
|
+
class TreeNodeFolderWrapper {
|
|
69677
|
+
constructor(folder) {
|
|
69678
|
+
__publicField(this, "id");
|
|
69679
|
+
__publicField(this, "name");
|
|
69680
|
+
__publicField(this, "childNumber");
|
|
69681
|
+
__publicField(this, "section", false);
|
|
69682
|
+
__publicField(this, "children", []);
|
|
69683
|
+
this.folder = folder, this.id = folder.id, this.name = folder.name, this.childNumber = folder.childNumber;
|
|
69684
|
+
}
|
|
69685
|
+
}
|
|
69580
69686
|
const getBestSupportedMimeType = () => MediaRecorder.isTypeSupported ? ["video/webm;codecs=vp9", 'video/mp4; codecs="avc1.424028, mp4a.40.2"', "video/webm;codecs=vp8,opus", "video/webm"].find((type2) => MediaRecorder.isTypeSupported(type2) ? true : (console.error(`${type2} is not Supported`), false)) || "video/ogg" : "video/webm;codecs=vp8,opus", ModalContext = /* @__PURE__ */ reactExports.createContext({
|
|
69581
69687
|
ariaLabelId: "",
|
|
69582
69688
|
ariaDescriptionId: "",
|
|
@@ -70652,7 +70758,7 @@ void main()
|
|
|
70652
70758
|
handleItemClick,
|
|
70653
70759
|
handleToggleNode
|
|
70654
70760
|
}) => {
|
|
70655
|
-
const expanded = expandedNodes.has(node2.id), sibling = siblingsNodes == null ? void 0 : siblingsNodes.has(node2.id), selected = selectedNodeId === node2.id, focused = draggedNodeId === node2.id, treeItemClasses = {
|
|
70761
|
+
const expanded = expandedNodes.has(node2.id), sibling = siblingsNodes == null ? void 0 : siblingsNodes.current.has(node2.id), selected = selectedNodeId === node2.id, focused = draggedNodeId === node2.id, treeItemClasses = {
|
|
70656
70762
|
action: clsx("action-container d-flex align-items-center gap-8 px-2", {
|
|
70657
70763
|
"drag-focus": focused,
|
|
70658
70764
|
"py-4": !node2.section
|
|
@@ -70681,13 +70787,14 @@ void main()
|
|
|
70681
70787
|
(event.code === "Enter" || event.code === "Space") && (event.preventDefault(), event.stopPropagation(), handleItemClick == null || handleItemClick(node2.id));
|
|
70682
70788
|
}, handleItemToggleKeyDown = (event) => {
|
|
70683
70789
|
(event.code === "Enter" || event.code === "Space") && (event.preventDefault(), event.stopPropagation(), handleToggleNode == null || handleToggleNode(node2.id));
|
|
70684
|
-
}, renderRafterIcon = (expanded2) => /* @__PURE__ */ jsxRuntimeExports.jsx(expanded2 ? SvgRafterDown$1 : SvgRafterRight$1, { title: t2("foldUnfold"), width: iconSize, height: iconSize })
|
|
70790
|
+
}, renderRafterIcon = (expanded2) => /* @__PURE__ */ jsxRuntimeExports.jsx(expanded2 ? SvgRafterDown$1 : SvgRafterRight$1, { title: t2("foldUnfold"), width: iconSize, height: iconSize }), shouldRenderRafterIcon = () => {
|
|
70791
|
+
var _a2;
|
|
70792
|
+
const hasNoSiblings = !((_a2 = siblingsNodes == null ? void 0 : siblingsNodes.current) != null && _a2.has(node2.id)), hasChildren2 = Array.isArray(node2.children) && node2.children.length > 0;
|
|
70793
|
+
return sibling || hasNoSiblings && hasChildren2;
|
|
70794
|
+
};
|
|
70685
70795
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { ref: setNodeRef, id: `treeitem-${node2.id}`, role: "treeitem", "aria-selected": selected && selected, "aria-expanded": expanded && expanded, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
70686
70796
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: treeItemClasses.action, children: [
|
|
70687
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
70688
|
-
sibling && renderRafterIcon(expanded),
|
|
70689
|
-
Array.isArray(node2.children) && !!node2.children.length && renderRafterIcon(expanded)
|
|
70690
|
-
] }),
|
|
70797
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: treeItemClasses.arrow, tabIndex: 0, role: "button", onClick: () => handleOnToggleNode(node2.id), onKeyDown: handleItemToggleKeyDown, "aria-label": t2("foldUnfold"), children: shouldRenderRafterIcon() && renderRafterIcon(expanded) }),
|
|
70691
70798
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { tabIndex: 0, role: "button", className: treeItemClasses.button, onClick: () => handleOnItemClick(node2.id), onKeyDown: handleItemKeyDown, children: [
|
|
70692
70799
|
node2.section && showIcon && /* @__PURE__ */ jsxRuntimeExports.jsx(SvgFolder$1, { title: t2("folder"), width: 20, height: 20 }),
|
|
70693
70800
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-truncate", children: node2.name })
|
|
@@ -70704,24 +70811,24 @@ void main()
|
|
|
70704
70811
|
onTreeItemFold,
|
|
70705
70812
|
onTreeItemClick
|
|
70706
70813
|
}) => {
|
|
70707
|
-
const [internalSelectedNodeId, setInternalSelectedNodeId] = reactExports.useState(void 0), [expandedNodes, setExpandedNodes] = reactExports.useState(/* @__PURE__ */ new Set()),
|
|
70814
|
+
const [internalSelectedNodeId, setInternalSelectedNodeId] = reactExports.useState(void 0), [expandedNodes, setExpandedNodes] = reactExports.useState(/* @__PURE__ */ new Set()), siblingsNodes = reactExports.useRef(/* @__PURE__ */ new Set()), [draggedNodeId, setDraggedNodeId] = reactExports.useState(void 0), selectedNodeId = internalSelectedNodeId ?? externalSelectedNodeId;
|
|
70708
70815
|
function addNodesWithSiblingHavingChildren(data2) {
|
|
70709
70816
|
var _a2;
|
|
70710
|
-
const resultSet = new Set(siblingsNodes);
|
|
70711
70817
|
Array.isArray(data2) ? data2.forEach((node2) => {
|
|
70818
|
+
const resultSet = new Set(siblingsNodes.current);
|
|
70712
70819
|
data2.filter(({
|
|
70713
70820
|
id: id2
|
|
70714
|
-
}) => id2 !== node2.id).some((sibling) => sibling.children && sibling.children.length > 0) &&
|
|
70821
|
+
}) => id2 !== node2.id).some((sibling) => sibling.children && sibling.children.length > 0) && resultSet.add(node2.id), node2.children && node2.children.length > 0 && node2.children.forEach((child) => {
|
|
70715
70822
|
var _a22;
|
|
70716
70823
|
const childSiblings = (_a22 = node2.children) == null ? void 0 : _a22.filter(({
|
|
70717
70824
|
id: id2
|
|
70718
70825
|
}) => id2 !== child.id);
|
|
70719
|
-
(childSiblings == null ? void 0 : childSiblings.some((sibling) => sibling.children && sibling.children.length > 0)) &&
|
|
70826
|
+
(childSiblings == null ? void 0 : childSiblings.some((sibling) => sibling.children && sibling.children.length > 0)) && resultSet.add(child.id), addNodesWithSiblingHavingChildren(child);
|
|
70720
70827
|
});
|
|
70721
70828
|
}) : (_a2 = data2.children) == null || _a2.forEach((child) => {
|
|
70722
70829
|
var _a22;
|
|
70723
|
-
const siblings = (_a22 = data2.children) == null ? void 0 : _a22.filter((c6) => c6.id !== child.id);
|
|
70724
|
-
(siblings == null ? void 0 : siblings.some((sibling) => sibling.children && sibling.children.length > 0)) && (resultSet.add(child.id),
|
|
70830
|
+
const resultSet = new Set(siblingsNodes.current), siblings = (_a22 = data2.children) == null ? void 0 : _a22.filter((c6) => c6.id !== child.id);
|
|
70831
|
+
(siblings == null ? void 0 : siblings.some((sibling) => sibling.children && sibling.children.length > 0)) && (resultSet.add(child.id), siblingsNodes.current = resultSet), addNodesWithSiblingHavingChildren(child);
|
|
70725
70832
|
});
|
|
70726
70833
|
}
|
|
70727
70834
|
reactExports.useEffect(() => {
|
|
@@ -70745,7 +70852,7 @@ void main()
|
|
|
70745
70852
|
externalSelectedNodeId && (handleExternalSelectedNodeId(externalSelectedNodeId), setInternalSelectedNodeId(externalSelectedNodeId));
|
|
70746
70853
|
}, [externalSelectedNodeId]);
|
|
70747
70854
|
const handleExternalSelectedNodeId = (nodeId) => {
|
|
70748
|
-
if (findNodeById
|
|
70855
|
+
if (findNodeById(data, selectedNodeId)) {
|
|
70749
70856
|
if (externalSelectedNodeId === "default") {
|
|
70750
70857
|
expandedNodes.forEach((node2) => onTreeItemUnfold == null ? void 0 : onTreeItemUnfold(node2));
|
|
70751
70858
|
return;
|
|
@@ -70768,9 +70875,9 @@ void main()
|
|
|
70768
70875
|
}, handleItemClick = (nodeId) => {
|
|
70769
70876
|
handleSelectedItem(nodeId), handleExpandNode(nodeId), onTreeItemClick == null || onTreeItemClick(nodeId);
|
|
70770
70877
|
}, handleFoldUnfold = (nodeId) => {
|
|
70771
|
-
|
|
70878
|
+
handleToggleNode(nodeId);
|
|
70772
70879
|
}, handleItemDrag = (nodeId) => {
|
|
70773
|
-
findNodeById
|
|
70880
|
+
findNodeById(data, externalSelectedNodeId) && handleExpandNode(nodeId);
|
|
70774
70881
|
};
|
|
70775
70882
|
return {
|
|
70776
70883
|
selectedNodeId,
|
|
@@ -71466,7 +71573,7 @@ void main()
|
|
|
71466
71573
|
browser: browser2,
|
|
71467
71574
|
device
|
|
71468
71575
|
} = useBrowserInfo(navigator.userAgent), {
|
|
71469
|
-
create
|
|
71576
|
+
create
|
|
71470
71577
|
} = useWorkspaceFile$1(), getUploadStatus = reactExports.useCallback((upload) => status[getOrGenerateBlobId(upload)], [status]), setUploadStatus = (blob, status2) => {
|
|
71471
71578
|
setStatus((prevStatus) => {
|
|
71472
71579
|
const key = getOrGenerateBlobId(blob);
|
|
@@ -71491,7 +71598,7 @@ void main()
|
|
|
71491
71598
|
return application === "media-library" && file.type.includes("video") ? resource = await uploadVideo(file, {
|
|
71492
71599
|
filename: file.name,
|
|
71493
71600
|
...metadata
|
|
71494
|
-
}) : resource = await
|
|
71601
|
+
}) : resource = await create(file, {
|
|
71495
71602
|
application,
|
|
71496
71603
|
visibility
|
|
71497
71604
|
}), setUploadStatus(file, "success"), resource;
|
|
@@ -71716,7 +71823,7 @@ void main()
|
|
|
71716
71823
|
function treeReducer(state, action) {
|
|
71717
71824
|
switch (action.type) {
|
|
71718
71825
|
case "update": {
|
|
71719
|
-
const node2 = findNodeById
|
|
71826
|
+
const node2 = findNodeById(state, action.folderId);
|
|
71720
71827
|
return node2 && (node2.children = action.subfolders.map((f2) => ({
|
|
71721
71828
|
id: f2._id || "",
|
|
71722
71829
|
name: f2.name
|
|
@@ -72096,7 +72203,7 @@ void main()
|
|
|
72096
72203
|
}), audioNameRef = reactExports.useRef(null), audioRef = reactExports.useRef(null), leftChannelRef = reactExports.useRef(), rightChannelRef = reactExports.useRef(), {
|
|
72097
72204
|
t: t2
|
|
72098
72205
|
} = useTranslation(), {
|
|
72099
|
-
create
|
|
72206
|
+
create
|
|
72100
72207
|
} = useWorkspaceFile$1(), BUFFER_SIZE = 128, DEFAULT_SAMPLE_RATE = 48e3;
|
|
72101
72208
|
reactExports.useEffect(() => {
|
|
72102
72209
|
const encoderWorker2 = new Worker("/infra/public/js/audioEncoder.js");
|
|
@@ -72208,7 +72315,7 @@ void main()
|
|
|
72208
72315
|
if (event.data instanceof Blob) {
|
|
72209
72316
|
const file = new File([event.data], audioName, {
|
|
72210
72317
|
type: "audio/mp3"
|
|
72211
|
-
}), resourceAudio = await
|
|
72318
|
+
}), resourceAudio = await create(file, {
|
|
72212
72319
|
application,
|
|
72213
72320
|
visibility
|
|
72214
72321
|
});
|
|
@@ -73929,7 +74036,7 @@ void main()
|
|
|
73929
74036
|
onSelect,
|
|
73930
74037
|
multiple = true,
|
|
73931
74038
|
className,
|
|
73932
|
-
defaultFolder,
|
|
74039
|
+
defaultFolder: defaultFolder2,
|
|
73933
74040
|
showPublicFolder
|
|
73934
74041
|
}) => {
|
|
73935
74042
|
const {
|
|
@@ -73946,7 +74053,7 @@ void main()
|
|
|
73946
74053
|
} = useWorkspaceSearch("root", t2("workspace.tree.protected"), "protected", roles), {
|
|
73947
74054
|
root: publicRoot,
|
|
73948
74055
|
loadContent: loadPublicDocs
|
|
73949
|
-
} = useWorkspaceSearch("root", t2("workspace.tree.public"), "public", roles), ownerRef = reactExports.useRef(null), sharedRef = reactExports.useRef(null), protectRef = reactExports.useRef(null), publicRef = reactExports.useRef(null), [currentFilter, setCurrentFilter] = reactExports.useState(() =>
|
|
74056
|
+
} = useWorkspaceSearch("root", t2("workspace.tree.public"), "public", roles), ownerRef = reactExports.useRef(null), sharedRef = reactExports.useRef(null), protectRef = reactExports.useRef(null), publicRef = reactExports.useRef(null), [currentFilter, setCurrentFilter] = reactExports.useState(() => defaultFolder2 === "public" ? showPublicFolder ? defaultFolder2 : "protected" : defaultFolder2 === "protected" || defaultFolder2 === "shared" ? defaultFolder2 : "owner"), [currentNode, setCurrentNode] = reactExports.useState(() => defaultFolder2 === "public" ? showPublicFolder ? publicRoot : protectRoot : defaultFolder2 === "protected" ? protectRoot : defaultFolder2 === "shared" ? sharedRoot : ownerRoot), [documents, setDocuments] = reactExports.useState(), [searchTerm, setSearchTerm] = reactExports.useState(null), [sortOrder, setSortOrder] = reactExports.useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = reactExports.useState([]), rootNodeFor = reactExports.useCallback((filter) => {
|
|
73950
74057
|
switch (filter) {
|
|
73951
74058
|
case "owner":
|
|
73952
74059
|
return {
|
|
@@ -76066,6 +76173,30 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76066
76173
|
renderCookies
|
|
76067
76174
|
] });
|
|
76068
76175
|
}, Layout$1 = Layout;
|
|
76176
|
+
const rootElement = document.querySelector(
|
|
76177
|
+
"[data-explorer-config]"
|
|
76178
|
+
);
|
|
76179
|
+
let config;
|
|
76180
|
+
function getExplorerConfig() {
|
|
76181
|
+
var _a2;
|
|
76182
|
+
if ((_a2 = rootElement == null ? void 0 : rootElement.dataset) == null ? void 0 : _a2.explorerConfig) {
|
|
76183
|
+
const { explorerConfig } = rootElement.dataset;
|
|
76184
|
+
try {
|
|
76185
|
+
const parsedConfig = JSON.parse(explorerConfig);
|
|
76186
|
+
config = {
|
|
76187
|
+
...parsedConfig,
|
|
76188
|
+
enableOnboarding: parsedConfig.enableOnboarding !== void 0 ? parsedConfig.enableOnboarding : true
|
|
76189
|
+
};
|
|
76190
|
+
} catch (e2) {
|
|
76191
|
+
console.error(
|
|
76192
|
+
"[Explorer Config] could not parse app params from root data attributes:",
|
|
76193
|
+
rootElement == null ? void 0 : rootElement.dataset,
|
|
76194
|
+
e2
|
|
76195
|
+
);
|
|
76196
|
+
}
|
|
76197
|
+
}
|
|
76198
|
+
return config;
|
|
76199
|
+
}
|
|
76069
76200
|
const scriptRel = "modulepreload";
|
|
76070
76201
|
const assetsURL = function(dep) {
|
|
76071
76202
|
return "/" + dep;
|
|
@@ -76110,39 +76241,6 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76110
76241
|
}
|
|
76111
76242
|
});
|
|
76112
76243
|
};
|
|
76113
|
-
var ReactQueryDevtools2 = function() {
|
|
76114
|
-
return null;
|
|
76115
|
-
};
|
|
76116
|
-
var createRoot;
|
|
76117
|
-
var m$1 = reactDomExports;
|
|
76118
|
-
{
|
|
76119
|
-
createRoot = m$1.createRoot;
|
|
76120
|
-
m$1.hydrateRoot;
|
|
76121
|
-
}
|
|
76122
|
-
const rootElement = document.querySelector(
|
|
76123
|
-
"[data-explorer-config]"
|
|
76124
|
-
);
|
|
76125
|
-
let config;
|
|
76126
|
-
function getExplorerConfig() {
|
|
76127
|
-
var _a2;
|
|
76128
|
-
if ((_a2 = rootElement == null ? void 0 : rootElement.dataset) == null ? void 0 : _a2.explorerConfig) {
|
|
76129
|
-
const { explorerConfig } = rootElement.dataset;
|
|
76130
|
-
try {
|
|
76131
|
-
const parsedConfig = JSON.parse(explorerConfig);
|
|
76132
|
-
config = {
|
|
76133
|
-
...parsedConfig,
|
|
76134
|
-
enableOnboarding: parsedConfig.enableOnboarding !== void 0 ? parsedConfig.enableOnboarding : true
|
|
76135
|
-
};
|
|
76136
|
-
} catch (e2) {
|
|
76137
|
-
console.error(
|
|
76138
|
-
"[Explorer Config] could not parse app params from root data attributes:",
|
|
76139
|
-
rootElement == null ? void 0 : rootElement.dataset,
|
|
76140
|
-
e2
|
|
76141
|
-
);
|
|
76142
|
-
}
|
|
76143
|
-
}
|
|
76144
|
-
return config;
|
|
76145
|
-
}
|
|
76146
76244
|
const snapCenterToCursor = (_ref) => {
|
|
76147
76245
|
let {
|
|
76148
76246
|
activatorEvent,
|
|
@@ -76194,7 +76292,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76194
76292
|
const initialState2 = state = createState(setState, getState, api);
|
|
76195
76293
|
return api;
|
|
76196
76294
|
};
|
|
76197
|
-
const createStore = (createState) =>
|
|
76295
|
+
const createStore = (createState) => createStoreImpl;
|
|
76198
76296
|
var withSelector = { exports: {} };
|
|
76199
76297
|
var withSelector_production_min = {};
|
|
76200
76298
|
var shim = { exports: {} };
|
|
@@ -76333,18 +76431,6 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76333
76431
|
useDebugValue(slice2);
|
|
76334
76432
|
return slice2;
|
|
76335
76433
|
}
|
|
76336
|
-
const createImpl = (createState) => {
|
|
76337
|
-
if ((define_import_meta_env_default ? "production" : void 0) !== "production" && typeof createState !== "function") {
|
|
76338
|
-
console.warn(
|
|
76339
|
-
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
|
|
76340
|
-
);
|
|
76341
|
-
}
|
|
76342
|
-
const api = typeof createState === "function" ? createStore(createState) : createState;
|
|
76343
|
-
const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
|
|
76344
|
-
Object.assign(useBoundStore, api);
|
|
76345
|
-
return useBoundStore;
|
|
76346
|
-
};
|
|
76347
|
-
const create = (createState) => createImpl;
|
|
76348
76434
|
const searchContext = async (searchParams) => {
|
|
76349
76435
|
const search = await odeServices.resource(searchParams.application).searchContext(searchParams);
|
|
76350
76436
|
return {
|
|
@@ -76488,82 +76574,11 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76488
76574
|
const url = odeServices.resource(searchParams.application).getExportUrl(assetId);
|
|
76489
76575
|
return window.open(url, "_self");
|
|
76490
76576
|
};
|
|
76491
|
-
|
|
76492
|
-
|
|
76493
|
-
|
|
76494
|
-
|
|
76495
|
-
|
|
76496
|
-
}
|
|
76497
|
-
if ((_a2 = data == null ? void 0 : data.children) == null ? void 0 : _a2.length) {
|
|
76498
|
-
(_b2 = data == null ? void 0 : data.children) == null ? void 0 : _b2.every((childNode) => {
|
|
76499
|
-
res = findNodeById(childNode, id2);
|
|
76500
|
-
return res === void 0;
|
|
76501
|
-
});
|
|
76502
|
-
}
|
|
76503
|
-
return res;
|
|
76504
|
-
}
|
|
76505
|
-
const findParentNode = (parentNode, childId) => {
|
|
76506
|
-
if (parentNode.children) {
|
|
76507
|
-
for (const child of parentNode.children) {
|
|
76508
|
-
if (child.id === childId) {
|
|
76509
|
-
return parentNode;
|
|
76510
|
-
}
|
|
76511
|
-
const foundNode = findParentNode(child, childId);
|
|
76512
|
-
if (foundNode) {
|
|
76513
|
-
return foundNode;
|
|
76514
|
-
}
|
|
76515
|
-
}
|
|
76516
|
-
}
|
|
76517
|
-
return void 0;
|
|
76518
|
-
};
|
|
76519
|
-
function hasChildren(folderId, data) {
|
|
76520
|
-
if (data.id === folderId && data.children) {
|
|
76521
|
-
return data.children.length > 0;
|
|
76522
|
-
}
|
|
76523
|
-
if (data.children) {
|
|
76524
|
-
return data.children.some((child) => hasChildren(data.id, child));
|
|
76525
|
-
}
|
|
76526
|
-
return false;
|
|
76527
|
-
}
|
|
76528
|
-
function modifyNode(data, callback) {
|
|
76529
|
-
const root2 = doModify(data, callback) || data;
|
|
76530
|
-
return root2;
|
|
76531
|
-
}
|
|
76532
|
-
function doModify(current, callback, parent) {
|
|
76533
|
-
var _a2;
|
|
76534
|
-
const result = callback(current, parent);
|
|
76535
|
-
if ((_a2 = result == null ? void 0 : result.children) == null ? void 0 : _a2.length) {
|
|
76536
|
-
const children = [];
|
|
76537
|
-
for (const child of (result == null ? void 0 : result.children) || []) {
|
|
76538
|
-
const res = doModify(child, callback, result);
|
|
76539
|
-
if (res) {
|
|
76540
|
-
children.push(res);
|
|
76541
|
-
}
|
|
76542
|
-
}
|
|
76543
|
-
return { ...result, children };
|
|
76544
|
-
}
|
|
76545
|
-
return result;
|
|
76546
|
-
}
|
|
76547
|
-
class TreeNodeFolderWrapper {
|
|
76548
|
-
constructor(folder) {
|
|
76549
|
-
__publicField(this, "id");
|
|
76550
|
-
__publicField(this, "name");
|
|
76551
|
-
__publicField(this, "childNumber");
|
|
76552
|
-
__publicField(this, "section", false);
|
|
76553
|
-
__publicField(this, "children", []);
|
|
76554
|
-
this.folder = folder;
|
|
76555
|
-
this.id = folder.id;
|
|
76556
|
-
this.name = folder.name;
|
|
76557
|
-
this.childNumber = folder.childNumber;
|
|
76558
|
-
}
|
|
76559
|
-
}
|
|
76560
|
-
const wrapTreeNode = (treeNode, folders, parentId) => {
|
|
76561
|
-
return modifyNode(treeNode, (node2) => {
|
|
76562
|
-
if (node2.id === parentId) {
|
|
76563
|
-
node2.children = folders == null ? void 0 : folders.map((e2) => new TreeNodeFolderWrapper(e2));
|
|
76564
|
-
}
|
|
76565
|
-
return node2;
|
|
76566
|
-
});
|
|
76577
|
+
const defaultFolder = {
|
|
76578
|
+
id: FOLDER.DEFAULT,
|
|
76579
|
+
name: t$4("explorer.filters.mine"),
|
|
76580
|
+
section: true,
|
|
76581
|
+
children: []
|
|
76567
76582
|
};
|
|
76568
76583
|
const initialState = {
|
|
76569
76584
|
config: void 0,
|
|
@@ -76585,12 +76600,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76585
76600
|
},
|
|
76586
76601
|
trashed: false
|
|
76587
76602
|
},
|
|
76588
|
-
treeData:
|
|
76589
|
-
id: FOLDER.DEFAULT,
|
|
76590
|
-
name: t$4("explorer.filters.mine"),
|
|
76591
|
-
section: true,
|
|
76592
|
-
children: []
|
|
76593
|
-
},
|
|
76603
|
+
treeData: defaultFolder,
|
|
76594
76604
|
selectedNodeId: "default",
|
|
76595
76605
|
currentFolder: {
|
|
76596
76606
|
id: "default"
|
|
@@ -76612,14 +76622,16 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76612
76622
|
resourceActionDisable: false,
|
|
76613
76623
|
status: void 0
|
|
76614
76624
|
};
|
|
76615
|
-
const
|
|
76625
|
+
const store = createStore()((set2, get2) => ({
|
|
76616
76626
|
...initialState,
|
|
76617
|
-
|
|
76627
|
+
actions: {
|
|
76618
76628
|
setConfig: (config2) => set2({ config: config2 }),
|
|
76619
76629
|
setSearchConfig: (searchConfig) => set2((state) => ({
|
|
76620
76630
|
searchConfig: { ...state.searchConfig, ...searchConfig }
|
|
76621
76631
|
})),
|
|
76622
|
-
setTreeData: (
|
|
76632
|
+
setTreeData: (treeData2) => set2(() => ({
|
|
76633
|
+
treeData: treeData2
|
|
76634
|
+
})),
|
|
76623
76635
|
setSearchParams: (searchParams) => {
|
|
76624
76636
|
set2((state) => {
|
|
76625
76637
|
const { searchParams: previousSearchParams } = state;
|
|
@@ -76675,7 +76687,6 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76675
76687
|
setResourceOrFolderIsDraggable: (resourceOrFolderIsDraggable) => set2(() => ({ resourceOrFolderIsDraggable })),
|
|
76676
76688
|
setElementDragOver: (elementDragOver) => set2(() => ({ elementDragOver })),
|
|
76677
76689
|
setResourceActionDisable: (resourceActionDisable) => set2(() => ({ resourceActionDisable })),
|
|
76678
|
-
setCurrentFolder: (currentFolder) => set2(() => ({ currentFolder })),
|
|
76679
76690
|
clearSelectedItems: () => set2(() => ({ selectedFolders: [], selectedResources: [] })),
|
|
76680
76691
|
clearSelectedIds: () => set2(() => ({ resourceIds: [], folderIds: [] })),
|
|
76681
76692
|
openResource: (resource) => {
|
|
@@ -76700,12 +76711,20 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76700
76711
|
console.error("explorer print failed: ", error);
|
|
76701
76712
|
}
|
|
76702
76713
|
},
|
|
76703
|
-
openFolder: ({
|
|
76714
|
+
openFolder: ({
|
|
76715
|
+
folderId,
|
|
76716
|
+
folder,
|
|
76717
|
+
queryClient: queryClient2
|
|
76718
|
+
}) => {
|
|
76704
76719
|
const { searchParams } = get2();
|
|
76705
76720
|
const previousId = searchParams.filters.folder;
|
|
76706
76721
|
const selectedNodeId = folderId;
|
|
76707
76722
|
if (previousId === folderId)
|
|
76708
76723
|
return;
|
|
76724
|
+
get2().actions.fetchTreeData(
|
|
76725
|
+
folderId,
|
|
76726
|
+
queryClient2
|
|
76727
|
+
);
|
|
76709
76728
|
set2((state) => {
|
|
76710
76729
|
return {
|
|
76711
76730
|
...state,
|
|
@@ -76729,56 +76748,40 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76729
76748
|
});
|
|
76730
76749
|
},
|
|
76731
76750
|
foldTreeItem: () => set2((state) => ({ ...state, status: "fold" })),
|
|
76732
|
-
|
|
76733
|
-
const
|
|
76734
|
-
|
|
76735
|
-
if (
|
|
76736
|
-
|
|
76737
|
-
|
|
76738
|
-
|
|
76739
|
-
"prefetchContext",
|
|
76740
|
-
{
|
|
76741
|
-
folderId,
|
|
76742
|
-
trashed: false
|
|
76743
|
-
}
|
|
76744
|
-
],
|
|
76745
|
-
queryFn: async () => await searchContext({
|
|
76746
|
-
...searchParams,
|
|
76747
|
-
filters: {
|
|
76748
|
-
...searchParams.filters,
|
|
76749
|
-
folder: folderId
|
|
76750
|
-
}
|
|
76751
|
-
})
|
|
76752
|
-
});
|
|
76753
|
-
const data = queryClient2.getQueryData([
|
|
76751
|
+
fetchTreeData: async (nodeId, queryClient2) => {
|
|
76752
|
+
const folder = findNodeById(get2().treeData, nodeId);
|
|
76753
|
+
const folderId = folder == null ? void 0 : folder.id;
|
|
76754
|
+
if (Array.isArray(folder == null ? void 0 : folder.children) && !!folder.children.length)
|
|
76755
|
+
return;
|
|
76756
|
+
const getQueryData = await queryClient2.fetchQuery({
|
|
76757
|
+
queryKey: [
|
|
76754
76758
|
"prefetchContext",
|
|
76755
76759
|
{
|
|
76756
76760
|
folderId,
|
|
76757
76761
|
trashed: false
|
|
76758
76762
|
}
|
|
76759
|
-
]
|
|
76760
|
-
|
|
76761
|
-
|
|
76762
|
-
|
|
76763
|
-
...
|
|
76764
|
-
|
|
76765
|
-
|
|
76766
|
-
|
|
76767
|
-
|
|
76768
|
-
|
|
76769
|
-
|
|
76770
|
-
|
|
76771
|
-
|
|
76772
|
-
|
|
76773
|
-
|
|
76774
|
-
|
|
76775
|
-
unfoldTreeItem(folderId, queryClient2);
|
|
76763
|
+
],
|
|
76764
|
+
queryFn: async () => await searchContext({
|
|
76765
|
+
...get2().searchParams,
|
|
76766
|
+
filters: {
|
|
76767
|
+
...get2().searchParams.filters,
|
|
76768
|
+
folder: folderId
|
|
76769
|
+
}
|
|
76770
|
+
})
|
|
76771
|
+
});
|
|
76772
|
+
get2().actions.setTreeData(
|
|
76773
|
+
wrapTreeNode(
|
|
76774
|
+
get2().treeData,
|
|
76775
|
+
getQueryData == null ? void 0 : getQueryData.folders,
|
|
76776
|
+
folderId || FOLDER.DEFAULT
|
|
76777
|
+
)
|
|
76778
|
+
);
|
|
76776
76779
|
},
|
|
76777
|
-
selectTreeItem: (folderId) => {
|
|
76778
|
-
const { treeData } = get2();
|
|
76779
|
-
const { openFolder } = get2().
|
|
76780
|
-
const folder = findNodeById(
|
|
76781
|
-
|
|
76780
|
+
selectTreeItem: (folderId, queryClient2) => {
|
|
76781
|
+
const { treeData: treeData2 } = get2();
|
|
76782
|
+
const { openFolder, fetchTreeData } = get2().actions;
|
|
76783
|
+
const folder = findNodeById(treeData2, folderId);
|
|
76784
|
+
fetchTreeData(folderId, queryClient2);
|
|
76782
76785
|
set2((state) => ({
|
|
76783
76786
|
...state,
|
|
76784
76787
|
searchParams: {
|
|
@@ -76794,11 +76797,17 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76794
76797
|
});
|
|
76795
76798
|
},
|
|
76796
76799
|
gotoPreviousFolder: () => {
|
|
76797
|
-
const { selectedNodeId, treeData } = get2();
|
|
76798
|
-
const { openFolder } = get2().
|
|
76800
|
+
const { selectedNodeId, treeData: treeData2, searchParams } = get2();
|
|
76801
|
+
const { openFolder } = get2().actions;
|
|
76802
|
+
if (searchParams.search) {
|
|
76803
|
+
openFolder({
|
|
76804
|
+
folder: defaultFolder,
|
|
76805
|
+
folderId: FOLDER.DEFAULT
|
|
76806
|
+
});
|
|
76807
|
+
}
|
|
76799
76808
|
if (!selectedNodeId)
|
|
76800
76809
|
return;
|
|
76801
|
-
const previousFolder = findParentNode(
|
|
76810
|
+
const previousFolder = findParentNode(treeData2, selectedNodeId);
|
|
76802
76811
|
openFolder({
|
|
76803
76812
|
folder: previousFolder,
|
|
76804
76813
|
folderId: (previousFolder == null ? void 0 : previousFolder.id) || FOLDER.DEFAULT
|
|
@@ -76827,9 +76836,15 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76827
76836
|
}
|
|
76828
76837
|
}
|
|
76829
76838
|
}));
|
|
76839
|
+
function useStoreContext(selector) {
|
|
76840
|
+
return useStore(store, selector);
|
|
76841
|
+
}
|
|
76842
|
+
const treeData = (state) => state.treeData;
|
|
76843
|
+
const actionsSelector = (state) => state.actions;
|
|
76844
|
+
const useTreeData = () => useStoreContext(treeData);
|
|
76845
|
+
const useStoreActions = () => useStoreContext(actionsSelector);
|
|
76830
76846
|
const useSearchParams = () => useStoreContext((state) => state.searchParams);
|
|
76831
76847
|
const useSelectedNodeId = () => useStoreContext((state) => state.selectedNodeId);
|
|
76832
|
-
const useTreeData = () => useStoreContext((state) => state.treeData);
|
|
76833
76848
|
const useSelectedFolders = () => useStoreContext((state) => state.selectedFolders);
|
|
76834
76849
|
const useSelectedResources = () => useStoreContext((state) => state.selectedResources);
|
|
76835
76850
|
const useSearchConfig = () => useStoreContext((state) => state.searchConfig);
|
|
@@ -76840,7 +76855,6 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76840
76855
|
(state) => state.selectedResources.filter((r2) => r2.assetId === r2.id)
|
|
76841
76856
|
);
|
|
76842
76857
|
const useCurrentFolder = () => useStoreContext((state) => state.currentFolder);
|
|
76843
|
-
const useStoreActions = () => useStoreContext((state) => state.updaters);
|
|
76844
76858
|
const useIsTrash = () => {
|
|
76845
76859
|
const currentFolder = useCurrentFolder();
|
|
76846
76860
|
return (currentFolder == null ? void 0 : currentFolder.id) === FOLDER.BIN;
|
|
@@ -76888,84 +76902,8 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
76888
76902
|
onTrashedCancel
|
|
76889
76903
|
};
|
|
76890
76904
|
};
|
|
76891
|
-
const DELAY =
|
|
76905
|
+
const DELAY = 175;
|
|
76892
76906
|
const TOLERANCE = 5;
|
|
76893
|
-
function arrayUnique(array) {
|
|
76894
|
-
return array.filter((item, index2) => array.indexOf(item) === index2);
|
|
76895
|
-
}
|
|
76896
|
-
function addNode(treeData, { parentId, newFolder }) {
|
|
76897
|
-
return modifyNode(treeData, (node2) => {
|
|
76898
|
-
var _a2;
|
|
76899
|
-
if (node2.id === parentId) {
|
|
76900
|
-
const parentAncestors = [
|
|
76901
|
-
...((_a2 = node2.folder) == null ? void 0 : _a2.ancestors) || []
|
|
76902
|
-
];
|
|
76903
|
-
const ancestors = arrayUnique([...parentAncestors, node2.id]);
|
|
76904
|
-
const newNode = {
|
|
76905
|
-
...node2,
|
|
76906
|
-
children: [
|
|
76907
|
-
...node2.children || [],
|
|
76908
|
-
new TreeNodeFolderWrapper({ ...newFolder, ancestors })
|
|
76909
|
-
]
|
|
76910
|
-
};
|
|
76911
|
-
return newNode;
|
|
76912
|
-
} else {
|
|
76913
|
-
return node2;
|
|
76914
|
-
}
|
|
76915
|
-
});
|
|
76916
|
-
}
|
|
76917
|
-
function deleteNode(treeData, { folders }) {
|
|
76918
|
-
return modifyNode(treeData, (node2) => {
|
|
76919
|
-
if (folders.includes(node2.id)) {
|
|
76920
|
-
return void 0;
|
|
76921
|
-
} else {
|
|
76922
|
-
return node2;
|
|
76923
|
-
}
|
|
76924
|
-
});
|
|
76925
|
-
}
|
|
76926
|
-
function moveNode(treeData, { destinationId, folders }) {
|
|
76927
|
-
return modifyNode(treeData, (node2, parent) => {
|
|
76928
|
-
var _a2, _b2;
|
|
76929
|
-
if (destinationId === node2.id) {
|
|
76930
|
-
const parentAncestors = [
|
|
76931
|
-
...((_a2 = node2.folder) == null ? void 0 : _a2.ancestors) || []
|
|
76932
|
-
];
|
|
76933
|
-
const ancestors = arrayUnique([...parentAncestors, node2.id]);
|
|
76934
|
-
const newChildren = [...node2.children || []];
|
|
76935
|
-
const childrenIds = ((_b2 = node2.children) == null ? void 0 : _b2.map((child) => child.id)) || [];
|
|
76936
|
-
for (const folder of folders) {
|
|
76937
|
-
if (!childrenIds.includes(folder)) {
|
|
76938
|
-
const item = findNodeById(treeData, folder);
|
|
76939
|
-
item && newChildren.push({
|
|
76940
|
-
...item,
|
|
76941
|
-
folder: {
|
|
76942
|
-
...item == null ? void 0 : item.folder,
|
|
76943
|
-
ancestors
|
|
76944
|
-
}
|
|
76945
|
-
});
|
|
76946
|
-
}
|
|
76947
|
-
}
|
|
76948
|
-
const newNode = {
|
|
76949
|
-
...node2,
|
|
76950
|
-
children: newChildren
|
|
76951
|
-
};
|
|
76952
|
-
return newNode;
|
|
76953
|
-
} else if (folders.includes(node2.id) && destinationId !== (parent == null ? void 0 : parent.id)) {
|
|
76954
|
-
return void 0;
|
|
76955
|
-
} else {
|
|
76956
|
-
return node2;
|
|
76957
|
-
}
|
|
76958
|
-
});
|
|
76959
|
-
}
|
|
76960
|
-
function updateNode(treeData, { folderId, newFolder }) {
|
|
76961
|
-
return modifyNode(treeData, (node2) => {
|
|
76962
|
-
if (node2.id === folderId) {
|
|
76963
|
-
return new TreeNodeFolderWrapper(newFolder);
|
|
76964
|
-
} else {
|
|
76965
|
-
return node2;
|
|
76966
|
-
}
|
|
76967
|
-
});
|
|
76968
|
-
}
|
|
76969
76907
|
const actionsQueryOptions = (actions, config2) => {
|
|
76970
76908
|
const actionRights = actions.map((action) => action.workflow);
|
|
76971
76909
|
const cleanedActions = new Set(actionRights);
|
|
@@ -77025,7 +76963,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77025
76963
|
const toast = useToast();
|
|
77026
76964
|
const queryClient2 = useQueryClient();
|
|
77027
76965
|
const searchParams = useSearchParams();
|
|
77028
|
-
const
|
|
76966
|
+
const treeData2 = useTreeData();
|
|
77029
76967
|
const folderIds = useFolderIds();
|
|
77030
76968
|
const assetIds = useResourceAssetIds();
|
|
77031
76969
|
const resourceRealIds = useResourceIds();
|
|
@@ -77079,7 +77017,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77079
77017
|
};
|
|
77080
77018
|
})
|
|
77081
77019
|
};
|
|
77082
|
-
const update2 = deleteNode(
|
|
77020
|
+
const update2 = deleteNode(treeData2, {
|
|
77083
77021
|
folders: folderIds
|
|
77084
77022
|
});
|
|
77085
77023
|
setTreeData(update2);
|
|
@@ -77318,7 +77256,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77318
77256
|
const toast = useToast();
|
|
77319
77257
|
const queryClient2 = useQueryClient();
|
|
77320
77258
|
const searchParams = useSearchParams();
|
|
77321
|
-
const
|
|
77259
|
+
const treeData2 = useTreeData();
|
|
77322
77260
|
const folderIds = useFolderIds();
|
|
77323
77261
|
const assetIds = useResourceAssetIds();
|
|
77324
77262
|
const resourceRealIds = useResourceIds();
|
|
@@ -77352,7 +77290,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77352
77290
|
return queryClient2.setQueryData(queryKey, (prev) => {
|
|
77353
77291
|
var _a2;
|
|
77354
77292
|
if (prev) {
|
|
77355
|
-
const update2 = moveNode(
|
|
77293
|
+
const update2 = moveNode(treeData2, {
|
|
77356
77294
|
destinationId: variables,
|
|
77357
77295
|
folders: folderIds
|
|
77358
77296
|
});
|
|
@@ -77406,7 +77344,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77406
77344
|
const toast = useToast();
|
|
77407
77345
|
const queryClient2 = useQueryClient();
|
|
77408
77346
|
const searchParams = useSearchParams();
|
|
77409
|
-
const
|
|
77347
|
+
const treeData2 = useTreeData();
|
|
77410
77348
|
const { setTreeData } = useStoreActions();
|
|
77411
77349
|
const { filters: filters2, trashed } = searchParams;
|
|
77412
77350
|
const queryKey = [
|
|
@@ -77447,7 +77385,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77447
77385
|
};
|
|
77448
77386
|
})
|
|
77449
77387
|
};
|
|
77450
|
-
const update2 = addNode(
|
|
77388
|
+
const update2 = addNode(treeData2, {
|
|
77451
77389
|
parentId: variables.parentId,
|
|
77452
77390
|
newFolder
|
|
77453
77391
|
});
|
|
@@ -77464,7 +77402,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77464
77402
|
const toast = useToast();
|
|
77465
77403
|
const queryClient2 = useQueryClient();
|
|
77466
77404
|
const searchParams = useSearchParams();
|
|
77467
|
-
const
|
|
77405
|
+
const treeData2 = useTreeData();
|
|
77468
77406
|
const { setFolderIds, setSelectedFolders, setTreeData } = useStoreActions();
|
|
77469
77407
|
const { filters: filters2, trashed } = searchParams;
|
|
77470
77408
|
const queryKey = [
|
|
@@ -77510,7 +77448,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77510
77448
|
};
|
|
77511
77449
|
})
|
|
77512
77450
|
};
|
|
77513
|
-
const update2 = updateNode(
|
|
77451
|
+
const update2 = updateNode(treeData2, {
|
|
77514
77452
|
folderId: variables.folderId,
|
|
77515
77453
|
newFolder: data
|
|
77516
77454
|
});
|
|
@@ -77729,7 +77667,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77729
77667
|
setElementDragOver,
|
|
77730
77668
|
setResourceIds,
|
|
77731
77669
|
setFolderIds,
|
|
77732
|
-
|
|
77670
|
+
fetchTreeData
|
|
77733
77671
|
} = useStoreActions();
|
|
77734
77672
|
const activationConstraint = {
|
|
77735
77673
|
delay: DELAY,
|
|
@@ -77743,8 +77681,27 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77743
77681
|
});
|
|
77744
77682
|
const keyboardSensor = useSensor(KeyboardSensor);
|
|
77745
77683
|
const sensors = useSensors(mouseSensor, touchSensor, keyboardSensor);
|
|
77746
|
-
const
|
|
77684
|
+
const notifySuccess = (active, folderName) => {
|
|
77747
77685
|
var _a2;
|
|
77686
|
+
if (((_a2 = active.data.current) == null ? void 0 : _a2.type) === "resource") {
|
|
77687
|
+
toast.success(
|
|
77688
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77689
|
+
t2("explorer.dragged.resource"),
|
|
77690
|
+
" ",
|
|
77691
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: folderName })
|
|
77692
|
+
] })
|
|
77693
|
+
);
|
|
77694
|
+
} else {
|
|
77695
|
+
toast.success(
|
|
77696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77697
|
+
t2("explorer.dragged.folder"),
|
|
77698
|
+
" ",
|
|
77699
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: folderName })
|
|
77700
|
+
] })
|
|
77701
|
+
);
|
|
77702
|
+
}
|
|
77703
|
+
};
|
|
77704
|
+
const handleDragEnd = async (event) => {
|
|
77748
77705
|
const { over, active } = event;
|
|
77749
77706
|
const elementOver = over == null ? void 0 : over.data.current;
|
|
77750
77707
|
const elementActive = active.data.current;
|
|
@@ -77752,23 +77709,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77752
77709
|
const folderName = (elementOver == null ? void 0 : elementOver.name) ?? rootName;
|
|
77753
77710
|
try {
|
|
77754
77711
|
await moveItem.mutate(elementOver == null ? void 0 : elementOver.id);
|
|
77755
|
-
|
|
77756
|
-
toast.success(
|
|
77757
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77758
|
-
t2("explorer.dragged.resource"),
|
|
77759
|
-
" ",
|
|
77760
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: folderName })
|
|
77761
|
-
] })
|
|
77762
|
-
);
|
|
77763
|
-
} else {
|
|
77764
|
-
toast.success(
|
|
77765
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
77766
|
-
t2("explorer.dragged.folder"),
|
|
77767
|
-
" ",
|
|
77768
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: folderName })
|
|
77769
|
-
] })
|
|
77770
|
-
);
|
|
77771
|
-
}
|
|
77712
|
+
notifySuccess(active, folderName);
|
|
77772
77713
|
} catch (e2) {
|
|
77773
77714
|
console.error(e2);
|
|
77774
77715
|
} finally {
|
|
@@ -77801,7 +77742,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77801
77742
|
const { over } = event;
|
|
77802
77743
|
const elementOver = over == null ? void 0 : over.data.current;
|
|
77803
77744
|
if (over) {
|
|
77804
|
-
|
|
77745
|
+
fetchTreeData(elementOver == null ? void 0 : elementOver.id, queryClient2);
|
|
77805
77746
|
setElementDragOver({
|
|
77806
77747
|
isOver: true,
|
|
77807
77748
|
overId: elementOver == null ? void 0 : elementOver.id,
|
|
@@ -77849,45 +77790,27 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
77849
77790
|
const selectedNodeId = useSelectedNodeId();
|
|
77850
77791
|
const searchParams = useSearchParams();
|
|
77851
77792
|
const currentFolder = useCurrentFolder();
|
|
77852
|
-
const treeData = useTreeData();
|
|
77853
77793
|
const toast = useToast();
|
|
77794
|
+
const queryClient2 = useQueryClient();
|
|
77854
77795
|
const { appCode } = useOdeClient();
|
|
77855
77796
|
const { t: t2 } = useTranslation([appCode]);
|
|
77856
|
-
const { setSearchParams, setSearchConfig,
|
|
77797
|
+
const { setSearchParams, setSearchConfig, fetchTreeData } = useStoreActions();
|
|
77857
77798
|
const { data, isError: isError2, error, isLoading, isFetching, fetchNextPage } = useSearchContext();
|
|
77858
77799
|
const hasNoFolders = (data == null ? void 0 : data.pages[0].folders.length) === 0;
|
|
77859
77800
|
const hasNoResources = (data == null ? void 0 : data.pages[0].resources.length) === 0;
|
|
77860
77801
|
const hasNoData = hasNoFolders && hasNoResources;
|
|
77861
77802
|
reactExports.useEffect(() => {
|
|
77862
|
-
var _a2, _b2
|
|
77803
|
+
var _a2, _b2;
|
|
77863
77804
|
if (data) {
|
|
77864
|
-
|
|
77865
|
-
if ((_b2 = data == null ? void 0 : data.pages[0]) == null ? void 0 : _b2.searchConfig) {
|
|
77805
|
+
if ((_a2 = data == null ? void 0 : data.pages[0]) == null ? void 0 : _a2.searchConfig) {
|
|
77866
77806
|
setSearchConfig(data.pages[0].searchConfig);
|
|
77867
77807
|
}
|
|
77868
|
-
if (!searchParams.search) {
|
|
77869
|
-
|
|
77870
|
-
setTreeData({
|
|
77871
|
-
id: FOLDER.DEFAULT,
|
|
77872
|
-
section: true,
|
|
77873
|
-
children: folders.map(
|
|
77874
|
-
(folder) => new TreeNodeFolderWrapper(folder)
|
|
77875
|
-
),
|
|
77876
|
-
name: t2("explorer.filters.mine", { ns: appCode })
|
|
77877
|
-
});
|
|
77878
|
-
} else {
|
|
77879
|
-
setTreeData(
|
|
77880
|
-
wrapTreeNode(
|
|
77881
|
-
treeData,
|
|
77882
|
-
folders,
|
|
77883
|
-
searchParams.filters.folder || FOLDER.DEFAULT
|
|
77884
|
-
)
|
|
77885
|
-
);
|
|
77886
|
-
}
|
|
77808
|
+
if (!searchParams.search && currentFolder.id === "default") {
|
|
77809
|
+
fetchTreeData(currentFolder.id, queryClient2);
|
|
77887
77810
|
}
|
|
77888
77811
|
setSearchParams({
|
|
77889
77812
|
...searchParams,
|
|
77890
|
-
pagination: (
|
|
77813
|
+
pagination: (_b2 = data == null ? void 0 : data.pages[(data == null ? void 0 : data.pages.length) - 1]) == null ? void 0 : _b2.pagination
|
|
77891
77814
|
});
|
|
77892
77815
|
}
|
|
77893
77816
|
}, [data]);
|
|
@@ -78123,26 +78046,44 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78123
78046
|
const TreeViewContainer = () => {
|
|
78124
78047
|
const [isModalOpen, toggle] = useToggle();
|
|
78125
78048
|
const queryClient2 = useQueryClient();
|
|
78126
|
-
const
|
|
78049
|
+
const treeData2 = useTreeData();
|
|
78127
78050
|
const isTrashFolder = useIsTrash();
|
|
78128
78051
|
const selectedNodeId = useSelectedNodeId();
|
|
78129
78052
|
const elementDragOver = useElementDragOver();
|
|
78130
|
-
const
|
|
78053
|
+
const scrollToTop = useScrollToTop();
|
|
78054
|
+
const currentSelectedNodeId = !isTrashFolder ? selectedNodeId : FOLDER.BIN;
|
|
78131
78055
|
const { appCode } = useOdeClient();
|
|
78132
78056
|
const { t: t2 } = useTranslation(["common", appCode]);
|
|
78133
78057
|
const data = {
|
|
78134
|
-
...
|
|
78058
|
+
...treeData2,
|
|
78135
78059
|
name: t2("explorer.filters.mine", { ns: appCode })
|
|
78136
78060
|
};
|
|
78137
78061
|
const {
|
|
78138
78062
|
goToTrash,
|
|
78139
78063
|
selectTreeItem,
|
|
78140
|
-
unfoldTreeItem,
|
|
78141
78064
|
clearSelectedItems,
|
|
78142
|
-
clearSelectedIds
|
|
78065
|
+
clearSelectedIds,
|
|
78066
|
+
fetchTreeData
|
|
78143
78067
|
} = useStoreActions();
|
|
78144
|
-
const
|
|
78145
|
-
|
|
78068
|
+
const handleTreeItemClick = (folderId) => {
|
|
78069
|
+
selectTreeItem(folderId, queryClient2);
|
|
78070
|
+
scrollToTop();
|
|
78071
|
+
};
|
|
78072
|
+
const handleOnTreeItemUnfold = (nodeId) => {
|
|
78073
|
+
var _a2, _b2;
|
|
78074
|
+
const folder = findNodeById(treeData2, nodeId);
|
|
78075
|
+
const hasSomeChildrenWithChildren = (_a2 = folder == null ? void 0 : folder.children) == null ? void 0 : _a2.some(
|
|
78076
|
+
(child) => {
|
|
78077
|
+
var _a3;
|
|
78078
|
+
return Array.isArray(child == null ? void 0 : child.children) && ((_a3 = child.children) == null ? void 0 : _a3.length) > 0;
|
|
78079
|
+
}
|
|
78080
|
+
);
|
|
78081
|
+
(_b2 = folder == null ? void 0 : folder.children) == null ? void 0 : _b2.forEach((child) => {
|
|
78082
|
+
if (hasSomeChildrenWithChildren)
|
|
78083
|
+
return;
|
|
78084
|
+
fetchTreeData(child.id, queryClient2);
|
|
78085
|
+
});
|
|
78086
|
+
};
|
|
78146
78087
|
const handleOnFolderCreate = () => {
|
|
78147
78088
|
clearSelectedItems();
|
|
78148
78089
|
clearSelectedIds();
|
|
@@ -78156,7 +78097,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78156
78097
|
selectedNodeId: currentSelectedNodeId,
|
|
78157
78098
|
draggedNode: (elementDragOver == null ? void 0 : elementDragOver.isTreeview) ? elementDragOver : void 0,
|
|
78158
78099
|
onTreeItemClick: handleTreeItemClick,
|
|
78159
|
-
onTreeItemUnfold:
|
|
78100
|
+
onTreeItemUnfold: handleOnTreeItemUnfold
|
|
78160
78101
|
}
|
|
78161
78102
|
),
|
|
78162
78103
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -78348,12 +78289,14 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78348
78289
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingScreen$1, { position: false });
|
|
78349
78290
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Explorer, { config: getHTMLConfig2 }) });
|
|
78350
78291
|
}
|
|
78351
|
-
|
|
78292
|
+
var ReactQueryDevtools2 = function() {
|
|
78293
|
+
return null;
|
|
78294
|
+
};
|
|
78352
78295
|
const queryClient = new QueryClient({
|
|
78353
78296
|
queryCache: new QueryCache({
|
|
78354
78297
|
onError: (error) => {
|
|
78355
78298
|
if (typeof error === "string") {
|
|
78356
|
-
if (error ===
|
|
78299
|
+
if (error === ERROR_CODE.NOT_LOGGED_IN)
|
|
78357
78300
|
window.location.replace("/auth/login");
|
|
78358
78301
|
}
|
|
78359
78302
|
}
|
|
@@ -78362,26 +78305,28 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78362
78305
|
queries: {
|
|
78363
78306
|
retry: false,
|
|
78364
78307
|
refetchOnWindowFocus: false
|
|
78308
|
+
// staleTime: 1000 * 60 * 2,
|
|
78365
78309
|
}
|
|
78366
78310
|
}
|
|
78367
78311
|
});
|
|
78368
78312
|
const getHTMLConfig = getExplorerConfig();
|
|
78313
|
+
const Providers = ({ children }) => {
|
|
78314
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(QueryClientProvider, { client: queryClient, children: [
|
|
78315
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
78316
|
+
OdeClientProvider,
|
|
78317
|
+
{
|
|
78318
|
+
params: {
|
|
78319
|
+
app: getHTMLConfig.app
|
|
78320
|
+
},
|
|
78321
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { children })
|
|
78322
|
+
}
|
|
78323
|
+
),
|
|
78324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReactQueryDevtools2, { initialIsOpen: false })
|
|
78325
|
+
] });
|
|
78326
|
+
};
|
|
78327
|
+
const root = document.getElementById("root");
|
|
78369
78328
|
createRoot(root).render(
|
|
78370
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
78371
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(QueryClientProvider, { client: queryClient, children: [
|
|
78372
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
78373
|
-
OdeClientProvider,
|
|
78374
|
-
{
|
|
78375
|
-
params: {
|
|
78376
|
-
app: getHTMLConfig.app
|
|
78377
|
-
},
|
|
78378
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root, {}) })
|
|
78379
|
-
}
|
|
78380
|
-
),
|
|
78381
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ReactQueryDevtools2, { initialIsOpen: false })
|
|
78382
|
-
] }),
|
|
78383
|
-
","
|
|
78384
|
-
] })
|
|
78329
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Providers, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root, {}) }) })
|
|
78385
78330
|
);
|
|
78386
78331
|
function EmptyScreenApp() {
|
|
78387
78332
|
const [imagePath] = usePaths();
|
|
@@ -78611,12 +78556,14 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78611
78556
|
data
|
|
78612
78557
|
}) => {
|
|
78613
78558
|
var _a2, _b2;
|
|
78614
|
-
const
|
|
78559
|
+
const queryClient2 = useQueryClient();
|
|
78615
78560
|
const selectedFolders = useSelectedFolders();
|
|
78616
78561
|
const folderIds = useFolderIds();
|
|
78617
|
-
const { setSelectedFolders, setFolderIds, openFolder } = useStoreActions();
|
|
78618
78562
|
const resourceOrFolderIsDraggable = useResourceOrFolderIsDraggable();
|
|
78619
|
-
|
|
78563
|
+
const scrollToTop = useScrollToTop();
|
|
78564
|
+
const { currentApp } = useOdeClient();
|
|
78565
|
+
const { setSelectedFolders, setFolderIds, openFolder } = useStoreActions();
|
|
78566
|
+
function handleOnSelectToggle(folder) {
|
|
78620
78567
|
if (folderIds.includes(folder.id)) {
|
|
78621
78568
|
setFolderIds(
|
|
78622
78569
|
folderIds.filter((selectedFolder) => selectedFolder !== folder.id)
|
|
@@ -78631,11 +78578,14 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78631
78578
|
setSelectedFolders([...selectedFolders, folder]);
|
|
78632
78579
|
}
|
|
78633
78580
|
}
|
|
78581
|
+
function handleOnFolderClick(folder) {
|
|
78582
|
+
scrollToTop();
|
|
78583
|
+
openFolder({ folder, folderId: folder.id, queryClient: queryClient2 });
|
|
78584
|
+
}
|
|
78634
78585
|
const springs = useSpring({
|
|
78635
78586
|
from: { opacity: 0 },
|
|
78636
78587
|
to: { opacity: 1 }
|
|
78637
78588
|
});
|
|
78638
|
-
const scrollToTop = useScrollToTop();
|
|
78639
78589
|
return ((_a2 = data == null ? void 0 : data.pages[0]) == null ? void 0 : _a2.folders.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx(animated.ul, { className: "grid ps-0 list-unstyled mb-24", children: (_b2 = data == null ? void 0 : data.pages[0]) == null ? void 0 : _b2.folders.map((folder) => {
|
|
78640
78590
|
const { id: id2, name } = folder;
|
|
78641
78591
|
const isDrag = resourceOrFolderIsDraggable.elementDrag === id2;
|
|
@@ -78654,11 +78604,8 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78654
78604
|
idFolder: id2,
|
|
78655
78605
|
app: currentApp,
|
|
78656
78606
|
isSelected: folderIds.includes(folder.id),
|
|
78657
|
-
onClick: () =>
|
|
78658
|
-
|
|
78659
|
-
openFolder({ folder, folderId: folder.id });
|
|
78660
|
-
},
|
|
78661
|
-
onSelect: () => toggleSelect(folder)
|
|
78607
|
+
onClick: () => handleOnFolderClick(folder),
|
|
78608
|
+
onSelect: () => handleOnSelectToggle(folder)
|
|
78662
78609
|
}
|
|
78663
78610
|
)
|
|
78664
78611
|
},
|
|
@@ -78803,7 +78750,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78803
78750
|
const handleNextPage = reactExports.useCallback(() => {
|
|
78804
78751
|
fetchNextPage();
|
|
78805
78752
|
}, []);
|
|
78806
|
-
const
|
|
78753
|
+
const handleOnResourceClick = (resource) => {
|
|
78807
78754
|
if (isTrashFolder) {
|
|
78808
78755
|
setResourceIsTrash(true);
|
|
78809
78756
|
setResourceIds([resource.id]);
|
|
@@ -78812,7 +78759,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78812
78759
|
openResource(resource);
|
|
78813
78760
|
}
|
|
78814
78761
|
};
|
|
78815
|
-
async function
|
|
78762
|
+
async function handleOnSelectToggle(resource) {
|
|
78816
78763
|
if (resourceIds.includes(resource.id)) {
|
|
78817
78764
|
setResourceIds(
|
|
78818
78765
|
resourceIds.filter(
|
|
@@ -78852,8 +78799,8 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
78852
78799
|
time,
|
|
78853
78800
|
isSelectable: true,
|
|
78854
78801
|
isSelected: resourceIds.includes(resource.id),
|
|
78855
|
-
onClick: () =>
|
|
78856
|
-
onSelect: () =>
|
|
78802
|
+
onClick: () => handleOnResourceClick(resource),
|
|
78803
|
+
onSelect: () => handleOnSelectToggle(resource)
|
|
78857
78804
|
}
|
|
78858
78805
|
)
|
|
78859
78806
|
},
|
|
@@ -79813,9 +79760,9 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
79813
79760
|
const { appCode } = useOdeClient();
|
|
79814
79761
|
const { t: t2 } = useTranslation();
|
|
79815
79762
|
const { handleTreeItemSelect, handleTreeItemUnfold, onMove, disableSubmit } = useMoveModal({ onSuccess });
|
|
79816
|
-
const
|
|
79763
|
+
const treeData2 = useTreeData();
|
|
79817
79764
|
const data = {
|
|
79818
|
-
...
|
|
79765
|
+
...treeData2,
|
|
79819
79766
|
name: t2("explorer.filters.mine", { ns: appCode })
|
|
79820
79767
|
};
|
|
79821
79768
|
return reactDomExports.createPortal(
|