canvu-react 0.4.39 → 0.4.41

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
@@ -4693,6 +4693,10 @@ var MARKER_TOOL_STYLE = {
4693
4693
  strokeWidth: 16,
4694
4694
  strokeOpacity: 0.5
4695
4695
  };
4696
+ var NATIVE_VIEWPORT_OVERLAY_Z_INDEX = 40;
4697
+ var NATIVE_VIEWPORT_OVERLAY_ELEVATION = 40;
4698
+ var NATIVE_VIEWPORT_EXTERNAL_OVERLAY_Z_INDEX = 20;
4699
+ var NATIVE_VIEWPORT_EXTERNAL_OVERLAY_ELEVATION = 20;
4696
4700
  function isPlacementTool(toolId) {
4697
4701
  return toolId === "rect" || toolId === "ellipse" || toolId === "architectural-cloud" || toolId === "line" || toolId === "arrow";
4698
4702
  }
@@ -4776,6 +4780,7 @@ var NativeVectorViewport = react.forwardRef(function NativeVectorViewport2({
4776
4780
  onCameraChange,
4777
4781
  customPlacement,
4778
4782
  customPlacements = [],
4783
+ overlay,
4779
4784
  toolbar,
4780
4785
  showStyleInspector = false,
4781
4786
  styleInspectorPlacement = "bottom"
@@ -5707,153 +5712,174 @@ var NativeVectorViewport = react.forwardRef(function NativeVectorViewport2({
5707
5712
  };
5708
5713
  const normalizedNativeLinkHref = normalizeNativeLinkHref(nativeLinkInputValue);
5709
5714
  const nativeLinkCanSubmit = pendingNativeLinkRequest !== null && normalizedNativeLinkHref !== null && onItemsChange != null;
5710
- return /* @__PURE__ */ jsxRuntime.jsxs(
5711
- reactNative.View,
5712
- {
5713
- style: { flex: 1, overflow: "hidden" },
5714
- onLayout,
5715
- onPointerDown: handlePointerDown,
5716
- onPointerMove: handlePointerMove,
5717
- onPointerUp: handlePointerUp,
5718
- onPointerEnter: handlePointerMove,
5719
- onPointerLeave: () => {
5720
- hideToolCursor();
5721
- notifyWorldPointerLeave();
5722
- },
5723
- ...panResponder.panHandlers,
5724
- children: [
5725
- size.width > 0 && size.height > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5726
- /* @__PURE__ */ jsxRuntime.jsx(
5727
- NativeSceneRenderer,
5728
- {
5729
- items: sceneItems,
5730
- camera,
5731
- width: size.width,
5732
- height: size.height
5733
- }
5734
- ),
5735
- interactive && /* @__PURE__ */ jsxRuntime.jsx(
5736
- NativeInteractionOverlay,
5715
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flex: 1, overflow: "hidden" }, onLayout, children: [
5716
+ size.width > 0 && size.height > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5717
+ /* @__PURE__ */ jsxRuntime.jsxs(
5718
+ reactNative.View,
5719
+ {
5720
+ style: reactNative.StyleSheet.absoluteFill,
5721
+ onPointerDown: handlePointerDown,
5722
+ onPointerMove: handlePointerMove,
5723
+ onPointerUp: handlePointerUp,
5724
+ onPointerEnter: handlePointerMove,
5725
+ onPointerLeave: () => {
5726
+ hideToolCursor();
5727
+ notifyWorldPointerLeave();
5728
+ },
5729
+ ...panResponder.panHandlers,
5730
+ children: [
5731
+ /* @__PURE__ */ jsxRuntime.jsx(
5732
+ NativeSceneRenderer,
5733
+ {
5734
+ items: sceneItems,
5735
+ camera,
5736
+ width: size.width,
5737
+ height: size.height
5738
+ }
5739
+ ),
5740
+ interactive && /* @__PURE__ */ jsxRuntime.jsx(
5741
+ NativeInteractionOverlay,
5742
+ {
5743
+ camera,
5744
+ width: size.width,
5745
+ height: size.height,
5746
+ selectedItems,
5747
+ showResizeHandles,
5748
+ placementPreview,
5749
+ laserTrail,
5750
+ eraserTrail,
5751
+ eraserPreviewItems: items.filter(
5752
+ (it) => eraserPreviewIds.includes(it.id)
5753
+ ),
5754
+ previewStrokeStyle: strokeStyleState,
5755
+ remotePresence
5756
+ }
5757
+ )
5758
+ ]
5759
+ }
5760
+ ),
5761
+ overlay ? /* @__PURE__ */ jsxRuntime.jsx(
5762
+ reactNative.View,
5763
+ {
5764
+ pointerEvents: "box-none",
5765
+ style: [
5766
+ reactNative.StyleSheet.absoluteFill,
5737
5767
  {
5738
- camera,
5739
- width: size.width,
5740
- height: size.height,
5741
- selectedItems,
5742
- showResizeHandles,
5743
- placementPreview,
5744
- laserTrail,
5745
- eraserTrail,
5746
- eraserPreviewItems: items.filter(
5747
- (it) => eraserPreviewIds.includes(it.id)
5748
- ),
5749
- previewStrokeStyle: strokeStyleState,
5750
- remotePresence
5768
+ zIndex: NATIVE_VIEWPORT_EXTERNAL_OVERLAY_Z_INDEX,
5769
+ elevation: NATIVE_VIEWPORT_EXTERNAL_OVERLAY_ELEVATION
5751
5770
  }
5752
- ),
5753
- interactive && showStyleInspector && activeStyleToolId ? /* @__PURE__ */ jsxRuntime.jsx(
5754
- reactNative.View,
5771
+ ],
5772
+ children: overlay
5773
+ }
5774
+ ) : null,
5775
+ interactive && showStyleInspector && activeStyleToolId ? /* @__PURE__ */ jsxRuntime.jsx(
5776
+ reactNative.View,
5777
+ {
5778
+ pointerEvents: "box-none",
5779
+ style: styleInspectorPlacement === "top-left" ? {
5780
+ position: "absolute",
5781
+ left: 16,
5782
+ top: 104,
5783
+ alignItems: "flex-start",
5784
+ zIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX,
5785
+ elevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION
5786
+ } : {
5787
+ position: "absolute",
5788
+ left: 16,
5789
+ right: 16,
5790
+ bottom: 84,
5791
+ alignItems: "center",
5792
+ zIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX,
5793
+ elevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION
5794
+ },
5795
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5796
+ NativeVectorStyleInspector,
5755
5797
  {
5756
- pointerEvents: "box-none",
5757
- style: styleInspectorPlacement === "top-left" ? {
5758
- position: "absolute",
5759
- left: 16,
5760
- top: 104,
5761
- alignItems: "flex-start"
5762
- } : {
5763
- position: "absolute",
5764
- left: 16,
5765
- right: 16,
5766
- bottom: 84,
5767
- alignItems: "center"
5768
- },
5769
- children: /* @__PURE__ */ jsxRuntime.jsx(
5770
- NativeVectorStyleInspector,
5771
- {
5772
- toolId: activeStyleToolId,
5773
- value: strokeStyleState,
5774
- onChange: patchCurrentStrokeStyle
5775
- }
5776
- )
5798
+ toolId: activeStyleToolId,
5799
+ value: strokeStyleState,
5800
+ onChange: patchCurrentStrokeStyle
5777
5801
  }
5778
- ) : null,
5779
- toolbar && /* @__PURE__ */ jsxRuntime.jsx(
5780
- reactNative.View,
5802
+ )
5803
+ }
5804
+ ) : null,
5805
+ toolbar && /* @__PURE__ */ jsxRuntime.jsx(
5806
+ reactNative.View,
5807
+ {
5808
+ style: {
5809
+ position: "absolute",
5810
+ bottom: 16,
5811
+ left: 16,
5812
+ right: 16,
5813
+ flexDirection: "row",
5814
+ justifyContent: "center",
5815
+ alignItems: "center",
5816
+ zIndex: NATIVE_VIEWPORT_OVERLAY_Z_INDEX,
5817
+ elevation: NATIVE_VIEWPORT_OVERLAY_ELEVATION
5818
+ },
5819
+ pointerEvents: "box-none",
5820
+ children: toolbar
5821
+ }
5822
+ )
5823
+ ] }),
5824
+ /* @__PURE__ */ jsxRuntime.jsx(
5825
+ reactNative.Modal,
5826
+ {
5827
+ animationType: "fade",
5828
+ transparent: true,
5829
+ visible: pendingNativeLinkRequest !== null,
5830
+ onRequestClose: closeNativeLinkDialog,
5831
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.nativeLinkDialogBackdrop, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.nativeLinkDialogCard, children: [
5832
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogTitle, children: nativeLinkDialogLabels.title }),
5833
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogDescription, children: nativeLinkDialogLabels.description }),
5834
+ /* @__PURE__ */ jsxRuntime.jsx(
5835
+ reactNative.TextInput,
5781
5836
  {
5782
- style: {
5783
- position: "absolute",
5784
- bottom: 16,
5785
- left: 16,
5786
- right: 16,
5787
- flexDirection: "row",
5788
- justifyContent: "center",
5789
- alignItems: "center"
5790
- },
5791
- pointerEvents: "box-none",
5792
- children: toolbar
5837
+ accessibilityLabel: nativeLinkDialogLabels.title,
5838
+ autoCapitalize: "none",
5839
+ autoCorrect: false,
5840
+ keyboardType: "url",
5841
+ onChangeText: setNativeLinkInputValue,
5842
+ onSubmitEditing: submitNativeLinkDialog,
5843
+ placeholder: nativeLinkDialogLabels.inputPlaceholder,
5844
+ returnKeyType: "done",
5845
+ style: styles3.nativeLinkDialogInput,
5846
+ value: nativeLinkInputValue
5793
5847
  }
5794
- )
5795
- ] }),
5796
- /* @__PURE__ */ jsxRuntime.jsx(
5797
- reactNative.Modal,
5798
- {
5799
- animationType: "fade",
5800
- transparent: true,
5801
- visible: pendingNativeLinkRequest !== null,
5802
- onRequestClose: closeNativeLinkDialog,
5803
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.nativeLinkDialogBackdrop, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.nativeLinkDialogCard, children: [
5804
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogTitle, children: nativeLinkDialogLabels.title }),
5805
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogDescription, children: nativeLinkDialogLabels.description }),
5806
- /* @__PURE__ */ jsxRuntime.jsx(
5807
- reactNative.TextInput,
5808
- {
5809
- accessibilityLabel: nativeLinkDialogLabels.title,
5810
- autoCapitalize: "none",
5811
- autoCorrect: false,
5812
- keyboardType: "url",
5813
- onChangeText: setNativeLinkInputValue,
5814
- onSubmitEditing: submitNativeLinkDialog,
5815
- placeholder: nativeLinkDialogLabels.inputPlaceholder,
5816
- returnKeyType: "done",
5817
- style: styles3.nativeLinkDialogInput,
5818
- value: nativeLinkInputValue
5819
- }
5820
- ),
5821
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.nativeLinkDialogActions, children: [
5822
- /* @__PURE__ */ jsxRuntime.jsx(
5823
- reactNative.Pressable,
5824
- {
5825
- accessibilityRole: "button",
5826
- onPress: closeNativeLinkDialog,
5827
- style: ({ pressed }) => [
5828
- styles3.nativeLinkDialogButton,
5829
- pressed ? styles3.nativeLinkDialogButtonPressed : void 0
5830
- ],
5831
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogButtonText, children: nativeLinkDialogLabels.cancelLabel })
5832
- }
5833
- ),
5834
- /* @__PURE__ */ jsxRuntime.jsx(
5835
- reactNative.Pressable,
5836
- {
5837
- accessibilityRole: "button",
5838
- accessibilityState: { disabled: !nativeLinkCanSubmit },
5839
- disabled: !nativeLinkCanSubmit,
5840
- onPress: submitNativeLinkDialog,
5841
- style: ({ pressed }) => [
5842
- styles3.nativeLinkDialogButton,
5843
- styles3.nativeLinkDialogPrimaryButton,
5844
- pressed && nativeLinkCanSubmit ? styles3.nativeLinkDialogPrimaryButtonPressed : void 0,
5845
- !nativeLinkCanSubmit ? styles3.nativeLinkDialogDisabledButton : void 0
5846
- ],
5847
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogPrimaryButtonText, children: nativeLinkDialogLabels.addLabel })
5848
- }
5849
- )
5850
- ] })
5851
- ] }) })
5852
- }
5853
- )
5854
- ]
5855
- }
5856
- );
5848
+ ),
5849
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.nativeLinkDialogActions, children: [
5850
+ /* @__PURE__ */ jsxRuntime.jsx(
5851
+ reactNative.Pressable,
5852
+ {
5853
+ accessibilityRole: "button",
5854
+ onPress: closeNativeLinkDialog,
5855
+ style: ({ pressed }) => [
5856
+ styles3.nativeLinkDialogButton,
5857
+ pressed ? styles3.nativeLinkDialogButtonPressed : void 0
5858
+ ],
5859
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogButtonText, children: nativeLinkDialogLabels.cancelLabel })
5860
+ }
5861
+ ),
5862
+ /* @__PURE__ */ jsxRuntime.jsx(
5863
+ reactNative.Pressable,
5864
+ {
5865
+ accessibilityRole: "button",
5866
+ accessibilityState: { disabled: !nativeLinkCanSubmit },
5867
+ disabled: !nativeLinkCanSubmit,
5868
+ onPress: submitNativeLinkDialog,
5869
+ style: ({ pressed }) => [
5870
+ styles3.nativeLinkDialogButton,
5871
+ styles3.nativeLinkDialogPrimaryButton,
5872
+ pressed && nativeLinkCanSubmit ? styles3.nativeLinkDialogPrimaryButtonPressed : void 0,
5873
+ !nativeLinkCanSubmit ? styles3.nativeLinkDialogDisabledButton : void 0
5874
+ ],
5875
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.nativeLinkDialogPrimaryButtonText, children: nativeLinkDialogLabels.addLabel })
5876
+ }
5877
+ )
5878
+ ] })
5879
+ ] }) })
5880
+ }
5881
+ )
5882
+ ] });
5857
5883
  });
5858
5884
  var styles3 = reactNative.StyleSheet.create({
5859
5885
  nativeLinkDialogBackdrop: {