Commit Graph

244 Commits

Author SHA1 Message Date
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
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
Ryan Di b7350f9707 fix: elements in non-existing frame getting removed (#6708)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-06-22 22:10:08 +00:00
Ryan Di 81ebf82979 feat: introduce frames (#6123)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-06-14 18:42:01 +02:00
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 Doshi d9e6910df0 Merge remote-tracking branch 'origin/master' into aakansha-create-text-containers-programmatically 2023-06-05 11:46:26 +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
Arnost Pleskot a91e401554 feat: clearing library cache (#6621)
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-05-29 16:01:44 +02:00
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 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 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 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 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
Barnabás Molnár 5b7596582f feat: color picker redesign (#6216)
Co-authored-by: Maielo <maielo.mv@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2023-05-18 16:06:27 +02:00
Aakansha Doshi 4348646705 better types 2023-05-17 17:58:18 +05:30
Aakansha Doshi fbf2d533c0 support creating arrows and line 2023-05-16 16:50:58 +05:30
Aakansha Doshi 32aaa8b95d fix api and support individual shapes and text element 2023-05-15 16:34:12 +05:30
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
David Luzar e9cae918a7 feat: sidebar tabs support (#6213)
* feat: Sidebar tabs support [wip]

* tab trigger styling tweaks

* add `:hover` & `:active` states

* replace `@dwelle/tunnel-rat` with `tunnel-rat`

* make stuff more explicit

- remove `Sidebar.Header` fallback (host apps need to render manually), and stop tunneling it (render in place)
- make `docked` state explicit
- stop tunneling `Sidebar.TabTriggers` (render in place)

* redesign sidebar / library as per latest spec

* support no label on `Sidebar.Trigger`

* add Sidebar `props.onStateChange`

* style fixes

* make `appState.isSidebarDocked` into a soft user preference

* px -> rem & refactor

* remove `props.renderSidebar`

* update tests

* remove

* refactor

* rename constants

* tab triggers styling fixes

* factor out library-related logic from generic sidebar trigger

* change `props.onClose` to `onToggle`

* rename `props.value` -> `props.tab`

* add displayNames

* allow HTMLAttributes on applicable compos

* fix example App

* more styling tweaks and fixes

* fix not setting `dockable`

* more style fixes

* fix and align sidebar header button styling

* make DefaultSidebar dockable on if host apps supplies `onDock`

* stop `Sidebar.Trigger` hiding label on mobile

this should be only the default sidebar trigger behavior, and for that we don't need to use `device` hook as we handle in CSS

* fix `dockable` prop of defaultSidebar

* remove extra `typescript` dep

* remove `defaultTab` prop

in favor of explicit `tab` value in `<Sidebar.Trigger/>` and `toggleSidebar()`, to reduce API surface area and solve inconsistency of `appState.openSidebar.tab` not reflecting actual UI value if `defaultTab` was supported (without additional syncing logic which feels like the wrong solution).

* remove `onToggle` in favor of `onStateChange`

reducing API surface area

* fix restore

* comment no longer applies

* reuse `Button` component in sidebar buttons

* fix tests

* split Sidebar sub-components into files

* remove `props.dockable` in favor of `props.onDock` only

* split tests

* fix sidebar showing dock button if no `props.docked` supplied & add more tests

* reorder and group sidebar tests

* clarify

* rename classes & dedupe css

* refactor tests

* update changelog

* update changelog

---------

Co-authored-by: barnabasmolnar <barnabas@excalidraw.com>
2023-05-04 17:33:31 +00:00
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 Doshi 45a57d70de fix: don't refresh dimensions for text containers on font load (#6523) 2023-04-26 21:35:06 +05:30
David Luzar fee760d38c feat: allow avif, jfif, webp, bmp, ico image types (#6500
* feat: allow `avif`, `jfif`, `webp`, `bmp`, `ico` image types

* dedupe for SSOT

* more SSOT
2023-04-21 22:53:49 +02:00
David Luzar f640ddc2aa fix: incorrectly duplicating items on paste/library insert (#6467
* fix: incorrectly duplicating items on paste/library insert

* fix: deduplicate element ids on restore

* tests
2023-04-16 17:22:16 +02:00
Aakansha Doshi ec215362a1 fix: introduce baseline to fix the layout shift when switching to text editor (#6397)
* fix: introduce baseline to fix the layout shift when switching to text editor

* uncomment

* change offset to 8pixels

* [debug]

* introduce DOM baseline in canvas rendering instead

* introduce baseline in element making it backward compat

* fix

* lint

* fix

* update baseline when resizing text element

* fix safari backward compat

* fix for safari

* lint

* reduce safari LS

* floor line height and height when dom height increases than canvas height

* Revert "floor line height and height when dom height increases than canvas height"

This reverts commit 8de6516823.

* cleanup

* use DOM height only for safari to fix LS

* Revert "use DOM height only for safari to fix LS"

This reverts commit d75889238d.

* fix lint and test

* fix

* calculate line height by rounding off instead of DOM

* cleanup

---------

Co-authored-by: dwelle <luzar.david@gmail.com>
2023-04-10 18:52:46 +05:30
Type Horror 25bb6738ea feat: Add fitToContent and animate to scrollToContent (#6319)
Co-authored-by: Brice Leroy <brice@brigalabs.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2023-03-25 23:26:58 +01:00
Aakansha Doshi 83383977f5 feat: add line height attribute to text element (#6360)
* feat: add line height attribute to text element

* lint

* update line height when redrawing text bounding box

* fix tests

* retain line height when pasting styles

* fix test

* create a util for calculating ling height using old algo

* update line height when resizing multiple text elements

* make line height backward compatible

* udpate line height for older element when font size updated

* remove logs

* Add specs

* lint

* review fixes

* simplify by changing `lineHeight` from px to unitless

* make param non-optional

* update comment

* fix: jumping text due to font size being calculated incorrectly

* update line height when font family is updated

* lint

* Add spec

* more specs

* rename to getDefaultLineHeight

* fix getting lineHeight for potentially undefined fontFamily

* reduce duplication

* fix fallback

* refactor and comment tweaks

* fix

---------

Co-authored-by: dwelle <luzar.david@gmail.com>
2023-03-22 11:32:38 +05:30
David Luzar ac4c8b3ca7 fix: chrome crashing when embedding scene on chrome arm (#6383) 2023-03-21 18:48:49 +01:00