@uipath/apollo-react 4.19.0 → 4.20.0-pr644.f72be25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.cjs +95 -75
  2. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.d.ts +2 -1
  3. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.d.ts.map +1 -1
  4. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.js +95 -75
  5. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.cjs +2 -2
  6. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.d.ts +2 -2
  7. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.d.ts.map +1 -1
  8. package/dist/canvas/components/StickyNoteNode/StickyNoteNode.styles.js +2 -2
  9. package/dist/canvas/components/Toolbox/ListView.cjs +13 -1
  10. package/dist/canvas/components/Toolbox/ListView.d.ts.map +1 -1
  11. package/dist/canvas/components/Toolbox/ListView.js +14 -2
  12. package/dist/canvas/components/Toolbox/ListView.styles.cjs +18 -0
  13. package/dist/canvas/components/Toolbox/ListView.styles.d.ts +4 -0
  14. package/dist/canvas/components/Toolbox/ListView.styles.d.ts.map +1 -1
  15. package/dist/canvas/components/Toolbox/ListView.styles.js +16 -1
  16. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  17. package/dist/material/components/ap-chat/locales/de.cjs +1 -1
  18. package/dist/material/components/ap-chat/locales/de.d.ts.map +1 -1
  19. package/dist/material/components/ap-chat/locales/de.js +1 -1
  20. package/dist/material/components/ap-chat/locales/es-MX.cjs +1 -1
  21. package/dist/material/components/ap-chat/locales/es-MX.d.ts.map +1 -1
  22. package/dist/material/components/ap-chat/locales/es-MX.js +1 -1
  23. package/dist/material/components/ap-chat/locales/es.cjs +1 -1
  24. package/dist/material/components/ap-chat/locales/es.d.ts.map +1 -1
  25. package/dist/material/components/ap-chat/locales/es.js +1 -1
  26. package/dist/material/components/ap-chat/locales/fr.cjs +1 -1
  27. package/dist/material/components/ap-chat/locales/fr.d.ts.map +1 -1
  28. package/dist/material/components/ap-chat/locales/fr.js +1 -1
  29. package/dist/material/components/ap-chat/locales/ja.cjs +1 -1
  30. package/dist/material/components/ap-chat/locales/ja.d.ts.map +1 -1
  31. package/dist/material/components/ap-chat/locales/ja.js +1 -1
  32. package/dist/material/components/ap-chat/locales/ko.cjs +1 -1
  33. package/dist/material/components/ap-chat/locales/ko.d.ts.map +1 -1
  34. package/dist/material/components/ap-chat/locales/ko.js +1 -1
  35. package/dist/material/components/ap-chat/locales/pt-BR.cjs +1 -1
  36. package/dist/material/components/ap-chat/locales/pt-BR.d.ts.map +1 -1
  37. package/dist/material/components/ap-chat/locales/pt-BR.js +1 -1
  38. package/dist/material/components/ap-chat/locales/pt.cjs +1 -1
  39. package/dist/material/components/ap-chat/locales/pt.d.ts.map +1 -1
  40. package/dist/material/components/ap-chat/locales/pt.js +1 -1
  41. package/dist/material/components/ap-chat/locales/tr.cjs +1 -1
  42. package/dist/material/components/ap-chat/locales/tr.d.ts.map +1 -1
  43. package/dist/material/components/ap-chat/locales/tr.js +1 -1
  44. package/dist/material/components/ap-chat/locales/zh-CN.cjs +1 -1
  45. package/dist/material/components/ap-chat/locales/zh-CN.d.ts.map +1 -1
  46. package/dist/material/components/ap-chat/locales/zh-CN.js +1 -1
  47. package/dist/material/components/ap-chat/locales/zh-TW.cjs +1 -1
  48. package/dist/material/components/ap-chat/locales/zh-TW.d.ts.map +1 -1
  49. package/dist/material/components/ap-chat/locales/zh-TW.js +1 -1
  50. package/package.json +2 -2
@@ -59,9 +59,9 @@ const external_useMarkdownShortcuts_cjs_namespaceObject = require("./useMarkdown
59
59
  const external_useScrollCapture_cjs_namespaceObject = require("./useScrollCapture.cjs");
60
60
  const minWidth = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
61
61
  const minHeight = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
62
- const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, onContentChange, onColorChange, onResize })=>{
62
+ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, readOnly = false, onContentChange, onColorChange, onResize })=>{
63
63
  const { updateNodeData, deleteElements } = (0, react_cjs_namespaceObject.useReactFlow)();
64
- const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(data.autoFocus ?? false);
64
+ const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(!readOnly && (data.autoFocus ?? false));
65
65
  const [isResizing, setIsResizing] = (0, external_react_namespaceObject.useState)(false);
66
66
  const [isColorPickerOpen, setIsColorPickerOpen] = (0, external_react_namespaceObject.useState)(false);
67
67
  const [localContent, setLocalContent] = (0, external_react_namespaceObject.useState)(data.content || '');
@@ -88,14 +88,15 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
88
88
  textAreaRef.current.focus();
89
89
  textAreaRef.current.select();
90
90
  }
91
- if (data.autoFocus) updateNodeData(id, {
91
+ if (!readOnly && data.autoFocus) updateNodeData(id, {
92
92
  autoFocus: false
93
93
  });
94
94
  }, [
95
95
  isEditing,
96
96
  data.autoFocus,
97
97
  id,
98
- updateNodeData
98
+ updateNodeData,
99
+ readOnly
99
100
  ]);
100
101
  (0, external_react_namespaceObject.useEffect)(()=>{
101
102
  if (!selected || isResizing) setIsColorPickerOpen(false);
@@ -103,8 +104,17 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
103
104
  selected,
104
105
  isResizing
105
106
  ]);
107
+ (0, external_react_namespaceObject.useEffect)(()=>{
108
+ if (readOnly) {
109
+ setIsEditing(false);
110
+ setLocalContent(data.content || '');
111
+ }
112
+ }, [
113
+ readOnly,
114
+ data.content
115
+ ]);
106
116
  const handleDoubleClick = (0, external_react_namespaceObject.useCallback)(()=>{
107
- if (isEditing) return;
117
+ if (readOnly || isEditing) return;
108
118
  setIsEditing(true);
109
119
  setTimeout(()=>{
110
120
  if (textAreaRef.current) {
@@ -113,10 +123,12 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
113
123
  }
114
124
  }, 0);
115
125
  }, [
116
- isEditing
126
+ isEditing,
127
+ readOnly
117
128
  ]);
118
129
  const handleBlur = (0, external_react_namespaceObject.useCallback)(()=>{
119
130
  setIsEditing(false);
131
+ if (readOnly) return;
120
132
  if (localContent !== data.content) {
121
133
  onContentChange?.(localContent);
122
134
  updateNodeData(id, {
@@ -128,7 +140,8 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
128
140
  localContent,
129
141
  data.content,
130
142
  updateNodeData,
131
- onContentChange
143
+ onContentChange,
144
+ readOnly
132
145
  ]);
133
146
  const handleChange = (0, external_react_namespaceObject.useCallback)((e)=>{
134
147
  setLocalContent(e.target.value);
@@ -205,6 +218,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
205
218
  setIsColorPickerOpen((prev)=>!prev);
206
219
  }, []);
207
220
  const handleEditClick = (0, external_react_namespaceObject.useCallback)(()=>{
221
+ if (readOnly) return;
208
222
  setIsEditing(true);
209
223
  setTimeout(()=>{
210
224
  if (textAreaRef.current) {
@@ -212,7 +226,9 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
212
226
  textAreaRef.current.select();
213
227
  }
214
228
  }, 0);
215
- }, []);
229
+ }, [
230
+ readOnly
231
+ ]);
216
232
  const handleDelete = (0, external_react_namespaceObject.useCallback)(()=>{
217
233
  deleteElements({
218
234
  nodes: [
@@ -299,69 +315,73 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
299
315
  }),
300
316
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StickyNoteNode_styles_cjs_namespaceObject.StickyNoteWrapper, {
301
317
  children: [
302
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
303
- style: {
304
- background: 'transparent',
305
- border: 'none',
306
- zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
307
- },
308
- position: "top-left",
309
- minWidth: minWidth,
310
- minHeight: minHeight,
311
- onResizeStart: handleResizeStart,
312
- onResizeEnd: handleResizeEnd,
313
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
314
- selected: selected,
315
- cursor: "nwse-resize"
316
- })
317
- }),
318
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
319
- style: {
320
- background: 'transparent',
321
- border: 'none',
322
- zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
323
- },
324
- position: "top-right",
325
- minWidth: minWidth,
326
- minHeight: minHeight,
327
- onResizeStart: handleResizeStart,
328
- onResizeEnd: handleResizeEnd,
329
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
330
- selected: selected,
331
- cursor: "nesw-resize"
332
- })
333
- }),
334
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
335
- style: {
336
- background: 'transparent',
337
- border: 'none',
338
- zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
339
- },
340
- position: "bottom-left",
341
- minWidth: minWidth,
342
- minHeight: minHeight,
343
- onResizeStart: handleResizeStart,
344
- onResizeEnd: handleResizeEnd,
345
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
346
- selected: selected,
347
- cursor: "nesw-resize"
348
- })
349
- }),
350
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
351
- style: {
352
- background: 'transparent',
353
- border: 'none',
354
- zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
355
- },
356
- position: "bottom-right",
357
- minWidth: minWidth,
358
- minHeight: minHeight,
359
- onResizeStart: handleResizeStart,
360
- onResizeEnd: handleResizeEnd,
361
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
362
- selected: selected,
363
- cursor: "nwse-resize"
364
- })
318
+ !readOnly && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
319
+ children: [
320
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
321
+ style: {
322
+ background: 'transparent',
323
+ border: 'none',
324
+ zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
325
+ },
326
+ position: "top-left",
327
+ minWidth: minWidth,
328
+ minHeight: minHeight,
329
+ onResizeStart: handleResizeStart,
330
+ onResizeEnd: handleResizeEnd,
331
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
332
+ selected: selected,
333
+ cursor: "nwse-resize"
334
+ })
335
+ }),
336
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
337
+ style: {
338
+ background: 'transparent',
339
+ border: 'none',
340
+ zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
341
+ },
342
+ position: "top-right",
343
+ minWidth: minWidth,
344
+ minHeight: minHeight,
345
+ onResizeStart: handleResizeStart,
346
+ onResizeEnd: handleResizeEnd,
347
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
348
+ selected: selected,
349
+ cursor: "nesw-resize"
350
+ })
351
+ }),
352
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
353
+ style: {
354
+ background: 'transparent',
355
+ border: 'none',
356
+ zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
357
+ },
358
+ position: "bottom-left",
359
+ minWidth: minWidth,
360
+ minHeight: minHeight,
361
+ onResizeStart: handleResizeStart,
362
+ onResizeEnd: handleResizeEnd,
363
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
364
+ selected: selected,
365
+ cursor: "nesw-resize"
366
+ })
367
+ }),
368
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
369
+ style: {
370
+ background: 'transparent',
371
+ border: 'none',
372
+ zIndex: external_StickyNoteNode_styles_cjs_namespaceObject.RESIZE_CONTROL_Z_INDEX
373
+ },
374
+ position: "bottom-right",
375
+ minWidth: minWidth,
376
+ minHeight: minHeight,
377
+ onResizeStart: handleResizeStart,
378
+ onResizeEnd: handleResizeEnd,
379
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.ResizeHandle, {
380
+ selected: selected,
381
+ cursor: "nwse-resize"
382
+ })
383
+ })
384
+ ]
365
385
  }),
366
386
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StickyNoteNode_styles_cjs_namespaceObject.StickyNoteContainer, {
367
387
  backgroundColor: colorWithAlpha,
@@ -371,10 +391,10 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
371
391
  onDoubleClick: handleDoubleClick,
372
392
  children: [
373
393
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.TopCornerIndicators, {
374
- selected: selected
394
+ visible: selected && !readOnly
375
395
  }),
376
396
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_styles_cjs_namespaceObject.BottomCornerIndicators, {
377
- selected: selected
397
+ visible: selected && !readOnly
378
398
  }),
379
399
  isEditing ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.ApI18nProvider, {
380
400
  component: "canvas",
@@ -419,13 +439,13 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
419
439
  })
420
440
  ]
421
441
  }),
422
- selected && !dragging && !isResizing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.NodeToolbar, {
442
+ !readOnly && selected && !dragging && !isResizing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.NodeToolbar, {
423
443
  nodeId: id,
424
444
  config: toolbarConfig,
425
445
  expanded: true
426
446
  }),
427
447
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_motion_react_namespaceObject.AnimatePresence, {
428
- children: selected && !dragging && !isResizing && isColorPickerOpen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
448
+ children: !readOnly && selected && !dragging && !isResizing && isColorPickerOpen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
429
449
  style: {
430
450
  position: 'absolute',
431
451
  top: -40,
@@ -4,9 +4,10 @@ export interface StickyNoteNodeProps extends NodeProps {
4
4
  data: StickyNoteData;
5
5
  placeholder?: string;
6
6
  renderPlaceholderOnSelect?: boolean;
7
+ readOnly?: boolean;
7
8
  onContentChange?: (content: string) => void;
8
9
  onColorChange?: (color: StickyNoteColor) => void;
9
10
  onResize?: (width: number, height: number) => void;
10
11
  }
11
- export declare const StickyNoteNode: import("react").MemoExoticComponent<({ id, data, selected, dragging, placeholder, renderPlaceholderOnSelect, onContentChange, onColorChange, onResize, }: StickyNoteNodeProps) => import("react/jsx-runtime").JSX.Element>;
12
+ export declare const StickyNoteNode: import("react").MemoExoticComponent<({ id, data, selected, dragging, placeholder, renderPlaceholderOnSelect, readOnly, onContentChange, onColorChange, onResize, }: StickyNoteNodeProps) => import("react/jsx-runtime").JSX.Element>;
12
13
  //# 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;AAgC1E,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"}
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;AAgC1E,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,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,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;AAoZD,eAAO,MAAM,cAAc,sKApYxB,mBAAmB,6CAoYqC,CAAC"}
@@ -19,9 +19,9 @@ import { useMarkdownShortcuts } from "./useMarkdownShortcuts.js";
19
19
  import { useScrollCapture } from "./useScrollCapture.js";
20
20
  const minWidth = 8 * GRID_SPACING;
21
21
  const minHeight = 8 * GRID_SPACING;
22
- const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, onContentChange, onColorChange, onResize })=>{
22
+ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, readOnly = false, onContentChange, onColorChange, onResize })=>{
23
23
  const { updateNodeData, deleteElements } = useReactFlow();
24
- const [isEditing, setIsEditing] = useState(data.autoFocus ?? false);
24
+ const [isEditing, setIsEditing] = useState(!readOnly && (data.autoFocus ?? false));
25
25
  const [isResizing, setIsResizing] = useState(false);
26
26
  const [isColorPickerOpen, setIsColorPickerOpen] = useState(false);
27
27
  const [localContent, setLocalContent] = useState(data.content || '');
@@ -48,14 +48,15 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
48
48
  textAreaRef.current.focus();
49
49
  textAreaRef.current.select();
50
50
  }
51
- if (data.autoFocus) updateNodeData(id, {
51
+ if (!readOnly && data.autoFocus) updateNodeData(id, {
52
52
  autoFocus: false
53
53
  });
54
54
  }, [
55
55
  isEditing,
56
56
  data.autoFocus,
57
57
  id,
58
- updateNodeData
58
+ updateNodeData,
59
+ readOnly
59
60
  ]);
60
61
  useEffect(()=>{
61
62
  if (!selected || isResizing) setIsColorPickerOpen(false);
@@ -63,8 +64,17 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
63
64
  selected,
64
65
  isResizing
65
66
  ]);
67
+ useEffect(()=>{
68
+ if (readOnly) {
69
+ setIsEditing(false);
70
+ setLocalContent(data.content || '');
71
+ }
72
+ }, [
73
+ readOnly,
74
+ data.content
75
+ ]);
66
76
  const handleDoubleClick = useCallback(()=>{
67
- if (isEditing) return;
77
+ if (readOnly || isEditing) return;
68
78
  setIsEditing(true);
69
79
  setTimeout(()=>{
70
80
  if (textAreaRef.current) {
@@ -73,10 +83,12 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
73
83
  }
74
84
  }, 0);
75
85
  }, [
76
- isEditing
86
+ isEditing,
87
+ readOnly
77
88
  ]);
78
89
  const handleBlur = useCallback(()=>{
79
90
  setIsEditing(false);
91
+ if (readOnly) return;
80
92
  if (localContent !== data.content) {
81
93
  onContentChange?.(localContent);
82
94
  updateNodeData(id, {
@@ -88,7 +100,8 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
88
100
  localContent,
89
101
  data.content,
90
102
  updateNodeData,
91
- onContentChange
103
+ onContentChange,
104
+ readOnly
92
105
  ]);
93
106
  const handleChange = useCallback((e)=>{
94
107
  setLocalContent(e.target.value);
@@ -165,6 +178,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
165
178
  setIsColorPickerOpen((prev)=>!prev);
166
179
  }, []);
167
180
  const handleEditClick = useCallback(()=>{
181
+ if (readOnly) return;
168
182
  setIsEditing(true);
169
183
  setTimeout(()=>{
170
184
  if (textAreaRef.current) {
@@ -172,7 +186,9 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
172
186
  textAreaRef.current.select();
173
187
  }
174
188
  }, 0);
175
- }, []);
189
+ }, [
190
+ readOnly
191
+ ]);
176
192
  const handleDelete = useCallback(()=>{
177
193
  deleteElements({
178
194
  nodes: [
@@ -259,69 +275,73 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
259
275
  }),
260
276
  /*#__PURE__*/ jsxs(StickyNoteWrapper, {
261
277
  children: [
262
- /*#__PURE__*/ jsx(NodeResizeControl, {
263
- style: {
264
- background: 'transparent',
265
- border: 'none',
266
- zIndex: RESIZE_CONTROL_Z_INDEX
267
- },
268
- position: "top-left",
269
- minWidth: minWidth,
270
- minHeight: minHeight,
271
- onResizeStart: handleResizeStart,
272
- onResizeEnd: handleResizeEnd,
273
- children: /*#__PURE__*/ jsx(ResizeHandle, {
274
- selected: selected,
275
- cursor: "nwse-resize"
276
- })
277
- }),
278
- /*#__PURE__*/ jsx(NodeResizeControl, {
279
- style: {
280
- background: 'transparent',
281
- border: 'none',
282
- zIndex: RESIZE_CONTROL_Z_INDEX
283
- },
284
- position: "top-right",
285
- minWidth: minWidth,
286
- minHeight: minHeight,
287
- onResizeStart: handleResizeStart,
288
- onResizeEnd: handleResizeEnd,
289
- children: /*#__PURE__*/ jsx(ResizeHandle, {
290
- selected: selected,
291
- cursor: "nesw-resize"
292
- })
293
- }),
294
- /*#__PURE__*/ jsx(NodeResizeControl, {
295
- style: {
296
- background: 'transparent',
297
- border: 'none',
298
- zIndex: RESIZE_CONTROL_Z_INDEX
299
- },
300
- position: "bottom-left",
301
- minWidth: minWidth,
302
- minHeight: minHeight,
303
- onResizeStart: handleResizeStart,
304
- onResizeEnd: handleResizeEnd,
305
- children: /*#__PURE__*/ jsx(ResizeHandle, {
306
- selected: selected,
307
- cursor: "nesw-resize"
308
- })
309
- }),
310
- /*#__PURE__*/ jsx(NodeResizeControl, {
311
- style: {
312
- background: 'transparent',
313
- border: 'none',
314
- zIndex: RESIZE_CONTROL_Z_INDEX
315
- },
316
- position: "bottom-right",
317
- minWidth: minWidth,
318
- minHeight: minHeight,
319
- onResizeStart: handleResizeStart,
320
- onResizeEnd: handleResizeEnd,
321
- children: /*#__PURE__*/ jsx(ResizeHandle, {
322
- selected: selected,
323
- cursor: "nwse-resize"
324
- })
278
+ !readOnly && /*#__PURE__*/ jsxs(Fragment, {
279
+ children: [
280
+ /*#__PURE__*/ jsx(NodeResizeControl, {
281
+ style: {
282
+ background: 'transparent',
283
+ border: 'none',
284
+ zIndex: RESIZE_CONTROL_Z_INDEX
285
+ },
286
+ position: "top-left",
287
+ minWidth: minWidth,
288
+ minHeight: minHeight,
289
+ onResizeStart: handleResizeStart,
290
+ onResizeEnd: handleResizeEnd,
291
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
292
+ selected: selected,
293
+ cursor: "nwse-resize"
294
+ })
295
+ }),
296
+ /*#__PURE__*/ jsx(NodeResizeControl, {
297
+ style: {
298
+ background: 'transparent',
299
+ border: 'none',
300
+ zIndex: RESIZE_CONTROL_Z_INDEX
301
+ },
302
+ position: "top-right",
303
+ minWidth: minWidth,
304
+ minHeight: minHeight,
305
+ onResizeStart: handleResizeStart,
306
+ onResizeEnd: handleResizeEnd,
307
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
308
+ selected: selected,
309
+ cursor: "nesw-resize"
310
+ })
311
+ }),
312
+ /*#__PURE__*/ jsx(NodeResizeControl, {
313
+ style: {
314
+ background: 'transparent',
315
+ border: 'none',
316
+ zIndex: RESIZE_CONTROL_Z_INDEX
317
+ },
318
+ position: "bottom-left",
319
+ minWidth: minWidth,
320
+ minHeight: minHeight,
321
+ onResizeStart: handleResizeStart,
322
+ onResizeEnd: handleResizeEnd,
323
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
324
+ selected: selected,
325
+ cursor: "nesw-resize"
326
+ })
327
+ }),
328
+ /*#__PURE__*/ jsx(NodeResizeControl, {
329
+ style: {
330
+ background: 'transparent',
331
+ border: 'none',
332
+ zIndex: RESIZE_CONTROL_Z_INDEX
333
+ },
334
+ position: "bottom-right",
335
+ minWidth: minWidth,
336
+ minHeight: minHeight,
337
+ onResizeStart: handleResizeStart,
338
+ onResizeEnd: handleResizeEnd,
339
+ children: /*#__PURE__*/ jsx(ResizeHandle, {
340
+ selected: selected,
341
+ cursor: "nwse-resize"
342
+ })
343
+ })
344
+ ]
325
345
  }),
326
346
  /*#__PURE__*/ jsxs(StickyNoteContainer, {
327
347
  backgroundColor: colorWithAlpha,
@@ -331,10 +351,10 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
331
351
  onDoubleClick: handleDoubleClick,
332
352
  children: [
333
353
  /*#__PURE__*/ jsx(TopCornerIndicators, {
334
- selected: selected
354
+ visible: selected && !readOnly
335
355
  }),
336
356
  /*#__PURE__*/ jsx(BottomCornerIndicators, {
337
- selected: selected
357
+ visible: selected && !readOnly
338
358
  }),
339
359
  isEditing ? /*#__PURE__*/ jsxs(ApI18nProvider, {
340
360
  component: "canvas",
@@ -379,13 +399,13 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
379
399
  })
380
400
  ]
381
401
  }),
382
- selected && !dragging && !isResizing && /*#__PURE__*/ jsx(NodeToolbar, {
402
+ !readOnly && selected && !dragging && !isResizing && /*#__PURE__*/ jsx(NodeToolbar, {
383
403
  nodeId: id,
384
404
  config: toolbarConfig,
385
405
  expanded: true
386
406
  }),
387
407
  /*#__PURE__*/ jsx(AnimatePresence, {
388
- children: selected && !dragging && !isResizing && isColorPickerOpen && /*#__PURE__*/ jsx("div", {
408
+ children: !readOnly && selected && !dragging && !isResizing && isColorPickerOpen && /*#__PURE__*/ jsx("div", {
389
409
  style: {
390
410
  position: 'absolute',
391
411
  top: -40,
@@ -281,7 +281,7 @@ const TopCornerIndicators = styled_default().div`
281
281
  position: absolute;
282
282
  inset: 0;
283
283
  pointer-events: none;
284
- opacity: ${(props)=>props.selected ? 1 : 0};
284
+ opacity: ${(props)=>props.visible ? 1 : 0};
285
285
 
286
286
  /* Top-left corner */
287
287
  &::before {
@@ -313,7 +313,7 @@ const BottomCornerIndicators = styled_default().div`
313
313
  position: absolute;
314
314
  inset: 0;
315
315
  pointer-events: none;
316
- opacity: ${(props)=>props.selected ? 1 : 0};
316
+ opacity: ${(props)=>props.visible ? 1 : 0};
317
317
 
318
318
  /* Bottom-left corner */
319
319
  &::before {
@@ -35,13 +35,13 @@ export declare const TopCornerIndicators: import("@emotion/styled").StyledCompon
35
35
  theme?: import("@emotion/react").Theme;
36
36
  as?: React.ElementType;
37
37
  } & {
38
- selected?: boolean;
38
+ visible?: boolean;
39
39
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
40
40
  export declare const BottomCornerIndicators: import("@emotion/styled").StyledComponent<{
41
41
  theme?: import("@emotion/react").Theme;
42
42
  as?: React.ElementType;
43
43
  } & {
44
- selected?: boolean;
44
+ visible?: boolean;
45
45
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
46
46
  export declare const ColorPickerPanel: import("@emotion/styled").StyledComponent<Omit<import("motion/react").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
47
47
  theme?: import("@emotion/react").Theme;
@@ -1 +1 @@
1
- {"version":3,"file":"StickyNoteNode.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,8BAA8B,MAAM,CAAC;AA4BlD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,sBAAsB,2CAUlC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;yGAI7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;iBACjB,MAAM;qBACF,MAAM;eACZ,OAAO;eACP,OAAO;yGAuBnB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;eAAgC,OAAO;2HAsBrE,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGA8H9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;eAA2B,OAAO;aAAW,MAAM;yGAW3E,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;eAA2B,OAAO;yGA+BjE,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;eAA2B,OAAO;yGA+BpE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;UAa5B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;WAA0B,MAAM;gBAAc,OAAO;qHAkB5E,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;iBAA6B,MAAM;yGAQzE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;cAA6B,OAAO;qHAoBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAK5B,CAAC"}
1
+ {"version":3,"file":"StickyNoteNode.styles.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,8BAA8B,MAAM,CAAC;AA4BlD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,sBAAsB,2CAUlC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;yGAI7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;iBACjB,MAAM;qBACF,MAAM;eACZ,OAAO;eACP,OAAO;yGAuBnB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;eAAgC,OAAO;2HAsBrE,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;yGA8H9B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;eAA2B,OAAO;aAAW,MAAM;yGAW3E,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;cAA0B,OAAO;yGA+BhE,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;cAA0B,OAAO;yGA+BnE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;UAa5B,CAAC;AAEF,eAAO,MAAM,WAAW;;;;WAA0B,MAAM;gBAAc,OAAO;qHAkB5E,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;iBAA6B,MAAM;yGAQzE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;cAA6B,OAAO;qHAoBhE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;yGAK5B,CAAC"}
@@ -229,7 +229,7 @@ const TopCornerIndicators = styled.div`
229
229
  position: absolute;
230
230
  inset: 0;
231
231
  pointer-events: none;
232
- opacity: ${(props)=>props.selected ? 1 : 0};
232
+ opacity: ${(props)=>props.visible ? 1 : 0};
233
233
 
234
234
  /* Top-left corner */
235
235
  &::before {
@@ -261,7 +261,7 @@ const BottomCornerIndicators = styled.div`
261
261
  position: absolute;
262
262
  inset: 0;
263
263
  pointer-events: none;
264
- opacity: ${(props)=>props.selected ? 1 : 0};
264
+ opacity: ${(props)=>props.visible ? 1 : 0};
265
265
 
266
266
  /* Bottom-left corner */
267
267
  &::before {
@@ -36,6 +36,13 @@ const CanvasThemeContext_cjs_namespaceObject = require("../BaseCanvas/CanvasThem
36
36
  const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
37
37
  const external_ListView_styles_cjs_namespaceObject = require("./ListView.styles.cjs");
38
38
  const DEFAULT_SKELETON_COUNT = 3;
39
+ function getInitial(name) {
40
+ const trimmed = name.trim();
41
+ if (!trimmed) return '?';
42
+ return [
43
+ ...trimmed
44
+ ][0] ?? '?';
45
+ }
39
46
  function buildRenderedItems(items, enableSections, loadingSkeleton) {
40
47
  const result = [];
41
48
  const skeletonConfig = 'object' == typeof loadingSkeleton ? loadingSkeleton : loadingSkeleton ? {} : void 0;
@@ -162,7 +169,12 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
162
169
  icon: item.icon.name,
163
170
  size: 24
164
171
  }),
165
- item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(item.icon.Component, {})
172
+ item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(item.icon.Component, {}),
173
+ !item.icon?.url && !item.icon?.name && !item.icon?.Component && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ListView_styles_cjs_namespaceObject.InitialsBadge, {
174
+ "aria-hidden": "true",
175
+ "data-testid": "list-item-initials-badge",
176
+ children: getInitial(item.name)
177
+ })
166
178
  ]
167
179
  }),
168
180
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {