@ynput/ayon-frontend-shared 0.2.25 → 0.2.26
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/Views.cjs.js +1 -1
- package/dist/Views.es.js +14 -14
- package/dist/shared/src/components/LinksManager/hooks/useUpdateLinks.cjs.js +1 -1
- package/dist/shared/src/components/LinksManager/hooks/useUpdateLinks.cjs.js.map +1 -1
- package/dist/shared/src/components/LinksManager/hooks/useUpdateLinks.es.js +33 -25
- package/dist/shared/src/components/LinksManager/hooks/useUpdateLinks.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/CellEditingProvider.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/CellEditingProvider.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/CellEditingProvider.es.js +10 -10
- package/dist/shared/src/containers/ProjectTreeTable/context/CellEditingProvider.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/usePasteLinks.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/usePasteLinks.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/usePasteLinks.es.js +229 -68
- package/dist/shared/src/containers/ProjectTreeTable/hooks/usePasteLinks.es.js.map +1 -1
- package/dist/shared/src/containers/Slicer/createFilterFromSlicer.cjs.js +1 -1
- package/dist/shared/src/containers/Slicer/createFilterFromSlicer.cjs.js.map +1 -1
- package/dist/shared/src/containers/Slicer/createFilterFromSlicer.es.js +21 -25
- package/dist/shared/src/containers/Slicer/createFilterFromSlicer.es.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewItem/ViewItem.cjs.js +1 -1
- package/dist/shared/src/containers/Views/ViewItem/ViewItem.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewItem/ViewItem.es.js +64 -54
- package/dist/shared/src/containers/Views/ViewItem/ViewItem.es.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewFormDialogFallback.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewFormDialogFallback.es.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewsDialogContainer.cjs.js +1 -1
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewsDialogContainer.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewsDialogContainer.es.js +22 -20
- package/dist/shared/src/containers/Views/ViewsDialogContainer/ViewsDialogContainer.es.js.map +1 -1
- package/dist/shared/src/containers/Views/context/ViewsContext.cjs.js +1 -1
- package/dist/shared/src/containers/Views/context/ViewsContext.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/context/ViewsContext.es.js +60 -59
- package/dist/shared/src/containers/Views/context/ViewsContext.es.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/useSaveViewFromCurrent.cjs.js +1 -1
- package/dist/shared/src/containers/Views/hooks/useSaveViewFromCurrent.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/useSaveViewFromCurrent.es.js +14 -14
- package/dist/shared/src/containers/Views/hooks/useSaveViewFromCurrent.es.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/useViewsMutations.cjs.js +1 -1
- package/dist/shared/src/containers/Views/hooks/useViewsMutations.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/useViewsMutations.es.js +17 -18
- package/dist/shared/src/containers/Views/hooks/useViewsMutations.es.js.map +1 -1
- package/dist/shared/src/hooks/useActionTriggers.cjs.js +1 -1
- package/dist/shared/src/hooks/useActionTriggers.cjs.js.map +1 -1
- package/dist/shared/src/hooks/useActionTriggers.es.js +38 -33
- package/dist/shared/src/hooks/useActionTriggers.es.js.map +1 -1
- package/dist/shared/src/hooks/useCustomProtocolCheck.cjs.js +2 -0
- package/dist/shared/src/hooks/useCustomProtocolCheck.cjs.js.map +1 -0
- package/dist/shared/src/hooks/useCustomProtocolCheck.es.js +43 -0
- package/dist/shared/src/hooks/useCustomProtocolCheck.es.js.map +1 -0
- package/dist/types/containers/Slicer/createFilterFromSlicer.d.ts +3 -1
- package/dist/types/containers/Slicer/types.d.ts +1 -1
- package/dist/types/containers/Views/ViewsDialogContainer/ViewFormDialogFallback.d.ts +1 -0
- package/dist/types/containers/Views/context/ViewsContext.d.ts +2 -1
- package/dist/types/containers/Views/hooks/useViewsMutations.d.ts +3 -3
- package/dist/types/hooks/useActionTriggers.d.ts +1 -1
- package/dist/types/hooks/useCustomProtocolCheck.d.ts +10 -0
- package/package.json +1 -1
|
@@ -214,9 +214,9 @@ import "../../../components/LinksManager/LinksManagerDialog.es.js";
|
|
|
214
214
|
import "../ProjectTreeTable.styled.es.js";
|
|
215
215
|
import "../widgets/LoadMoreWidget.es.js";
|
|
216
216
|
const Zo = ({ children: F }) => {
|
|
217
|
-
const [d, D] = B(null), T = w((i) => i === d, [d]), E = S(), { pushHistory: U, undo:
|
|
217
|
+
const [d, D] = B(null), T = w((i) => i === d, [d]), E = S(), { pushHistory: U, undo: K, redo: N, canUndo: k, canRedo: A } = E, { selectedCells: b } = V(), { updateEntities: v, inheritFromParent: l } = O({
|
|
218
218
|
pushHistory: U
|
|
219
|
-
}), { attribFields: f, getEntityById:
|
|
219
|
+
}), { attribFields: f, getEntityById: P } = W(), c = w(
|
|
220
220
|
async (i = [], t = !0) => {
|
|
221
221
|
try {
|
|
222
222
|
return X(i, f), await v(i, t);
|
|
@@ -226,7 +226,7 @@ const Zo = ({ children: F }) => {
|
|
|
226
226
|
},
|
|
227
227
|
[v, f]
|
|
228
228
|
), u = async () => {
|
|
229
|
-
const [i, t, r] =
|
|
229
|
+
const [i, t, r] = K() || [];
|
|
230
230
|
if (i && i.length > 0)
|
|
231
231
|
try {
|
|
232
232
|
await c(i, !1);
|
|
@@ -247,7 +247,7 @@ const Zo = ({ children: F }) => {
|
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
249
|
}, y = async () => {
|
|
250
|
-
const [i, t, r] =
|
|
250
|
+
const [i, t, r] = N() || [];
|
|
251
251
|
if (i && i.length > 0)
|
|
252
252
|
try {
|
|
253
253
|
await c(i, !1);
|
|
@@ -276,7 +276,7 @@ const Zo = ({ children: F }) => {
|
|
|
276
276
|
console.warn(`Invalid cellId: ${o}`);
|
|
277
277
|
continue;
|
|
278
278
|
}
|
|
279
|
-
const e =
|
|
279
|
+
const e = P(s);
|
|
280
280
|
if (!e) return;
|
|
281
281
|
const p = n.replace("attrib_", ""), m = n.startsWith("attrib_");
|
|
282
282
|
if (!p) {
|
|
@@ -311,7 +311,7 @@ const Zo = ({ children: F }) => {
|
|
|
311
311
|
console.warn(`Field not editable: ${p}`);
|
|
312
312
|
continue;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
314
|
+
const j = {
|
|
315
315
|
id: s,
|
|
316
316
|
rowId: s,
|
|
317
317
|
field: p,
|
|
@@ -319,7 +319,7 @@ const Zo = ({ children: F }) => {
|
|
|
319
319
|
isAttrib: m,
|
|
320
320
|
type: e.entityType
|
|
321
321
|
};
|
|
322
|
-
t.push(
|
|
322
|
+
t.push(j);
|
|
323
323
|
}
|
|
324
324
|
if (t.length > 0)
|
|
325
325
|
try {
|
|
@@ -336,7 +336,7 @@ const Zo = ({ children: F }) => {
|
|
|
336
336
|
t.length === 0 && r.length === 0 && a.warn("No valid cells selected to clear");
|
|
337
337
|
},
|
|
338
338
|
[f, v]
|
|
339
|
-
),
|
|
339
|
+
), _ = H(
|
|
340
340
|
() => ({
|
|
341
341
|
editingCellId: d,
|
|
342
342
|
setEditingCellId: D,
|
|
@@ -365,7 +365,7 @@ const Zo = ({ children: F }) => {
|
|
|
365
365
|
const n = typeof navigator < "u" && // @ts-expect-error
|
|
366
366
|
(navigator.userAgentData && // @ts-expect-error
|
|
367
367
|
navigator.userAgentData.platform.toUpperCase().includes("MAC") || navigator.userAgent.toUpperCase().includes("MAC")) ? t.metaKey : t.ctrlKey;
|
|
368
|
-
if (n && t.key === "z" && (t.preventDefault(), k && u()), (n && t.key === "y" || n && t.shiftKey && t.key === "z" || n && t.key === "Z") && (t.preventDefault(), A && y()), t.key === "Backspace" || t.key === "Delete") {
|
|
368
|
+
if (n && t.key === "z" && (t.preventDefault(), k && u()), (n && t.key === "y" || n && t.shiftKey && t.key === "z" || n && t.key === "Z") && (t.preventDefault(), A && y()), t.key === "Backspace" && !(t.ctrlKey || t.metaKey) || t.key === "Delete") {
|
|
369
369
|
if (!b.size) return;
|
|
370
370
|
t.preventDefault();
|
|
371
371
|
const s = Array.from(b).map(
|
|
@@ -379,7 +379,7 @@ const Zo = ({ children: F }) => {
|
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
382
|
-
}, [k, A, u, y, b, x]), /* @__PURE__ */ R.jsx(z.Provider, { value:
|
|
382
|
+
}, [k, A, u, y, b, x]), /* @__PURE__ */ R.jsx(z.Provider, { value: _, children: F });
|
|
383
383
|
};
|
|
384
384
|
export {
|
|
385
385
|
Zo as CellEditingProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellEditingProvider.es.js","sources":["../../../../../../src/containers/ProjectTreeTable/context/CellEditingProvider.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { CellId, getTypeDefaultValue, parseCellId } from '../utils'\nimport useHistory from '../hooks/useHistory'\nimport { useSelectionCellsContext } from './SelectionCellsContext'\nimport useUpdateTableData, {\n EntityUpdate,\n InheritFromParentEntity,\n UpdateTableEntities,\n} from '../hooks/useUpdateTableData'\nimport { useProjectTableContext } from './ProjectTableContext'\nimport validateUpdateEntities from '../utils/validateUpdateEntities'\nimport { toast } from 'react-toastify'\nimport { CellEditingContext } from './CellEditingContext'\n\nexport const CellEditingProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const [editingCellId, setEditingCellId] = useState<CellId | null>(null)\n\n // Memoize these functions to prevent unnecessary re-renders\n const isEditing = useCallback((id: CellId) => id === editingCellId, [editingCellId])\n\n // Get history functions\n const history = useHistory()\n const { pushHistory, undo: undoHistory, redo: redoHistory, canUndo, canRedo } = history\n\n const { selectedCells } = useSelectionCellsContext()\n const { updateEntities: updateOverviewEntities, inheritFromParent } = useUpdateTableData({\n pushHistory,\n })\n const { attribFields, getEntityById } = useProjectTableContext()\n\n const handleUpdateEntities: UpdateTableEntities = useCallback(\n async (entities = [], pushToHistory = true) => {\n try {\n // validate the entities before updating\n validateUpdateEntities(entities, attribFields)\n\n // if validation passes, update the entities\n return await updateOverviewEntities(entities, pushToHistory)\n } catch (error: any) {\n // if validation fails, show a toast and return\n toast.error(error.message)\n\n return Promise.reject(error)\n }\n },\n [updateOverviewEntities, attribFields],\n )\n\n // Handle undo\n const handleUndo = async () => {\n const [entitiesToUndo, entitiesToInherit, callbacks] = undoHistory() || []\n\n if (entitiesToUndo && entitiesToUndo.length > 0) {\n try {\n await handleUpdateEntities(entitiesToUndo, false)\n } catch (error) {\n toast.error('Failed to undo changes')\n }\n }\n if (entitiesToInherit && entitiesToInherit.length > 0) {\n try {\n await inheritFromParent(entitiesToInherit, false)\n } catch (error) {\n toast.error('Failed to inherit changes')\n }\n }\n // Execute custom callbacks if any\n if (callbacks && callbacks.length > 0) {\n callbacks.forEach((callback) => {\n try {\n callback()\n } catch (error) {\n toast.error('Failed to execute custom undo action')\n }\n })\n }\n }\n\n // Handle redo\n const handleRedo = async () => {\n const [entitiesToRedo, entitiesToInherit, callbacks] = redoHistory() || []\n\n if (entitiesToRedo && entitiesToRedo.length > 0) {\n try {\n await handleUpdateEntities(entitiesToRedo, false)\n } catch (error) {\n toast.error('Failed to redo changes')\n }\n }\n if (entitiesToInherit && entitiesToInherit.length > 0) {\n try {\n await inheritFromParent(entitiesToInherit, false)\n } catch (error) {\n toast.error('Failed to inherit changes')\n }\n }\n // Execute custom callbacks if any\n if (callbacks && callbacks.length > 0) {\n callbacks.forEach((callback) => {\n try {\n callback()\n } catch (error) {\n toast.error('Failed to execute custom redo action')\n }\n })\n }\n }\n\n // Handle clearing cells\n const handleClear = useCallback(\n async (cells: CellId[]) => {\n // we explicity update the value of the cells to their default values\n const entityUpdates: EntityUpdate[] = []\n // of if they are inheritable, we inherit from the parent entity\n const entityInheriting: InheritFromParentEntity[] = []\n\n for (const cellId of cells) {\n const { colId, rowId } = parseCellId(cellId) || {}\n if (!colId || !rowId) {\n console.warn(`Invalid cellId: ${cellId}`)\n continue\n }\n\n // get the entity from the rowId\n const entity = getEntityById(rowId)\n\n if (!entity) return\n\n // get the field name and check if it is an attribute\n const fieldName = colId.replace('attrib_', '')\n const isAttrib = colId.startsWith('attrib_')\n\n if (!fieldName) {\n console.warn(`Invalid column ID: ${colId}`)\n continue\n }\n\n let defaultValue: any = null\n if (isAttrib) {\n // find default value for the attribute\n const attribField = attribFields.find((f) => f.name === fieldName)\n if (!attribField) {\n console.warn(`Attribute field not found: ${fieldName}`)\n continue\n }\n // check if the attribute is inheritable\n if (attribField.data.inherit) {\n // inherit from parent entity\n // check if this entity has already been added to the inheriting list\n const existingInherit = entityInheriting.find((e) => e.entityId === entity.entityId)\n if (existingInherit) {\n // add the attrib to the existing entity\n existingInherit.attribs.push(fieldName)\n } else {\n // add a new entity to the inheriting list\n entityInheriting.push({\n entityId: entity.entityId,\n attribs: [fieldName],\n entityType: entity.entityType,\n ownAttrib: entity.ownAttrib || [],\n rowId: rowId,\n folderId:\n entity.entityType === 'folder'\n ? entity.parentId\n : entity.entityType === 'task'\n ? entity.folderId\n : undefined,\n })\n }\n continue\n } else {\n // set explicit default value\n defaultValue = attribField.data.default || getTypeDefaultValue(attribField.data.type)\n }\n } else if (fieldName === 'assignees') {\n // for assignees, we set it to an empty array\n defaultValue = getTypeDefaultValue('list_of_strings')\n } else if (fieldName === 'tags') {\n // for tags, we set it to an empty array\n defaultValue = getTypeDefaultValue('list_of_strings')\n } else {\n // we ignore other fields\n console.warn(`Field not editable: ${fieldName}`)\n continue\n }\n\n // create the entity update\n const update: EntityUpdate = {\n id: rowId,\n rowId: rowId,\n field: fieldName,\n value: defaultValue,\n isAttrib,\n type: entity.entityType,\n }\n\n entityUpdates.push(update)\n }\n\n // if we have updates, call the updateEntities function\n if (entityUpdates.length > 0) {\n try {\n await handleUpdateEntities(entityUpdates, true)\n } catch (error) {\n toast.error('Failed to clear selected cells')\n console.error('Error clearing selected cells:', error)\n }\n }\n\n // if we have inheritable attributes, call inheritFromParent\n if (entityInheriting.length > 0) {\n try {\n await inheritFromParent(entityInheriting, true)\n } catch (error) {\n toast.error('Failed to inherit parent values for cleared cells')\n console.error('Error clearing inherited cells:', error)\n }\n }\n\n // if nothing was done, warn the user\n if (entityUpdates.length === 0 && entityInheriting.length === 0) {\n toast.warn('No valid cells selected to clear')\n }\n },\n [attribFields, updateOverviewEntities],\n )\n\n const value = useMemo(\n () => ({\n editingCellId,\n setEditingCellId,\n isEditing,\n updateEntities: handleUpdateEntities,\n inheritFromParent,\n undo: handleUndo,\n redo: handleRedo,\n history,\n }),\n [\n editingCellId,\n isEditing,\n handleUpdateEntities,\n inheritFromParent,\n handleUndo,\n handleRedo,\n history,\n ],\n )\n\n // Listen for shortcuts\n // undo - ctrl + z\n // redo - ctrl + y or ctrl + shift + z\n // clear - backspace or delete\n useEffect(() => {\n const onKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement\n if (\n target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.isContentEditable ||\n target.getAttribute('role') === 'textbox' ||\n target.tagName === 'LI'\n ) {\n return\n }\n\n const isMac =\n typeof navigator !== 'undefined' &&\n // @ts-expect-error\n ((navigator.userAgentData &&\n // @ts-expect-error\n navigator.userAgentData.platform.toUpperCase().includes('MAC')) ||\n navigator.userAgent.toUpperCase().includes('MAC'))\n const ctrlKey = isMac ? e.metaKey : e.ctrlKey\n\n // undo\n if (ctrlKey && e.key === 'z') {\n e.preventDefault()\n if (canUndo) handleUndo()\n }\n // redo\n if (\n (ctrlKey && e.key === 'y') ||\n (ctrlKey && e.shiftKey && e.key === 'z') ||\n (ctrlKey && e.key === 'Z')\n ) {\n e.preventDefault()\n if (canRedo) handleRedo()\n }\n // clear\n if (e.key === 'Backspace' || e.key === 'Delete') {\n // check we have cells selected\n if (!selectedCells.size) return\n e.preventDefault()\n\n // find selected cells elements\n const selectedCellElements = Array.from(selectedCells).map((cellId) =>\n document.getElementById(cellId),\n )\n\n // check the cell is editable from the classnames\n const isEditable = (cell: HTMLElement | null) => cell?.classList.contains('editable')\n\n // filter out non-editable cells\n const editableCells = selectedCellElements.filter(isEditable)\n if (editableCells.length === 0) {\n toast.warn('No editable cells selected to clear')\n return\n }\n // clear the selected cells\n handleClear(editableCells.map((cell) => cell?.id).filter(Boolean) as CellId[])\n }\n }\n\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [canUndo, canRedo, handleUndo, handleRedo, selectedCells, handleClear])\n\n return <CellEditingContext.Provider value={value}>{children}</CellEditingContext.Provider>\n}\n"],"names":["CellEditingProvider","children","editingCellId","setEditingCellId","useState","isEditing","useCallback","id","history","useHistory","pushHistory","undoHistory","redoHistory","canUndo","canRedo","selectedCells","useSelectionCellsContext","updateOverviewEntities","inheritFromParent","useUpdateTableData","attribFields","getEntityById","useProjectTableContext","handleUpdateEntities","entities","pushToHistory","validateUpdateEntities","error","toast","handleUndo","entitiesToUndo","entitiesToInherit","callbacks","callback","handleRedo","entitiesToRedo","handleClear","cells","entityUpdates","entityInheriting","cellId","colId","rowId","parseCellId","entity","fieldName","isAttrib","defaultValue","attribField","f","existingInherit","e","getTypeDefaultValue","update","value","useMemo","useEffect","onKeyDown","target","ctrlKey","selectedCellElements","isEditable","cell","editableCells","jsx","CellEditingContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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brC,KAAoBoB,EAAA,IAGtBiB,EAAE,QAAQ,eAAeA,EAAE,QAAQ,UAAU;AAE3C,YAAA,CAACpC,EAAc,KAAM;AACzB,QAAAoC,EAAE,eAAe;AAGjB,cAAMS,IAAuB,MAAM,KAAK7C,CAAa,EAAE;AAAA,UAAI,CAACyB,MAC1D,SAAS,eAAeA,CAAM;AAAA,QAChC,GAGMqB,IAAa,CAACC,MAA6BA,KAAA,gBAAAA,EAAM,UAAU,SAAS,aAGpEC,IAAgBH,EAAqB,OAAOC,CAAU;AACxD,YAAAE,EAAc,WAAW,GAAG;AAC9B,UAAAnC,EAAM,KAAK,qCAAqC;AAChD;AAAA,QAAA;AAGU,QAAAQ,EAAA2B,EAAc,IAAI,CAACD,MAASA,KAAA,gBAAAA,EAAM,EAAE,EAAE,OAAO,OAAO,CAAa;AAAA,MAAA;AAAA,IAEjF;AAES,oBAAA,iBAAiB,WAAWL,CAAS,GACvC,MAAM,SAAS,oBAAoB,WAAWA,CAAS;AAAA,EAAA,GAC7D,CAAC5C,GAASC,GAASe,GAAYK,GAAYnB,GAAeqB,CAAW,CAAC,GAEjE4B,gBAAAA,EAAAA,IAAAC,EAAmB,UAAnB,EAA4B,OAAAX,GAAe,UAAArD,EAAS,CAAA;AAC9D;"}
|
|
1
|
+
{"version":3,"file":"CellEditingProvider.es.js","sources":["../../../../../../src/containers/ProjectTreeTable/context/CellEditingProvider.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { CellId, getTypeDefaultValue, parseCellId } from '../utils'\nimport useHistory from '../hooks/useHistory'\nimport { useSelectionCellsContext } from './SelectionCellsContext'\nimport useUpdateTableData, {\n EntityUpdate,\n InheritFromParentEntity,\n UpdateTableEntities,\n} from '../hooks/useUpdateTableData'\nimport { useProjectTableContext } from './ProjectTableContext'\nimport validateUpdateEntities from '../utils/validateUpdateEntities'\nimport { toast } from 'react-toastify'\nimport { CellEditingContext } from './CellEditingContext'\n\nexport const CellEditingProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const [editingCellId, setEditingCellId] = useState<CellId | null>(null)\n\n // Memoize these functions to prevent unnecessary re-renders\n const isEditing = useCallback((id: CellId) => id === editingCellId, [editingCellId])\n\n // Get history functions\n const history = useHistory()\n const { pushHistory, undo: undoHistory, redo: redoHistory, canUndo, canRedo } = history\n\n const { selectedCells } = useSelectionCellsContext()\n const { updateEntities: updateOverviewEntities, inheritFromParent } = useUpdateTableData({\n pushHistory,\n })\n const { attribFields, getEntityById } = useProjectTableContext()\n\n const handleUpdateEntities: UpdateTableEntities = useCallback(\n async (entities = [], pushToHistory = true) => {\n try {\n // validate the entities before updating\n validateUpdateEntities(entities, attribFields)\n\n // if validation passes, update the entities\n return await updateOverviewEntities(entities, pushToHistory)\n } catch (error: any) {\n // if validation fails, show a toast and return\n toast.error(error.message)\n\n return Promise.reject(error)\n }\n },\n [updateOverviewEntities, attribFields],\n )\n\n // Handle undo\n const handleUndo = async () => {\n const [entitiesToUndo, entitiesToInherit, callbacks] = undoHistory() || []\n\n if (entitiesToUndo && entitiesToUndo.length > 0) {\n try {\n await handleUpdateEntities(entitiesToUndo, false)\n } catch (error) {\n toast.error('Failed to undo changes')\n }\n }\n if (entitiesToInherit && entitiesToInherit.length > 0) {\n try {\n await inheritFromParent(entitiesToInherit, false)\n } catch (error) {\n toast.error('Failed to inherit changes')\n }\n }\n // Execute custom callbacks if any\n if (callbacks && callbacks.length > 0) {\n callbacks.forEach((callback) => {\n try {\n callback()\n } catch (error) {\n toast.error('Failed to execute custom undo action')\n }\n })\n }\n }\n\n // Handle redo\n const handleRedo = async () => {\n const [entitiesToRedo, entitiesToInherit, callbacks] = redoHistory() || []\n\n if (entitiesToRedo && entitiesToRedo.length > 0) {\n try {\n await handleUpdateEntities(entitiesToRedo, false)\n } catch (error) {\n toast.error('Failed to redo changes')\n }\n }\n if (entitiesToInherit && entitiesToInherit.length > 0) {\n try {\n await inheritFromParent(entitiesToInherit, false)\n } catch (error) {\n toast.error('Failed to inherit changes')\n }\n }\n // Execute custom callbacks if any\n if (callbacks && callbacks.length > 0) {\n callbacks.forEach((callback) => {\n try {\n callback()\n } catch (error) {\n toast.error('Failed to execute custom redo action')\n }\n })\n }\n }\n\n // Handle clearing cells\n const handleClear = useCallback(\n async (cells: CellId[]) => {\n // we explicity update the value of the cells to their default values\n const entityUpdates: EntityUpdate[] = []\n // of if they are inheritable, we inherit from the parent entity\n const entityInheriting: InheritFromParentEntity[] = []\n\n for (const cellId of cells) {\n const { colId, rowId } = parseCellId(cellId) || {}\n if (!colId || !rowId) {\n console.warn(`Invalid cellId: ${cellId}`)\n continue\n }\n\n // get the entity from the rowId\n const entity = getEntityById(rowId)\n\n if (!entity) return\n\n // get the field name and check if it is an attribute\n const fieldName = colId.replace('attrib_', '')\n const isAttrib = colId.startsWith('attrib_')\n\n if (!fieldName) {\n console.warn(`Invalid column ID: ${colId}`)\n continue\n }\n\n let defaultValue: any = null\n if (isAttrib) {\n // find default value for the attribute\n const attribField = attribFields.find((f) => f.name === fieldName)\n if (!attribField) {\n console.warn(`Attribute field not found: ${fieldName}`)\n continue\n }\n // check if the attribute is inheritable\n if (attribField.data.inherit) {\n // inherit from parent entity\n // check if this entity has already been added to the inheriting list\n const existingInherit = entityInheriting.find((e) => e.entityId === entity.entityId)\n if (existingInherit) {\n // add the attrib to the existing entity\n existingInherit.attribs.push(fieldName)\n } else {\n // add a new entity to the inheriting list\n entityInheriting.push({\n entityId: entity.entityId,\n attribs: [fieldName],\n entityType: entity.entityType,\n ownAttrib: entity.ownAttrib || [],\n rowId: rowId,\n folderId:\n entity.entityType === 'folder'\n ? entity.parentId\n : entity.entityType === 'task'\n ? entity.folderId\n : undefined,\n })\n }\n continue\n } else {\n // set explicit default value\n defaultValue = attribField.data.default || getTypeDefaultValue(attribField.data.type)\n }\n } else if (fieldName === 'assignees') {\n // for assignees, we set it to an empty array\n defaultValue = getTypeDefaultValue('list_of_strings')\n } else if (fieldName === 'tags') {\n // for tags, we set it to an empty array\n defaultValue = getTypeDefaultValue('list_of_strings')\n } else {\n // we ignore other fields\n console.warn(`Field not editable: ${fieldName}`)\n continue\n }\n\n // create the entity update\n const update: EntityUpdate = {\n id: rowId,\n rowId: rowId,\n field: fieldName,\n value: defaultValue,\n isAttrib,\n type: entity.entityType,\n }\n\n entityUpdates.push(update)\n }\n\n // if we have updates, call the updateEntities function\n if (entityUpdates.length > 0) {\n try {\n await handleUpdateEntities(entityUpdates, true)\n } catch (error) {\n toast.error('Failed to clear selected cells')\n console.error('Error clearing selected cells:', error)\n }\n }\n\n // if we have inheritable attributes, call inheritFromParent\n if (entityInheriting.length > 0) {\n try {\n await inheritFromParent(entityInheriting, true)\n } catch (error) {\n toast.error('Failed to inherit parent values for cleared cells')\n console.error('Error clearing inherited cells:', error)\n }\n }\n\n // if nothing was done, warn the user\n if (entityUpdates.length === 0 && entityInheriting.length === 0) {\n toast.warn('No valid cells selected to clear')\n }\n },\n [attribFields, updateOverviewEntities],\n )\n\n const value = useMemo(\n () => ({\n editingCellId,\n setEditingCellId,\n isEditing,\n updateEntities: handleUpdateEntities,\n inheritFromParent,\n undo: handleUndo,\n redo: handleRedo,\n history,\n }),\n [\n editingCellId,\n isEditing,\n handleUpdateEntities,\n inheritFromParent,\n handleUndo,\n handleRedo,\n history,\n ],\n )\n\n // Listen for shortcuts\n // undo - ctrl + z\n // redo - ctrl + y or ctrl + shift + z\n // clear - backspace or delete\n useEffect(() => {\n const onKeyDown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement\n if (\n target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.isContentEditable ||\n target.getAttribute('role') === 'textbox' ||\n target.tagName === 'LI'\n ) {\n return\n }\n\n const isMac =\n typeof navigator !== 'undefined' &&\n // @ts-expect-error\n ((navigator.userAgentData &&\n // @ts-expect-error\n navigator.userAgentData.platform.toUpperCase().includes('MAC')) ||\n navigator.userAgent.toUpperCase().includes('MAC'))\n const ctrlKey = isMac ? e.metaKey : e.ctrlKey\n\n // undo\n if (ctrlKey && e.key === 'z') {\n e.preventDefault()\n if (canUndo) handleUndo()\n }\n // redo\n if (\n (ctrlKey && e.key === 'y') ||\n (ctrlKey && e.shiftKey && e.key === 'z') ||\n (ctrlKey && e.key === 'Z')\n ) {\n e.preventDefault()\n if (canRedo) handleRedo()\n }\n // clear\n if ((e.key === 'Backspace' && !(e.ctrlKey || e.metaKey)) || e.key === 'Delete') {\n // check we have cells selected\n if (!selectedCells.size) return\n e.preventDefault()\n\n // find selected cells elements\n const selectedCellElements = Array.from(selectedCells).map((cellId) =>\n document.getElementById(cellId),\n )\n\n // check the cell is editable from the classnames\n const isEditable = (cell: HTMLElement | null) => cell?.classList.contains('editable')\n\n // filter out non-editable cells\n const editableCells = selectedCellElements.filter(isEditable)\n if (editableCells.length === 0) {\n toast.warn('No editable cells selected to clear')\n return\n }\n // clear the selected cells\n handleClear(editableCells.map((cell) => cell?.id).filter(Boolean) as CellId[])\n }\n }\n\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [canUndo, canRedo, handleUndo, handleRedo, selectedCells, handleClear])\n\n return <CellEditingContext.Provider value={value}>{children}</CellEditingContext.Provider>\n}\n"],"names":["CellEditingProvider","children","editingCellId","setEditingCellId","useState","isEditing","useCallback","id","history","useHistory","pushHistory","undoHistory","redoHistory","canUndo","canRedo","selectedCells","useSelectionCellsContext","updateOverviewEntities","inheritFromParent","useUpdateTableData","attribFields","getEntityById","useProjectTableContext","handleUpdateEntities","entities","pushToHistory","validateUpdateEntities","error","toast","handleUndo","entitiesToUndo","entitiesToInherit","callbacks","callback","handleRedo","entitiesToRedo","handleClear","cells","entityUpdates","entityInheriting","cellId","colId","rowId","parseCellId","entity","fieldName","isAttrib","defaultValue","attribField","f","existingInherit","e","getTypeDefaultValue","update","value","useMemo","useEffect","onKeyDown","target","ctrlKey","selectedCellElements","isEditable","cell","editableCells","jsx","CellEditingContext"],"mappings":";;;;;;;;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KAAoBgB,EAAA,KAIvB8B,KAAWR,EAAE,QAAQ,OACrBQ,KAAWR,EAAE,YAAYA,EAAE,QAAQ,OACnCQ,KAAWR,EAAE,QAAQ,SAEtBA,EAAE,eAAe,GACbrC,KAAoBoB,EAAA,IAGrBiB,EAAE,QAAQ,eAAe,EAAEA,EAAE,WAAWA,EAAE,YAAaA,EAAE,QAAQ,UAAU;AAE1E,YAAA,CAACpC,EAAc,KAAM;AACzB,QAAAoC,EAAE,eAAe;AAGjB,cAAMS,IAAuB,MAAM,KAAK7C,CAAa,EAAE;AAAA,UAAI,CAACyB,MAC1D,SAAS,eAAeA,CAAM;AAAA,QAChC,GAGMqB,IAAa,CAACC,MAA6BA,KAAA,gBAAAA,EAAM,UAAU,SAAS,aAGpEC,IAAgBH,EAAqB,OAAOC,CAAU;AACxD,YAAAE,EAAc,WAAW,GAAG;AAC9B,UAAAnC,EAAM,KAAK,qCAAqC;AAChD;AAAA,QAAA;AAGU,QAAAQ,EAAA2B,EAAc,IAAI,CAACD,MAASA,KAAA,gBAAAA,EAAM,EAAE,EAAE,OAAO,OAAO,CAAa;AAAA,MAAA;AAAA,IAEjF;AAES,oBAAA,iBAAiB,WAAWL,CAAS,GACvC,MAAM,SAAS,oBAAoB,WAAWA,CAAS;AAAA,EAAA,GAC7D,CAAC5C,GAASC,GAASe,GAAYK,GAAYnB,GAAeqB,CAAW,CAAC,GAEjE4B,gBAAAA,EAAAA,IAAAC,EAAmB,UAAnB,EAA4B,OAAAX,GAAe,UAAArD,EAAS,CAAA;AAC9D;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const x=require("react");require("../../../api/base/client.cjs.js");require("../../../api/generated/graphql.cjs.js");require("../../../api/generated/graphqlLinks.cjs.js");require("../../../api/generated/access.cjs.js");require("../../../api/generated/actions.cjs.js");require("../../../api/generated/activityFeed.cjs.js");require("../../../api/generated/addons.cjs.js");require("../../../api/generated/anatomy.cjs.js");require("../../../api/generated/attributes.cjs.js");require("../../../api/generated/authentication.cjs.js");require("../../../api/generated/bundles.cjs.js");require("../../../api/generated/configuration.cjs.js");require("../../../api/generated/desktop.cjs.js");require("../../../api/generated/entityLists.cjs.js");require("../../../api/generated/events.cjs.js");require("../../../api/generated/files.cjs.js");require("../../../api/generated/folders.cjs.js");require("../../../api/generated/inbox.cjs.js");require("../../../api/generated/links.cjs.js");require("../../../api/generated/market.cjs.js");require("../../../api/generated/onboarding.cjs.js");require("../../../api/generated/operations.cjs.js");require("../../../api/generated/products.cjs.js");require("../../../api/generated/projectDashboard.cjs.js");require("../../../api/generated/projects.cjs.js");require("../../../api/generated/reviewables.cjs.js");require("../../../api/generated/services.cjs.js");require("../../../api/generated/system.cjs.js");require("../../../api/generated/tasks.cjs.js");require("../../../api/generated/teams.cjs.js");require("../../../api/generated/thumbnails.cjs.js");require("../../../api/generated/uRIs.cjs.js");require("../../../api/generated/users.cjs.js");require("../../../api/generated/versions.cjs.js");require("../../../api/generated/workfiles.cjs.js");require("../../../api/generated/ynputCloud.cjs.js");require("../../../api/generated/grouping.cjs.js");require("../../../api/generated/views.cjs.js");require("../../../api/queries/actions/getActions.cjs.js");require("../../../api/queries/activities/getActivities.cjs.js");require("../../../api/queries/activities/updateActivities.cjs.js");require("../../../api/queries/activities/updateReaction.cjs.js");require("../../../api/queries/activities/getMentions.cjs.js");require("../../../api/queries/addons/getAddons.cjs.js");require("../../../api/queries/addons/updateAddons.cjs.js");require("../../../api/queries/attributes/getAttributes.cjs.js");require("../../../api/queries/attributes/updateAttributes.cjs.js");require("../../../api/queries/authentication/getAuthentication.cjs.js");require("../../../api/queries/cloud/cloud.cjs.js");require("../../../api/queries/entities/getEntity.cjs.js");require("../../../api/queries/entities/getEntityPanel.cjs.js");require("../../../api/queries/entities/updateEntity.cjs.js");require("../../../api/queries/entityLists/getLists.cjs.js");require("../../../api/queries/entityLists/updateLists.cjs.js");require("../../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../../api/queries/folders/getFolders.cjs.js");require("../../../api/queries/grouping/getGrouping.cjs.js");const L=require("../../../api/queries/links/updateLinks.cjs.js");require("../../../api/queries/links/getLinks.cjs.js");require("../../../api/queries/links/getEntityLinks.cjs.js");require("../../../api/queries/overview/getOverview.cjs.js");require("../../../api/queries/overview/updateOverview.cjs.js");require("../../../api/queries/permissions/getPermissions.cjs.js");require("../../../api/queries/products/createProduct.cjs.js");require("../../../api/queries/project/getProject.cjs.js");require("../../../api/queries/project/updateProject.cjs.js");require("../../../api/queries/review/getReview.cjs.js");require("../../../api/queries/review/updateReview.cjs.js");require("../../../api/queries/share/share.cjs.js");require("../../../api/queries/system/getSystem.cjs.js");require("../../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../../api/queries/users/getUsers.cjs.js");require("../../../api/queries/users/updateUsers.cjs.js");require("../../../api/queries/versions/updateVersions.cjs.js");require("../../../api/queries/views/getViews.cjs.js");require("../../../api/queries/views/updateViews.cjs.js");require("../../../api/queries/watchers/getWatchers.cjs.js");const m=require("../../../components/LinksManager/utils/linkUpdates.cjs.js"),A=require("../context/ProjectTableContext.cjs.js");require("lodash");require("react-toastify");const P=require("../../../util/getEntityId.cjs.js");require("../../../util/pubsub.cjs.js");const M=C=>{const{getEntityById:k,projectName:w}=A.useProjectTableContext(),u=w,[T]=L.useDeleteEntityLinkMutation(),[g]=L.useCreateEntityLinkMutation();return{pasteTableLinks:x.useCallback(async E=>{if(!u||!E.length)return;const s=new Map;for(const i of E){const t=`${i.sourceEntityId}-${i.linkType}-${i.direction}`;s.has(t)||s.set(t,[]),s.get(t).push(i)}const d=[];for(const[i,t]of s){const b=t[0],{sourceEntityId:n,sourceEntityType:p,linkType:o,direction:q,targetEntityType:c,operation:h}=b,l=new Set;t.forEach(e=>{e.targetEntityIds.forEach(r=>l.add(r))});const a=[],f=[],I=k(n);if(!I){console.warn(`Entity not found: ${n}`);continue}const y=I.links;if(h==="replace"){if(Array.isArray(y))for(const e of y)e.entityType===c&&e.direction===q&&e.linkType===o.split("|")[0]&&f.push({id:e.id,target:{entityId:e.node.id,entityType:e.entityType},source:{entityId:n,entityType:p},linkType:o,direction:q,projectName:u});for(const e of l){const r=P.getEntityId();a.push({targetEntityId:e,linkId:r,sourceEntityId:n,sourceEntityType:p,targetEntityType:c,linkType:o,direction:q,projectName:u})}}else if(h==="merge"){const e=new Set;Array.isArray(y)&&y.forEach(r=>{r.entityType===c&&r.direction===q&&r.linkType===o&&e.add(r.node.id)}),console.log(e);for(const r of l)if(!e.has(r)){const j=P.getEntityId();a.push({targetEntityId:r,linkId:j,sourceEntityId:n,sourceEntityType:p,targetEntityType:c,linkType:o,direction:q,projectName:u})}}f.length>0&&d.push(m.removeMultipleLinks(f,T)),a.length>0&&d.push(m.addMultipleLinks(a,g))}try{await Promise.all(d)}catch(i){throw i}},[u,k,T,g])}};module.exports=M;
|
|
1
|
+
"use strict";const N=require("react");require("../../../api/base/client.cjs.js");require("../../../api/generated/graphql.cjs.js");require("../../../api/generated/graphqlLinks.cjs.js");require("../../../api/generated/access.cjs.js");require("../../../api/generated/actions.cjs.js");require("../../../api/generated/activityFeed.cjs.js");require("../../../api/generated/addons.cjs.js");require("../../../api/generated/anatomy.cjs.js");require("../../../api/generated/attributes.cjs.js");require("../../../api/generated/authentication.cjs.js");require("../../../api/generated/bundles.cjs.js");require("../../../api/generated/configuration.cjs.js");require("../../../api/generated/desktop.cjs.js");require("../../../api/generated/entityLists.cjs.js");require("../../../api/generated/events.cjs.js");require("../../../api/generated/files.cjs.js");require("../../../api/generated/folders.cjs.js");require("../../../api/generated/inbox.cjs.js");require("../../../api/generated/links.cjs.js");require("../../../api/generated/market.cjs.js");require("../../../api/generated/onboarding.cjs.js");require("../../../api/generated/operations.cjs.js");require("../../../api/generated/products.cjs.js");require("../../../api/generated/projectDashboard.cjs.js");require("../../../api/generated/projects.cjs.js");require("../../../api/generated/reviewables.cjs.js");require("../../../api/generated/services.cjs.js");require("../../../api/generated/system.cjs.js");require("../../../api/generated/tasks.cjs.js");require("../../../api/generated/teams.cjs.js");require("../../../api/generated/thumbnails.cjs.js");require("../../../api/generated/uRIs.cjs.js");require("../../../api/generated/users.cjs.js");require("../../../api/generated/versions.cjs.js");require("../../../api/generated/workfiles.cjs.js");require("../../../api/generated/ynputCloud.cjs.js");require("../../../api/generated/grouping.cjs.js");require("../../../api/generated/views.cjs.js");require("../../../api/queries/actions/getActions.cjs.js");require("../../../api/queries/activities/getActivities.cjs.js");require("../../../api/queries/activities/updateActivities.cjs.js");require("../../../api/queries/activities/updateReaction.cjs.js");require("../../../api/queries/activities/getMentions.cjs.js");require("../../../api/queries/addons/getAddons.cjs.js");require("../../../api/queries/addons/updateAddons.cjs.js");require("../../../api/queries/attributes/getAttributes.cjs.js");require("../../../api/queries/attributes/updateAttributes.cjs.js");require("../../../api/queries/authentication/getAuthentication.cjs.js");require("../../../api/queries/cloud/cloud.cjs.js");require("../../../api/queries/entities/getEntity.cjs.js");require("../../../api/queries/entities/getEntityPanel.cjs.js");require("../../../api/queries/entities/updateEntity.cjs.js");require("../../../api/queries/entityLists/getLists.cjs.js");require("../../../api/queries/entityLists/updateLists.cjs.js");require("../../../api/queries/entityLists/getListsAttributes.cjs.js");require("../../../api/queries/entityLists/updateListsAttributes.cjs.js");require("../../../api/queries/folders/getFolders.cjs.js");require("../../../api/queries/grouping/getGrouping.cjs.js");const M=require("../../../api/queries/links/updateLinks.cjs.js");require("../../../api/queries/links/getLinks.cjs.js");require("../../../api/queries/links/getEntityLinks.cjs.js");require("../../../api/queries/overview/getOverview.cjs.js");require("../../../api/queries/overview/updateOverview.cjs.js");require("../../../api/queries/permissions/getPermissions.cjs.js");require("../../../api/queries/products/createProduct.cjs.js");require("../../../api/queries/project/getProject.cjs.js");require("../../../api/queries/project/updateProject.cjs.js");require("../../../api/queries/review/getReview.cjs.js");require("../../../api/queries/review/updateReview.cjs.js");require("../../../api/queries/share/share.cjs.js");require("../../../api/queries/system/getSystem.cjs.js");require("../../../api/queries/userDashboard/getUserDashboard.cjs.js");require("../../../api/queries/users/getUsers.cjs.js");require("../../../api/queries/users/updateUsers.cjs.js");require("../../../api/queries/versions/updateVersions.cjs.js");require("../../../api/queries/views/getViews.cjs.js");require("../../../api/queries/views/updateViews.cjs.js");require("../../../api/queries/watchers/getWatchers.cjs.js");const o=require("../../../components/LinksManager/utils/linkUpdates.cjs.js"),x=require("../context/ProjectTableContext.cjs.js");require("lodash");const A=require("react-toastify"),b=require("../../../util/getEntityId.cjs.js");require("../../../util/pubsub.cjs.js");require("../../ContextMenu/ContextMenuContext.cjs.js");require("../../../../../_virtual/jsx-runtime.cjs.js");require("@ynput/ayon-react-components");;/* empty css */require("clsx");require("react-dom");require("../../Feed/context/FeedContext.cjs.js");require("../../Feed/components/Tooltips/UserTooltip/UserTooltip.styled.cjs.js");require("../../Feed/components/Tooltips/EntityTooltip/EntityTooltip.styled.cjs.js");require("../../Feed/components/FileUploadPreview/FileUploadPreview.styled.cjs.js");require("../../Feed/components/FileUploadPreview/Mimes/TextMime.cjs.js");require("react-markdown");require("remark-emoji");require("remark-gfm");require("remark-directive");require("remark-directive-rehype");require("../../Feed/components/CommentInput/CommentInput.cjs.js");require("../../Feed/components/ReactionContainer/Reactions.styled.cjs.js");require("../../Feed/components/FilesGrid/FilesGrid.styled.cjs.js");require("../../Feed/components/FileUploadCard/FileUploadCard.styled.cjs.js");require("../../../context/RemoteModulesContext.cjs.js");require("../../../context/DetailsPanelContext.cjs.js");require("../../../context/ThumbnailUploaderContext.cjs.js");require("../../../context/SettingsPanelContext.cjs.js");require("../../../context/pip/PiPProvider.cjs.js");require("../../../context/pip/PiPWrapper.cjs.js");require("../../../context/AddonProjectContext.cjs.js");require("../../../context/AddonContext.cjs.js");require("../../../context/PowerpackContext.cjs.js");require("../../../context/MoveEntityContext.cjs.js");require("../../Feed/components/CommentInput/quillToMarkdown.cjs.js");require("../../Feed/components/ActivityComment/ActivityComment.styled.cjs.js");require("../../Feed/components/ActivityCheckbox/ActivityCheckbox.styled.cjs.js");require("../../Feed/components/ActivityReference/ActivityReference.styled.cjs.js");require("react-router-dom");require("../../Feed/components/ActivityStatus/ActivityStatus.cjs.js");require("../../Feed/components/ActivityHeader/ActivityHeader.styled.cjs.js");require("../../Feed/components/ActivityDate.cjs.js");require("../../Feed/components/ActivityStatusChange/ActivityStatusChange.styled.cjs.js");require("../../Feed/components/ActivityAssigneeChange/ActivityAssigneeChange.styled.cjs.js");require("../../Feed/components/ActivityVersions/ActivityVersions.styled.cjs.js");require("../../Feed/components/ActivityGroup/ActivityGroup.styled.cjs.js");require("../../Feed/Feed.styled.cjs.js");require("date-fns");require("../../../components/EmptyPlaceholder/EmptyPlaceholder.cjs.js");require("../../../components/EmptyPlaceholder/EmptyPlaceholderFlex.styled.cjs.js");require("../ProjectTreeTable.cjs.js");const R=require("../context/CellEditingContext.cjs.js");require("@tanstack/react-table");require("../widgets/CollapsedWidget.cjs.js");require("../widgets/DateWidget.cjs.js");require("../widgets/EnumWidget.cjs.js");require("../widgets/TextWidget.cjs.js");require("../widgets/BooleanWidget.cjs.js");require("../widgets/CellWidget.cjs.js");require("../widgets/EntityNameWidget.cjs.js");require("../widgets/GroupHeaderWidget.cjs.js");require("../widgets/ThumbnailWidget.cjs.js");require("../../../components/ThumbnailSimple/ThumbnailSimple.cjs.js");require("@dnd-kit/core");require("@dnd-kit/sortable");require("../../../components/ReviewablesList/ReviewablesList.styled.cjs.js");require("../../../components/ReviewablesList/ReviewablesUpload.styled.cjs.js");require("axios");require("../../../components/ReviewableCard/ReviewableCard.cjs.js");require("../../../components/ReviewableProgressCard/ReviewableProgressCard.styled.cjs.js");require("../../../components/FileThumbnail/FileThumbnail.cjs.js");require("../../../components/Thumbnail/Thumbnail.styled.cjs.js");require("../../../components/Thumbnail/StackedThumbnails.cjs.js");require("../../../components/EntityPanelUploader/EntityPanelUploader.styled.cjs.js");require("../../../components/SimpleFormDialog/SimpleFormDialog.cjs.js");require("../../../components/EntityPath/EntityPath.styled.cjs.js");require("../../../components/EntityPath/SegmentProvider.cjs.js");require("../../../components/DetailsPanelAttributes/DetailsPanelAttributesEditor.cjs.js");require("../../../../../_virtual/runtime.cjs.js");require("../../../../../_virtual/semver.cjs.js");require("react-redux");require("custom-protocol-check");require("../../../components/Watchers/Watchers.cjs.js");require("../../../components/ProjectTableSettings/ProjectTableSettings.cjs.js");require("../../../components/Powerpack/PowerpackButton.cjs.js");require("../../../components/Powerpack/PricingLink.cjs.js");require("../../../components/Powerpack/PowerpackDialog.styled.cjs.js");require("../../../components/Powerpack/CTAButton.cjs.js");require("../../../components/SettingsPanel/SettingsPanel.cjs.js");require("../../../components/SettingsPanel/SettingsPanelItemTemplate.cjs.js");require("../../../components/AttributeEditor/components/MinMaxField.cjs.js");require("../../../components/EnumEditor/EnumEditor.styled.cjs.js");require("../../../components/SearchFilter/filterDates.cjs.js");require("../../../components/Badge/Badge.cjs.js");require("../../../components/VersionUploader/components/UploadVersionDialog.cjs.js");require("../../../components/VersionUploader/context/VersionUploadContext.cjs.js");require("../../../components/Feedback/FeedbackContext.cjs.js");require("../../../components/Feedback/SupportBubble.cjs.js");require("../../../components/Chips/Chips.cjs.js");require("../../../components/LinksManager/LinksManager.styled.cjs.js");require("../../EntityPickerDialog/EntityPickerDialog.cjs.js");require("../../../components/LinksManager/LinksManagerDialog.cjs.js");require("../context/DetailsPanelEntityContext.cjs.js");require("../context/SelectedRowsContext.cjs.js");require("../ProjectTreeTable.styled.cjs.js");require("../components/SelectionCell.cjs.js");require("../components/RowSelectionHeader.cjs.js");require("../context/SelectionCellsContext.cjs.js");require("../widgets/LoadMoreWidget.cjs.js");require("../context/ProjectTableQueriesContext.cjs.js");require("../context/ClipboardContext.cjs.js");require("../context/ColumnSettingsContext.cjs.js");require("../components/GroupSettingsFallback.cjs.js");require("../context/ProjectDataContext.cjs.js");require("../components/HeaderActionButton.cjs.js");require("../components/ColumnHeaderMenu.cjs.js");require("../../DetailsPanel/DetailsPanel.styled.cjs.js");require("../../DetailsPanel/FeedFilters/FeedFilters.styled.cjs.js");require("../../DetailsPanel/DetailsPanelHeader/DetailsPanelHeader.styled.cjs.js");require("../../../components/PlayableIcon/PlayableIcon.cjs.js");require("../../DetailsPanel/DetailsPanelFiles/DetailsPanelFiles.cjs.js");require("../../DetailsPanel/DetailsPanelSlideOut/DetailsPanelSlideOut.styled.cjs.js");require("../../DetailsPanel/DetailsPanelFloating/DetailsPanelFloating.styled.cjs.js");require("../../Actions/Actions.styled.cjs.js");require("../../Actions/ActionsDropdown/ActionsDropdown.cjs.js");require("../../Actions/ActionIcon.cjs.js");require("../../Views/context/ViewsContext.cjs.js");require("../../Views/Views.styled.cjs.js");require("../../Views/ViewsMenuContainer/ViewsMenuContainer.cjs.js");require("../../Views/ViewsMenu/ViewsMenu.cjs.js");require("uuid");const S=$=>{const{getEntityById:L,projectName:v}=x.useProjectTableContext(),s=v,{history:I}=R.useCellEditing(),[f]=M.useDeleteEntityLinkMutation(),[g]=M.useCreateEntityLinkMutation();return{pasteTableLinks:N.useCallback(async P=>{if(!s||!P.length)return;const c=new Map;for(const i of P){const u=`${i.sourceEntityId}-${i.linkType}-${i.direction}`;c.has(u)||c.set(u,[]),c.get(u).push(i)}const k=[],a=[],d=[];for(const[,i]of c){const{sourceEntityId:u}=i[0],n=new Set;if(i.forEach(q=>q.targetEntityIds.forEach(e=>n.add(e))),n.has(u)){A.toast.error("You can't link an entity to itself");return}}for(const[i,u]of c){const n=u[0],{sourceEntityId:q,sourceEntityType:e,linkType:y,direction:p,targetEntityType:h,operation:j}=n,m=new Set;u.forEach(r=>{r.targetEntityIds.forEach(t=>m.add(t))});const l=[],T=[],C=L(q);if(!C){console.warn(`Entity not found: ${q}`);continue}const E=C.links;if(j==="replace"){if(Array.isArray(E))for(const r of E)r.entityType===h&&r.direction===p&&r.linkType===y.split("|")[0]&&T.push({id:r.id,target:{entityId:r.node.id,entityType:r.entityType},source:{entityId:q,entityType:e},linkType:y,direction:p,projectName:s});for(const r of m){const t=b.getEntityId();l.push({targetEntityId:r,linkId:t,sourceEntityId:q,sourceEntityType:e,targetEntityType:h,linkType:y,direction:p,projectName:s})}}else if(j==="merge"){const r=new Set;Array.isArray(E)&&E.forEach(t=>{t.entityType===h&&t.direction===p&&t.linkType===y&&r.add(t.node.id)}),console.log(r);for(const t of m)if(!r.has(t)){const w=b.getEntityId();l.push({targetEntityId:t,linkId:w,sourceEntityId:q,sourceEntityType:e,targetEntityType:h,linkType:y,direction:p,projectName:s})}}T.length>0&&(k.push(o.removeMultipleLinks(T,f)),d.push(...T)),l.length>0&&(k.push(o.addMultipleLinks(l,g)),a.push(...l))}try{if(await Promise.all(k),I&&(a.length>0||d.length>0)){const i=a.map(e=>({id:e.linkId,projectName:e.projectName,linkType:e.linkType,direction:e.direction,target:{entityId:e.targetEntityId,entityType:e.targetEntityType},source:{entityId:e.sourceEntityId,entityType:e.sourceEntityType}})),u=d.map(e=>({targetEntityId:e.target.entityId,linkId:e.id,sourceEntityId:e.source.entityId,sourceEntityType:e.source.entityType,targetEntityType:e.target.entityType,linkType:e.linkType,direction:e.direction,projectName:e.projectName})),n=()=>{const e=[];i.length&&e.push(o.removeMultipleLinks(i,f)),u.length&&e.push(o.addMultipleLinks(u,g)),e.length&&Promise.all(e).catch(()=>{})},q=()=>{const e=[];d.length&&e.push(o.removeMultipleLinks(d,f)),a.length&&e.push(o.addMultipleLinks(a,g)),e.length&&Promise.all(e).catch(()=>{})};I.pushHistory([n],[q])}}catch(i){throw i}},[s,L,f,g,I])}};module.exports=S;
|
|
2
2
|
//# sourceMappingURL=usePasteLinks.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePasteLinks.cjs.js","sources":["../../../../../../src/containers/ProjectTreeTable/hooks/usePasteLinks.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { useCreateEntityLinkMutation, useDeleteEntityLinkMutation } from '@shared/api'\nimport {\n addMultipleLinks,\n removeMultipleLinks,\n LinkToAdd,\n LinkToRemove,\n} from '@shared/components/LinksManager/utils/linkUpdates'\nimport { useProjectTableContext } from '../context/ProjectTableContext'\nimport { getEntityId } from '@shared/util'\nimport { PasteMethod } from '../context'\n\n/**\n * Represents a link update operation for table links\n */\nexport type LinkUpdate = {\n /** Row ID in the table */\n rowId: string\n /** ID of the source entity (the entity that will have links) */\n sourceEntityId: string\n /** Type of the source entity (e.g., 'folder', 'task') */\n sourceEntityType: string\n /** Type of link (e.g., 'workflow', 'dependency') */\n linkType: string\n /** Direction of the link from source entity perspective */\n direction: 'in' | 'out'\n /** Type of the target entities that will be linked */\n targetEntityType: string\n /**\n * Operation type:\n * - 'replace': Remove all existing links of this type and add new ones\n * - 'merge': Keep existing links and add new ones (skip duplicates)\n */\n operation: PasteMethod\n /** Array of target entity IDs to link to */\n targetEntityIds: string[]\n}\n\nexport type PasteTableLinks = (linkUpdates: LinkUpdate[]) => Promise<void>\n\ninterface usePasteLinksProps {\n projectName?: string\n}\n\nconst usePasteLinks = (props?: usePasteLinksProps) => {\n const { getEntityById, projectName: contextProjectName } = useProjectTableContext()\n const projectName = props?.projectName || contextProjectName\n\n // Add mutation hooks for link operations\n const [deleteLink] = useDeleteEntityLinkMutation()\n const [addLink] = useCreateEntityLinkMutation()\n\n // Handle link updates using the utility functions\n const pasteTableLinks = useCallback<PasteTableLinks>(\n async (linkUpdates: LinkUpdate[]) => {\n if (!projectName || !linkUpdates.length) return\n\n // Group operations by entity and link type for processing\n const operationsToProcess = new Map<string, LinkUpdate[]>()\n\n for (const update of linkUpdates) {\n const key = `${update.sourceEntityId}-${update.linkType}-${update.direction}`\n if (!operationsToProcess.has(key)) {\n operationsToProcess.set(key, [])\n }\n operationsToProcess.get(key)!.push(update)\n }\n\n const updatePromises: Promise<void>[] = []\n // Process each unique entity-linkType-direction combination\n for (const [key, updates] of operationsToProcess) {\n const firstUpdate = updates[0]\n const {\n sourceEntityId,\n sourceEntityType,\n linkType,\n direction,\n targetEntityType,\n operation,\n } = firstUpdate\n\n // Collect all target entity IDs from all updates for this combination\n const allTargetEntityIds = new Set<string>()\n updates.forEach((update) => {\n update.targetEntityIds.forEach((id) => allTargetEntityIds.add(id))\n })\n\n const linksToAdd: LinkToAdd[] = []\n const linksToRemove: LinkToRemove[] = []\n\n // Get current links for this entity and link type\n const entityData = getEntityById(sourceEntityId)\n if (!entityData) {\n console.warn(`Entity not found: ${sourceEntityId}`)\n continue\n }\n\n // Get current links for this link type and direction\n const currentLinks = entityData.links\n\n if (operation === 'replace') {\n // Remove all current links of this (linkType + direction + targetEntityType) only.\n if (Array.isArray(currentLinks)) {\n for (const link of currentLinks) {\n if (\n link.entityType === targetEntityType &&\n link.direction === direction &&\n link.linkType === linkType.split('|')[0]\n ) {\n linksToRemove.push({\n id: link.id,\n target: {\n entityId: link.node.id,\n entityType: link.entityType,\n },\n source: { entityId: sourceEntityId, entityType: sourceEntityType },\n linkType,\n direction,\n projectName,\n })\n }\n }\n }\n\n // Add all new links\n for (const targetEntityId of allTargetEntityIds) {\n const linkId = getEntityId()\n\n linksToAdd.push({\n targetEntityId,\n linkId,\n sourceEntityId,\n sourceEntityType,\n targetEntityType,\n linkType,\n direction,\n projectName,\n })\n }\n } else if (operation === 'merge') {\n // Get existing target entity IDs for this (linkType + direction + targetEntityType)\n const existingTargetIds = new Set<string>()\n if (Array.isArray(currentLinks)) {\n currentLinks.forEach((link) => {\n if (\n link.entityType === targetEntityType &&\n link.direction === direction &&\n link.linkType === linkType\n ) {\n existingTargetIds.add(link.node.id)\n }\n })\n }\n\n console.log(existingTargetIds)\n\n // Only add links that don't already exist\n for (const targetEntityId of allTargetEntityIds) {\n if (!existingTargetIds.has(targetEntityId)) {\n const linkId = getEntityId()\n\n linksToAdd.push({\n targetEntityId,\n linkId,\n sourceEntityId,\n sourceEntityType,\n targetEntityType,\n linkType,\n direction,\n projectName,\n })\n }\n }\n }\n\n if (linksToRemove.length > 0) {\n updatePromises.push(removeMultipleLinks(linksToRemove, deleteLink))\n }\n if (linksToAdd.length > 0) {\n updatePromises.push(addMultipleLinks(linksToAdd, addLink))\n }\n }\n try {\n // Execute all link operations in parallel\n await Promise.all(updatePromises)\n } catch (error) {\n throw error\n }\n },\n [projectName, getEntityById, deleteLink, addLink],\n )\n\n return { pasteTableLinks }\n}\n\nexport default usePasteLinks\n"],"names":["usePasteLinks","props","getEntityById","contextProjectName","useProjectTableContext","projectName","deleteLink","useDeleteEntityLinkMutation","addLink","useCreateEntityLinkMutation","useCallback","linkUpdates","operationsToProcess","update","key","updatePromises","updates","firstUpdate","sourceEntityId","sourceEntityType","linkType","direction","targetEntityType","operation","allTargetEntityIds","id","linksToAdd","linksToRemove","entityData","currentLinks","link","targetEntityId","linkId","getEntityId","existingTargetIds","removeMultipleLinks","addMultipleLinks","error"],"mappings":"0hJA4CM,MAAAA,EAAiBC,GAA+B,CACpD,KAAM,CAAE,cAAAC,EAAe,YAAaC,CAAA,EAAuBC,EAAAA,uBAAuB,EAC5EC,EAAoCF,EAGpC,CAACG,CAAU,EAAIC,8BAA4B,EAC3C,CAACC,CAAO,EAAIC,8BAA4B,EA8I9C,MAAO,CAAE,gBA3IeC,EAAA,YACtB,MAAOC,GAA8B,CACnC,GAAI,CAACN,GAAe,CAACM,EAAY,OAAQ,OAGnC,MAAAC,MAA0B,IAEhC,UAAWC,KAAUF,EAAa,CAC1B,MAAAG,EAAM,GAAGD,EAAO,cAAc,IAAIA,EAAO,QAAQ,IAAIA,EAAO,SAAS,GACtED,EAAoB,IAAIE,CAAG,GACVF,EAAA,IAAIE,EAAK,EAAE,EAEjCF,EAAoB,IAAIE,CAAG,EAAG,KAAKD,CAAM,CAAA,CAG3C,MAAME,EAAkC,CAAC,EAEzC,SAAW,CAACD,EAAKE,CAAO,IAAKJ,EAAqB,CAC1C,MAAAK,EAAcD,EAAQ,CAAC,EACvB,CACJ,eAAAE,EACA,iBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,UAAAC,CAAA,EACEN,EAGEO,MAAyB,IACvBR,E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A,eAAAd,EACA,iBAAAC,EACA,iBAAAG,EACA,SAAAF,EACA,UAAAC,EACA,YAAAhB,CAAA,CACD,CAAA,CAEL,CAGEsB,EAAc,OAAS,GACzBZ,EAAe,KAAKoB,EAAAA,oBAAoBR,EAAerB,CAAU,CAAC,EAEhEoB,EAAW,OAAS,GACtBX,EAAe,KAAKqB,EAAAA,iBAAiBV,EAAYlB,CAAO,CAAC,CAC3D,CAEE,GAAA,CAEI,MAAA,QAAQ,IAAIO,CAAc,QACzBsB,EAAO,CACR,MAAAA,CAAA,CAEV,EACA,CAAChC,EAAaH,EAAeI,EAAYE,CAAO,CAClD,CAEyB,CAC3B"}
|
|
1
|
+
{"version":3,"file":"usePasteLinks.cjs.js","sources":["../../../../../../src/containers/ProjectTreeTable/hooks/usePasteLinks.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { useCreateEntityLinkMutation, useDeleteEntityLinkMutation } from '@shared/api'\nimport {\n addMultipleLinks,\n removeMultipleLinks,\n LinkToAdd,\n LinkToRemove,\n} from '@shared/components/LinksManager/utils/linkUpdates'\nimport { useProjectTableContext } from '../context/ProjectTableContext'\nimport { getEntityId } from '@shared/util'\nimport { PasteMethod } from '../context'\nimport { useCellEditing } from '@shared/containers'\nimport { toast } from 'react-toastify'\n\n/**\n * Represents a link update operation for table links\n */\nexport type LinkUpdate = {\n /** Row ID in the table */\n rowId: string\n /** ID of the source entity (the entity that will have links) */\n sourceEntityId: string\n /** Type of the source entity (e.g., 'folder', 'task') */\n sourceEntityType: string\n /** Type of link (e.g., 'workflow', 'dependency') */\n linkType: string\n /** Direction of the link from source entity perspective */\n direction: 'in' | 'out'\n /** Type of the target entities that will be linked */\n targetEntityType: string\n /**\n * Operation type:\n * - 'replace': Remove all existing links of this type and add new ones\n * - 'merge': Keep existing links and add new ones (skip duplicates)\n */\n operation: PasteMethod\n /** Array of target entity IDs to link to */\n targetEntityIds: string[]\n}\n\nexport type PasteTableLinks = (linkUpdates: LinkUpdate[]) => Promise<void>\n\ninterface usePasteLinksProps {\n projectName?: string\n}\n\nconst usePasteLinks = (props?: usePasteLinksProps) => {\n const { getEntityById, projectName: contextProjectName } = useProjectTableContext()\n const projectName = props?.projectName || contextProjectName\n const { history } = useCellEditing()\n\n // Add mutation hooks for link operations\n const [deleteLink] = useDeleteEntityLinkMutation()\n const [addLink] = useCreateEntityLinkMutation()\n\n // Handle link updates using the utility functions\n const pasteTableLinks = useCallback<PasteTableLinks>(\n async (linkUpdates: LinkUpdate[]) => {\n if (!projectName || !linkUpdates.length) return\n\n // Group operations by entity and link type for processing\n const operationsToProcess = new Map<string, LinkUpdate[]>()\n\n for (const update of linkUpdates) {\n const key = `${update.sourceEntityId}-${update.linkType}-${update.direction}`\n if (!operationsToProcess.has(key)) {\n operationsToProcess.set(key, [])\n }\n operationsToProcess.get(key)!.push(update)\n }\n\n const updatePromises: Promise<void>[] = []\n // Collect all adds/removes across all operations to build a single history entry\n const addedInPaste: LinkToAdd[] = []\n const removedInPaste: LinkToRemove[] = []\n\n // Pre-flight validation: detect any self-referential links across the whole paste\n for (const [, updates] of operationsToProcess) {\n const { sourceEntityId } = updates[0]\n const targets = new Set<string>()\n updates.forEach((u) => u.targetEntityIds.forEach((id) => targets.add(id)))\n if (targets.has(sourceEntityId)) {\n toast.error(\"You can't link an entity to itself\")\n return\n }\n }\n // Process each unique entity-linkType-direction combination\n for (const [key, updates] of operationsToProcess) {\n const firstUpdate = updates[0]\n const {\n sourceEntityId,\n sourceEntityType,\n linkType,\n direction,\n targetEntityType,\n operation,\n } = firstUpdate\n\n // Collect all target entity IDs from all updates for this combination\n const allTargetEntityIds = new Set<string>()\n updates.forEach((update) => {\n update.targetEntityIds.forEach((id) => allTargetEntityIds.add(id))\n })\n\n const linksToAdd: LinkToAdd[] = []\n const linksToRemove: LinkToRemove[] = []\n\n // Get current links for this entity and link type\n const entityData = getEntityById(sourceEntityId)\n if (!entityData) {\n console.warn(`Entity not found: ${sourceEntityId}`)\n continue\n }\n\n // Get current links for this link type and direction\n const currentLinks = entityData.links\n\n if (operation === 'replace') {\n // Remove all current links of this (linkType + direction + targetEntityType) only.\n if (Array.isArray(currentLinks)) {\n for (const link of currentLinks) {\n if (\n link.entityType === targetEntityType &&\n link.direction === direction &&\n link.linkType === linkType.split('|')[0]\n ) {\n linksToRemove.push({\n id: link.id,\n target: {\n entityId: link.node.id,\n entityType: link.entityType,\n },\n source: { entityId: sourceEntityId, entityType: sourceEntityType },\n linkType,\n direction,\n projectName,\n })\n }\n }\n }\n\n // Add all new links\n for (const targetEntityId of allTargetEntityIds) {\n const linkId = getEntityId()\n\n linksToAdd.push({\n targetEntityId,\n linkId,\n sourceEntityId,\n sourceEntityType,\n targetEntityType,\n linkType,\n direction,\n projectName,\n })\n }\n } else if (operation === 'merge') {\n // Get existing target entity IDs for this (linkType + direction + targetEntityType)\n const existingTargetIds = new Set<string>()\n if (Array.isArray(currentLinks)) {\n currentLinks.forEach((link) => {\n if (\n link.entityType === targetEntityType &&\n link.direction === direction &&\n link.linkType === linkType\n ) {\n existingTargetIds.add(link.node.id)\n }\n })\n }\n\n console.log(existingTargetIds)\n\n // Only add links that don't already exist\n for (const targetEntityId of allTargetEntityIds) {\n if (!existingTargetIds.has(targetEntityId)) {\n const linkId = getEntityId()\n\n linksToAdd.push({\n targetEntityId,\n linkId,\n sourceEntityId,\n sourceEntityType,\n targetEntityType,\n linkType,\n direction,\n projectName,\n })\n }\n }\n }\n\n if (linksToRemove.length > 0) {\n updatePromises.push(removeMultipleLinks(linksToRemove, deleteLink))\n removedInPaste.push(...linksToRemove)\n }\n if (linksToAdd.length > 0) {\n updatePromises.push(addMultipleLinks(linksToAdd, addLink))\n addedInPaste.push(...linksToAdd)\n }\n }\n try {\n // Execute all link operations in parallel\n await Promise.all(updatePromises)\n\n // Push a single history entry that undoes BOTH: remove added links and re-add removed links\n if (history && (addedInPaste.length > 0 || removedInPaste.length > 0)) {\n // Prepare inverse operations for undo\n const addedToRemove: LinkToRemove[] = addedInPaste.map((link) => ({\n id: link.linkId,\n projectName: link.projectName,\n linkType: link.linkType,\n direction: link.direction,\n target: { entityId: link.targetEntityId, entityType: link.targetEntityType },\n source: { entityId: link.sourceEntityId, entityType: link.sourceEntityType },\n }))\n\n const removedToAdd: LinkToAdd[] = removedInPaste.map((link) => ({\n targetEntityId: link.target.entityId,\n linkId: link.id,\n sourceEntityId: link.source.entityId,\n sourceEntityType: link.source.entityType,\n targetEntityType: link.target.entityType,\n linkType: link.linkType,\n direction: link.direction,\n projectName: link.projectName,\n }))\n\n // Single callbacks to keep history atomic\n const undoCallback = () => {\n const tasks: Promise<void>[] = []\n if (addedToRemove.length) tasks.push(removeMultipleLinks(addedToRemove, deleteLink))\n if (removedToAdd.length) tasks.push(addMultipleLinks(removedToAdd, addLink))\n if (tasks.length) Promise.all(tasks).catch(() => {})\n }\n\n const redoCallback = () => {\n const tasks: Promise<void>[] = []\n if (removedInPaste.length) tasks.push(removeMultipleLinks(removedInPaste, deleteLink))\n if (addedInPaste.length) tasks.push(addMultipleLinks(addedInPaste, addLink))\n if (tasks.length) Promise.all(tasks).catch(() => {})\n }\n\n history.pushHistory([undoCallback], [redoCallback])\n }\n } catch (error) {\n throw error\n }\n },\n [projectName, getEntityById, deleteLink, addLink, history],\n )\n\n return { pasteTableLinks }\n}\n\nexport default usePasteLinks\n"],"names":["usePasteLinks","props","getEntityById","contextProjectName","useProjectTableContext","projectName","history","useCellEditing","deleteLink","useDeleteEntityLinkMutation","addLink","useCreateEntityLinkMutation","useCallback","linkUpdates","operationsToProcess","update","key","updatePromises","addedInPaste","removedInPaste","updates","sourceEntityId","targets","u","id","toast","firstUpdate","sourceEntityType","linkType","direction","targetEntityType","operation","allTargetEntityIds","linksToAdd","linksToRemove","entityData","currentLinks","link","targetEntityId","linkId","getEntityId","existingTargetIds","removeMultipleLinks","addMultipleLinks","addedToRemove","removedToAdd","undoCallback","tasks","redoCallback","error"],"mappings":"mpXA8CM,MAAAA,EAAiBC,GAA+B,CACpD,KAAM,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