From 875450a0a149517a53af848700c3d19cd39cabde Mon Sep 17 00:00:00 2001 From: Marcel Mraz Date: Tue, 18 Mar 2025 11:25:46 +0100 Subject: [PATCH] Fix the rest except scene and ShapeCache --- package.json | 4 +-- packages/common/index.ts | 9 ----- packages/common/src/index.ts | 9 +++++ packages/element/src/frame.ts | 3 +- packages/element/{ => src}/index.ts | 32 +++++++++--------- packages/element/src/linearElementEditor.ts | 7 ++-- packages/element/src/newElement.ts | 4 +-- packages/element/src/shapes.ts | 4 +-- packages/element/src/textElement.ts | 4 +-- .../excalidraw/actions/actionCropEditor.tsx | 7 ++-- packages/excalidraw/components/Button.tsx | 2 +- .../components/ColorPicker/Picker.tsx | 12 ++++--- .../ColorPicker/colorPickerUtils.ts | 7 ++-- packages/excalidraw/components/HandButton.tsx | 2 +- .../components/ImageExportDialog.tsx | 2 +- .../components/LibraryMenuItems.tsx | 6 ++-- .../dropdownMenu/DropdownMenuContent.tsx | 3 +- packages/excalidraw/components/shapes.tsx | 2 +- .../excalidraw/hooks/useLibraryItemSvg.ts | 3 +- packages/math/index.ts | 12 ------- packages/math/src/index.ts | 12 +++++++ packages/tsconfig.base.json | 6 ++-- packages/utils/export.ts | 4 +-- packages/utils/geometry/shape.ts | 6 ++-- packages/utils/index.ts | 2 +- packages/utils/withinBounds.ts | 10 +++--- scripts/buildPackage.js | 6 ++-- scripts/buildShared.js | 6 ++-- tsconfig.json | 6 ++-- yarn.lock | 33 +++---------------- 30 files changed, 100 insertions(+), 125 deletions(-) delete mode 100644 packages/common/index.ts create mode 100644 packages/common/src/index.ts rename packages/element/{ => src}/index.ts (78%) delete mode 100644 packages/math/index.ts create mode 100644 packages/math/src/index.ts diff --git a/package.json b/package.json index 9ff4379d1..6f57f7e7c 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,7 @@ "packageManager": "yarn@1.22.22", "workspaces": [ "excalidraw-app", - "packages/excalidraw", - "packages/utils", - "packages/math", + "packages/*", "examples/*" ], "devDependencies": { diff --git a/packages/common/index.ts b/packages/common/index.ts deleted file mode 100644 index ac31c5878..000000000 --- a/packages/common/index.ts +++ /dev/null @@ -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"; diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts new file mode 100644 index 000000000..f4718d89d --- /dev/null +++ b/packages/common/src/index.ts @@ -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"; diff --git a/packages/element/src/frame.ts b/packages/element/src/frame.ts index edeb360fe..bc47ebc02 100644 --- a/packages/element/src/frame.ts +++ b/packages/element/src/frame.ts @@ -3,7 +3,6 @@ import { isPointWithinBounds, pointFrom } from "@excalidraw/math"; import { doLineSegmentsIntersect, elementsOverlappingBBox, - getCommonBounds, } from "@excalidraw/utils"; import { @@ -37,7 +36,7 @@ import type { import type { ReadonlySetLike } from "@excalidraw/excalidraw/utility-types"; -import { getElementLineSegments } from "./bounds"; +import { getElementLineSegments, getCommonBounds } from "./bounds"; import { mutateElement } from "./mutateElement"; import { getBoundTextElement, getContainerElement } from "./textElement"; import { isFrameElement, isFrameLikeElement } from "./typeChecks"; diff --git a/packages/element/index.ts b/packages/element/src/index.ts similarity index 78% rename from packages/element/index.ts rename to packages/element/src/index.ts index afb00414b..12024a10f 100644 --- a/packages/element/index.ts +++ b/packages/element/src/index.ts @@ -1,25 +1,25 @@ -import { isInvisiblySmallElement } from "./src/sizeHelpers"; -import { isLinearElementType } from "./src/typeChecks"; +import { isInvisiblySmallElement } from "./sizeHelpers"; +import { isLinearElementType } from "./typeChecks"; import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, -} from "./src/types"; +} from "./types"; -export * from "./src/bounds"; -export * from "./src/dragElements"; -export * from "./src/frame"; -export * from "./src/mutateElement"; -export * from "./src/newElement"; -export * from "./src/resizeElements"; -export * from "./src/resizeTest"; -export * from "./src/shapes"; -export * from "./src/showSelectedShapeActions"; -export * from "./src/textElement"; -export * from "./src/typeChecks"; -export * from "./src/transformHandles"; -export * from "./src/sizeHelpers"; +export * from "./bounds"; +export * from "./dragElements"; +export * from "./frame"; +export * from "./mutateElement"; +export * from "./newElement"; +export * from "./resizeElements"; +export * from "./resizeTest"; +export * from "./shapes"; +export * from "./showSelectedShapeActions"; +export * from "./textElement"; +export * from "./typeChecks"; +export * from "./transformHandles"; +export * from "./sizeHelpers"; /** * @deprecated unsafe, use hashElementsVersion instead diff --git a/packages/element/src/linearElementEditor.ts b/packages/element/src/linearElementEditor.ts index 020f70a76..264a24b41 100644 --- a/packages/element/src/linearElementEditor.ts +++ b/packages/element/src/linearElementEditor.ts @@ -44,11 +44,6 @@ import type { import type { Mutable } from "@excalidraw/excalidraw/utility-types"; -import { - getElementAbsoluteCoords, - getLockedLinearCursorAlignSize, -} from "../index"; - import { bindOrUnbindLinearElement, getHoveredElementForBinding, @@ -64,6 +59,8 @@ import { isFixedPointBinding, } from "./typeChecks"; +import { getElementAbsoluteCoords, getLockedLinearCursorAlignSize } from "./"; + import type { Bounds } from "./bounds"; import type { NonDeleted, diff --git a/packages/element/src/newElement.ts b/packages/element/src/newElement.ts index 84396dd10..3fc5634b7 100644 --- a/packages/element/src/newElement.ts +++ b/packages/element/src/newElement.ts @@ -27,14 +27,14 @@ import type { Mutable, } from "@excalidraw/excalidraw/utility-types"; -import { getElementAbsoluteCoords } from "../index"; - import { getResizedElementAbsoluteCoords } from "./bounds"; import { bumpVersion, newElementWith } from "./mutateElement"; import { getBoundTextMaxWidth } from "./textElement"; import { normalizeText, measureText } from "./textMeasurements"; import { wrapText } from "./textWrapping"; +import { getElementAbsoluteCoords } from "."; + import type { ExcalidrawElement, ExcalidrawImageElement, diff --git a/packages/element/src/shapes.ts b/packages/element/src/shapes.ts index d103ace4a..cff01b9ac 100644 --- a/packages/element/src/shapes.ts +++ b/packages/element/src/shapes.ts @@ -27,13 +27,13 @@ import { import type { NormalizedZoomValue, Zoom } from "@excalidraw/excalidraw/types"; -import { getElementAbsoluteCoords } from "../index"; - import { shouldTestInside } from "./collision"; import { LinearElementEditor } from "./linearElementEditor"; import { getBoundTextElement } from "./textElement"; import { ShapeCache } from "./scene/ShapeCache"; +import { getElementAbsoluteCoords } from "./"; + import type { Bounds } from "./bounds"; import type { ElementsMap, diff --git a/packages/element/src/textElement.ts b/packages/element/src/textElement.ts index 05d5fd6ce..1f132a3dd 100644 --- a/packages/element/src/textElement.ts +++ b/packages/element/src/textElement.ts @@ -13,8 +13,6 @@ import type { AppState } from "@excalidraw/excalidraw/types"; import type { ExtractSetType } from "@excalidraw/excalidraw/utility-types"; -import { isTextElement } from "../index"; - import { resetOriginalContainerCache, updateOriginalContainerCache, @@ -25,6 +23,8 @@ import { measureText } from "./textMeasurements"; import { wrapText } from "./textWrapping"; import { isBoundToContainer, isArrowElement } from "./typeChecks"; +import { isTextElement } from "./"; + import type { MaybeTransformHandleType } from "./transformHandles"; import type { ElementsMap, diff --git a/packages/excalidraw/actions/actionCropEditor.tsx b/packages/excalidraw/actions/actionCropEditor.tsx index c377b3a02..1a7b6da69 100644 --- a/packages/excalidraw/actions/actionCropEditor.tsx +++ b/packages/excalidraw/actions/actionCropEditor.tsx @@ -1,13 +1,14 @@ +import { isImageElement } from "@excalidraw/element/typeChecks"; + +import type { ExcalidrawImageElement } from "@excalidraw/element/types"; + import { ToolButton } from "../components/ToolButton"; import { cropIcon } from "../components/icons"; -import { isImageElement } from "../element/typeChecks"; import { t } from "../i18n"; import { CaptureUpdateAction } from "../store"; import { register } from "./register"; -import type { ExcalidrawImageElement } from "../element/types"; - export const actionToggleCropEditor = register({ name: "cropEditor", label: "helpDialog.cropStart", diff --git a/packages/excalidraw/components/Button.tsx b/packages/excalidraw/components/Button.tsx index 9512d607f..acdd4afde 100644 --- a/packages/excalidraw/components/Button.tsx +++ b/packages/excalidraw/components/Button.tsx @@ -1,7 +1,7 @@ import clsx from "clsx"; import React from "react"; -import { composeEventHandlers } from "../utils"; +import { composeEventHandlers } from "@excalidraw/common"; import "./Button.scss"; diff --git a/packages/excalidraw/components/ColorPicker/Picker.tsx b/packages/excalidraw/components/ColorPicker/Picker.tsx index 122eb0069..3c54c6769 100644 --- a/packages/excalidraw/components/ColorPicker/Picker.tsx +++ b/packages/excalidraw/components/ColorPicker/Picker.tsx @@ -2,15 +2,18 @@ import React, { useEffect, useState } from "react"; import { EVENT } from "@excalidraw/common"; -import type { ExcalidrawElement } from "@excalidraw/element/types"; - import { DEFAULT_ELEMENT_BACKGROUND_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 { t } from "../../i18n"; -import { KEYS } from "../../keys"; import { CustomColorList } from "./CustomColorList"; import PickerColorList from "./PickerColorList"; @@ -25,7 +28,6 @@ import { import { colorPickerKeyNavHandler } from "./keyboardNavHandlers"; import type { ColorPickerType } from "./colorPickerUtils"; -import type { ColorPaletteCustom } from "../../colors"; interface PickerProps { color: string; diff --git a/packages/excalidraw/components/ColorPicker/colorPickerUtils.ts b/packages/excalidraw/components/ColorPicker/colorPickerUtils.ts index 42a16ac0b..4925a3145 100644 --- a/packages/excalidraw/components/ColorPicker/colorPickerUtils.ts +++ b/packages/excalidraw/components/ColorPicker/colorPickerUtils.ts @@ -1,9 +1,10 @@ +import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "@excalidraw/common"; + import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { MAX_CUSTOM_COLORS_USED_IN_CANVAS } from "../../colors"; -import { atom } from "../../editor-jotai"; +import type { ColorPickerColor, ColorPaletteCustom } from "@excalidraw/common"; -import type { ColorPickerColor, ColorPaletteCustom } from "../../colors"; +import { atom } from "../../editor-jotai"; export const getColorNameAndShadeFromColor = ({ palette, diff --git a/packages/excalidraw/components/HandButton.tsx b/packages/excalidraw/components/HandButton.tsx index 4bffb1000..5ebfdf9d3 100644 --- a/packages/excalidraw/components/HandButton.tsx +++ b/packages/excalidraw/components/HandButton.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; -import { KEYS } from "../keys"; +import { KEYS } from "@excalidraw/common"; import { ToolButton } from "./ToolButton"; import { handIcon } from "./icons"; diff --git a/packages/excalidraw/components/ImageExportDialog.tsx b/packages/excalidraw/components/ImageExportDialog.tsx index 984df67d5..e8e0b70f4 100644 --- a/packages/excalidraw/components/ImageExportDialog.tsx +++ b/packages/excalidraw/components/ImageExportDialog.tsx @@ -6,6 +6,7 @@ import { EXPORT_IMAGE_TYPES, isFirefox, EXPORT_SCALES, + cloneJSON, } from "@excalidraw/common"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; @@ -25,7 +26,6 @@ import { useCopyStatus } from "../hooks/useCopiedIndicator"; import { t } from "../i18n"; import { isSomeElementSelected } from "../scene"; -import { cloneJSON } from "../utils"; import { copyIcon, downloadIcon, helpIcon } from "./icons"; import { Dialog } from "./Dialog"; diff --git a/packages/excalidraw/components/LibraryMenuItems.tsx b/packages/excalidraw/components/LibraryMenuItems.tsx index 9b6c0d054..e4bbc9c02 100644 --- a/packages/excalidraw/components/LibraryMenuItems.tsx +++ b/packages/excalidraw/components/LibraryMenuItems.tsx @@ -6,14 +6,14 @@ import React, { useState, } 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 { duplicateElements } from "../element/newElement"; import { useLibraryCache } from "../hooks/useLibraryItemSvg"; import { useScrollPosition } from "../hooks/useScrollPosition"; import { t } from "../i18n"; -import { arrayToMap } from "../utils"; import { LibraryMenuControlButtons } from "./LibraryMenuControlButtons"; import { LibraryDropdownMenu } from "./LibraryMenuHeaderContent"; diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx index 33a9bc005..de6fc31c1 100644 --- a/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx +++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuContent.tsx @@ -1,11 +1,10 @@ import clsx from "clsx"; import React, { useEffect, useRef } from "react"; -import { EVENT } from "@excalidraw/common"; +import { EVENT, KEYS } from "@excalidraw/common"; import { useOutsideClick } from "../../hooks/useOutsideClick"; import { useStable } from "../../hooks/useStable"; -import { KEYS } from "../../keys"; import { useDevice } from "../App"; import { Island } from "../Island"; import Stack from "../Stack"; diff --git a/packages/excalidraw/components/shapes.tsx b/packages/excalidraw/components/shapes.tsx index 1fbb7add2..7411a9e25 100644 --- a/packages/excalidraw/components/shapes.tsx +++ b/packages/excalidraw/components/shapes.tsx @@ -1,4 +1,4 @@ -import { KEYS } from "../keys"; +import { KEYS } from "@excalidraw/common"; import { SelectionIcon, diff --git a/packages/excalidraw/hooks/useLibraryItemSvg.ts b/packages/excalidraw/hooks/useLibraryItemSvg.ts index a79aab5c5..ad423ab95 100644 --- a/packages/excalidraw/hooks/useLibraryItemSvg.ts +++ b/packages/excalidraw/hooks/useLibraryItemSvg.ts @@ -1,7 +1,8 @@ import { exportToSvg } from "@excalidraw/utils/export"; import { useEffect, useState } from "react"; -import { COLOR_PALETTE } from "../colors"; +import { COLOR_PALETTE } from "@excalidraw/common"; + import { atom, useAtom } from "../editor-jotai"; import type { LibraryItem } from "../types"; diff --git a/packages/math/index.ts b/packages/math/index.ts deleted file mode 100644 index 955fbd348..000000000 --- a/packages/math/index.ts +++ /dev/null @@ -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"; diff --git a/packages/math/src/index.ts b/packages/math/src/index.ts new file mode 100644 index 000000000..d00ab469d --- /dev/null +++ b/packages/math/src/index.ts @@ -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"; diff --git a/packages/tsconfig.base.json b/packages/tsconfig.base.json index b00d1d60a..cde00d3fc 100644 --- a/packages/tsconfig.base.json +++ b/packages/tsconfig.base.json @@ -11,13 +11,13 @@ "jsx": "react-jsx", "emitDeclarationOnly": true, "paths": { - "@excalidraw/common": ["./common/index.ts"], + "@excalidraw/common": ["./common/src/index.ts"], "@excalidraw/common/*": ["./common/src/*"], - "@excalidraw/element": ["./element/index.ts"], + "@excalidraw/element": ["./element/src/index.ts"], "@excalidraw/element/*": ["./element/src/*"], "@excalidraw/excalidraw": ["./excalidraw/index.tsx"], "@excalidraw/excalidraw/*": ["./excalidraw/*"], - "@excalidraw/math": ["./math/index.ts"], + "@excalidraw/math": ["./math/src/index.ts"], "@excalidraw/math/*": ["./math/src/*"], "@excalidraw/utils": ["./utils/index.ts"], "@excalidraw/utils/*": ["./utils/*"] diff --git a/packages/utils/export.ts b/packages/utils/export.ts index 6de25c62b..315fd599c 100644 --- a/packages/utils/export.ts +++ b/packages/utils/export.ts @@ -4,7 +4,7 @@ import { copyTextToSystemClipboard, copyToClipboard, } 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 { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; import { restore } from "@excalidraw/excalidraw/data/restore"; @@ -17,7 +17,7 @@ import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, -} from "@excalidraw/excalidraw/element/types"; +} from "@excalidraw/element/types"; import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types"; export { MIME_TYPES }; diff --git a/packages/utils/geometry/shape.ts b/packages/utils/geometry/shape.ts index ea3cde3f6..49ee76a07 100644 --- a/packages/utils/geometry/shape.ts +++ b/packages/utils/geometry/shape.ts @@ -12,8 +12,8 @@ * to pure shapes */ -import { getElementAbsoluteCoords } from "@excalidraw/excalidraw/element"; -import { invariant } from "@excalidraw/excalidraw/utils"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; +import { invariant } from "@excalidraw/common"; import { curve, lineSegment, @@ -50,7 +50,7 @@ import type { ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement, -} from "@excalidraw/excalidraw/element/types"; +} from "@excalidraw/element/types"; import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math"; import type { Drawable, Op } from "roughjs/bin/core"; diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 2a929134e..58830b356 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -1,4 +1,4 @@ export * from "./export"; export * from "./withinBounds"; export * from "./bbox"; -export { getCommonBounds } from "@excalidraw/excalidraw/element/bounds"; +export { getCommonBounds } from "@excalidraw/element/bounds"; diff --git a/packages/utils/withinBounds.ts b/packages/utils/withinBounds.ts index 71bc78969..0e1cf38a6 100644 --- a/packages/utils/withinBounds.ts +++ b/packages/utils/withinBounds.ts @@ -1,12 +1,12 @@ -import { getElementBounds } from "@excalidraw/excalidraw/element/bounds"; +import { arrayToMap } from "@excalidraw/common"; +import { getElementBounds } from "@excalidraw/element/bounds"; import { isArrowElement, isExcalidrawElement, isFreeDrawElement, isLinearElement, isTextElement, -} from "@excalidraw/excalidraw/element/typeChecks"; -import { arrayToMap } from "@excalidraw/excalidraw/utils"; +} from "@excalidraw/element/typeChecks"; import { rangeIncludesValue, pointFrom, @@ -14,13 +14,13 @@ import { rangeInclusive, } from "@excalidraw/math"; -import type { Bounds } from "@excalidraw/excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element/bounds"; import type { ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, NonDeletedExcalidrawElement, -} from "@excalidraw/excalidraw/element/types"; +} from "@excalidraw/element/types"; import type { LocalPoint } from "@excalidraw/math"; type Element = NonDeletedExcalidrawElement; diff --git a/scripts/buildPackage.js b/scripts/buildPackage.js index 966d7e058..d14e71614 100644 --- a/scripts/buildPackage.js +++ b/scripts/buildPackage.js @@ -28,11 +28,11 @@ const getConfig = (outdir) => ({ assetNames: "[dir]/[name]", chunkNames: "[dir]/[name]-[hash]", alias: { - "@excalidraw/common": path.resolve(__dirname, "../packages/common"), - "@excalidraw/element": path.resolve(__dirname, "../packages/element"), + "@excalidraw/common": path.resolve(__dirname, "../packages/common/src"), + "@excalidraw/element": path.resolve(__dirname, "../packages/element/src"), "@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"), "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), - "@excalidraw/math": path.resolve(__dirname, "../packages/math"), + "@excalidraw/math": path.resolve(__dirname, "../packages/math/src"), }, loader: { ".woff2": "file", diff --git a/scripts/buildShared.js b/scripts/buildShared.js index ef31a4876..80ac715cc 100644 --- a/scripts/buildShared.js +++ b/scripts/buildShared.js @@ -14,11 +14,11 @@ const getConfig = (outdir) => ({ entryNames: "[name]", assetNames: "[dir]/[name]", alias: { - "@excalidraw/common": path.resolve(__dirname, "../packages/common"), - "@excalidraw/element": path.resolve(__dirname, "../packages/element"), + "@excalidraw/common": path.resolve(__dirname, "../packages/common/src"), + "@excalidraw/element": path.resolve(__dirname, "../packages/element/src"), "@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"), "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), - "@excalidraw/math": path.resolve(__dirname, "../packages/math"), + "@excalidraw/math": path.resolve(__dirname, "../packages/math/src"), }, }); diff --git a/tsconfig.json b/tsconfig.json index a9112b87c..1cde33248 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,13 +19,13 @@ "jsx": "react-jsx", "baseUrl": ".", "paths": { - "@excalidraw/common": ["./packages/common/index.ts"], + "@excalidraw/common": ["./packages/common/src/index.ts"], "@excalidraw/common/*": ["./packages/common/src/*"], "@excalidraw/excalidraw": ["./packages/excalidraw/index.tsx"], "@excalidraw/excalidraw/*": ["./packages/excalidraw/*"], - "@excalidraw/element": ["./packages/element/index.ts"], + "@excalidraw/element": ["./packages/element/src/index.ts"], "@excalidraw/element/*": ["./packages/element/src/*"], - "@excalidraw/math": ["./packages/math/index.ts"], + "@excalidraw/math": ["./packages/math/src/index.ts"], "@excalidraw/math/*": ["./packages/math/src/*"], "@excalidraw/utils": ["./packages/utils/index.ts"], "@excalidraw/utils/*": ["./packages/utils/*"] diff --git a/yarn.lock b/yarn.lock index ccd0827fb..6651a9109 100644 --- a/yarn.lock +++ b/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" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - 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: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8962,14 +8954,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.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: +"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== @@ -10102,7 +10087,8 @@ workbox-window@7.3.0, workbox-window@^7.3.0: "@types/trusted-types" "^2.0.2" 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" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -10120,15 +10106,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.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: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"