Commit graph

3222 commits

Author SHA1 Message Date
Arnošt Pleskot
186ed43671
feat: animate to constrained area on setting constrains 2023-09-13 16:41:10 +02:00
Arnošt Pleskot
d1e3ea431b
chore: renaming 2023-09-13 16:40:39 +02:00
Arnošt Pleskot
ddb08ce732
feat: use single function for animating canvas translation 2023-09-13 16:20:12 +02:00
Arnošt Pleskot
edf54d1543
fix: scale constrained area based on zoom 2023-09-13 15:58:38 +02:00
Arnošt Pleskot
b4e80b602d
feat: add memoization 2023-09-13 15:57:50 +02:00
Arnošt Pleskot
dd9bde5ee7
feat: animation depending on timeout 2023-09-13 14:54:39 +02:00
Arnošt Pleskot
b99bf74c3d
feat: hide scroll back to content button 2023-09-12 12:23:13 +02:00
Arnošt Pleskot
84b19a77d7
feat: make constrained scroll working with split canvases 2023-09-11 17:07:07 +02:00
Arnošt Pleskot
53a88d4c7a
Merge branch 'master' of github.com:excalidraw/excalidraw into arnost/scroll-in-read-only-links 2023-09-07 13:52:29 +02:00
Aakansha Doshi
134df7bfbb
fix: update size-limit so react is not installed as dependency (#6964) 2023-09-06 10:39:04 +05:30
Alex Kim
5191cdbe26
fix: stale labeled arrow bounds cache after editing the label (#6893)
* fix stale labeled arrow bounds cache after editing the label

* add arrow bounds test

* fix test to check the arrow version

* fix

* fix test - remove unused import

* Update src/element/textWysiwyg.test.tsx

---------

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2023-09-05 21:20:27 +05:30
Arnošt Pleskot
10900f39ee
fix: allow to scroll on one axis when other is fully in view 2023-09-05 17:32:51 +02:00
David Luzar
27fd150a20
fix: canvas flickering due to resetting canvas on skipped frames (#6960) 2023-09-05 12:06:48 +02:00
Arnošt Pleskot
ebbd72e792
feat: use single overscrollAllowance for both axis 2023-09-04 11:55:14 +02:00
Arnošt Pleskot
f8ba862774
feat: set initial zoom to viewportZoomFactor when lockZoom is false 2023-09-03 23:47:48 +02:00
Arnošt Pleskot
806b1e9705
fix: prevent viewport jumping when panning by mouse wheel 2023-09-03 16:54:04 +02:00
zsviczian
188921c247
fix: grid jittery after partition PR (#6935) 2023-08-27 19:30:47 +02:00
David Luzar
de1ebad755
fix: regression in indexing when adding elements to frame (#6904) 2023-08-18 16:34:01 +02:00
David Luzar
9cd5e15917
fix: stabilize selectedElementIds when box selecting (#6912) 2023-08-18 16:14:57 +02:00
David Luzar
8101a351db
fix: resetting deleted elements on duplication (#6906) 2023-08-18 00:28:26 +02:00
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>
2023-08-17 13:47:32 +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
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>
2023-08-16 16:11:43 +05:30
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>
2023-08-16 11:38:36 +02:00
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>
2023-08-16 11:38:16 +02:00
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>
2023-08-16 11:25:31 +02:00
David Luzar
9e0bfd178e
refactor: factor out shape generation from renderElement.ts pt 2 (#6878) 2023-08-14 13:52:25 +02:00
Rahul
c29f19a88b
perf: Limiting the suggested binding to fix performance issue (#6877) 2023-08-14 13:11:08 +02:00
Aakansha Doshi
2b14a5c233
build: increase limit for bundle by 1kb (#6880) 2023-08-14 15:47:18 +05:30
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 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>
2023-08-09 16:41:15 +05:30
Jezreel Maldonado
ded0222e8d
docs: add note for tests that have requisites (#6856)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2023-08-05 09:51:50 +00:00
zsviczian
e7983bc493
fix: webpack config exclude statement to system agnostic (#6857) 2023-08-05 11:49:57 +02:00
David Luzar
083bcf802c
fix: remove embeddable from generic elements (#6853) 2023-08-04 15:16:55 +02:00
dwelle
b0cdd00c2a [debug] 2023-08-02 17:54:04 +02:00
dwelle
6711735b27 Merge branch 'master' into arnost/scroll-in-read-only-links 2023-08-02 17:53:30 +02:00
dwelle
803e14ada1 Revert "[debug]"
This reverts commit 71eb3023b2.
2023-08-02 17:41:32 +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
Arnošt Pleskot
4469c02191
chore: move this.scene.getElementsIncludingDeleted() result into const 2023-08-01 16:52:59 +02:00
Arnošt Pleskot
04e23e1d29
fix: do not animate empty scene 2023-08-01 16:30:45 +02:00
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>
2023-08-01 16:14:08 +05:30
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
2023-08-01 16:13:04 +05:30
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>
2023-08-01 11:07:16 +05:30
Ives van Hoorne
50450a7dab
chore: update required node version to 18 (#6837) 2023-07-31 23:47:41 +02:00
Arnošt Pleskot
d24a032dbb
feat: set scroll constraints on initial scene state 2023-07-31 18:33:39 +02:00
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
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
2023-07-31 19:56:50 +05:30
David Luzar
12e37e3dd2
fix: forgotten REACT_APP env variables (#6834) 2023-07-31 15:29:24 +02:00
Arnošt Pleskot
76d3930983
fix: typo 2023-07-31 09:50:47 +02:00