Commit Graph

3174 Commits (ffa4cea61c115278ead38f849fbb7789650aecca)
 

Author SHA1 Message Date
dwelle ffa4cea61c refactor: FONT_FAMILY and related helpers 1 year ago
David Luzar de1ebad755
fix: regression in indexing when adding elements to frame (#6904) 1 year ago
David Luzar 9cd5e15917
fix: stabilize `selectedElementIds` when box selecting (#6912) 1 year ago
David Luzar 8101a351db
fix: resetting deleted elements on duplication (#6906) 1 year ago
dependabot[bot] 49e9a2ab33
build(deps): bump @excalidraw/excalidraw from 0.15.2 to 0.15.3 in /dev-docs (#6896)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 year ago
David Luzar d140d1b8b3
fix: make canvas compos memoize appState on props they declare (#6897) 1 year ago
zsviczian 1bd416002c
fix: scope `--color-selection` retrieval to given instance (#6886)
Co-authored-by: dwelle <luzar.david@gmail.com>
1 year ago
dependabot[bot] 991f5570ce
build(deps): bump word-wrap from 1.2.3 to 1.2.5 (#6892)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 year ago
dependabot[bot] 3cf8259e71
build(deps): bump semver from 6.3.0 to 6.3.1 in /src/packages/utils (#6755)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 year ago
dependabot[bot] 9b727025fd
build(deps): bump semver from 6.3.0 to 6.3.1 in /src/packages/excalidraw (#6754)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 year ago
dependabot[bot] 59b53eb9cb
build(deps): bump protobufjs from 6.11.3 to 6.11.4 (#6890)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 year ago
David Luzar 9e0bfd178e
refactor: factor out shape generation from `renderElement.ts` pt 2 (#6878) 1 year ago
Rahul c29f19a88b
perf: Limiting the suggested binding to fix performance issue (#6877) 1 year ago
Aakansha Doshi 2b14a5c233
build: increase limit for bundle by 1kb (#6880) 1 year ago
Marcel Mraz a376bd9495
feat: partition main canvas vertically (#6759)
Co-authored-by: Marcel Mraz <marcel.mraz@adacta-fintech.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
1 year ago
Aakansha Doshi 3ea07076ad
feat: support creating containers, linear elements, text containers, labelled arrows and arrow bindings programatically (#6546)
* feat: support creating text containers programatically

* fix

* fix

* fix

* fix

* update api to use label

* fix api and support individual shapes and text element

* update test case in package example

* support creating arrows and line

* support labelled arrows

* add in package example

* fix alignment

* better types

* fix

* keep element as is unless we support prog api

* fix tests

* fix lint

* ignore

* support arrow bindings via start and end in api

* fix lint

* fix coords

* support id as well for elements

* preserve bindings if present and fix testcases

* preserve bindings for labelled arrows

* support ids, clean up code and move the api related stuff to transform.ts

* allow multiple arrows to bind to single element

* fix singular elements

* fix single text element, unique id and tests

* fix lint

* fix

* support binding arrow to text element

* fix creation of regular text

* use same stroke color as parent for text containers and height 0 for linear element by default

* fix types

* fix

* remove more ts ignore

* remove ts ignore

* remove

* Add coverage script

* Add tests

* fix tests

* make type optional when id present

* remove type when id provided in tests

* Add more tests

* tweak

* let host call convertToExcalidrawElements when using programmatic API

* remove convertToExcalidrawElements call from restore

* lint

* update snaps

* Add new type excalidraw-api/clipboard for programmatic api

* cleanup

* rename tweak

* tweak

* make image attributes optional and better ts check

* support image via programmatic API

* fix lint

* more types

* make fileId mandatory for image and export convertToExcalidrawElements

* fix

* small tweaks

* update snaps

* fix

* use Object.assign instead of mutateElement

* lint

* preserve z-index by pushing all elements first and then add bindings

* instantiate instead of closure for storing elements

* use element API to create regular text, diamond, ellipse and rectangle

* fix snaps

* udpdate api

* ts fixes

* make `convertToExcalidrawElements` more typesafe

* update snaps

* refactor the approach so that order of elements doesn't matter

* Revert "update snaps"

This reverts commit 621dfadccf.

* review fixes

* rename ExcalidrawProgrammaticElement -> ExcalidrawELementSkeleton

* Add tests

* give preference to first element when duplicate ids found

* use console.error

---------

Co-authored-by: dwelle <luzar.david@gmail.com>
2 years ago
Jezreel Maldonado ded0222e8d
docs: add note for tests that have requisites (#6856)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2 years ago
zsviczian e7983bc493
fix: webpack config exclude statement to system agnostic (#6857) 2 years ago
David Luzar 083bcf802c
fix: remove `embeddable` from generic elements (#6853) 2 years ago
Alex Kim bb985eba3a
fix: resizing arrow labels (#6789)
* fix arrow labels resizing

- min arrow labels width based on font size
- labels width and padding in % of container's width
- resize labels simply multiplying by scale

* remove no longer needed getContainerDims

* fix arrow labels font size not updated on change font size action

* fix bound arrows not updated right after resize

* fix test

* fix 3+ point arrow label resizing with shift

* fix bound text not scaling when resizing with shift & n or s handle

* fix arrow labels width not updating when moving a 2-point arrow point with shift

---------

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2 years ago
dependabot[bot] 23c88a38d0
build(deps): bump semver from 5.7.1 to 5.7.2 in /dev-docs (#6757)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Aakansha Doshi 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
2 years ago
dependabot[bot] 9391a09e54
build(deps): bump word-wrap from 1.2.3 to 1.2.5 (#6811)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Ives van Hoorne 50450a7dab
chore: update required node version to 18 (#6837) 2 years ago
David Luzar fc9a9a2571
fix: eye-dropper not working with app offset correctly on non-1 dPR (#6835) 2 years ago
Aakansha Doshi 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
2 years ago
David Luzar 12e37e3dd2
fix: forgotten REACT_APP env variables (#6834) 2 years ago
Benjamin André-Micolon 9ca27c62c7
feat: add support for simplePDF in Web-Embeds (#6810) 2 years ago
Achille Lacoin 1acc646534
feat: add support for val.town embeds (#6821) 2 years ago
Aakansha Doshi 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

---------
2 years ago
Aakansha Doshi 5dd1efde8a
build: update to node 18 in docker (#6822) 2 years ago
Arnost Pleskot a7c590d459
feat: render bold lines in grid (#6779)
Co-authored-by: dwelle <luzar.david@gmail.com>
2 years ago
Aakansha Doshi 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>
2 years ago
David Luzar 8af9ea3cf3
fix: adding to selection via shift box-select (#6815) 2 years ago
Max Kovalenko cbd908097f
chore: typo - Collab.ts (#6812) 2 years ago
David Luzar c1247742ea
fix: prevent binding focus NaN value (#6803)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2 years ago
Aakansha Doshi 8104068bd5
revert: "build: Migrate to Vite 🚀" (#6814)
Revert "build: Migrate to Vite 🚀 (#6713)"

This reverts commit e93bbc5776.
2 years ago
Tomek Sułkowski dcc75ed007
feat: adds support for stackblitz.com embeds (#6813)
feat: adds stackblitz.com embeds
2 years ago
Aakansha Doshi 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>
2 years ago
Aakansha Doshi 2a2495175b
build: increase limit to 290 kB for prod bundle (#6809) 2 years ago
zsviczian b57b3b573d
feat: introducing Web-Embeds (alias iframe element) (#6691)
Co-authored-by: dwelle <luzar.david@gmail.com>
2 years ago
Aakansha Doshi 744e5b2ab3
fix: use pull request in semantic workflow for better security (#6799)
* fix: use pull request in semantic workflow for security

* add types
2 years ago
Guilherme Minozzi d36c72c435
fix: don't show `canvasBackground` label when `UIOptions.canvasActions.changeViewBackgroundColor` is false (#6781)
* fix(components/main-menu): not show canvasBackground

* chore(components/main-menu): add data-testid attr to canvasBackground label

* test(tests/packages/excalidraw): check whether canvasbackground label is rendered when changeviewbackground is false

* test: update snapshots

* fix(tests/packages/excalidraw): change to lowercase canvas background test id

* change to pull request target for size-limit

* Revert "change to pull request target for size-limit"

This reverts commit baf1ca2677.

* Add test

---------

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2 years ago
Aakansha Doshi e57dc405fa
chore: add style-loader as deps instead of using from react-scripts (#6791) 2 years ago
Aakansha Doshi 41ed019bc2
chore: remove size-limit deps from root package.json (#6790)
* chore: remove size-limit deps from root package.json

* add size limit preset
2 years ago
Ajay Kumbhare f7c3644342
refactor: add typeScript support to enforce valid translation keys (#6776) 2 years ago
Aakansha Doshi 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
2 years ago
Aakansha Doshi 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
2 years ago
Aakansha Doshi 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
2 years ago
Aakansha Doshi 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>
2 years ago