excalidraw/src/tests
Aakansha Doshi f47ddb988f
feat: Support hyperlinks 🔥 (#4620)
* 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>
2022-02-03 20:34:59 +05:30
..
__snapshots__ feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
data feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
fixtures feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
helpers refactor: simplify zoom by removing zoom.translation (#4477) 2022-01-29 21:12:44 +01:00
packages feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
queries feat: improved freedraw (#3512) 2021-05-09 17:42:10 +02:00
scene feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
align.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
appState.test.tsx feat: image support (#4011) 2021-10-21 22:05:48 +02:00
binding.test.tsx fix: support collaboration in bound text (#4573) 2022-01-17 17:35:35 +05:30
charts.test.tsx improvement: Support numbers with commas in them (#2636) 2020-12-20 14:08:22 +02:00
clients.test.ts Add user list component + snap to user functionality (#1749) 2020-06-19 12:36:49 +02:00
collab.test.tsx feat: image support (#4011) 2021-10-21 22:05:48 +02:00
contextmenu.test.tsx feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
dragCreate.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
export.test.tsx feat: image support (#4011) 2021-10-21 22:05:48 +02:00
flip.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
geometricAlgebra.test.ts Allow binding linear elements to other elements (#1899) 2020-08-08 21:04:15 -07:00
history.test.tsx feat: image support (#4011) 2021-10-21 22:05:48 +02:00
library.test.tsx feat: Allow publishing libraries from UI (#4115) 2021-11-17 23:53:43 +05:30
move.test.tsx feat: Calculate width/height of canvas based on container dimensions (".excalidraw" selector) & remove props width & height (#3379) 2021-04-04 15:05:16 +05:30
multiPointCreate.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
reconciliation.test.ts chore: Update Typescript to 4.4.4 (#4188) 2021-11-02 14:24:16 +02:00
regressionTests.test.tsx refactor: simplify zoom by removing zoom.translation (#4477) 2022-01-29 21:12:44 +01:00
resize.test.tsx fix: cmd/ctrl native browser behavior blocked in inputs (#4589) 2022-01-13 19:53:22 +01:00
scroll.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
selection.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
test-utils.ts feat: Sync local storage state across tabs when out of sync (#4545) 2022-01-27 13:21:55 +01:00
utils.test.ts hide fill icons when fill color transparent (#2414) 2020-11-26 21:43:38 +01:00
viewMode.test.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
zindex.test.tsx fix: bound text not atomic with container when changing z-index (#4414) 2021-12-17 13:10:37 +00:00