2451 Commits

Author SHA1 Message Date
David Luzar
c3f6d6d344
test: revert node v16 requirement for tests (#4737) 2022-02-07 12:27:31 +01:00
David Luzar
339636caab
feat: allow any precision when zooming (#4730) 2022-02-06 21:58:59 +01:00
David Luzar
08115ef311
fix: Apple Pen missing strokes (#4705) 2022-02-06 20:07:37 +01:00
Excalidraw Bot
e68abdbab4
chore: Update translations from Crowdin (#4590) 2022-02-06 18:08:55 +01:00
David Luzar
8aff076782
feat: throttle pointermove events per framerate (#4727) 2022-02-06 17:45:37 +01:00
zsviczian
96de887cc8
fix: freedraw slow movement jittery lines (#4726)
Co-authored-by: David Luzar <luzar.david@gmail.com>
2022-02-06 17:45:23 +01:00
zsviczian
98ea46664c
fix: Disable three finger pinch zoom in penMode (#4725) 2022-02-06 16:56:52 +01:00
Aakansha Doshi
00e30ca0e4
fix: remove click listener for opening popup (#4700)
* fix: remove click listener for oening popup

* fix
2022-02-04 20:36:21 +05:30
David Luzar
de6371aac4
fix: link popup position not accounting for offsets (#4695) 2022-02-03 17:00:00 +01:00
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
zsviczian
59cbf5fde5
fix: penMode darkmode style (#4692) 2022-02-03 00:09:59 +01:00
zsviczian
4486fbc2c6
feat: Added penMode for palm rejection (#4657)
Co-authored-by: dwelle <luzar.david@gmail.com>
2022-02-02 14:31:38 +01:00
Aakansha Doshi
edfbac9d7d
feat: support unbinding bound text (#4686)
* 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
2022-02-01 20:11:24 +05:30
rulikrulit
719ae7b72f
fix: reset unmounted state for the component (#4682)
* Reset unmounted state for the component

* update changelog

Co-authored-by: ad1992 <aakansha1216@gmail.com>
2022-02-01 16:32:22 +05:30
David Luzar
631a228ca1
fix: typing _+ in wysiwyg not working (#4681) 2022-01-31 14:29:42 +01:00
David Luzar
4b5270ab12
fix: keyboard-zooming in wysiwyg should zoom canvas (#4676) 2022-01-31 10:43:03 +01:00
dwelle
dcee594b66 remove forgotten debug statements 2022-01-29 22:07:09 +01:00
David Luzar
79d323fab1
refactor: simplify zoom by removing zoom.translation (#4477) 2022-01-29 21:12:44 +01:00
zsviczian
e4edda4555
fix: sceneCoordsToViewportCoords, jumping text when there is an offset (#4413) (#4630)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
Co-authored-by: David Luzar <luzar.david@gmail.com>
Co-authored-by: thxnder <tswwe@qq.com>
2022-01-29 14:27:03 +01:00
Aakansha Doshi
ca89d47d4c
feat: Sync local storage state across tabs when out of sync (#4545)
Co-authored-by: dwelle <luzar.david@gmail.com>
2022-01-27 13:21:55 +01:00
Aakansha Doshi
18c526d877
feat: support contextMenuLabel to be of function type to support dynmaic labels (#4654) 2022-01-27 17:47:23 +05:30
dependabot[bot]
cbc6bd1ad8
chore(deps): bump nanoid in /src/packages/excalidraw (#4628)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.23 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.23...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 14:46:28 +05:30
dependabot[bot]
83d9282dbf
chore(deps): bump nanoid from 3.1.23 to 3.2.0 in /src/packages/utils (#4629)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.23 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.23...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 14:46:03 +05:30
Aakansha Doshi
abff780983
perf: cache approx line height in textwysiwg (#4651) 2022-01-25 17:01:12 +05:30
zsviczian
c009e03c8e
fix: Right-click object menu displays partially off-screen (#4572) (#4631) 2022-01-23 17:28:38 +01:00
Aakansha Doshi
24bf4cb5fb
fix: support collaboration in bound text (#4573)
* fix: support collaboration in bounded text

* align implementation irrespective of collab/submit

* don't wrap when submitted

* fix

* tests: exit editor via ESCAPE instead to remove async hacks

* simplify and remove dead comment

* remove mutating coords in submit since its taken care in updateWysiwygStyle

Co-authored-by: dwelle <luzar.david@gmail.com>
2022-01-17 17:35:35 +05:30
dependabot[bot]
0850ab0dd0
chore(deps-dev): bump @babel/plugin-transform-runtime (#4577)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.4 to 7.16.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.8/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 12:36:53 +05:30
dependabot[bot]
a7473169ba
chore(deps-dev): bump webpack-dev-server in /src/packages/excalidraw (#4595)
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.7.2 to 4.7.3.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.7.2...v4.7.3)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 12:36:40 +05:30
dependabot[bot]
f6325b1e5e
chore(deps-dev): bump webpack in /src/packages/utils (#4602)
Bumps [webpack](https://github.com/webpack/webpack) from 5.65.0 to 5.66.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.65.0...v5.66.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 12:36:26 +05:30
dependabot[bot]
466220a3a8
chore(deps): bump nanoid from 3.1.30 to 3.1.32 (#4607)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.1.32.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.1.32)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 12:36:07 +05:30
dependabot[bot]
d9cc7d1033
chore(deps): bump follow-redirects from 1.14.6 to 1.14.7 in /src/packages/excalidraw (#4609)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-16 10:31:04 +01:00
dependabot[bot]
c037e9854c
chore(deps): bump follow-redirects from 1.13.3 to 1.14.7 (#4593)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-16 10:30:24 +01:00
Excalidraw Bot
9373961857
chore: Update translations from Crowdin (#4322)
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
2022-01-13 19:06:48 +00:00
David Luzar
1fd2fe56ee
fix: cmd/ctrl native browser behavior blocked in inputs (#4589)
* fix: cmd/ctrl native browser behavior blocked in inputs

* add basic test for fontSize increase/decrease via keyboard

* add tests for fontSize resizing via keyboard outside wysiwyg

* Update src/element/textWysiwyg.test.tsx

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>

* Update src/tests/resize.test.tsx

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>

* Update src/tests/resize.test.tsx

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
2022-01-13 19:53:22 +01:00
Aakansha Doshi
dba71e358d
fix: use cached width when calculating min width during resize (#4585) 2022-01-13 21:35:38 +05:30
David Luzar
1ef287027b
fix: support collaboration in bounded text (#4580) 2022-01-12 23:21:45 +01:00
David Luzar
a51ed9ced6
feat: support decreasing/increasing fontSize via keyboard (#4553)
Co-authored-by: david <dw@dw.local>
2022-01-12 15:21:36 +01:00
dependabot[bot]
4501d6d630
chore(deps-dev): bump @babel/preset-env in /src/packages/utils (#4510)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.4 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-12 15:33:05 +05:30
Aakansha Doshi
92a5936c7f
fix: port for collab server and update docs (#4569) 2022-01-11 18:40:09 +05:30
Aakansha Doshi
50bd5fbae1
fix: don't mutate the bounded text if not updated when submitted (#4543)
* fix: don't mutate the bounded text if not updated when submitted

* dont update text for bounded text unless submitted

* add specs

* use node 16

* fix

* Update text when editing and cache prev text

* update prev text when props updated

* remove only

* type properly and remove unnecessary type checks

* cache original text and compare with editor value to fix alignement issue after editing and add specs

* naming tweak

Co-authored-by: dwelle <luzar.david@gmail.com>
2022-01-11 16:36:08 +05:30
dependabot[bot]
62bead66d7
chore(deps-dev): bump typescript in /src/packages/excalidraw (#4432)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.3 to 4.5.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.3...v4.5.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:40:14 +05:30
dependabot[bot]
b3073984b3
chore(deps-dev): bump @babel/core in /src/packages/excalidraw (#4513)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.0 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:40:01 +05:30
dependabot[bot]
3c9ee13979
chore(deps-dev): bump autoprefixer in /src/packages/excalidraw (#4554)
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.0 to 10.4.2.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.0...10.4.2)

---
updated-dependencies:
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:39:42 +05:30
dependabot[bot]
228c8136cf
chore(deps-dev): bump mini-css-extract-plugin (#4555)
Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 2.4.5 to 2.4.6.
- [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.4.5...v2.4.6)

---
updated-dependencies:
- dependency-name: mini-css-extract-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:39:29 +05:30
dependabot[bot]
324dd460c8
chore(deps-dev): bump lint-staged from 12.1.4 to 12.1.7 (#4557)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.1.4 to 12.1.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v12.1.4...v12.1.7)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:38:48 +05:30
dependabot[bot]
d8ea085a94
chore(deps): bump sass from 1.45.2 to 1.47.0 (#4561)
Bumps [sass](https://github.com/sass/dart-sass) from 1.45.2 to 1.47.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.45.2...1.47.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:38:20 +05:30
dependabot[bot]
adbd486f32
chore(deps): bump @tldraw/vec from 1.4.0 to 1.4.3 (#4562)
Bumps [@tldraw/vec](https://github.com/tldraw/tldraw) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/tldraw/tldraw/releases)
- [Commits](https://github.com/tldraw/tldraw/compare/v1.4.0...v1.4.3)

---
updated-dependencies:
- dependency-name: "@tldraw/vec"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 12:38:08 +05:30
Arun
0a89c4b0c8
fix: prevent canvas drag while editing text (#4552) 2022-01-08 23:50:25 +01:00
Aakansha Doshi
c03845bac3
fix: support shift+P for freedraw (#4550)
* fix: support shift+P for freedraw

* newline

* show shift+p first
2022-01-08 18:01:22 +05:30
David Luzar
d5a6014076
fix: prefer spreadsheet data over image (#4533) 2022-01-07 23:18:04 +01:00