* feat: Add a mid point for linear elements
* fix tests
* show mid point only on hover
* hacky fix :(
* don't add mid points if present and only add outside editor
* improve styling and always show phantom point instead of just on hover
* fix tests
* fix
* only add polyfill for test
* add hover state for phantom point
* fix tests
* fix
* Add Array.at polyfill
* reuse `centerPoint()` helper
* reuse `distance2d`
* use `Point` type
Co-authored-by: dwelle <luzar.david@gmail.com>
* feat: update toast api to account for duration and closable
* fix
* update snaps
* update docs
* male toast nullable
* fix snaps
* remove clearToast from App.tsx and replace clearToast prop in Toast comp with onClose
* support libraryItems promise for `updateScene()` and use `importLibrary`
* fix typing for `getLibraryItemsFromStorage()`
* remove `libraryItemsFromStorage` hack
if there was a point to it then I'm missing it, but this part will be rewritten anyway
* rewrite state handling
(temporarily removed loading states)
* add async support
* refactor and deduplicate library importing logic
* hide hints when library open
* fix snaps
* support promise in `initialData.libraryItems`
* add default to params instead
* naming tweaks
* do not mark local element as duplicate when there's no remote counterpart
* merge instead of overwrite elements when saving to firebase & reconcile local state
* decouple syncing from persistence
* fix ts
* clarify doc
* fix reconciliation not removing duplicates
* fix: image not initialized correctly due to not renewing `state.pendingImageElement`
* ensure we replace elements on update
* set file as errored on >= 400 status respones
* flush queues on portal close
* fix mouse broadcast race condition
* stop mutating image elements when updating status
to fix race condition when closing/opening collab room
* check `files` when resolving `LayerUI`
* fix displaying AbortError
* feat: support exporting json to excalidraw plus
* add Firebase Storage rules to codebase
* factor the onClick handler out
* move excal icon to icons.tsx
* handle export error
* feat: support updating appState in updateScene API
* make `updateScene.data.appState` more type-safe
* restore `appState` when passing to `updateScene`
* fix
Co-authored-by: dwelle <luzar.david@gmail.com>
* feat: dnt share library & attach to the excalidraw instance
* fix
* Add addToLibrary, resetLibrary and libraryItems in initialData
* remove comment
* handle errors & improve types
* remove resetLibrary and addToLibrary and add onLibraryChange prop
* set library cache to empty arrary on reset
* Add i18n for remove/add library
* Update src/locales/en.json
Co-authored-by: David Luzar <luzar.david@gmail.com>
* update docs
* Assign unique ID to
each excalidraw component and remove csrfToken from library as its not needed
* tweaks
Co-authored-by: David Luzar <luzar.david@gmail.com>
* update
* tweak
Co-authored-by: dwelle <luzar.david@gmail.com>
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <luzar.david@gmail.com>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <luzar.david@gmail.com>
* Remove width/height from the ".excalidraw" container so it will sized automatically.
* updated all ref calculation to ".excalidraw" instead of parent since now ".excalidraw" will get resized
* Remove props width/height as its not needed anymore.
* Resize handler is also not needed anymore.
* Position absolute canvas due to #3379 (comment)
* move css to style and remove one extra rerendering
* factor out mock logic for test
* set height, width so as to avoid unnecessary updates of regression snap
* better mock
* better type checking and omit width,height from getDefaultAppState and also restore
* revert
* default to window dimensions in constructor
* update docs
* update
* update
* tweaks
* feat: Add renderCustomStats prop to render extra stats & move storage and version to renderCustomStats
* expose Api to update toast message so single instance of toast is used
* rename to setToastMessage
* update docs