Wykres commitów

95 Commity (f281e123f833fd6e3a827c9589a689fd364ad8fc)

Autor SHA1 Wiadomość Data
Steve Ruiz e2a6badaef
[improvement] Adds error boundary (#690)
* Add error boundary

* Update useStyle.tsx

* Update ErrorFallback.tsx
2022-05-18 12:45:04 +01:00
Steve Ruiz c3050db968
[fix] copy and paste (again) (#685)
* fix copy

* remove console logs

* update types
2022-05-14 14:15:55 +01:00
Steve Ruiz c54c800675
[improvement] local copy and export for images (#669)
* local images

use assets for local copy

add menu options

* clean up packages

* cleanup unused content, move file handling into app.paste

* Add tldraw-assets.json to other files.

* add path to editor

* Update build.mjs

* add export to server example with link to gist

* Fix onAssetCreate and onAssetDelete APIs

* Update yarn.lock

* fix bugs on paste, adjust api for getting images, fix readonly on cut, copy, paste

* re-enable swc

* paste svg strings as svg images

* cleanup

* fix string case for tldraw json
2022-05-11 14:25:08 +01:00
Alejandro Durán b4c47a8e74
Added fix for horizontal scroll on mac (#662)
Based onto [this worldanvil whiteboard issue](https://github.com/worldanvil/worldanvil-bug-tracker/issues/969) which is based on tldraw where one of our users noticed that the horizontal scrolling (panning) with the middle mouse didn't worked on macOS.

Tested on different machines and this bug fixes it

Co-authored-by: Alejandro Duran <alejandro@worldanvil.com>
2022-05-05 16:43:02 +01:00
Chen ☁️☁️ 184d8cfd78
[fix] duplicate code (#651) 2022-04-27 14:56:06 +01:00
Enrico 2781aa4e0d
added CAD like behavior like described in issue #555 (#589)
* added cade like behaviour like described in issue #555

* added color change when selecting depending on behavior

* added option to turn on/off cad like selection

* Revert "added color change when selecting depending on behavior"

This reverts commit 4a4aac02b6.

* Remove colors, add perfect dash props, rename setting, move prop to appState

* Reorder menu

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-03-09 10:19:58 +00:00
Yao Wang e43219ded8
fix(import): make sure every shape is in page (#599)
* fix(import): make sure every shape is in page

- only to add the shape is in page shapes
-https://gist.github.com/cangoektas/4a84e2d48f6e2551b8b3a632ae1b4f71

Closes #554

* Update useShapeTree.tsx

* Update useShapeTree.tsx

* Update turbo.json

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-03-02 14:21:14 +00:00
Steve Ruiz 3a08473d85
[improvement] zoom (#577)
* improve zoom events, skip pinch on desktop

* Update useZoomEvents.ts
2022-02-15 12:21:31 +00:00
Steve Ruiz e8dd64baf7
[fix] Multiplayer bugs on text (#571)
* Update StickyUtil.tsx

* Fix sticky text in multiplayer?

* fix text and text label

* Update TextUtil.tsx

* Update TextUtil.tsx

* Fix missing empty content button

* Create tidy-ducks-visit.md

* forcing bump

* Update TextUtil.tsx

* fix resizing

* try again

* don't merge editing ids

* fixed!

* Update utils.ts

* downgrade puppeteer

* change deps

* restore deps

* explicit version

* keep at it

* deps
2022-02-11 21:35:24 +00:00
Steve Ruiz 014bfbc841 bump dependencies 2022-02-03 10:57:03 +00:00
Herb Caudill 372cc690c7
Scroll wheel fixes & enhancements (#501)
* scroll wheel fixes & enhancements

1. correct zoom direction (was reversed)
2. support ctrl+scroll for zoom (in addition to alt+scroll)
3. support shift+scroll for horizontal pan

* Allow two-axis panning

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2022-01-12 14:33:55 +00:00
Steve Ruiz 6a282ca9c2 Bump dependencies, fix bug on mobile, preserve settings. 2022-01-10 21:09:26 +00:00
Steve Ruiz f2481642f9 Fix context menu bug on mobile 2022-01-08 20:08:17 +00:00
Steve Ruiz 9c3424a5fc Update documentation
bump versions

update readmes, licenses
2022-01-07 09:01:08 +00:00
Steve Ruiz 9255e7a4a5 Update useShapeEvents.tsx 2022-01-06 14:01:25 +00:00
Steve Ruiz b1697b2ca7 Fix context menu, fix blur issue 2022-01-06 14:00:23 +00:00
Steve Ruiz d7a697647b
[feature] Labels for shapes (#462)
* Adds generic text label

* Clean up text label / text util

* labels for ellipse and triangles

* Add arrow label

* Update filesystem.ts

* Double click bend to edit label, fix mask location

* refactor arrowutil

* fix arrow bindings

* Rename text to label, add labelPoint

* Fix arrow binding, styles on text labels, double click bounds edge to edit label

* Update ArrowSession.ts

* Update StyleMenu.tsx

* set version
2021-12-27 19:21:30 +00:00
Steve Ruiz d5cd7ed480 bump use-gesture, memoize gesture callbacks 2021-12-27 12:50:18 +00:00
Steve Ruiz 4aa8547a8e
[improvement] performance modes (#463)
* add performance modes to core, sessions

* Update filesystem.ts

* rename TLPerformance to TLPerformanceMode, fix bugs
2021-12-27 12:30:35 +00:00
Faraz Shaikh 1c65c031b2
Add Image and Video shapes (#460)
* Added image and video shapes

* Fixed bugs; Added optional onImageUpload callback

* Added id field to onImageUpload

* Added onImageDelete callback for cleanup

* Added firebase storage to multiplayer for media

* Added firebase storage to multiplayer for media

* Silence unnecessary TS errors

* Fixed bugs; Added tests

* Added tests

* Disable images for multiplayer example

* switch to assets in document, rather than on shapes, fix resize, fix sizes

* bump version, add migration for assets table

* Rename onImageUpload

* Add isPlaying state to video (not complete)

* Revert "Add isPlaying state to video (not complete)"

This reverts commit 3dc2ba703f.

* Adds controls when editing video, sync current time when cloning

* Remove unused tools

* avoid duplication in assets

* Remove unused image styles from style menu

* Fix placement of clone buttons

* Fix flag to hide image assets in multiplayer

* move getSizeFromDataUrl to filesystem

* Update VideoUtil.tsx

* Re-center video after it loads

* Add copy and paste support for assets

* Fix bug in state manager, remove unused assets on load, fix indicators

* Add multiplayer with images example

* Update MultiplayerEditor.tsx

* Add images to copy SVG

* tighten up some code around svg export

* Update TldrawApp.spec.ts

* Update useBoundsHandleEvents.tsx

* Reset image size by double clicking bounds

* fix reset size

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-12-25 17:06:33 +00:00
Thomas Mathisen 4cf283e84f
Bugfix on useShapeEvents wrong key name (#459)
* onPointShape called instead of onPointerDown

* Update useShapeEvents.tsx

* Bugfix on useShapeEvents wrong key name

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-12-22 12:56:49 +00:00
Steve Ruiz e8befe2290 fix leaky ref 2021-12-22 00:40:37 +00:00
Steve Ruiz 4da632d5d8
[improvement] Multiplayer cursors (#458)
* bump versions, improve cursors

* Spline cursors

* Update useCursorAnimation.ts

* Update useCursorAnimation.ts

* Add improved cursors

* Update MultiplayerEditor.tsx

* Update [id].tsx
2021-12-22 00:34:44 +00:00
Steve Ruiz 7c2777966f
[improvement] Multiplayer + cursors (#457)
* bump versions, improve cursors

* Spline cursors
2021-12-22 00:14:38 +00:00
Thomas Mathisen 34492f2f01
Bugfix: onPointerDown not called (#451)
* onPointShape called instead of onPointerDown

* Update useShapeEvents.tsx

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-12-17 16:02:13 +00:00
Elizabeth Louie c5124b160e
add triangle tool (#433)
* add triangle tool

* fix keyboard shortcuts

* cleaned code

* Add binding, better indicator, bounds

* Fix tests

* Refactor getBindingPoint, binding distances, add comments to getBindingPoint

* Update TextUtil.spec.tsx.snap

* fix intersection math

* fix ellipse indicator

* Update EllipseUtil.tsx

* Update BrushSession.spec.ts

* Add draw style to triangle

* improve strokes

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-12-09 22:29:09 +00:00
Steve Ruiz 52ae47371d
[improvement] Select unfilled shapes by clicking on their stroke (#438)
* removes touch events from middle of shapes

* Improve ellipse

* selectable stroke when not selected, fill when selected

* Update BrushSession.spec.ts

* Fix test
2021-12-07 20:48:56 +00:00
Steve Ruiz 0334ac0f30
Fix alt zoom (#424) 2021-12-01 14:25:56 +00:00
Noah Shipley 98cc0d4cac
Feature/mobx - adds mobx support to @tldraw/core (#383)
* Initial commit with mobx

* Convert more to mobx

* Make useCameraCss reactive (autorun)

* Move more items to mobx

* Fix more invalid components and layout hooks that needed to be reactive

* Add autorun to css layout effect

* Remove centric specific yarn.lock changes

* mild cleanup

* update from main

* add tests, example

* cleanup

* minor tweak to advanced example

* Update app.tsx

* Optimizations around events not being memoized

* Support className property on SVGContainer

* Add data-type to shape container to aid with external styling

* Fix classnames

* Fixes bug on text shapes / shapes with refs

* v1.1.9-beta.1

* v1.1.9-beta.2

* Drop mobx as a dependency for core

* v1.1.9-beta.3

* rename

* Revert "Drop mobx as a dependency for core"

This reverts commit 2d93f84a87.

* remove unused code from utils, move curve to separate package

* v1.1.9-beta.4

* Add pretty-quick

* Update package.json

* Renamings

Co-authored-by: Noah Shipley <nshipley@centricsoftware.com>
Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-11-28 10:05:40 +00:00
Christian Petersen e2814943e9
[feature] Add grids (#344)
* [feature] grids

* Shows relative grids at different zoom levels

* Update colors

* Restores vec and intersect to monorepo, changes vec.round to vec.toFixed, adds vec.snap

* Snapping in translate and transforms, fix shortcut

* fix bugs in build

* use grid size for nudge too

* update scripts

* Update grid.tsx

* Update grid.tsx

* Fixed!

* Update grid.tsx

* Fix package imports

* Update Editor.tsx

* Improve tsconfigs, imports

* Fix tiny arrow bugs, snap starting points to grid

* Update tsconfig.base.json

* Update shape-styles.ts

* Fix example tsconfig

* Fix translate type error

* Fix types, paths

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-11-26 15:14:10 +00:00
Proful Sadangi 1f7f779506
feature middle mouse wheel pan (#364) 2021-11-24 10:01:17 +00:00
Steve Ruiz a2fff9dca7
[improvement] Add basic support for copying text (#354)
* Add getSvgElement

* Update TextUtil.tsx

* Add sticky svg

* Fix bounds bug, improve text export

* Include fonts
2021-11-22 16:15:51 +00:00
Steve Ruiz 62803443ef
fix stuck pointer during text editing / palm hits (#316) 2021-11-20 00:05:48 +00:00
Steve Ruiz e6a3e5c3ea
[big chore] restore core to monorepo (#287)
* move core into repo, apps into apps folder, update tests

* Update scripts for build:core

* improve scripts

* remove noise from www

* Update .gitignore

* Fix focus bug

* add ci test script

* Update main.yml
2021-11-18 13:09:18 +00:00
Steve Ruiz 599e6032a9 Removes core (off to its own repo) 2021-10-27 18:52:02 +01:00
Steve Ruiz 2e6c33342d
[refactor] ShapeUtils (#206)
* Starts refactor

* tests passing, got it

* Fix next
2021-10-27 16:15:01 +01:00
Steve Ruiz 8fd9cf8389
[feature] UX preferences (#172)
* Improves snapping util, styles corner buttons, adds preferences

* Update bounds.test.tsx

* Update preferences.tsx

* Update preferences.tsx

* Change copy
2021-10-19 14:29:55 +01:00
Steve Ruiz a7e8fafb96
Adds up and downstream links (#171) 2021-10-19 12:19:56 +01:00
Steve Ruiz 235a57d302 Adds indicator for text, linked translate 2021-10-18 16:59:12 +01:00
Steve Ruiz 0cfc68b004
[feature] snapping (#168)
* defer cloning

* basic snapping

* Improves algorithm for snap points, rendering

* Improves snapping, snaplines

* Enables a clone to snap to its parent

* Adds overlay

* Fix overlay, zoom scaling for distance and speed
2021-10-18 14:30:42 +01:00
Steve Ruiz db62005251
Fix dark theme UI (#161)
* Fix theming

* Cleanup

* Update tldraw.tsx
2021-10-17 06:59:10 +01:00
Steve Ruiz 1ec0434a3c
[improvement] improve performance (#151)
* Remove context menu

* Update stitches elements

* Update yarn.lock

* Fix bug on bounds bg

* Adds timer for will-change

* remove zindex

* jesus christ, just an extra div

* Remove will change timer
2021-10-15 13:49:48 +01:00
Steve Ruiz f8516a2c4a Fix pinching on tools other than select 2021-10-14 17:25:10 +01:00
Steve Ruiz 46c9ac508d
[feature] Side cloning (#149)
* Adds side clone behavior

* Adds tab to clone, fixes wheel

* Fix bug in draw shape

* Passing tests
2021-10-14 16:37:52 +01:00
Steve Ruiz d95a2e83a0 Fix handles when drawing 2021-10-14 14:14:47 +01:00
Steve Ruiz f8cb7f03b6 Adds space panning, tweak css for performance 2021-10-14 13:33:39 +01:00
Steve Ruiz e1c307fd71
[feature] sticky notes (#148)
* Refactor toolbar

* Adds containerRef prop

* Fix arrows for groups

* Adds auto focus

* Notes on blurring

* Upgrades to match main

* Loose ends around sticky notes

* Fixes user select

* Passing tests

* Update sticky.tsx
2021-10-13 17:03:33 +01:00
Steve Ruiz 1408ac2cbe
Refactor tools (#147)
* Refactor Tools

* Update text.tsx

* Passing tests

* Error fixes

* Fix re-selecting tool

* Fix arrow
2021-10-13 14:55:31 +01:00
Steve Ruiz 93827e45dd Adds indicators for selected shapes from other users 2021-10-12 15:59:04 +01:00
Steve Ruiz c49b2e684a
[improvement] stroke appearance (#142)
* make default style small, adjust font sizes and stroke widths

* Reduce size of handle click area

* Make save command+shift+s (just persists)

* Update stroke width for arrow

* Update stroke width for draw

* Update stroke width for ellipse

* Update stroke width for rectangle

* Tweak dash algorithm

* Updates snapshot
2021-10-10 10:41:45 +01:00