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