@uipath/apollo-react 3.69.1 → 3.70.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.
@@ -81,6 +81,9 @@ const StageNodeInner = (props)=>{
81
81
  const tasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.some((t)=>!t.isAdhoc)), [
82
82
  allTasks
83
83
  ]);
84
+ const adhocGroups = (0, external_react_namespaceObject.useMemo)(()=>allTasks.filter((group)=>group.every((t)=>t.isAdhoc)), [
85
+ allTasks
86
+ ]);
84
87
  const adhocTasks = (0, external_react_namespaceObject.useMemo)(()=>allTasks.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
85
88
  task,
86
89
  groupIndex,
@@ -241,6 +244,23 @@ const StageNodeInner = (props)=>{
241
244
  isStageTitleEditing
242
245
  ]);
243
246
  const hasContextMenu = !!(onReplaceTaskFromToolbox || onTaskGroupModification);
247
+ const handleTaskRegroup = (0, external_react_namespaceObject.useCallback)((groupModificationType, groupIndex, taskIndex)=>{
248
+ if (onTaskReorder && (groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP || groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_DOWN)) {
249
+ const mover = groupModificationType === GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP ? GroupModificationUtils_cjs_namespaceObject.moveGroupUp : GroupModificationUtils_cjs_namespaceObject.moveGroupDown;
250
+ const reordered = mover(tasks, groupIndex, taskIndex);
251
+ onTaskReorder([
252
+ ...reordered,
253
+ ...adhocGroups
254
+ ]);
255
+ return;
256
+ }
257
+ onTaskGroupModification?.(groupModificationType, groupIndex, taskIndex);
258
+ }, [
259
+ onTaskReorder,
260
+ onTaskGroupModification,
261
+ tasks,
262
+ adhocGroups
263
+ ]);
244
264
  const buildContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex)=>{
245
265
  const taskGroup = tasks[groupIndex] ?? [];
246
266
  const isParallel = taskGroup.length > 1;
@@ -259,7 +279,7 @@ const StageNodeInner = (props)=>{
259
279
  items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
260
280
  }
261
281
  if (onTaskGroupModification) {
262
- const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, onTaskGroupModification, hideParallelOptions);
282
+ const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, handleTaskRegroup, hideParallelOptions);
263
283
  return [
264
284
  ...items,
265
285
  ...reGroupOptions
@@ -271,7 +291,8 @@ const StageNodeInner = (props)=>{
271
291
  onTaskClick,
272
292
  onTaskGroupModification,
273
293
  tasks,
274
- hideParallelOptions
294
+ hideParallelOptions,
295
+ handleTaskRegroup
275
296
  ]);
276
297
  const getAdhocContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex, taskId)=>{
277
298
  const items = [];
@@ -437,12 +458,16 @@ const StageNodeInner = (props)=>{
437
458
  if (activeTask && activeTask.depth === projection.depth) return;
438
459
  }
439
460
  const newTasks = (0, external_StageNode_utils_cjs_namespaceObject.reorderTasks)(tasks, active.id, over.id, projection.depth);
440
- onTaskReorder(newTasks);
461
+ onTaskReorder([
462
+ ...newTasks,
463
+ ...adhocGroups
464
+ ]);
441
465
  }, [
442
466
  tasks,
443
467
  onTaskReorder,
444
468
  offsetLeft,
445
- resetState
469
+ resetState,
470
+ adhocGroups
446
471
  ]);
447
472
  const handleDragCancel = (0, external_react_namespaceObject.useCallback)(()=>{
448
473
  resetState();
@@ -670,7 +695,7 @@ const StageNodeInner = (props)=>{
670
695
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_material_index_cjs_namespaceObject.ApTypography, {
671
696
  variant: apollo_core_namespaceObject.FontVariantToken.fontSizeSBold,
672
697
  color: "var(--uix-canvas-foreground-de-emp)",
673
- children: "Adhoc tasks"
698
+ children: "Ad hoc tasks"
674
699
  })
675
700
  }),
676
701
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAsvBxD,eAAO,MAAM,SAAS,8CAluBS,cAAc,6CAkuBA,CAAC"}
1
+ {"version":3,"file":"StageNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.tsx"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAsxBxD,eAAO,MAAM,SAAS,8CAlwBS,cAAc,6CAkwBA,CAAC"}
@@ -7,7 +7,7 @@ import { Position, useStore, useStoreApi } from "../../xyflow/react.js";
7
7
  import { ApIcon, ApIconButton, ApLink, ApTooltip, ApTypography } from "../../../material/index.js";
8
8
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
9
9
  import { EntryConditionIcon, ExitConditionIcon, ReturnToOriginIcon } from "../../icons/index.js";
10
- import { GroupModificationType } from "../../utils/GroupModificationUtils.js";
10
+ import { GroupModificationType, moveGroupDown, moveGroupUp } from "../../utils/GroupModificationUtils.js";
11
11
  import { useConnectedHandles } from "../BaseCanvas/ConnectedHandlesContext.js";
12
12
  import { useButtonHandles } from "../ButtonHandle/useButtonHandles.js";
13
13
  import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
@@ -53,6 +53,9 @@ const StageNodeInner = (props)=>{
53
53
  const tasks = useMemo(()=>allTasks.filter((group)=>group.some((t)=>!t.isAdhoc)), [
54
54
  allTasks
55
55
  ]);
56
+ const adhocGroups = useMemo(()=>allTasks.filter((group)=>group.every((t)=>t.isAdhoc)), [
57
+ allTasks
58
+ ]);
56
59
  const adhocTasks = useMemo(()=>allTasks.flatMap((group, groupIndex)=>group.map((task, taskIndex)=>({
57
60
  task,
58
61
  groupIndex,
@@ -213,6 +216,23 @@ const StageNodeInner = (props)=>{
213
216
  isStageTitleEditing
214
217
  ]);
215
218
  const hasContextMenu = !!(onReplaceTaskFromToolbox || onTaskGroupModification);
219
+ const handleTaskRegroup = useCallback((groupModificationType, groupIndex, taskIndex)=>{
220
+ if (onTaskReorder && (groupModificationType === GroupModificationType.TASK_GROUP_UP || groupModificationType === GroupModificationType.TASK_GROUP_DOWN)) {
221
+ const mover = groupModificationType === GroupModificationType.TASK_GROUP_UP ? moveGroupUp : moveGroupDown;
222
+ const reordered = mover(tasks, groupIndex, taskIndex);
223
+ onTaskReorder([
224
+ ...reordered,
225
+ ...adhocGroups
226
+ ]);
227
+ return;
228
+ }
229
+ onTaskGroupModification?.(groupModificationType, groupIndex, taskIndex);
230
+ }, [
231
+ onTaskReorder,
232
+ onTaskGroupModification,
233
+ tasks,
234
+ adhocGroups
235
+ ]);
216
236
  const buildContextMenuItems = useCallback((groupIndex, taskIndex)=>{
217
237
  const taskGroup = tasks[groupIndex] ?? [];
218
238
  const isParallel = taskGroup.length > 1;
@@ -231,7 +251,7 @@ const StageNodeInner = (props)=>{
231
251
  items.push(getDivider());
232
252
  }
233
253
  if (onTaskGroupModification) {
234
- const reGroupOptions = getContextMenuItems(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, onTaskGroupModification, hideParallelOptions);
254
+ const reGroupOptions = getContextMenuItems(isParallel, groupIndex, tasks.length, taskIndex, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1, handleTaskRegroup, hideParallelOptions);
235
255
  return [
236
256
  ...items,
237
257
  ...reGroupOptions
@@ -243,7 +263,8 @@ const StageNodeInner = (props)=>{
243
263
  onTaskClick,
244
264
  onTaskGroupModification,
245
265
  tasks,
246
- hideParallelOptions
266
+ hideParallelOptions,
267
+ handleTaskRegroup
247
268
  ]);
248
269
  const getAdhocContextMenuItems = useCallback((groupIndex, taskIndex, taskId)=>{
249
270
  const items = [];
@@ -409,12 +430,16 @@ const StageNodeInner = (props)=>{
409
430
  if (activeTask && activeTask.depth === projection.depth) return;
410
431
  }
411
432
  const newTasks = reorderTasks(tasks, active.id, over.id, projection.depth);
412
- onTaskReorder(newTasks);
433
+ onTaskReorder([
434
+ ...newTasks,
435
+ ...adhocGroups
436
+ ]);
413
437
  }, [
414
438
  tasks,
415
439
  onTaskReorder,
416
440
  offsetLeft,
417
- resetState
441
+ resetState,
442
+ adhocGroups
418
443
  ]);
419
444
  const handleDragCancel = useCallback(()=>{
420
445
  resetState();
@@ -642,7 +667,7 @@ const StageNodeInner = (props)=>{
642
667
  children: /*#__PURE__*/ jsx(ApTypography, {
643
668
  variant: FontVariantToken.fontSizeSBold,
644
669
  color: "var(--uix-canvas-foreground-de-emp)",
645
- children: "Adhoc tasks"
670
+ children: "Ad hoc tasks"
646
671
  })
647
672
  }),
648
673
  /*#__PURE__*/ jsx(StageTaskList, {
@@ -1288,6 +1288,14 @@ const initialTasks = [
1288
1288
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
1289
1289
  }
1290
1290
  ],
1291
+ [
1292
+ {
1293
+ id: 'task-7',
1294
+ label: 'Ad hoc - Manual Review',
1295
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {}),
1296
+ isAdhoc: true
1297
+ }
1298
+ ],
1291
1299
  [
1292
1300
  {
1293
1301
  id: 'task-3',
@@ -1300,6 +1308,14 @@ const initialTasks = [
1300
1308
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
1301
1309
  }
1302
1310
  ],
1311
+ [
1312
+ {
1313
+ id: 'task-8',
1314
+ label: 'Ad hoc - Exception Handling',
1315
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ProcessIcon, {}),
1316
+ isAdhoc: true
1317
+ }
1318
+ ],
1303
1319
  [
1304
1320
  {
1305
1321
  id: 'task-5',
@@ -1347,15 +1363,34 @@ const DraggableTaskReorderingStory = ()=>{
1347
1363
  }, [
1348
1364
  setNodes
1349
1365
  ]);
1366
+ const groupModificationHandlers = (0, external_react_namespaceObject.useMemo)(()=>(0, GroupModificationUtils_cjs_namespaceObject.createGroupModificationHandlers)(), []);
1367
+ const handleTaskGroupModification = (0, external_react_namespaceObject.useCallback)((groupModificationType, groupIndex, taskIndex)=>{
1368
+ const handler = (0, GroupModificationUtils_cjs_namespaceObject.getHandlerForModificationType)(groupModificationHandlers, groupModificationType);
1369
+ setNodes((nds)=>nds.map((node)=>'reorder-stage' === node.id ? {
1370
+ ...node,
1371
+ data: {
1372
+ ...node.data,
1373
+ stageDetails: {
1374
+ ...node.data.stageDetails,
1375
+ tasks: handler(node.data.stageDetails.tasks, groupIndex, taskIndex)
1376
+ }
1377
+ }
1378
+ } : node));
1379
+ }, [
1380
+ groupModificationHandlers,
1381
+ setNodes
1382
+ ]);
1350
1383
  const nodesWithHandler = (0, external_react_namespaceObject.useMemo)(()=>nodes.map((node)=>({
1351
1384
  ...node,
1352
1385
  data: {
1353
1386
  ...node.data,
1354
- onTaskReorder: handleTaskReorder
1387
+ onTaskReorder: handleTaskReorder,
1388
+ onTaskGroupModification: handleTaskGroupModification
1355
1389
  }
1356
1390
  })), [
1357
1391
  nodes,
1358
- handleTaskReorder
1392
+ handleTaskReorder,
1393
+ handleTaskGroupModification
1359
1394
  ]);
1360
1395
  const onConnect = (0, external_react_namespaceObject.useCallback)((connection)=>setEdges((eds)=>(0, react_cjs_namespaceObject.addEdge)(connection, eds)), [
1361
1396
  setEdges
@@ -1411,6 +1446,14 @@ const initialTasksForAddReplace = [
1411
1446
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
1412
1447
  }
1413
1448
  ],
1449
+ [
1450
+ {
1451
+ id: 'task-adhoc-1',
1452
+ label: 'Ad hoc - Manual Check',
1453
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
1454
+ isAdhoc: true
1455
+ }
1456
+ ],
1414
1457
  [
1415
1458
  {
1416
1459
  id: 'task-2',
@@ -1586,6 +1629,20 @@ const AddAndReplaceTasksStory = ()=>{
1586
1629
  groupModificationHandlers,
1587
1630
  setNodes
1588
1631
  ]);
1632
+ const handleTaskReorder = (0, external_react_namespaceObject.useCallback)((reorderedTasks)=>{
1633
+ setNodes((prevNodes)=>prevNodes.map((node)=>'add-replace-stage' === node.id ? {
1634
+ ...node,
1635
+ data: {
1636
+ ...node.data,
1637
+ stageDetails: {
1638
+ ...node.data.stageDetails,
1639
+ tasks: reorderedTasks
1640
+ }
1641
+ }
1642
+ } : node));
1643
+ }, [
1644
+ setNodes
1645
+ ]);
1589
1646
  const handleTaskClick = (0, external_react_namespaceObject.useCallback)((taskId)=>{
1590
1647
  setSelectedTaskId(taskId);
1591
1648
  }, []);
@@ -1630,6 +1687,7 @@ const AddAndReplaceTasksStory = ()=>{
1630
1687
  onAddTaskFromToolbox: handleAddTask,
1631
1688
  onReplaceTaskFromToolbox: handleReplaceTask,
1632
1689
  onTaskGroupModification: handleTaskGroupModification,
1690
+ onTaskReorder: handleTaskReorder,
1633
1691
  onTaskClick: handleTaskClick
1634
1692
  }
1635
1693
  } : node), [
@@ -1639,6 +1697,7 @@ const AddAndReplaceTasksStory = ()=>{
1639
1697
  handleAddTask,
1640
1698
  handleReplaceTask,
1641
1699
  handleTaskGroupModification,
1700
+ handleTaskReorder,
1642
1701
  handleTaskClick
1643
1702
  ]);
1644
1703
  const onConnect = (0, external_react_namespaceObject.useCallback)((connection)=>setEdges((eds)=>(0, react_cjs_namespaceObject.addEdge)(connection, eds)), [
@@ -2053,7 +2112,7 @@ const AddTaskLoading = {
2053
2112
  render: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AddTaskLoadingStory, {})
2054
2113
  };
2055
2114
  const AdhocTasks = {
2056
- name: 'Adhoc Tasks',
2115
+ name: 'Ad hoc Tasks',
2057
2116
  parameters: {
2058
2117
  nodes: [
2059
2118
  {
@@ -2071,7 +2130,7 @@ const AdhocTasks = {
2071
2130
  [
2072
2131
  {
2073
2132
  id: '1',
2074
- label: 'Adhoc - KYC Check',
2133
+ label: 'Ad hoc - KYC Check',
2075
2134
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
2076
2135
  isAdhoc: true
2077
2136
  }
@@ -2079,7 +2138,7 @@ const AdhocTasks = {
2079
2138
  [
2080
2139
  {
2081
2140
  id: '2',
2082
- label: 'Adhoc - Document Review',
2141
+ label: 'Ad hoc - Document Review',
2083
2142
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {}),
2084
2143
  isAdhoc: true
2085
2144
  }
@@ -2110,7 +2169,7 @@ const AdhocTasks = {
2110
2169
  [
2111
2170
  {
2112
2171
  id: '1',
2113
- label: 'Adhoc - Risk Assessment',
2172
+ label: 'Ad hoc - Risk Assessment',
2114
2173
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
2115
2174
  isAdhoc: true
2116
2175
  }
@@ -2118,7 +2177,7 @@ const AdhocTasks = {
2118
2177
  [
2119
2178
  {
2120
2179
  id: '2',
2121
- label: 'Adhoc - Compliance Review',
2180
+ label: 'Ad hoc - Compliance Review',
2122
2181
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {}),
2123
2182
  isAdhoc: true
2124
2183
  }
@@ -2160,13 +2219,13 @@ const AdhocTasks = {
2160
2219
  [
2161
2220
  {
2162
2221
  id: '1',
2163
- label: 'Adhoc - Verify Address',
2222
+ label: 'Ad hoc - Verify Address',
2164
2223
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
2165
2224
  isAdhoc: true
2166
2225
  },
2167
2226
  {
2168
2227
  id: '2',
2169
- label: 'Adhoc - Verify Identity',
2228
+ label: 'Ad hoc - Verify Identity',
2170
2229
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
2171
2230
  isAdhoc: true
2172
2231
  }
@@ -2174,7 +2233,7 @@ const AdhocTasks = {
2174
2233
  [
2175
2234
  {
2176
2235
  id: '3',
2177
- label: 'Adhoc - Bkgd Check',
2236
+ label: 'Ad hoc - Bkgd Check',
2178
2237
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {}),
2179
2238
  isAdhoc: true
2180
2239
  }
@@ -2182,7 +2241,7 @@ const AdhocTasks = {
2182
2241
  [
2183
2242
  {
2184
2243
  id: '4',
2185
- label: 'Adhoc - Review Docs',
2244
+ label: 'Ad hoc - Review Docs',
2186
2245
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {}),
2187
2246
  isAdhoc: true
2188
2247
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA2BvD,OAAO,EAAuB,KAAK,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AAiDjG,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,CA8C9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAmHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAqE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA6M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA8HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAmKpC,CAAC;AAsGF,eAAO,MAAM,uBAAuB,EAAE,KAMrC,CAAC;AA0UF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AA4GF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AAqJF,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA8LxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAiO3B,CAAC"}
1
+ {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA2BvD,OAAO,EAAuB,KAAK,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AAiDjG,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,CA8C9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAmHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAqE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA6M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA8HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAmKpC,CAAC;AAyIF,eAAO,MAAM,uBAAuB,EAAE,KAMrC,CAAC;AA0WF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AA4GF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AAqJF,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA8LxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAiO3B,CAAC"}
@@ -1249,6 +1249,14 @@ const initialTasks = [
1249
1249
  icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1250
1250
  }
1251
1251
  ],
1252
+ [
1253
+ {
1254
+ id: 'task-7',
1255
+ label: 'Ad hoc - Manual Review',
1256
+ icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
1257
+ isAdhoc: true
1258
+ }
1259
+ ],
1252
1260
  [
1253
1261
  {
1254
1262
  id: 'task-3',
@@ -1261,6 +1269,14 @@ const initialTasks = [
1261
1269
  icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1262
1270
  }
1263
1271
  ],
1272
+ [
1273
+ {
1274
+ id: 'task-8',
1275
+ label: 'Ad hoc - Exception Handling',
1276
+ icon: /*#__PURE__*/ jsx(ProcessIcon, {}),
1277
+ isAdhoc: true
1278
+ }
1279
+ ],
1264
1280
  [
1265
1281
  {
1266
1282
  id: 'task-5',
@@ -1308,15 +1324,34 @@ const DraggableTaskReorderingStory = ()=>{
1308
1324
  }, [
1309
1325
  setNodes
1310
1326
  ]);
1327
+ const groupModificationHandlers = useMemo(()=>createGroupModificationHandlers(), []);
1328
+ const handleTaskGroupModification = useCallback((groupModificationType, groupIndex, taskIndex)=>{
1329
+ const handler = getHandlerForModificationType(groupModificationHandlers, groupModificationType);
1330
+ setNodes((nds)=>nds.map((node)=>'reorder-stage' === node.id ? {
1331
+ ...node,
1332
+ data: {
1333
+ ...node.data,
1334
+ stageDetails: {
1335
+ ...node.data.stageDetails,
1336
+ tasks: handler(node.data.stageDetails.tasks, groupIndex, taskIndex)
1337
+ }
1338
+ }
1339
+ } : node));
1340
+ }, [
1341
+ groupModificationHandlers,
1342
+ setNodes
1343
+ ]);
1311
1344
  const nodesWithHandler = useMemo(()=>nodes.map((node)=>({
1312
1345
  ...node,
1313
1346
  data: {
1314
1347
  ...node.data,
1315
- onTaskReorder: handleTaskReorder
1348
+ onTaskReorder: handleTaskReorder,
1349
+ onTaskGroupModification: handleTaskGroupModification
1316
1350
  }
1317
1351
  })), [
1318
1352
  nodes,
1319
- handleTaskReorder
1353
+ handleTaskReorder,
1354
+ handleTaskGroupModification
1320
1355
  ]);
1321
1356
  const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
1322
1357
  setEdges
@@ -1372,6 +1407,14 @@ const initialTasksForAddReplace = [
1372
1407
  icon: /*#__PURE__*/ jsx(VerificationIcon, {})
1373
1408
  }
1374
1409
  ],
1410
+ [
1411
+ {
1412
+ id: 'task-adhoc-1',
1413
+ label: 'Ad hoc - Manual Check',
1414
+ icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
1415
+ isAdhoc: true
1416
+ }
1417
+ ],
1375
1418
  [
1376
1419
  {
1377
1420
  id: 'task-2',
@@ -1547,6 +1590,20 @@ const AddAndReplaceTasksStory = ()=>{
1547
1590
  groupModificationHandlers,
1548
1591
  setNodes
1549
1592
  ]);
1593
+ const handleTaskReorder = useCallback((reorderedTasks)=>{
1594
+ setNodes((prevNodes)=>prevNodes.map((node)=>'add-replace-stage' === node.id ? {
1595
+ ...node,
1596
+ data: {
1597
+ ...node.data,
1598
+ stageDetails: {
1599
+ ...node.data.stageDetails,
1600
+ tasks: reorderedTasks
1601
+ }
1602
+ }
1603
+ } : node));
1604
+ }, [
1605
+ setNodes
1606
+ ]);
1550
1607
  const handleTaskClick = useCallback((taskId)=>{
1551
1608
  setSelectedTaskId(taskId);
1552
1609
  }, []);
@@ -1591,6 +1648,7 @@ const AddAndReplaceTasksStory = ()=>{
1591
1648
  onAddTaskFromToolbox: handleAddTask,
1592
1649
  onReplaceTaskFromToolbox: handleReplaceTask,
1593
1650
  onTaskGroupModification: handleTaskGroupModification,
1651
+ onTaskReorder: handleTaskReorder,
1594
1652
  onTaskClick: handleTaskClick
1595
1653
  }
1596
1654
  } : node), [
@@ -1600,6 +1658,7 @@ const AddAndReplaceTasksStory = ()=>{
1600
1658
  handleAddTask,
1601
1659
  handleReplaceTask,
1602
1660
  handleTaskGroupModification,
1661
+ handleTaskReorder,
1603
1662
  handleTaskClick
1604
1663
  ]);
1605
1664
  const onConnect = useCallback((connection)=>setEdges((eds)=>addEdge(connection, eds)), [
@@ -2014,7 +2073,7 @@ const AddTaskLoading = {
2014
2073
  render: ()=>/*#__PURE__*/ jsx(AddTaskLoadingStory, {})
2015
2074
  };
2016
2075
  const AdhocTasks = {
2017
- name: 'Adhoc Tasks',
2076
+ name: 'Ad hoc Tasks',
2018
2077
  parameters: {
2019
2078
  nodes: [
2020
2079
  {
@@ -2032,7 +2091,7 @@ const AdhocTasks = {
2032
2091
  [
2033
2092
  {
2034
2093
  id: '1',
2035
- label: 'Adhoc - KYC Check',
2094
+ label: 'Ad hoc - KYC Check',
2036
2095
  icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2037
2096
  isAdhoc: true
2038
2097
  }
@@ -2040,7 +2099,7 @@ const AdhocTasks = {
2040
2099
  [
2041
2100
  {
2042
2101
  id: '2',
2043
- label: 'Adhoc - Document Review',
2102
+ label: 'Ad hoc - Document Review',
2044
2103
  icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2045
2104
  isAdhoc: true
2046
2105
  }
@@ -2071,7 +2130,7 @@ const AdhocTasks = {
2071
2130
  [
2072
2131
  {
2073
2132
  id: '1',
2074
- label: 'Adhoc - Risk Assessment',
2133
+ label: 'Ad hoc - Risk Assessment',
2075
2134
  icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2076
2135
  isAdhoc: true
2077
2136
  }
@@ -2079,7 +2138,7 @@ const AdhocTasks = {
2079
2138
  [
2080
2139
  {
2081
2140
  id: '2',
2082
- label: 'Adhoc - Compliance Review',
2141
+ label: 'Ad hoc - Compliance Review',
2083
2142
  icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2084
2143
  isAdhoc: true
2085
2144
  }
@@ -2121,13 +2180,13 @@ const AdhocTasks = {
2121
2180
  [
2122
2181
  {
2123
2182
  id: '1',
2124
- label: 'Adhoc - Verify Address',
2183
+ label: 'Ad hoc - Verify Address',
2125
2184
  icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2126
2185
  isAdhoc: true
2127
2186
  },
2128
2187
  {
2129
2188
  id: '2',
2130
- label: 'Adhoc - Verify Identity',
2189
+ label: 'Ad hoc - Verify Identity',
2131
2190
  icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2132
2191
  isAdhoc: true
2133
2192
  }
@@ -2135,7 +2194,7 @@ const AdhocTasks = {
2135
2194
  [
2136
2195
  {
2137
2196
  id: '3',
2138
- label: 'Adhoc - Bkgd Check',
2197
+ label: 'Ad hoc - Bkgd Check',
2139
2198
  icon: /*#__PURE__*/ jsx(VerificationIcon, {}),
2140
2199
  isAdhoc: true
2141
2200
  }
@@ -2143,7 +2202,7 @@ const AdhocTasks = {
2143
2202
  [
2144
2203
  {
2145
2204
  id: '4',
2146
- label: 'Adhoc - Review Docs',
2205
+ label: 'Ad hoc - Review Docs',
2147
2206
  icon: /*#__PURE__*/ jsx(DocumentIcon, {}),
2148
2207
  isAdhoc: true
2149
2208
  }
@@ -58,7 +58,7 @@ const external_useMarkdownShortcuts_cjs_namespaceObject = require("./useMarkdown
58
58
  const external_useScrollCapture_cjs_namespaceObject = require("./useScrollCapture.cjs");
59
59
  const minWidth = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
60
60
  const minHeight = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
61
- const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false })=>{
61
+ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, onContentChange, onColorChange, onResize })=>{
62
62
  const { updateNodeData, deleteElements } = (0, react_cjs_namespaceObject.useReactFlow)();
63
63
  const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(data.autoFocus ?? false);
64
64
  const [isResizing, setIsResizing] = (0, external_react_namespaceObject.useState)(false);
@@ -116,14 +116,18 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
116
116
  ]);
117
117
  const handleBlur = (0, external_react_namespaceObject.useCallback)(()=>{
118
118
  setIsEditing(false);
119
- if (localContent !== data.content) updateNodeData(id, {
120
- content: localContent
121
- });
119
+ if (localContent !== data.content) {
120
+ onContentChange?.(localContent);
121
+ updateNodeData(id, {
122
+ content: localContent
123
+ });
124
+ }
122
125
  }, [
123
126
  id,
124
127
  localContent,
125
128
  data.content,
126
- updateNodeData
129
+ updateNodeData,
130
+ onContentChange
127
131
  ]);
128
132
  const handleChange = (0, external_react_namespaceObject.useCallback)((e)=>{
129
133
  setLocalContent(e.target.value);
@@ -179,17 +183,22 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
179
183
  const handleResizeStart = (0, external_react_namespaceObject.useCallback)(()=>{
180
184
  setIsResizing(true);
181
185
  }, []);
182
- const handleResizeEnd = (0, external_react_namespaceObject.useCallback)(()=>{
186
+ const handleResizeEnd = (0, external_react_namespaceObject.useCallback)((_event, params)=>{
183
187
  setIsResizing(false);
184
- }, []);
188
+ onResize?.(params.width, params.height);
189
+ }, [
190
+ onResize
191
+ ]);
185
192
  const handleColorChange = (0, external_react_namespaceObject.useCallback)((newColor)=>{
193
+ onColorChange?.(newColor);
186
194
  updateNodeData(id, {
187
195
  color: newColor
188
196
  });
189
197
  setIsColorPickerOpen(false);
190
198
  }, [
191
199
  id,
192
- updateNodeData
200
+ updateNodeData,
201
+ onColorChange
193
202
  ]);
194
203
  const handleToggleColorPicker = (0, external_react_namespaceObject.useCallback)(()=>{
195
204
  setIsColorPickerOpen((prev)=>!prev);
@@ -1,9 +1,12 @@
1
1
  import type { NodeProps } from '../../xyflow/react.ts';
2
- import type { StickyNoteData } from './StickyNoteNode.types';
2
+ import type { StickyNoteColor, StickyNoteData } from './StickyNoteNode.types';
3
3
  export interface StickyNoteNodeProps extends NodeProps {
4
4
  data: StickyNoteData;
5
5
  placeholder?: string;
6
6
  renderPlaceholderOnSelect?: boolean;
7
+ onContentChange?: (content: string) => void;
8
+ onColorChange?: (color: StickyNoteColor) => void;
9
+ onResize?: (width: number, height: number) => void;
7
10
  }
8
- export declare const StickyNoteNode: import("react").MemoExoticComponent<({ id, data, selected, dragging, placeholder, renderPlaceholderOnSelect, }: StickyNoteNodeProps) => import("react/jsx-runtime").JSX.Element>;
11
+ export declare const StickyNoteNode: import("react").MemoExoticComponent<({ id, data, selected, dragging, placeholder, renderPlaceholderOnSelect, onContentChange, onColorChange, onResize, }: StickyNoteNodeProps) => import("react/jsx-runtime").JSX.Element>;
9
12
  //# sourceMappingURL=StickyNoteNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA8B1E,OAAO,KAAK,EAAmB,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAM7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AA6XD,eAAO,MAAM,cAAc,kHAjXxB,mBAAmB,6CAiXqC,CAAC"}
1
+ {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AA+B1E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAM7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAsYD,eAAO,MAAM,cAAc,4JAvXxB,mBAAmB,6CAuXqC,CAAC"}
@@ -18,7 +18,7 @@ import { useMarkdownShortcuts } from "./useMarkdownShortcuts.js";
18
18
  import { useScrollCapture } from "./useScrollCapture.js";
19
19
  const minWidth = 8 * GRID_SPACING;
20
20
  const minHeight = 8 * GRID_SPACING;
21
- const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false })=>{
21
+ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, onContentChange, onColorChange, onResize })=>{
22
22
  const { updateNodeData, deleteElements } = useReactFlow();
23
23
  const [isEditing, setIsEditing] = useState(data.autoFocus ?? false);
24
24
  const [isResizing, setIsResizing] = useState(false);
@@ -76,14 +76,18 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
76
76
  ]);
77
77
  const handleBlur = useCallback(()=>{
78
78
  setIsEditing(false);
79
- if (localContent !== data.content) updateNodeData(id, {
80
- content: localContent
81
- });
79
+ if (localContent !== data.content) {
80
+ onContentChange?.(localContent);
81
+ updateNodeData(id, {
82
+ content: localContent
83
+ });
84
+ }
82
85
  }, [
83
86
  id,
84
87
  localContent,
85
88
  data.content,
86
- updateNodeData
89
+ updateNodeData,
90
+ onContentChange
87
91
  ]);
88
92
  const handleChange = useCallback((e)=>{
89
93
  setLocalContent(e.target.value);
@@ -139,17 +143,22 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
139
143
  const handleResizeStart = useCallback(()=>{
140
144
  setIsResizing(true);
141
145
  }, []);
142
- const handleResizeEnd = useCallback(()=>{
146
+ const handleResizeEnd = useCallback((_event, params)=>{
143
147
  setIsResizing(false);
144
- }, []);
148
+ onResize?.(params.width, params.height);
149
+ }, [
150
+ onResize
151
+ ]);
145
152
  const handleColorChange = useCallback((newColor)=>{
153
+ onColorChange?.(newColor);
146
154
  updateNodeData(id, {
147
155
  color: newColor
148
156
  });
149
157
  setIsColorPickerOpen(false);
150
158
  }, [
151
159
  id,
152
- updateNodeData
160
+ updateNodeData,
161
+ onColorChange
153
162
  ]);
154
163
  const handleToggleColorPicker = useCallback(()=>{
155
164
  setIsColorPickerOpen((prev)=>!prev);
@@ -24,9 +24,10 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- WithBaseNodes: ()=>WithBaseNodes,
27
+ WithCallbacks: ()=>WithCallbacks,
28
+ Default: ()=>Default,
28
29
  default: ()=>StickyNoteNode_stories,
29
- Default: ()=>Default
30
+ WithBaseNodes: ()=>WithBaseNodes
30
31
  });
31
32
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
33
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
@@ -46,9 +47,42 @@ const meta = {
46
47
  ]
47
48
  };
48
49
  const StickyNoteNode_stories = meta;
50
+ const StickyNoteWithCallbacks = (props)=>{
51
+ const handleContentChange = (content)=>{
52
+ console.log('📝 Content changed:', {
53
+ nodeId: props.id,
54
+ content,
55
+ timestamp: new Date().toISOString()
56
+ });
57
+ };
58
+ const handleColorChange = (color)=>{
59
+ console.log('🎨 Color changed:', {
60
+ nodeId: props.id,
61
+ color,
62
+ timestamp: new Date().toISOString()
63
+ });
64
+ };
65
+ const handleResize = (width, height)=>{
66
+ console.log('📏 Resized:', {
67
+ nodeId: props.id,
68
+ width,
69
+ height,
70
+ timestamp: new Date().toISOString()
71
+ });
72
+ };
73
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_cjs_namespaceObject.StickyNoteNode, {
74
+ ...props,
75
+ onContentChange: handleContentChange,
76
+ onColorChange: handleColorChange,
77
+ onResize: handleResize
78
+ });
79
+ };
49
80
  const nodeTypes = {
50
81
  stickyNote: external_StickyNoteNode_cjs_namespaceObject.StickyNoteNode
51
82
  };
83
+ const nodeTypesWithCallbacks = {
84
+ stickyNote: StickyNoteWithCallbacks
85
+ };
52
86
  function createStickyNote(id, color, content, position, size = {
53
87
  width: 250,
54
88
  height: 150
@@ -469,18 +503,48 @@ function WithBaseNodesStory() {
469
503
  })
470
504
  });
471
505
  }
506
+ function WithCallbacksStory() {
507
+ const initialNodes = (0, external_react_namespaceObject.useMemo)(()=>[
508
+ createStickyNote('sticky-test-1', 'yellow', '**Test Callbacks!**\n\n1. Double-click to edit content\n2. Click the color button to change color\n3. Drag corners to resize\n\nOpen the browser console to see logs! 🔍', {
509
+ x: 480,
510
+ y: 480
511
+ }, {
512
+ width: 320,
513
+ height: 320
514
+ })
515
+ ], []);
516
+ const { canvasProps } = (0, index_cjs_namespaceObject.useCanvasStory)({
517
+ initialNodes,
518
+ additionalNodeTypes: nodeTypesWithCallbacks
519
+ });
520
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseCanvas_index_cjs_namespaceObject.BaseCanvas, {
521
+ ...canvasProps,
522
+ mode: "design",
523
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
524
+ position: "bottom-right",
525
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasPositionControls_cjs_namespaceObject.CanvasPositionControls, {
526
+ translations: external_types_cjs_namespaceObject.DefaultCanvasTranslations
527
+ })
528
+ })
529
+ });
530
+ }
472
531
  const Default = {
473
532
  render: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DefaultStory, {})
474
533
  };
475
534
  const WithBaseNodes = {
476
535
  render: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(WithBaseNodesStory, {})
477
536
  };
537
+ const WithCallbacks = {
538
+ render: ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(WithCallbacksStory, {})
539
+ };
478
540
  exports.Default = __webpack_exports__.Default;
479
541
  exports.WithBaseNodes = __webpack_exports__.WithBaseNodes;
542
+ exports.WithCallbacks = __webpack_exports__.WithCallbacks;
480
543
  exports["default"] = __webpack_exports__["default"];
481
544
  for(var __rspack_i in __webpack_exports__)if (-1 === [
482
545
  "Default",
483
546
  "WithBaseNodes",
547
+ "WithCallbacks",
484
548
  "default"
485
549
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
486
550
  Object.defineProperty(exports, '__esModule', {
@@ -4,4 +4,5 @@ export default meta;
4
4
  type Story = StoryObj<typeof meta>;
5
5
  export declare const Default: Story;
6
6
  export declare const WithBaseNodes: Story;
7
+ export declare const WithCallbacks: Story;
7
8
  //# sourceMappingURL=StickyNoteNode.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StickyNoteNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAe5D,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAwWnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC"}
1
+ {"version":3,"file":"StickyNoteNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAe5D,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA6anC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC"}
@@ -16,9 +16,42 @@ const meta = {
16
16
  ]
17
17
  };
18
18
  const StickyNoteNode_stories = meta;
19
+ const StickyNoteWithCallbacks = (props)=>{
20
+ const handleContentChange = (content)=>{
21
+ console.log('📝 Content changed:', {
22
+ nodeId: props.id,
23
+ content,
24
+ timestamp: new Date().toISOString()
25
+ });
26
+ };
27
+ const handleColorChange = (color)=>{
28
+ console.log('🎨 Color changed:', {
29
+ nodeId: props.id,
30
+ color,
31
+ timestamp: new Date().toISOString()
32
+ });
33
+ };
34
+ const handleResize = (width, height)=>{
35
+ console.log('📏 Resized:', {
36
+ nodeId: props.id,
37
+ width,
38
+ height,
39
+ timestamp: new Date().toISOString()
40
+ });
41
+ };
42
+ return /*#__PURE__*/ jsx(StickyNoteNode, {
43
+ ...props,
44
+ onContentChange: handleContentChange,
45
+ onColorChange: handleColorChange,
46
+ onResize: handleResize
47
+ });
48
+ };
19
49
  const nodeTypes = {
20
50
  stickyNote: StickyNoteNode
21
51
  };
52
+ const nodeTypesWithCallbacks = {
53
+ stickyNote: StickyNoteWithCallbacks
54
+ };
22
55
  function createStickyNote(id, color, content, position, size = {
23
56
  width: 250,
24
57
  height: 150
@@ -439,10 +472,38 @@ function WithBaseNodesStory() {
439
472
  })
440
473
  });
441
474
  }
475
+ function WithCallbacksStory() {
476
+ const initialNodes = useMemo(()=>[
477
+ createStickyNote('sticky-test-1', 'yellow', '**Test Callbacks!**\n\n1. Double-click to edit content\n2. Click the color button to change color\n3. Drag corners to resize\n\nOpen the browser console to see logs! 🔍', {
478
+ x: 480,
479
+ y: 480
480
+ }, {
481
+ width: 320,
482
+ height: 320
483
+ })
484
+ ], []);
485
+ const { canvasProps } = useCanvasStory({
486
+ initialNodes,
487
+ additionalNodeTypes: nodeTypesWithCallbacks
488
+ });
489
+ return /*#__PURE__*/ jsx(BaseCanvas, {
490
+ ...canvasProps,
491
+ mode: "design",
492
+ children: /*#__PURE__*/ jsx(Panel, {
493
+ position: "bottom-right",
494
+ children: /*#__PURE__*/ jsx(CanvasPositionControls, {
495
+ translations: DefaultCanvasTranslations
496
+ })
497
+ })
498
+ });
499
+ }
442
500
  const Default = {
443
501
  render: ()=>/*#__PURE__*/ jsx(DefaultStory, {})
444
502
  };
445
503
  const WithBaseNodes = {
446
504
  render: ()=>/*#__PURE__*/ jsx(WithBaseNodesStory, {})
447
505
  };
448
- export { Default, WithBaseNodes, StickyNoteNode_stories as default };
506
+ const WithCallbacks = {
507
+ render: ()=>/*#__PURE__*/ jsx(WithCallbacksStory, {})
508
+ };
509
+ export { Default, WithBaseNodes, WithCallbacks, StickyNoteNode_stories as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.69.1",
3
+ "version": "3.70.1",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -201,8 +201,8 @@
201
201
  "use-sync-external-store": "^1.2.0",
202
202
  "zod": "^4.3.5",
203
203
  "zustand": "^5.0.9",
204
- "@uipath/apollo-wind": "2.0.0",
205
- "@uipath/apollo-core": "5.9.0"
204
+ "@uipath/apollo-core": "5.9.0",
205
+ "@uipath/apollo-wind": "2.0.0"
206
206
  },
207
207
  "devDependencies": {
208
208
  "@lingui/cli": "^5.6.1",