canvu-react 0.3.29 → 0.3.31

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 (45) hide show
  1. package/dist/{asset-hydration-BEG21hMp.d.ts → asset-hydration-DrTOgDdd.d.ts} +2 -2
  2. package/dist/{asset-hydration-3Iv5xHxM.d.cts → asset-hydration-EtEuBwb7.d.cts} +2 -2
  3. package/dist/{camera-KwCYYPhm.d.ts → camera-AoTwBSoE.d.ts} +1 -1
  4. package/dist/{camera-BwQjm5oh.d.cts → camera-Di5R_Rwl.d.cts} +1 -1
  5. package/dist/chatbot.d.cts +4 -4
  6. package/dist/chatbot.d.ts +4 -4
  7. package/dist/index.cjs +85 -1
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +6 -6
  10. package/dist/index.d.ts +6 -6
  11. package/dist/index.js +83 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/native.cjs +66 -0
  14. package/dist/native.cjs.map +1 -1
  15. package/dist/native.d.cts +2 -2
  16. package/dist/native.d.ts +2 -2
  17. package/dist/native.js +66 -0
  18. package/dist/native.js.map +1 -1
  19. package/dist/react.cjs +143 -7
  20. package/dist/react.cjs.map +1 -1
  21. package/dist/react.d.cts +15 -12
  22. package/dist/react.d.ts +15 -12
  23. package/dist/react.js +143 -8
  24. package/dist/react.js.map +1 -1
  25. package/dist/realtime.cjs +11 -0
  26. package/dist/realtime.cjs.map +1 -1
  27. package/dist/realtime.d.cts +6 -6
  28. package/dist/realtime.d.ts +6 -6
  29. package/dist/realtime.js +11 -0
  30. package/dist/realtime.js.map +1 -1
  31. package/dist/{shape-builders-DFudWDFI.d.cts → shape-builders-CsSXKCcs.d.ts} +43 -2
  32. package/dist/{shape-builders-ENwnK-zT.d.ts → shape-builders-CsbSRZnQ.d.cts} +43 -2
  33. package/dist/tldraw.cjs +68 -2
  34. package/dist/tldraw.cjs.map +1 -1
  35. package/dist/tldraw.d.cts +1 -1
  36. package/dist/tldraw.d.ts +1 -1
  37. package/dist/tldraw.js +68 -2
  38. package/dist/tldraw.js.map +1 -1
  39. package/dist/{types-DNwjgs5U.d.cts → types-B2Na677H.d.cts} +1 -1
  40. package/dist/{types-BLXR7g_L.d.cts → types-B6PAYKzx.d.ts} +4 -4
  41. package/dist/{types-CB0TZZuk.d.cts → types-Bnq2HtHQ.d.cts} +1 -1
  42. package/dist/{types-CB0TZZuk.d.ts → types-Bnq2HtHQ.d.ts} +1 -1
  43. package/dist/{types-Cm7IsgL4.d.ts → types-DWGk2_GZ.d.cts} +4 -4
  44. package/dist/{types-BtAJFS_-.d.ts → types-zmUah-vP.d.ts} +1 -1
  45. package/package.json +1 -1
package/dist/react.d.cts CHANGED
@@ -1,16 +1,16 @@
1
- import { I as IndexedDbImageStore } from './asset-hydration-3Iv5xHxM.cjs';
2
- export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-3Iv5xHxM.cjs';
3
- import { V as VectorSceneItem } from './types-CB0TZZuk.cjs';
4
- import { V as VectorViewportAssetKind, u as VectorViewportAssetStore } from './shape-builders-DFudWDFI.cjs';
5
- export { v as VectorViewportAssetHydrationRequest, w as VectorViewportAssetResolveRequest, x as VectorViewportAssetResolveResult, y as VectorViewportAssetUploadRequest, z as VectorViewportAssetUploadResult } from './shape-builders-DFudWDFI.cjs';
6
- import { B as BoardComponentPosition, V as VectorToolDefinition, C as CanvasPlugin, a as VectorSelectionInspector } from './types-BLXR7g_L.cjs';
7
- export { b as CanvasPluginComponentProps, c as CanvasPluginContribution, d as CanvasPluginItemsChangeMiddlewareContext, e as CanvasPluginRenderContext, f as CanvuChromeActiveToolStyle, g as CanvuChromeContext, h as CanvuChromeContextValue, i as CanvuChromeSelectionStyleChange, j as CanvuPluginContext, k as CanvuPluginContextValue, l as CanvuPluginViewportSnapshot, m as CustomShapePlacementOptions, P as PlacementPreview, n as VectorCanvasSpacePosition, o as VectorSelectionInspectorProps, p as VectorViewport, q as VectorViewportHandle, r as VectorViewportProps, W as WorldPointerDownDetail, s as createCanvuPlugin, t as getBoardPositionStyle, u as useCanvuChromeContext, v as useCanvuDocumentContext, w as useCanvuPluginContext, x as useCanvuPluginContribution, y as useCanvuResolvedTools, z as useCanvuViewportContext } from './types-BLXR7g_L.cjs';
1
+ import { I as IndexedDbImageStore } from './asset-hydration-EtEuBwb7.cjs';
2
+ export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-EtEuBwb7.cjs';
3
+ import { V as VectorSceneItem } from './types-Bnq2HtHQ.cjs';
4
+ import { V as VectorViewportAssetKind, x as VectorViewportAssetStore } from './shape-builders-CsbSRZnQ.cjs';
5
+ export { y as VectorViewportAssetHydrationRequest, z as VectorViewportAssetResolveRequest, A as VectorViewportAssetResolveResult, B as VectorViewportAssetUploadRequest, C as VectorViewportAssetUploadResult } from './shape-builders-CsbSRZnQ.cjs';
6
+ import { B as BoardComponentPosition, V as VectorToolDefinition, C as CanvasPlugin, a as VectorSelectionInspector } from './types-DWGk2_GZ.cjs';
7
+ export { b as CanvasPluginComponentProps, c as CanvasPluginContribution, d as CanvasPluginItemsChangeMiddlewareContext, e as CanvasPluginRenderContext, f as CanvuChromeActiveToolStyle, g as CanvuChromeContext, h as CanvuChromeContextValue, i as CanvuChromeSelectionStyleChange, j as CanvuPluginContext, k as CanvuPluginContextValue, l as CanvuPluginViewportSnapshot, m as CustomShapePlacementOptions, P as PlacementPreview, n as VectorCanvasSpacePosition, o as VectorSelectionInspectorProps, p as VectorViewport, q as VectorViewportHandle, r as VectorViewportProps, W as WorldPointerDownDetail, s as createCanvuPlugin, t as getBoardPositionStyle, u as useCanvuChromeContext, v as useCanvuDocumentContext, w as useCanvuPluginContext, x as useCanvuPluginContribution, y as useCanvuResolvedTools, z as useCanvuViewportContext } from './types-DWGk2_GZ.cjs';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import * as react from 'react';
10
10
  import { CSSProperties, ReactNode, ReactElement, SVGProps } from 'react';
11
- import { C as Camera2D } from './camera-BwQjm5oh.cjs';
12
- import { V as VectorCanvasPersistenceAdapter, a as VectorCanvasRemoteAdapter } from './types-DNwjgs5U.cjs';
13
- export { b as VectorCanvasSnapshot } from './types-DNwjgs5U.cjs';
11
+ import { C as Camera2D } from './camera-Di5R_Rwl.cjs';
12
+ import { V as VectorCanvasPersistenceAdapter, a as VectorCanvasRemoteAdapter } from './types-B2Na677H.cjs';
13
+ export { b as VectorCanvasSnapshot } from './types-B2Na677H.cjs';
14
14
 
15
15
  /**
16
16
  * Extra context for each item created by {@link ingestAssetFilesToSceneItems}.
@@ -425,7 +425,7 @@ declare function ShapeContextMenu({ x, y, allSelectedLocked, onClose, onToggleLo
425
425
  * Tool ids shown in the overflow menu at the end of the default toolbar (horizontal layout).
426
426
  * Order: shapes, marker, laser, image.
427
427
  */
428
- declare const DEFAULT_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "line", "marker", "laser", "image"];
428
+ declare const DEFAULT_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "architectural-cloud", "line", "marker", "laser", "image"];
429
429
  /**
430
430
  * Opinionated default tool strip using [Lucide](https://lucide.dev) icons.
431
431
  * Pass a subset or your own list via {@link VectorToolbarProps.tools}.
@@ -437,6 +437,7 @@ declare function IconHand(props: IconProps): react_jsx_runtime.JSX.Element;
437
437
  declare function IconSelect(props: IconProps): react_jsx_runtime.JSX.Element;
438
438
  declare function IconRect(props: IconProps): react_jsx_runtime.JSX.Element;
439
439
  declare function IconEllipse(props: IconProps): react_jsx_runtime.JSX.Element;
440
+ declare function IconArchitecturalCloud(props: IconProps): react_jsx_runtime.JSX.Element;
440
441
  declare function IconLine(props: IconProps): react_jsx_runtime.JSX.Element;
441
442
  declare function IconArrow(props: IconProps): react_jsx_runtime.JSX.Element;
442
443
  declare function IconDraw(props: IconProps): react_jsx_runtime.JSX.Element;
@@ -668,6 +669,7 @@ declare const HandBinding: ToolBinding;
668
669
  declare const SelectBinding: ToolBinding;
669
670
  declare const RectBinding: ToolBinding;
670
671
  declare const EllipseBinding: ToolBinding;
672
+ declare const ArchitecturalCloudBinding: ToolBinding;
671
673
  declare const LineBinding: ToolBinding;
672
674
  declare const ArrowBinding: ToolBinding;
673
675
  declare const DrawBinding: ToolBinding;
@@ -684,6 +686,7 @@ type VectorToolbarWithStatics = ((props: VectorToolbarProps) => ReactElement) &
684
686
  Select: typeof SelectBinding;
685
687
  Rect: typeof RectBinding;
686
688
  Ellipse: typeof EllipseBinding;
689
+ ArchitecturalCloud: typeof ArchitecturalCloudBinding;
687
690
  Line: typeof LineBinding;
688
691
  Arrow: typeof ArrowBinding;
689
692
  Draw: typeof DrawBinding;
@@ -703,4 +706,4 @@ type VectorToolbarWithStatics = ((props: VectorToolbarProps) => ReactElement) &
703
706
  */
704
707
  declare const VectorToolbar: VectorToolbarWithStatics;
705
708
 
706
- export { BoardComponentPosition, CanvasPlugin, type CreateLocalStoragePersistenceAdapterOptions, type CreateToolPluginOptions, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, type ImagesMenuLabels, type ImagesMenuProps, type IngestAssetFileError, type IngestAssetFilesToSceneItemsOptions, type IngestAssetFilesToSceneItemsResult, type IngestedAssetItemContext, NavMenu, type NavMenuMinimapProps, type NavMenuProps, type NavMenuUndoRedoProps, type NavMenuZoomControlsProps, ShapeContextMenu, type ShapeContextMenuProps, type UseVectorCanvasDocumentOptions, type UseVectorCanvasDocumentResult, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasPersistenceAdapter, VectorCanvasRemoteAdapter, VectorCanvasRoot, type VectorCanvasSlotProps, type VectorCanvasSpaceProps, VectorCanvasToolbar, type VectorCanvasToolbarProps, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolDefinition, VectorToolbar, type VectorToolbarOverflowProps, type VectorToolbarProps, type VectorToolbarRenderContext, type VectorToolbarToolLockProps, type VectorToolbarToolProps, VectorViewportAssetKind, VectorViewportAssetStore, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, ingestAssetFilesToSceneItems, useVectorCanvasDocument };
709
+ export { BoardComponentPosition, CanvasPlugin, type CreateLocalStoragePersistenceAdapterOptions, type CreateToolPluginOptions, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArchitecturalCloud, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, type ImagesMenuLabels, type ImagesMenuProps, type IngestAssetFileError, type IngestAssetFilesToSceneItemsOptions, type IngestAssetFilesToSceneItemsResult, type IngestedAssetItemContext, NavMenu, type NavMenuMinimapProps, type NavMenuProps, type NavMenuUndoRedoProps, type NavMenuZoomControlsProps, ShapeContextMenu, type ShapeContextMenuProps, type UseVectorCanvasDocumentOptions, type UseVectorCanvasDocumentResult, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasPersistenceAdapter, VectorCanvasRemoteAdapter, VectorCanvasRoot, type VectorCanvasSlotProps, type VectorCanvasSpaceProps, VectorCanvasToolbar, type VectorCanvasToolbarProps, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolDefinition, VectorToolbar, type VectorToolbarOverflowProps, type VectorToolbarProps, type VectorToolbarRenderContext, type VectorToolbarToolLockProps, type VectorToolbarToolProps, VectorViewportAssetKind, VectorViewportAssetStore, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, ingestAssetFilesToSceneItems, useVectorCanvasDocument };
package/dist/react.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { I as IndexedDbImageStore } from './asset-hydration-BEG21hMp.js';
2
- export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-BEG21hMp.js';
3
- import { V as VectorSceneItem } from './types-CB0TZZuk.js';
4
- import { V as VectorViewportAssetKind, u as VectorViewportAssetStore } from './shape-builders-ENwnK-zT.js';
5
- export { v as VectorViewportAssetHydrationRequest, w as VectorViewportAssetResolveRequest, x as VectorViewportAssetResolveResult, y as VectorViewportAssetUploadRequest, z as VectorViewportAssetUploadResult } from './shape-builders-ENwnK-zT.js';
6
- import { B as BoardComponentPosition, V as VectorToolDefinition, C as CanvasPlugin, a as VectorSelectionInspector } from './types-Cm7IsgL4.js';
7
- export { b as CanvasPluginComponentProps, c as CanvasPluginContribution, d as CanvasPluginItemsChangeMiddlewareContext, e as CanvasPluginRenderContext, f as CanvuChromeActiveToolStyle, g as CanvuChromeContext, h as CanvuChromeContextValue, i as CanvuChromeSelectionStyleChange, j as CanvuPluginContext, k as CanvuPluginContextValue, l as CanvuPluginViewportSnapshot, m as CustomShapePlacementOptions, P as PlacementPreview, n as VectorCanvasSpacePosition, o as VectorSelectionInspectorProps, p as VectorViewport, q as VectorViewportHandle, r as VectorViewportProps, W as WorldPointerDownDetail, s as createCanvuPlugin, t as getBoardPositionStyle, u as useCanvuChromeContext, v as useCanvuDocumentContext, w as useCanvuPluginContext, x as useCanvuPluginContribution, y as useCanvuResolvedTools, z as useCanvuViewportContext } from './types-Cm7IsgL4.js';
1
+ import { I as IndexedDbImageStore } from './asset-hydration-DrTOgDdd.js';
2
+ export { H as HydratedSceneItemsWithAssetsResult, h as hydrateSceneItemsWithAssets } from './asset-hydration-DrTOgDdd.js';
3
+ import { V as VectorSceneItem } from './types-Bnq2HtHQ.js';
4
+ import { V as VectorViewportAssetKind, x as VectorViewportAssetStore } from './shape-builders-CsSXKCcs.js';
5
+ export { y as VectorViewportAssetHydrationRequest, z as VectorViewportAssetResolveRequest, A as VectorViewportAssetResolveResult, B as VectorViewportAssetUploadRequest, C as VectorViewportAssetUploadResult } from './shape-builders-CsSXKCcs.js';
6
+ import { B as BoardComponentPosition, V as VectorToolDefinition, C as CanvasPlugin, a as VectorSelectionInspector } from './types-B6PAYKzx.js';
7
+ export { b as CanvasPluginComponentProps, c as CanvasPluginContribution, d as CanvasPluginItemsChangeMiddlewareContext, e as CanvasPluginRenderContext, f as CanvuChromeActiveToolStyle, g as CanvuChromeContext, h as CanvuChromeContextValue, i as CanvuChromeSelectionStyleChange, j as CanvuPluginContext, k as CanvuPluginContextValue, l as CanvuPluginViewportSnapshot, m as CustomShapePlacementOptions, P as PlacementPreview, n as VectorCanvasSpacePosition, o as VectorSelectionInspectorProps, p as VectorViewport, q as VectorViewportHandle, r as VectorViewportProps, W as WorldPointerDownDetail, s as createCanvuPlugin, t as getBoardPositionStyle, u as useCanvuChromeContext, v as useCanvuDocumentContext, w as useCanvuPluginContext, x as useCanvuPluginContribution, y as useCanvuResolvedTools, z as useCanvuViewportContext } from './types-B6PAYKzx.js';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import * as react from 'react';
10
10
  import { CSSProperties, ReactNode, ReactElement, SVGProps } from 'react';
11
- import { C as Camera2D } from './camera-KwCYYPhm.js';
12
- import { V as VectorCanvasPersistenceAdapter, a as VectorCanvasRemoteAdapter } from './types-BtAJFS_-.js';
13
- export { b as VectorCanvasSnapshot } from './types-BtAJFS_-.js';
11
+ import { C as Camera2D } from './camera-AoTwBSoE.js';
12
+ import { V as VectorCanvasPersistenceAdapter, a as VectorCanvasRemoteAdapter } from './types-zmUah-vP.js';
13
+ export { b as VectorCanvasSnapshot } from './types-zmUah-vP.js';
14
14
 
15
15
  /**
16
16
  * Extra context for each item created by {@link ingestAssetFilesToSceneItems}.
@@ -425,7 +425,7 @@ declare function ShapeContextMenu({ x, y, allSelectedLocked, onClose, onToggleLo
425
425
  * Tool ids shown in the overflow menu at the end of the default toolbar (horizontal layout).
426
426
  * Order: shapes, marker, laser, image.
427
427
  */
428
- declare const DEFAULT_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "line", "marker", "laser", "image"];
428
+ declare const DEFAULT_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "architectural-cloud", "line", "marker", "laser", "image"];
429
429
  /**
430
430
  * Opinionated default tool strip using [Lucide](https://lucide.dev) icons.
431
431
  * Pass a subset or your own list via {@link VectorToolbarProps.tools}.
@@ -437,6 +437,7 @@ declare function IconHand(props: IconProps): react_jsx_runtime.JSX.Element;
437
437
  declare function IconSelect(props: IconProps): react_jsx_runtime.JSX.Element;
438
438
  declare function IconRect(props: IconProps): react_jsx_runtime.JSX.Element;
439
439
  declare function IconEllipse(props: IconProps): react_jsx_runtime.JSX.Element;
440
+ declare function IconArchitecturalCloud(props: IconProps): react_jsx_runtime.JSX.Element;
440
441
  declare function IconLine(props: IconProps): react_jsx_runtime.JSX.Element;
441
442
  declare function IconArrow(props: IconProps): react_jsx_runtime.JSX.Element;
442
443
  declare function IconDraw(props: IconProps): react_jsx_runtime.JSX.Element;
@@ -668,6 +669,7 @@ declare const HandBinding: ToolBinding;
668
669
  declare const SelectBinding: ToolBinding;
669
670
  declare const RectBinding: ToolBinding;
670
671
  declare const EllipseBinding: ToolBinding;
672
+ declare const ArchitecturalCloudBinding: ToolBinding;
671
673
  declare const LineBinding: ToolBinding;
672
674
  declare const ArrowBinding: ToolBinding;
673
675
  declare const DrawBinding: ToolBinding;
@@ -684,6 +686,7 @@ type VectorToolbarWithStatics = ((props: VectorToolbarProps) => ReactElement) &
684
686
  Select: typeof SelectBinding;
685
687
  Rect: typeof RectBinding;
686
688
  Ellipse: typeof EllipseBinding;
689
+ ArchitecturalCloud: typeof ArchitecturalCloudBinding;
687
690
  Line: typeof LineBinding;
688
691
  Arrow: typeof ArrowBinding;
689
692
  Draw: typeof DrawBinding;
@@ -703,4 +706,4 @@ type VectorToolbarWithStatics = ((props: VectorToolbarProps) => ReactElement) &
703
706
  */
704
707
  declare const VectorToolbar: VectorToolbarWithStatics;
705
708
 
706
- export { BoardComponentPosition, CanvasPlugin, type CreateLocalStoragePersistenceAdapterOptions, type CreateToolPluginOptions, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, type ImagesMenuLabels, type ImagesMenuProps, type IngestAssetFileError, type IngestAssetFilesToSceneItemsOptions, type IngestAssetFilesToSceneItemsResult, type IngestedAssetItemContext, NavMenu, type NavMenuMinimapProps, type NavMenuProps, type NavMenuUndoRedoProps, type NavMenuZoomControlsProps, ShapeContextMenu, type ShapeContextMenuProps, type UseVectorCanvasDocumentOptions, type UseVectorCanvasDocumentResult, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasPersistenceAdapter, VectorCanvasRemoteAdapter, VectorCanvasRoot, type VectorCanvasSlotProps, type VectorCanvasSpaceProps, VectorCanvasToolbar, type VectorCanvasToolbarProps, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolDefinition, VectorToolbar, type VectorToolbarOverflowProps, type VectorToolbarProps, type VectorToolbarRenderContext, type VectorToolbarToolLockProps, type VectorToolbarToolProps, VectorViewportAssetKind, VectorViewportAssetStore, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, ingestAssetFilesToSceneItems, useVectorCanvasDocument };
709
+ export { BoardComponentPosition, CanvasPlugin, type CreateLocalStoragePersistenceAdapterOptions, type CreateToolPluginOptions, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArchitecturalCloud, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, type ImagesMenuLabels, type ImagesMenuProps, type IngestAssetFileError, type IngestAssetFilesToSceneItemsOptions, type IngestAssetFilesToSceneItemsResult, type IngestedAssetItemContext, NavMenu, type NavMenuMinimapProps, type NavMenuProps, type NavMenuUndoRedoProps, type NavMenuZoomControlsProps, ShapeContextMenu, type ShapeContextMenuProps, type UseVectorCanvasDocumentOptions, type UseVectorCanvasDocumentResult, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasPersistenceAdapter, VectorCanvasRemoteAdapter, VectorCanvasRoot, type VectorCanvasSlotProps, type VectorCanvasSpaceProps, VectorCanvasToolbar, type VectorCanvasToolbarProps, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolDefinition, VectorToolbar, type VectorToolbarOverflowProps, type VectorToolbarProps, type VectorToolbarRenderContext, type VectorToolbarToolLockProps, type VectorToolbarToolProps, VectorViewportAssetKind, VectorViewportAssetStore, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, ingestAssetFilesToSceneItems, useVectorCanvasDocument };
package/dist/react.js CHANGED
@@ -174,6 +174,8 @@ __export(shape_builders_exports, {
174
174
  DEFAULT_TEXT_FONT_SIZE: () => DEFAULT_TEXT_FONT_SIZE,
175
175
  applyStrokeToItem: () => applyStrokeToItem,
176
176
  applyTextDraftWhileEditing: () => applyTextDraftWhileEditing,
177
+ buildArchitecturalCloudPathD: () => buildArchitecturalCloudPathD,
178
+ buildArchitecturalCloudSvg: () => buildArchitecturalCloudSvg,
177
179
  buildArrowSvg: () => buildArrowSvg,
178
180
  buildDrawDotSvg: () => buildDrawDotSvg,
179
181
  buildEllipseSvg: () => buildEllipseSvg,
@@ -185,6 +187,7 @@ __export(shape_builders_exports, {
185
187
  buildTextSvg: () => buildTextSvg,
186
188
  computeFreehandSvgPayload: () => computeFreehandSvgPayload,
187
189
  computeStraightArrowGeometry: () => computeStraightArrowGeometry,
190
+ createArchitecturalCloudItem: () => createArchitecturalCloudItem,
188
191
  createDrawDotItem: () => createDrawDotItem,
189
192
  createEllipseItem: () => createEllipseItem,
190
193
  createFreehandStrokeItem: () => createFreehandStrokeItem,
@@ -276,6 +279,22 @@ function resolveStrokeStyle(item) {
276
279
  function strokeOpacityAttr(style) {
277
280
  return style.strokeOpacity != null ? ` stroke-opacity="${style.strokeOpacity}"` : "";
278
281
  }
282
+ function svgNumber(value) {
283
+ if (!Number.isFinite(value)) return "0";
284
+ const rounded = Math.round(value * 100) / 100;
285
+ return Number.isInteger(rounded) ? String(rounded) : String(rounded);
286
+ }
287
+ function approximateEllipsePerimeter(rx, ry) {
288
+ if (rx <= 0 || ry <= 0) return 0;
289
+ return Math.PI * (3 * (rx + ry) - Math.sqrt((3 * rx + ry) * (rx + 3 * ry)));
290
+ }
291
+ function architecturalCloudScallopCount(rx, ry, amplitude) {
292
+ const perimeter = approximateEllipsePerimeter(rx, ry);
293
+ const targetScallopLength = Math.max(10, amplitude * 2);
294
+ let count = Math.max(12, Math.round(perimeter / targetScallopLength));
295
+ if (count % 2 === 1) count += 1;
296
+ return count;
297
+ }
279
298
  function buildRectSvg(width, height, style = DEFAULT_STROKE_STYLE) {
280
299
  return `<rect width="${width}" height="${height}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}" rx="4"${strokeOpacityAttr(style)} />`;
281
300
  }
@@ -284,6 +303,49 @@ function buildEllipseSvg(width, height, style = DEFAULT_STROKE_STYLE) {
284
303
  const ry = height / 2;
285
304
  return `<ellipse cx="${rx}" cy="${ry}" rx="${rx}" ry="${ry}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}"${strokeOpacityAttr(style)} />`;
286
305
  }
306
+ function buildArchitecturalCloudPathD(width, height, strokeWidth = DEFAULT_STROKE_STYLE.strokeWidth) {
307
+ const w = Math.max(0, width);
308
+ const h = Math.max(0, height);
309
+ if (w <= 0 || h <= 0) return "";
310
+ const inset = Math.max(0.5, strokeWidth / 2);
311
+ const outerRx = Math.max(0, w / 2 - inset);
312
+ const outerRy = Math.max(0, h / 2 - inset);
313
+ if (outerRx <= 0 || outerRy <= 0) return "";
314
+ const amplitude = Math.min(
315
+ outerRx * 0.45,
316
+ outerRy * 0.45,
317
+ Math.max(2, Math.min(8, Math.min(w, h) * 0.04))
318
+ );
319
+ const innerRx = Math.max(0, outerRx - amplitude);
320
+ const innerRy = Math.max(0, outerRy - amplitude);
321
+ const scallopCount = architecturalCloudScallopCount(innerRx, innerRy, amplitude);
322
+ const angleStep = Math.PI * 2 / scallopCount;
323
+ const cx = w / 2;
324
+ const cy = h / 2;
325
+ const startAngle = -Math.PI / 2;
326
+ const pointOnEllipse = (theta, radiusX, radiusY) => [
327
+ cx + Math.cos(theta) * radiusX,
328
+ cy + Math.sin(theta) * radiusY
329
+ ];
330
+ const [startX, startY] = pointOnEllipse(startAngle, innerRx, innerRy);
331
+ const segments = [`M${svgNumber(startX)} ${svgNumber(startY)}`];
332
+ for (let index = 0; index < scallopCount; index += 1) {
333
+ const segmentStart = startAngle + index * angleStep;
334
+ const segmentMid = segmentStart + angleStep / 2;
335
+ const segmentEnd = segmentStart + angleStep;
336
+ const [controlX, controlY] = pointOnEllipse(segmentMid, outerRx, outerRy);
337
+ const [endX, endY] = pointOnEllipse(segmentEnd, innerRx, innerRy);
338
+ segments.push(
339
+ `Q${svgNumber(controlX)} ${svgNumber(controlY)} ${svgNumber(endX)} ${svgNumber(endY)}`
340
+ );
341
+ }
342
+ segments.push("Z");
343
+ return segments.join(" ");
344
+ }
345
+ function buildArchitecturalCloudSvg(width, height, style = DEFAULT_STROKE_STYLE) {
346
+ const d = buildArchitecturalCloudPathD(width, height, style.strokeWidth);
347
+ return `<path d="${d}" fill="none" stroke="${style.stroke}" stroke-width="${style.strokeWidth}" stroke-linecap="round" stroke-linejoin="round"${strokeOpacityAttr(style)} />`;
348
+ }
287
349
  function buildLineSvg(line, style = DEFAULT_STROKE_STYLE) {
288
350
  return `<line x1="${line.x1}" y1="${line.y1}" x2="${line.x2}" y2="${line.y2}" stroke="${style.stroke}" stroke-width="${style.strokeWidth}"${strokeOpacityAttr(style)} />`;
289
351
  }
@@ -426,6 +488,13 @@ function rebuildItemSvg(item) {
426
488
  childrenSvg: buildEllipseSvg(b.width, b.height, style)
427
489
  };
428
490
  }
491
+ if (k === "architectural-cloud") {
492
+ const b = normalizeRect(item.bounds);
493
+ return {
494
+ ...item,
495
+ childrenSvg: buildArchitecturalCloudSvg(b.width, b.height, style)
496
+ };
497
+ }
429
498
  if ((k === "line" || k === "arrow") && item.line) {
430
499
  const line = item.line;
431
500
  const childrenSvg = k === "arrow" ? buildArrowSvg(item.id, line, style) : buildLineSvg(line, style);
@@ -538,6 +607,21 @@ function createEllipseItem(id, bounds, style) {
538
607
  childrenSvg: ""
539
608
  });
540
609
  }
610
+ function createArchitecturalCloudItem(id, bounds, style) {
611
+ const r = normalizeRect(bounds);
612
+ const s = { ...DEFAULT_STROKE_STYLE, ...style };
613
+ return rebuildItemSvg({
614
+ id,
615
+ x: r.x,
616
+ y: r.y,
617
+ bounds: { ...r },
618
+ toolKind: "architectural-cloud",
619
+ stroke: s.stroke,
620
+ strokeWidth: s.strokeWidth,
621
+ ...s.strokeOpacity != null ? { strokeOpacity: s.strokeOpacity } : {},
622
+ childrenSvg: ""
623
+ });
624
+ }
541
625
  function createLineItem(id, bounds, line, toolKind, style, arrowBind) {
542
626
  const r = normalizeRect(bounds);
543
627
  const s = { ...DEFAULT_STROKE_STYLE, ...style };
@@ -3012,6 +3096,7 @@ function ShapeContextMenu({
3012
3096
  }
3013
3097
  return createPortal(menu, document.body);
3014
3098
  }
3099
+ var architecturalCloudIconPath = "M12 8.28 Q14.33 7.17 15.86 8.78 Q18.36 8.46 18.69 10.14 Q20.69 10.71 19.72 12 Q20.69 13.29 18.69 13.86 Q18.36 15.54 15.86 15.22 Q14.33 16.83 12 15.72 Q9.67 16.83 8.14 15.22 Q5.64 15.54 5.31 13.86 Q3.31 13.29 4.28 12 Q3.31 10.71 5.31 10.14 Q5.64 8.46 8.14 8.78 Q9.67 7.17 12 8.28 Z";
3015
3100
  var base = {
3016
3101
  width: 20,
3017
3102
  height: 20,
@@ -3042,6 +3127,9 @@ function IconRect(props) {
3042
3127
  function IconEllipse(props) {
3043
3128
  return /* @__PURE__ */ jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsx("ellipse", { cx: "12", cy: "12", rx: "9", ry: "6" }) });
3044
3129
  }
3130
+ function IconArchitecturalCloud(props) {
3131
+ return /* @__PURE__ */ jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: architecturalCloudIconPath, transform: "translate(0 4)" }) });
3132
+ }
3045
3133
  function IconLine(props) {
3046
3134
  return /* @__PURE__ */ jsx("svg", { ...base, ...props, "aria-hidden": true, children: /* @__PURE__ */ jsx("line", { x1: "5", y1: "19", x2: "19", y2: "5" }) });
3047
3135
  }
@@ -3086,6 +3174,7 @@ var ic = { size: 20, strokeWidth: 2 };
3086
3174
  var DEFAULT_OVERFLOW_TOOL_IDS = [
3087
3175
  "rect",
3088
3176
  "ellipse",
3177
+ "architectural-cloud",
3089
3178
  "line",
3090
3179
  "marker",
3091
3180
  "laser",
@@ -3116,6 +3205,13 @@ var DEFAULT_VECTOR_TOOLS = [
3116
3205
  icon: /* @__PURE__ */ jsx(Circle, { ...ic, "aria-hidden": true }),
3117
3206
  shortcutHint: "O"
3118
3207
  },
3208
+ {
3209
+ id: "architectural-cloud",
3210
+ label: "Nuvem arquitetural",
3211
+ tooltipLabel: "Architectural cloud",
3212
+ icon: /* @__PURE__ */ jsx(IconArchitecturalCloud, { "aria-hidden": true }),
3213
+ shortcutHint: "C"
3214
+ },
3119
3215
  {
3120
3216
  id: "line",
3121
3217
  label: "Line",
@@ -3193,7 +3289,7 @@ function normalizeHex(stroke) {
3193
3289
  return "#2563eb";
3194
3290
  }
3195
3291
  function isStylableKind(tk) {
3196
- return tk === "rect" || tk === "ellipse" || tk === "line" || tk === "arrow" || tk === "draw" || tk === "pencil" || tk === "brush" || tk === "marker" || tk === "text";
3292
+ return tk === "rect" || tk === "ellipse" || tk === "architectural-cloud" || tk === "line" || tk === "arrow" || tk === "draw" || tk === "pencil" || tk === "brush" || tk === "marker" || tk === "text";
3197
3293
  }
3198
3294
  function VectorSelectionInspector({
3199
3295
  items: itemsProp,
@@ -4554,6 +4650,7 @@ var HandBinding = makeToolBinding("hand");
4554
4650
  var SelectBinding = makeToolBinding("select");
4555
4651
  var RectBinding = makeToolBinding("rect");
4556
4652
  var EllipseBinding = makeToolBinding("ellipse");
4653
+ var ArchitecturalCloudBinding = makeToolBinding("architectural-cloud");
4557
4654
  var LineBinding = makeToolBinding("line");
4558
4655
  var ArrowBinding = makeToolBinding("arrow");
4559
4656
  var DrawBinding = makeToolBinding("draw");
@@ -4573,6 +4670,7 @@ var VectorToolbar = Object.assign(
4573
4670
  Select: SelectBinding,
4574
4671
  Rect: RectBinding,
4575
4672
  Ellipse: EllipseBinding,
4673
+ ArchitecturalCloud: ArchitecturalCloudBinding,
4576
4674
  Line: LineBinding,
4577
4675
  Arrow: ArrowBinding,
4578
4676
  Draw: DrawBinding,
@@ -5302,7 +5400,7 @@ function isArrowBindTarget(item) {
5302
5400
  if (item.locked) return false;
5303
5401
  const k = item.toolKind;
5304
5402
  if (!k) return false;
5305
- return k === "rect" || k === "ellipse" || k === "text" || k === "image" || k === "custom";
5403
+ return k === "rect" || k === "ellipse" || k === "architectural-cloud" || k === "text" || k === "image" || k === "custom";
5306
5404
  }
5307
5405
  function closestPointOnShapeBoundaryLocal(item, lx, ly, w, h) {
5308
5406
  if (item.toolKind === "ellipse") {
@@ -5641,6 +5739,16 @@ function resizeItemByHandle(item, start, handle, currentWorld) {
5641
5739
  childrenSvg: buildEllipseSvg(nb.width, nb.height, style)
5642
5740
  };
5643
5741
  }
5742
+ if (k === "architectural-cloud") {
5743
+ const style = resolveStrokeStyle(item);
5744
+ return {
5745
+ ...item,
5746
+ x: nb.x,
5747
+ y: nb.y,
5748
+ bounds: nb,
5749
+ childrenSvg: buildArchitecturalCloudSvg(nb.width, nb.height, style)
5750
+ };
5751
+ }
5644
5752
  if (k === "text" && item.text !== void 0) {
5645
5753
  const sfw = Math.max(sb.width, 1e-6);
5646
5754
  const sfh = Math.max(sb.height, 1e-6);
@@ -6183,7 +6291,7 @@ function InteractionOverlay({
6183
6291
  vectorEffect: "non-scaling-stroke"
6184
6292
  }
6185
6293
  );
6186
- } else if (placementPreview.kind === "rect" || placementPreview.kind === "ellipse") {
6294
+ } else if (placementPreview.kind === "rect" || placementPreview.kind === "ellipse" || placementPreview.kind === "architectural-cloud") {
6187
6295
  const r = normalizeRect(placementPreview.rect);
6188
6296
  preview = placementPreview.kind === "rect" ? /* @__PURE__ */ jsx(
6189
6297
  "rect",
@@ -6198,7 +6306,7 @@ function InteractionOverlay({
6198
6306
  strokeDasharray: dashPattern,
6199
6307
  vectorEffect: "non-scaling-stroke"
6200
6308
  }
6201
- ) : /* @__PURE__ */ jsx(
6309
+ ) : placementPreview.kind === "ellipse" ? /* @__PURE__ */ jsx(
6202
6310
  "ellipse",
6203
6311
  {
6204
6312
  cx: r.x + r.width / 2,
@@ -6211,7 +6319,19 @@ function InteractionOverlay({
6211
6319
  strokeDasharray: dashPattern,
6212
6320
  vectorEffect: "non-scaling-stroke"
6213
6321
  }
6214
- );
6322
+ ) : /* @__PURE__ */ jsx("g", { transform: `translate(${r.x}, ${r.y})`, children: /* @__PURE__ */ jsx(
6323
+ "path",
6324
+ {
6325
+ d: buildArchitecturalCloudPathD(r.width, r.height, overlayStrokePx),
6326
+ fill: "none",
6327
+ stroke: "#64748b",
6328
+ strokeWidth: overlayStrokePx,
6329
+ strokeDasharray: dashPattern,
6330
+ strokeLinecap: "round",
6331
+ strokeLinejoin: "round",
6332
+ vectorEffect: "non-scaling-stroke"
6333
+ }
6334
+ ) });
6215
6335
  } else if (placementPreview.kind === "line" || placementPreview.kind === "arrow") {
6216
6336
  const { start, end } = placementPreview;
6217
6337
  const geometry = placementPreview.kind === "arrow" ? computeStraightArrowGeometry(
@@ -6784,6 +6904,7 @@ function cursorForVectorToolId(toolId) {
6784
6904
  return "default";
6785
6905
  case "rect":
6786
6906
  case "ellipse":
6907
+ case "architectural-cloud":
6787
6908
  case "line":
6788
6909
  case "arrow":
6789
6910
  return "crosshair";
@@ -6834,7 +6955,7 @@ function replaceItem(items, id, next) {
6834
6955
  }
6835
6956
  function supportsResizeHandles(item) {
6836
6957
  const k = item?.toolKind;
6837
- if (k === "rect" || k === "ellipse" || k === "line" || k === "arrow" || k === "image" || k === "text") {
6958
+ if (k === "rect" || k === "ellipse" || k === "architectural-cloud" || k === "line" || k === "arrow" || k === "image" || k === "text") {
6838
6959
  return true;
6839
6960
  }
6840
6961
  if ((k === "draw" || k === "pencil" || k === "brush" || k === "marker") && item?.pathPointsLocal && item.pathPointsLocal.length > 0) {
@@ -6891,6 +7012,9 @@ function defaultPlacementWorld(tool, center) {
6891
7012
  if (tool === "ellipse") {
6892
7013
  return { raw: { x: cx - 70, y: cy - 45, width: 140, height: 90 } };
6893
7014
  }
7015
+ if (tool === "architectural-cloud") {
7016
+ return { raw: { x: cx - 90, y: cy - 50, width: 180, height: 100 } };
7017
+ }
6894
7018
  const a = { x: cx - 50, y: cy };
6895
7019
  const b = { x: cx + 50, y: cy };
6896
7020
  return {
@@ -8794,7 +8918,7 @@ var VectorViewport = forwardRef(
8794
8918
  return;
8795
8919
  }
8796
8920
  const cp = customPlacementRef.current;
8797
- if (tool === "rect" || tool === "ellipse" || tool === "line" || tool === "arrow" || cp && tool === cp.toolId) {
8921
+ if (tool === "rect" || tool === "ellipse" || tool === "architectural-cloud" || tool === "line" || tool === "arrow" || cp && tool === cp.toolId) {
8798
8922
  dragStateRef.current = {
8799
8923
  kind: "place",
8800
8924
  tool,
@@ -9214,6 +9338,11 @@ var VectorViewport = forwardRef(
9214
9338
  setPlacementPreview({ kind: "rect", rect: rectFromCorners(a, b) });
9215
9339
  } else if (st.tool === "ellipse") {
9216
9340
  setPlacementPreview({ kind: "ellipse", rect: rectFromCorners(a, b) });
9341
+ } else if (st.tool === "architectural-cloud") {
9342
+ setPlacementPreview({
9343
+ kind: "architectural-cloud",
9344
+ rect: rectFromCorners(a, b)
9345
+ });
9217
9346
  } else if (st.tool === "line") {
9218
9347
  setPlacementPreview({
9219
9348
  kind: "line",
@@ -9472,6 +9601,12 @@ var VectorViewport = forwardRef(
9472
9601
  } else if (st.tool === "ellipse") {
9473
9602
  change([...itemsRef.current, createEllipseItem(id, raw, pen)]);
9474
9603
  setEffectiveSelectedIdsRef.current([id]);
9604
+ } else if (st.tool === "architectural-cloud") {
9605
+ change([
9606
+ ...itemsRef.current,
9607
+ createArchitecturalCloudItem(id, raw, pen)
9608
+ ]);
9609
+ setEffectiveSelectedIdsRef.current([id]);
9475
9610
  } else if (st.tool === "line" || st.tool === "arrow") {
9476
9611
  const line = lineEndpointsToLocal(raw, lineA, lineB);
9477
9612
  change([
@@ -9788,6 +9923,6 @@ var VectorViewport = forwardRef(
9788
9923
  );
9789
9924
  VectorViewport.displayName = "VectorViewport";
9790
9925
 
9791
- export { CanvuChromeContext, CanvuPluginContext, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, NavMenu, ShapeContextMenu, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasRoot, VectorCanvasToolbar, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolbar, VectorViewport, createCanvuPlugin, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, getBoardPositionStyle, hydrateSceneItemsWithAssets, ingestAssetFilesToSceneItems, useCanvuChromeContext, useCanvuDocumentContext, useCanvuPluginContext, useCanvuPluginContribution, useCanvuResolvedTools, useCanvuViewportContext, useVectorCanvasDocument };
9926
+ export { CanvuChromeContext, CanvuPluginContext, DEFAULT_OVERFLOW_TOOL_IDS, DEFAULT_VECTOR_CANVAS_STORAGE_KEY, DEFAULT_VECTOR_TOOLS, IconArchitecturalCloud, IconArrow, IconDraw, IconEllipse, IconHand, IconImage, IconLaser, IconLine, IconRect, IconSelect, IconText, ImagesMenu, NavMenu, ShapeContextMenu, VectorCanvas, VectorCanvasBody, VectorCanvasHeader, VectorCanvasMain, VectorCanvasRoot, VectorCanvasToolbar, VectorCanvasViewportSurface, VectorSelectionInspector, VectorToolbar, VectorViewport, createCanvuPlugin, createIndexedDbPersistenceAdapter, createLocalStoragePersistenceAdapter, createNoopPersistenceAdapter, createToolPlugin, cursorForVectorToolId, getBoardPositionStyle, hydrateSceneItemsWithAssets, ingestAssetFilesToSceneItems, useCanvuChromeContext, useCanvuDocumentContext, useCanvuPluginContext, useCanvuPluginContribution, useCanvuResolvedTools, useCanvuViewportContext, useVectorCanvasDocument };
9792
9927
  //# sourceMappingURL=react.js.map
9793
9928
  //# sourceMappingURL=react.js.map