canvu-react 0.3.39 → 0.4.0

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-DowNdaOJ.d.cts → asset-hydration-B7yMDQE-.d.cts} +2 -2
  2. package/dist/{asset-hydration-DdFLdlqX.d.ts → asset-hydration-CbwQVAwh.d.ts} +2 -2
  3. package/dist/{camera-Di5R_Rwl.d.cts → camera-CVVG7z56.d.cts} +1 -1
  4. package/dist/{camera-AoTwBSoE.d.ts → camera-CoRYN_IV.d.ts} +1 -1
  5. package/dist/chatbot.d.cts +4 -4
  6. package/dist/chatbot.d.ts +4 -4
  7. package/dist/index.cjs +59 -15
  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 +59 -15
  12. package/dist/index.js.map +1 -1
  13. package/dist/native.cjs +57 -14
  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 +57 -14
  18. package/dist/native.js.map +1 -1
  19. package/dist/react.cjs +699 -255
  20. package/dist/react.cjs.map +1 -1
  21. package/dist/react.d.cts +10 -10
  22. package/dist/react.d.ts +10 -10
  23. package/dist/react.js +699 -255
  24. package/dist/react.js.map +1 -1
  25. package/dist/realtime.cjs +498 -129
  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 +479 -129
  30. package/dist/realtime.js.map +1 -1
  31. package/dist/{shape-builders-Dedcl6tw.d.cts → shape-builders-BAWu-PxX.d.cts} +7 -3
  32. package/dist/{shape-builders-C7bxJBGR.d.ts → shape-builders-ClKv9tz9.d.ts} +7 -3
  33. package/dist/tldraw.cjs +56 -14
  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 +56 -14
  38. package/dist/tldraw.js.map +1 -1
  39. package/dist/{types-DUW61Tjy.d.cts → types-BC9Xgfu6.d.cts} +11 -6
  40. package/dist/{types-Bnq2HtHQ.d.cts → types-BCCvY6ie.d.cts} +2 -0
  41. package/dist/{types-Bnq2HtHQ.d.ts → types-BCCvY6ie.d.ts} +2 -0
  42. package/dist/{types-B2Na677H.d.cts → types-BUPc2Zgw.d.cts} +1 -1
  43. package/dist/{types-zmUah-vP.d.ts → types-CYtq9Pr9.d.ts} +1 -1
  44. package/dist/{types-BBb8KoyW.d.ts → types-DlSVGX0w.d.ts} +11 -6
  45. package/package.json +3 -2
@@ -1,18 +1,22 @@
1
1
  import * as react from 'react';
2
2
  import { CSSProperties, ReactNode, RefObject } from 'react';
3
- import { V as VectorSceneItem, R as Rect } from './types-Bnq2HtHQ.cjs';
4
- import { C as Camera2D } from './camera-Di5R_Rwl.cjs';
5
- import { S as StrokeStyle, C as CanvuLinkData, E as VectorViewportAssetStore } from './shape-builders-Dedcl6tw.cjs';
3
+ import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.cjs';
4
+ import { C as Camera2D } from './camera-CVVG7z56.cjs';
5
+ import { S as StrokeStyle, C as CanvuLinkData, E as VectorViewportAssetStore } from './shape-builders-BAWu-PxX.cjs';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
8
  type CanvuChromeActiveToolStyle = StrokeStyle & {
9
- toolKind: "draw" | "marker";
9
+ toolKind: "draw" | "marker" | "text" | "rect" | "ellipse" | "architectural-cloud" | "line" | "arrow";
10
10
  label?: string;
11
+ /** Local font size when `toolKind === "text"`. */
12
+ textFontSize?: number;
11
13
  };
12
14
  type CanvuChromeSelectionStyleChange = (patch: {
13
15
  stroke: string;
14
16
  strokeWidth: number;
15
17
  strokeOpacity?: number;
18
+ strokeDash?: "solid" | "dashed";
19
+ textFontSize?: number;
16
20
  }) => void;
17
21
  /**
18
22
  * Runtime data and handlers shared with floating board chrome (e.g. {@link NavMenu},
@@ -179,8 +183,9 @@ type PresenceOverlayRenderContext = {
179
183
  };
180
184
 
181
185
  type ActiveToolStyle = StrokeStyle & {
182
- toolKind: "draw" | "marker";
186
+ toolKind: "draw" | "marker" | "text" | "rect" | "ellipse" | "architectural-cloud" | "line" | "arrow";
183
187
  label?: string;
188
+ textFontSize?: number;
184
189
  };
185
190
  /**
186
191
  * Color + stroke-width inspector for the current selection (or active drawing tool style).
@@ -193,7 +198,7 @@ type VectorSelectionInspectorProps = {
193
198
  items?: readonly VectorSceneItem[];
194
199
  /** Optional active tool style shown even without a selection. */
195
200
  activeToolStyle?: ActiveToolStyle | null;
196
- /** Apply stroke / width / opacity to every item in `items`. */
201
+ /** Apply stroke / width / opacity / dash / text size to every item in `items`. */
197
202
  onChange?: CanvuChromeSelectionStyleChange;
198
203
  /** Anchor preset. Defaults to top-left. */
199
204
  position?: BoardComponentPosition;
@@ -80,6 +80,8 @@ type VectorSceneItem = {
80
80
  readonly strokeWidth?: number;
81
81
  /** Optional stroke opacity (e.g. highlighter `~0.45`). */
82
82
  readonly strokeOpacity?: number;
83
+ /** Dash style for freehand drawings (`"dashed"` paints a centerline with dash gaps). */
84
+ readonly strokeDash?: "solid" | "dashed";
83
85
  /**
84
86
  * Polyline for freehand tools (`draw`, `marker`; legacy `pencil` / `brush`) in **local** coords relative to `x`,`y`.
85
87
  */
@@ -80,6 +80,8 @@ type VectorSceneItem = {
80
80
  readonly strokeWidth?: number;
81
81
  /** Optional stroke opacity (e.g. highlighter `~0.45`). */
82
82
  readonly strokeOpacity?: number;
83
+ /** Dash style for freehand drawings (`"dashed"` paints a centerline with dash gaps). */
84
+ readonly strokeDash?: "solid" | "dashed";
83
85
  /**
84
86
  * Polyline for freehand tools (`draw`, `marker`; legacy `pencil` / `brush`) in **local** coords relative to `x`,`y`.
85
87
  */
@@ -1,4 +1,4 @@
1
- import { V as VectorSceneItem } from './types-Bnq2HtHQ.cjs';
1
+ import { V as VectorSceneItem } from './types-BCCvY6ie.cjs';
2
2
 
3
3
  /**
4
4
  * Serializable document for persistence (localStorage, API, WebSocket).
@@ -1,4 +1,4 @@
1
- import { V as VectorSceneItem } from './types-Bnq2HtHQ.js';
1
+ import { V as VectorSceneItem } from './types-BCCvY6ie.js';
2
2
 
3
3
  /**
4
4
  * Serializable document for persistence (localStorage, API, WebSocket).
@@ -1,18 +1,22 @@
1
1
  import * as react from 'react';
2
2
  import { CSSProperties, ReactNode, RefObject } from 'react';
3
- import { V as VectorSceneItem, R as Rect } from './types-Bnq2HtHQ.js';
4
- import { C as Camera2D } from './camera-AoTwBSoE.js';
5
- import { S as StrokeStyle, C as CanvuLinkData, E as VectorViewportAssetStore } from './shape-builders-C7bxJBGR.js';
3
+ import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.js';
4
+ import { C as Camera2D } from './camera-CoRYN_IV.js';
5
+ import { S as StrokeStyle, C as CanvuLinkData, E as VectorViewportAssetStore } from './shape-builders-ClKv9tz9.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
8
  type CanvuChromeActiveToolStyle = StrokeStyle & {
9
- toolKind: "draw" | "marker";
9
+ toolKind: "draw" | "marker" | "text" | "rect" | "ellipse" | "architectural-cloud" | "line" | "arrow";
10
10
  label?: string;
11
+ /** Local font size when `toolKind === "text"`. */
12
+ textFontSize?: number;
11
13
  };
12
14
  type CanvuChromeSelectionStyleChange = (patch: {
13
15
  stroke: string;
14
16
  strokeWidth: number;
15
17
  strokeOpacity?: number;
18
+ strokeDash?: "solid" | "dashed";
19
+ textFontSize?: number;
16
20
  }) => void;
17
21
  /**
18
22
  * Runtime data and handlers shared with floating board chrome (e.g. {@link NavMenu},
@@ -179,8 +183,9 @@ type PresenceOverlayRenderContext = {
179
183
  };
180
184
 
181
185
  type ActiveToolStyle = StrokeStyle & {
182
- toolKind: "draw" | "marker";
186
+ toolKind: "draw" | "marker" | "text" | "rect" | "ellipse" | "architectural-cloud" | "line" | "arrow";
183
187
  label?: string;
188
+ textFontSize?: number;
184
189
  };
185
190
  /**
186
191
  * Color + stroke-width inspector for the current selection (or active drawing tool style).
@@ -193,7 +198,7 @@ type VectorSelectionInspectorProps = {
193
198
  items?: readonly VectorSceneItem[];
194
199
  /** Optional active tool style shown even without a selection. */
195
200
  activeToolStyle?: ActiveToolStyle | null;
196
- /** Apply stroke / width / opacity to every item in `items`. */
201
+ /** Apply stroke / width / opacity / dash / text size to every item in `items`. */
197
202
  onChange?: CanvuChromeSelectionStyleChange;
198
203
  /** Anchor preset. Defaults to top-left. */
199
204
  position?: BoardComponentPosition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvu-react",
3
- "version": "0.3.39",
3
+ "version": "0.4.0",
4
4
  "description": "Vector-first infinite canvas (SVG) with pan, zoom, React bindings, and optional plugins",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -64,7 +64,8 @@
64
64
  "@dnd-kit/sortable": "^10.0.0",
65
65
  "@dnd-kit/utilities": "^3.2.2",
66
66
  "pdfjs-dist": "^5.7.284",
67
- "perfect-freehand": "^1.2.3"
67
+ "perfect-freehand": "^1.2.3",
68
+ "yjs": "^13.6.20"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "@ai-sdk/react": "^3.0.0",