diff --git a/package.json b/package.json index 64f0bada5..8b43feba3 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "build:app:docker": "cross-env VITE_APP_DISABLE_SENTRY=true VITE_APP_DISABLE_TRACKING=true vite build", "build:app": "cross-env VITE_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA vite build", "build:version": "node ./scripts/build-version.js", - "build": "yarn --cwd ./excalidraw-app build", + "build": "yarn workspace @excalidraw/utils build:esm && yarn --cwd ./excalidraw-app build", "fix:code": "yarn test:code --fix", "fix:other": "yarn prettier --write", "fix": "yarn fix:other && yarn fix:code", diff --git a/packages/excalidraw/element/binding.ts b/packages/excalidraw/element/binding.ts index a2ecc1678..008439dd0 100644 --- a/packages/excalidraw/element/binding.ts +++ b/packages/excalidraw/element/binding.ts @@ -26,7 +26,7 @@ import { import { getElementAbsoluteCoords } from "./bounds"; import { AppClassProperties, AppState, Point } from "../types"; -import { isPointOnShape } from "../../utils/collision"; +import { isPointOnShape } from "@excalidraw/utils"; import { getElementAtPosition } from "../scene"; import { isArrowElement, diff --git a/packages/excalidraw/element/collision.ts b/packages/excalidraw/element/collision.ts index 51769a8b0..6d1a0c04b 100644 --- a/packages/excalidraw/element/collision.ts +++ b/packages/excalidraw/element/collision.ts @@ -13,7 +13,7 @@ import { GeometricShape, getPolygonShape, } from "../../utils/geometry/shape"; -import { isPointInShape, isPointOnShape } from "../../utils/collision"; +import { isPointInShape, isPointOnShape } from "@excalidraw/utils"; import { isTransparent } from "../utils"; import { hasBoundTextElement, diff --git a/packages/excalidraw/package.json b/packages/excalidraw/package.json index 791602e61..0f531e1d6 100644 --- a/packages/excalidraw/package.json +++ b/packages/excalidraw/package.json @@ -59,7 +59,7 @@ "@braintree/sanitize-url": "6.0.2", "@excalidraw/laser-pointer": "1.3.1", "@excalidraw/mermaid-to-excalidraw": "0.3.0", - "@excalidraw/utils": "workspace:^", + "@excalidraw/utils": "*", "@excalidraw/random-username": "1.1.0", "@radix-ui/react-popover": "1.0.3", "@radix-ui/react-tabs": "1.0.2", diff --git a/packages/utils/export.ts b/packages/utils/export.ts index f0411f6ec..e20b1136c 100644 --- a/packages/utils/export.ts +++ b/packages/utils/export.ts @@ -171,6 +171,8 @@ export const exportToSvg = async ({ exportPadding?: number; renderEmbeddables?: boolean; }): Promise => { + console.log("HIIII TGEREE122"); + const { elements: restoredElements, appState: restoredAppState } = restore( { elements, appState }, null, diff --git a/packages/utils/index.ts b/packages/utils/index.ts index d199849eb..66e448b17 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -1,3 +1,4 @@ export * from "./export"; export * from "./withinBounds"; export * from "./bbox"; +export * from "./collision"; diff --git a/scripts/buildUtils.js b/scripts/buildUtils.js index e910fc9f3..1d51f11c1 100644 --- a/scripts/buildUtils.js +++ b/scripts/buildUtils.js @@ -8,6 +8,7 @@ const browserConfig = { bundle: true, format: "esm", plugins: [sassPlugin()], + external: ["@excalidraw/utils"], }; // Will be used later for treeshaking @@ -80,6 +81,7 @@ const rawConfig = { format: "esm", packages: "external", plugins: [sassPlugin()], + external: ["@excalidraw/utils"], }; // const BASE_PATH = `${path.resolve(`${__dirname}/..`)}`; diff --git a/yarn.lock b/yarn.lock index a2e3868fb..1b4507be5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2022,11 +2022,6 @@ resolved "https://registry.npmjs.org/@excalidraw/random-username/-/random-username-1.1.0.tgz#6f388d6a9708cf655b8c9c6aa3fa569ee71ecf0f" integrity sha512-nULYsQxkWHnbmHvcs+efMkJ4/9TtvNyFeLyHdeGxW0zHs6P+jYVqcRff9A6Vq9w9JXeDRnRh2VKvTtS19GW2qA== -"@excalidraw/utils@workspace:^": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@excalidraw/utils/-/utils-0.1.2.tgz#69b931772b5d06ea655743a85557f001b585c352" - integrity sha512-hypi3np+Do3e8Eb0Y1ug52EyJP4JAP3RPQRfAgiMN0ftag7M49vahiWVXd9yX4wsviCKYacTbBDs2mRqt3nyUQ== - "@firebase/analytics-types@0.4.0": version "0.4.0" resolved "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.4.0.tgz#d6716f9fa36a6e340bc0ecfe68af325aa6f60508"