mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix the rest except scene and ShapeCache
This commit is contained in:
parent
79021f4b6b
commit
875450a0a1
30 changed files with 100 additions and 125 deletions
|
@ -4,9 +4,7 @@
|
||||||
"packageManager": "yarn@1.22.22",
|
"packageManager": "yarn@1.22.22",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"excalidraw-app",
|
"excalidraw-app",
|
||||||
"packages/excalidraw",
|
"packages/*",
|
||||||
"packages/utils",
|
|
||||||
"packages/math",
|
|
||||||
"examples/*"
|
"examples/*"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
export * from "./src/binary-heap";
|
|
||||||
export * from "./src/colors";
|
|
||||||
export * from "./src/constants";
|
|
||||||
export * from "./src/keys";
|
|
||||||
export * from "./src/points";
|
|
||||||
export * from "./src/promise-pool";
|
|
||||||
export * from "./src/random";
|
|
||||||
export * from "./src/url";
|
|
||||||
export * from "./src/utils";
|
|
9
packages/common/src/index.ts
Normal file
9
packages/common/src/index.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
export * from "./binary-heap";
|
||||||
|
export * from "./colors";
|
||||||
|
export * from "./constants";
|
||||||
|
export * from "./keys";
|
||||||
|
export * from "./points";
|
||||||
|
export * from "./promise-pool";
|
||||||
|
export * from "./random";
|
||||||
|
export * from "./url";
|
||||||
|
export * from "./utils";
|
|
@ -3,7 +3,6 @@ import { isPointWithinBounds, pointFrom } from "@excalidraw/math";
|
||||||
import {
|
import {
|
||||||
doLineSegmentsIntersect,
|
doLineSegmentsIntersect,
|
||||||
elementsOverlappingBBox,
|
elementsOverlappingBBox,
|
||||||
getCommonBounds,
|
|
||||||
} from "@excalidraw/utils";
|
} from "@excalidraw/utils";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -37,7 +36,7 @@ import type {
|
||||||
|
|
||||||
import type { ReadonlySetLike } from "@excalidraw/excalidraw/utility-types";
|
import type { ReadonlySetLike } from "@excalidraw/excalidraw/utility-types";
|
||||||
|
|
||||||
import { getElementLineSegments } from "./bounds";
|
import { getElementLineSegments, getCommonBounds } from "./bounds";
|
||||||
import { mutateElement } from "./mutateElement";
|
import { mutateElement } from "./mutateElement";
|
||||||
import { getBoundTextElement, getContainerElement } from "./textElement";
|
import { getBoundTextElement, getContainerElement } from "./textElement";
|
||||||
import { isFrameElement, isFrameLikeElement } from "./typeChecks";
|
import { isFrameElement, isFrameLikeElement } from "./typeChecks";
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
import { isInvisiblySmallElement } from "./src/sizeHelpers";
|
import { isInvisiblySmallElement } from "./sizeHelpers";
|
||||||
import { isLinearElementType } from "./src/typeChecks";
|
import { isLinearElementType } from "./typeChecks";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ExcalidrawElement,
|
ExcalidrawElement,
|
||||||
NonDeletedExcalidrawElement,
|
NonDeletedExcalidrawElement,
|
||||||
NonDeleted,
|
NonDeleted,
|
||||||
} from "./src/types";
|
} from "./types";
|
||||||
|
|
||||||
export * from "./src/bounds";
|
export * from "./bounds";
|
||||||
export * from "./src/dragElements";
|
export * from "./dragElements";
|
||||||
export * from "./src/frame";
|
export * from "./frame";
|
||||||
export * from "./src/mutateElement";
|
export * from "./mutateElement";
|
||||||
export * from "./src/newElement";
|
export * from "./newElement";
|
||||||
export * from "./src/resizeElements";
|
export * from "./resizeElements";
|
||||||
export * from "./src/resizeTest";
|
export * from "./resizeTest";
|
||||||
export * from "./src/shapes";
|
export * from "./shapes";
|
||||||
export * from "./src/showSelectedShapeActions";
|
export * from "./showSelectedShapeActions";
|
||||||
export * from "./src/textElement";
|
export * from "./textElement";
|
||||||
export * from "./src/typeChecks";
|
export * from "./typeChecks";
|
||||||
export * from "./src/transformHandles";
|
export * from "./transformHandles";
|
||||||
export * from "./src/sizeHelpers";
|
export * from "./sizeHelpers";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated unsafe, use hashElementsVersion instead
|
* @deprecated unsafe, use hashElementsVersion instead
|
|
@ -44,11 +44,6 @@ import type {
|
||||||
|
|
||||||
import type { Mutable } from "@excalidraw/excalidraw/utility-types";
|
import type { Mutable } from "@excalidraw/excalidraw/utility-types";
|
||||||
|
|
||||||
import {
|
|
||||||
getElementAbsoluteCoords,
|
|
||||||
getLockedLinearCursorAlignSize,
|
|
||||||
} from "../index";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
bindOrUnbindLinearElement,
|
bindOrUnbindLinearElement,
|
||||||
getHoveredElementForBinding,
|
getHoveredElementForBinding,
|
||||||
|
@ -64,6 +59,8 @@ import {
|
||||||
isFixedPointBinding,
|
isFixedPointBinding,
|
||||||
} from "./typeChecks";
|
} from "./typeChecks";
|
||||||
|
|
||||||
|
import { getElementAbsoluteCoords, getLockedLinearCursorAlignSize } from "./";
|
||||||
|
|
||||||
import type { Bounds } from "./bounds";
|
import type { Bounds } from "./bounds";
|
||||||
import type {
|
import type {
|
||||||
NonDeleted,
|
NonDeleted,
|
||||||
|
|
|
@ -27,14 +27,14 @@ import type {
|
||||||
Mutable,
|
Mutable,
|
||||||
} from "@excalidraw/excalidraw/utility-types";
|
} from "@excalidraw/excalidraw/utility-types";
|
||||||
|
|
||||||
import { getElementAbsoluteCoords } from "../index";
|
|
||||||
|
|
||||||
import { getResizedElementAbsoluteCoords } from "./bounds";
|
import { getResizedElementAbsoluteCoords } from "./bounds";
|
||||||
import { bumpVersion, newElementWith } from "./mutateElement";
|
import { bumpVersion, newElementWith } from "./mutateElement";
|
||||||
import { getBoundTextMaxWidth } from "./textElement";
|
import { getBoundTextMaxWidth } from "./textElement";
|
||||||
import { normalizeText, measureText } from "./textMeasurements";
|
import { normalizeText, measureText } from "./textMeasurements";
|
||||||
import { wrapText } from "./textWrapping";
|
import { wrapText } from "./textWrapping";
|
||||||
|
|
||||||
|
import { getElementAbsoluteCoords } from ".";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ExcalidrawElement,
|
ExcalidrawElement,
|
||||||
ExcalidrawImageElement,
|
ExcalidrawImageElement,
|
||||||
|
|
|
@ -27,13 +27,13 @@ import {
|
||||||
|
|
||||||
import type { NormalizedZoomValue, Zoom } from "@excalidraw/excalidraw/types";
|
import type { NormalizedZoomValue, Zoom } from "@excalidraw/excalidraw/types";
|
||||||
|
|
||||||
import { getElementAbsoluteCoords } from "../index";
|
|
||||||
|
|
||||||
import { shouldTestInside } from "./collision";
|
import { shouldTestInside } from "./collision";
|
||||||
import { LinearElementEditor } from "./linearElementEditor";
|
import { LinearElementEditor } from "./linearElementEditor";
|
||||||
import { getBoundTextElement } from "./textElement";
|
import { getBoundTextElement } from "./textElement";
|
||||||
import { ShapeCache } from "./scene/ShapeCache";
|
import { ShapeCache } from "./scene/ShapeCache";
|
||||||
|
|
||||||
|
import { getElementAbsoluteCoords } from "./";
|
||||||
|
|
||||||
import type { Bounds } from "./bounds";
|
import type { Bounds } from "./bounds";
|
||||||
import type {
|
import type {
|
||||||
ElementsMap,
|
ElementsMap,
|
||||||
|
|
|
@ -13,8 +13,6 @@ import type { AppState } from "@excalidraw/excalidraw/types";
|
||||||
|
|
||||||
import type { ExtractSetType } from "@excalidraw/excalidraw/utility-types";
|
import type { ExtractSetType } from "@excalidraw/excalidraw/utility-types";
|
||||||
|
|
||||||
import { isTextElement } from "../index";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
resetOriginalContainerCache,
|
resetOriginalContainerCache,
|
||||||
updateOriginalContainerCache,
|
updateOriginalContainerCache,
|
||||||
|
@ -25,6 +23,8 @@ import { measureText } from "./textMeasurements";
|
||||||
import { wrapText } from "./textWrapping";
|
import { wrapText } from "./textWrapping";
|
||||||
import { isBoundToContainer, isArrowElement } from "./typeChecks";
|
import { isBoundToContainer, isArrowElement } from "./typeChecks";
|
||||||
|
|
||||||
|
import { isTextElement } from "./";
|
||||||
|
|
||||||
import type { MaybeTransformHandleType } from "./transformHandles";
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
||||||
import type {
|
import type {
|
||||||
ElementsMap,
|
ElementsMap,
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
|
import { isImageElement } from "@excalidraw/element/typeChecks";
|
||||||
|
|
||||||
|
import type { ExcalidrawImageElement } from "@excalidraw/element/types";
|
||||||
|
|
||||||
import { ToolButton } from "../components/ToolButton";
|
import { ToolButton } from "../components/ToolButton";
|
||||||
import { cropIcon } from "../components/icons";
|
import { cropIcon } from "../components/icons";
|
||||||
import { isImageElement } from "../element/typeChecks";
|
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
import { CaptureUpdateAction } from "../store";
|
import { CaptureUpdateAction } from "../store";
|
||||||
|
|
||||||
import { register } from "./register";
|
import { register } from "./register";
|
||||||
|
|
||||||
import type { ExcalidrawImageElement } from "../element/types";
|
|
||||||
|
|
||||||
export const actionToggleCropEditor = register({
|
export const actionToggleCropEditor = register({
|
||||||
name: "cropEditor",
|
name: "cropEditor",
|
||||||
label: "helpDialog.cropStart",
|
label: "helpDialog.cropStart",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import { composeEventHandlers } from "../utils";
|
import { composeEventHandlers } from "@excalidraw/common";
|
||||||
|
|
||||||
import "./Button.scss";
|
import "./Button.scss";
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,18 @@ import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { EVENT } from "@excalidraw/common";
|
import { EVENT } from "@excalidraw/common";
|
||||||
|
|
||||||
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,
|
DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,
|
||||||
DEFAULT_ELEMENT_STROKE_COLOR_INDEX,
|
DEFAULT_ELEMENT_STROKE_COLOR_INDEX,
|
||||||
} from "../../colors";
|
KEYS,
|
||||||
|
} from "@excalidraw/common";
|
||||||
|
|
||||||
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
||||||
|
|
||||||
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
||||||
|
|
||||||
import { useAtom } from "../../editor-jotai";
|
import { useAtom } from "../../editor-jotai";
|
||||||
import { t } from "../../i18n";
|
import { t } from "../../i18n";
|
||||||
import { KEYS } from "../../keys";
|
|
||||||
|
|
||||||
import { CustomColorList } from "./CustomColorList";
|
import { CustomColorList } from "./CustomColorList";
|
||||||
import PickerColorList from "./PickerColorList";
|
import PickerColorList from "./PickerColorList";
|
||||||
|
@ -25,7 +28,6 @@ import {
|
||||||
import { colorPickerKeyNavHandler } from "./keyboardNavHandlers";
|
import { colorPickerKeyNavHandler } from "./keyboardNavHandlers";
|
||||||
|
|
||||||
import type { ColorPickerType } from "./colorPickerUtils";
|
import type { ColorPickerType } from "./colorPickerUtils";
|
||||||
import type { ColorPaletteCustom } from "../../colors";
|
|
||||||
|
|
||||||
interface PickerProps {
|
interface PickerProps {
|
||||||
color: string;
|
color: string;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "@excalidraw/common";
|
||||||
|
|
||||||
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
||||||
|
|
||||||
import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "../../colors";
|
import type { ColorPickerColor, ColorPaletteCustom } from "@excalidraw/common";
|
||||||
import { atom } from "../../editor-jotai";
|
|
||||||
|
|
||||||
import type { ColorPickerColor, ColorPaletteCustom } from "../../colors";
|
import { atom } from "../../editor-jotai";
|
||||||
|
|
||||||
export const getColorNameAndShadeFromColor = ({
|
export const getColorNameAndShadeFromColor = ({
|
||||||
palette,
|
palette,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
import { KEYS } from "../keys";
|
import { KEYS } from "@excalidraw/common";
|
||||||
|
|
||||||
import { ToolButton } from "./ToolButton";
|
import { ToolButton } from "./ToolButton";
|
||||||
import { handIcon } from "./icons";
|
import { handIcon } from "./icons";
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
EXPORT_IMAGE_TYPES,
|
EXPORT_IMAGE_TYPES,
|
||||||
isFirefox,
|
isFirefox,
|
||||||
EXPORT_SCALES,
|
EXPORT_SCALES,
|
||||||
|
cloneJSON,
|
||||||
} from "@excalidraw/common";
|
} from "@excalidraw/common";
|
||||||
|
|
||||||
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
||||||
|
@ -25,7 +26,6 @@ import { useCopyStatus } from "../hooks/useCopiedIndicator";
|
||||||
|
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
import { isSomeElementSelected } from "../scene";
|
import { isSomeElementSelected } from "../scene";
|
||||||
import { cloneJSON } from "../utils";
|
|
||||||
|
|
||||||
import { copyIcon, downloadIcon, helpIcon } from "./icons";
|
import { copyIcon, downloadIcon, helpIcon } from "./icons";
|
||||||
import { Dialog } from "./Dialog";
|
import { Dialog } from "./Dialog";
|
||||||
|
|
|
@ -6,14 +6,14 @@ import React, {
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
|
|
||||||
import { MIME_TYPES } from "@excalidraw/common";
|
import { MIME_TYPES, arrayToMap } from "@excalidraw/common";
|
||||||
|
|
||||||
|
import { duplicateElements } from "@excalidraw/element/newElement";
|
||||||
|
|
||||||
import { serializeLibraryAsJSON } from "../data/json";
|
import { serializeLibraryAsJSON } from "../data/json";
|
||||||
import { duplicateElements } from "../element/newElement";
|
|
||||||
import { useLibraryCache } from "../hooks/useLibraryItemSvg";
|
import { useLibraryCache } from "../hooks/useLibraryItemSvg";
|
||||||
import { useScrollPosition } from "../hooks/useScrollPosition";
|
import { useScrollPosition } from "../hooks/useScrollPosition";
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
import { arrayToMap } from "../utils";
|
|
||||||
|
|
||||||
import { LibraryMenuControlButtons } from "./LibraryMenuControlButtons";
|
import { LibraryMenuControlButtons } from "./LibraryMenuControlButtons";
|
||||||
import { LibraryDropdownMenu } from "./LibraryMenuHeaderContent";
|
import { LibraryDropdownMenu } from "./LibraryMenuHeaderContent";
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
|
|
||||||
import { EVENT } from "@excalidraw/common";
|
import { EVENT, KEYS } from "@excalidraw/common";
|
||||||
|
|
||||||
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
import { useOutsideClick } from "../../hooks/useOutsideClick";
|
||||||
import { useStable } from "../../hooks/useStable";
|
import { useStable } from "../../hooks/useStable";
|
||||||
import { KEYS } from "../../keys";
|
|
||||||
import { useDevice } from "../App";
|
import { useDevice } from "../App";
|
||||||
import { Island } from "../Island";
|
import { Island } from "../Island";
|
||||||
import Stack from "../Stack";
|
import Stack from "../Stack";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { KEYS } from "../keys";
|
import { KEYS } from "@excalidraw/common";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SelectionIcon,
|
SelectionIcon,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { exportToSvg } from "@excalidraw/utils/export";
|
import { exportToSvg } from "@excalidraw/utils/export";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { COLOR_PALETTE } from "../colors";
|
import { COLOR_PALETTE } from "@excalidraw/common";
|
||||||
|
|
||||||
import { atom, useAtom } from "../editor-jotai";
|
import { atom, useAtom } from "../editor-jotai";
|
||||||
|
|
||||||
import type { LibraryItem } from "../types";
|
import type { LibraryItem } from "../types";
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
export * from "./src/angle";
|
|
||||||
export * from "./src/curve";
|
|
||||||
export * from "./src/line";
|
|
||||||
export * from "./src/point";
|
|
||||||
export * from "./src/polygon";
|
|
||||||
export * from "./src/range";
|
|
||||||
export * from "./src/rectangle";
|
|
||||||
export * from "./src/segment";
|
|
||||||
export * from "./src/triangle";
|
|
||||||
export * from "./src/types";
|
|
||||||
export * from "./src/vector";
|
|
||||||
export * from "./src/utils";
|
|
12
packages/math/src/index.ts
Normal file
12
packages/math/src/index.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
export * from "./angle";
|
||||||
|
export * from "./curve";
|
||||||
|
export * from "./line";
|
||||||
|
export * from "./point";
|
||||||
|
export * from "./polygon";
|
||||||
|
export * from "./range";
|
||||||
|
export * from "./rectangle";
|
||||||
|
export * from "./segment";
|
||||||
|
export * from "./triangle";
|
||||||
|
export * from "./types";
|
||||||
|
export * from "./vector";
|
||||||
|
export * from "./utils";
|
|
@ -11,13 +11,13 @@
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@excalidraw/common": ["./common/index.ts"],
|
"@excalidraw/common": ["./common/src/index.ts"],
|
||||||
"@excalidraw/common/*": ["./common/src/*"],
|
"@excalidraw/common/*": ["./common/src/*"],
|
||||||
"@excalidraw/element": ["./element/index.ts"],
|
"@excalidraw/element": ["./element/src/index.ts"],
|
||||||
"@excalidraw/element/*": ["./element/src/*"],
|
"@excalidraw/element/*": ["./element/src/*"],
|
||||||
"@excalidraw/excalidraw": ["./excalidraw/index.tsx"],
|
"@excalidraw/excalidraw": ["./excalidraw/index.tsx"],
|
||||||
"@excalidraw/excalidraw/*": ["./excalidraw/*"],
|
"@excalidraw/excalidraw/*": ["./excalidraw/*"],
|
||||||
"@excalidraw/math": ["./math/index.ts"],
|
"@excalidraw/math": ["./math/src/index.ts"],
|
||||||
"@excalidraw/math/*": ["./math/src/*"],
|
"@excalidraw/math/*": ["./math/src/*"],
|
||||||
"@excalidraw/utils": ["./utils/index.ts"],
|
"@excalidraw/utils": ["./utils/index.ts"],
|
||||||
"@excalidraw/utils/*": ["./utils/*"]
|
"@excalidraw/utils/*": ["./utils/*"]
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
copyTextToSystemClipboard,
|
copyTextToSystemClipboard,
|
||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
} from "@excalidraw/excalidraw/clipboard";
|
} from "@excalidraw/excalidraw/clipboard";
|
||||||
import { MIME_TYPES } from "@excalidraw/excalidraw/constants";
|
import { MIME_TYPES } from "@excalidraw/common";
|
||||||
import { encodePngMetadata } from "@excalidraw/excalidraw/data/image";
|
import { encodePngMetadata } from "@excalidraw/excalidraw/data/image";
|
||||||
import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
|
import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
|
||||||
import { restore } from "@excalidraw/excalidraw/data/restore";
|
import { restore } from "@excalidraw/excalidraw/data/restore";
|
||||||
|
@ -17,7 +17,7 @@ import type {
|
||||||
ExcalidrawElement,
|
ExcalidrawElement,
|
||||||
ExcalidrawFrameLikeElement,
|
ExcalidrawFrameLikeElement,
|
||||||
NonDeleted,
|
NonDeleted,
|
||||||
} from "@excalidraw/excalidraw/element/types";
|
} from "@excalidraw/element/types";
|
||||||
import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types";
|
import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types";
|
||||||
|
|
||||||
export { MIME_TYPES };
|
export { MIME_TYPES };
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
* to pure shapes
|
* to pure shapes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getElementAbsoluteCoords } from "@excalidraw/excalidraw/element";
|
import { getElementAbsoluteCoords } from "@excalidraw/element";
|
||||||
import { invariant } from "@excalidraw/excalidraw/utils";
|
import { invariant } from "@excalidraw/common";
|
||||||
import {
|
import {
|
||||||
curve,
|
curve,
|
||||||
lineSegment,
|
lineSegment,
|
||||||
|
@ -50,7 +50,7 @@ import type {
|
||||||
ExcalidrawRectangleElement,
|
ExcalidrawRectangleElement,
|
||||||
ExcalidrawSelectionElement,
|
ExcalidrawSelectionElement,
|
||||||
ExcalidrawTextElement,
|
ExcalidrawTextElement,
|
||||||
} from "@excalidraw/excalidraw/element/types";
|
} from "@excalidraw/element/types";
|
||||||
import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math";
|
import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math";
|
||||||
|
|
||||||
import type { Drawable, Op } from "roughjs/bin/core";
|
import type { Drawable, Op } from "roughjs/bin/core";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export * from "./export";
|
export * from "./export";
|
||||||
export * from "./withinBounds";
|
export * from "./withinBounds";
|
||||||
export * from "./bbox";
|
export * from "./bbox";
|
||||||
export { getCommonBounds } from "@excalidraw/excalidraw/element/bounds";
|
export { getCommonBounds } from "@excalidraw/element/bounds";
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { getElementBounds } from "@excalidraw/excalidraw/element/bounds";
|
import { arrayToMap } from "@excalidraw/common";
|
||||||
|
import { getElementBounds } from "@excalidraw/element/bounds";
|
||||||
import {
|
import {
|
||||||
isArrowElement,
|
isArrowElement,
|
||||||
isExcalidrawElement,
|
isExcalidrawElement,
|
||||||
isFreeDrawElement,
|
isFreeDrawElement,
|
||||||
isLinearElement,
|
isLinearElement,
|
||||||
isTextElement,
|
isTextElement,
|
||||||
} from "@excalidraw/excalidraw/element/typeChecks";
|
} from "@excalidraw/element/typeChecks";
|
||||||
import { arrayToMap } from "@excalidraw/excalidraw/utils";
|
|
||||||
import {
|
import {
|
||||||
rangeIncludesValue,
|
rangeIncludesValue,
|
||||||
pointFrom,
|
pointFrom,
|
||||||
|
@ -14,13 +14,13 @@ import {
|
||||||
rangeInclusive,
|
rangeInclusive,
|
||||||
} from "@excalidraw/math";
|
} from "@excalidraw/math";
|
||||||
|
|
||||||
import type { Bounds } from "@excalidraw/excalidraw/element/bounds";
|
import type { Bounds } from "@excalidraw/element/bounds";
|
||||||
import type {
|
import type {
|
||||||
ExcalidrawElement,
|
ExcalidrawElement,
|
||||||
ExcalidrawFreeDrawElement,
|
ExcalidrawFreeDrawElement,
|
||||||
ExcalidrawLinearElement,
|
ExcalidrawLinearElement,
|
||||||
NonDeletedExcalidrawElement,
|
NonDeletedExcalidrawElement,
|
||||||
} from "@excalidraw/excalidraw/element/types";
|
} from "@excalidraw/element/types";
|
||||||
import type { LocalPoint } from "@excalidraw/math";
|
import type { LocalPoint } from "@excalidraw/math";
|
||||||
|
|
||||||
type Element = NonDeletedExcalidrawElement;
|
type Element = NonDeletedExcalidrawElement;
|
||||||
|
|
|
@ -28,11 +28,11 @@ const getConfig = (outdir) => ({
|
||||||
assetNames: "[dir]/[name]",
|
assetNames: "[dir]/[name]",
|
||||||
chunkNames: "[dir]/[name]-[hash]",
|
chunkNames: "[dir]/[name]-[hash]",
|
||||||
alias: {
|
alias: {
|
||||||
"@excalidraw/common": path.resolve(__dirname, "../packages/common"),
|
"@excalidraw/common": path.resolve(__dirname, "../packages/common/src"),
|
||||||
"@excalidraw/element": path.resolve(__dirname, "../packages/element"),
|
"@excalidraw/element": path.resolve(__dirname, "../packages/element/src"),
|
||||||
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
|
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
|
||||||
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),
|
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),
|
||||||
"@excalidraw/math": path.resolve(__dirname, "../packages/math"),
|
"@excalidraw/math": path.resolve(__dirname, "../packages/math/src"),
|
||||||
},
|
},
|
||||||
loader: {
|
loader: {
|
||||||
".woff2": "file",
|
".woff2": "file",
|
||||||
|
|
|
@ -14,11 +14,11 @@ const getConfig = (outdir) => ({
|
||||||
entryNames: "[name]",
|
entryNames: "[name]",
|
||||||
assetNames: "[dir]/[name]",
|
assetNames: "[dir]/[name]",
|
||||||
alias: {
|
alias: {
|
||||||
"@excalidraw/common": path.resolve(__dirname, "../packages/common"),
|
"@excalidraw/common": path.resolve(__dirname, "../packages/common/src"),
|
||||||
"@excalidraw/element": path.resolve(__dirname, "../packages/element"),
|
"@excalidraw/element": path.resolve(__dirname, "../packages/element/src"),
|
||||||
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
|
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
|
||||||
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),
|
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),
|
||||||
"@excalidraw/math": path.resolve(__dirname, "../packages/math"),
|
"@excalidraw/math": path.resolve(__dirname, "../packages/math/src"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@excalidraw/common": ["./packages/common/index.ts"],
|
"@excalidraw/common": ["./packages/common/src/index.ts"],
|
||||||
"@excalidraw/common/*": ["./packages/common/src/*"],
|
"@excalidraw/common/*": ["./packages/common/src/*"],
|
||||||
"@excalidraw/excalidraw": ["./packages/excalidraw/index.tsx"],
|
"@excalidraw/excalidraw": ["./packages/excalidraw/index.tsx"],
|
||||||
"@excalidraw/excalidraw/*": ["./packages/excalidraw/*"],
|
"@excalidraw/excalidraw/*": ["./packages/excalidraw/*"],
|
||||||
"@excalidraw/element": ["./packages/element/index.ts"],
|
"@excalidraw/element": ["./packages/element/src/index.ts"],
|
||||||
"@excalidraw/element/*": ["./packages/element/src/*"],
|
"@excalidraw/element/*": ["./packages/element/src/*"],
|
||||||
"@excalidraw/math": ["./packages/math/index.ts"],
|
"@excalidraw/math": ["./packages/math/src/index.ts"],
|
||||||
"@excalidraw/math/*": ["./packages/math/src/*"],
|
"@excalidraw/math/*": ["./packages/math/src/*"],
|
||||||
"@excalidraw/utils": ["./packages/utils/index.ts"],
|
"@excalidraw/utils": ["./packages/utils/index.ts"],
|
||||||
"@excalidraw/utils/*": ["./packages/utils/*"]
|
"@excalidraw/utils/*": ["./packages/utils/*"]
|
||||||
|
|
33
yarn.lock
33
yarn.lock
|
@ -8851,16 +8851,8 @@ string-natural-compare@^3.0.1:
|
||||||
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
|
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
|
||||||
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
|
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
|
||||||
|
|
||||||
"string-width-cjs@npm:string-width@^4.2.0":
|
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||||
version "4.2.3"
|
name string-width-cjs
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
||||||
dependencies:
|
|
||||||
emoji-regex "^8.0.0"
|
|
||||||
is-fullwidth-code-point "^3.0.0"
|
|
||||||
strip-ansi "^6.0.1"
|
|
||||||
|
|
||||||
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
|
||||||
version "4.2.3"
|
version "4.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
|
@ -8962,14 +8954,7 @@ stringify-object@^3.3.0:
|
||||||
is-obj "^1.0.1"
|
is-obj "^1.0.1"
|
||||||
is-regexp "^1.0.0"
|
is-regexp "^1.0.0"
|
||||||
|
|
||||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1, strip-ansi@^7.0.1:
|
||||||
version "6.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
|
||||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
||||||
dependencies:
|
|
||||||
ansi-regex "^5.0.1"
|
|
||||||
|
|
||||||
strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1, strip-ansi@^7.0.1:
|
|
||||||
version "6.0.1"
|
version "6.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
|
@ -10102,7 +10087,8 @@ workbox-window@7.3.0, workbox-window@^7.3.0:
|
||||||
"@types/trusted-types" "^2.0.2"
|
"@types/trusted-types" "^2.0.2"
|
||||||
workbox-core "7.3.0"
|
workbox-core "7.3.0"
|
||||||
|
|
||||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
|
||||||
|
name wrap-ansi-cjs
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||||
|
@ -10120,15 +10106,6 @@ wrap-ansi@^6.2.0:
|
||||||
string-width "^4.1.0"
|
string-width "^4.1.0"
|
||||||
strip-ansi "^6.0.0"
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
wrap-ansi@^7.0.0:
|
|
||||||
version "7.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
|
||||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^4.0.0"
|
|
||||||
string-width "^4.1.0"
|
|
||||||
strip-ansi "^6.0.0"
|
|
||||||
|
|
||||||
wrap-ansi@^8.1.0:
|
wrap-ansi@^8.1.0:
|
||||||
version "8.1.0"
|
version "8.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue