@myoc/common 0.19.537 → 0.19.539
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/dev/index.js +18 -6
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/utils.d.ts +15 -12
- package/dist/types/excalidraw/actions/actionAlign.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionFlipViewpoint.d.ts +43 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -0
- package/dist/types/excalidraw/data/json.d.ts +1 -0
- package/dist/types/excalidraw/renderer/viewpoint.d.ts +8 -0
- package/dist/types/excalidraw/types.d.ts +5 -1
- package/dist/types/excalidraw/viewport.d.ts +1 -0
- package/package.json +1 -1
package/dist/dev/index.js
CHANGED
|
@@ -2682,15 +2682,21 @@ var updateActiveTool = (appState, data) => {
|
|
|
2682
2682
|
var isFullScreen = () => document.fullscreenElement?.nodeName === "HTML";
|
|
2683
2683
|
var allowFullScreen = () => document.documentElement.requestFullscreen();
|
|
2684
2684
|
var exitFullScreen = () => document.exitFullscreen();
|
|
2685
|
+
var getViewpointFlipSign = (flipped) => flipped ? -1 : 1;
|
|
2685
2686
|
var viewportCoordsToSceneCoords = ({ clientX, clientY }, {
|
|
2686
2687
|
zoom,
|
|
2687
2688
|
offsetLeft,
|
|
2688
2689
|
offsetTop,
|
|
2689
2690
|
scrollX,
|
|
2690
|
-
scrollY
|
|
2691
|
+
scrollY,
|
|
2692
|
+
width,
|
|
2693
|
+
height,
|
|
2694
|
+
viewpointFlip
|
|
2691
2695
|
}) => {
|
|
2692
|
-
const
|
|
2693
|
-
const
|
|
2696
|
+
const viewportX = clientX - offsetLeft;
|
|
2697
|
+
const viewportY = clientY - offsetTop;
|
|
2698
|
+
const x = (viewpointFlip?.horizontal && width !== void 0 ? width - viewportX : viewportX) / zoom.value - scrollX;
|
|
2699
|
+
const y = (viewpointFlip?.vertical && height !== void 0 ? height - viewportY : viewportY) / zoom.value - scrollY;
|
|
2694
2700
|
return { x, y };
|
|
2695
2701
|
};
|
|
2696
2702
|
var sceneCoordsToViewportCoords = ({ sceneX, sceneY }, {
|
|
@@ -2698,10 +2704,15 @@ var sceneCoordsToViewportCoords = ({ sceneX, sceneY }, {
|
|
|
2698
2704
|
offsetLeft,
|
|
2699
2705
|
offsetTop,
|
|
2700
2706
|
scrollX,
|
|
2701
|
-
scrollY
|
|
2707
|
+
scrollY,
|
|
2708
|
+
width,
|
|
2709
|
+
height,
|
|
2710
|
+
viewpointFlip
|
|
2702
2711
|
}) => {
|
|
2703
|
-
const
|
|
2704
|
-
const
|
|
2712
|
+
const sceneViewportX = (sceneX + scrollX) * zoom.value;
|
|
2713
|
+
const sceneViewportY = (sceneY + scrollY) * zoom.value;
|
|
2714
|
+
const x = (viewpointFlip?.horizontal && width !== void 0 ? width - sceneViewportX : sceneViewportX) + offsetLeft;
|
|
2715
|
+
const y = (viewpointFlip?.vertical && height !== void 0 ? height - sceneViewportY : sceneViewportY) + offsetTop;
|
|
2705
2716
|
return { x, y };
|
|
2706
2717
|
};
|
|
2707
2718
|
var getGlobalCSSVariable = (name) => getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);
|
|
@@ -3705,6 +3716,7 @@ export {
|
|
|
3705
3716
|
getUpdatedTimestamp,
|
|
3706
3717
|
getVersion,
|
|
3707
3718
|
getVerticalOffset,
|
|
3719
|
+
getViewpointFlipSign,
|
|
3708
3720
|
invariant,
|
|
3709
3721
|
isAndroid,
|
|
3710
3722
|
isAnyTrue,
|