* feat: Support hypelinks
* dont show edit when link not present
* auto submit on blur
* Add link button in sidebar and do it react way
* add key to hyperlink to remount when element selection changes
* autofocus input
* remove click handler and use pointerup/down to show /hide popup
* add keydown and support enter/escape to submit
* show extrrnal link icon when element has link
* use icons and open link in new tab
* dnt submit unless link updated
* renamed ffiles
* remove unnecessary changes
* update snap
* hide link popup once user starts interacting with element and show again only if clicked outside and clicked on element again
* render link icon outside the element
* fix hit testing
* rewrite implementation to render hyperlinks outside elements and hide when element selected
* remove
* remove
* tweak icon position and size
* rotate link icon when element rotated, handle zooming and render exactly where ne resize handle is rendered
* no need to create a new reference anymore for element when link added/updated
* rotate the link image as well when rotating element
* calculate hitbox of link icon and show pointer when hovering over link icon
* open link when clicked on link icon
* show tooltip when hovering over link icon
* show link action only when single element selected
* support other protocols
* add shortcut cmd/ctrl+k to edit/update link
* don't hide popup after submit
* renderes decreased woo
* Add context mneu label to add/edit link
* fix tests
* remove tick and show trash when in edit mode
* show edit view when element contains link
* fix snap
* horizontally center the hyperlink container with respect to elemnt
* fix padding
* remove checkcircle
* show popup on hover of selected element and dismiss when outside hitbox
* check if element has link before setting popup state
* move logic of auto hide to hyperlink and dnt hide when editing
* hide popover when drag/resize/rotate
* unmount during autohide
* autohide after 500ms
* fix regression
* prevent cmd/ctrl+k when inside link editor
* submit when input not updated
* allow custom urls
* fix centering of popup when zoomed
* fix hitbox during zoom
* fix
* tweak link normalization
* touch hyperlink tooltip DOM only if needed
* consider 0 if no offsetY
* reduce hitbox of link icon and make sure link icon doesn't show on top of higher z-index elements
* show link tooltip only if element has higher z-index
* dnt show hyperlink popup when selection changes from element with link to element with no link and also hide popover when element type changes from selection to something else
* lint: EOL
* fix link icon tooltip positioning
* open the link only when last pointer down and last pointer up hit the link hitbox
* render tooltip after 300ms delay
* ensure link popup and editor input have same height
* wip: cache the link icon canvas
* fix the image quality after caching using device pixel ratio yay
* some cleanup
* remove unused selectedElementIds from renderConfig
* Update src/renderer/renderElement.ts
* fix `opener` vulnerability
* tweak styling
* decrease padding
* open local links in the same tab
* fix caching
* code style refactor
* remove unnecessary save & restore
* show link shortcut in help dialog
* submit on cmd/ctrl+k
* merge state props
* Add title for link
* update editview if prop changes
* tweak link action logic
* make `Hyperlink` compo editor state fully controlled
* dont show popup when context menu open
* show in contextMenu only for single selection & change pos
* set button `selected` state
* set contextMenuOpen on pointerdown
* set contextMenyOpen to false when action triggered
* don't render link icons on export
* fix tests
* fix buttons wrap
* move focus states to input top-level rule
* fix elements sharing `Hyperlink` state
* fix hitbox for link icon in case of rect
* Early return if hitting link icon
Co-authored-by: dwelle <luzar.david@gmail.com>
* feat: support unbinding text
* fix unbound text
* move the unbind option next to group action
* use boundTextElement.id when unbinding
* update original text so it takes same bounding box when unbind
* Add spec
* recompute measurements when unbinding
* 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
* Allow updating name on updateScene
* Revert "Allow updating name on updateScene"
This reverts commit 4e07a608d38a585e0f3c04e26b9f5e0e404824b1.
* Make requested changes
* Make requested changes
* Remove customName from state
* Remove redundant if statement
* Add tests, update changelog and minor fixes
* remove eempty lines
* minor fixes
* no border and on hover no background change
* Give preference to name prop when initialData.appState.name is present and update specs
* minor fix
* Fix name input style in dark mode
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
* fix: pass default value for grid mode / zen mode so it sets the value from initialData appState
fixes#2870
* change checked from boolean to be a function which recieves appState and returns boolean
* fix
* use clsx
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: Maximilian Massing <maximilian.massing@googlemail.com>
Co-authored-by: Sven Kube <github@sven-kube.de>
Co-authored-by: Maximilian Massing <massing@sipgate.de>
* feat: calculate coords based on parent left and top so it renders correctly in host App
* fix text
* move offsets to state & fix bugs
* fix text jumping
* account for zoom in textWysiwyg & undo incorrect offsetting
Co-authored-by: dwelle <luzar.david@gmail.com>
* Implement Save without re-prompt and Save as
Fixes#1668
* Add save-as icon
* Make .excalidraw the default extension
* Only show save as button on supporting browsers
* add zoom center action button
* enhance zoom calculation and scroll to center
* add zoom out and center button
* filter deleted elements
* improve complexity
* add key shortcut
* calculate zoom value
* don't render zoomCenter action
* offset from top to account for shape menu
* change shortcut & add to shortcut dialog
* decrease offset
* revert offset
* change hotkey & description
* rename to zoomToFit
* change shortcut label & position
Co-authored-by: dwelle <luzar.david@gmail.com>
* feat: add the ability to change the alignement of the text
* test: update the snapshots to included the newely textAlign state
* style: use explicit key assignment to object
* test: add missing new key textAlign to newElement.test.ts
* style: make the text on the buttons start with uppercase
* Update src/locales/en.json
* add types
* add migration
* remove incorrect update
Co-authored-by: Youness Fkhach <younessfkhach@porotonmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons
* Create variables for the ToolIcon colors
* Darken the menu buttons when they’re active
* Put the more intensive test in `perform`
* Fix & restyle hint viewer
* Add pinch zoom for macOS Safari
* Chrome/Firefox trackpad pinch zoom
* openedMenu → openMenu
* needsShapeEditor.ts → showSelectedShapeActions.ts
* Call showSelectedShapeActions