@ynput/ayon-frontend-shared 0.3.10 → 0.3.11
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/api.cjs.js +1 -1
- package/dist/api.es.js +123 -122
- package/dist/shared/src/api/queries/tasks/updateTasks.cjs.js +1 -1
- package/dist/shared/src/api/queries/tasks/updateTasks.cjs.js.map +1 -1
- package/dist/shared/src/api/queries/tasks/updateTasks.es.js +40 -22
- package/dist/shared/src/api/queries/tasks/updateTasks.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 +93 -93
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js +4 -4
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js +226 -226
- 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 +25 -24
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
- package/dist/types/api/queries/entityLists/types.d.ts +1 -0
- package/dist/types/api/queries/tasks/updateTasks.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useSelectionCellsContext as
|
|
4
|
-
import { useCellEditing as
|
|
1
|
+
import { j as vt } from "../../../../../_virtual/jsx-runtime.es.js";
|
|
2
|
+
import { createContext as Et, useCallback as it, useEffect as St, useMemo as $t, useContext as At } from "react";
|
|
3
|
+
import { useSelectionCellsContext as Lt, ROW_SELECTION_COLUMN_ID as O } from "./SelectionCellsContext.es.js";
|
|
4
|
+
import { useCellEditing as _t } from "./CellEditingContext.es.js";
|
|
5
5
|
import "../../../context/RemoteModulesContext.es.js";
|
|
6
6
|
import "../../../context/DetailsPanelContext.es.js";
|
|
7
7
|
import "../../../context/SubtasksModulesContext.es.js";
|
|
@@ -17,11 +17,11 @@ import "../../../context/MoveEntityContext.es.js";
|
|
|
17
17
|
import "../../../context/MenuContext.es.js";
|
|
18
18
|
import "../../../context/WebsocketContext.es.js";
|
|
19
19
|
import "../../../context/GlobalContext.es.js";
|
|
20
|
-
import { useProjectContext as
|
|
20
|
+
import { useProjectContext as Vt } from "../../../context/ProjectContext.es.js";
|
|
21
21
|
import "../../../context/ProjectFoldersContext.es.js";
|
|
22
22
|
import "../../../context/UriContext.es.js";
|
|
23
|
-
import { parseCellId as q, getLinkEntityIdsByColumnId as
|
|
24
|
-
import
|
|
23
|
+
import { parseCellId as q, getLinkEntityIdsByColumnId as Pt, getCellValue as ft, getEntityDataById as lt } from "../utils/cellUtils.es.js";
|
|
24
|
+
import Rt from "../hooks/usePasteLinks.es.js";
|
|
25
25
|
import "../../../api/base/client.es.js";
|
|
26
26
|
import "../../../api/generated/graphql.es.js";
|
|
27
27
|
import "../../../api/generated/graphqlLinks.es.js";
|
|
@@ -100,7 +100,7 @@ import "../../../api/queries/review/getReview.es.js";
|
|
|
100
100
|
import "../../../api/queries/review/updateReview.es.js";
|
|
101
101
|
import "../../../api/queries/share/share.es.js";
|
|
102
102
|
import "../../../api/queries/system/getSystem.es.js";
|
|
103
|
-
import { useUpdateSubtasksMutation as
|
|
103
|
+
import { useUpdateSubtasksMutation as Dt } from "../../../api/queries/tasks/updateTasks.es.js";
|
|
104
104
|
import "../../../api/queries/userDashboard/getUserDashboard.es.js";
|
|
105
105
|
import "../../../api/queries/users/getUsers.es.js";
|
|
106
106
|
import "../../../api/queries/users/updateUsers.es.js";
|
|
@@ -110,103 +110,103 @@ import "../../../api/queries/views/getViews.es.js";
|
|
|
110
110
|
import "../../../api/queries/views/updateViews.es.js";
|
|
111
111
|
import "../../../api/queries/watchers/getWatchers.es.js";
|
|
112
112
|
import "../../../api/queries/uris/getUris.es.js";
|
|
113
|
-
import { getEntityPath as
|
|
114
|
-
import { validateClipboardData as
|
|
115
|
-
import { subtasksToTSV as
|
|
116
|
-
import { useProjectTableContext as
|
|
113
|
+
import { getEntityPath as Nt, clipboardError as K, parseClipboardText as yt, processFieldValue as Ut } from "./clipboard/clipboardUtils.es.js";
|
|
114
|
+
import { validateClipboardData as jt } from "./clipboard/clipboardValidation.es.js";
|
|
115
|
+
import { subtasksToTSV as Bt, isSubtasksTSV as Ft, tsvToSubtasks as ct, sanitizeSubtaskName as Ot } from "./clipboard/clipboardSubtasks.es.js";
|
|
116
|
+
import { useProjectTableContext as Kt } from "./ProjectTableContext.es.js";
|
|
117
117
|
import "lodash";
|
|
118
118
|
import "react-toastify";
|
|
119
|
-
import { getEntityId as
|
|
119
|
+
import { getEntityId as Mt, validateEntityId as Ht } from "../../../util/getEntityId.es.js";
|
|
120
120
|
import "../../../util/pubsub.es.js";
|
|
121
|
-
const
|
|
121
|
+
const bt = Et(void 0), rs = ({
|
|
122
122
|
children: z,
|
|
123
123
|
entitiesMap: j,
|
|
124
|
-
columnEnums:
|
|
125
|
-
columnReadOnly:
|
|
124
|
+
columnEnums: pt,
|
|
125
|
+
columnReadOnly: gt,
|
|
126
126
|
visibleColumns: X
|
|
127
127
|
}) => {
|
|
128
|
-
const { selectedCells: B, gridMap:
|
|
128
|
+
const { selectedCells: B, gridMap: b, focusedCellId: It } = Lt(), { updateEntities: dt, history: nt } = _t(), { pasteTableLinks: mt } = Rt(), { getEntityById: M, attribFields: J } = Kt(), { projectName: Q } = Vt(), [Y] = Dt(), at = it(
|
|
129
129
|
async (a, p) => {
|
|
130
|
-
const { headers: l, fullRow:
|
|
130
|
+
const { headers: l, fullRow: I } = p || {};
|
|
131
131
|
try {
|
|
132
|
-
const
|
|
133
|
-
a.forEach((
|
|
134
|
-
const o = q(
|
|
132
|
+
const E = X.map((h) => h.id).filter((h) => h !== O), x = /* @__PURE__ */ new Map();
|
|
133
|
+
a.forEach((h) => {
|
|
134
|
+
const o = q(h);
|
|
135
135
|
if (!o) return;
|
|
136
|
-
const { rowId: m, colId:
|
|
137
|
-
|
|
138
|
-
}),
|
|
136
|
+
const { rowId: m, colId: S } = o;
|
|
137
|
+
S === O || !E.includes(S) || (x.has(m) || x.set(m, /* @__PURE__ */ new Set()), x.get(m)?.add(S));
|
|
138
|
+
}), I && a.filter(
|
|
139
139
|
(o) => q(o)?.rowId && q(o)?.colId === O
|
|
140
140
|
).map((o) => q(o)?.rowId).forEach((o) => {
|
|
141
|
-
x.has(o) || x.set(o, /* @__PURE__ */ new Set()), Array.from(
|
|
142
|
-
x.get(o)?.add(
|
|
141
|
+
x.has(o) || x.set(o, /* @__PURE__ */ new Set()), Array.from(b.colIdToIndex.keys()).forEach((S) => {
|
|
142
|
+
x.get(o)?.add(S);
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
|
-
const d = Array.from(x.keys()).sort((
|
|
146
|
-
const m =
|
|
147
|
-
return m -
|
|
145
|
+
const d = Array.from(x.keys()).sort((h, o) => {
|
|
146
|
+
const m = b.rowIdToIndex.get(h) ?? 1 / 0, S = b.rowIdToIndex.get(o) ?? 1 / 0;
|
|
147
|
+
return m - S;
|
|
148
148
|
});
|
|
149
149
|
let R = "";
|
|
150
150
|
const et = d[0];
|
|
151
151
|
if (!et) return "";
|
|
152
|
-
const ot = Array.from(x.get(et) || []).sort((
|
|
153
|
-
const m =
|
|
154
|
-
return m -
|
|
152
|
+
const ot = Array.from(x.get(et) || []).sort((h, o) => {
|
|
153
|
+
const m = b.colIdToIndex.get(h) ?? 1 / 0, S = b.colIdToIndex.get(o) ?? 1 / 0;
|
|
154
|
+
return m - S;
|
|
155
155
|
});
|
|
156
156
|
if (l && ot.length > 0) {
|
|
157
|
-
const
|
|
157
|
+
const h = [];
|
|
158
158
|
for (const o of ot) {
|
|
159
159
|
const m = o;
|
|
160
|
-
|
|
160
|
+
h.push(`${m.replace(/"/g, '""')}`);
|
|
161
161
|
}
|
|
162
|
-
R +=
|
|
162
|
+
R += h.join(" ") + `
|
|
163
163
|
`;
|
|
164
164
|
}
|
|
165
|
-
for (const
|
|
166
|
-
const o =
|
|
165
|
+
for (const h of d) {
|
|
166
|
+
const o = M(h);
|
|
167
167
|
if (!o) {
|
|
168
|
-
console.warn(`Entity not found for rowId: ${
|
|
168
|
+
console.warn(`Entity not found for rowId: ${h}`);
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
return
|
|
174
|
-
}).filter((u) => u !== O),
|
|
175
|
-
for (const u of
|
|
176
|
-
let
|
|
171
|
+
const S = Array.from(x.get(h) || []).sort((u, v) => {
|
|
172
|
+
const $ = b.colIdToIndex.get(u) ?? 1 / 0, U = b.colIdToIndex.get(v) ?? 1 / 0;
|
|
173
|
+
return $ - U;
|
|
174
|
+
}).filter((u) => u !== O), P = [];
|
|
175
|
+
for (const u of S) {
|
|
176
|
+
let v = "";
|
|
177
177
|
if (u.startsWith("link_"))
|
|
178
|
-
|
|
178
|
+
v = Pt(o.links, u);
|
|
179
179
|
else if (u === "subtasks") {
|
|
180
|
-
const
|
|
181
|
-
|
|
180
|
+
const $ = ft(o, u) || [];
|
|
181
|
+
v = Bt($, o.id, o.name);
|
|
182
182
|
} else {
|
|
183
|
-
let
|
|
184
|
-
if (
|
|
185
|
-
const
|
|
186
|
-
|
|
183
|
+
let $ = ft(o, u);
|
|
184
|
+
if (!$) {
|
|
185
|
+
const U = J.find((H) => H.name === u.replace("attrib_", ""));
|
|
186
|
+
U && U.data.type === "boolean" ? $ = !1 : U && U.data.type.includes("list_of") && ($ = []);
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
v = $ != null ? String($) : "", u === "name" && (v = Nt(o.entityId || o.id, j)), u === "subType" && ("folderType" in o && (v = o.folderType || ""), "taskType" in o && (v = o.taskType || ""));
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
P.push(`${v.replace(/"/g, '""')}`);
|
|
191
191
|
}
|
|
192
|
-
R +=
|
|
192
|
+
R += P.join(" ") + `
|
|
193
193
|
`;
|
|
194
194
|
}
|
|
195
195
|
return R;
|
|
196
|
-
} catch (
|
|
197
|
-
console.error("Failed to copy to clipboard:",
|
|
196
|
+
} catch (E) {
|
|
197
|
+
console.error("Failed to copy to clipboard:", E);
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
|
-
[B,
|
|
201
|
-
),
|
|
202
|
-
const a = await
|
|
200
|
+
[B, It, b, j, M, X]
|
|
201
|
+
), ht = async () => {
|
|
202
|
+
const a = await ut();
|
|
203
203
|
if (!a) return !1;
|
|
204
|
-
const p =
|
|
205
|
-
return p.length === 0 ? !1 : p.every((l) => l.values.every((
|
|
206
|
-
}, Z =
|
|
204
|
+
const p = yt(a);
|
|
205
|
+
return p.length === 0 ? !1 : p.every((l) => l.values.every((I) => I.split(",").every((E) => Ht(E))));
|
|
206
|
+
}, Z = it(
|
|
207
207
|
async (a, p) => {
|
|
208
208
|
if (a = a || Array.from(B), !a.length) return;
|
|
209
|
-
const l = await
|
|
209
|
+
const l = await at(a, { fullRow: p });
|
|
210
210
|
if (l) {
|
|
211
211
|
if (!navigator.clipboard) {
|
|
212
212
|
K("Clipboard API not supported in this browser.");
|
|
@@ -218,28 +218,28 @@ const ft = Ct(void 0), os = ({
|
|
|
218
218
|
}
|
|
219
219
|
try {
|
|
220
220
|
await navigator.clipboard.writeText(l);
|
|
221
|
-
} catch (
|
|
222
|
-
K(`Failed to copy to clipboard: ${
|
|
221
|
+
} catch (I) {
|
|
222
|
+
K(`Failed to copy to clipboard: ${I.message}`);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
|
-
[B, j,
|
|
227
|
-
),
|
|
226
|
+
[B, j, b]
|
|
227
|
+
), wt = it(
|
|
228
228
|
async (a, p, l) => {
|
|
229
229
|
if (a = a || Array.from(B), !!a.length)
|
|
230
230
|
try {
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
233
|
-
const
|
|
231
|
+
const I = await at(a, { headers: !0, fullRow: l });
|
|
232
|
+
if (!I) return;
|
|
233
|
+
const E = new Blob([I], { type: "text/csv" }), x = URL.createObjectURL(E), d = document.createElement("a");
|
|
234
234
|
d.href = x;
|
|
235
235
|
const R = a.length;
|
|
236
236
|
d.download = `${p}-export-${R}_cells-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, d.click(), URL.revokeObjectURL(x);
|
|
237
|
-
} catch (
|
|
238
|
-
console.error("Failed to copy to clipboard:",
|
|
237
|
+
} catch (I) {
|
|
238
|
+
console.error("Failed to copy to clipboard:", I);
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
|
-
[B, j,
|
|
242
|
-
),
|
|
241
|
+
[B, j, b, at]
|
|
242
|
+
), ut = async () => {
|
|
243
243
|
if (!navigator.clipboard) {
|
|
244
244
|
K("Clipboard API not supported in this browser.");
|
|
245
245
|
return;
|
|
@@ -255,27 +255,27 @@ const ft = Ct(void 0), os = ({
|
|
|
255
255
|
K(`Failed to read from clipboard: ${p.message}`);
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
|
-
}, tt =
|
|
258
|
+
}, tt = it(
|
|
259
259
|
async (a, p) => {
|
|
260
260
|
const { method: l = "replace" } = p || {};
|
|
261
261
|
if (!a.length) return;
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
let
|
|
265
|
-
|
|
266
|
-
const d =
|
|
262
|
+
const I = await ut();
|
|
263
|
+
if (!I) return;
|
|
264
|
+
let E = !1, x = I;
|
|
265
|
+
Ft(I) && (E = !0);
|
|
266
|
+
const d = yt(I);
|
|
267
267
|
if (!d.length) return;
|
|
268
268
|
const R = d.length === 1 && d[0].values.length === 1, et = X.map((t) => t.id).filter((t) => t !== O), ot = (t, e, s) => {
|
|
269
269
|
const f = {};
|
|
270
|
-
return s && s.length > 0 ? s.forEach((c,
|
|
271
|
-
const
|
|
270
|
+
return s && s.length > 0 ? s.forEach((c, r) => {
|
|
271
|
+
const g = e.find(
|
|
272
272
|
(n) => n === c || n.replace("attrib_", "") === c || n === `attrib_${c}` || n.toLowerCase() === c.toLowerCase()
|
|
273
273
|
);
|
|
274
|
-
|
|
275
|
-
}) : e.forEach((c,
|
|
276
|
-
|
|
274
|
+
g && r < t.values.length && (f[g] = t.values[r]);
|
|
275
|
+
}) : e.forEach((c, r) => {
|
|
276
|
+
r < t.values.length && (f[c] = t.values[r]);
|
|
277
277
|
}), f;
|
|
278
|
-
},
|
|
278
|
+
}, h = d[0]?.colIds || void 0, o = /* @__PURE__ */ new Map();
|
|
279
279
|
Array.from(a).forEach((t) => {
|
|
280
280
|
const e = q(t);
|
|
281
281
|
if (!e) return;
|
|
@@ -283,132 +283,132 @@ const ft = Ct(void 0), os = ({
|
|
|
283
283
|
f === O || !et.includes(f) || (o.has(s) || o.set(s, /* @__PURE__ */ new Set()), o.get(s)?.add(f));
|
|
284
284
|
});
|
|
285
285
|
const m = Array.from(o.keys()).sort((t, e) => {
|
|
286
|
-
const s =
|
|
286
|
+
const s = b.rowIdToIndex.get(t) ?? 1 / 0, f = b.rowIdToIndex.get(e) ?? 1 / 0;
|
|
287
287
|
return s - f;
|
|
288
|
-
}),
|
|
289
|
-
const s =
|
|
288
|
+
}), S = m[0], P = Array.from(o.get(S) || []).sort((t, e) => {
|
|
289
|
+
const s = b.colIdToIndex.get(t) ?? 1 / 0, f = b.colIdToIndex.get(e) ?? 1 / 0;
|
|
290
290
|
return s - f;
|
|
291
291
|
});
|
|
292
292
|
for (let t = 0; t < m.length; t++) {
|
|
293
|
-
const e = m[t], s =
|
|
294
|
-
for (const
|
|
295
|
-
const n =
|
|
296
|
-
if (!
|
|
297
|
-
colId:
|
|
293
|
+
const e = m[t], s = lt(e, j)?.entityType === "folder", f = t % d.length, c = d[f], r = R ? { [P[0]]: d[0].values[0] } : ot(c, P, h);
|
|
294
|
+
for (const g of P) {
|
|
295
|
+
const n = r[g] || "";
|
|
296
|
+
if (!jt({
|
|
297
|
+
colId: g,
|
|
298
298
|
isFolder: s,
|
|
299
299
|
pasteValue: n,
|
|
300
300
|
parsedData: d,
|
|
301
|
-
columnEnums:
|
|
302
|
-
columnReadOnly:
|
|
301
|
+
columnEnums: pt,
|
|
302
|
+
columnReadOnly: gt,
|
|
303
303
|
rowIndex: t,
|
|
304
|
-
colIndex:
|
|
304
|
+
colIndex: P.indexOf(g),
|
|
305
305
|
isSingleCellValue: R,
|
|
306
306
|
attribFields: J
|
|
307
307
|
})) return;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
const u = /* @__PURE__ */ new Map();
|
|
311
|
-
for (let t = 0; t <
|
|
312
|
-
const e =
|
|
311
|
+
for (let t = 0; t < P.length; t++) {
|
|
312
|
+
const e = P[t];
|
|
313
313
|
if (e === "name") continue;
|
|
314
314
|
if (e === "subtasks") {
|
|
315
|
-
let
|
|
316
|
-
if (
|
|
315
|
+
let r = [], g = !1;
|
|
316
|
+
if (E) {
|
|
317
317
|
const n = x.trim().split(`
|
|
318
|
-
`),
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
const w =
|
|
323
|
-
|
|
324
|
-
}),
|
|
325
|
-
const [
|
|
326
|
-
|
|
327
|
-
taskId:
|
|
318
|
+
`), y = n[0].toLowerCase(), _ = y.includes("label") && y.includes("name") && y.includes("start date") && y.includes("end date") && y.includes("assignees") && y.includes("status") ? n.slice(1) : n, V = /* @__PURE__ */ new Map(), F = [];
|
|
319
|
+
_.forEach((D) => {
|
|
320
|
+
const A = ct(D);
|
|
321
|
+
if (A.length === 0) return;
|
|
322
|
+
const w = A[0], N = `${w.taskId || ""}|${w.taskName || ""}`;
|
|
323
|
+
V.has(N) || (V.set(N, []), F.push(N)), V.get(N).push(w);
|
|
324
|
+
}), F.forEach((D) => {
|
|
325
|
+
const [A, w] = D.split("|");
|
|
326
|
+
r.push({
|
|
327
|
+
taskId: A || void 0,
|
|
328
328
|
taskName: w || void 0,
|
|
329
|
-
subtasks:
|
|
329
|
+
subtasks: V.get(D) || []
|
|
330
330
|
});
|
|
331
|
-
}),
|
|
331
|
+
}), g = r.length <= 1;
|
|
332
332
|
}
|
|
333
333
|
for (let n = 0; n < m.length; n++) {
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
const
|
|
337
|
-
u.has(
|
|
338
|
-
rowId:
|
|
339
|
-
id:
|
|
340
|
-
type:
|
|
334
|
+
const y = m[n], T = lt(y, j)?.entityType;
|
|
335
|
+
if (T !== "task") continue;
|
|
336
|
+
const _ = M(y), V = _?.entityId || y, F = `${y}-${T}`;
|
|
337
|
+
u.has(F) || u.set(F, {
|
|
338
|
+
rowId: y,
|
|
339
|
+
id: V,
|
|
340
|
+
type: T,
|
|
341
341
|
fields: {},
|
|
342
342
|
attrib: {},
|
|
343
343
|
links: {}
|
|
344
344
|
});
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
let
|
|
348
|
-
if (
|
|
349
|
-
if (
|
|
350
|
-
|
|
351
|
-
else if (
|
|
352
|
-
const
|
|
353
|
-
|
|
345
|
+
const D = u.get(F), A = _ && "subtasks" in _ && _.subtasks || [];
|
|
346
|
+
D.previousSubtasks = A;
|
|
347
|
+
let w = [];
|
|
348
|
+
if (E) {
|
|
349
|
+
if (g && r.length > 0)
|
|
350
|
+
w = r[0].subtasks;
|
|
351
|
+
else if (r.length > 0) {
|
|
352
|
+
const i = n % r.length;
|
|
353
|
+
w = r[i].subtasks;
|
|
354
354
|
}
|
|
355
355
|
} else if (R) {
|
|
356
|
-
const
|
|
357
|
-
|
|
356
|
+
const i = d[0].values[0];
|
|
357
|
+
w = ct(i);
|
|
358
358
|
} else {
|
|
359
|
-
const
|
|
360
|
-
|
|
359
|
+
const i = n % d.length, k = d[i], C = t % k.values.length, L = k.values[C];
|
|
360
|
+
w = ct(L);
|
|
361
361
|
}
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
id:
|
|
365
|
-
name:
|
|
366
|
-
label:
|
|
367
|
-
assignees:
|
|
368
|
-
description:
|
|
369
|
-
startDate:
|
|
370
|
-
endDate:
|
|
371
|
-
isDone:
|
|
362
|
+
if (!w || w.length === 0) continue;
|
|
363
|
+
const N = w.map((i, k) => ({
|
|
364
|
+
id: Mt(),
|
|
365
|
+
name: Ot(i.name || i.label || `Subtask ${k + 1}`),
|
|
366
|
+
label: i.label || "",
|
|
367
|
+
assignees: i.assignees || [],
|
|
368
|
+
description: i.label || "",
|
|
369
|
+
startDate: i.startDate,
|
|
370
|
+
endDate: i.endDate,
|
|
371
|
+
isDone: i.isDone || !1
|
|
372
372
|
}));
|
|
373
373
|
if (l === "merge") {
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
return `${
|
|
374
|
+
const i = [...A], k = new Set(
|
|
375
|
+
A.map((C) => {
|
|
376
|
+
const L = (C.label || "").toLowerCase(), st = (C.name || "").toLowerCase();
|
|
377
|
+
return `${L}|${st}`;
|
|
378
378
|
})
|
|
379
379
|
);
|
|
380
|
-
for (const
|
|
381
|
-
const
|
|
382
|
-
|
|
380
|
+
for (const C of N) {
|
|
381
|
+
const L = (C.label || "").toLowerCase(), st = (C.name || "").toLowerCase(), rt = `${L}|${st}`;
|
|
382
|
+
k.has(rt) || i.push(C);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
D.subtasks = i;
|
|
385
385
|
} else {
|
|
386
|
-
const
|
|
387
|
-
const
|
|
388
|
-
(
|
|
386
|
+
const i = N.map((k) => {
|
|
387
|
+
const C = A.find(
|
|
388
|
+
(L) => (L.label || "").toLowerCase() === (k.label || "").toLowerCase() && (L.name || "").toLowerCase() === (k.name || "").toLowerCase()
|
|
389
389
|
);
|
|
390
390
|
return {
|
|
391
|
-
...
|
|
392
|
-
id:
|
|
391
|
+
...k,
|
|
392
|
+
id: C?.id || k.id
|
|
393
393
|
};
|
|
394
394
|
});
|
|
395
|
-
|
|
395
|
+
D.subtasks = i;
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
continue;
|
|
399
399
|
}
|
|
400
400
|
let s = !1, f = !1, c = "string";
|
|
401
401
|
if (m.length > 0) {
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
402
|
+
const r = m[0];
|
|
403
|
+
if (M(r))
|
|
404
404
|
if (s = e.startsWith("attrib_"), f = e.startsWith("link_"), e === "status" || e === "subType")
|
|
405
405
|
c = "string", s = !1;
|
|
406
406
|
else if (e === "tags" || e === "assignees")
|
|
407
407
|
c = "array";
|
|
408
408
|
else if (s) {
|
|
409
|
-
const n = e.replace("attrib_", ""),
|
|
410
|
-
if (
|
|
411
|
-
switch (
|
|
409
|
+
const n = e.replace("attrib_", ""), y = J.find((T) => T.name === n);
|
|
410
|
+
if (y)
|
|
411
|
+
switch (y.data.type) {
|
|
412
412
|
case "boolean":
|
|
413
413
|
c = "boolean";
|
|
414
414
|
break;
|
|
@@ -427,52 +427,52 @@ const ft = Ct(void 0), os = ({
|
|
|
427
427
|
}
|
|
428
428
|
} else f && (c = "array");
|
|
429
429
|
}
|
|
430
|
-
for (let
|
|
431
|
-
const
|
|
432
|
-
let
|
|
430
|
+
for (let r = 0; r < m.length; r++) {
|
|
431
|
+
const g = m[r], n = lt(g, j)?.entityType, y = n === "folder";
|
|
432
|
+
let T;
|
|
433
433
|
if (R)
|
|
434
|
-
|
|
434
|
+
T = d[0].values[0];
|
|
435
435
|
else {
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
const
|
|
439
|
-
const
|
|
440
|
-
return
|
|
441
|
-
}),
|
|
442
|
-
(
|
|
443
|
-
),
|
|
444
|
-
|
|
445
|
-
|
|
436
|
+
const N = r % d.length, i = d[N];
|
|
437
|
+
if (i.values.length > P.length) {
|
|
438
|
+
const k = b.colIdToIndex.get(P[0]) ?? 0, C = Array.from(b.colIdToIndex.keys()).filter((G) => G !== O).sort((G, Tt) => {
|
|
439
|
+
const xt = b.colIdToIndex.get(G) ?? 1 / 0, Ct = b.colIdToIndex.get(Tt) ?? 1 / 0;
|
|
440
|
+
return xt - Ct;
|
|
441
|
+
}), L = C.findIndex(
|
|
442
|
+
(G) => b.colIdToIndex.get(G) === k
|
|
443
|
+
), rt = C.slice(
|
|
444
|
+
L,
|
|
445
|
+
L + i.values.length
|
|
446
446
|
).indexOf(e);
|
|
447
|
-
|
|
447
|
+
T = i.values[rt] || i.values[rt % i.values.length];
|
|
448
448
|
} else {
|
|
449
|
-
const
|
|
450
|
-
|
|
449
|
+
const k = t % i.values.length;
|
|
450
|
+
T = i.values[k];
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
let
|
|
454
|
-
if (e === "subType" && (
|
|
453
|
+
let _ = e.split("_").pop() || e;
|
|
454
|
+
if (e === "subType" && (_ = y ? "folderType" : "taskType", s = !1, !T))
|
|
455
455
|
continue;
|
|
456
|
-
const
|
|
457
|
-
!u.has(
|
|
458
|
-
rowId:
|
|
459
|
-
id:
|
|
456
|
+
const V = Ut(T, c), D = M(g)?.entityId || g, A = `${g}-${n}`;
|
|
457
|
+
!u.has(A) && n && u.set(A, {
|
|
458
|
+
rowId: g,
|
|
459
|
+
id: D,
|
|
460
460
|
type: n,
|
|
461
461
|
fields: {},
|
|
462
462
|
attrib: {},
|
|
463
463
|
links: {}
|
|
464
464
|
});
|
|
465
|
-
const
|
|
465
|
+
const w = u.get(A);
|
|
466
466
|
if (f) {
|
|
467
|
-
const [
|
|
468
|
-
|
|
469
|
-
} else s ?
|
|
467
|
+
const [N, i, k, C, L] = e.split("_");
|
|
468
|
+
w.links[`${i}|${k}|${C}_${L}`] = V;
|
|
469
|
+
} else s ? w.attrib[_] = V : w.fields[_] = V;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const
|
|
472
|
+
const v = [], $ = /* @__PURE__ */ new Map();
|
|
473
473
|
u.forEach((t) => {
|
|
474
474
|
Object.entries(t.fields).forEach(([e, s]) => {
|
|
475
|
-
|
|
475
|
+
v.push({
|
|
476
476
|
rowId: t.rowId,
|
|
477
477
|
id: t.id,
|
|
478
478
|
type: t.type,
|
|
@@ -480,7 +480,7 @@ const ft = Ct(void 0), os = ({
|
|
|
480
480
|
value: s
|
|
481
481
|
});
|
|
482
482
|
}), Object.entries(t.attrib).forEach(([e, s]) => {
|
|
483
|
-
|
|
483
|
+
v.push({
|
|
484
484
|
rowId: t.rowId,
|
|
485
485
|
id: t.id,
|
|
486
486
|
type: t.type,
|
|
@@ -489,81 +489,81 @@ const ft = Ct(void 0), os = ({
|
|
|
489
489
|
isAttrib: !0
|
|
490
490
|
});
|
|
491
491
|
}), Object.entries(t.links).forEach(([e, s]) => {
|
|
492
|
-
const [f, c] = e.split("_"),
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
|
|
492
|
+
const [f, c] = e.split("_"), r = f.split("|");
|
|
493
|
+
if (r.length >= 3) {
|
|
494
|
+
const g = r[0], n = r[1], y = r[2], T = `${g}|${n}|${y}`, _ = c === "out" ? y : n, V = `${t.id}-${T}-${c}`;
|
|
495
|
+
$.set(V, {
|
|
496
496
|
rowId: t.rowId,
|
|
497
497
|
sourceEntityId: t.id,
|
|
498
498
|
sourceEntityType: t.type,
|
|
499
|
-
linkType:
|
|
499
|
+
linkType: T,
|
|
500
500
|
direction: c,
|
|
501
|
-
targetEntityType:
|
|
501
|
+
targetEntityType: _,
|
|
502
502
|
operation: l,
|
|
503
503
|
targetEntityIds: Array.isArray(s) ? s : []
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
});
|
|
508
|
-
const
|
|
508
|
+
const U = Array.from($.values()), H = [];
|
|
509
509
|
u.forEach((t) => {
|
|
510
|
-
t.subtasks &&
|
|
510
|
+
t.subtasks && H.push({
|
|
511
511
|
taskId: t.id,
|
|
512
512
|
subtasks: t.subtasks,
|
|
513
513
|
previousSubtasks: t.previousSubtasks
|
|
514
514
|
});
|
|
515
515
|
});
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
|
|
519
|
-
const c = f || [],
|
|
516
|
+
const W = [];
|
|
517
|
+
if (v.length > 0 && W.push(dt(v)), U.length > 0 && W.push(mt(U)), H.length > 0) {
|
|
518
|
+
nt && H.forEach(({ taskId: e, subtasks: s, previousSubtasks: f }) => {
|
|
519
|
+
const c = f || [], r = s || [], g = () => {
|
|
520
520
|
Y({ projectName: Q, taskId: e, subtasks: c }).unwrap().catch(() => {
|
|
521
521
|
});
|
|
522
522
|
}, n = () => {
|
|
523
|
-
Y({ projectName: Q, taskId: e, subtasks:
|
|
523
|
+
Y({ projectName: Q, taskId: e, subtasks: r }).unwrap().catch(() => {
|
|
524
524
|
});
|
|
525
525
|
};
|
|
526
|
-
|
|
526
|
+
nt.pushHistory([g], [n]);
|
|
527
527
|
});
|
|
528
|
-
const t =
|
|
528
|
+
const t = H.map(
|
|
529
529
|
({ taskId: e, subtasks: s }) => Y({ projectName: Q, taskId: e, subtasks: s }).unwrap()
|
|
530
530
|
);
|
|
531
|
-
|
|
531
|
+
W.push(...t);
|
|
532
532
|
}
|
|
533
|
-
if (
|
|
533
|
+
if (W.length > 0)
|
|
534
534
|
try {
|
|
535
|
-
await Promise.all(
|
|
535
|
+
await Promise.all(W);
|
|
536
536
|
} catch (t) {
|
|
537
537
|
console.error("Error updating entities:", t), K(`Paste failed: ${t || t?.message || "Unknown error"}`);
|
|
538
538
|
}
|
|
539
539
|
},
|
|
540
540
|
[
|
|
541
541
|
B,
|
|
542
|
-
|
|
542
|
+
b,
|
|
543
543
|
j,
|
|
544
|
-
|
|
544
|
+
dt,
|
|
545
|
+
mt,
|
|
545
546
|
pt,
|
|
546
|
-
|
|
547
|
-
W,
|
|
547
|
+
M,
|
|
548
548
|
X,
|
|
549
549
|
J,
|
|
550
550
|
Q,
|
|
551
551
|
Y,
|
|
552
|
-
|
|
552
|
+
nt
|
|
553
553
|
]
|
|
554
554
|
);
|
|
555
|
-
|
|
555
|
+
St(() => {
|
|
556
556
|
const a = async (p) => {
|
|
557
557
|
if ((p.ctrlKey || p.metaKey) && p.key === "c") {
|
|
558
|
-
const l = document.activeElement,
|
|
559
|
-
if ((window.getSelection()?.toString().length ?? !1) && !
|
|
558
|
+
const l = document.activeElement, I = l?.closest("table") !== null || l?.closest(".table-container") !== null || l?.tagName === "TD" || l?.tagName === "TH", E = l?.tagName === "INPUT" || l?.tagName === "TEXTAREA" || l?.isContentEditable;
|
|
559
|
+
if ((window.getSelection()?.toString().length ?? !1) && !I || E && !I)
|
|
560
560
|
return;
|
|
561
561
|
B.size > 0 && await Z();
|
|
562
562
|
}
|
|
563
563
|
if ((p.ctrlKey || p.metaKey) && p.key === "v") {
|
|
564
564
|
const l = document.activeElement;
|
|
565
565
|
if (l && (l.tagName === "INPUT" || l.tagName === "TEXTAREA" || l.isContentEditable))
|
|
566
|
-
if (await
|
|
566
|
+
if (await ht())
|
|
567
567
|
p.preventDefault();
|
|
568
568
|
else
|
|
569
569
|
return;
|
|
@@ -577,23 +577,23 @@ const ft = Ct(void 0), os = ({
|
|
|
577
577
|
window.removeEventListener("keydown", a);
|
|
578
578
|
};
|
|
579
579
|
}, [Z, tt]);
|
|
580
|
-
const
|
|
580
|
+
const kt = $t(
|
|
581
581
|
() => ({
|
|
582
582
|
copyToClipboard: Z,
|
|
583
583
|
pasteFromClipboard: tt,
|
|
584
|
-
exportCSV:
|
|
584
|
+
exportCSV: wt
|
|
585
585
|
}),
|
|
586
586
|
[Z, tt]
|
|
587
587
|
);
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
},
|
|
590
|
-
const z =
|
|
588
|
+
return /* @__PURE__ */ vt.jsx(bt.Provider, { value: kt, children: z });
|
|
589
|
+
}, is = () => {
|
|
590
|
+
const z = At(bt);
|
|
591
591
|
if (z === void 0)
|
|
592
592
|
throw new Error("useClipboard must be used within a ClipboardProvider");
|
|
593
593
|
return z;
|
|
594
594
|
};
|
|
595
595
|
export {
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
rs as ClipboardProvider,
|
|
597
|
+
is as useClipboard
|
|
598
598
|
};
|
|
599
599
|
//# sourceMappingURL=ClipboardContext.es.js.map
|