@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.
Files changed (82) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs11.js +1 -1
  3. package/dist/_virtual/index.cjs12.js +1 -1
  4. package/dist/_virtual/index.cjs4.js +1 -1
  5. package/dist/_virtual/index.cjs5.js +1 -1
  6. package/dist/_virtual/index.es10.js +3 -3
  7. package/dist/_virtual/index.es11.js +5 -5
  8. package/dist/_virtual/index.es12.js +5 -5
  9. package/dist/_virtual/index.es4.js +2 -5
  10. package/dist/_virtual/index.es4.js.map +1 -1
  11. package/dist/_virtual/index.es5.js +5 -2
  12. package/dist/_virtual/index.es5.js.map +1 -1
  13. package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
  14. package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
  15. package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
  16. package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
  17. package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
  18. package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
  19. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  20. package/dist/node_modules/remove-accents/index.es.js +1 -1
  21. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  22. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  23. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  24. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  25. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  26. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  27. package/dist/shared/src/api/queries/overview/getOverview.cjs.js +1 -1
  28. package/dist/shared/src/api/queries/overview/getOverview.cjs.js.map +1 -1
  29. package/dist/shared/src/api/queries/overview/getOverview.es.js +95 -95
  30. package/dist/shared/src/api/queries/overview/getOverview.es.js.map +1 -1
  31. package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js +1 -1
  32. package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js.map +1 -1
  33. package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js +14 -11
  34. package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js.map +1 -1
  35. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js +1 -1
  36. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js.map +1 -1
  37. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js +42 -41
  38. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js.map +1 -1
  39. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js +1 -1
  40. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js.map +1 -1
  41. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js +23 -23
  42. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js.map +1 -1
  43. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js +1 -1
  44. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js.map +1 -1
  45. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js +65 -64
  46. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js.map +1 -1
  47. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js +1 -1
  48. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js.map +1 -1
  49. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js +16 -16
  50. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js.map +1 -1
  51. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js +3 -3
  52. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js.map +1 -1
  53. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js +142 -146
  54. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js.map +1 -1
  55. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
  56. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
  57. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +24 -24
  58. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
  59. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js +1 -1
  60. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js.map +1 -1
  61. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js +141 -132
  62. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js.map +1 -1
  63. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js +1 -1
  64. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js.map +1 -1
  65. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js +35 -28
  66. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js.map +1 -1
  67. package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.cjs.js.map +1 -1
  68. package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.es.js.map +1 -1
  69. package/dist/shared/src/context/AddonContext.cjs.js.map +1 -1
  70. package/dist/shared/src/context/AddonContext.es.js.map +1 -1
  71. package/dist/shared/src/context/ProjectFoldersContext.cjs.js +1 -1
  72. package/dist/shared/src/context/ProjectFoldersContext.cjs.js.map +1 -1
  73. package/dist/shared/src/context/ProjectFoldersContext.es.js +62 -49
  74. package/dist/shared/src/context/ProjectFoldersContext.es.js.map +1 -1
  75. package/dist/types/api/queries/overview/getOverview.d.ts +1 -0
  76. package/dist/types/components/RemotePage/RemotePageWrapper.d.ts +1 -0
  77. package/dist/types/components/SearchFilter/useBuildFilterOptions.d.ts +1 -0
  78. package/dist/types/containers/ProjectTreeTable/hooks/useFetchOverviewData.d.ts +2 -1
  79. package/dist/types/containers/ProjectTreeTable/hooks/useQueryFilters.d.ts +4 -1
  80. package/dist/types/context/AddonContext.d.ts +1 -0
  81. package/dist/types/context/ProjectFoldersContext.d.ts +1 -0
  82. 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 be } from "react";
3
- import { useSelectionCellsContext as we, ROW_SELECTION_COLUMN_ID as V } from "./SelectionCellsContext.es.js";
4
- import { useCellEditing as Te } from "./CellEditingContext.es.js";
5
- import { parseCellId as F, getLinkEntityIdsByColumnId as he, getCellValue as xe, getEntityDataById as ne } from "../utils/cellUtils.es.js";
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: j,
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: v, gridMap: l, focusedCellId: ae } = we(), { updateEntities: Y } = Te(), { pasteTableLinks: Z } = Ce(), { getEntityById: O, attribFields: N } = Ae(), z = H(
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: c, fullRow: m } = i || {};
23
+ const { headers: g, fullRow: m } = i || {};
24
24
  try {
25
- const f = D.map((s) => s.id).filter((s) => s !== V), y = /* @__PURE__ */ new Map();
25
+ const d = D.map((s) => s.id).filter((s) => s !== V), u = /* @__PURE__ */ new Map();
26
26
  r.forEach((s) => {
27
- const o = F(s);
27
+ const o = j(s);
28
28
  if (!o) return;
29
- const { rowId: d, colId: I } = o;
30
- I === V || !f.includes(I) || (y.has(d) || y.set(d, /* @__PURE__ */ new Set()), y.get(d)?.add(I));
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) => F(o)?.rowId && F(o)?.colId === V
33
- ).map((o) => F(o)?.rowId).forEach((o) => {
34
- y.has(o) || y.set(o, /* @__PURE__ */ new Set()), Array.from(l.colIdToIndex.keys()).forEach((I) => {
35
- y.get(o)?.add(I);
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 E = Array.from(y.keys()).sort((s, o) => {
39
- const d = l.rowIdToIndex.get(s) ?? 1 / 0, I = l.rowIdToIndex.get(o) ?? 1 / 0;
40
- return d - I;
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 = E[0];
43
+ const M = v[0];
44
44
  if (!M) return "";
45
- const k = Array.from(y.get(M) || []).sort((s, o) => {
46
- const d = l.colIdToIndex.get(s) ?? 1 / 0, I = l.colIdToIndex.get(o) ?? 1 / 0;
47
- return d - I;
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 (c && k.length > 0) {
49
+ if (g && E.length > 0) {
50
50
  const s = [];
51
- for (const o of k) {
52
- const d = o;
53
- s.push(`${d.replace(/"/g, '""')}`);
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 E) {
59
- const o = O(s);
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 I = Array.from(y.get(s) || []).sort((w, h) => {
65
- const T = l.colIdToIndex.get(w) ?? 1 / 0, e = l.colIdToIndex.get(h) ?? 1 / 0;
66
- return T - e;
67
- }).filter((w) => w !== V), R = [];
68
- for (const w of I) {
69
- let h = "";
70
- if (w.startsWith("link_"))
71
- h = he(o.links, w);
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 T = xe(o, w);
74
- if (!T) {
75
- const e = N.find((t) => t.name === w.replace("attrib_", ""));
76
- e && e.data.type === "boolean" ? T = !1 : e && e.data.type.includes("list_of") && (T = []);
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
- h = T != null ? String(T) : "", w === "name" && (h = ve(o.entityId || o.id, _)), w === "subType" && ("folderType" in o && (h = o.folderType || ""), "taskType" in o && (h = o.taskType || ""));
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(`${h.replace(/"/g, '""')}`);
80
+ R.push(`${T.replace(/"/g, '""')}`);
81
81
  }
82
82
  $ += R.join(" ") + `
83
83
  `;
84
84
  }
85
85
  return $;
86
- } catch (f) {
87
- console.error("Failed to copy to clipboard:", f);
86
+ } catch (d) {
87
+ console.error("Failed to copy to clipboard:", d);
88
88
  }
89
89
  },
90
- [v, ae, l, _, O, D]
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((c) => c.values.every((m) => m.split(",").every((f) => _e(f))));
96
- }, K = H(
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(v), !r.length) return;
99
- const c = await z(r, { fullRow: i });
100
- if (c) {
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(c);
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
- [v, _, l]
116
+ [_, A, l]
117
117
  ), ce = H(
118
- async (r, i, c) => {
119
- if (r = r || Array.from(v), !!r.length)
118
+ async (r, i, g) => {
119
+ if (r = r || Array.from(_), !!r.length)
120
120
  try {
121
- const m = await z(r, { headers: !0, fullRow: c });
121
+ const m = await X(r, { headers: !0, fullRow: g });
122
122
  if (!m) return;
123
- const f = new Blob([m], { type: "text/csv" }), y = URL.createObjectURL(f), E = document.createElement("a");
124
- E.href = y;
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
- E.download = `${i}-export-${$}_cells-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, E.click(), URL.revokeObjectURL(y);
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
- [v, _, l, z]
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: c = "replace" } = i || {};
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 f = re(m);
155
- if (!f.length) return;
156
- const y = f.length === 1 && f[0].values.length === 1, E = D.map((e) => e.id).filter((e) => e !== V), $ = (e, t, n) => {
157
- const p = {};
158
- return n && n.length > 0 ? n.forEach((a, u) => {
159
- const b = t.find(
160
- (g) => g === a || g.replace("attrib_", "") === a || g === `attrib_${a}` || g.toLowerCase() === a.toLowerCase()
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
- b && u < e.values.length && (p[b] = e.values[u]);
163
- }) : t.forEach((a, u) => {
164
- u < e.values.length && (p[a] = e.values[u]);
165
- }), p;
166
- }, M = f[0]?.colIds || void 0, k = /* @__PURE__ */ new Map();
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 = F(e);
168
+ const t = j(e);
169
169
  if (!t) return;
170
- const { rowId: n, colId: p } = t;
171
- p === V || !E.includes(p) || (k.has(n) || k.set(n, /* @__PURE__ */ new Set()), k.get(n)?.add(p));
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(k.keys()).sort((e, t) => {
174
- const n = l.rowIdToIndex.get(e) ?? 1 / 0, p = l.rowIdToIndex.get(t) ?? 1 / 0;
175
- return n - p;
176
- }), o = s[0], d = Array.from(k.get(o) || []).sort((e, t) => {
177
- const n = l.colIdToIndex.get(e) ?? 1 / 0, p = l.colIdToIndex.get(t) ?? 1 / 0;
178
- return n - p;
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, _)?.entityType === "folder", p = e % f.length, a = f[p], u = y ? { [d[0]]: f[0].values[0] } : $(a, d, M);
182
- for (const b of d) {
183
- const g = u[b] || "";
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: b,
185
+ colId: w,
186
186
  isFolder: n,
187
- pasteValue: g,
188
- parsedData: f,
187
+ pasteValue: I,
188
+ parsedData: d,
189
189
  columnEnums: Q,
190
190
  columnReadOnly: ie,
191
191
  rowIndex: e,
192
- colIndex: d.indexOf(b),
193
- isSingleCellValue: y,
194
- attribFields: N
192
+ colIndex: c.indexOf(w),
193
+ isSingleCellValue: u,
194
+ attribFields: K
195
195
  })) return;
196
196
  }
197
197
  }
198
- const I = /* @__PURE__ */ new Map();
199
- for (let e = 0; e < d.length; e++) {
200
- const t = d[e];
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, p = !1, a = "string";
202
+ let n = !1, f = !1, a = "string";
203
203
  if (s.length > 0) {
204
- const u = s[0];
205
- if (O(u))
206
- if (n = t.startsWith("attrib_"), p = t.startsWith("link_"), t === "status" || t === "subType")
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 g = t.replace("attrib_", ""), A = N.find((x) => x.name === g);
212
- if (A)
213
- switch (A.data.type) {
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 p && (a = "array");
230
+ } else f && (a = "array");
231
231
  }
232
- for (let u = 0; u < s.length; u++) {
233
- const b = s[u], g = ne(b, _)?.entityType, A = g === "folder";
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 (y)
236
- x = f[0].values[0];
235
+ if (u)
236
+ x = d[0].values[0];
237
237
  else {
238
- const te = u % f.length, C = f[te];
239
- if (C.values.length > d.length) {
240
- const U = l.colIdToIndex.get(d[0]) ?? 0, q = Array.from(l.colIdToIndex.keys()).filter((B) => B !== V).sort((B, fe) => {
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 = A ? "folderType" : "taskType", n = !1, !x))
256
+ if (t === "subType" && (S = k ? "folderType" : "taskType", n = !1, !x))
257
257
  continue;
258
- const L = Ee(x, a), X = `${b}-${g}`;
259
- !I.has(X) && g && I.set(X, {
260
- rowId: b,
261
- id: b,
262
- type: g,
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 = I.get(X);
268
- if (p) {
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 = [], w = /* @__PURE__ */ new Map();
275
- I.forEach((e) => {
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 [p, a] = t.split("_"), u = p.split("|");
295
- if (u.length >= 3) {
296
- const b = u[0], g = u[1], A = u[2], x = `${b}|${g}|${A}`, S = a === "out" ? A : g, L = `${e.id}-${x}-${a}`;
297
- w.set(L, {
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: c,
304
+ operation: g,
305
305
  targetEntityIds: Array.isArray(n) ? n : []
306
306
  });
307
307
  }
308
308
  });
309
309
  });
310
- const h = Array.from(w.values()), T = [];
311
- if (R.length > 0 && T.push(Y(R)), h.length > 0 && T.push(Z(h)), T.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(T);
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
- O,
325
+ F,
326
326
  D,
327
- N
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 c = document.activeElement;
334
- (c?.closest("table") !== null || c?.closest(".table-container") !== null || c?.tagName === "TD" || c?.tagName === "TH") && v.size > 0 && K();
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(v), {
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
- }, [K, W]);
348
+ }, [N, W]);
353
349
  const de = me(
354
350
  () => ({
355
- copyToClipboard: K,
351
+ copyToClipboard: N,
356
352
  pasteFromClipboard: W,
357
353
  exportCSV: ce
358
354
  }),
359
- [K, W]
355
+ [N, W]
360
356
  );
361
- return /* @__PURE__ */ ye.jsx(se.Provider, { value: de, children: j });
357
+ return /* @__PURE__ */ ye.jsx(se.Provider, { value: de, children: O });
362
358
  }, Me = () => {
363
- const j = be(se);
364
- if (j === void 0)
359
+ const O = we(se);
360
+ if (O === void 0)
365
361
  throw new Error("useClipboard must be used within a ClipboardProvider");
366
- return j;
362
+ return O;
367
363
  };
368
364
  export {
369
365
  We as ClipboardProvider,