Wykres commitów

2889 Commity (mime/sticky-empty-mobile)

Autor SHA1 Wiadomość Data
Steve Ruiz 039e709b61 Merge branch 'main' into mime/sticky-empty-mobile 2024-04-10 11:21:56 +01:00
Steve Ruiz 6305e83830
Fix some tests (#3403)
This PR fixes some jest test.

- We skip the culling shapes in test environments.
- We skip rendering patterns in test environments.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `tests` — Changes to any test code
2024-04-09 15:42:54 +00:00
Steve Ruiz 3b98e36914
Perf: throttle `updateHoveredId` (#3419)
This PR throttles the `updateHoveredId` call so that it happens ever
30ms.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Release Notes

- Improves canvas performance by throttling the update to the editor's
hovered id.
2024-04-09 15:33:07 +00:00
Steve Ruiz 988dbbde28
Fix text bug on iOS (#3423)
In this PR, we no longer buffer pointer down/ups. We now batch only
`pointer_move`, `wheel`, and `pinch` events.

Batched inputs were causing text not to work on iOS. On iOS, the
keyboard is only shown if we call `focus` during the same event loop as
a user input.

### Change Type
- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix

### Test Plan

1. Use text on iOS.
2024-04-09 15:30:33 +00:00
Mime Čuvalo 15b68b285d
textfields: on mobile edit->edit, allow going to empty geo 2024-04-09 17:23:21 +02:00
Steve Ruiz dadb57edcd
Perf: block hit tests while moving camera (#3418)
This PR uses an element that prevents hit tests on shapes while the
camera is moving.


https://github.com/tldraw/tldraw/assets/23072548/9905f3d4-ba64-4e4d-ae99-194f513eaac8

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features


### Test Plan

1. Move the camera.
2. Interact with the canvas.
3. Zoom in and out.

### Release Notes

- Improves performance of canvas while the camera is moving.
2024-04-09 14:34:24 +00:00
Lu Wilson eabcb22b6e
Allow "kickout" on every shape, not just frames, and add drag-and-drop example (#3406)
> Stacked on top of https://github.com/tldraw/tldraw/pull/3405

> This doesn't need to land for the stickies release. We can merge it
afterwards. It's the last bit of work on my 'parenting' spike.

This PR makes `kickoutOccludedShapes` shape-agnostic. It now runs on any
shape that opts-in to the drag and drop manager by having an
`onDragShapesOut` method. This is more of a bug fix than a feature, but
some people might be relying on the bug.

This PR also adds an example for drag and drop.


https://github.com/tldraw/tldraw/assets/15892272/15b66be4-75bd-4c30-a594-340415bc5896


### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add a brief release note for your PR here.

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-04-09 14:47:08 +01:00
Steve Ruiz 3f64bf8c5b
Perf: slightly faster `getShapeAtPoint` (#3416)
This PR makes a small improvement to the speed of `getShapeAtPoint`. It
removes `Editor.getCurrentPageRenderingShapesSorted`.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features
2024-04-09 12:57:46 +00:00
Steve Ruiz 3f33f98434
Stickies: Emit `text-select-all` event (#3412)
This PR adds a `select-all-text` event that the editor emits when it
intends for the editing shape's text to be selected. This replaces some
temporary code that would query the shape's textarea element directly.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

### Test Plan

For geo shapes / arrows / note shapes (any shape with a label):
1. Press enter to select all of its text.
2. Double click the shape to select all of its text
3. Select a text shape and press enter
2024-04-09 12:19:17 +01:00
Mime Čuvalo eb41b36ede
textfields: allow edit→edit to persist in empty geo; also increase hit target area (#3409)
two things this PR does to enable better text editing on Geo shapes:
- when a geo shape is empty (no text), allow edit→edit to continue
(simple change of isEditing→isEditingAnything)
- relatedly, increase the geometry size of an empty text label on geo
shapes. This brings it inline with the text geometry of the new stickies
so that they're consistent.

before:
<img width="605" alt="Screenshot 2024-04-09 at 09 58 50"
src="https://github.com/tldraw/tldraw/assets/469604/a31aed14-4c55-41e0-9706-98ff8b74252e">


after:
<img width="581" alt="Screenshot 2024-04-09 at 09 58 39"
src="https://github.com/tldraw/tldraw/assets/469604/d8812900-3f6d-4188-80b3-fda0f33ac340">


### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-09 11:27:08 +01:00
Mime Čuvalo fd908c02d7
textfields: paste text content onto selected shape (#3410)
If there's a text on the clipboard, we now would allow that text to go
into the shape itself instead of creating a new shape.

before:


https://github.com/tldraw/tldraw/assets/469604/6b8db088-f640-4527-8730-e7e176894e8f


after:


https://github.com/tldraw/tldraw/assets/469604/96c854e0-a11b-4a31-837b-5bef48e10dcd



Linear issue: TLD-2365

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-09 10:12:43 +01:00
Mime Čuvalo 994b0f8baa
textfields: only do pointer capture when not editing (#3407)
Fixes https://linear.app/tldraw/issue/TLD-2374/can-lose-focus-and-caret

#focus-issues #blood-moat

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-09 08:49:24 +01:00
Mime Čuvalo 4a5068f681
move editing shape indicator to the original spot - fix TLD-2377 2024-04-09 09:33:22 +02:00
Mime Čuvalo 346cabdd6f
lint 2024-04-08 17:22:15 +02:00
Mime Čuvalo a250e92830
merge 2024-04-08 16:52:11 +02:00
Mime Čuvalo 16bcad49d6
Merge branch 'main' into stickies-rc 2024-04-08 16:49:45 +02:00
Mime Čuvalo a709032c93
textfields: also let draw shapes not be in the way of text editing (#3404)
Draw shapes shouldn't get in the way when going from
EditingShape→EditingShape. They don't feel like they have the same
occlusion rules. Hard to see in the gifs below but the geometry is
occluding the sticky underneath like so:

<img width="588" alt="Screenshot 2024-04-08 at 16 39 51"
src="https://github.com/tldraw/tldraw/assets/469604/2559725c-4706-43ae-9f7f-4961bd99471f">


before


https://github.com/tldraw/tldraw/assets/469604/04e760a6-70e7-48d8-89b0-b481193be7be




after


https://github.com/tldraw/tldraw/assets/469604/f9b2ecdd-d844-4d11-9bf2-c28d97751fbb



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-08 15:40:25 +01:00
Lu Wilson 7a1111bd1e
Remove more note parenting code (#3402)
This PR removes some extras that were used for note parenting.
 
### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add a brief release note for your PR here.
2024-04-08 15:21:14 +01:00
Mitja Bezenšek 5347c5f30e
Add two simple perf helpers. (#3399)
Can be useful for ad-hoc measure of performance. One is a method
decorator, which can be use on methods like so:

```typescript
  @measureDuration
  someLongRunningProccess() {
  // ....
  }
```

And the other offer more granular control. It also returns what the
callback returns, so it can be use in assignments / return statements.

```typescript
return measureCbDuration('sorting took', () =>  renderingShapes.sort(sortById))
```


### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [x] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-08 13:41:09 +00:00
Steve Ruiz fb2d3b4372
Perf: (slightly) faster min dist checks (#3401)
This PR improves a bunch of places where we do "minimum distance
checks". Previously, we were using `Vec.Dist`, which uses `Math.hypot`
to find the actual distance, but we can just as well use the squared
distance. So this PR makes a small improvement to `Vec.Dist2` and then
switches to that method when checking minimum distances.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features


### Test Plan

- [x] Unit Tests

### Release Notes

- Performance: small improvements to hit testing.
2024-04-08 13:31:05 +00:00
Mime Čuvalo 2d2e4ea685
need a min-width/min-height when blank note to make editing easier 2024-04-08 15:12:35 +02:00
Steve Ruiz 2929816e32
Stickies: fast adjacent note positions check (#3400)
This PR improves the speed of pit checking at the start of a
translation.

Before (1000 shapes):
<img width="385" alt="image"
src="https://github.com/tldraw/tldraw/assets/23072548/ede999f2-a82f-4278-bec8-edf8b59a524e">

After (1000 shapes):
<img width="360" alt="image"
src="https://github.com/tldraw/tldraw/assets/23072548/bd91c38b-1507-4475-92ff-fc75bffbf484">


### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features
2024-04-08 13:22:45 +01:00
Mime Čuvalo cddbae5e39
Revert "stickies: translucency, sometimes"
This reverts commit 2a263fba4c.
2024-04-08 14:05:18 +02:00
Mitja Bezenšek 947f7b1d76
[culling] Improve setting of display none. (#3376)
Small improvement for culling shapes. We now use reactor to do it. .

Before:

![image](https://github.com/tldraw/tldraw/assets/2523721/7f791cdd-c0e2-4b92-84d1-8b071540de10)

After:

![image](https://github.com/tldraw/tldraw/assets/2523721/ca2e2a9e-f9f6-48a8-936f-05a402c1e7a2)


### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-08 11:36:12 +00:00
Mime Čuvalo 63f4059938
Revert "textfields: fix Safari cursor rendering bug (#3373)"
This reverts commit bd433483b0.
2024-04-08 12:25:35 +02:00
Orion Reed 86403c1b0d
Fix typo in Store.ts (#3385)
An immense contribution, I know.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ x ] `docs` — Changes to the documentation, examples, or templates.

<!--  Please select a 'Type' label ️ -->

- [ x ] `chore` — Updating dependencies, other boring stuff
2024-04-08 08:06:24 +00:00
Mime Čuvalo 09bf33f9fa
textfields: fix cursor position on mobile in EditingShape (#3374)
On mobile, cursor position wasn't going to the right place when using
the EditingShape→EditingShape transition.

Before


https://github.com/tldraw/tldraw/assets/469604/9487d741-684b-4562-b1c2-7ea8f89a3a56

After


https://github.com/tldraw/tldraw/assets/469604/f828e1ce-0315-4393-be50-c31888e25f3a



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-06 23:05:02 +01:00
Mime Čuvalo bd433483b0
textfields: fix Safari cursor rendering bug (#3373)
There seems to be a Webkit bug with the cursor not initially being
visible sometimes, especially when the page first loads.
This ain't pretty but it's a not-too-hacky way of "shaking" the cursor
awake.

Before:


https://github.com/tldraw/tldraw/assets/469604/ca66c7d1-8b34-498a-a827-4f7725ab85dd


After:


https://github.com/tldraw/tldraw/assets/469604/93d0f190-b586-496c-a416-0c726ac51858




### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-06 23:04:09 +01:00
Steve Ruiz 001cfa33c9 remove parenting tests, skip auto edit tests 2024-04-06 22:57:32 +01:00
Steve Ruiz c840acdca5 fix long press bug 2024-04-06 22:52:17 +01:00
Steve Ruiz a16ac3e9db Update DefaultHandle.tsx 2024-04-06 22:50:10 +01:00
Steve Ruiz 5f0e2197bf show selection box while editing 2024-04-06 22:44:02 +01:00
Steve Ruiz d45cfe0b0b remove bring to front 2024-04-06 22:41:28 +01:00
Steve Ruiz f1da5ab361 Merge branch 'main' into stickies-rc 2024-04-06 22:40:03 +01:00
Steve Ruiz 4b04a51a12 Update DefaultCanvas.tsx 2024-04-06 22:38:46 +01:00
Steve Ruiz 5aa64a1460
Remove note parenting (#3384)
This PR removes the ability for notes to accept children. It keeps all
of the other improvements to dragging / dropping / etc.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `feature` — New feature
2024-04-06 22:34:30 +01:00
Steve Ruiz 62d90a797e
[stickies] feature flag edit on type (#3383)
This PR removes edit on type. A noble ambition, perhaps feature flag?

### Change Type
- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features
2024-04-06 22:31:21 +01:00
Mime Čuvalo b14b61e7fb
textfields: need to select on pointer down when in EditingShape, not later (#3372)
A long press was causing the wrong shape to be selected on mobile. We
need to set the right selection on pointer down not on up.

before


https://github.com/tldraw/tldraw/assets/469604/610f5dc8-a619-419a-9e4d-db1c3af767da

after


https://github.com/tldraw/tldraw/assets/469604/8ff16119-5850-403a-89f3-a113408d3816



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-06 22:18:42 +01:00
Mitja Bezenšek d01a2223be
Fix an issue with layers when moving shapes. (#3380)
https://github.com/tldraw/tldraw/assets/2523721/d35b5e41-5270-4fad-8f9e-f8d7ac46558c



https://github.com/tldraw/tldraw/assets/2523721/2e1d1f54-f980-437d-aa51-f598b59d56b9



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-05 19:09:07 +00:00
Steve Ruiz 97b5e4093a
[culling] minimal culled diff with webgl (#3377)
This PR extracts the #3344 changes to a smaller diff against main. It
does not include the changes to how / where culled shapes are
calculated, though I understand this could be much more efficiently
done!

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features

---------

Co-authored-by: Mitja Bezenšek <mitja.bezensek@gmail.com>
2024-04-05 18:03:22 +00:00
Steve Ruiz 4d32a38cf8
put `getCurrentPageId` into a computed (#3378)
This PR makes the `getCurrentPageId` method use a computed. Previously,
anything that referenced the current page id would pick up any change to
instance state. This will help a bunch of interactions like brushing
that would update the instance state on every frame.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `improvement` — Improving existing features
2024-04-05 16:02:11 +00:00
Mitja Bezenšek f1e0af7631
Display none for culled shapes (#3291)
Comparing different culling optimizations:


https://github.com/tldraw/tldraw/assets/2523721/0b3b8b42-ed70-45b7-bf83-41023c36a563

I think we should go with the `display: none` + showing the skeleteon.
The way it works is:
- We now add a sibling to the shape wrapper div which serves as the
skeleton for the culled shapes.
- Only one of the two divs (shape wrapper and skeleton div) is
displayed. The other one is using `display: none` to improve
performance.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [x] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


- Improve performance of culled shapes by using `display: none`.

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-04-05 13:23:02 +00:00
Mime Čuvalo 67e83b76ef
editingshape state: make sure we reset this.hitShapeForPointerUp when done with it 2024-04-05 14:03:16 +01:00
Mime Čuvalo 0505c1eb1c
textfields: prevent selection drag on Firefox (#3370)
This is a minor edge case but worth accounting for: in Firefox, there's
a behavior where dragging a selection will grab that selection into the
drag event. However, once the drag is over, and you select away from the
textarea, starting a drag over the textarea will restart a selection
drag, instead of a shape drag. And also then your cursor will get
'stuck' because it missed some pointer event somewhere. This prevents
that default behavior in FF.

Before:


https://github.com/tldraw/tldraw/assets/469604/21416a61-e439-4245-bf4b-c41b170bfb05


After:


https://github.com/tldraw/tldraw/assets/469604/6b372fd6-c1dd-4d5f-b959-ce961b188d1f



### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
2024-04-05 13:53:50 +01:00
Steve Ruiz b69b6366b8 Merge branch 'main' into stickies-rc 2024-04-05 13:52:24 +01:00
Steve Ruiz 4a494a2eaf
Update useFileSystem.tsx (#3371)
This PR makes a small change to how useFileSystem reports errors, so
that legitimate errors may be caught.

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `feature` — New feature
2024-04-05 11:40:28 +00:00
Steve Ruiz f9a4fc3e34 Update Translating.ts 2024-04-05 12:08:41 +01:00
Steve Ruiz 21141d6c1e fix test 2024-04-05 12:08:25 +01:00
Steve Ruiz 2a263fba4c stickies: translucency, sometimes
stickies: translucency, sometimes
2024-04-05 11:39:29 +01:00
Taha e8de70ec85
Examples: update kbd shortcuts, add actions overrides example (#3330)
I think the keyboard shortcuts example already teaches the concept that
the actions overrides example does. I've updated the keyboard shortcuts
example and included an action override example in case we want that
too.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [x] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Add action overrides example, update keyboard shortcuts example

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2024-04-05 10:04:38 +00:00