Commit Graph
100 Commits
Author SHA1 Message Date
Aakansha Doshi 1e633f7ed6 ts fixes 2023-08-03 15:40:18 +05:30
Aakansha Doshi eb415c1851 udpdate api 2023-08-03 12:14:33 +05:30
Aakansha Doshi 8aed24312f fix snaps 2023-08-03 12:14:21 +05:30
Aakansha Doshi e49c94f22f use element API to create regular text, diamond, ellipse and rectangle 2023-08-03 11:53:54 +05:30
Aakansha Doshi 685ece4b3a instantiate instead of closure for storing elements 2023-08-02 21:32:26 +05:30
Aakansha Doshi 93008d6a8d preserve z-index by pushing all elements first and then add bindings 2023-08-02 20:40:39 +05:30
Aakansha Doshi dcc4c28041 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-08-02 16:30:29 +05:30
Aakansha Doshi 7577ed5387 lint 2023-08-02 15:32:37 +05:30
Aakansha Doshi e463d2f51b use Object.assign instead of mutateElement 2023-08-02 15:29:44 +05:30
Aakansha Doshi 06dd6de0af fix 2023-08-01 20:40:52 +05:30
Aakansha Doshi 77ef356076 update snaps 2023-08-01 20:21:24 +05:30
Aakansha DoshiandGitHub b85d5fa12b test: add coverage report for PR (#6840)
* test: add coverage report for PR

* gh token

* fix

* fix

* add reporter

* fix

* enable v8 for coverage

* no watch

* test

* add threshold

* fix

* change name so the action isn't required

* change job name

* rename job so it doesn't collid with test required check

* remove log
2023-08-01 16:13:04 +05:30
Aakansha DoshiandGitHub 6126c34dc0 fix: add self destroying service-worker.js to migrate everyone from CRA to Vite (#6833)
* fix: add self destroying service-worker.js to migrate everyone from CRA to VITE

* add comment

* don't add service-worker.js to app pre-cache
2023-07-31 19:56:50 +05:30
Aakansha DoshiandGitHub 66bac50de3 fix: refresh sw when browser refreshed (#6824)
* fix: refresh sw when browser refreshed

* dummy test

* enable immediate reload

* test

* fix

* autoupdate

* don't immediate

* test

* testing testing

* test

* test

* its same

* revert logs

* fix types

---------
2023-07-28 20:17:24 +05:30
Aakansha DoshiandGitHub 5dd1efde8a build: update to node 18 in docker (#6822) 2023-07-28 12:06:33 +05:30
48924688c7 build: migrate to Vite 🚀 (#6818)
* init

* add: vite dev build working

* fix: href serving from public

* feat: add ejs plugin

* feat: migrated env files and ejs templating

* chore: add types related to envs

* chore: add vite-env types

* feat: support vite pwa

* chore: upgrade vite pwa

* chore: pin node version to 16.18.1

* chore: preserve use of nodejs 14

* refactor: preserve REACT_APP as env prefix

* chore: support esm environment variables

* fix ts config

* use VITE prefix and remove vite-plugin-env-compatible

* introduce import-meta-loader for building pacakge as webpack isn't compatible with import.meta syntax

* lint

* remove import.meta.env in main.js

* set debug flag to false

* migrate to vitest and use jest-canvas-mock 2.4.0 so its comp
atible with vite

* integrate vitest-ui

* fix most of teh test

* snaps

* Add script for testing with vite ui

* fix all tests related to mocking

* fix more test

* fix more

* fix flip.test.tsx

* fix contentxmenu snaps

* fix regression snaps

* fix excalidraw.test.tsx and this makes all tests finally pass :)

* use node 16

* specify node version

* use node 16 in lint as well

* fix mobile.test.tsx

* use node 16

* add style-loader

* upgrade to node 18

* fix lint package.json

* support eslint with vite

* fix lint

* fix lint

* fix ts

* remove pwa/sw stuff

* use env vars in EJS the vite way

* fix lint

* move remainig jest mock/spy to vite

* don't cache locales

* fix regex

* add fonts cache

* tweak

* add custom service worker

* upgrade vite and create font cache again

* cache fonts.css and locales

* tweak

* use manifestTransforms for filtering locales

* use assets js pattern for locales

* add font.css to globIgnore so its pushed to fonts cache

* create a separate chunk for locales with rollup

* remove manifestTransforms and fix glob pattern for locales to filter from workbox pre-cache

* push sourcemaps in production

* add comments in config

* lint

* use node 18

* disable pwa in dev

* fix

* fix

* increase limit of bundle

* upgrade vite-pwa to latest

* remove public/workbox so workbox assets are not precached

* fon't club en.json and percentages.json with manual locales chunk to fix first load+offline mode

* tweak regex

* remove happy-dom as its not used

* add comment

* use any instead of ts-ignore

* cleanup

* remove jest-canvas-mock resolution as vite-canvas-mock was patched locking deps at 2.4.0

* use same theme color present in entry point

* remove vite-plugin-eslint as it improves DX significantly

* integrate vite-plugin-checker for ts errors

* add nabla/vite-plugin-eslint

* use eslint from checker only

* add env variable VITE_APP_COLLAPSE_OVERLAY for collapsing the checker overlay

* tweak vite checker overlay badge position

* Enable eslint behind flag as its not working well with windows with non WSL

* make port configurable

* open the browser when server ready

* enable eslint by default

---------

Co-authored-by: Weslley Braga <weslley@bambee.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-07-27 23:50:11 +05:30
Aakansha DoshiandGitHub 8104068bd5 revert: "build: Migrate to Vite 🚀" (#6814)
Revert "build: Migrate to Vite 🚀 (#6713)"

This reverts commit e93bbc5776.
2023-07-26 22:34:06 +05:30
e93bbc5776 build: Migrate to Vite 🚀 (#6713)
* init

* add: vite dev build working

* fix: href serving from public

* feat: add ejs plugin

* feat: migrated env files and ejs templating

* chore: add types related to envs

* chore: add vite-env types

* feat: support vite pwa

* chore: upgrade vite pwa

* chore: pin node version to 16.18.1

* chore: preserve use of nodejs 14

* refactor: preserve REACT_APP as env prefix

* chore: support esm environment variables

* fix ts config

* use VITE prefix and remove vite-plugin-env-compatible

* introduce import-meta-loader for building pacakge as webpack isn't compatible with import.meta syntax

* lint

* remove import.meta.env in main.js

* set debug flag to false

* migrate to vitest and use jest-canvas-mock 2.4.0 so its comp
atible with vite

* integrate vitest-ui

* fix most of teh test

* snaps

* Add script for testing with vite ui

* fix all tests related to mocking

* fix more test

* fix more

* fix flip.test.tsx

* fix contentxmenu snaps

* fix regression snaps

* fix excalidraw.test.tsx and this makes all tests finally pass :)

* use node 16

* specify node version

* use node 16 in lint as well

* fix mobile.test.tsx

* use node 16

* add style-loader

* upgrade to node 18

* fix lint package.json

* support eslint with vite

* fix lint

* fix lint

* fix ts

* remove pwa/sw stuff

* use env vars in EJS the vite way

* fix lint

* move remainig jest mock/spy to vite

* don't cache locales

* fix regex

* add fonts cache

* tweak

* add custom service worker

* upgrade vite and create font cache again

* cache fonts.css and locales

* tweak

* use manifestTransforms for filtering locales

* use assets js pattern for locales

* add font.css to globIgnore so its pushed to fonts cache

* create a separate chunk for locales with rollup

* remove manifestTransforms and fix glob pattern for locales to filter from workbox pre-cache

* push sourcemaps in production

* add comments in config

* lint

* use node 18

* disable pwa in dev

* fix

* fix

* increase limit of bundle

* upgrade vite-pwa to latest

* remove public/workbox so workbox assets are not precached

* fon't club en.json and percentages.json with manual locales chunk to fix first load+offline mode

* tweak regex

* remove happy-dom as its not used

* add comment

* use any instead of ts-ignore

* cleanup

* remove jest-canvas-mock resolution as vite-canvas-mock was patched locking deps at 2.4.0

* use same theme color present in entry point

---------

Co-authored-by: Weslley Braga <weslley@bambee.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-07-26 15:55:20 +05:30
Aakansha DoshiandGitHub 2a2495175b build: increase limit to 290 kB for prod bundle (#6809) 2023-07-26 08:49:39 +05:30
Aakansha DoshiandGitHub 744e5b2ab3 fix: use pull request in semantic workflow for better security (#6799)
* fix: use pull request in semantic workflow for security

* add types
2023-07-24 13:01:42 +05:30
Aakansha DoshiandGitHub e57dc405fa chore: add style-loader as deps instead of using from react-scripts (#6791) 2023-07-21 13:48:48 +05:30
Aakansha DoshiandGitHub 41ed019bc2 chore: remove size-limit deps from root package.json (#6790)
* chore: remove size-limit deps from root package.json

* add size limit preset
2023-07-21 13:35:20 +05:30
Aakansha Doshi 354ca3fe06 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-07-20 14:05:02 +05:30
Aakansha DoshiandGitHub 5e3550fc14 ci: structured build output from size-limit (#6788)
* ci: better build output from size-limit

* add size-limit.json

* try with pull request target

* fix

* revert pull request target
2023-07-20 13:54:13 +05:30
Aakansha DoshiandGitHub 70888327a3 fix: use subdirectory for @excalidraw/excalidraw size limit (#6787)
* fix: use subdirectory for @excalidraw/excalidraw size limit

* fix

* update yml

* update path

* fix

* fix

* better
2023-07-19 22:07:18 +05:30
Aakansha DoshiandGitHub 9fc15d81a0 ci: introduce bundle size for package @excalidraw/excalidraw (#6785)
* ci: update bundle size limit

* change the size script to track bundle size on the package excalidraw

* fix build command

* fix

* remove

* fix

* update script

* fix
2023-07-19 21:19:10 +05:30
Aakansha Doshi 2b2e8f241d Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-07-19 14:13:03 +05:30
a80ac4c748 ci: add bundle size limit action (#6783)
* ci: add bundle size limit action

* chore: fix lint

* ci: fix

* ci: fix workflow

* ci: fix workflow

* add size limit deps

* use node 18

---------

Co-authored-by: Nitin Kumar <nitin.kumar@razorpay.com>
2023-07-19 13:55:50 +05:30
Aakansha Doshi eae7ba28e3 fix 2023-07-18 13:24:51 +05:30
Aakansha Doshi 756b924518 make fileId mandatory for image and export convertToExcalidrawElements 2023-07-18 13:03:59 +05:30
Aakansha Doshi a6b389ca62 more types 2023-07-17 18:18:14 +05:30
Aakansha Doshi 23f212367a fix lint 2023-07-17 17:59:00 +05:30
Aakansha Doshi 21ca391e8c support image via programmatic API 2023-07-17 17:54:50 +05:30
Aakansha Doshi bf3afc34ed make image attributes optional and better ts check 2023-07-17 17:33:23 +05:30
Aakansha Doshi bdb84b01ca tweak 2023-07-17 16:30:38 +05:30
Aakansha Doshi 2359a7a818 rename tweak 2023-07-17 13:10:57 +05:30
Aakansha Doshi 562249e981 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-07-17 12:56:35 +05:30
Aakansha Doshi d994f72c40 cleanup 2023-07-14 20:37:53 +05:30
Aakansha Doshi 7a94ee3191 Add new type excalidraw-api/clipboard for programmatic api 2023-07-14 20:10:02 +05:30
Aakansha Doshi bb778892dc update snaps 2023-07-14 17:20:27 +05:30
Aakansha Doshi 11fd4efa32 lint 2023-07-14 17:15:37 +05:30
Aakansha Doshi d3361f910b remove convertToExcalidrawElements call from restore 2023-07-14 17:13:24 +05:30
Aakansha Doshi 2ff0528a4f Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-07-14 17:10:09 +05:30
Aakansha Doshi 25e2f80709 let host call convertToExcalidrawElements when using programmatic API 2023-07-14 14:50:27 +05:30
Aakansha DoshiandGitHub 6d56634289 fix: do not bind text to container using text tool when it has text already (#6694)
* fix: do not bind text to container using text tool when it has text already

* Update src/element/textWysiwyg.test.tsx
2023-06-19 17:28:45 +05:30
Aakansha DoshiandGitHub 7f7128ec09 fix: don't allow binding text to images (#6693) 2023-06-19 13:47:28 +05:30
Aakansha DoshiandGitHub 6de6a96abf docs: add info about roadmap (#6687) 2023-06-16 20:55:33 +05:30
Aakansha DoshiandGitHub 4d7d96eb7b feat: add canvas-roundrect-polyfill package (#6675)
* feat: add canvas-roundrect-polyfill instead of maintaining a copy of it and transplile it since its not transpiled in the package

* transform canvas-roundrect-polyfill in jest
2023-06-14 17:26:29 +05:30
Aakansha Doshi c1a61b06df tweak 2023-06-12 14:29:45 +05:30
Aakansha Doshi 9e6751c5fb Add more tests 2023-06-12 13:00:31 +05:30
Aakansha Doshi 1784f5b31e remove type when id provided in tests 2023-06-12 11:59:21 +05:30
Aakansha Doshi d76bc7890d make type optional when id present 2023-06-12 11:53:10 +05:30
Aakansha DoshiandGitHub ae7ff76126 fix: cleanup textWysiwyg and getAdjustedDimensions (#6520)
* fix: cleanup textWysiwyg and getAdjustedDimensions

* fix lint

* fix test
2023-06-06 14:36:18 +05:30
Aakansha Doshi d9e6910df0 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-06-05 11:46:26 +05:30
Aakansha DoshiandGitHub 82d8d02697 test: Add coverage script (#6634)
Add coverage script
2023-05-31 17:30:14 +05:30
Aakansha Doshi 236a12d968 fix tests 2023-05-30 20:11:19 +05:30
Aakansha Doshi a9154b36d5 Add tests 2023-05-30 13:24:47 +05:30
Aakansha Doshi dfd3d4551f Add coverage script 2023-05-30 12:34:23 +05:30
Aakansha Doshi d4b34a380b remove 2023-05-30 11:51:57 +05:30
Aakansha Doshi 2c52107f6f remove ts ignore 2023-05-29 18:30:30 +05:30
Aakansha Doshi 03131750be remove more ts ignore 2023-05-29 14:48:22 +05:30
Aakansha Doshi f57e72443d fix 2023-05-29 14:09:30 +05:30
Aakansha Doshi 016662a7f6 fix types 2023-05-29 13:53:19 +05:30
Aakansha Doshi 5841e6a48d use same stroke color as parent for text containers and height 0 for linear element by default 2023-05-26 13:59:10 +05:30
Aakansha Doshi 5b458288e7 fix creation of regular text 2023-05-26 13:00:22 +05:30
Aakansha Doshi afc98c2d47 support binding arrow to text element 2023-05-25 22:56:50 +05:30
Aakansha Doshi 7560b59900 fix 2023-05-25 14:35:58 +05:30
Aakansha Doshi b72515a83b fix lint 2023-05-25 14:20:14 +05:30
Aakansha Doshi 1c291f8b3d fix single text element, unique id and tests 2023-05-25 14:12:01 +05:30
Aakansha Doshi 6c41e507db fix singular elements 2023-05-24 22:35:51 +05:30
Aakansha Doshi 596edaea62 allow multiple arrows to bind to single element 2023-05-24 18:42:35 +05:30
Aakansha Doshi 985318e960 support ids, clean up code and move the api related stuff to transform.ts 2023-05-24 17:12:26 +05:30
Aakansha Doshi da8e97ad14 preserve bindings for labelled arrows 2023-05-23 16:55:41 +05:30
Aakansha Doshi f113a393e6 preserve bindings if present and fix testcases 2023-05-23 16:47:52 +05:30
Aakansha Doshi 75cfe54b15 support id as well for elements 2023-05-23 13:21:22 +05:30
Aakansha Doshi b783b822d6 fix coords 2023-05-23 13:19:33 +05:30
Aakansha Doshi 596e64ca5a fix lint 2023-05-22 21:29:42 +05:30
Aakansha Doshi d8c901e0c1 support arrow bindings via start and end in api 2023-05-22 21:22:36 +05:30
Aakansha Doshi 0449cccc39 ignore 2023-05-22 14:01:32 +05:30
Aakansha Doshi 5bfe4dff5f fix lint 2023-05-22 13:57:05 +05:30
Aakansha Doshi dcf9e27e51 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-05-22 13:51:36 +05:30
Aakansha Doshi e3fa2905f2 fix tests 2023-05-22 13:40:35 +05:30
Aakansha Doshi e68edb9f73 keep element as is unless we support prog api 2023-05-18 15:20:26 +05:30
Aakansha Doshi 453aa722eb fix 2023-05-17 18:22:59 +05:30
Aakansha Doshi 4348646705 better types 2023-05-17 17:58:18 +05:30
Aakansha Doshi 81bee8acb8 fix alignment 2023-05-17 14:09:25 +05:30
Aakansha Doshi 9e3032059d add in package example 2023-05-16 17:52:40 +05:30
Aakansha Doshi a443d65512 support labelled arrows 2023-05-16 17:49:24 +05:30
Aakansha Doshi fbf2d533c0 support creating arrows and line 2023-05-16 16:50:58 +05:30
Aakansha Doshi d83860c747 update test case in package example 2023-05-15 16:57:01 +05:30
Aakansha Doshi 32aaa8b95d fix api and support individual shapes and text element 2023-05-15 16:34:12 +05:30
Aakansha DoshiandGitHub e0f2869374 fix: assign the original text to text editor only during init (#6580) 2023-05-13 19:17:29 +02:00
Aakansha Doshi acde193a64 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-05-12 17:19:45 +05:30
Aakansha Doshi bc5c58282f update api to use label 2023-05-12 17:19:36 +05:30
Aakansha Doshi e465a43f77 fix 2023-05-03 15:44:18 +05:30
Aakansha Doshi 9c63b0124c fix 2023-05-03 14:34:06 +05:30
Aakansha Doshi 59e8bf498d fix 2023-05-03 13:41:41 +05:30
Aakansha Doshi 7087db42c0 fix 2023-05-03 00:48:11 +05:30
Aakansha Doshi 15b5295baf feat: support creating text containers programatically 2023-05-02 22:11:35 +05:30
Aakansha DoshiandGitHub b1311a407a fix: Revert add version tags to Docker build (#6540)
Revert "build: Add version tags to Docker build (#6508)"

This reverts commit 1815cf3213.
2023-05-02 12:49:11 +05:30