canvu-react 0.4.60 → 0.4.62

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
@@ -389,6 +389,39 @@ type NativeVectorViewportProps = {
389
389
  };
390
390
  declare const NativeVectorViewport: react.ForwardRefExoticComponent<NativeVectorViewportProps & react.RefAttributes<NativeVectorViewportHandle>>;
391
391
 
392
+ type NativeVectorZoomControlsLabels = {
393
+ readonly zoomOut?: string;
394
+ readonly zoomIn?: string;
395
+ };
396
+ type NativeVectorZoomControlsProps = {
397
+ readonly zoomPercent: number;
398
+ readonly onZoomOut: () => void;
399
+ readonly onZoomIn: () => void;
400
+ readonly labels?: NativeVectorZoomControlsLabels;
401
+ readonly disabled?: boolean;
402
+ readonly style?: StyleProp<ViewStyle>;
403
+ readonly buttonStyle?: StyleProp<ViewStyle>;
404
+ readonly iconStyle?: StyleProp<TextStyle>;
405
+ readonly labelStyle?: StyleProp<TextStyle>;
406
+ };
407
+ /**
408
+ * Native zoom-out, percentage, and zoom-in control for apps that compose
409
+ * {@link NativeVectorViewport} with their own floating chrome.
410
+ *
411
+ * Canvu owns the visual control and accessibility defaults; the consuming app
412
+ * should own placement, visibility, and camera wiring.
413
+ *
414
+ * @example
415
+ * ```tsx
416
+ * <NativeVectorZoomControls
417
+ * zoomPercent={Math.round(camera.zoom * 100)}
418
+ * onZoomOut={() => camera.setZoom(camera.zoom / 1.2)}
419
+ * onZoomIn={() => camera.setZoom(camera.zoom * 1.2)}
420
+ * />
421
+ * ```
422
+ */
423
+ declare function NativeVectorZoomControls({ zoomPercent, onZoomOut, onZoomIn, labels, disabled, style, buttonStyle, iconStyle, labelStyle, }: NativeVectorZoomControlsProps): react_jsx_runtime.JSX.Element;
424
+
392
425
  type NativeStyleColor = {
393
426
  readonly name: string;
394
427
  readonly hex: string;
@@ -520,4 +553,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
520
553
  */
521
554
  declare function parseSvgFragment(xml: string): SvgNode[];
522
555
 
523
- 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 };
556
+ 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, NativeVectorZoomControls, type NativeVectorZoomControlsLabels, type NativeVectorZoomControlsProps, type NativeWorldPointerDownDetail, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
package/dist/native.d.ts CHANGED
@@ -389,6 +389,39 @@ type NativeVectorViewportProps = {
389
389
  };
390
390
  declare const NativeVectorViewport: react.ForwardRefExoticComponent<NativeVectorViewportProps & react.RefAttributes<NativeVectorViewportHandle>>;
391
391
 
392
+ type NativeVectorZoomControlsLabels = {
393
+ readonly zoomOut?: string;
394
+ readonly zoomIn?: string;
395
+ };
396
+ type NativeVectorZoomControlsProps = {
397
+ readonly zoomPercent: number;
398
+ readonly onZoomOut: () => void;
399
+ readonly onZoomIn: () => void;
400
+ readonly labels?: NativeVectorZoomControlsLabels;
401
+ readonly disabled?: boolean;
402
+ readonly style?: StyleProp<ViewStyle>;
403
+ readonly buttonStyle?: StyleProp<ViewStyle>;
404
+ readonly iconStyle?: StyleProp<TextStyle>;
405
+ readonly labelStyle?: StyleProp<TextStyle>;
406
+ };
407
+ /**
408
+ * Native zoom-out, percentage, and zoom-in control for apps that compose
409
+ * {@link NativeVectorViewport} with their own floating chrome.
410
+ *
411
+ * Canvu owns the visual control and accessibility defaults; the consuming app
412
+ * should own placement, visibility, and camera wiring.
413
+ *
414
+ * @example
415
+ * ```tsx
416
+ * <NativeVectorZoomControls
417
+ * zoomPercent={Math.round(camera.zoom * 100)}
418
+ * onZoomOut={() => camera.setZoom(camera.zoom / 1.2)}
419
+ * onZoomIn={() => camera.setZoom(camera.zoom * 1.2)}
420
+ * />
421
+ * ```
422
+ */
423
+ declare function NativeVectorZoomControls({ zoomPercent, onZoomOut, onZoomIn, labels, disabled, style, buttonStyle, iconStyle, labelStyle, }: NativeVectorZoomControlsProps): react_jsx_runtime.JSX.Element;
424
+
392
425
  type NativeStyleColor = {
393
426
  readonly name: string;
394
427
  readonly hex: string;
@@ -520,4 +553,4 @@ type SvgNode = SvgRectNode | SvgEllipseNode | SvgCircleNode | SvgLineNode | SvgP
520
553
  */
521
554
  declare function parseSvgFragment(xml: string): SvgNode[];
522
555
 
523
- 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 };
556
+ 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, NativeVectorZoomControls, type NativeVectorZoomControlsLabels, type NativeVectorZoomControlsProps, type NativeWorldPointerDownDetail, type PlacementPreview, type SvgNode, VectorSceneItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
package/dist/native.js CHANGED
@@ -7142,7 +7142,140 @@ var styles4 = StyleSheet.create({
7142
7142
  fontWeight: "700"
7143
7143
  }
7144
7144
  });
7145
+ var DEFAULT_NATIVE_VECTOR_ZOOM_CONTROLS_LABELS = {
7146
+ zoomOut: "Zoom out",
7147
+ zoomIn: "Zoom in"
7148
+ };
7149
+ function NativeVectorZoomControls({
7150
+ zoomPercent,
7151
+ onZoomOut,
7152
+ onZoomIn,
7153
+ labels,
7154
+ disabled = false,
7155
+ style,
7156
+ buttonStyle,
7157
+ iconStyle,
7158
+ labelStyle
7159
+ }) {
7160
+ const resolvedLabels = {
7161
+ ...DEFAULT_NATIVE_VECTOR_ZOOM_CONTROLS_LABELS,
7162
+ ...labels
7163
+ };
7164
+ return /* @__PURE__ */ jsxs(View, { style: [styles5.root, style], children: [
7165
+ /* @__PURE__ */ jsx(
7166
+ Pressable,
7167
+ {
7168
+ accessibilityRole: "button",
7169
+ accessibilityLabel: resolvedLabels.zoomOut,
7170
+ accessibilityState: { disabled },
7171
+ disabled,
7172
+ onPress: onZoomOut,
7173
+ style: ({ pressed }) => [
7174
+ styles5.button,
7175
+ pressed && !disabled ? styles5.buttonPressed : null,
7176
+ disabled ? styles5.buttonDisabled : null,
7177
+ buttonStyle
7178
+ ],
7179
+ children: /* @__PURE__ */ jsx(
7180
+ Text,
7181
+ {
7182
+ style: [styles5.icon, disabled ? styles5.disabledText : null, iconStyle],
7183
+ children: "-"
7184
+ }
7185
+ )
7186
+ }
7187
+ ),
7188
+ /* @__PURE__ */ jsx(View, { style: styles5.labelWrap, children: /* @__PURE__ */ jsxs(
7189
+ Text,
7190
+ {
7191
+ accessibilityRole: "text",
7192
+ style: [styles5.label, disabled ? styles5.disabledText : null, labelStyle],
7193
+ children: [
7194
+ zoomPercent,
7195
+ "%"
7196
+ ]
7197
+ }
7198
+ ) }),
7199
+ /* @__PURE__ */ jsx(
7200
+ Pressable,
7201
+ {
7202
+ accessibilityRole: "button",
7203
+ accessibilityLabel: resolvedLabels.zoomIn,
7204
+ accessibilityState: { disabled },
7205
+ disabled,
7206
+ onPress: onZoomIn,
7207
+ style: ({ pressed }) => [
7208
+ styles5.button,
7209
+ pressed && !disabled ? styles5.buttonPressed : null,
7210
+ disabled ? styles5.buttonDisabled : null,
7211
+ buttonStyle
7212
+ ],
7213
+ children: /* @__PURE__ */ jsx(
7214
+ Text,
7215
+ {
7216
+ style: [styles5.icon, disabled ? styles5.disabledText : null, iconStyle],
7217
+ children: "+"
7218
+ }
7219
+ )
7220
+ }
7221
+ )
7222
+ ] });
7223
+ }
7224
+ var styles5 = StyleSheet.create({
7225
+ root: {
7226
+ alignItems: "center",
7227
+ backgroundColor: "#ffffff",
7228
+ borderColor: "rgba(15, 23, 42, 0.12)",
7229
+ borderRadius: 18,
7230
+ borderWidth: 1,
7231
+ elevation: 4,
7232
+ flexDirection: "row",
7233
+ paddingHorizontal: 12,
7234
+ paddingVertical: 8,
7235
+ shadowColor: "#0f172a",
7236
+ shadowOffset: { width: 0, height: 1 },
7237
+ shadowOpacity: 0.16,
7238
+ shadowRadius: 3
7239
+ },
7240
+ button: {
7241
+ alignItems: "center",
7242
+ borderRadius: 12,
7243
+ height: 36,
7244
+ justifyContent: "center",
7245
+ width: 36
7246
+ },
7247
+ buttonPressed: {
7248
+ backgroundColor: "rgba(15, 23, 42, 0.08)"
7249
+ },
7250
+ buttonDisabled: {
7251
+ opacity: 0.54
7252
+ },
7253
+ icon: {
7254
+ color: "#0f172a",
7255
+ fontSize: 30,
7256
+ fontWeight: "400",
7257
+ includeFontPadding: false,
7258
+ lineHeight: 32,
7259
+ textAlign: "center"
7260
+ },
7261
+ labelWrap: {
7262
+ alignItems: "center",
7263
+ justifyContent: "center",
7264
+ minWidth: 64,
7265
+ paddingHorizontal: 8
7266
+ },
7267
+ label: {
7268
+ color: "#0f172a",
7269
+ fontSize: 16,
7270
+ fontWeight: "700",
7271
+ includeFontPadding: false,
7272
+ lineHeight: 20
7273
+ },
7274
+ disabledText: {
7275
+ color: "#64748b"
7276
+ }
7277
+ });
7145
7278
 
7146
- export { DEFAULT_LINK_CARD_SIZE, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, NativeImagesMenu, NativeInteractionOverlay, NativeSceneRenderer, NativeShapeRenderer, NativeVectorStyleInspector, NativeVectorToolbar, NativeVectorViewport, createFreehandStrokeItem, createImageItem, createLinkItem, createShapeId, getLinkData, isLinkItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
7279
+ export { DEFAULT_LINK_CARD_SIZE, DEFAULT_NATIVE_OVERFLOW_TOOL_IDS, DEFAULT_NATIVE_VECTOR_TOOLS, NATIVE_STYLE_PALETTE, NativeImagesMenu, NativeInteractionOverlay, NativeSceneRenderer, NativeShapeRenderer, NativeVectorStyleInspector, NativeVectorToolbar, NativeVectorViewport, NativeVectorZoomControls, createFreehandStrokeItem, createImageItem, createLinkItem, createShapeId, getLinkData, isLinkItem, nativeStyleColorWithOpacity, normalizeNativeStyleHex, parseSvgFragment };
7147
7280
  //# sourceMappingURL=native.js.map
7148
7281
  //# sourceMappingURL=native.js.map