canvu-react 0.3.38 → 0.3.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{asset-hydration-EtEuBwb7.d.cts → asset-hydration-B7yMDQE-.d.cts} +2 -2
- package/dist/{asset-hydration-DrTOgDdd.d.ts → asset-hydration-CbwQVAwh.d.ts} +2 -2
- package/dist/{camera-Di5R_Rwl.d.cts → camera-CVVG7z56.d.cts} +1 -1
- package/dist/{camera-AoTwBSoE.d.ts → camera-CoRYN_IV.d.ts} +1 -1
- package/dist/chatbot.d.cts +4 -4
- package/dist/chatbot.d.ts +4 -4
- package/dist/index.cjs +164 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +159 -16
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +57 -14
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +2 -2
- package/dist/native.d.ts +2 -2
- package/dist/native.js +57 -14
- package/dist/native.js.map +1 -1
- package/dist/react.cjs +731 -258
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +10 -10
- package/dist/react.d.ts +10 -10
- package/dist/react.js +731 -258
- package/dist/react.js.map +1 -1
- package/dist/realtime.cjs +36 -0
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +6 -6
- package/dist/realtime.d.ts +6 -6
- package/dist/realtime.js +36 -0
- package/dist/realtime.js.map +1 -1
- package/dist/{shape-builders-CsbSRZnQ.d.cts → shape-builders-BAWu-PxX.d.cts} +46 -4
- package/dist/{shape-builders-CsSXKCcs.d.ts → shape-builders-ClKv9tz9.d.ts} +46 -4
- package/dist/tldraw.cjs +189 -78
- package/dist/tldraw.cjs.map +1 -1
- package/dist/tldraw.d.cts +1 -1
- package/dist/tldraw.d.ts +1 -1
- package/dist/tldraw.js +189 -78
- package/dist/tldraw.js.map +1 -1
- package/dist/{types-DWGk2_GZ.d.cts → types-BC9Xgfu6.d.cts} +20 -6
- package/dist/{types-Bnq2HtHQ.d.cts → types-BCCvY6ie.d.cts} +2 -0
- package/dist/{types-Bnq2HtHQ.d.ts → types-BCCvY6ie.d.ts} +2 -0
- package/dist/{types-B2Na677H.d.cts → types-BUPc2Zgw.d.cts} +1 -1
- package/dist/{types-zmUah-vP.d.ts → types-CYtq9Pr9.d.ts} +1 -1
- package/dist/{types-B6PAYKzx.d.ts → types-DlSVGX0w.d.ts} +20 -6
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VectorSceneItem,
|
|
1
|
+
import { V as VectorSceneItem, R as Rect, L as LineEndpointsLocal, b as VectorPathPoint, a as ArrowBindings } from './types-BCCvY6ie.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Kind of binary selected through the built-in canvu asset ingestion flow.
|
|
@@ -110,11 +110,52 @@ type VectorViewportAssetStore = {
|
|
|
110
110
|
getHydrationRequest?: (item: VectorSceneItem) => VectorViewportAssetHydrationRequest | null;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
/** Plugin key under which link metadata is stored on a link item's `pluginData`. */
|
|
114
|
+
declare const LINK_PLUGIN_KEY = "canvuLink";
|
|
115
|
+
/**
|
|
116
|
+
* Metadata describing a clickable link/bookmark item.
|
|
117
|
+
* `href` is required; the rest enrich the rendered card (unfurl result).
|
|
118
|
+
*/
|
|
119
|
+
type CanvuLinkData = {
|
|
120
|
+
/** Absolute URL the card points to. */
|
|
121
|
+
href: string;
|
|
122
|
+
/** Human readable title (falls back to the hostname). */
|
|
123
|
+
title?: string;
|
|
124
|
+
/** Short description shown under the title. */
|
|
125
|
+
description?: string;
|
|
126
|
+
/** Preview image URL (og:image). */
|
|
127
|
+
image?: string;
|
|
128
|
+
/** Favicon URL shown in the leading badge. */
|
|
129
|
+
favicon?: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Builds the inner SVG (no outer `<svg>`) for a link/bookmark card at the given box size.
|
|
133
|
+
* Uses fixed pixel bands so text never overlaps regardless of the card's aspect ratio.
|
|
134
|
+
*/
|
|
135
|
+
declare function buildLinkCardSvg(width: number, height: number, link: CanvuLinkData): string;
|
|
136
|
+
/** Reads the link metadata from an item, or `null` when the item is not a link. */
|
|
137
|
+
declare function getLinkData(item: VectorSceneItem): CanvuLinkData | null;
|
|
138
|
+
/** True when the item carries link metadata (clickable card). */
|
|
139
|
+
declare function isLinkItem(item: VectorSceneItem): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Creates a clickable link/bookmark card item ready to append to the scene.
|
|
142
|
+
* The card resizes by scaling its authored SVG, like other custom shapes.
|
|
143
|
+
*/
|
|
144
|
+
declare function createLinkItem(id: string, bounds: Rect, link: CanvuLinkData): VectorSceneItem;
|
|
145
|
+
/** Default card size used when placing a new link without explicit bounds. */
|
|
146
|
+
declare const DEFAULT_LINK_CARD_SIZE: {
|
|
147
|
+
readonly width: 360;
|
|
148
|
+
readonly height: 132;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** Stroke dash pattern for freehand drawings. `solid` = perfect-freehand fill; `dashed` = centerline stroke with dashes. */
|
|
152
|
+
type StrokeDash = "solid" | "dashed";
|
|
113
153
|
/** Resolved stroke for SVG generation. */
|
|
114
154
|
type StrokeStyle = {
|
|
115
155
|
stroke: string;
|
|
116
156
|
strokeWidth: number;
|
|
117
157
|
strokeOpacity?: number;
|
|
158
|
+
strokeDash?: StrokeDash;
|
|
118
159
|
};
|
|
119
160
|
declare const DEFAULT_STROKE_STYLE: StrokeStyle;
|
|
120
161
|
declare function resolveStrokeStyle(item: VectorSceneItem): StrokeStyle;
|
|
@@ -164,6 +205,7 @@ type FreehandSvgPayload = {
|
|
|
164
205
|
stroke: string;
|
|
165
206
|
strokeWidth: number;
|
|
166
207
|
strokeOpacity?: number;
|
|
208
|
+
strokeDasharray?: string;
|
|
167
209
|
};
|
|
168
210
|
/**
|
|
169
211
|
* Computes freehand geometry (perfect-freehand + fallback). Used by {@link buildFreehandPathSvg}
|
|
@@ -198,7 +240,7 @@ declare function lineEndpointsToLocal(bounds: Rect, worldEndA: {
|
|
|
198
240
|
*/
|
|
199
241
|
declare function rebuildItemSvg(item: VectorSceneItem): VectorSceneItem;
|
|
200
242
|
/** Updates stroke color / width / opacity and refreshes the item’s SVG. */
|
|
201
|
-
declare function applyStrokeToItem(item: VectorSceneItem, patch: Partial<Pick<VectorSceneItem, "stroke" | "strokeWidth" | "strokeOpacity">>): VectorSceneItem;
|
|
243
|
+
declare function applyStrokeToItem(item: VectorSceneItem, patch: Partial<Pick<VectorSceneItem, "stroke" | "strokeWidth" | "strokeOpacity" | "strokeDash" | "textFontSize">>): VectorSceneItem;
|
|
202
244
|
/** Creates a rectangle shape ready to append to your scene `items` array. */
|
|
203
245
|
declare function createRectangleItem(id: string, bounds: Rect, style?: Partial<StrokeStyle>): VectorSceneItem;
|
|
204
246
|
/** Creates an ellipse shape. */
|
|
@@ -227,7 +269,7 @@ declare function createLineItem(id: string, bounds: Rect, line: LineEndpointsLoc
|
|
|
227
269
|
/** “Draw dot” tool: a small filled circle at (`worldX`, `worldY`). */
|
|
228
270
|
declare function createDrawDotItem(id: string, worldX: number, worldY: number, radius: number, style?: Partial<StrokeStyle>): VectorSceneItem;
|
|
229
271
|
/** Creates an editable text box (`stroke` is used as text fill). */
|
|
230
|
-
declare function createTextItem(id: string, bounds: Rect, text?: string, style?: Partial<StrokeStyle
|
|
272
|
+
declare function createTextItem(id: string, bounds: Rect, text?: string, style?: Partial<StrokeStyle>, textFontSize?: number): VectorSceneItem;
|
|
231
273
|
/** Freehand stroke from world-space points (main pen or marker highlight). */
|
|
232
274
|
declare function createFreehandStrokeItem(id: string, pointsWorld: readonly VectorPathPoint[], toolKind: "draw" | "marker", style?: Partial<StrokeStyle>): VectorSceneItem | null;
|
|
233
275
|
/** Places a bitmap (e.g. `data:image/png;base64,...`) inside `bounds`. */
|
|
@@ -241,4 +283,4 @@ declare function createImageFromVectorTrace(id: string, bounds: Rect, imageVecto
|
|
|
241
283
|
height: number;
|
|
242
284
|
}): VectorSceneItem;
|
|
243
285
|
|
|
244
|
-
export {
|
|
286
|
+
export { rebuildItemSvg as A, resolveStrokeStyle as B, type CanvuLinkData as C, DEFAULT_LINK_CARD_SIZE as D, type VectorViewportAssetStore as E, type FreehandSvgPayload as F, type VectorViewportAssetHydrationRequest as G, type VectorViewportAssetResolveRequest as H, type VectorViewportAssetResolveResult as I, type VectorViewportAssetUploadRequest as J, type VectorViewportAssetUploadResult as K, LINK_PLUGIN_KEY as L, type StrokeStyle as S, type VectorViewportAssetKind as V, DEFAULT_STROKE_STYLE as a, applyStrokeToItem as b, buildArchitecturalCloudPathD as c, buildArchitecturalCloudSvg as d, buildArrowSvg as e, buildDrawDotSvg as f, buildEllipseSvg as g, buildFreehandPathSvg as h, buildLineSvg as i, buildLinkCardSvg as j, buildRectSvg as k, computeFreehandSvgPayload as l, createArchitecturalCloudItem as m, createDrawDotItem as n, createEllipseItem as o, createFreehandStrokeItem as p, createImageFromVectorTrace as q, createImageItem as r, createLineItem as s, createLinkItem as t, createRectangleItem as u, createShapeId as v, createTextItem as w, getLinkData as x, isLinkItem as y, lineEndpointsToLocal as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VectorSceneItem,
|
|
1
|
+
import { V as VectorSceneItem, R as Rect, L as LineEndpointsLocal, b as VectorPathPoint, a as ArrowBindings } from './types-BCCvY6ie.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Kind of binary selected through the built-in canvu asset ingestion flow.
|
|
@@ -110,11 +110,52 @@ type VectorViewportAssetStore = {
|
|
|
110
110
|
getHydrationRequest?: (item: VectorSceneItem) => VectorViewportAssetHydrationRequest | null;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
/** Plugin key under which link metadata is stored on a link item's `pluginData`. */
|
|
114
|
+
declare const LINK_PLUGIN_KEY = "canvuLink";
|
|
115
|
+
/**
|
|
116
|
+
* Metadata describing a clickable link/bookmark item.
|
|
117
|
+
* `href` is required; the rest enrich the rendered card (unfurl result).
|
|
118
|
+
*/
|
|
119
|
+
type CanvuLinkData = {
|
|
120
|
+
/** Absolute URL the card points to. */
|
|
121
|
+
href: string;
|
|
122
|
+
/** Human readable title (falls back to the hostname). */
|
|
123
|
+
title?: string;
|
|
124
|
+
/** Short description shown under the title. */
|
|
125
|
+
description?: string;
|
|
126
|
+
/** Preview image URL (og:image). */
|
|
127
|
+
image?: string;
|
|
128
|
+
/** Favicon URL shown in the leading badge. */
|
|
129
|
+
favicon?: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Builds the inner SVG (no outer `<svg>`) for a link/bookmark card at the given box size.
|
|
133
|
+
* Uses fixed pixel bands so text never overlaps regardless of the card's aspect ratio.
|
|
134
|
+
*/
|
|
135
|
+
declare function buildLinkCardSvg(width: number, height: number, link: CanvuLinkData): string;
|
|
136
|
+
/** Reads the link metadata from an item, or `null` when the item is not a link. */
|
|
137
|
+
declare function getLinkData(item: VectorSceneItem): CanvuLinkData | null;
|
|
138
|
+
/** True when the item carries link metadata (clickable card). */
|
|
139
|
+
declare function isLinkItem(item: VectorSceneItem): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Creates a clickable link/bookmark card item ready to append to the scene.
|
|
142
|
+
* The card resizes by scaling its authored SVG, like other custom shapes.
|
|
143
|
+
*/
|
|
144
|
+
declare function createLinkItem(id: string, bounds: Rect, link: CanvuLinkData): VectorSceneItem;
|
|
145
|
+
/** Default card size used when placing a new link without explicit bounds. */
|
|
146
|
+
declare const DEFAULT_LINK_CARD_SIZE: {
|
|
147
|
+
readonly width: 360;
|
|
148
|
+
readonly height: 132;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/** Stroke dash pattern for freehand drawings. `solid` = perfect-freehand fill; `dashed` = centerline stroke with dashes. */
|
|
152
|
+
type StrokeDash = "solid" | "dashed";
|
|
113
153
|
/** Resolved stroke for SVG generation. */
|
|
114
154
|
type StrokeStyle = {
|
|
115
155
|
stroke: string;
|
|
116
156
|
strokeWidth: number;
|
|
117
157
|
strokeOpacity?: number;
|
|
158
|
+
strokeDash?: StrokeDash;
|
|
118
159
|
};
|
|
119
160
|
declare const DEFAULT_STROKE_STYLE: StrokeStyle;
|
|
120
161
|
declare function resolveStrokeStyle(item: VectorSceneItem): StrokeStyle;
|
|
@@ -164,6 +205,7 @@ type FreehandSvgPayload = {
|
|
|
164
205
|
stroke: string;
|
|
165
206
|
strokeWidth: number;
|
|
166
207
|
strokeOpacity?: number;
|
|
208
|
+
strokeDasharray?: string;
|
|
167
209
|
};
|
|
168
210
|
/**
|
|
169
211
|
* Computes freehand geometry (perfect-freehand + fallback). Used by {@link buildFreehandPathSvg}
|
|
@@ -198,7 +240,7 @@ declare function lineEndpointsToLocal(bounds: Rect, worldEndA: {
|
|
|
198
240
|
*/
|
|
199
241
|
declare function rebuildItemSvg(item: VectorSceneItem): VectorSceneItem;
|
|
200
242
|
/** Updates stroke color / width / opacity and refreshes the item’s SVG. */
|
|
201
|
-
declare function applyStrokeToItem(item: VectorSceneItem, patch: Partial<Pick<VectorSceneItem, "stroke" | "strokeWidth" | "strokeOpacity">>): VectorSceneItem;
|
|
243
|
+
declare function applyStrokeToItem(item: VectorSceneItem, patch: Partial<Pick<VectorSceneItem, "stroke" | "strokeWidth" | "strokeOpacity" | "strokeDash" | "textFontSize">>): VectorSceneItem;
|
|
202
244
|
/** Creates a rectangle shape ready to append to your scene `items` array. */
|
|
203
245
|
declare function createRectangleItem(id: string, bounds: Rect, style?: Partial<StrokeStyle>): VectorSceneItem;
|
|
204
246
|
/** Creates an ellipse shape. */
|
|
@@ -227,7 +269,7 @@ declare function createLineItem(id: string, bounds: Rect, line: LineEndpointsLoc
|
|
|
227
269
|
/** “Draw dot” tool: a small filled circle at (`worldX`, `worldY`). */
|
|
228
270
|
declare function createDrawDotItem(id: string, worldX: number, worldY: number, radius: number, style?: Partial<StrokeStyle>): VectorSceneItem;
|
|
229
271
|
/** Creates an editable text box (`stroke` is used as text fill). */
|
|
230
|
-
declare function createTextItem(id: string, bounds: Rect, text?: string, style?: Partial<StrokeStyle
|
|
272
|
+
declare function createTextItem(id: string, bounds: Rect, text?: string, style?: Partial<StrokeStyle>, textFontSize?: number): VectorSceneItem;
|
|
231
273
|
/** Freehand stroke from world-space points (main pen or marker highlight). */
|
|
232
274
|
declare function createFreehandStrokeItem(id: string, pointsWorld: readonly VectorPathPoint[], toolKind: "draw" | "marker", style?: Partial<StrokeStyle>): VectorSceneItem | null;
|
|
233
275
|
/** Places a bitmap (e.g. `data:image/png;base64,...`) inside `bounds`. */
|
|
@@ -241,4 +283,4 @@ declare function createImageFromVectorTrace(id: string, bounds: Rect, imageVecto
|
|
|
241
283
|
height: number;
|
|
242
284
|
}): VectorSceneItem;
|
|
243
285
|
|
|
244
|
-
export {
|
|
286
|
+
export { rebuildItemSvg as A, resolveStrokeStyle as B, type CanvuLinkData as C, DEFAULT_LINK_CARD_SIZE as D, type VectorViewportAssetStore as E, type FreehandSvgPayload as F, type VectorViewportAssetHydrationRequest as G, type VectorViewportAssetResolveRequest as H, type VectorViewportAssetResolveResult as I, type VectorViewportAssetUploadRequest as J, type VectorViewportAssetUploadResult as K, LINK_PLUGIN_KEY as L, type StrokeStyle as S, type VectorViewportAssetKind as V, DEFAULT_STROKE_STYLE as a, applyStrokeToItem as b, buildArchitecturalCloudPathD as c, buildArchitecturalCloudSvg as d, buildArrowSvg as e, buildDrawDotSvg as f, buildEllipseSvg as g, buildFreehandPathSvg as h, buildLineSvg as i, buildLinkCardSvg as j, buildRectSvg as k, computeFreehandSvgPayload as l, createArchitecturalCloudItem as m, createDrawDotItem as n, createEllipseItem as o, createFreehandStrokeItem as p, createImageFromVectorTrace as q, createImageItem as r, createLineItem as s, createLinkItem as t, createRectangleItem as u, createShapeId as v, createTextItem as w, getLinkData as x, isLinkItem as y, lineEndpointsToLocal as z };
|