canvu-react 0.4.17 → 0.4.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/native.d.cts CHANGED
@@ -202,6 +202,14 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
202
202
  */
203
203
  declare function NativeVectorToolbar({ value, onChange, tools, overflowToolIds, overflowMenuAccessibilityLabel, disabled, disabledToolIds, showToolLockToggle, toolLocked, onToolLockedChange, density, accessibilityLabel, style, contentContainerStyle, overflowPanelStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolLockIcon, renderOverflowIcon, renderOverflowChevronIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
204
204
 
205
+ type NativeCustomShapePlacementOptions = {
206
+ readonly toolId: string;
207
+ readonly createItem: (args: {
208
+ readonly id: string;
209
+ readonly bounds: Rect;
210
+ }) => VectorSceneItem;
211
+ };
212
+
205
213
  type NativeVectorViewportHandle = {
206
214
  getCamera: () => Camera2D | null;
207
215
  requestRender: () => void;
@@ -213,6 +221,13 @@ type NativeVectorViewportHandle = {
213
221
  padding?: number;
214
222
  }) => void;
215
223
  };
224
+ type NativeWorldPointerDownDetail = {
225
+ readonly toolId: string;
226
+ readonly worldX: number;
227
+ readonly worldY: number;
228
+ readonly screenX: number;
229
+ readonly screenY: number;
230
+ };
216
231
  type NativeVectorViewportProps = {
217
232
  readonly items: readonly VectorSceneItem[];
218
233
  readonly selectedIds?: readonly string[];
@@ -222,7 +237,11 @@ type NativeVectorViewportProps = {
222
237
  readonly onSelectionChange?: (ids: string[]) => void;
223
238
  readonly onItemsChange?: (items: VectorSceneItem[]) => void;
224
239
  readonly onToolChangeRequest?: (toolId: string) => void;
240
+ readonly onWorldPointerDown?: (detail: NativeWorldPointerDownDetail) => void;
225
241
  readonly onCameraChange?: () => void;
242
+ readonly customPlacement?: NativeCustomShapePlacementOptions;
243
+ readonly customPlacements?: readonly NativeCustomShapePlacementOptions[];
244
+ readonly customCrosshairToolIds?: readonly string[];
226
245
  readonly toolbar?: React.ReactNode;
227
246
  readonly showStyleInspector?: boolean;
228
247
  readonly styleInspectorPlacement?: "bottom" | "top-left";
@@ -359,4 +378,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
359
378
  */
360
379
  declare function parseSvgFragment(xml: string): SvgNode[];
361
380
 
362
- export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeStyleColor, NativeVectorStyleInspector, type NativeVectorStyleInspectorProps, type NativeVectorStyleToolId, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
381
+ export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeStyleColor, NativeVectorStyleInspector, type NativeVectorStyleInspectorProps, type NativeVectorStyleToolId, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type NativeWorldPointerDownDetail, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
package/dist/native.d.ts CHANGED
@@ -202,6 +202,14 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
202
202
  */
203
203
  declare function NativeVectorToolbar({ value, onChange, tools, overflowToolIds, overflowMenuAccessibilityLabel, disabled, disabledToolIds, showToolLockToggle, toolLocked, onToolLockedChange, density, accessibilityLabel, style, contentContainerStyle, overflowPanelStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolLockIcon, renderOverflowIcon, renderOverflowChevronIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
204
204
 
205
+ type NativeCustomShapePlacementOptions = {
206
+ readonly toolId: string;
207
+ readonly createItem: (args: {
208
+ readonly id: string;
209
+ readonly bounds: Rect;
210
+ }) => VectorSceneItem;
211
+ };
212
+
205
213
  type NativeVectorViewportHandle = {
206
214
  getCamera: () => Camera2D | null;
207
215
  requestRender: () => void;
@@ -213,6 +221,13 @@ type NativeVectorViewportHandle = {
213
221
  padding?: number;
214
222
  }) => void;
215
223
  };
224
+ type NativeWorldPointerDownDetail = {
225
+ readonly toolId: string;
226
+ readonly worldX: number;
227
+ readonly worldY: number;
228
+ readonly screenX: number;
229
+ readonly screenY: number;
230
+ };
216
231
  type NativeVectorViewportProps = {
217
232
  readonly items: readonly VectorSceneItem[];
218
233
  readonly selectedIds?: readonly string[];
@@ -222,7 +237,11 @@ type NativeVectorViewportProps = {
222
237
  readonly onSelectionChange?: (ids: string[]) => void;
223
238
  readonly onItemsChange?: (items: VectorSceneItem[]) => void;
224
239
  readonly onToolChangeRequest?: (toolId: string) => void;
240
+ readonly onWorldPointerDown?: (detail: NativeWorldPointerDownDetail) => void;
225
241
  readonly onCameraChange?: () => void;
242
+ readonly customPlacement?: NativeCustomShapePlacementOptions;
243
+ readonly customPlacements?: readonly NativeCustomShapePlacementOptions[];
244
+ readonly customCrosshairToolIds?: readonly string[];
226
245
  readonly toolbar?: React.ReactNode;
227
246
  readonly showStyleInspector?: boolean;
228
247
  readonly styleInspectorPlacement?: "bottom" | "top-left";
@@ -359,4 +378,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
359
378
  */
360
379
  declare function parseSvgFragment(xml: string): SvgNode[];
361
380
 
362
- export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeStyleColor, NativeVectorStyleInspector, type NativeVectorStyleInspectorProps, type NativeVectorStyleToolId, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
381
+ export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeStyleColor, NativeVectorStyleInspector, type NativeVectorStyleInspectorProps, type NativeVectorStyleToolId, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type NativeWorldPointerDownDetail, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };