Commit Graph
100 Commits
Author SHA1 Message Date
David LuzarandGitHub dadf054ea2 fix not always generating shape on render (#1741) 2020-06-09 17:36:25 +02:00
David LuzarandGitHub d1be2a5481 fix text constructor groupIds & improve type safety (#1715) 2020-06-06 13:32:43 +02:00
David LuzarandGitHub ff93d95998 Revert "Fix RTL text direction rendering (#1687)" (#1705)
This reverts commit a118bed82f.
2020-06-03 12:12:43 +02:00
14a66956d7 Implement line editing (#1616)
* implement line editing

* line editing with rotation

* ensure adding new points is disabled on point dragging

* fix hotkey replacement

* don't paint bounding box when creating new multipoint

* tweak points style, account for zoom and z-index

* don't persist editingLinearElement to localStorage

* don't mutate on noop points updates

* account for rotation when adding new point

* ensure clicking on points doesn't deselect element

* tweak history handling around editingline element

* update snapshots

* refactor pointerMove handling

* factor out point dragging

* factor out pointerDown

* improve positioning with rotation

* revert to use roughjs for calculating points bounds

* migrate from storing editingLinearElement.element to id

* make GlobalScene.getElement into O(1)

* use Alt for adding new points

* fix adding and deleting a point with rotation

* disable resize handlers & bounding box on line edit

Co-authored-by: daishi <daishi@axlight.com>
2020-06-01 11:35:44 +02:00
David LuzarandGitHub f413bab3de Fix group element removing (#1676) 2020-05-30 13:48:57 -07:00
David LuzarandGitHub 0db7ac78c4 fix fontFamily state updating (#1679) 2020-05-29 21:59:39 +02:00
David LuzarandGitHub 44a88d2d58 Rewrite restore to guard against missing migrations (#1664) 2020-05-28 02:41:34 -07:00
David LuzarandGitHub 4f3bf79708 skip element mutation on noop updates (#1667) 2020-05-28 00:50:56 -07:00
David LuzarandGitHub 5327e8a3dc fix language change not rerendering ui (#1638) 2020-05-27 16:46:11 +02:00
David LuzarandGitHub 63c10743fb split font into fontSize and fontFamily (#1635) 2020-05-27 15:14:50 +02:00
35049e3de7 History tweaks (#1641)
Co-authored-by: Pete Hunt <phunt@twitter.com>
2020-05-24 15:17:14 -07:00
David LuzarandGitHub d2ae18995c add history.shouldCreateEntry resolver (#1622) 2020-05-22 22:26:59 -07:00
David LuzarandGitHub ce6f2ff88c cache nonDeleted elements (#1626) 2020-05-22 10:15:16 -07:00
David LuzarandGitHub 876170ee27 fix snapshots (#1598) 2020-05-14 17:21:37 +02:00
David LuzarandGitHub 39c56a4c01 implement stroke style (#1571) 2020-05-14 17:04:33 +02:00
David LuzarandGitHub 828c9c4d65 use commitToHistory prop for handling draw history (#1595) 2020-05-14 14:51:33 +02:00
David LuzarandGitHub a90ca5eb84 don't use unicode characters for shortcut help (#1565)
* don't use unicode characters for shortcut help

* use option instead of alt

* make shortcut replacement case-insensitive

* improve shortcut dialog layout
2020-05-11 01:29:35 +03:00
David LuzarandGitHub 8c8458ceb0 fix incorrect font rendered on late load (#1555) 2020-05-08 10:42:51 +02:00
David LuzarandGitHub 4aa1784ba3 fix horizontal scroll via shift+wheel on mac (#1528) 2020-05-02 13:15:28 -07:00
David LuzarandGitHub b7a37c157b scroll horizontally on shift-scroll (#1519) 2020-04-30 13:34:38 -07:00
David LuzarandGitHub 51f8146357 disable pointer events on hidden menus in zen mode (#1511) 2020-04-29 22:49:36 +02:00
David LuzarandGitHub 2c5c770e78 rewrite picker color handling (#1487) 2020-04-25 23:06:16 +02:00
David LuzarandGitHub a4b49ea350 ignore fileOpen error when user cancels (#1486) 2020-04-25 09:02:31 -07:00
David LuzarandGitHub 83199164ae don't prevent select-element devTools action (#1446) 2020-04-17 01:18:45 +03:00
David LuzarandGitHub 8cfc64a3ab fix bg color picker rendered behind shape menu (#1445)
* fix bg color picker rendered behind shape menu

* add comment
2020-04-16 21:31:20 +02:00
David LuzarandGitHub 75e0163dd1 tweak blurry bg for legibility & remove from modals (#1436) 2020-04-15 21:20:35 +02:00
David LuzarandGitHub d998a190df persist pointerDown event (#1426) 2020-04-14 12:33:57 +02:00
David LuzarandGitHub 692ceece65 fix not using className when querying container (#1420) 2020-04-13 17:29:11 +02:00
David LuzarandGitHub 0b971ea570 Remove CSP (#1418)
* remove csp

* remove csp from now.json
2020-04-13 16:28:05 +02:00
David LuzarandGitHub 6771b505ad rewrite wysiwyg property updating (#1387)
* rewrite wysiwyg property updating

* reuse existing class

* fix case of focus being stolen by other UIs

* revert mistake csp removal

* ensure we don't run cleanup twice

* fix opacity updating

* add shape actions menu class to constants
2020-04-12 15:57:57 +02:00
David LuzarandGitHub d79c859cd9 CSP: fix codesandbox (#1401)
* add csb to csp whitelist

* add csb.app

* allow child-src csp

* add cdnjs.cloudflare

* allow unsafe-eval
2020-04-12 14:58:03 +02:00
David LuzarandGitHub 3fd6f3023f support newline on shift+enter (#1324) 2020-04-08 20:56:27 +02:00
David LuzarandGitHub 88cec2df5e log console.error to sentry (#1243)
* log console.error to sentry

* fix
2020-04-07 15:54:49 +02:00
David LuzarandGitHub b7230b05d7 add task to update snapshots & update readme (#1302)
* add task to update snapshots & update readme

* remove test:app from readme & tweak
2020-04-07 15:09:01 +02:00
David LuzarandGitHub 729aeacc47 prevent pasting svg copied from excalidraw (#1288)
* prevent pasting svg copied from excalidraw

* remove unnecessary template
2020-04-06 23:02:17 +02:00
David LuzarandGitHub e9b4700bba edit text when clicked on with text tool (#1283) 2020-04-06 22:26:54 +02:00
David LuzarandGitHub d3ed5a42fc fix font being reset to current state font on edit (#1282) 2020-04-06 22:26:00 +02:00
David LuzarandGitHub 81b38d8808 fix wysiwyg event cleanup (#1248) 2020-04-05 22:31:59 +02:00
David LuzarandGitHub 4dd947b261 fix scrollToCenter when no elements supplied (#1222)
* fix scrollToCenter when no elements supplied

* make getCommonBounds return default values on empty elements
2020-04-04 18:45:14 +02:00
David LuzarandGitHub 23540eba4c sync remote selection (#1207)
* sync remote selection

* skip deleted elements

* remove unnecessary condition & change naming
2020-04-04 16:02:16 +02:00
David LuzarandGitHub 3afb4515b6 scroll to content on collab scene init (#1201) 2020-04-03 22:22:26 +03:00
David LuzarandGitHub 036978b837 fix font not rendered on init in FF (#1197) 2020-04-03 22:21:40 +03:00
8dccc793ee add editorconfig (#1198)
* add editorconfig

* Update .editorconfig

Co-Authored-By: Lipis <lipiridis@gmail.com>

* remove duplicate section

Co-authored-by: Lipis <lipiridis@gmail.com>
2020-04-03 19:19:01 +02:00
David LuzarandGitHub 8030a167c6 make text committing cross-platform (#1188) 2020-04-03 15:56:23 +02:00
David LuzarandGitHub 4912a29e75 sync intermediate text updates (#1174)
* sync intermediate text updates

* fix initial render text position

* batch updates

* tweak onChange subscription
2020-04-03 14:16:14 +02:00
David LuzarandGitHub cac2dda5ac Add loading state (#1027)
* add loading state

* update snapshots

* add border radius

* fix comment breaking build jsx
2020-03-26 18:28:26 +01:00
David LuzarandGitHub 6fd2a3b2e5 fix z-index action to account for deleted elems and add tests (#1077) 2020-03-26 00:28:50 -07:00
David LuzarandGitHub 42df058223 load from localStorage only if not in multiplayer (#1074) 2020-03-24 09:57:59 -07:00
David LuzarandGitHub c416de3499 fix lint not failing on warnings on CI (#1063) 2020-03-23 17:20:42 +02:00
David LuzarandGitHub cf4fa30a57 tweak png copy button label (#1062)
* tweak png copy button label

* fix lint
2020-03-23 16:15:22 +01:00
David LuzarandGitHub f6b36519f1 don't pass deleted elements to UI (#1029) 2020-03-20 21:46:09 +01:00
David LuzarandGitHub edd54d93b3 revert #1017 (#1025)
This reverts commit 1546c00c0c.
2020-03-20 16:46:06 +01:00
David LuzarandGitHub fda06e4fc3 Fix history - the 2nd installment (#1014)
* don't regenerate versionNonce on pushEntry

* fix history handling around multi-point arrows

* remove filtering from getElementMap helper
2020-03-19 11:41:32 -07:00
David LuzarandGitHub 82ce068972 fix history (#1009)
* fix history

* tweak withBatchedUpdates typing
2020-03-19 14:51:05 +01:00
David LuzarandGitHub ff033640e4 expose a few state props for debugging (#1008)
* expose a few state props for debugging

* rename h.appState & add h.setState

* support setting elements
2020-03-18 20:44:05 +01:00
David LuzarandGitHub b7da524538 confirm arrow on doubleclick (#949)
* confirm arrow on double click

* change hint

* fix cursor not updating on click
2020-03-18 16:43:06 +01:00
David LuzarandGitHub 254a0753ff fix negative resize for non-multipoint elements (#1000) 2020-03-18 08:34:04 -07:00
David LuzarandGitHub 23b785de68 Trim trailing newlines (#999)
* trim newlines for text elements

* fix comment
2020-03-18 13:01:33 +01:00
David LuzarandGitHub 373d16abe6 improve & granularize ExcalidrawElement types (#991)
* improve & granularize ExcalidrawElement types

* fix incorrectly passing type

* fix tests

* fix more tests

* fix unnecessary spreads & refactor

* add comments
2020-03-17 20:55:40 +01:00
David LuzarandGitHub b9c75b5bc4 use deletedIds map to sync deletions (#936)
* use deletedIds map for sync deletions

* refactor how we create data for syncing

* fix comments

* streamline broadcast API

* split broadcast methods
2020-03-14 21:25:07 +01:00
David LuzarandGitHub c85315650f fix calculating text width for indented text (#930) 2020-03-13 15:10:44 +01:00
David LuzarandGitHub 450a024f5c remove object.fromEntries (#933) 2020-03-13 15:10:24 +01:00
dwelle 642e47bd03 Merge remote-tracking branch 'origin/master' into fix_multiplayer_concurrency 2020-03-12 21:49:54 +01:00
dwelle c04fe403fc don't sync editing elements & prefer local versions 2020-03-12 21:28:58 +01:00
dwelle f1ac8cac32 remove unused selectedId 2020-03-12 20:02:10 +01:00
David LuzarandGitHub 95e726bd6f cancel text via doubleclick when in multiElement mode (#926) 2020-03-12 18:31:53 +01:00
David LuzarandGitHub f0e6f4dbb8 Text esc fixes (#925)
* fix incorrectly resetting state on esc

* confirm text on esc
2020-03-12 18:04:56 +01:00
David LuzarandGitHub 3a5ca27600 fix zero-coalescing roughness (#924) 2020-03-12 17:49:11 +01:00
dwelle 5706dd7ae2 consolidate & align collaboration socket eventing with server 2020-03-12 12:19:56 +01:00
dwelle 96320478e6 remove remote pointers on client disconnect 2020-03-12 10:41:36 +01:00
David LuzarandGitHub 2db2f3f5e4 Collab ui tweaks (#913)
* decrease gap between menu icons

* reduce margin of copy button

* add collaboratorsCount to roomDialog toggle button
2020-03-11 14:48:27 -07:00
b82b0754ac Room dialog (#905)
* support ToolIcon className and fix label padding

* factor some ExportDialog classes out to Modal

* initial RoomDialog prototype

* change label for another-session button

* remove unused css

* add color comments

* Move the collaboration button to the main menu, add support for mobile

* remove button for creating another session

* add locks

* Fix alignment issue

* Reorder button

* reuse current scene for collab session

* keep collaboration state on restore

Co-authored-by: Jed Fox <git@twopointzero.us>
2020-03-11 19:42:18 +01:00
David LuzarandGitHub 13b838117c filter out selection elements on restore (#901)
* filter out selection elements on restore

* add comment
2020-03-10 19:41:41 +01:00
David LuzarandGitHub 5dadbcdcd5 don't set pointer on pointerMove if not already present (#889) 2020-03-09 09:17:26 -07:00
David LuzarandGitHub 3bf3d96d9f make error message more user-friendly (#812)
* make error message more user-friendly

* tweak aria

* override user-select for error splash screen

* localize messages

* fix naming

* log error

* include spaces in i18n
2020-03-09 17:09:45 +01:00
David LuzarandGitHub 463854e42a fix pinch zoom (#885) 2020-03-09 07:19:38 -07:00
David LuzarandGitHub 7e0e885417 ensure restored elements are normalized before filter (#844) 2020-02-27 17:37:43 +01:00
David LuzarandGitHub 8198d71af8 fix svg export (#837) 2020-02-24 21:08:13 +01:00
David LuzarandGitHub 4977593ec4 fix exporting lines as svg (#836) 2020-02-24 18:30:21 +01:00
David LuzarandGitHub 4b8b9965c2 fix early return from renderScene (#815) 2020-02-23 21:19:27 +01:00
David LuzarandGitHub 80a49e9611 improve error handling & map stack trace (#809)
* improve error handling & map stack trace

* log error message and tweak

* support logging multiple errors

* move dynamic import inside try/catch
2020-02-22 22:37:04 +01:00
David LuzarandGitHub 9439908b92 use a better cloning algorithm (#753)
* use a better cloning algorithm

* Revert "use a better cloning algorithm"

This reverts commit 7279262129.

* implement custom cloning algorithm

* add tests

* refactor

* don't copy canvas & ignore canvas in related ops

* fix tests
2020-02-19 22:28:11 +01:00
David LuzarandGitHub 2d22ffda49 fix wheel zoom step (#771) 2020-02-16 16:23:56 +01:00
David LuzarandGitHub 6dd3620dd6 fix cloning element.points (#744) 2020-02-09 23:57:14 +01:00
David LuzarandGitHub 2a472bb912 ensure duplicateElement does deep copy of points (#742) 2020-02-09 14:45:21 -08:00
David LuzarandGitHub 389e40900c z-index button fixes (#738)
* fix svg attributes

* center z-index icons

* remove unnecessary attributes

* differentiate button :active bg

* prevent selection of ToolIcon hints

* emphasize active elem color
2020-02-09 17:09:21 +01:00
David LuzarandGitHub d79293de06 move footer into layerUI & refactor ActionManager (#729) 2020-02-07 23:46:19 +01:00
David LuzarandGitHub 88eacc9da7 Improve pasting (#723)
* switch to selection tool on paste

* align pasting via contextMenu with pasting from event

* ensure only plaintext can be pasted

* fix findShapeByKey regression

* simplify wysiwyg pasting

* improve wysiwyg blurriness
2020-02-07 18:42:24 +01:00
David LuzarandGitHub 3b20e6e2b8 fix decoding imported data from backend (#722) 2020-02-06 18:46:26 +01:00
David LuzarandGitHub 972d69da6c fix hotkeys not working when non-writable input focused (#717) 2020-02-05 19:07:53 +01:00
David LuzarandGitHub 82eb97462b fix restoring from localStorage (#715) 2020-02-05 17:57:08 +01:00
David LuzarandGitHub b7a6ceba68 Eslint tweaks (#696)
* make eslint styleguide into warnings & drop no-else-return

* reintroduce max-warnings=0

* remove unnecessary eslint line disable

* reintroduce no-else-return rule
2020-02-05 17:41:14 +01:00
David LuzarandGitHub 954d805cb3 rewrite clipboard handling (#689) 2020-02-04 11:50:18 +01:00
David LuzarandGitHub 3d2e59bfed Revert "Feature: Multi Point Arrows (#338)" (#634)
This reverts commit 16263e942b.
2020-01-31 18:56:55 +01:00
David LuzarandGitHub 6886dfdea7 ensure we reset draggingElement when tool locked (#627) 2020-01-30 22:14:40 +01:00
David LuzarandGitHub bd1c00014b fix not resuming recording (#614) 2020-01-30 15:39:17 +01:00
David LuzarandGitHub 023400c3cc Revert "Fix keyboard shortcut (#587)" (#617)
This reverts commit cc3d71f13c.
2020-01-30 10:40:49 +01:00
David LuzarandGitHub 26048ee469 improve clipboard handling (#596)
* improve clipboard handling

* fix regression of not defocusing tool icons
2020-01-27 22:14:35 +01:00
David LuzarandGitHub 187cfbe2d8 temp hack fix for state updates (#593)
* temp hack fix state updates

* switch setTimeout for state mutation
2020-01-27 19:24:11 +01:00
David LuzarandGitHub 61264ee2d6 move title to label (#584) 2020-01-26 20:49:18 +01:00