@ynput/ayon-frontend-shared 0.3.0 → 0.3.1
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/_virtual/index.cjs10.js +1 -1
- package/dist/_virtual/index.cjs11.js +1 -1
- package/dist/_virtual/index.cjs12.js +1 -1
- package/dist/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.es10.js +3 -3
- package/dist/_virtual/index.es11.js +5 -5
- package/dist/_virtual/index.es12.js +5 -5
- package/dist/_virtual/index.es4.js +2 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -2
- package/dist/_virtual/index.es5.js.map +1 -1
- package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
- package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
- package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
- package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js +1 -1
- package/dist/node_modules/remove-accents/index.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.cjs.js +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.cjs.js.map +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.es.js +95 -95
- package/dist/shared/src/api/queries/overview/getOverview.es.js.map +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js.map +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js +14 -11
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js.map +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js.map +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js +42 -41
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js.map +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js.map +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js +23 -23
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js +65 -64
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js +16 -16
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js +3 -3
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js +142 -146
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +24 -24
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js +141 -132
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js +35 -28
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.es.js.map +1 -1
- package/dist/shared/src/context/AddonContext.cjs.js.map +1 -1
- package/dist/shared/src/context/AddonContext.es.js.map +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.cjs.js +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.cjs.js.map +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.es.js +62 -49
- package/dist/shared/src/context/ProjectFoldersContext.es.js.map +1 -1
- package/dist/types/api/queries/overview/getOverview.d.ts +1 -0
- package/dist/types/components/RemotePage/RemotePageWrapper.d.ts +1 -0
- package/dist/types/components/SearchFilter/useBuildFilterOptions.d.ts +1 -0
- package/dist/types/containers/ProjectTreeTable/hooks/useFetchOverviewData.d.ts +2 -1
- package/dist/types/containers/ProjectTreeTable/hooks/useQueryFilters.d.ts +4 -1
- package/dist/types/context/AddonContext.d.ts +1 -0
- package/dist/types/context/ProjectFoldersContext.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as ye } from "../../../../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { createContext as Ie, useCallback as H, useEffect as ge, useMemo as me, useContext as
|
|
3
|
-
import { useSelectionCellsContext as
|
|
4
|
-
import { useCellEditing as
|
|
5
|
-
import { parseCellId as
|
|
2
|
+
import { createContext as Ie, useCallback as H, useEffect as ge, useMemo as me, useContext as we } from "react";
|
|
3
|
+
import { useSelectionCellsContext as be, ROW_SELECTION_COLUMN_ID as V } from "./SelectionCellsContext.es.js";
|
|
4
|
+
import { useCellEditing as he } from "./CellEditingContext.es.js";
|
|
5
|
+
import { parseCellId as j, getLinkEntityIdsByColumnId as Te, getCellValue as xe, getEntityDataById as ne } from "../utils/cellUtils.es.js";
|
|
6
6
|
import Ce from "../hooks/usePasteLinks.es.js";
|
|
7
7
|
import { getEntityPath as ve, clipboardError as P, parseClipboardText as re, processFieldValue as Ee } from "./clipboard/clipboardUtils.es.js";
|
|
8
8
|
import { validateClipboardData as ke } from "./clipboard/clipboardValidation.es.js";
|
|
@@ -12,92 +12,92 @@ import "react-toastify";
|
|
|
12
12
|
import { validateEntityId as _e } from "../../../util/getEntityId.es.js";
|
|
13
13
|
import "../../../util/pubsub.es.js";
|
|
14
14
|
const se = Ie(void 0), We = ({
|
|
15
|
-
children:
|
|
16
|
-
entitiesMap:
|
|
15
|
+
children: O,
|
|
16
|
+
entitiesMap: A,
|
|
17
17
|
columnEnums: Q,
|
|
18
18
|
columnReadOnly: ie,
|
|
19
19
|
visibleColumns: D
|
|
20
20
|
}) => {
|
|
21
|
-
const { selectedCells:
|
|
21
|
+
const { selectedCells: _, gridMap: l, focusedCellId: ae } = be(), { updateEntities: Y } = he(), { pasteTableLinks: Z } = Ce(), { getEntityById: F, attribFields: K } = Ae(), X = H(
|
|
22
22
|
async (r, i) => {
|
|
23
|
-
const { headers:
|
|
23
|
+
const { headers: g, fullRow: m } = i || {};
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
25
|
+
const d = D.map((s) => s.id).filter((s) => s !== V), u = /* @__PURE__ */ new Map();
|
|
26
26
|
r.forEach((s) => {
|
|
27
|
-
const o =
|
|
27
|
+
const o = j(s);
|
|
28
28
|
if (!o) return;
|
|
29
|
-
const { rowId:
|
|
30
|
-
|
|
29
|
+
const { rowId: c, colId: y } = o;
|
|
30
|
+
y === V || !d.includes(y) || (u.has(c) || u.set(c, /* @__PURE__ */ new Set()), u.get(c)?.add(y));
|
|
31
31
|
}), m && r.filter(
|
|
32
|
-
(o) =>
|
|
33
|
-
).map((o) =>
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
(o) => j(o)?.rowId && j(o)?.colId === V
|
|
33
|
+
).map((o) => j(o)?.rowId).forEach((o) => {
|
|
34
|
+
u.has(o) || u.set(o, /* @__PURE__ */ new Set()), Array.from(l.colIdToIndex.keys()).forEach((y) => {
|
|
35
|
+
u.get(o)?.add(y);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
const v = Array.from(u.keys()).sort((s, o) => {
|
|
39
|
+
const c = l.rowIdToIndex.get(s) ?? 1 / 0, y = l.rowIdToIndex.get(o) ?? 1 / 0;
|
|
40
|
+
return c - y;
|
|
41
41
|
});
|
|
42
42
|
let $ = "";
|
|
43
|
-
const M =
|
|
43
|
+
const M = v[0];
|
|
44
44
|
if (!M) return "";
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
return
|
|
45
|
+
const E = Array.from(u.get(M) || []).sort((s, o) => {
|
|
46
|
+
const c = l.colIdToIndex.get(s) ?? 1 / 0, y = l.colIdToIndex.get(o) ?? 1 / 0;
|
|
47
|
+
return c - y;
|
|
48
48
|
});
|
|
49
|
-
if (
|
|
49
|
+
if (g && E.length > 0) {
|
|
50
50
|
const s = [];
|
|
51
|
-
for (const o of
|
|
52
|
-
const
|
|
53
|
-
s.push(`${
|
|
51
|
+
for (const o of E) {
|
|
52
|
+
const c = o;
|
|
53
|
+
s.push(`${c.replace(/"/g, '""')}`);
|
|
54
54
|
}
|
|
55
55
|
$ += s.join(" ") + `
|
|
56
56
|
`;
|
|
57
57
|
}
|
|
58
|
-
for (const s of
|
|
59
|
-
const o =
|
|
58
|
+
for (const s of v) {
|
|
59
|
+
const o = F(s);
|
|
60
60
|
if (!o) {
|
|
61
61
|
console.warn(`Entity not found for rowId: ${s}`);
|
|
62
62
|
continue;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
}).filter((
|
|
68
|
-
for (const
|
|
69
|
-
let
|
|
70
|
-
if (
|
|
71
|
-
|
|
64
|
+
const y = Array.from(u.get(s) || []).sort((b, T) => {
|
|
65
|
+
const h = l.colIdToIndex.get(b) ?? 1 / 0, e = l.colIdToIndex.get(T) ?? 1 / 0;
|
|
66
|
+
return h - e;
|
|
67
|
+
}).filter((b) => b !== V), R = [];
|
|
68
|
+
for (const b of y) {
|
|
69
|
+
let T = "";
|
|
70
|
+
if (b.startsWith("link_"))
|
|
71
|
+
T = Te(o.links, b);
|
|
72
72
|
else {
|
|
73
|
-
let
|
|
74
|
-
if (!
|
|
75
|
-
const e =
|
|
76
|
-
e && e.data.type === "boolean" ?
|
|
73
|
+
let h = xe(o, b);
|
|
74
|
+
if (!h) {
|
|
75
|
+
const e = K.find((t) => t.name === b.replace("attrib_", ""));
|
|
76
|
+
e && e.data.type === "boolean" ? h = !1 : e && e.data.type.includes("list_of") && (h = []);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
T = h != null ? String(h) : "", b === "name" && (T = ve(o.entityId || o.id, A)), b === "subType" && ("folderType" in o && (T = o.folderType || ""), "taskType" in o && (T = o.taskType || ""));
|
|
79
79
|
}
|
|
80
|
-
R.push(`${
|
|
80
|
+
R.push(`${T.replace(/"/g, '""')}`);
|
|
81
81
|
}
|
|
82
82
|
$ += R.join(" ") + `
|
|
83
83
|
`;
|
|
84
84
|
}
|
|
85
85
|
return $;
|
|
86
|
-
} catch (
|
|
87
|
-
console.error("Failed to copy to clipboard:",
|
|
86
|
+
} catch (d) {
|
|
87
|
+
console.error("Failed to copy to clipboard:", d);
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
-
[
|
|
90
|
+
[_, ae, l, A, F, D]
|
|
91
91
|
), le = async () => {
|
|
92
92
|
const r = await ee();
|
|
93
93
|
if (!r) return !1;
|
|
94
94
|
const i = re(r);
|
|
95
|
-
return i.length === 0 ? !1 : i.every((
|
|
96
|
-
},
|
|
95
|
+
return i.length === 0 ? !1 : i.every((g) => g.values.every((m) => m.split(",").every((d) => _e(d))));
|
|
96
|
+
}, N = H(
|
|
97
97
|
async (r, i) => {
|
|
98
|
-
if (r = r || Array.from(
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
98
|
+
if (r = r || Array.from(_), !r.length) return;
|
|
99
|
+
const g = await X(r, { fullRow: i });
|
|
100
|
+
if (g) {
|
|
101
101
|
if (!navigator.clipboard) {
|
|
102
102
|
P("Clipboard API not supported in this browser.");
|
|
103
103
|
return;
|
|
@@ -107,28 +107,28 @@ const se = Ie(void 0), We = ({
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
try {
|
|
110
|
-
await navigator.clipboard.writeText(
|
|
110
|
+
await navigator.clipboard.writeText(g);
|
|
111
111
|
} catch (m) {
|
|
112
112
|
P(`Failed to copy to clipboard: ${m.message}`);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
[
|
|
116
|
+
[_, A, l]
|
|
117
117
|
), ce = H(
|
|
118
|
-
async (r, i,
|
|
119
|
-
if (r = r || Array.from(
|
|
118
|
+
async (r, i, g) => {
|
|
119
|
+
if (r = r || Array.from(_), !!r.length)
|
|
120
120
|
try {
|
|
121
|
-
const m = await
|
|
121
|
+
const m = await X(r, { headers: !0, fullRow: g });
|
|
122
122
|
if (!m) return;
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
const d = new Blob([m], { type: "text/csv" }), u = URL.createObjectURL(d), v = document.createElement("a");
|
|
124
|
+
v.href = u;
|
|
125
125
|
const $ = r.length;
|
|
126
|
-
|
|
126
|
+
v.download = `${i}-export-${$}_cells-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, v.click(), URL.revokeObjectURL(u);
|
|
127
127
|
} catch (m) {
|
|
128
128
|
console.error("Failed to copy to clipboard:", m);
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
|
-
[
|
|
131
|
+
[_, A, l, X]
|
|
132
132
|
), ee = async () => {
|
|
133
133
|
if (!navigator.clipboard) {
|
|
134
134
|
P("Clipboard API not supported in this browser.");
|
|
@@ -147,70 +147,70 @@ const se = Ie(void 0), We = ({
|
|
|
147
147
|
}
|
|
148
148
|
}, W = H(
|
|
149
149
|
async (r, i) => {
|
|
150
|
-
const { method:
|
|
150
|
+
const { method: g = "replace" } = i || {};
|
|
151
151
|
if (!r.length) return;
|
|
152
152
|
const m = await ee();
|
|
153
153
|
if (!m) return;
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
return n && n.length > 0 ? n.forEach((a,
|
|
159
|
-
const
|
|
160
|
-
(
|
|
154
|
+
const d = re(m);
|
|
155
|
+
if (!d.length) return;
|
|
156
|
+
const u = d.length === 1 && d[0].values.length === 1, v = D.map((e) => e.id).filter((e) => e !== V), $ = (e, t, n) => {
|
|
157
|
+
const f = {};
|
|
158
|
+
return n && n.length > 0 ? n.forEach((a, p) => {
|
|
159
|
+
const w = t.find(
|
|
160
|
+
(I) => I === a || I.replace("attrib_", "") === a || I === `attrib_${a}` || I.toLowerCase() === a.toLowerCase()
|
|
161
161
|
);
|
|
162
|
-
|
|
163
|
-
}) : t.forEach((a,
|
|
164
|
-
|
|
165
|
-
}),
|
|
166
|
-
}, M =
|
|
162
|
+
w && p < e.values.length && (f[w] = e.values[p]);
|
|
163
|
+
}) : t.forEach((a, p) => {
|
|
164
|
+
p < e.values.length && (f[a] = e.values[p]);
|
|
165
|
+
}), f;
|
|
166
|
+
}, M = d[0]?.colIds || void 0, E = /* @__PURE__ */ new Map();
|
|
167
167
|
Array.from(r).forEach((e) => {
|
|
168
|
-
const t =
|
|
168
|
+
const t = j(e);
|
|
169
169
|
if (!t) return;
|
|
170
|
-
const { rowId: n, colId:
|
|
171
|
-
|
|
170
|
+
const { rowId: n, colId: f } = t;
|
|
171
|
+
f === V || !v.includes(f) || (E.has(n) || E.set(n, /* @__PURE__ */ new Set()), E.get(n)?.add(f));
|
|
172
172
|
});
|
|
173
|
-
const s = Array.from(
|
|
174
|
-
const n = l.rowIdToIndex.get(e) ?? 1 / 0,
|
|
175
|
-
return n -
|
|
176
|
-
}), o = s[0],
|
|
177
|
-
const n = l.colIdToIndex.get(e) ?? 1 / 0,
|
|
178
|
-
return n -
|
|
173
|
+
const s = Array.from(E.keys()).sort((e, t) => {
|
|
174
|
+
const n = l.rowIdToIndex.get(e) ?? 1 / 0, f = l.rowIdToIndex.get(t) ?? 1 / 0;
|
|
175
|
+
return n - f;
|
|
176
|
+
}), o = s[0], c = Array.from(E.get(o) || []).sort((e, t) => {
|
|
177
|
+
const n = l.colIdToIndex.get(e) ?? 1 / 0, f = l.colIdToIndex.get(t) ?? 1 / 0;
|
|
178
|
+
return n - f;
|
|
179
179
|
});
|
|
180
180
|
for (let e = 0; e < s.length; e++) {
|
|
181
|
-
const t = s[e], n = ne(t,
|
|
182
|
-
for (const
|
|
183
|
-
const
|
|
181
|
+
const t = s[e], n = ne(t, A)?.entityType === "folder", f = e % d.length, a = d[f], p = u ? { [c[0]]: d[0].values[0] } : $(a, c, M);
|
|
182
|
+
for (const w of c) {
|
|
183
|
+
const I = p[w] || "";
|
|
184
184
|
if (!ke({
|
|
185
|
-
colId:
|
|
185
|
+
colId: w,
|
|
186
186
|
isFolder: n,
|
|
187
|
-
pasteValue:
|
|
188
|
-
parsedData:
|
|
187
|
+
pasteValue: I,
|
|
188
|
+
parsedData: d,
|
|
189
189
|
columnEnums: Q,
|
|
190
190
|
columnReadOnly: ie,
|
|
191
191
|
rowIndex: e,
|
|
192
|
-
colIndex:
|
|
193
|
-
isSingleCellValue:
|
|
194
|
-
attribFields:
|
|
192
|
+
colIndex: c.indexOf(w),
|
|
193
|
+
isSingleCellValue: u,
|
|
194
|
+
attribFields: K
|
|
195
195
|
})) return;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
const
|
|
199
|
-
for (let e = 0; e <
|
|
200
|
-
const t =
|
|
198
|
+
const y = /* @__PURE__ */ new Map();
|
|
199
|
+
for (let e = 0; e < c.length; e++) {
|
|
200
|
+
const t = c[e];
|
|
201
201
|
if (t === "name") continue;
|
|
202
|
-
let n = !1,
|
|
202
|
+
let n = !1, f = !1, a = "string";
|
|
203
203
|
if (s.length > 0) {
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
if (n = t.startsWith("attrib_"),
|
|
204
|
+
const p = s[0];
|
|
205
|
+
if (F(p))
|
|
206
|
+
if (n = t.startsWith("attrib_"), f = t.startsWith("link_"), t === "status" || t === "subType")
|
|
207
207
|
a = "string", n = !1;
|
|
208
208
|
else if (t === "tags" || t === "assignees")
|
|
209
209
|
a = "array";
|
|
210
210
|
else if (n) {
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
switch (
|
|
211
|
+
const I = t.replace("attrib_", ""), k = K.find((x) => x.name === I);
|
|
212
|
+
if (k)
|
|
213
|
+
switch (k.data.type) {
|
|
214
214
|
case "boolean":
|
|
215
215
|
a = "boolean";
|
|
216
216
|
break;
|
|
@@ -227,17 +227,17 @@ const se = Ie(void 0), We = ({
|
|
|
227
227
|
default:
|
|
228
228
|
a = "string";
|
|
229
229
|
}
|
|
230
|
-
} else
|
|
230
|
+
} else f && (a = "array");
|
|
231
231
|
}
|
|
232
|
-
for (let
|
|
233
|
-
const
|
|
232
|
+
for (let p = 0; p < s.length; p++) {
|
|
233
|
+
const w = s[p], I = ne(w, A)?.entityType, k = I === "folder";
|
|
234
234
|
let x;
|
|
235
|
-
if (
|
|
236
|
-
x =
|
|
235
|
+
if (u)
|
|
236
|
+
x = d[0].values[0];
|
|
237
237
|
else {
|
|
238
|
-
const te =
|
|
239
|
-
if (C.values.length >
|
|
240
|
-
const U = l.colIdToIndex.get(
|
|
238
|
+
const te = p % d.length, C = d[te];
|
|
239
|
+
if (C.values.length > c.length) {
|
|
240
|
+
const U = l.colIdToIndex.get(c[0]) ?? 0, q = Array.from(l.colIdToIndex.keys()).filter((B) => B !== V).sort((B, fe) => {
|
|
241
241
|
const pe = l.colIdToIndex.get(B) ?? 1 / 0, ue = l.colIdToIndex.get(fe) ?? 1 / 0;
|
|
242
242
|
return pe - ue;
|
|
243
243
|
}), G = q.findIndex(
|
|
@@ -253,26 +253,26 @@ const se = Ie(void 0), We = ({
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
let S = t.split("_").pop() || t;
|
|
256
|
-
if (t === "subType" && (S =
|
|
256
|
+
if (t === "subType" && (S = k ? "folderType" : "taskType", n = !1, !x))
|
|
257
257
|
continue;
|
|
258
|
-
const L = Ee(x, a),
|
|
259
|
-
!
|
|
260
|
-
rowId:
|
|
261
|
-
id:
|
|
262
|
-
type:
|
|
258
|
+
const L = Ee(x, a), z = `${w}-${I}`;
|
|
259
|
+
!y.has(z) && I && y.set(z, {
|
|
260
|
+
rowId: w,
|
|
261
|
+
id: w,
|
|
262
|
+
type: I,
|
|
263
263
|
fields: {},
|
|
264
264
|
attrib: {},
|
|
265
265
|
links: {}
|
|
266
266
|
});
|
|
267
|
-
const J =
|
|
268
|
-
if (
|
|
267
|
+
const J = y.get(z);
|
|
268
|
+
if (f) {
|
|
269
269
|
const [te, C, U, q, G] = t.split("_");
|
|
270
270
|
J.links[`${C}|${U}|${q}_${G}`] = L;
|
|
271
271
|
} else n ? J.attrib[S] = L : J.fields[S] = L;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
const R = [],
|
|
275
|
-
|
|
274
|
+
const R = [], b = /* @__PURE__ */ new Map();
|
|
275
|
+
y.forEach((e) => {
|
|
276
276
|
Object.entries(e.fields).forEach(([t, n]) => {
|
|
277
277
|
R.push({
|
|
278
278
|
rowId: e.rowId,
|
|
@@ -291,56 +291,52 @@ const se = Ie(void 0), We = ({
|
|
|
291
291
|
isAttrib: !0
|
|
292
292
|
});
|
|
293
293
|
}), Object.entries(e.links).forEach(([t, n]) => {
|
|
294
|
-
const [
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
|
|
294
|
+
const [f, a] = t.split("_"), p = f.split("|");
|
|
295
|
+
if (p.length >= 3) {
|
|
296
|
+
const w = p[0], I = p[1], k = p[2], x = `${w}|${I}|${k}`, S = a === "out" ? k : I, L = `${e.id}-${x}-${a}`;
|
|
297
|
+
b.set(L, {
|
|
298
298
|
rowId: e.rowId,
|
|
299
299
|
sourceEntityId: e.id,
|
|
300
300
|
sourceEntityType: e.type,
|
|
301
301
|
linkType: x,
|
|
302
302
|
direction: a,
|
|
303
303
|
targetEntityType: S,
|
|
304
|
-
operation:
|
|
304
|
+
operation: g,
|
|
305
305
|
targetEntityIds: Array.isArray(n) ? n : []
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
});
|
|
310
|
-
const
|
|
311
|
-
if (R.length > 0 &&
|
|
310
|
+
const T = Array.from(b.values()), h = [];
|
|
311
|
+
if (R.length > 0 && h.push(Y(R)), T.length > 0 && h.push(Z(T)), h.length > 0)
|
|
312
312
|
try {
|
|
313
|
-
await Promise.all(
|
|
313
|
+
await Promise.all(h);
|
|
314
314
|
} catch (e) {
|
|
315
315
|
console.error("Error updating entities:", e), P(`Paste failed: ${e || e?.message || "Unknown error"}`);
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
318
|
[
|
|
319
|
-
v,
|
|
320
|
-
l,
|
|
321
319
|
_,
|
|
320
|
+
l,
|
|
321
|
+
A,
|
|
322
322
|
Y,
|
|
323
323
|
Z,
|
|
324
324
|
Q,
|
|
325
|
-
|
|
325
|
+
F,
|
|
326
326
|
D,
|
|
327
|
-
|
|
327
|
+
K
|
|
328
328
|
]
|
|
329
329
|
);
|
|
330
330
|
ge(() => {
|
|
331
331
|
const r = async (i) => {
|
|
332
|
-
if ((i.ctrlKey || i.metaKey) && i.key === "c") {
|
|
333
|
-
const
|
|
334
|
-
(
|
|
335
|
-
}
|
|
336
|
-
if ((i.ctrlKey || i.metaKey) && i.key === "v") {
|
|
337
|
-
const c = document.activeElement;
|
|
338
|
-
if (c && (c.tagName === "INPUT" || c.tagName === "TEXTAREA" || c.isContentEditable))
|
|
332
|
+
if ((i.ctrlKey || i.metaKey) && i.key === "c" && N(), (i.ctrlKey || i.metaKey) && i.key === "v") {
|
|
333
|
+
const g = document.activeElement;
|
|
334
|
+
if (g && (g.tagName === "INPUT" || g.tagName === "TEXTAREA" || g.isContentEditable))
|
|
339
335
|
if (await le())
|
|
340
336
|
i.preventDefault();
|
|
341
337
|
else
|
|
342
338
|
return;
|
|
343
|
-
W(Array.from(
|
|
339
|
+
W(Array.from(_), {
|
|
344
340
|
method: i.shiftKey ? "merge" : "replace"
|
|
345
341
|
// Use shift key to determine paste method
|
|
346
342
|
});
|
|
@@ -349,21 +345,21 @@ const se = Ie(void 0), We = ({
|
|
|
349
345
|
return window.addEventListener("keydown", r), () => {
|
|
350
346
|
window.removeEventListener("keydown", r);
|
|
351
347
|
};
|
|
352
|
-
}, [
|
|
348
|
+
}, [N, W]);
|
|
353
349
|
const de = me(
|
|
354
350
|
() => ({
|
|
355
|
-
copyToClipboard:
|
|
351
|
+
copyToClipboard: N,
|
|
356
352
|
pasteFromClipboard: W,
|
|
357
353
|
exportCSV: ce
|
|
358
354
|
}),
|
|
359
|
-
[
|
|
355
|
+
[N, W]
|
|
360
356
|
);
|
|
361
|
-
return /* @__PURE__ */ ye.jsx(se.Provider, { value: de, children:
|
|
357
|
+
return /* @__PURE__ */ ye.jsx(se.Provider, { value: de, children: O });
|
|
362
358
|
}, Me = () => {
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
359
|
+
const O = we(se);
|
|
360
|
+
if (O === void 0)
|
|
365
361
|
throw new Error("useClipboard must be used within a ClipboardProvider");
|
|
366
|
-
return
|
|
362
|
+
return O;
|
|
367
363
|
};
|
|
368
364
|
export {
|
|
369
365
|
We as ClipboardProvider,
|