canvu-react 0.4.6 → 0.4.7

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
@@ -1,5 +1,5 @@
1
1
  import { C as Camera2D } from './shape-builders-CKEMjivV.cjs';
2
- export { o as createFreehandStrokeItem, t as createShapeId } from './shape-builders-CKEMjivV.cjs';
2
+ export { o as createFreehandStrokeItem, q as createImageItem, t as createShapeId } from './shape-builders-CKEMjivV.cjs';
3
3
  import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.cjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
@@ -83,6 +83,8 @@ type NativeVectorToolDefinition = {
83
83
  readonly id: string;
84
84
  readonly label: string;
85
85
  readonly shortLabel?: string;
86
+ readonly tooltipLabel?: string;
87
+ readonly shortcutHint?: string;
86
88
  readonly accessibilityLabel?: string;
87
89
  readonly disabled?: boolean;
88
90
  };
@@ -100,6 +102,20 @@ type NativeVectorToolbarRenderToolInput = {
100
102
  readonly foregroundColor: string;
101
103
  readonly onSelect: () => void;
102
104
  };
105
+ type NativeVectorToolbarDensity = "compact" | "comfortable";
106
+ type NativeVectorToolbarRenderToolLockInput = {
107
+ readonly locked: boolean;
108
+ readonly disabled: boolean;
109
+ readonly foregroundColor: string;
110
+ readonly onToggle: () => void;
111
+ };
112
+ type NativeVectorToolbarRenderOverflowInput = {
113
+ readonly open: boolean;
114
+ readonly activeTool: NativeVectorToolDefinition | null;
115
+ readonly disabled: boolean;
116
+ readonly foregroundColor: string;
117
+ readonly onToggle: () => void;
118
+ };
103
119
  /**
104
120
  * Props for {@link NativeVectorToolbar}.
105
121
  *
@@ -111,18 +127,29 @@ type NativeVectorToolbarProps = {
111
127
  readonly value: string;
112
128
  readonly onChange: (toolId: string) => void;
113
129
  readonly tools?: readonly NativeVectorToolDefinition[];
130
+ readonly overflowToolIds?: readonly string[];
131
+ readonly overflowMenuAccessibilityLabel?: string;
114
132
  readonly disabled?: boolean;
115
133
  readonly disabledToolIds?: readonly string[];
134
+ readonly showToolLockToggle?: boolean;
135
+ readonly toolLocked?: boolean;
136
+ readonly onToolLockedChange?: (locked: boolean) => void;
137
+ readonly density?: NativeVectorToolbarDensity;
116
138
  readonly accessibilityLabel?: string;
117
139
  readonly style?: StyleProp<ViewStyle>;
118
140
  readonly contentContainerStyle?: StyleProp<ViewStyle>;
141
+ readonly overflowPanelStyle?: StyleProp<ViewStyle>;
119
142
  readonly toolButtonStyle?: StyleProp<ViewStyle>;
120
143
  readonly activeToolButtonStyle?: StyleProp<ViewStyle>;
121
144
  readonly toolLabelStyle?: StyleProp<TextStyle>;
122
145
  readonly activeToolLabelStyle?: StyleProp<TextStyle>;
123
146
  readonly renderToolIcon?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
147
+ readonly renderToolLockIcon?: (input: NativeVectorToolbarRenderToolLockInput) => ReactNode;
148
+ readonly renderOverflowIcon?: (input: NativeVectorToolbarRenderOverflowInput) => ReactNode;
149
+ readonly renderOverflowChevronIcon?: (input: NativeVectorToolbarRenderOverflowInput) => ReactNode;
124
150
  readonly renderToolButton?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
125
151
  };
152
+ declare const DEFAULT_NATIVE_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "architectural-cloud", "line", "marker", "laser", "image"];
126
153
  /**
127
154
  * Default mobile-friendly tool list for {@link NativeVectorToolbar}.
128
155
  *
@@ -145,7 +172,7 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
145
172
  * <NativeVectorToolbar value={toolId} onChange={setToolId} />
146
173
  * ```
147
174
  */
148
- declare function NativeVectorToolbar({ value, onChange, tools, disabled, disabledToolIds, accessibilityLabel, style, contentContainerStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
175
+ 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;
149
176
 
150
177
  type NativeVectorViewportHandle = {
151
178
  getCamera: () => Camera2D | null;
@@ -162,9 +189,11 @@ type NativeVectorViewportProps = {
162
189
  readonly items: readonly VectorSceneItem[];
163
190
  readonly selectedIds?: readonly string[];
164
191
  readonly toolId?: string;
192
+ readonly toolLocked?: boolean;
165
193
  readonly interactive?: boolean;
166
194
  readonly onSelectionChange?: (ids: string[]) => void;
167
195
  readonly onItemsChange?: (items: VectorSceneItem[]) => void;
196
+ readonly onToolChangeRequest?: (toolId: string) => void;
168
197
  readonly onCameraChange?: () => void;
169
198
  readonly toolbar?: React.ReactNode;
170
199
  };
@@ -292,4 +321,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
292
321
  */
293
322
  declare function parseSvgFragment(xml: string): SvgNode[];
294
323
 
295
- export { DEFAULT_NATIVE_VECTOR_TOOLS, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarProps, type NativeVectorToolbarRenderToolInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, parseSvgFragment };
324
+ export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, parseSvgFragment };
package/dist/native.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as Camera2D } from './shape-builders-Cyh8zvDG.js';
2
- export { o as createFreehandStrokeItem, t as createShapeId } from './shape-builders-Cyh8zvDG.js';
2
+ export { o as createFreehandStrokeItem, q as createImageItem, t as createShapeId } from './shape-builders-Cyh8zvDG.js';
3
3
  import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
@@ -83,6 +83,8 @@ type NativeVectorToolDefinition = {
83
83
  readonly id: string;
84
84
  readonly label: string;
85
85
  readonly shortLabel?: string;
86
+ readonly tooltipLabel?: string;
87
+ readonly shortcutHint?: string;
86
88
  readonly accessibilityLabel?: string;
87
89
  readonly disabled?: boolean;
88
90
  };
@@ -100,6 +102,20 @@ type NativeVectorToolbarRenderToolInput = {
100
102
  readonly foregroundColor: string;
101
103
  readonly onSelect: () => void;
102
104
  };
105
+ type NativeVectorToolbarDensity = "compact" | "comfortable";
106
+ type NativeVectorToolbarRenderToolLockInput = {
107
+ readonly locked: boolean;
108
+ readonly disabled: boolean;
109
+ readonly foregroundColor: string;
110
+ readonly onToggle: () => void;
111
+ };
112
+ type NativeVectorToolbarRenderOverflowInput = {
113
+ readonly open: boolean;
114
+ readonly activeTool: NativeVectorToolDefinition | null;
115
+ readonly disabled: boolean;
116
+ readonly foregroundColor: string;
117
+ readonly onToggle: () => void;
118
+ };
103
119
  /**
104
120
  * Props for {@link NativeVectorToolbar}.
105
121
  *
@@ -111,18 +127,29 @@ type NativeVectorToolbarProps = {
111
127
  readonly value: string;
112
128
  readonly onChange: (toolId: string) => void;
113
129
  readonly tools?: readonly NativeVectorToolDefinition[];
130
+ readonly overflowToolIds?: readonly string[];
131
+ readonly overflowMenuAccessibilityLabel?: string;
114
132
  readonly disabled?: boolean;
115
133
  readonly disabledToolIds?: readonly string[];
134
+ readonly showToolLockToggle?: boolean;
135
+ readonly toolLocked?: boolean;
136
+ readonly onToolLockedChange?: (locked: boolean) => void;
137
+ readonly density?: NativeVectorToolbarDensity;
116
138
  readonly accessibilityLabel?: string;
117
139
  readonly style?: StyleProp<ViewStyle>;
118
140
  readonly contentContainerStyle?: StyleProp<ViewStyle>;
141
+ readonly overflowPanelStyle?: StyleProp<ViewStyle>;
119
142
  readonly toolButtonStyle?: StyleProp<ViewStyle>;
120
143
  readonly activeToolButtonStyle?: StyleProp<ViewStyle>;
121
144
  readonly toolLabelStyle?: StyleProp<TextStyle>;
122
145
  readonly activeToolLabelStyle?: StyleProp<TextStyle>;
123
146
  readonly renderToolIcon?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
147
+ readonly renderToolLockIcon?: (input: NativeVectorToolbarRenderToolLockInput) => ReactNode;
148
+ readonly renderOverflowIcon?: (input: NativeVectorToolbarRenderOverflowInput) => ReactNode;
149
+ readonly renderOverflowChevronIcon?: (input: NativeVectorToolbarRenderOverflowInput) => ReactNode;
124
150
  readonly renderToolButton?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
125
151
  };
152
+ declare const DEFAULT_NATIVE_OVERFLOW_TOOL_IDS: readonly ["rect", "ellipse", "architectural-cloud", "line", "marker", "laser", "image"];
126
153
  /**
127
154
  * Default mobile-friendly tool list for {@link NativeVectorToolbar}.
128
155
  *
@@ -145,7 +172,7 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
145
172
  * <NativeVectorToolbar value={toolId} onChange={setToolId} />
146
173
  * ```
147
174
  */
148
- declare function NativeVectorToolbar({ value, onChange, tools, disabled, disabledToolIds, accessibilityLabel, style, contentContainerStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
175
+ 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;
149
176
 
150
177
  type NativeVectorViewportHandle = {
151
178
  getCamera: () => Camera2D | null;
@@ -162,9 +189,11 @@ type NativeVectorViewportProps = {
162
189
  readonly items: readonly VectorSceneItem[];
163
190
  readonly selectedIds?: readonly string[];
164
191
  readonly toolId?: string;
192
+ readonly toolLocked?: boolean;
165
193
  readonly interactive?: boolean;
166
194
  readonly onSelectionChange?: (ids: string[]) => void;
167
195
  readonly onItemsChange?: (items: VectorSceneItem[]) => void;
196
+ readonly onToolChangeRequest?: (toolId: string) => void;
168
197
  readonly onCameraChange?: () => void;
169
198
  readonly toolbar?: React.ReactNode;
170
199
  };
@@ -292,4 +321,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
292
321
  */
293
322
  declare function parseSvgFragment(xml: string): SvgNode[];
294
323
 
295
- export { DEFAULT_NATIVE_VECTOR_TOOLS, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarProps, type NativeVectorToolbarRenderToolInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, parseSvgFragment };
324
+ export { DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, type NativeVectorToolDefinition, NativeVectorToolbar, type NativeVectorToolbarDensity, type NativeVectorToolbarProps, type NativeVectorToolbarRenderOverflowInput, type NativeVectorToolbarRenderToolInput, type NativeVectorToolbarRenderToolLockInput, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, VectorSceneItem, parseSvgFragment };