984 Commits

Author SHA1 Message Date
David Luzar
26ff3993bb
feat: better laser cursor for dark mode (#7132) 2023-10-11 11:17:27 +02:00
David Luzar
7ad02c359a
fix: memoize static canvas on props.renderConfig (#7131) 2023-10-10 23:31:23 +02:00
David Luzar
2523fe82e3
feat: laser pointer improvements (#7128) 2023-10-10 13:55:55 +02:00
zsviczian
4ea079eb85
fix: regression from #6739 preventing redirect link in view mode (#7120)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-10-09 12:26:49 +02:00
David Luzar
a249f332a2
fix: ensure we do not stop laser update prematurely (#7100) 2023-10-06 12:00:35 +02:00
Are
2e61926a6b
feat: initial Laser Pointer MVP (#6739)
* feat: initial Laser pointer mvp

* feat: add laser-pointer package and integrate it with collab

* chore: fix yarn.lock

* feat: update laser-pointer package, prevent panning from showing

* feat: add laser pointer tool button when collaborating, migrate to official package

* feat: reduce laser tool button size

* update icon

* fix icon & rotate

* fix: lock zoom level

* fix icon

* add `selected` state, simplify and reduce api

* set up pointer callbacks in viewMode if laser tool active

* highlight extra-tools button if one of the nested tools active

* add shortcut to laser pointer

* feat: don't update paths if nothing changed

* ensure we reset flag if no rAF scheduled

* move `lastUpdate` to instance to optimize

* return early

* factor out into constants and add doc

* skip iteration instead of exit

* fix naming

* feat: remove testing variable on window

* destroy on editor unmount

* fix incorrectly resetting `lastUpdate` in `stop()`

---------

Co-authored-by: dwelle <luzar.david@gmail.com>
2023-10-05 17:05:16 +02:00
DanielJGeiger
e921bfb1ae
feat: Export iconFillColor() (#6996) 2023-10-04 18:17:22 -05:00
David Luzar
e6f74350ac
refactor: DRY out tool typing (#7086) 2023-10-04 23:39:00 +02:00
David Luzar
fa33aa08ab
refactor: refactor event globals to differentiate from lastPointerUp (#7084) 2023-10-04 16:18:22 +02:00
David Luzar
8b838049df
fix: remove invisible elements safely (#7083) 2023-10-04 16:09:59 +02:00
David Luzar
1f4f5e11ae
refactor: DRY out and simplify setting active tool from toolbar (#7079) 2023-10-04 00:16:54 +02:00
David Luzar
12420592ef
feat: support menu / dropdown items to have selected state (#7078) 2023-10-03 23:35:47 +02:00
hugofqt
4c35eba72d
feat: element alignments - snapping (#6256)
Co-authored-by: Ryan Di <ryan.weihao.di@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-09-28 16:28:08 +02:00
David Luzar
4765f5536e
fix: frame name not editable on dbl-click (#7037) 2023-09-25 16:54:23 +02:00
David Luzar
f8b3692262
fix: more eye-droper fixes (#7019) 2023-09-21 09:54:03 +05:30
Aakansha Doshi
741d5f1a18
refactor: move excalidraw-app outside src (#6987)
* refactor: move excalidraw-app outside src

* move some tests to excal app and fix some

* fix tests

* fix

* port remaining tests

* fix

* update snap

* move tests inside test folder

* fix

* fix
2023-09-21 09:28:48 +05:30
David Luzar
3d617958cc
fix: improperly disabling UI pointer-events on canvas interaction (#7005)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2023-09-19 16:01:40 +02:00
David Luzar
4b11f43117
feat: zen-mode/go-to-plus button style tweaks (#7006) 2023-09-19 14:20:59 +02:00
zsviczian
e3f4f567b8
feat: holding down CMD/CTRL will disable snap to grid when grid is active (#6983)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-09-18 17:10:28 +02:00
David Luzar
c1952fd6cc
fix: several eyeDropper fixes (#7002) 2023-09-17 13:24:50 +02:00
David Luzar
c9efb12e5b
fix: use device.isMobile for sidebar trigger label breakpoint (#6994) 2023-09-15 12:08:51 +00:00
David Luzar
5302490372
feat: update logo (#6979) 2023-09-11 17:47:41 +02:00
Marcel Mraz
a13aed92f2
fix: z-index inconsistencies during addition / deletion in frames (#6914)
Co-authored-by: Marcel Mraz <marcel.mraz@adacta-fintech.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-09-06 22:41:44 +00:00
David Luzar
27fd150a20
fix: canvas flickering due to resetting canvas on skipped frames (#6960) 2023-09-05 12:06:48 +02:00
David Luzar
8101a351db
fix: resetting deleted elements on duplication (#6906) 2023-08-18 00:28:26 +02:00
David Luzar
d140d1b8b3
fix: make canvas compos memoize appState on props they declare (#6897) 2023-08-17 13:39:15 +02:00
zsviczian
1bd416002c
fix: scope --color-selection retrieval to given instance (#6886)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-08-16 21:59:37 +00:00
Rahul
c29f19a88b
perf: Limiting the suggested binding to fix performance issue (#6877) 2023-08-14 13:11:08 +02:00
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>
2023-08-12 22:56:59 +02:00
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 621dfadccfea975a1f77223f506dce9d260f91fd.

* 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>
2023-08-09 16:41:15 +05:30
David Luzar
083bcf802c
fix: remove embeddable from generic elements (#6853) 2023-08-04 15:16:55 +02:00
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>
2023-08-02 15:34:21 +05:30
David Luzar
fc9a9a2571
fix: eye-dropper not working with app offset correctly on non-1 dPR (#6835) 2023-07-31 16:36:30 +02:00
Benjamin André-Micolon
9ca27c62c7
feat: add support for simplePDF in Web-Embeds (#6810) 2023-07-29 10:02:15 +02:00
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>
2023-07-27 23:50:11 +05:30
David Luzar
8af9ea3cf3
fix: adding to selection via shift box-select (#6815) 2023-07-27 12:50:08 +02:00
Aakansha Doshi
8104068bd5
revert: "build: Migrate to Vite 🚀" (#6814)
Revert "build: Migrate to Vite 🚀 (#6713)"

This reverts commit e93bbc577613a6de6bb43c40c3b57286b4994ca5.
2023-07-26 22:34:06 +05:30
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>
2023-07-26 15:55:20 +05:30
zsviczian
b57b3b573d
feat: introducing Web-Embeds (alias iframe element) (#6691)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-07-24 16:51:53 +02:00
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 baf1ca2677be4b51c6666522387ab9da9ac9f9d1.

* Add test

---------

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2023-07-24 12:33:54 +05:30
Ajay Kumbhare
f7c3644342
refactor: add typeScript support to enforce valid translation keys (#6776) 2023-07-20 18:15:32 +02:00
David Luzar
9f76f8677b
feat: cache most of element selection (#6747) 2023-07-17 01:09:44 +02:00
David Luzar
2e46e27490
fix: use actual dock state to not close docked library on insert (#6766) 2023-07-14 20:21:02 +02:00
David Luzar
cf0413338e
feat: support customizing what parts of frames are rendered (#6752) 2023-07-10 17:13:44 +02:00
David Luzar
49e4289878
feat: make appState.selectedElementIds more stable (#6745) 2023-07-08 23:33:34 +02:00
zsviczian
3ddcc48e4c
fix: UI disappears when pressing the eyedropper shortcut on mobile (#6725) 2023-06-29 12:39:44 +02:00
Barnabás Molnár
29a5e982c3
feat: support scrollToContent opts.fitToViewport (#6581)
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Arnošt Pleskot <arnostpleskot@gmail.com>
2023-06-29 12:36:38 +02:00
Christopher Chedeau
b33fa6d6f6
fix: stronger enforcement of normalizeLink (#6728)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-06-29 12:14:42 +02:00
David Luzar
8dfa2a98bb
fix: scrollbars renders but disable (#6706) 2023-06-22 14:35:01 +02:00
Are
7558a4e2be
feat: overwrite confirmation dialogs (#6658)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-06-19 17:08:12 +02:00