tldraw 3.16.0-canary.e1d5c8aeb399 → 3.16.0-canary.e372fad80b6d

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 -2
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +4 -4
  4. package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
  5. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js +2 -2
  6. package/dist-cjs/lib/shapes/frame/components/FrameLabelInput.js.map +2 -2
  7. package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +4 -4
  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 +2 -2
  12. package/dist-cjs/lib/shapes/text/PlainTextArea.js.map +2 -2
  13. package/dist-cjs/lib/shapes/text/RichTextArea.js +3 -3
  14. package/dist-cjs/lib/shapes/text/RichTextArea.js.map +2 -2
  15. package/dist-cjs/lib/ui/components/A11y.js +1 -1
  16. package/dist-cjs/lib/ui/components/A11y.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 +1 -1
  21. package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.js +2 -2
  22. package/dist-cjs/lib/ui/components/primitives/TldrawUiInput.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 -2
  28. package/dist-esm/index.mjs +1 -1
  29. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +5 -5
  30. package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
  31. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs +3 -3
  32. package/dist-esm/lib/shapes/frame/components/FrameLabelInput.mjs.map +2 -2
  33. package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs +5 -5
  34. package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs.map +2 -2
  35. package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs +4 -3
  36. package/dist-esm/lib/shapes/shared/useEditablePlainText.mjs.map +2 -2
  37. package/dist-esm/lib/shapes/text/PlainTextArea.mjs +3 -3
  38. package/dist-esm/lib/shapes/text/PlainTextArea.mjs.map +2 -2
  39. package/dist-esm/lib/shapes/text/RichTextArea.mjs +3 -4
  40. package/dist-esm/lib/shapes/text/RichTextArea.mjs.map +2 -2
  41. package/dist-esm/lib/ui/components/A11y.mjs +2 -2
  42. package/dist-esm/lib/ui/components/A11y.mjs.map +2 -2
  43. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs +2 -2
  44. package/dist-esm/lib/ui/components/PageMenu/DefaultPageMenu.mjs.map +2 -2
  45. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs +2 -2
  46. package/dist-esm/lib/ui/components/primitives/TldrawUiContextualToolbar.mjs.map +1 -1
  47. package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs +3 -3
  48. package/dist-esm/lib/ui/components/primitives/TldrawUiInput.mjs.map +2 -2
  49. package/dist-esm/lib/ui/hooks/useClipboardEvents.mjs +2 -2
  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 +5 -5
  55. package/src/lib/shapes/frame/components/FrameLabelInput.tsx +3 -3
  56. package/src/lib/shapes/shared/HyperlinkButton.tsx +5 -5
  57. package/src/lib/shapes/shared/useEditablePlainText.ts +5 -3
  58. package/src/lib/shapes/text/PlainTextArea.tsx +3 -3
  59. package/src/lib/shapes/text/RichTextArea.tsx +3 -4
  60. package/src/lib/ui/components/A11y.tsx +2 -2
  61. package/src/lib/ui/components/PageMenu/DefaultPageMenu.tsx +2 -2
  62. package/src/lib/ui/components/primitives/TldrawUiContextualToolbar.tsx +2 -2
  63. package/src/lib/ui/components/primitives/TldrawUiInput.tsx +3 -3
  64. package/src/lib/ui/hooks/useClipboardEvents.ts +2 -2
  65. package/src/lib/ui/version.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tldraw",
3
3
  "description": "A tiny little drawing editor.",
4
- "version": "3.16.0-canary.e1d5c8aeb399",
4
+ "version": "3.16.0-canary.e372fad80b6d",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -55,8 +55,8 @@
55
55
  "@tiptap/pm": "^2.9.1",
56
56
  "@tiptap/react": "^2.9.1",
57
57
  "@tiptap/starter-kit": "^2.9.1",
58
- "@tldraw/editor": "3.16.0-canary.e1d5c8aeb399",
59
- "@tldraw/store": "3.16.0-canary.e1d5c8aeb399",
58
+ "@tldraw/editor": "3.16.0-canary.e372fad80b6d",
59
+ "@tldraw/store": "3.16.0-canary.e372fad80b6d",
60
60
  "classnames": "^2.5.1",
61
61
  "hotkeys-js": "^3.13.9",
62
62
  "idb": "^7.1.1",
@@ -13,7 +13,7 @@ import {
13
13
  debounce,
14
14
  getHashForString,
15
15
  lerp,
16
- stopEventPropagation,
16
+ markEventAsHandled,
17
17
  tlenv,
18
18
  toDomPrecision,
19
19
  useEditor,
@@ -132,9 +132,9 @@ function BookmarkShapeComponent({ shape }: { shape: TLBookmarkShape }) {
132
132
  const [isFaviconValid, setIsFaviconValid] = useState(true)
133
133
  const onFaviconError = () => setIsFaviconValid(false)
134
134
 
135
- const useStopPropagationOnShiftKey = useCallback<PointerEventHandler>(
135
+ const markAsHandledOnShiftKey = useCallback<PointerEventHandler>(
136
136
  (e) => {
137
- if (!editor.inputs.shiftKey) stopEventPropagation(e)
137
+ if (!editor.inputs.shiftKey) markEventAsHandled(e)
138
138
  },
139
139
  [editor]
140
140
  )
@@ -182,8 +182,8 @@ function BookmarkShapeComponent({ shape }: { shape: TLBookmarkShape }) {
182
182
  target="_blank"
183
183
  rel="noopener noreferrer"
184
184
  draggable={false}
185
- onPointerDown={useStopPropagationOnShiftKey}
186
- onPointerUp={useStopPropagationOnShiftKey}
185
+ onPointerDown={markAsHandledOnShiftKey}
186
+ onPointerUp={markAsHandledOnShiftKey}
187
187
  >
188
188
  {isFaviconValid && asset?.props.favicon ? (
189
189
  <img
@@ -1,4 +1,4 @@
1
- import { TLFrameShape, TLShapeId, stopEventPropagation, useEditor } from '@tldraw/editor'
1
+ import { TLFrameShape, TLShapeId, markEventAsHandled, useEditor } from '@tldraw/editor'
2
2
  import { forwardRef, useCallback } from 'react'
3
3
  import { defaultEmptyAs } from '../FrameShapeUtil'
4
4
 
@@ -13,7 +13,7 @@ export const FrameLabelInput = forwardRef<
13
13
  if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
14
14
  // need to prevent the enter keydown making it's way up to the Idle state
15
15
  // and sending us back into edit mode
16
- stopEventPropagation(e)
16
+ markEventAsHandled(e)
17
17
  e.currentTarget.blur()
18
18
  editor.setEditingShape(null)
19
19
  }
@@ -74,7 +74,7 @@ export const FrameLabelInput = forwardRef<
74
74
  onKeyDown={handleKeyDown}
75
75
  onBlur={handleBlur}
76
76
  onChange={handleChange}
77
- onPointerDown={isEditing ? stopEventPropagation : undefined}
77
+ onPointerDown={isEditing ? markEventAsHandled : undefined}
78
78
  draggable={false}
79
79
  />
80
80
  {defaultEmptyAs(name, 'Frame') + String.fromCharCode(8203)}
@@ -1,4 +1,4 @@
1
- import { stopEventPropagation, useEditor, useValue } from '@tldraw/editor'
1
+ import { markEventAsHandled, useEditor, useValue } from '@tldraw/editor'
2
2
  import classNames from 'classnames'
3
3
  import { PointerEventHandler, useCallback } from 'react'
4
4
 
@@ -8,9 +8,9 @@ const LINK_ICON =
8
8
  export function HyperlinkButton({ url }: { url: string }) {
9
9
  const editor = useEditor()
10
10
  const hideButton = useValue('zoomLevel', () => editor.getZoomLevel() < 0.32, [editor])
11
- const useStopPropagationOnShiftKey = useCallback<PointerEventHandler>(
11
+ const markAsHandledOnShiftKey = useCallback<PointerEventHandler>(
12
12
  (e) => {
13
- if (!editor.inputs.shiftKey) stopEventPropagation(e)
13
+ if (!editor.inputs.shiftKey) markEventAsHandled(e)
14
14
  },
15
15
  [editor]
16
16
  )
@@ -22,8 +22,8 @@ export function HyperlinkButton({ url }: { url: string }) {
22
22
  href={url}
23
23
  target="_blank"
24
24
  rel="noopener noreferrer"
25
- onPointerDown={useStopPropagationOnShiftKey}
26
- onPointerUp={useStopPropagationOnShiftKey}
25
+ onPointerDown={markAsHandledOnShiftKey}
26
+ onPointerUp={markAsHandledOnShiftKey}
27
27
  title={url}
28
28
  draggable={false}
29
29
  >
@@ -3,9 +3,9 @@ import {
3
3
  TLShapeId,
4
4
  TLUnknownShape,
5
5
  getPointerInfo,
6
+ markEventAsHandled,
6
7
  noop,
7
8
  preventDefault,
8
- stopEventPropagation,
9
9
  tlenv,
10
10
  useEditor,
11
11
  useValue,
@@ -136,7 +136,7 @@ export function useEditableTextCommon(shapeId: TLShapeId) {
136
136
  shape: editor.getShape(shapeId)!,
137
137
  })
138
138
 
139
- stopEventPropagation(e) // we need to prevent blurring the input
139
+ e.stopPropagation() // we need to prevent blurring the input
140
140
  },
141
141
  [editor, shapeId]
142
142
  )
@@ -157,11 +157,13 @@ export function useEditableTextCommon(shapeId: TLShapeId) {
157
157
  [editor, shapeId]
158
158
  )
159
159
 
160
+ const handleDoubleClick: (e: React.MouseEvent) => void = markEventAsHandled
161
+
160
162
  return {
161
163
  handleFocus: noop,
162
164
  handleBlur: noop,
163
165
  handleInputPointerDown,
164
- handleDoubleClick: stopEventPropagation,
166
+ handleDoubleClick,
165
167
  handlePaste,
166
168
  isEditing,
167
169
  isReadyForEditing,
@@ -1,4 +1,4 @@
1
- import { preventDefault, stopEventPropagation } from '@tldraw/editor'
1
+ import { markEventAsHandled, preventDefault } from '@tldraw/editor'
2
2
  import React from 'react'
3
3
  import { TextAreaProps } from './RichTextArea'
4
4
 
@@ -46,8 +46,8 @@ export const PlainTextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps
46
46
  onChange={onChange}
47
47
  onKeyDown={(e) => handleKeyDown(e.nativeEvent)}
48
48
  onBlur={handleBlur}
49
- onTouchEnd={stopEventPropagation}
50
- onContextMenu={isEditing ? stopEventPropagation : undefined}
49
+ onTouchEnd={markEventAsHandled}
50
+ onContextMenu={isEditing ? (e) => e.stopPropagation() : undefined}
51
51
  onPointerDown={handleInputPointerDown}
52
52
  onPaste={handlePaste}
53
53
  onDoubleClick={handleDoubleClick}
@@ -10,7 +10,6 @@ import {
10
10
  TLRichText,
11
11
  TLShapeId,
12
12
  preventDefault,
13
- stopEventPropagation,
14
13
  useEditor,
15
14
  useEvent,
16
15
  useUniqueSafeId,
@@ -233,13 +232,13 @@ export const RichTextArea = React.forwardRef<HTMLDivElement, TextAreaProps>(func
233
232
  tabIndex={-1}
234
233
  data-testid="rich-text-area"
235
234
  className="tl-rich-text tl-text tl-text-input"
236
- onContextMenu={isEditing ? stopEventPropagation : undefined}
235
+ onContextMenu={isEditing ? (e) => e.stopPropagation() : undefined}
237
236
  // N.B. When PointerStateExtension was introduced, this was moved there.
238
237
  // However, that caused selecting over list items to break.
239
238
  // The handleDOMEvents in TipTap don't seem to support the pointerDownCapture event.
240
- onPointerDownCapture={stopEventPropagation}
239
+ onPointerDownCapture={(e) => e.stopPropagation()}
241
240
  // This onTouchEnd is important for Android to be able to change selection on text.
242
- onTouchEnd={stopEventPropagation}
241
+ onTouchEnd={(e) => e.stopPropagation()}
243
242
  // On FF, there's a behavior where dragging a selection will grab that selection into
244
243
  // the drag event. However, once the drag is over, and you select away from the textarea,
245
244
  // starting a drag over the textarea will restart a selection drag instead of a shape drag.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  debugFlags,
3
3
  Editor,
4
- stopEventPropagation,
4
+ markEventAsHandled,
5
5
  TLGeoShape,
6
6
  TLShapeId,
7
7
  unsafe__withoutCapture,
@@ -23,7 +23,7 @@ export function SkipToMainContent() {
23
23
 
24
24
  const handleNavigateToFirstShape = useCallback(
25
25
  (e: MouseEvent | KeyboardEvent) => {
26
- stopEventPropagation(e)
26
+ markEventAsHandled(e)
27
27
  button.current?.blur()
28
28
  const shapes = editor.getCurrentPageShapesInReadingOrder()
29
29
  if (!shapes.length) return
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  PageRecordType,
3
3
  TLPageId,
4
+ markEventAsHandled,
4
5
  releasePointerCapture,
5
6
  setPointerCapture,
6
- stopEventPropagation,
7
7
  tlenv,
8
8
  useEditor,
9
9
  useValue,
@@ -451,7 +451,7 @@ export const DefaultPageMenu = memo(function DefaultPageMenu() {
451
451
  if (e.key === 'Enter') {
452
452
  if (page.id === currentPage.id) {
453
453
  toggleEditing()
454
- stopEventPropagation(e)
454
+ markEventAsHandled(e)
455
455
  }
456
456
  }
457
457
  }}
@@ -3,8 +3,8 @@ import {
3
3
  Box,
4
4
  clamp,
5
5
  Editor,
6
+ markEventAsHandled,
6
7
  react,
7
- stopEventPropagation,
8
8
  useAtom,
9
9
  useEditor,
10
10
  usePassThroughMouseOverEvents,
@@ -170,7 +170,7 @@ export const TldrawUiContextualToolbar = ({
170
170
  data-visible={false}
171
171
  data-testid="contextual-toolbar"
172
172
  className={classNames('tlui-contextual-toolbar', className)}
173
- onPointerDown={stopEventPropagation}
173
+ onPointerDown={markEventAsHandled}
174
174
  >
175
175
  <TldrawUiToolbar
176
176
  orientation="horizontal"
@@ -1,4 +1,4 @@
1
- import { stopEventPropagation, tlenv, tltime, useMaybeEditor } from '@tldraw/editor'
1
+ import { tlenv, tltime, useMaybeEditor } from '@tldraw/editor'
2
2
  import classNames from 'classnames'
3
3
  import * as React from 'react'
4
4
  import { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey'
@@ -118,7 +118,7 @@ export const TldrawUiInput = React.forwardRef<HTMLInputElement, TLUiInputProps>(
118
118
  // `onChange` with a duplicated text value.
119
119
  if (isComposing.current) return
120
120
  e.currentTarget.blur()
121
- stopEventPropagation(e)
121
+ e.stopPropagation()
122
122
  onComplete?.(e.currentTarget.value)
123
123
  break
124
124
  }
@@ -126,7 +126,7 @@ export const TldrawUiInput = React.forwardRef<HTMLInputElement, TLUiInputProps>(
126
126
  e.currentTarget.value = rInitialValue.current
127
127
  onCancel?.(e.currentTarget.value)
128
128
  e.currentTarget.blur()
129
- stopEventPropagation(e)
129
+ e.stopPropagation()
130
130
  break
131
131
  }
132
132
  }
@@ -7,8 +7,8 @@ import {
7
7
  assert,
8
8
  compact,
9
9
  isDefined,
10
+ markEventAsHandled,
10
11
  preventDefault,
11
- stopEventPropagation,
12
12
  uniq,
13
13
  useEditor,
14
14
  useMaybeEditor,
@@ -763,7 +763,7 @@ export function useNativeClipboardEvents() {
763
763
 
764
764
  const paste = (e: ClipboardEvent) => {
765
765
  if (disablingMiddleClickPaste) {
766
- stopEventPropagation(e)
766
+ markEventAsHandled(e)
767
767
  return
768
768
  }
769
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.e1d5c8aeb399'
4
+ export const version = '3.16.0-canary.e372fad80b6d'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-09-15T11:32:58.792Z',
8
- patch: '2025-09-15T11:32:58.792Z',
7
+ minor: '2025-09-15T14:33:27.355Z',
8
+ patch: '2025-09-15T14:33:27.355Z',
9
9
  }