diff --git a/.dockerignore b/.dockerignore index 7a01509475..1f38a978cf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,6 @@ !.prettierrc !package.json !public/ -!src/ +!packages/ !tsconfig.json !yarn.lock diff --git a/.env.development b/.env.development index d67b137d1d..44955884f5 100644 --- a/.env.development +++ b/.env.development @@ -10,6 +10,11 @@ VITE_APP_WS_SERVER_URL=http://localhost:3002 # set this only if using the collaboration workflow we use on excalidraw.com VITE_APP_PORTAL_URL= +VITE_APP_PLUS_LP=https://plus.excalidraw.com +VITE_APP_PLUS_APP=https://app.excalidraw.com + +VITE_APP_AI_BACKEND=http://localhost:3015 + VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}' # put these in your .env.local, or make sure you don't commit! diff --git a/.env.production b/.env.production index b0570f2a03..26b46a52ab 100644 --- a/.env.production +++ b/.env.production @@ -5,11 +5,16 @@ VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries VITE_APP_PORTAL_URL=https://portal.excalidraw.com + +VITE_APP_PLUS_LP=https://plus.excalidraw.com +VITE_APP_PLUS_APP=https://app.excalidraw.com + +VITE_APP_AI_BACKEND=https://oss-ai.excalidraw.com + # Fill to set socket server URL used for collaboration. # Meant for forks only: excalidraw.com uses custom VITE_APP_PORTAL_URL flow VITE_APP_WS_SERVER_URL= VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}' -VITE_APP_PLUS_APP=https://app.excalidraw.com VITE_APP_DISABLE_TRACKING= diff --git a/.eslintignore b/.eslintignore index b238ce5f7b..ab3aa6c763 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,4 @@ package-lock.json firebase/ dist/ public/workbox -src/packages/excalidraw/types +packages/excalidraw/types diff --git a/.github/assets/logo.png b/.github/assets/logo.png deleted file mode 100644 index d9b8953ebd..0000000000 Binary files a/.github/assets/logo.png and /dev/null differ diff --git a/.github/workflows/autorelease-preview.yml b/.github/workflows/autorelease-preview.yml index bcd501880e..a40ed3c430 100644 --- a/.github/workflows/autorelease-preview.yml +++ b/.github/workflows/autorelease-preview.yml @@ -44,7 +44,7 @@ jobs: - name: Auto release preview id: "autorelease" run: | - yarn add @actions/core + yarn add @actions/core -W yarn autorelease preview ${{ github.event.issue.number }} - name: Post comment post release if: always() diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d42f8f632b..82f826361c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - name: Install and lint run: | - yarn --frozen-lockfile + yarn install yarn test:other yarn test:code yarn test:typecheck diff --git a/.github/workflows/locales-coverage.yml b/.github/workflows/locales-coverage.yml index 822af06e1c..3cce93e041 100644 --- a/.github/workflows/locales-coverage.yml +++ b/.github/workflows/locales-coverage.yml @@ -22,11 +22,11 @@ jobs: - name: Create report file run: | yarn locales-coverage - FILE_CHANGED=$(git diff src/locales/percentages.json) + FILE_CHANGED=$(git diff packages/excalidraw/locales/percentages.json) if [ ! -z "${FILE_CHANGED}" ]; then git config --global user.name 'Excalidraw Bot' git config --global user.email 'bot@excalidraw.com' - git add src/locales/percentages.json + git add packages/excalidraw/locales/percentages.json git commit -am "Auto commit: Calculate translation coverage" git push fi diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 8ced8ee037..5bd3c0d92b 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -15,16 +15,14 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.x - - name: Install - run: yarn --frozen-lockfile - - name: Install in src/packages/excalidraw - run: yarn --frozen-lockfile - working-directory: src/packages/excalidraw + - name: Install in packages/excalidraw + run: yarn + working-directory: packages/excalidraw env: CI: true - uses: andresz1/size-limit-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - build_script: build:umd + build_script: build:esm skip_step: install - directory: src/packages/excalidraw + directory: packages/excalidraw diff --git a/.github/workflows/test-coverage-pr.yml b/.github/workflows/test-coverage-pr.yml index 76c818298a..7ff40ad5d2 100644 --- a/.github/workflows/test-coverage-pr.yml +++ b/.github/workflows/test-coverage-pr.yml @@ -16,7 +16,7 @@ jobs: with: node-version: "18.x" - name: "Install Deps" - run: yarn --frozen-lockfile + run: yarn install - name: "Test Coverage" run: yarn test:coverage - name: "Report Coverage" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c4584e823..2c458a8108 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,5 +13,5 @@ jobs: node-version: 18.x - name: Install and test run: | - yarn --frozen-lockfile + yarn install yarn test:app diff --git a/.gitignore b/.gitignore index 6e430f4ed3..17e3e7dcf9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,7 @@ npm-debug.log* package-lock.json yarn-debug.log* yarn-error.log* -src/packages/excalidraw/types -src/packages/excalidraw/example/public/bundle.js -src/packages/excalidraw/example/public/excalidraw-assets-dev -src/packages/excalidraw/example/public/excalidraw.development.js +packages/excalidraw/types coverage dev-dist html diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a6506e9a0f..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 2020-10-13 - -- Added ability to embed scene source into exported PNG/SVG files so you can import the scene from them (open via `Load` button or drag & drop). #2219 diff --git a/README.md b/README.md index 48529165e6..e8cd3b06fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ - - Excalidraw + + Excalidraw @@ -25,6 +25,9 @@ Excalidraw is released under the MIT license. + + npm downloads/month + PRs welcome! @@ -70,7 +73,7 @@ The Excalidraw editor (npm package) supports: ## Excalidraw.com -The app hosted at [excalidraw.com](https://excalidraw.com) is a minimal showcase of what you can build with Excalidraw. Its [source code](https://github.com/excalidraw/excalidraw/tree/master/src/excalidraw-app) is part of this repository as well, and the app features: +The app hosted at [excalidraw.com](https://excalidraw.com) is a minimal showcase of what you can build with Excalidraw. Its [source code](https://github.com/excalidraw/excalidraw/tree/master/excalidraw-app) is part of this repository as well, and the app features: - 📡 PWA support (works offline). - 🤼 Real-time collaboration. @@ -82,7 +85,7 @@ We'll be adding these features as drop-in plugins for the npm package in the fut ## Quick start -Install the [Excalidraw npm package](https://www.npmjs.com/package/@excalidraw/excalidraw): +**Note:** following instructions are for installing the Excalidraw [npm package](https://www.npmjs.com/package/@excalidraw/excalidraw) when integrating Excalidraw into your own app. To run the repository locally for development, please refer to our [Development Guide](https://docs.excalidraw.com/docs/introduction/development). ``` npm install react react-dom @excalidraw/excalidraw @@ -94,7 +97,7 @@ or via yarn yarn add react react-dom @excalidraw/excalidraw ``` -Don't forget to check out our [Documentation](https://docs.excalidraw.com)! +Check out our [documentation](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/installation) for more details! ## Contributing diff --git a/crowdin.yml b/crowdin.yml index a08b939c60..ccb8a17aa7 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,3 @@ files: - - source: /src/locales/en.json - translation: /src/locales/%locale%.json + - source: /packages/excalidraw/locales/en.json + translation: /packages/excalidraw/locales/%locale%.json diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/children-components/children-components-intro.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/children-components/children-components-intro.mdx index 706adb594c..06bb1cbaf6 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/children-components/children-components-intro.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/children-components/children-components-intro.mdx @@ -17,5 +17,6 @@ Below are the currently supported components: - [MainMenu](/docs/@excalidraw/excalidraw/api/children-components/main-menu) - [WelcomeScreen](/docs/@excalidraw/excalidraw/api/children-components/welcome-screen) +- [Sidebar](/docs/@excalidraw/excalidraw/api/children-components/sidebar) - [Footer](/docs/@excalidraw/excalidraw/api/children-components/footer) - [LiveCollaborationTrigger](/docs/@excalidraw/excalidraw/api/children-components/live-collaboration-trigger) diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/children-components/footer.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/children-components/footer.mdx index cdd5ea5a49..3831268f0f 100644 --- a/dev-docs/docs/@excalidraw/excalidraw/api/children-components/footer.mdx +++ b/dev-docs/docs/@excalidraw/excalidraw/api/children-components/footer.mdx @@ -34,7 +34,7 @@ Open the `Menu` in the below playground and you will see the `custom footer` ren ```jsx live noInline const MobileFooter = ({}) => { const device = useDevice(); - if (device.isMobile) { + if (device.editor.isMobile) { return (