tldraw 3.16.0-canary.c349490eaef0 → 3.16.0-canary.c360426d8b7a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist-cjs/index.d.ts +2 -6
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +1 -1
  4. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
  5. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js +2 -8
  6. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js.map +2 -2
  7. package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +1 -1
  8. package/dist-cjs/lib/shapes/shared/HyperlinkButton.js.map +2 -2
  9. package/dist-cjs/lib/shapes/shared/useEditablePlainText.js +3 -2
  10. package/dist-cjs/lib/shapes/shared/useEditablePlainText.js.map +2 -2
  11. package/dist-cjs/lib/shapes/text/PlainTextArea.js +1 -2
  12. package/dist-cjs/lib/shapes/text/PlainTextArea.js.map +2 -2
  13. package/dist-cjs/lib/ui/components/A11y.js +1 -1
  14. package/dist-cjs/lib/ui/components/A11y.js.map +2 -2
  15. package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js +1 -1
  16. package/dist-cjs/lib/ui/components/Minimap/DefaultMinimap.js.map +2 -2
  17. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js +1 -1
  18. package/dist-cjs/lib/ui/components/PageMenu/DefaultPageMenu.js.map +2 -2
  19. package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js +1 -1
  20. package/dist-cjs/lib/ui/components/primitives/TldrawUiContextualToolbar.js.map +2 -2
  21. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js +3 -3
  22. package/dist-cjs/lib/ui/components/primitives/menus/TldrawUiMenuItem.js.map +2 -2
  23. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js +1 -1
  24. package/dist-cjs/lib/ui/hooks/useClipboardEvents.js.map +2 -2
  25. package/dist-cjs/lib/ui/version.js +3 -3
  26. package/dist-cjs/lib/ui/version.js.map +1 -1
  27. package/dist-esm/index.d.mts +2 -6
  28. package/dist-esm/index.mjs +1 -1
  29. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +2 -1
  30. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
  31. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs +3 -9
  32. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs.map +2 -2
  33. package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs +2 -2
  34. package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs.map +2 -2
  35. package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs +4 -2
  36. package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs.map +2 -2
  37. package/dist-esm/lib/shapes/text/PlainTextArea.mjs +2 -3
  38. package/dist-esm/lib/shapes/text/PlainTextArea.mjs.map +2 -2
  39. package/dist-esm/lib/ui/components/A11y.mjs +2 -1
  40. package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
  41. package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs +1 -1
  42. package/dist-esm/lib/ui/components/Minimap/DefaultMinimap.mjs.map +2 -2
  43. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +2 -1
  44. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
  45. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +2 -1
  46. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +2 -2
  47. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs +3 -3
  48. package/dist-esm/lib/ui/components/primitives/menus/TldrawUiMenuItem.mjs.map +2 -2
  49. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +2 -1
  50. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs.map +2 -2
  51. package/dist-esm/lib/ui/version.mjs +3 -3
  52. package/dist-esm/lib/ui/version.mjs.map +1 -1
  53. package/package.json +3 -3
  54. package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +2 -1
  55. package/src/lib/shapes/frame/components/FrameLabelInput.tsx +3 -10
  56. package/src/lib/shapes/shared/HyperlinkButton.tsx +2 -2
  57. package/src/lib/shapes/shared/useEditablePlainText.ts +5 -2
  58. package/src/lib/shapes/text/PlainTextArea.tsx +2 -3
  59. package/src/lib/ui/components/A11y.tsx +2 -1
  60. package/src/lib/ui/components/Minimap/DefaultMinimap.tsx +1 -1
  61. package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +2 -1
  62. package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +2 -1
  63. package/src/lib/ui/components/primitives/menus/TldrawUiMenuItem.tsx +3 -3
  64. package/src/lib/ui/hooks/useClipboardEvents.ts +2 -1
  65. package/src/lib/ui/version.ts +3 -3
@@ -3,6 +3,7 @@ import {
3
3
  TLShapeId,
4
4
  TLUnknownShape,
5
5
  getPointerInfo,
6
+ markEventAsHandled,
6
7
  noop,
7
8
  preventDefault,
8
9
  tlenv,
@@ -128,7 +129,7 @@ export function useEditableTextCommon(shapeId: TLShapeId) {
128
129
  // partially if we didn't dispatch/stop below.
129
130
 
130
131
  editor.dispatch({
131
- ...getPointerInfo(editor, e),
132
+ ...getPointerInfo(e),
132
133
  type: 'pointer',
133
134
  name: 'pointer_down',
134
135
  target: 'shape',
@@ -156,11 +157,13 @@ export function useEditableTextCommon(shapeId: TLShapeId) {
156
157
  [editor, shapeId]
157
158
  )
158
159
 
160
+ const handleDoubleClick: (e: React.MouseEvent) => void = markEventAsHandled
161
+
159
162
  return {
160
163
  handleFocus: noop,
161
164
  handleBlur: noop,
162
165
  handleInputPointerDown,
163
- handleDoubleClick: editor.markEventAsHandled,
166
+ handleDoubleClick,
164
167
  handlePaste,
165
168
  isEditing,
166
169
  isReadyForEditing,
@@ -1,4 +1,4 @@
1
- import { preventDefault, useEditor } from '@tldraw/editor'
1
+ import { markEventAsHandled, preventDefault } from '@tldraw/editor'
2
2
  import React from 'react'
3
3
  import { TextAreaProps } from './RichTextArea'
4
4
 
@@ -21,7 +21,6 @@ export const PlainTextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps
21
21
  },
22
22
  ref
23
23
  ) {
24
- const editor = useEditor()
25
24
  const onChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
26
25
  handleChange({ plaintext: e.target.value })
27
26
  }
@@ -47,7 +46,7 @@ export const PlainTextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps
47
46
  onChange={onChange}
48
47
  onKeyDown={(e) => handleKeyDown(e.nativeEvent)}
49
48
  onBlur={handleBlur}
50
- onTouchEnd={editor.markEventAsHandled}
49
+ onTouchEnd={markEventAsHandled}
51
50
  onContextMenu={isEditing ? (e) => e.stopPropagation() : undefined}
52
51
  onPointerDown={handleInputPointerDown}
53
52
  onPaste={handlePaste}
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  debugFlags,
3
3
  Editor,
4
+ markEventAsHandled,
4
5
  TLGeoShape,
5
6
  TLShapeId,
6
7
  unsafe__withoutCapture,
@@ -22,7 +23,7 @@ export function SkipToMainContent() {
22
23
 
23
24
  const handleNavigateToFirstShape = useCallback(
24
25
  (e: MouseEvent | KeyboardEvent) => {
25
- editor.markEventAsHandled(e)
26
+ markEventAsHandled(e)
26
27
  button.current?.blur()
27
28
  const shapes = editor.getCurrentPageShapesInReadingOrder()
28
29
  if (!shapes.length) return
@@ -159,7 +159,7 @@ export function DefaultMinimap() {
159
159
  type: 'pointer',
160
160
  target: 'canvas',
161
161
  name: 'pointer_move',
162
- ...getPointerInfo(editor, e),
162
+ ...getPointerInfo(e),
163
163
  point: screenPoint,
164
164
  isPen: editor.getInstanceState().isPenMode,
165
165
  }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  PageRecordType,
3
3
  TLPageId,
4
+ markEventAsHandled,
4
5
  releasePointerCapture,
5
6
  setPointerCapture,
6
7
  tlenv,
@@ -450,7 +451,7 @@ export const DefaultPageMenu = memo(function DefaultPageMenu() {
450
451
  if (e.key === 'Enter') {
451
452
  if (page.id === currentPage.id) {
452
453
  toggleEditing()
453
- editor.markEventAsHandled(e)
454
+ markEventAsHandled(e)
454
455
  }
455
456
  }
456
457
  }}
@@ -3,6 +3,7 @@ import {
3
3
  Box,
4
4
  clamp,
5
5
  Editor,
6
+ markEventAsHandled,
6
7
  react,
7
8
  useAtom,
8
9
  useEditor,
@@ -169,7 +170,7 @@ export const TldrawUiContextualToolbar = ({
169
170
  data-visible={false}
170
171
  data-testid="contextual-toolbar"
171
172
  className={classNames('tlui-contextual-toolbar', className)}
172
- onPointerDown={editor.markEventAsHandled}
173
+ onPointerDown={markEventAsHandled}
173
174
  >
174
175
  <TldrawUiToolbar
175
176
  orientation="horizontal"
@@ -333,7 +333,7 @@ function useDraggableEvents(
333
333
  type: 'pointer',
334
334
  target: 'canvas',
335
335
  name: 'pointer_down',
336
- ...getPointerInfo(editor, e),
336
+ ...getPointerInfo(e),
337
337
  point: screenSpaceStart,
338
338
  })
339
339
 
@@ -345,7 +345,7 @@ function useDraggableEvents(
345
345
  type: 'pointer',
346
346
  target: 'canvas',
347
347
  name: 'pointer_move',
348
- ...getPointerInfo(editor, e),
348
+ ...getPointerInfo(e),
349
349
  point: screenSpaceStart,
350
350
  })
351
351
 
@@ -365,7 +365,7 @@ function useDraggableEvents(
365
365
  type: 'pointer',
366
366
  target: 'canvas',
367
367
  name: 'pointer_up',
368
- ...getPointerInfo(editor, e),
368
+ ...getPointerInfo(e),
369
369
  })
370
370
  }
371
371
 
@@ -7,6 +7,7 @@ import {
7
7
  assert,
8
8
  compact,
9
9
  isDefined,
10
+ markEventAsHandled,
10
11
  preventDefault,
11
12
  uniq,
12
13
  useEditor,
@@ -762,7 +763,7 @@ export function useNativeClipboardEvents() {
762
763
 
763
764
  const paste = (e: ClipboardEvent) => {
764
765
  if (disablingMiddleClickPaste) {
765
- editor.markEventAsHandled(e)
766
+ markEventAsHandled(e)
766
767
  return
767
768
  }
768
769
 
@@ -1,9 +1,9 @@
1
1
  // This file is automatically generated by internal/scripts/refresh-assets.ts.
2
2
  // Do not edit manually. Or do, I'm a comment, not a cop.
3
3
 
4
- export const version = '3.16.0-canary.c349490eaef0'
4
+ export const version = '3.16.0-canary.c360426d8b7a'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-09-17T16:01:20.675Z',
8
- patch: '2025-09-17T16:01:20.675Z',
7
+ minor: '2025-09-17T15:16:03.696Z',
8
+ patch: '2025-09-17T15:16:03.696Z',
9
9
  }