canvu-react 0.3.17 → 0.3.19
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/chatbot.d.cts +1 -1
- package/dist/chatbot.d.ts +1 -1
- package/dist/index.cjs +87 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +79 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +2445 -1710
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +326 -35
- package/dist/react.d.ts +326 -35
- package/dist/react.js +2447 -1712
- package/dist/react.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/{types-CTyASYIm.d.cts → types-7kfWcm0L.d.cts} +33 -154
- package/dist/{types-UvUy2Eed.d.ts → types-C4k_AMvi.d.ts} +33 -154
- package/package.json +16 -1
package/dist/realtime.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlacementPreview, R as RemotePresenceMarkupStroke,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-7kfWcm0L.cjs';
|
|
2
|
+
export { F as PresenceOverlayRenderContext } from './types-7kfWcm0L.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { C as Camera2D } from './camera-BwQjm5oh.cjs';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-CB0TZZuk.cjs';
|
package/dist/realtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PlacementPreview, R as RemotePresenceMarkupStroke,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PlacementPreview, R as RemotePresenceMarkupStroke, A as RemotePresencePeer, D as RemotePresenceCamera, E as RealtimeConnectionState, q as VectorViewportHandle, V as VectorToolDefinition, r as VectorViewportProps, C as CanvasPlugin, e as CanvasPluginRenderContext } from './types-C4k_AMvi.js';
|
|
2
|
+
export { F as PresenceOverlayRenderContext } from './types-C4k_AMvi.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { C as Camera2D } from './camera-KwCYYPhm.js';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-CB0TZZuk.js';
|
|
@@ -69,43 +69,6 @@ type PlacementPreview = {
|
|
|
69
69
|
}[];
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
type ActiveToolStyle = StrokeStyle & {
|
|
73
|
-
toolKind: "draw" | "marker";
|
|
74
|
-
label?: string;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Color + stroke-width inspector for the current selection (or active drawing tool style).
|
|
78
|
-
* When rendered inside `VectorViewport` (e.g. via the `selectionInspector` slot), `items`,
|
|
79
|
-
* `activeToolStyle`, and `onChange` default to values from {@link CanvuChromeContext};
|
|
80
|
-
* pass any prop to override.
|
|
81
|
-
*/
|
|
82
|
-
type VectorSelectionInspectorProps = {
|
|
83
|
-
/** Selected items that support stroke/fill styling (caller may filter). */
|
|
84
|
-
items?: readonly VectorSceneItem[];
|
|
85
|
-
/** Optional active tool style shown even without a selection. */
|
|
86
|
-
activeToolStyle?: ActiveToolStyle | null;
|
|
87
|
-
/** Apply stroke / width / opacity to every item in `items`. */
|
|
88
|
-
onChange?: CanvuChromeSelectionStyleChange;
|
|
89
|
-
/** Anchor preset. Defaults to top-left. */
|
|
90
|
-
position?: BoardComponentPosition;
|
|
91
|
-
/** Distance (px) from anchored edges. @default 12 */
|
|
92
|
-
inset?: number;
|
|
93
|
-
/** @default 24 */
|
|
94
|
-
zIndex?: number;
|
|
95
|
-
className?: string;
|
|
96
|
-
/** Merged on top of position-derived styles for custom tweaks. */
|
|
97
|
-
style?: CSSProperties;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Color + stroke width for the current selection. Supports multiple selected shapes: one change applies to all.
|
|
101
|
-
*/
|
|
102
|
-
declare function VectorSelectionInspector({ items: itemsProp, activeToolStyle: activeToolStyleProp, onChange: onChangeProp, position, inset, zIndex, className, style, }: VectorSelectionInspectorProps): react_jsx_runtime.JSX.Element | null;
|
|
103
|
-
|
|
104
|
-
type VectorCanvasSlotProps = {
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
className?: string;
|
|
107
|
-
style?: CSSProperties;
|
|
108
|
-
};
|
|
109
72
|
/**
|
|
110
73
|
* Anchor presets for floating board components.
|
|
111
74
|
*
|
|
@@ -126,122 +89,6 @@ type VectorCanvasSpacePosition = BoardComponentPosition;
|
|
|
126
89
|
* Callers merge the result with their own style/className overrides.
|
|
127
90
|
*/
|
|
128
91
|
declare function getBoardPositionStyle(position: BoardComponentPosition, inset?: number, zIndex?: number): CSSProperties;
|
|
129
|
-
type VectorCanvasSpaceProps = VectorCanvasSlotProps & {
|
|
130
|
-
position?: BoardComponentPosition;
|
|
131
|
-
/** @default 12 */
|
|
132
|
-
inset?: number;
|
|
133
|
-
/** @default 40 */
|
|
134
|
-
zIndex?: number;
|
|
135
|
-
/** Pointer events value on the content wrapper. @default "auto" */
|
|
136
|
-
contentPointerEvents?: CSSProperties["pointerEvents"];
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Full-viewport column shell for a vector canvas (header + body with stage).
|
|
140
|
-
* Use with {@link VectorCanvasBody}, {@link VectorCanvasMain}. Pass `toolbar` on {@link VectorViewport};
|
|
141
|
-
* Compose the floating tool strip with {@link VectorCanvasToolbar} around {@link VectorToolbar} (see example below).
|
|
142
|
-
*/
|
|
143
|
-
declare function VectorCanvasRoot({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
144
|
-
/** Optional top chrome (title, hints, toggles). */
|
|
145
|
-
declare function VectorCanvasHeader({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
146
|
-
/** Fills remaining space below the header (typically one {@link VectorCanvasMain}). */
|
|
147
|
-
declare function VectorCanvasBody({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
148
|
-
/**
|
|
149
|
-
* Stretch area for {@link VectorViewport} (or any child that should fill the stage).
|
|
150
|
-
*/
|
|
151
|
-
declare function VectorCanvasMain({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
152
|
-
/**
|
|
153
|
-
* Flex child that fills {@link VectorCanvasMain} and gives {@link VectorViewport} a bounded height
|
|
154
|
-
* (white surface by default). Omit if you set the background on `Main` or the viewport yourself.
|
|
155
|
-
*/
|
|
156
|
-
declare function VectorCanvasViewportSurface({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
157
|
-
type VectorCanvasToolbarProps = {
|
|
158
|
-
children?: ReactNode;
|
|
159
|
-
className?: string;
|
|
160
|
-
style?: CSSProperties;
|
|
161
|
-
/** Anchor preset. @default "bottom-center" */
|
|
162
|
-
position?: BoardComponentPosition;
|
|
163
|
-
/** Distance (px) from the anchored edge(s). @default 12 */
|
|
164
|
-
inset?: number;
|
|
165
|
-
/** @default 30 */
|
|
166
|
-
zIndex?: number;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Floating strip anchor for {@link VectorToolbar} or custom controls. Defaults to bottom-center.
|
|
170
|
-
* Renders `pointer-events: none` on the shell and `auto` on children so the canvas keeps receiving hits outside the bar.
|
|
171
|
-
* Pass as the `toolbar` prop of `VectorViewport`; pick a different `position` for top / side anchoring.
|
|
172
|
-
* Z-index defaults to 30 so the strip stays above zoom controls.
|
|
173
|
-
*/
|
|
174
|
-
declare function VectorCanvasToolbar({ children, className, style, position, inset, zIndex, }: VectorCanvasToolbarProps): react_jsx_runtime.JSX.Element;
|
|
175
|
-
/**
|
|
176
|
-
* Absolute canvas-aligned space for floating UI such as chats, rosters, inspectors, and overlays.
|
|
177
|
-
* Use this instead of ad-hoc wrapper divs or plugin hosts when a feature can be expressed as React nodes.
|
|
178
|
-
*/
|
|
179
|
-
declare function VectorCanvasSpace({ children, className, style, position, inset, zIndex, contentPointerEvents, }: VectorCanvasSpaceProps): react_jsx_runtime.JSX.Element;
|
|
180
|
-
/**
|
|
181
|
-
* Namespaced layout primitives for composing a vector canvas shell without ad-hoc wrapper divs.
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```tsx
|
|
185
|
-
* <VectorCanvas.Root>
|
|
186
|
-
* <VectorCanvas.Header>…</VectorCanvas.Header>
|
|
187
|
-
* <VectorCanvas.Body>
|
|
188
|
-
* <VectorCanvas.Main>
|
|
189
|
-
* <VectorCanvas.ViewportSurface>
|
|
190
|
-
* <VectorViewport
|
|
191
|
-
* toolbar={
|
|
192
|
-
* <VectorCanvas.Toolbar>
|
|
193
|
-
* <VectorToolbar … />
|
|
194
|
-
* </VectorCanvas.Toolbar>
|
|
195
|
-
* }
|
|
196
|
-
* …
|
|
197
|
-
* />
|
|
198
|
-
* </VectorCanvas.ViewportSurface>
|
|
199
|
-
* </VectorCanvas.Main>
|
|
200
|
-
* </VectorCanvas.Body>
|
|
201
|
-
* </VectorCanvas.Root>
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
declare const VectorCanvas: {
|
|
205
|
-
readonly Root: typeof VectorCanvasRoot;
|
|
206
|
-
readonly Header: typeof VectorCanvasHeader;
|
|
207
|
-
readonly Body: typeof VectorCanvasBody;
|
|
208
|
-
readonly Main: typeof VectorCanvasMain;
|
|
209
|
-
readonly ViewportSurface: typeof VectorCanvasViewportSurface;
|
|
210
|
-
readonly Toolbar: typeof VectorCanvasToolbar;
|
|
211
|
-
readonly Space: typeof VectorCanvasSpace;
|
|
212
|
-
readonly NavMenu: typeof NavMenu;
|
|
213
|
-
readonly SelectionInspector: typeof VectorSelectionInspector;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Floating bottom-bar combining zoom controls, undo/redo, and an expandable minimap.
|
|
218
|
-
* When rendered inside `VectorViewport` (e.g. via the `navMenu` slot), data props default
|
|
219
|
-
* to values from {@link CanvuChromeContext}; pass any prop to override.
|
|
220
|
-
*/
|
|
221
|
-
type NavMenuProps = {
|
|
222
|
-
camera?: Camera2D;
|
|
223
|
-
viewportWidth?: number;
|
|
224
|
-
viewportHeight?: number;
|
|
225
|
-
items?: readonly VectorSceneItem[];
|
|
226
|
-
zoomPercent?: number;
|
|
227
|
-
onZoomIn?: () => void;
|
|
228
|
-
onZoomOut?: () => void;
|
|
229
|
-
onUndo?: () => void;
|
|
230
|
-
onRedo?: () => void;
|
|
231
|
-
canUndo?: boolean;
|
|
232
|
-
canRedo?: boolean;
|
|
233
|
-
onRequestRender?: () => void;
|
|
234
|
-
/** Anchor preset. Defaults to bottom-left. */
|
|
235
|
-
position?: BoardComponentPosition;
|
|
236
|
-
/** Distance (px) from anchored edges. @default 12 */
|
|
237
|
-
inset?: number;
|
|
238
|
-
/** @default 23 */
|
|
239
|
-
zIndex?: number;
|
|
240
|
-
className?: string;
|
|
241
|
-
/** Merged on top of position-derived styles for custom tweaks. */
|
|
242
|
-
style?: CSSProperties;
|
|
243
|
-
};
|
|
244
|
-
declare function NavMenu({ camera: cameraProp, viewportWidth: viewportWidthProp, viewportHeight: viewportHeightProp, items: itemsProp, zoomPercent: zoomPercentProp, onZoomIn: onZoomInProp, onZoomOut: onZoomOutProp, onUndo: onUndoProp, onRedo: onRedoProp, canUndo: canUndoProp, canRedo: canRedoProp, onRequestRender: onRequestRenderProp, position, inset, zIndex, className, style, }: NavMenuProps): react_jsx_runtime.JSX.Element;
|
|
245
92
|
|
|
246
93
|
/**
|
|
247
94
|
* Describes one entry in {@link VectorToolbar}.
|
|
@@ -324,6 +171,38 @@ type PresenceOverlayRenderContext = {
|
|
|
324
171
|
cameraVersion: number;
|
|
325
172
|
};
|
|
326
173
|
|
|
174
|
+
type ActiveToolStyle = StrokeStyle & {
|
|
175
|
+
toolKind: "draw" | "marker";
|
|
176
|
+
label?: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Color + stroke-width inspector for the current selection (or active drawing tool style).
|
|
180
|
+
* When rendered inside `VectorViewport` (e.g. via the `selectionInspector` slot), `items`,
|
|
181
|
+
* `activeToolStyle`, and `onChange` default to values from {@link CanvuChromeContext};
|
|
182
|
+
* pass any prop to override.
|
|
183
|
+
*/
|
|
184
|
+
type VectorSelectionInspectorProps = {
|
|
185
|
+
/** Selected items that support stroke/fill styling (caller may filter). */
|
|
186
|
+
items?: readonly VectorSceneItem[];
|
|
187
|
+
/** Optional active tool style shown even without a selection. */
|
|
188
|
+
activeToolStyle?: ActiveToolStyle | null;
|
|
189
|
+
/** Apply stroke / width / opacity to every item in `items`. */
|
|
190
|
+
onChange?: CanvuChromeSelectionStyleChange;
|
|
191
|
+
/** Anchor preset. Defaults to top-left. */
|
|
192
|
+
position?: BoardComponentPosition;
|
|
193
|
+
/** Distance (px) from anchored edges. @default 12 */
|
|
194
|
+
inset?: number;
|
|
195
|
+
/** @default 24 */
|
|
196
|
+
zIndex?: number;
|
|
197
|
+
className?: string;
|
|
198
|
+
/** Merged on top of position-derived styles for custom tweaks. */
|
|
199
|
+
style?: CSSProperties;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Color + stroke width for the current selection. Supports multiple selected shapes: one change applies to all.
|
|
203
|
+
*/
|
|
204
|
+
declare function VectorSelectionInspector({ items: itemsProp, activeToolStyle: activeToolStyleProp, onChange: onChangeProp, position, inset, zIndex, className, style, }: VectorSelectionInspectorProps): react_jsx_runtime.JSX.Element | null;
|
|
205
|
+
|
|
327
206
|
type WorldPointerDownDetail = {
|
|
328
207
|
worldX: number;
|
|
329
208
|
worldY: number;
|
|
@@ -594,4 +473,4 @@ declare function useCanvuResolvedTools(): VectorToolDefinition[];
|
|
|
594
473
|
*/
|
|
595
474
|
declare function useCanvuPluginContribution(pluginId: string, contribution: CanvasPluginContribution): void;
|
|
596
475
|
|
|
597
|
-
export {
|
|
476
|
+
export { type RemotePresencePeer as A, type BoardComponentPosition as B, type CanvasPlugin as C, type RemotePresenceCamera as D, type RealtimeConnectionState as E, type PresenceOverlayRenderContext as F, type PlacementPreview as P, type RemotePresenceMarkupStroke as R, type VectorToolDefinition as V, type WorldPointerDownDetail as W, VectorSelectionInspector as a, type CanvasPluginComponentProps as b, type CanvasPluginContribution as c, type CanvasPluginItemsChangeMiddlewareContext as d, type CanvasPluginRenderContext as e, type CanvuChromeActiveToolStyle as f, CanvuChromeContext as g, type CanvuChromeContextValue as h, type CanvuChromeSelectionStyleChange as i, CanvuPluginContext as j, type CanvuPluginContextValue as k, type CanvuPluginViewportSnapshot as l, type CustomShapePlacementOptions as m, type VectorCanvasSpacePosition as n, type VectorSelectionInspectorProps as o, VectorViewport as p, type VectorViewportHandle as q, type VectorViewportProps as r, createCanvuPlugin as s, getBoardPositionStyle as t, useCanvuChromeContext as u, useCanvuDocumentContext as v, useCanvuPluginContext as w, useCanvuPluginContribution as x, useCanvuResolvedTools as y, useCanvuViewportContext as z };
|
|
@@ -69,43 +69,6 @@ type PlacementPreview = {
|
|
|
69
69
|
}[];
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
type ActiveToolStyle = StrokeStyle & {
|
|
73
|
-
toolKind: "draw" | "marker";
|
|
74
|
-
label?: string;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Color + stroke-width inspector for the current selection (or active drawing tool style).
|
|
78
|
-
* When rendered inside `VectorViewport` (e.g. via the `selectionInspector` slot), `items`,
|
|
79
|
-
* `activeToolStyle`, and `onChange` default to values from {@link CanvuChromeContext};
|
|
80
|
-
* pass any prop to override.
|
|
81
|
-
*/
|
|
82
|
-
type VectorSelectionInspectorProps = {
|
|
83
|
-
/** Selected items that support stroke/fill styling (caller may filter). */
|
|
84
|
-
items?: readonly VectorSceneItem[];
|
|
85
|
-
/** Optional active tool style shown even without a selection. */
|
|
86
|
-
activeToolStyle?: ActiveToolStyle | null;
|
|
87
|
-
/** Apply stroke / width / opacity to every item in `items`. */
|
|
88
|
-
onChange?: CanvuChromeSelectionStyleChange;
|
|
89
|
-
/** Anchor preset. Defaults to top-left. */
|
|
90
|
-
position?: BoardComponentPosition;
|
|
91
|
-
/** Distance (px) from anchored edges. @default 12 */
|
|
92
|
-
inset?: number;
|
|
93
|
-
/** @default 24 */
|
|
94
|
-
zIndex?: number;
|
|
95
|
-
className?: string;
|
|
96
|
-
/** Merged on top of position-derived styles for custom tweaks. */
|
|
97
|
-
style?: CSSProperties;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Color + stroke width for the current selection. Supports multiple selected shapes: one change applies to all.
|
|
101
|
-
*/
|
|
102
|
-
declare function VectorSelectionInspector({ items: itemsProp, activeToolStyle: activeToolStyleProp, onChange: onChangeProp, position, inset, zIndex, className, style, }: VectorSelectionInspectorProps): react_jsx_runtime.JSX.Element | null;
|
|
103
|
-
|
|
104
|
-
type VectorCanvasSlotProps = {
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
className?: string;
|
|
107
|
-
style?: CSSProperties;
|
|
108
|
-
};
|
|
109
72
|
/**
|
|
110
73
|
* Anchor presets for floating board components.
|
|
111
74
|
*
|
|
@@ -126,122 +89,6 @@ type VectorCanvasSpacePosition = BoardComponentPosition;
|
|
|
126
89
|
* Callers merge the result with their own style/className overrides.
|
|
127
90
|
*/
|
|
128
91
|
declare function getBoardPositionStyle(position: BoardComponentPosition, inset?: number, zIndex?: number): CSSProperties;
|
|
129
|
-
type VectorCanvasSpaceProps = VectorCanvasSlotProps & {
|
|
130
|
-
position?: BoardComponentPosition;
|
|
131
|
-
/** @default 12 */
|
|
132
|
-
inset?: number;
|
|
133
|
-
/** @default 40 */
|
|
134
|
-
zIndex?: number;
|
|
135
|
-
/** Pointer events value on the content wrapper. @default "auto" */
|
|
136
|
-
contentPointerEvents?: CSSProperties["pointerEvents"];
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Full-viewport column shell for a vector canvas (header + body with stage).
|
|
140
|
-
* Use with {@link VectorCanvasBody}, {@link VectorCanvasMain}. Pass `toolbar` on {@link VectorViewport};
|
|
141
|
-
* Compose the floating tool strip with {@link VectorCanvasToolbar} around {@link VectorToolbar} (see example below).
|
|
142
|
-
*/
|
|
143
|
-
declare function VectorCanvasRoot({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
144
|
-
/** Optional top chrome (title, hints, toggles). */
|
|
145
|
-
declare function VectorCanvasHeader({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
146
|
-
/** Fills remaining space below the header (typically one {@link VectorCanvasMain}). */
|
|
147
|
-
declare function VectorCanvasBody({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
148
|
-
/**
|
|
149
|
-
* Stretch area for {@link VectorViewport} (or any child that should fill the stage).
|
|
150
|
-
*/
|
|
151
|
-
declare function VectorCanvasMain({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
152
|
-
/**
|
|
153
|
-
* Flex child that fills {@link VectorCanvasMain} and gives {@link VectorViewport} a bounded height
|
|
154
|
-
* (white surface by default). Omit if you set the background on `Main` or the viewport yourself.
|
|
155
|
-
*/
|
|
156
|
-
declare function VectorCanvasViewportSurface({ children, className, style, }: VectorCanvasSlotProps): react_jsx_runtime.JSX.Element;
|
|
157
|
-
type VectorCanvasToolbarProps = {
|
|
158
|
-
children?: ReactNode;
|
|
159
|
-
className?: string;
|
|
160
|
-
style?: CSSProperties;
|
|
161
|
-
/** Anchor preset. @default "bottom-center" */
|
|
162
|
-
position?: BoardComponentPosition;
|
|
163
|
-
/** Distance (px) from the anchored edge(s). @default 12 */
|
|
164
|
-
inset?: number;
|
|
165
|
-
/** @default 30 */
|
|
166
|
-
zIndex?: number;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Floating strip anchor for {@link VectorToolbar} or custom controls. Defaults to bottom-center.
|
|
170
|
-
* Renders `pointer-events: none` on the shell and `auto` on children so the canvas keeps receiving hits outside the bar.
|
|
171
|
-
* Pass as the `toolbar` prop of `VectorViewport`; pick a different `position` for top / side anchoring.
|
|
172
|
-
* Z-index defaults to 30 so the strip stays above zoom controls.
|
|
173
|
-
*/
|
|
174
|
-
declare function VectorCanvasToolbar({ children, className, style, position, inset, zIndex, }: VectorCanvasToolbarProps): react_jsx_runtime.JSX.Element;
|
|
175
|
-
/**
|
|
176
|
-
* Absolute canvas-aligned space for floating UI such as chats, rosters, inspectors, and overlays.
|
|
177
|
-
* Use this instead of ad-hoc wrapper divs or plugin hosts when a feature can be expressed as React nodes.
|
|
178
|
-
*/
|
|
179
|
-
declare function VectorCanvasSpace({ children, className, style, position, inset, zIndex, contentPointerEvents, }: VectorCanvasSpaceProps): react_jsx_runtime.JSX.Element;
|
|
180
|
-
/**
|
|
181
|
-
* Namespaced layout primitives for composing a vector canvas shell without ad-hoc wrapper divs.
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```tsx
|
|
185
|
-
* <VectorCanvas.Root>
|
|
186
|
-
* <VectorCanvas.Header>…</VectorCanvas.Header>
|
|
187
|
-
* <VectorCanvas.Body>
|
|
188
|
-
* <VectorCanvas.Main>
|
|
189
|
-
* <VectorCanvas.ViewportSurface>
|
|
190
|
-
* <VectorViewport
|
|
191
|
-
* toolbar={
|
|
192
|
-
* <VectorCanvas.Toolbar>
|
|
193
|
-
* <VectorToolbar … />
|
|
194
|
-
* </VectorCanvas.Toolbar>
|
|
195
|
-
* }
|
|
196
|
-
* …
|
|
197
|
-
* />
|
|
198
|
-
* </VectorCanvas.ViewportSurface>
|
|
199
|
-
* </VectorCanvas.Main>
|
|
200
|
-
* </VectorCanvas.Body>
|
|
201
|
-
* </VectorCanvas.Root>
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
declare const VectorCanvas: {
|
|
205
|
-
readonly Root: typeof VectorCanvasRoot;
|
|
206
|
-
readonly Header: typeof VectorCanvasHeader;
|
|
207
|
-
readonly Body: typeof VectorCanvasBody;
|
|
208
|
-
readonly Main: typeof VectorCanvasMain;
|
|
209
|
-
readonly ViewportSurface: typeof VectorCanvasViewportSurface;
|
|
210
|
-
readonly Toolbar: typeof VectorCanvasToolbar;
|
|
211
|
-
readonly Space: typeof VectorCanvasSpace;
|
|
212
|
-
readonly NavMenu: typeof NavMenu;
|
|
213
|
-
readonly SelectionInspector: typeof VectorSelectionInspector;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Floating bottom-bar combining zoom controls, undo/redo, and an expandable minimap.
|
|
218
|
-
* When rendered inside `VectorViewport` (e.g. via the `navMenu` slot), data props default
|
|
219
|
-
* to values from {@link CanvuChromeContext}; pass any prop to override.
|
|
220
|
-
*/
|
|
221
|
-
type NavMenuProps = {
|
|
222
|
-
camera?: Camera2D;
|
|
223
|
-
viewportWidth?: number;
|
|
224
|
-
viewportHeight?: number;
|
|
225
|
-
items?: readonly VectorSceneItem[];
|
|
226
|
-
zoomPercent?: number;
|
|
227
|
-
onZoomIn?: () => void;
|
|
228
|
-
onZoomOut?: () => void;
|
|
229
|
-
onUndo?: () => void;
|
|
230
|
-
onRedo?: () => void;
|
|
231
|
-
canUndo?: boolean;
|
|
232
|
-
canRedo?: boolean;
|
|
233
|
-
onRequestRender?: () => void;
|
|
234
|
-
/** Anchor preset. Defaults to bottom-left. */
|
|
235
|
-
position?: BoardComponentPosition;
|
|
236
|
-
/** Distance (px) from anchored edges. @default 12 */
|
|
237
|
-
inset?: number;
|
|
238
|
-
/** @default 23 */
|
|
239
|
-
zIndex?: number;
|
|
240
|
-
className?: string;
|
|
241
|
-
/** Merged on top of position-derived styles for custom tweaks. */
|
|
242
|
-
style?: CSSProperties;
|
|
243
|
-
};
|
|
244
|
-
declare function NavMenu({ camera: cameraProp, viewportWidth: viewportWidthProp, viewportHeight: viewportHeightProp, items: itemsProp, zoomPercent: zoomPercentProp, onZoomIn: onZoomInProp, onZoomOut: onZoomOutProp, onUndo: onUndoProp, onRedo: onRedoProp, canUndo: canUndoProp, canRedo: canRedoProp, onRequestRender: onRequestRenderProp, position, inset, zIndex, className, style, }: NavMenuProps): react_jsx_runtime.JSX.Element;
|
|
245
92
|
|
|
246
93
|
/**
|
|
247
94
|
* Describes one entry in {@link VectorToolbar}.
|
|
@@ -324,6 +171,38 @@ type PresenceOverlayRenderContext = {
|
|
|
324
171
|
cameraVersion: number;
|
|
325
172
|
};
|
|
326
173
|
|
|
174
|
+
type ActiveToolStyle = StrokeStyle & {
|
|
175
|
+
toolKind: "draw" | "marker";
|
|
176
|
+
label?: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Color + stroke-width inspector for the current selection (or active drawing tool style).
|
|
180
|
+
* When rendered inside `VectorViewport` (e.g. via the `selectionInspector` slot), `items`,
|
|
181
|
+
* `activeToolStyle`, and `onChange` default to values from {@link CanvuChromeContext};
|
|
182
|
+
* pass any prop to override.
|
|
183
|
+
*/
|
|
184
|
+
type VectorSelectionInspectorProps = {
|
|
185
|
+
/** Selected items that support stroke/fill styling (caller may filter). */
|
|
186
|
+
items?: readonly VectorSceneItem[];
|
|
187
|
+
/** Optional active tool style shown even without a selection. */
|
|
188
|
+
activeToolStyle?: ActiveToolStyle | null;
|
|
189
|
+
/** Apply stroke / width / opacity to every item in `items`. */
|
|
190
|
+
onChange?: CanvuChromeSelectionStyleChange;
|
|
191
|
+
/** Anchor preset. Defaults to top-left. */
|
|
192
|
+
position?: BoardComponentPosition;
|
|
193
|
+
/** Distance (px) from anchored edges. @default 12 */
|
|
194
|
+
inset?: number;
|
|
195
|
+
/** @default 24 */
|
|
196
|
+
zIndex?: number;
|
|
197
|
+
className?: string;
|
|
198
|
+
/** Merged on top of position-derived styles for custom tweaks. */
|
|
199
|
+
style?: CSSProperties;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Color + stroke width for the current selection. Supports multiple selected shapes: one change applies to all.
|
|
203
|
+
*/
|
|
204
|
+
declare function VectorSelectionInspector({ items: itemsProp, activeToolStyle: activeToolStyleProp, onChange: onChangeProp, position, inset, zIndex, className, style, }: VectorSelectionInspectorProps): react_jsx_runtime.JSX.Element | null;
|
|
205
|
+
|
|
327
206
|
type WorldPointerDownDetail = {
|
|
328
207
|
worldX: number;
|
|
329
208
|
worldY: number;
|
|
@@ -594,4 +473,4 @@ declare function useCanvuResolvedTools(): VectorToolDefinition[];
|
|
|
594
473
|
*/
|
|
595
474
|
declare function useCanvuPluginContribution(pluginId: string, contribution: CanvasPluginContribution): void;
|
|
596
475
|
|
|
597
|
-
export {
|
|
476
|
+
export { type RemotePresencePeer as A, type BoardComponentPosition as B, type CanvasPlugin as C, type RemotePresenceCamera as D, type RealtimeConnectionState as E, type PresenceOverlayRenderContext as F, type PlacementPreview as P, type RemotePresenceMarkupStroke as R, type VectorToolDefinition as V, type WorldPointerDownDetail as W, VectorSelectionInspector as a, type CanvasPluginComponentProps as b, type CanvasPluginContribution as c, type CanvasPluginItemsChangeMiddlewareContext as d, type CanvasPluginRenderContext as e, type CanvuChromeActiveToolStyle as f, CanvuChromeContext as g, type CanvuChromeContextValue as h, type CanvuChromeSelectionStyleChange as i, CanvuPluginContext as j, type CanvuPluginContextValue as k, type CanvuPluginViewportSnapshot as l, type CustomShapePlacementOptions as m, type VectorCanvasSpacePosition as n, type VectorSelectionInspectorProps as o, VectorViewport as p, type VectorViewportHandle as q, type VectorViewportProps as r, createCanvuPlugin as s, getBoardPositionStyle as t, useCanvuChromeContext as u, useCanvuDocumentContext as v, useCanvuPluginContext as w, useCanvuPluginContribution as x, useCanvuResolvedTools as y, useCanvuViewportContext as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvu-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.19",
|
|
4
4
|
"description": "Vector-first infinite canvas (SVG) with pan, zoom, React bindings, and optional plugins",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -65,6 +65,9 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@ai-sdk/react": "^3.0.0",
|
|
68
|
+
"@dnd-kit/core": "^6.3.0",
|
|
69
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
70
|
+
"@dnd-kit/utilities": "^3.2.0",
|
|
68
71
|
"@shopify/react-native-skia": "",
|
|
69
72
|
"ai": "^6.0.0",
|
|
70
73
|
"lucide-react": "^0.400.0 || ^1.0.0",
|
|
@@ -87,10 +90,22 @@
|
|
|
87
90
|
},
|
|
88
91
|
"ai": {
|
|
89
92
|
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"@dnd-kit/core": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@dnd-kit/sortable": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"@dnd-kit/utilities": {
|
|
101
|
+
"optional": true
|
|
90
102
|
}
|
|
91
103
|
},
|
|
92
104
|
"devDependencies": {
|
|
93
105
|
"@ai-sdk/react": "^3.0.140",
|
|
106
|
+
"@dnd-kit/core": "^6.3.1",
|
|
107
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
108
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
94
109
|
"@types/react": "^19.2.14",
|
|
95
110
|
"@types/react-dom": "^19.0.0",
|
|
96
111
|
"ai": "^6.0.138",
|