excalidraw/src
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
..
actions feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
components feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
css feat: redesign toolbar & tweaks (#4387) 2021-12-15 15:31:44 +01:00
data feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
element feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
excalidraw-app feat: Sync local storage state across tabs when out of sync (#4545) 2022-01-27 13:21:55 +01:00
hooks refactor: rewrite collabWrapper to remove TDZs and simplify (#2834) 2021-01-25 10:47:35 +01:00
locales feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
packages fix: reset unmounted state for the component (#4682) 2022-02-01 16:32:22 +05:30
renderer feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
scene refactor: simplify zoom by removing zoom.translation (#4477) 2022-01-29 21:12:44 +01:00
tests feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
align.ts fix: align and distribute binded text in container and cleanup (#4468) 2021-12-23 17:02:13 +05:30
analytics.ts fix(analytics.ts): add safe check for process so Excalidraw can be loaded via script (#2824) 2021-01-20 21:27:33 +05:30
appState.ts feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
bug-issue-template.js Add sentry integration (#1141) 2020-03-31 11:37:51 +03:00
charts.ts fix: Track the chart type correctly (#2773) 2021-01-13 15:23:14 +02:00
clients.ts feat: allow host to pass color for collaborators (#2943) 2021-02-06 23:33:52 +05:30
clipboard.ts feat: bind text to shapes when pressing enter and support sticky notes 🎉 (#4343) 2021-12-16 21:14:03 +05:30
colors.ts Update ESLint rules (#2342) 2020-11-06 21:06:30 +01:00
constants.ts feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
createInverseContext.tsx refactor: rewrite collabWrapper to remove TDZs and simplify (#2834) 2021-01-25 10:47:35 +01:00
css.d.ts Fix padding in the library loading buttons (#2331) 2020-11-04 11:05:12 +01:00
disitrubte.ts fix: align and distribute binded text in container and cleanup (#4468) 2021-12-23 17:02:13 +05:30
errors.ts fix: abstract and fix legacy fs (#4032) 2021-10-07 13:19:40 +02:00
ga.ts chore: bump Prettier to the latest (#4185) 2021-11-01 15:24:05 +02:00
gadirections.ts Prefer arrow functions (#2344) 2020-11-06 21:06:39 +01:00
galines.ts chore: bump Prettier to the latest (#4185) 2021-11-01 15:24:05 +02:00
gapoints.ts Prefer arrow functions (#2344) 2020-11-06 21:06:39 +01:00
gatransforms.ts Prefer arrow functions (#2344) 2020-11-06 21:06:39 +01:00
gesture.ts fix: stop flooring scroll positions (#2883) 2021-01-31 10:47:43 +01:00
global.d.ts feat: improve library preview image generation on publish (#4321) 2021-11-26 11:46:13 +01:00
groups.ts fix: align and distribute binded text in container and cleanup (#4468) 2021-12-23 17:02:13 +05:30
history.ts fix: selectedGroupIds not being stored in history (#3630) 2021-05-29 21:35:03 +02:00
i18n.ts chore: Update translations from Crowdin (#4322) 2022-01-13 19:06:48 +00:00
index-node.ts feat: image support (#4011) 2021-10-21 22:05:48 +02:00
index.tsx Refactor: convert initializeApp to func component and use JSX transform in the codebase (#4056) 2021-10-14 22:56:51 +05:30
keys.ts feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
math.test.ts Shift loses pointer fixing #1296 (#1330) 2020-04-10 00:14:32 +09:00
math.ts feat: improved freedraw (#3512) 2021-05-09 17:42:10 +02:00
points.ts feat: improved freedraw (#3512) 2021-05-09 17:42:10 +02:00
pwacompat.d.ts Add PWACompat (#1433) 2020-04-16 14:23:39 +02:00
random.ts fix: check if process is defined before using so it works in browser (#4497) 2021-12-28 17:17:41 +05:30
react-app-env.d.ts TS, Prettier, Eslint (#39) 2020-01-02 11:03:48 -08:00
service-worker.js feat: Implement the Web Share Target API (#3230) 2021-03-13 22:42:54 +01:00
serviceWorker.tsx feat: Add rewrite to webex landing page (#4102) 2021-10-26 18:19:41 +05:30
setupTests.ts fix: inline ENV variables when building excalidraw package (#4311) 2021-11-24 16:25:19 +01:00
shapes.tsx fix: support shift+P for freedraw (#4550) 2022-01-08 18:01:22 +05:30
types.ts feat: Support hyperlinks 🔥 (#4620) 2022-02-03 20:34:59 +05:30
utils.ts refactor: simplify zoom by removing zoom.translation (#4477) 2022-01-29 21:12:44 +01:00
zindex.ts fix: bound text not atomic with container when changing z-index (#4414) 2021-12-17 13:10:37 +00:00