fix: don't bundle react-dom when importing from transformHandles (#7634)

* fix: don't bundle react when importing from transfromHandles

* rename to DEFAULT_TRANSFORM_HANDLE_SPACING
This commit is contained in:
Aakansha Doshi 2024-01-31 16:50:35 +05:30 committed by GitHub
parent e0fefa8025
commit 63b50b3586
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 9 deletions

View file

@ -64,7 +64,11 @@ import {
} from "../element/transformHandles";
import { arrayToMap, throttleRAF } from "../utils";
import { UserIdleState } from "../types";
import { FRAME_STYLE, THEME_FILTER } from "../constants";
import {
DEFAULT_TRANSFORM_HANDLE_SPACING,
FRAME_STYLE,
THEME_FILTER,
} from "../constants";
import {
EXTERNAL_LINK_IMG,
getLinkHandleFromCoords,
@ -83,8 +87,6 @@ import {
isElementInFrame,
} from "../frame";
export const DEFAULT_SPACING = 2;
const strokeRectWithRotation = (
context: CanvasRenderingContext2D,
x: number,
@ -676,7 +678,8 @@ const _renderInteractiveScene = ({
);
}
} else if (selectedElements.length > 1 && !appState.isRotating) {
const dashedLinePadding = (DEFAULT_SPACING * 2) / appState.zoom.value;
const dashedLinePadding =
(DEFAULT_TRANSFORM_HANDLE_SPACING * 2) / appState.zoom.value;
context.fillStyle = oc.white;
const [x1, y1, x2, y2] = getCommonBounds(selectedElements);
const initialLineDash = context.getLineDash();
@ -1191,7 +1194,7 @@ const renderSelectionBorder = (
cy: number;
activeEmbeddable: boolean;
},
padding = DEFAULT_SPACING * 2,
padding = DEFAULT_TRANSFORM_HANDLE_SPACING * 2,
) => {
const {
angle,