canvu-react 0.4.41 → 0.4.43
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.cjs +571 -65
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +69 -3
- package/dist/native.d.ts +69 -3
- package/dist/native.js +571 -66
- package/dist/native.js.map +1 -1
- package/package.json +1 -1
package/dist/native.d.cts
CHANGED
|
@@ -4,10 +4,53 @@ import { C as Camera2D, S as StrokeStyle } from './shape-builders-CKEMjivV.cjs';
|
|
|
4
4
|
export { o as createFreehandStrokeItem, q as createImageItem, t as createShapeId } from './shape-builders-CKEMjivV.cjs';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.cjs';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
import { R as RemotePresencePeer } from './types-BQUbxMgz.cjs';
|
|
8
|
-
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
9
7
|
import * as react from 'react';
|
|
10
8
|
import { ReactNode } from 'react';
|
|
9
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
10
|
+
import { R as RemotePresencePeer } from './types-BQUbxMgz.cjs';
|
|
11
|
+
|
|
12
|
+
type NativeImagesMenuLabels = {
|
|
13
|
+
title?: string;
|
|
14
|
+
focus?: string;
|
|
15
|
+
duplicate?: string;
|
|
16
|
+
copy?: string;
|
|
17
|
+
rotate?: string;
|
|
18
|
+
delete?: string;
|
|
19
|
+
collapse?: string;
|
|
20
|
+
expand?: string;
|
|
21
|
+
};
|
|
22
|
+
type NativeImagesMenuProps = {
|
|
23
|
+
readonly items: readonly VectorSceneItem[];
|
|
24
|
+
readonly onItemsChange: (items: VectorSceneItem[]) => void;
|
|
25
|
+
readonly onFocusItem?: (item: VectorSceneItem) => void;
|
|
26
|
+
readonly labels?: NativeImagesMenuLabels;
|
|
27
|
+
readonly defaultOpen?: boolean;
|
|
28
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
29
|
+
readonly panelStyle?: StyleProp<ViewStyle>;
|
|
30
|
+
readonly collapsedButtonStyle?: StyleProp<ViewStyle>;
|
|
31
|
+
readonly rowStyle?: StyleProp<ViewStyle>;
|
|
32
|
+
readonly actionButtonStyle?: StyleProp<ViewStyle>;
|
|
33
|
+
readonly getImageUri?: (item: VectorSceneItem) => string | null | undefined;
|
|
34
|
+
readonly renderThumbnail?: (item: VectorSceneItem) => ReactNode;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* React Native companion to the web `ImagesMenu` component.
|
|
38
|
+
*
|
|
39
|
+
* Use this for floating mobile page/image management controls that should look
|
|
40
|
+
* and behave like the web `ImagesMenu`: a compact button when collapsed and a
|
|
41
|
+
* small anchored panel with managed image thumbnails plus duplicate, rotate,
|
|
42
|
+
* delete, and focus actions when expanded.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <NativeImagesMenu
|
|
47
|
+
* items={items}
|
|
48
|
+
* onItemsChange={setItems}
|
|
49
|
+
* onFocusItem={(item) => viewportRef.current?.fitWorldRect(item.bounds)}
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function NativeImagesMenu({ items, onItemsChange, onFocusItem, labels, defaultOpen, style, panelStyle, collapsedButtonStyle, rowStyle, actionButtonStyle, getImageUri, renderThumbnail, }: NativeImagesMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
11
54
|
|
|
12
55
|
type TimedTrailPoint = {
|
|
13
56
|
readonly x: number;
|
|
@@ -189,6 +232,19 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
|
|
|
189
232
|
*/
|
|
190
233
|
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;
|
|
191
234
|
|
|
235
|
+
type NativeRemotePresenceHitTarget = "cursor" | "label";
|
|
236
|
+
type NativeRemotePresenceHit = {
|
|
237
|
+
readonly peer: RemotePresencePeer;
|
|
238
|
+
readonly followId: string;
|
|
239
|
+
readonly target: NativeRemotePresenceHitTarget;
|
|
240
|
+
readonly screenX: number;
|
|
241
|
+
readonly screenY: number;
|
|
242
|
+
readonly worldX: number;
|
|
243
|
+
readonly worldY: number;
|
|
244
|
+
readonly clientId?: string;
|
|
245
|
+
readonly peerId?: string;
|
|
246
|
+
};
|
|
247
|
+
|
|
192
248
|
type NativeCustomShapePlacementOptions = {
|
|
193
249
|
readonly toolId: string;
|
|
194
250
|
readonly createItem: (args: {
|
|
@@ -215,6 +271,15 @@ type NativeWorldPointerDownDetail = {
|
|
|
215
271
|
readonly screenX: number;
|
|
216
272
|
readonly screenY: number;
|
|
217
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Detail emitted when a native pointer/touch begins on a remote realtime
|
|
276
|
+
* participant label or cursor.
|
|
277
|
+
*
|
|
278
|
+
* Pass `followId` into your `followedPeerId` state for
|
|
279
|
+
* `useRealtimePeerFollow(...)`. For realtime-session peers this is the
|
|
280
|
+
* connection `clientId`, matching the session peer `id`.
|
|
281
|
+
*/
|
|
282
|
+
type NativeRemotePresencePressDetail = NativeRemotePresenceHit;
|
|
218
283
|
/**
|
|
219
284
|
* Optional override for a link item inserted from the native link tool.
|
|
220
285
|
*
|
|
@@ -287,6 +352,7 @@ type NativeVectorViewportProps = {
|
|
|
287
352
|
readonly onLinkToolRequest?: (detail: NativeLinkToolRequestDetail) => void;
|
|
288
353
|
readonly linkToolDialogLabels?: NativeLinkToolDialogLabels;
|
|
289
354
|
readonly onWorldPointerDown?: (detail: NativeWorldPointerDownDetail) => void;
|
|
355
|
+
readonly onRemotePresencePress?: (detail: NativeRemotePresencePressDetail) => void;
|
|
290
356
|
readonly onWorldPointerMove?: (world: {
|
|
291
357
|
readonly x: number;
|
|
292
358
|
readonly y: number;
|
|
@@ -434,4 +500,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
|
|
|
434
500
|
*/
|
|
435
501
|
declare function parseSvgFragment(xml: string): SvgNode[];
|
|
436
502
|
|
|
437
|
-
export { CanvuLinkData, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeInteractionOverlay, type NativeInteractionOverlayProps, type NativeLinkToolDialogLabels, type NativeLinkToolInsertOptions, type NativeLinkToolRequestDetail, 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 };
|
|
503
|
+
export { CanvuLinkData, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeImagesMenu, type NativeImagesMenuLabels, type NativeImagesMenuProps, NativeInteractionOverlay, type NativeInteractionOverlayProps, type NativeLinkToolDialogLabels, type NativeLinkToolInsertOptions, type NativeLinkToolRequestDetail, type NativeRemotePresencePressDetail, 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
|
@@ -4,10 +4,53 @@ import { C as Camera2D, S as StrokeStyle } from './shape-builders-Cyh8zvDG.js';
|
|
|
4
4
|
export { o as createFreehandStrokeItem, q as createImageItem, t as createShapeId } from './shape-builders-Cyh8zvDG.js';
|
|
5
5
|
import { V as VectorSceneItem, R as Rect } from './types-BCCvY6ie.js';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
import { R as RemotePresencePeer } from './types-B82WiQQh.js';
|
|
8
|
-
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
9
7
|
import * as react from 'react';
|
|
10
8
|
import { ReactNode } from 'react';
|
|
9
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
10
|
+
import { R as RemotePresencePeer } from './types-B82WiQQh.js';
|
|
11
|
+
|
|
12
|
+
type NativeImagesMenuLabels = {
|
|
13
|
+
title?: string;
|
|
14
|
+
focus?: string;
|
|
15
|
+
duplicate?: string;
|
|
16
|
+
copy?: string;
|
|
17
|
+
rotate?: string;
|
|
18
|
+
delete?: string;
|
|
19
|
+
collapse?: string;
|
|
20
|
+
expand?: string;
|
|
21
|
+
};
|
|
22
|
+
type NativeImagesMenuProps = {
|
|
23
|
+
readonly items: readonly VectorSceneItem[];
|
|
24
|
+
readonly onItemsChange: (items: VectorSceneItem[]) => void;
|
|
25
|
+
readonly onFocusItem?: (item: VectorSceneItem) => void;
|
|
26
|
+
readonly labels?: NativeImagesMenuLabels;
|
|
27
|
+
readonly defaultOpen?: boolean;
|
|
28
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
29
|
+
readonly panelStyle?: StyleProp<ViewStyle>;
|
|
30
|
+
readonly collapsedButtonStyle?: StyleProp<ViewStyle>;
|
|
31
|
+
readonly rowStyle?: StyleProp<ViewStyle>;
|
|
32
|
+
readonly actionButtonStyle?: StyleProp<ViewStyle>;
|
|
33
|
+
readonly getImageUri?: (item: VectorSceneItem) => string | null | undefined;
|
|
34
|
+
readonly renderThumbnail?: (item: VectorSceneItem) => ReactNode;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* React Native companion to the web `ImagesMenu` component.
|
|
38
|
+
*
|
|
39
|
+
* Use this for floating mobile page/image management controls that should look
|
|
40
|
+
* and behave like the web `ImagesMenu`: a compact button when collapsed and a
|
|
41
|
+
* small anchored panel with managed image thumbnails plus duplicate, rotate,
|
|
42
|
+
* delete, and focus actions when expanded.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <NativeImagesMenu
|
|
47
|
+
* items={items}
|
|
48
|
+
* onItemsChange={setItems}
|
|
49
|
+
* onFocusItem={(item) => viewportRef.current?.fitWorldRect(item.bounds)}
|
|
50
|
+
* />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function NativeImagesMenu({ items, onItemsChange, onFocusItem, labels, defaultOpen, style, panelStyle, collapsedButtonStyle, rowStyle, actionButtonStyle, getImageUri, renderThumbnail, }: NativeImagesMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
11
54
|
|
|
12
55
|
type TimedTrailPoint = {
|
|
13
56
|
readonly x: number;
|
|
@@ -189,6 +232,19 @@ declare const DEFAULT_NATIVE_VECTOR_TOOLS: readonly NativeVectorToolDefinition[]
|
|
|
189
232
|
*/
|
|
190
233
|
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;
|
|
191
234
|
|
|
235
|
+
type NativeRemotePresenceHitTarget = "cursor" | "label";
|
|
236
|
+
type NativeRemotePresenceHit = {
|
|
237
|
+
readonly peer: RemotePresencePeer;
|
|
238
|
+
readonly followId: string;
|
|
239
|
+
readonly target: NativeRemotePresenceHitTarget;
|
|
240
|
+
readonly screenX: number;
|
|
241
|
+
readonly screenY: number;
|
|
242
|
+
readonly worldX: number;
|
|
243
|
+
readonly worldY: number;
|
|
244
|
+
readonly clientId?: string;
|
|
245
|
+
readonly peerId?: string;
|
|
246
|
+
};
|
|
247
|
+
|
|
192
248
|
type NativeCustomShapePlacementOptions = {
|
|
193
249
|
readonly toolId: string;
|
|
194
250
|
readonly createItem: (args: {
|
|
@@ -215,6 +271,15 @@ type NativeWorldPointerDownDetail = {
|
|
|
215
271
|
readonly screenX: number;
|
|
216
272
|
readonly screenY: number;
|
|
217
273
|
};
|
|
274
|
+
/**
|
|
275
|
+
* Detail emitted when a native pointer/touch begins on a remote realtime
|
|
276
|
+
* participant label or cursor.
|
|
277
|
+
*
|
|
278
|
+
* Pass `followId` into your `followedPeerId` state for
|
|
279
|
+
* `useRealtimePeerFollow(...)`. For realtime-session peers this is the
|
|
280
|
+
* connection `clientId`, matching the session peer `id`.
|
|
281
|
+
*/
|
|
282
|
+
type NativeRemotePresencePressDetail = NativeRemotePresenceHit;
|
|
218
283
|
/**
|
|
219
284
|
* Optional override for a link item inserted from the native link tool.
|
|
220
285
|
*
|
|
@@ -287,6 +352,7 @@ type NativeVectorViewportProps = {
|
|
|
287
352
|
readonly onLinkToolRequest?: (detail: NativeLinkToolRequestDetail) => void;
|
|
288
353
|
readonly linkToolDialogLabels?: NativeLinkToolDialogLabels;
|
|
289
354
|
readonly onWorldPointerDown?: (detail: NativeWorldPointerDownDetail) => void;
|
|
355
|
+
readonly onRemotePresencePress?: (detail: NativeRemotePresencePressDetail) => void;
|
|
290
356
|
readonly onWorldPointerMove?: (world: {
|
|
291
357
|
readonly x: number;
|
|
292
358
|
readonly y: number;
|
|
@@ -434,4 +500,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
|
|
|
434
500
|
*/
|
|
435
501
|
declare function parseSvgFragment(xml: string): SvgNode[];
|
|
436
502
|
|
|
437
|
-
export { CanvuLinkData, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeInteractionOverlay, type NativeInteractionOverlayProps, type NativeLinkToolDialogLabels, type NativeLinkToolInsertOptions, type NativeLinkToolRequestDetail, 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 };
|
|
503
|
+
export { CanvuLinkData, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, type NativeCustomShapePlacementOptions, NativeImagesMenu, type NativeImagesMenuLabels, type NativeImagesMenuProps, NativeInteractionOverlay, type NativeInteractionOverlayProps, type NativeLinkToolDialogLabels, type NativeLinkToolInsertOptions, type NativeLinkToolRequestDetail, type NativeRemotePresencePressDetail, 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 };
|