canvu-react 0.4.4 → 0.4.6
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-B7yMDQE-.d.cts → asset-hydration-CWhld14A.d.cts} +1 -1
- package/dist/{asset-hydration-CbwQVAwh.d.ts → asset-hydration-D35mHbUP.d.ts} +1 -1
- package/dist/chatbot.d.cts +3 -3
- package/dist/chatbot.d.ts +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/link-item-Bg5vj0RI.d.ts +151 -0
- package/dist/link-item-D870_X6P.d.cts +151 -0
- package/dist/native.cjs +539 -142
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +82 -4
- package/dist/native.d.ts +82 -4
- package/dist/native.js +537 -144
- package/dist/native.js.map +1 -1
- package/dist/react.d.cts +7 -7
- package/dist/react.d.ts +7 -7
- package/dist/realtime.d.cts +4 -4
- package/dist/realtime.d.ts +4 -4
- package/dist/{shape-builders-BAWu-PxX.d.cts → shape-builders-CKEMjivV.d.cts} +42 -143
- package/dist/{shape-builders-ClKv9tz9.d.ts → shape-builders-Cyh8zvDG.d.ts} +42 -143
- package/dist/{types-BC9Xgfu6.d.cts → types-Bw1SdC9v.d.cts} +2 -2
- package/dist/{types-DlSVGX0w.d.ts → types-DeXFfs7Y.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/camera-CVVG7z56.d.cts +0 -50
- package/dist/camera-CoRYN_IV.d.ts +0 -50
package/dist/native.d.cts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { C as Camera2D } from './shape-builders-CKEMjivV.cjs';
|
|
2
|
+
export { o as createFreehandStrokeItem, t as createShapeId } from './shape-builders-CKEMjivV.cjs';
|
|
3
3
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.cjs';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import * as react from 'react';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
5
8
|
|
|
6
9
|
type PlacementPreview = {
|
|
7
|
-
readonly kind: "rect" | "ellipse";
|
|
10
|
+
readonly kind: "rect" | "ellipse" | "architectural-cloud";
|
|
8
11
|
readonly rect: {
|
|
9
12
|
readonly x: number;
|
|
10
13
|
readonly y: number;
|
|
@@ -69,6 +72,81 @@ type NativeShapeRendererProps = {
|
|
|
69
72
|
};
|
|
70
73
|
declare function NativeShapeRenderer({ item }: NativeShapeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
71
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Describes a single tool button rendered by {@link NativeVectorToolbar}.
|
|
77
|
+
*
|
|
78
|
+
* Use the built-in ids from {@link DEFAULT_NATIVE_VECTOR_TOOLS} when pairing
|
|
79
|
+
* the toolbar with {@link NativeVectorViewport}. Custom ids are useful only
|
|
80
|
+
* when the app also implements matching viewport behavior.
|
|
81
|
+
*/
|
|
82
|
+
type NativeVectorToolDefinition = {
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly label: string;
|
|
85
|
+
readonly shortLabel?: string;
|
|
86
|
+
readonly accessibilityLabel?: string;
|
|
87
|
+
readonly disabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Render input for custom tool icons or complete custom tool buttons.
|
|
91
|
+
*
|
|
92
|
+
* Prefer `renderToolIcon` for app-specific icon packs. Use
|
|
93
|
+
* `renderToolButton` only when you need to replace the full touch target while
|
|
94
|
+
* keeping the toolbar's horizontal scrolling and tool list behavior.
|
|
95
|
+
*/
|
|
96
|
+
type NativeVectorToolbarRenderToolInput = {
|
|
97
|
+
readonly tool: NativeVectorToolDefinition;
|
|
98
|
+
readonly selected: boolean;
|
|
99
|
+
readonly disabled: boolean;
|
|
100
|
+
readonly foregroundColor: string;
|
|
101
|
+
readonly onSelect: () => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Props for {@link NativeVectorToolbar}.
|
|
105
|
+
*
|
|
106
|
+
* The component is controlled: pass the same `value` to `NativeVectorViewport`
|
|
107
|
+
* as `toolId`, and update it from `onChange`. It is intentionally lightweight
|
|
108
|
+
* and native-only, with no dependency on the web toolbar implementation.
|
|
109
|
+
*/
|
|
110
|
+
type NativeVectorToolbarProps = {
|
|
111
|
+
readonly value: string;
|
|
112
|
+
readonly onChange: (toolId: string) => void;
|
|
113
|
+
readonly tools?: readonly NativeVectorToolDefinition[];
|
|
114
|
+
readonly disabled?: boolean;
|
|
115
|
+
readonly disabledToolIds?: readonly string[];
|
|
116
|
+
readonly accessibilityLabel?: string;
|
|
117
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
118
|
+
readonly contentContainerStyle?: StyleProp<ViewStyle>;
|
|
119
|
+
readonly toolButtonStyle?: StyleProp<ViewStyle>;
|
|
120
|
+
readonly activeToolButtonStyle?: StyleProp<ViewStyle>;
|
|
121
|
+
readonly toolLabelStyle?: StyleProp<TextStyle>;
|
|
122
|
+
readonly activeToolLabelStyle?: StyleProp<TextStyle>;
|
|
123
|
+
readonly renderToolIcon?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
|
|
124
|
+
readonly renderToolButton?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Default mobile-friendly tool list for {@link NativeVectorToolbar}.
|
|
128
|
+
*
|
|
129
|
+
* The ids match the native viewport's built-in tool handling. Apps can pass a
|
|
130
|
+
* filtered or reordered list when permissions or product scope require it.
|
|
131
|
+
*/
|
|
132
|
+
declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[];
|
|
133
|
+
/**
|
|
134
|
+
* Horizontal, touch-sized toolbar for `canvu/native`.
|
|
135
|
+
*
|
|
136
|
+
* Use it with {@link NativeVectorViewport} by controlling the same `toolId`
|
|
137
|
+
* state. It intentionally uses React Native primitives only, so it works in
|
|
138
|
+
* Expo and bare React Native apps without a WebView.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* const [toolId, setToolId] = useState("select");
|
|
143
|
+
*
|
|
144
|
+
* <NativeVectorViewport toolId={toolId} ... />
|
|
145
|
+
* <NativeVectorToolbar value={toolId} onChange={setToolId} />
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
declare function NativeVectorToolbar({ value, onChange, tools, disabled, disabledToolIds, accessibilityLabel, style, contentContainerStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
|
|
72
150
|
type NativeVectorViewportHandle = {
|
|
73
151
|
getCamera: () => Camera2D | null;
|
|
74
152
|
requestRender: () => void;
|
|
@@ -214,4 +292,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
|
|
|
214
292
|
*/
|
|
215
293
|
declare function parseSvgFragment(xml: string): SvgNode[];
|
|
216
294
|
|
|
217
|
-
export { NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, parseSvgFragment };
|
|
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 };
|
package/dist/native.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { C as Camera2D } from './shape-builders-Cyh8zvDG.js';
|
|
2
|
+
export { o as createFreehandStrokeItem, t as createShapeId } from './shape-builders-Cyh8zvDG.js';
|
|
3
3
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.js';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import * as react from 'react';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
5
8
|
|
|
6
9
|
type PlacementPreview = {
|
|
7
|
-
readonly kind: "rect" | "ellipse";
|
|
10
|
+
readonly kind: "rect" | "ellipse" | "architectural-cloud";
|
|
8
11
|
readonly rect: {
|
|
9
12
|
readonly x: number;
|
|
10
13
|
readonly y: number;
|
|
@@ -69,6 +72,81 @@ type NativeShapeRendererProps = {
|
|
|
69
72
|
};
|
|
70
73
|
declare function NativeShapeRenderer({ item }: NativeShapeRendererProps): react_jsx_runtime.JSX.Element | null;
|
|
71
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Describes a single tool button rendered by {@link NativeVectorToolbar}.
|
|
77
|
+
*
|
|
78
|
+
* Use the built-in ids from {@link DEFAULT_NATIVE_VECTOR_TOOLS} when pairing
|
|
79
|
+
* the toolbar with {@link NativeVectorViewport}. Custom ids are useful only
|
|
80
|
+
* when the app also implements matching viewport behavior.
|
|
81
|
+
*/
|
|
82
|
+
type NativeVectorToolDefinition = {
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly label: string;
|
|
85
|
+
readonly shortLabel?: string;
|
|
86
|
+
readonly accessibilityLabel?: string;
|
|
87
|
+
readonly disabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Render input for custom tool icons or complete custom tool buttons.
|
|
91
|
+
*
|
|
92
|
+
* Prefer `renderToolIcon` for app-specific icon packs. Use
|
|
93
|
+
* `renderToolButton` only when you need to replace the full touch target while
|
|
94
|
+
* keeping the toolbar's horizontal scrolling and tool list behavior.
|
|
95
|
+
*/
|
|
96
|
+
type NativeVectorToolbarRenderToolInput = {
|
|
97
|
+
readonly tool: NativeVectorToolDefinition;
|
|
98
|
+
readonly selected: boolean;
|
|
99
|
+
readonly disabled: boolean;
|
|
100
|
+
readonly foregroundColor: string;
|
|
101
|
+
readonly onSelect: () => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Props for {@link NativeVectorToolbar}.
|
|
105
|
+
*
|
|
106
|
+
* The component is controlled: pass the same `value` to `NativeVectorViewport`
|
|
107
|
+
* as `toolId`, and update it from `onChange`. It is intentionally lightweight
|
|
108
|
+
* and native-only, with no dependency on the web toolbar implementation.
|
|
109
|
+
*/
|
|
110
|
+
type NativeVectorToolbarProps = {
|
|
111
|
+
readonly value: string;
|
|
112
|
+
readonly onChange: (toolId: string) => void;
|
|
113
|
+
readonly tools?: readonly NativeVectorToolDefinition[];
|
|
114
|
+
readonly disabled?: boolean;
|
|
115
|
+
readonly disabledToolIds?: readonly string[];
|
|
116
|
+
readonly accessibilityLabel?: string;
|
|
117
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
118
|
+
readonly contentContainerStyle?: StyleProp<ViewStyle>;
|
|
119
|
+
readonly toolButtonStyle?: StyleProp<ViewStyle>;
|
|
120
|
+
readonly activeToolButtonStyle?: StyleProp<ViewStyle>;
|
|
121
|
+
readonly toolLabelStyle?: StyleProp<TextStyle>;
|
|
122
|
+
readonly activeToolLabelStyle?: StyleProp<TextStyle>;
|
|
123
|
+
readonly renderToolIcon?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
|
|
124
|
+
readonly renderToolButton?: (input: NativeVectorToolbarRenderToolInput) => ReactNode;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Default mobile-friendly tool list for {@link NativeVectorToolbar}.
|
|
128
|
+
*
|
|
129
|
+
* The ids match the native viewport's built-in tool handling. Apps can pass a
|
|
130
|
+
* filtered or reordered list when permissions or product scope require it.
|
|
131
|
+
*/
|
|
132
|
+
declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[];
|
|
133
|
+
/**
|
|
134
|
+
* Horizontal, touch-sized toolbar for `canvu/native`.
|
|
135
|
+
*
|
|
136
|
+
* Use it with {@link NativeVectorViewport} by controlling the same `toolId`
|
|
137
|
+
* state. It intentionally uses React Native primitives only, so it works in
|
|
138
|
+
* Expo and bare React Native apps without a WebView.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* const [toolId, setToolId] = useState("select");
|
|
143
|
+
*
|
|
144
|
+
* <NativeVectorViewport toolId={toolId} ... />
|
|
145
|
+
* <NativeVectorToolbar value={toolId} onChange={setToolId} />
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
declare function NativeVectorToolbar({ value, onChange, tools, disabled, disabledToolIds, accessibilityLabel, style, contentContainerStyle, toolButtonStyle, activeToolButtonStyle, toolLabelStyle, activeToolLabelStyle, renderToolIcon, renderToolButton, }: NativeVectorToolbarProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
|
|
72
150
|
type NativeVectorViewportHandle = {
|
|
73
151
|
getCamera: () => Camera2D | null;
|
|
74
152
|
requestRender: () => void;
|
|
@@ -214,4 +292,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
|
|
|
214
292
|
*/
|
|
215
293
|
declare function parseSvgFragment(xml: string): SvgNode[];
|
|
216
294
|
|
|
217
|
-
export { NativeInteractionOverlay, type NativeInteractionOverlayProps, NativeSceneRenderer, type NativeSceneRendererProps, NativeShapeRenderer, type NativeShapeRendererProps, NativeVectorViewport, type NativeVectorViewportHandle, type NativeVectorViewportProps, type PlacementPreview, type SvgNode, parseSvgFragment };
|
|
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 };
|