canvu-react 0.4.61 → 0.4.63

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 CHANGED
@@ -5374,35 +5374,6 @@ function duplicateNativeSelectedShapes(input) {
5374
5374
  });
5375
5375
  }
5376
5376
 
5377
- // src/native/native-style-inspector-overlay.ts
5378
- function resolveNativeStyleInspectorOverlayStyle({
5379
- placement,
5380
- overlayElevation,
5381
- overlayStyle,
5382
- overlayZIndex
5383
- }) {
5384
- const placementStyle = placement === "top-left" ? {
5385
- position: "absolute",
5386
- left: 16,
5387
- top: 104,
5388
- alignItems: "flex-start"
5389
- } : {
5390
- position: "absolute",
5391
- left: 16,
5392
- right: 16,
5393
- bottom: 84,
5394
- alignItems: "center"
5395
- };
5396
- return [
5397
- placementStyle,
5398
- {
5399
- zIndex: overlayZIndex,
5400
- elevation: overlayElevation
5401
- },
5402
- overlayStyle
5403
- ];
5404
- }
5405
-
5406
5377
  // src/native/native-transient-items.ts
5407
5378
  function moveNativeTransientItems({
5408
5379
  items,
@@ -5699,8 +5670,7 @@ var NativeVectorViewport = react.forwardRef(function NativeVectorViewport2({
5699
5670
  overlay,
5700
5671
  toolbar,
5701
5672
  showStyleInspector = false,
5702
- styleInspectorPlacement = "bottom",
5703
- styleInspectorOverlayStyle
5673
+ styleInspectorPlacement = "bottom"
5704
5674
  }, ref) {
5705
5675
  const [size, setSize] = react.useState({ width: 0, height: 0 });
5706
5676
  const cameraRef = react.useRef(null);
@@ -6934,12 +6904,22 @@ var NativeVectorViewport = react.forwardRef(function NativeVectorViewport2({
6934
6904
  reactNative.View,
6935
6905
  {
6936
6906
  pointerEvents: "box-none",
6937
- style: resolveNativeStyleInspectorOverlayStyle({
6938
- placement: styleInspectorPlacement,
6939
- overlayElevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION,
6940
- overlayStyle: styleInspectorOverlayStyle,
6941
- overlayZIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX
6942
- }),
6907
+ style: styleInspectorPlacement === "top-left" ? {
6908
+ position: "absolute",
6909
+ left: 16,
6910
+ top: 104,
6911
+ alignItems: "flex-start",
6912
+ zIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX,
6913
+ elevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION
6914
+ } : {
6915
+ position: "absolute",
6916
+ left: 16,
6917
+ right: 16,
6918
+ bottom: 84,
6919
+ alignItems: "center",
6920
+ zIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX,
6921
+ elevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION
6922
+ },
6943
6923
  children: /* @__PURE__ */ jsxRuntime.jsx(
6944
6924
  NativeVectorStyleInspector,
6945
6925
  {
@@ -7168,6 +7148,139 @@ var styles4 = reactNative.StyleSheet.create({
7168
7148
  fontWeight: "700"
7169
7149
  }
7170
7150
  });
7151
+ var DEFAULT_NATIVE_VECTOR_ZOOM_CONTROLS_LABELS = {
7152
+ zoomOut: "Zoom out",
7153
+ zoomIn: "Zoom in"
7154
+ };
7155
+ function NativeVectorZoomControls({
7156
+ zoomPercent,
7157
+ onZoomOut,
7158
+ onZoomIn,
7159
+ labels,
7160
+ disabled = false,
7161
+ style,
7162
+ buttonStyle,
7163
+ iconStyle,
7164
+ labelStyle
7165
+ }) {
7166
+ const resolvedLabels = {
7167
+ ...DEFAULT_NATIVE_VECTOR_ZOOM_CONTROLS_LABELS,
7168
+ ...labels
7169
+ };
7170
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles5.root, style], children: [
7171
+ /* @__PURE__ */ jsxRuntime.jsx(
7172
+ reactNative.Pressable,
7173
+ {
7174
+ accessibilityRole: "button",
7175
+ accessibilityLabel: resolvedLabels.zoomOut,
7176
+ accessibilityState: { disabled },
7177
+ disabled,
7178
+ onPress: onZoomOut,
7179
+ style: ({ pressed }) => [
7180
+ styles5.button,
7181
+ pressed && !disabled ? styles5.buttonPressed : null,
7182
+ disabled ? styles5.buttonDisabled : null,
7183
+ buttonStyle
7184
+ ],
7185
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7186
+ reactNative.Text,
7187
+ {
7188
+ style: [styles5.icon, disabled ? styles5.disabledText : null, iconStyle],
7189
+ children: "-"
7190
+ }
7191
+ )
7192
+ }
7193
+ ),
7194
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles5.labelWrap, children: /* @__PURE__ */ jsxRuntime.jsxs(
7195
+ reactNative.Text,
7196
+ {
7197
+ accessibilityRole: "text",
7198
+ style: [styles5.label, disabled ? styles5.disabledText : null, labelStyle],
7199
+ children: [
7200
+ zoomPercent,
7201
+ "%"
7202
+ ]
7203
+ }
7204
+ ) }),
7205
+ /* @__PURE__ */ jsxRuntime.jsx(
7206
+ reactNative.Pressable,
7207
+ {
7208
+ accessibilityRole: "button",
7209
+ accessibilityLabel: resolvedLabels.zoomIn,
7210
+ accessibilityState: { disabled },
7211
+ disabled,
7212
+ onPress: onZoomIn,
7213
+ style: ({ pressed }) => [
7214
+ styles5.button,
7215
+ pressed && !disabled ? styles5.buttonPressed : null,
7216
+ disabled ? styles5.buttonDisabled : null,
7217
+ buttonStyle
7218
+ ],
7219
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7220
+ reactNative.Text,
7221
+ {
7222
+ style: [styles5.icon, disabled ? styles5.disabledText : null, iconStyle],
7223
+ children: "+"
7224
+ }
7225
+ )
7226
+ }
7227
+ )
7228
+ ] });
7229
+ }
7230
+ var styles5 = reactNative.StyleSheet.create({
7231
+ root: {
7232
+ alignItems: "center",
7233
+ backgroundColor: "#ffffff",
7234
+ borderColor: "rgba(15, 23, 42, 0.12)",
7235
+ borderRadius: 18,
7236
+ borderWidth: 1,
7237
+ elevation: 4,
7238
+ flexDirection: "row",
7239
+ paddingHorizontal: 12,
7240
+ paddingVertical: 8,
7241
+ shadowColor: "#0f172a",
7242
+ shadowOffset: { width: 0, height: 1 },
7243
+ shadowOpacity: 0.16,
7244
+ shadowRadius: 3
7245
+ },
7246
+ button: {
7247
+ alignItems: "center",
7248
+ borderRadius: 12,
7249
+ height: 36,
7250
+ justifyContent: "center",
7251
+ width: 36
7252
+ },
7253
+ buttonPressed: {
7254
+ backgroundColor: "rgba(15, 23, 42, 0.08)"
7255
+ },
7256
+ buttonDisabled: {
7257
+ opacity: 0.54
7258
+ },
7259
+ icon: {
7260
+ color: "#0f172a",
7261
+ fontSize: 30,
7262
+ fontWeight: "400",
7263
+ includeFontPadding: false,
7264
+ lineHeight: 32,
7265
+ textAlign: "center"
7266
+ },
7267
+ labelWrap: {
7268
+ alignItems: "center",
7269
+ justifyContent: "center",
7270
+ minWidth: 64,
7271
+ paddingHorizontal: 8
7272
+ },
7273
+ label: {
7274
+ color: "#0f172a",
7275
+ fontSize: 16,
7276
+ fontWeight: "700",
7277
+ includeFontPadding: false,
7278
+ lineHeight: 20
7279
+ },
7280
+ disabledText: {
7281
+ color: "#64748b"
7282
+ }
7283
+ });
7171
7284
 
7172
7285
  exports.DEFAULT_LINK_CARD_SIZE = DEFAULT_LINK_CARD_SIZE;
7173
7286
  exports.DEFAULT_NATIVE_OVERFLOW_TOOL_IDS = DEFAULT_NATIVE_OVERFLOW_TOOL_IDS;
@@ -7180,6 +7293,7 @@ exports.NativeShapeRenderer = NativeShapeRenderer;
7180
7293
  exports.NativeVectorStyleInspector = NativeVectorStyleInspector;
7181
7294
  exports.NativeVectorToolbar = NativeVectorToolbar;
7182
7295
  exports.NativeVectorViewport = NativeVectorViewport;
7296
+ exports.NativeVectorZoomControls = NativeVectorZoomControls;
7183
7297
  exports.createFreehandStrokeItem = createFreehandStrokeItem;
7184
7298
  exports.createImageItem = createImageItem;
7185
7299
  exports.createLinkItem = createLinkItem;