@tldraw/editor 3.14.0-canary.efa8f9545620 → 3.14.0-canary.f27d19561239

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 (42) hide show
  1. package/dist-cjs/index.d.ts +37 -57
  2. package/dist-cjs/index.js +1 -1
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/editor/Editor.js +1 -31
  5. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  6. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +42 -73
  7. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
  8. package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +1 -1
  9. package/dist-cjs/lib/editor/tools/StateNode.js +3 -3
  10. package/dist-cjs/lib/editor/tools/StateNode.js.map +2 -2
  11. package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
  12. package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
  13. package/dist-cjs/lib/hooks/useCanvasEvents.js +2 -1
  14. package/dist-cjs/lib/hooks/useCanvasEvents.js.map +2 -2
  15. package/dist-cjs/version.js +3 -3
  16. package/dist-cjs/version.js.map +1 -1
  17. package/dist-esm/index.d.mts +37 -57
  18. package/dist-esm/index.mjs +1 -1
  19. package/dist-esm/index.mjs.map +2 -2
  20. package/dist-esm/lib/editor/Editor.mjs +1 -31
  21. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  22. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +42 -73
  23. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
  24. package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +1 -1
  25. package/dist-esm/lib/editor/tools/StateNode.mjs +3 -3
  26. package/dist-esm/lib/editor/tools/StateNode.mjs.map +2 -2
  27. package/dist-esm/lib/hooks/useCanvasEvents.mjs +2 -1
  28. package/dist-esm/lib/hooks/useCanvasEvents.mjs.map +2 -2
  29. package/dist-esm/version.mjs +3 -3
  30. package/dist-esm/version.mjs.map +1 -1
  31. package/editor.css +482 -433
  32. package/package.json +7 -7
  33. package/src/index.ts +0 -2
  34. package/src/lib/editor/Editor.ts +1 -34
  35. package/src/lib/editor/managers/TextManager/TextManager.test.ts +5 -1
  36. package/src/lib/editor/managers/TextManager/TextManager.ts +86 -118
  37. package/src/lib/editor/shapes/ShapeUtil.ts +0 -1
  38. package/src/lib/editor/tools/StateNode.ts +3 -3
  39. package/src/lib/editor/types/emit-types.ts +0 -4
  40. package/src/lib/editor/types/external-content.ts +2 -11
  41. package/src/lib/hooks/useCanvasEvents.ts +1 -0
  42. package/src/version.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
3
  "description": "A tiny little drawing app (editor).",
4
- "version": "3.14.0-canary.efa8f9545620",
4
+ "version": "3.14.0-canary.f27d19561239",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -48,12 +48,12 @@
48
48
  "@tiptap/core": "^2.9.1",
49
49
  "@tiptap/pm": "^2.9.1",
50
50
  "@tiptap/react": "^2.9.1",
51
- "@tldraw/state": "3.14.0-canary.efa8f9545620",
52
- "@tldraw/state-react": "3.14.0-canary.efa8f9545620",
53
- "@tldraw/store": "3.14.0-canary.efa8f9545620",
54
- "@tldraw/tlschema": "3.14.0-canary.efa8f9545620",
55
- "@tldraw/utils": "3.14.0-canary.efa8f9545620",
56
- "@tldraw/validate": "3.14.0-canary.efa8f9545620",
51
+ "@tldraw/state": "3.14.0-canary.f27d19561239",
52
+ "@tldraw/state-react": "3.14.0-canary.f27d19561239",
53
+ "@tldraw/store": "3.14.0-canary.f27d19561239",
54
+ "@tldraw/tlschema": "3.14.0-canary.f27d19561239",
55
+ "@tldraw/utils": "3.14.0-canary.f27d19561239",
56
+ "@tldraw/validate": "3.14.0-canary.f27d19561239",
57
57
  "@types/core-js": "^2.5.8",
58
58
  "@use-gesture/react": "^10.3.1",
59
59
  "classnames": "^2.5.1",
package/src/index.ts CHANGED
@@ -174,7 +174,6 @@ export {
174
174
  } from './lib/editor/managers/SnapManager/SnapManager'
175
175
  export {
176
176
  TextManager,
177
- type TLMeasureTextOpts,
178
177
  type TLMeasureTextSpanOpts,
179
178
  } from './lib/editor/managers/TextManager/TextManager'
180
179
  export { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'
@@ -253,7 +252,6 @@ export {
253
252
  type TLExternalContent,
254
253
  type TLExternalContentSource,
255
254
  type TLFileExternalAsset,
256
- type TLFileReplaceExternalContent,
257
255
  type TLFilesExternalContent,
258
256
  type TLSvgTextExternalContent,
259
257
  type TLTextExternalContent,
@@ -348,8 +348,6 @@ export class Editor extends EventEmitter<TLEventMap> {
348
348
  this.getContainer = getContainer
349
349
 
350
350
  this.textMeasure = new TextManager(this)
351
- this.disposables.add(() => this.textMeasure.dispose())
352
-
353
351
  this.fonts = new FontManager(this, fontAssetUrls)
354
352
 
355
353
  this._tickManager = new TickManager(this)
@@ -2122,20 +2120,6 @@ export class Editor extends EventEmitter<TLEventMap> {
2122
2120
  return this.getShapesPageBounds(this.getSelectedShapeIds())
2123
2121
  }
2124
2122
 
2125
- /**
2126
- * The bounds of the selection bounding box in the current page space.
2127
- *
2128
- * @readonly
2129
- * @public
2130
- */
2131
- getSelectionScreenBounds(): Box | undefined {
2132
- const bounds = this.getSelectionPageBounds()
2133
- if (!bounds) return undefined
2134
- const { x, y } = this.pageToScreen(bounds.point)
2135
- const zoom = this.getZoomLevel()
2136
- return new Box(x, y, bounds.width * zoom, bounds.height * zoom)
2137
- }
2138
-
2139
2123
  /**
2140
2124
  * @internal
2141
2125
  */
@@ -6211,12 +6195,11 @@ export class Editor extends EventEmitter<TLEventMap> {
6211
6195
  */
6212
6196
  duplicateShapes(shapes: TLShapeId[] | TLShape[], offset?: VecLike): this {
6213
6197
  this.run(() => {
6214
- const _ids =
6198
+ const ids =
6215
6199
  typeof shapes[0] === 'string'
6216
6200
  ? (shapes as TLShapeId[])
6217
6201
  : (shapes as TLShape[]).map((s) => s.id)
6218
6202
 
6219
- const ids = this._shouldIgnoreShapeLock ? _ids : this._getUnlockedShapeIds(_ids)
6220
6203
  if (ids.length <= 0) return this
6221
6204
 
6222
6205
  const initialIds = new Set(ids)
@@ -7937,8 +7920,6 @@ export class Editor extends EventEmitter<TLEventMap> {
7937
7920
  }
7938
7921
  })
7939
7922
 
7940
- this.emit('created-shapes', shapeRecordsToCreate)
7941
- this.emit('edit')
7942
7923
  this.store.put(shapeRecordsToCreate)
7943
7924
  })
7944
7925
 
@@ -8333,8 +8314,6 @@ export class Editor extends EventEmitter<TLEventMap> {
8333
8314
  updates.push(updated)
8334
8315
  }
8335
8316
 
8336
- this.emit('edited-shapes', updates)
8337
- this.emit('edit')
8338
8317
  this.store.put(updates)
8339
8318
  })
8340
8319
  }
@@ -8384,8 +8363,6 @@ export class Editor extends EventEmitter<TLEventMap> {
8384
8363
  })
8385
8364
  }
8386
8365
 
8387
- this.emit('deleted-shapes', [...allShapeIdsToDelete])
8388
- this.emit('edit')
8389
8366
  return this.run(() => this.store.remove([...allShapeIdsToDelete]))
8390
8367
  }
8391
8368
 
@@ -8834,7 +8811,6 @@ export class Editor extends EventEmitter<TLEventMap> {
8834
8811
  } = {
8835
8812
  text: null,
8836
8813
  files: null,
8837
- 'file-replace': null,
8838
8814
  embed: null,
8839
8815
  'svg-text': null,
8840
8816
  url: null,
@@ -8884,15 +8860,6 @@ export class Editor extends EventEmitter<TLEventMap> {
8884
8860
  return this.externalContentHandlers[info.type]?.(info as any)
8885
8861
  }
8886
8862
 
8887
- /**
8888
- * Handle replacing external content.
8889
- *
8890
- * @param info - Info about the external content.
8891
- */
8892
- async replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void> {
8893
- return this.externalContentHandlers[info.type]?.(info as any)
8894
- }
8895
-
8896
8863
  /**
8897
8864
  * Get content that can be exported for the given shape ids.
8898
8865
  *
@@ -99,7 +99,7 @@ describe('TextManager', () => {
99
99
  })
100
100
 
101
101
  it('should handle empty text', () => {
102
- const result = textManager.measureText('', { ...defaultOpts, measureScrollWidth: true })
102
+ const result = textManager.measureText('', defaultOpts)
103
103
  expect(result).toHaveProperty('x', 0)
104
104
  expect(result).toHaveProperty('y', 0)
105
105
  expect(result).toHaveProperty('w')
@@ -128,6 +128,7 @@ describe('TextManager', () => {
128
128
  y: 0,
129
129
  w: expect.any(Number),
130
130
  h: expect.any(Number),
131
+ scrollWidth: expect.any(Number),
131
132
  })
132
133
  })
133
134
 
@@ -140,6 +141,7 @@ describe('TextManager', () => {
140
141
  y: 0,
141
142
  w: expect.any(Number),
142
143
  h: expect.any(Number),
144
+ scrollWidth: expect.any(Number),
143
145
  })
144
146
  })
145
147
 
@@ -152,6 +154,7 @@ describe('TextManager', () => {
152
154
  y: 0,
153
155
  w: expect.any(Number),
154
156
  h: expect.any(Number),
157
+ scrollWidth: expect.any(Number),
155
158
  })
156
159
  })
157
160
 
@@ -170,6 +173,7 @@ describe('TextManager', () => {
170
173
  y: 0,
171
174
  w: expect.any(Number),
172
175
  h: expect.any(Number),
176
+ scrollWidth: expect.any(Number),
173
177
  })
174
178
  })
175
179
  })
@@ -20,28 +20,6 @@ const textAlignmentsForLtr = {
20
20
  'end-legacy': 'right',
21
21
  }
22
22
 
23
- /** @public */
24
- export interface TLMeasureTextOpts {
25
- fontStyle: string
26
- fontWeight: string
27
- fontFamily: string
28
- fontSize: number
29
- /** This must be a number, e.g. 1.35, not a pixel value. */
30
- lineHeight: number
31
- /**
32
- * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
33
- * is null, the text will be measured without wrapping, but explicit line breaks and
34
- * space are preserved.
35
- */
36
- maxWidth: null | number
37
- minWidth?: null | number
38
- // todo: make this a number so that it is consistent with other TLMeasureTextSpanOpts
39
- padding: string
40
- otherStyles?: Record<string, string>
41
- disableOverflowWrapBreaking?: boolean
42
- measureScrollWidth?: boolean
43
- }
44
-
45
23
  /** @public */
46
24
  export interface TLMeasureTextSpanOpts {
47
25
  overflow: 'wrap' | 'truncate-ellipsis' | 'truncate-clip'
@@ -55,99 +33,96 @@ export interface TLMeasureTextSpanOpts {
55
33
  lineHeight: number
56
34
  textAlign: TLDefaultHorizontalAlignStyle
57
35
  otherStyles?: Record<string, string>
58
- measureScrollWidth?: boolean
59
36
  }
60
37
 
61
38
  const spaceCharacterRegex = /\s/
62
39
 
63
40
  /** @public */
64
41
  export class TextManager {
65
- private elm: HTMLDivElement
66
- private defaultStyles: Record<string, string | null>
42
+ private baseElem: HTMLDivElement
67
43
 
68
44
  constructor(public editor: Editor) {
69
- const elm = document.createElement('div')
70
- elm.classList.add('tl-text')
71
- elm.classList.add('tl-text-measure')
72
- elm.setAttribute('dir', 'auto')
73
- elm.tabIndex = -1
74
- this.editor.getContainer().appendChild(elm)
75
-
76
- // we need to save the default styles so that we can restore them when we're done
77
- // these must be the css names, not the js names for the styles
78
- this.defaultStyles = {
79
- 'overflow-wrap': 'break-word',
80
- 'word-break': 'auto',
81
- width: null,
82
- height: null,
83
- 'max-width': null,
84
- 'min-width': null,
85
- }
86
-
87
- this.elm = elm
88
- }
89
-
90
- dispose() {
91
- return this.elm.remove()
45
+ this.baseElem = document.createElement('div')
46
+ this.baseElem.classList.add('tl-text')
47
+ this.baseElem.classList.add('tl-text-measure')
48
+ this.baseElem.tabIndex = -1
92
49
  }
93
50
 
94
- private resetElmStyles() {
95
- const { elm, defaultStyles } = this
96
- for (const key in defaultStyles) {
97
- elm.style.setProperty(key, defaultStyles[key])
51
+ measureText(
52
+ textToMeasure: string,
53
+ opts: {
54
+ fontStyle: string
55
+ fontWeight: string
56
+ fontFamily: string
57
+ fontSize: number
58
+ lineHeight: number
59
+ /**
60
+ * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
61
+ * is null, the text will be measured without wrapping, but explicit line breaks and
62
+ * space are preserved.
63
+ */
64
+ maxWidth: null | number
65
+ minWidth?: null | number
66
+ padding: string
67
+ disableOverflowWrapBreaking?: boolean
98
68
  }
99
- }
100
-
101
- measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & { scrollWidth: number } {
69
+ ): BoxModel & { scrollWidth: number } {
102
70
  const div = document.createElement('div')
103
71
  div.textContent = normalizeTextForDom(textToMeasure)
104
72
  return this.measureHtml(div.innerHTML, opts)
105
73
  }
106
74
 
107
- measureHtml(html: string, opts: TLMeasureTextOpts): BoxModel & { scrollWidth: number } {
108
- const { elm } = this
109
-
110
- if (opts.otherStyles) {
111
- for (const key in opts.otherStyles) {
112
- if (!this.defaultStyles[key]) {
113
- // we need to save the original style so that we can restore it when we're done
114
- this.defaultStyles[key] = elm.style.getPropertyValue(key)
115
- }
116
- }
75
+ measureHtml(
76
+ html: string,
77
+ opts: {
78
+ fontStyle: string
79
+ fontWeight: string
80
+ fontFamily: string
81
+ fontSize: number
82
+ lineHeight: number
83
+ /**
84
+ * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
85
+ * is null, the text will be measured without wrapping, but explicit line breaks and
86
+ * space are preserved.
87
+ */
88
+ maxWidth: null | number
89
+ minWidth?: null | number
90
+ otherStyles?: Record<string, string>
91
+ padding: string
92
+ disableOverflowWrapBreaking?: boolean
117
93
  }
118
-
119
- elm.innerHTML = html
120
-
121
- // Apply the default styles to the element (for all styles here or that were ever seen in opts.otherStyles)
122
- this.resetElmStyles()
123
-
124
- elm.style.setProperty('font-family', opts.fontFamily)
125
- elm.style.setProperty('font-style', opts.fontStyle)
126
- elm.style.setProperty('font-weight', opts.fontWeight)
127
- elm.style.setProperty('font-size', opts.fontSize + 'px')
128
- elm.style.setProperty('line-height', opts.lineHeight.toString())
129
- elm.style.setProperty('padding', opts.padding)
130
-
131
- if (opts.maxWidth) {
132
- elm.style.setProperty('max-width', opts.maxWidth + 'px')
133
- }
134
-
135
- if (opts.minWidth) {
136
- elm.style.setProperty('min-width', opts.minWidth + 'px')
137
- }
138
-
139
- if (opts.disableOverflowWrapBreaking) {
140
- elm.style.setProperty('overflow-wrap', 'normal')
141
- }
142
-
94
+ ): BoxModel & { scrollWidth: number } {
95
+ // Duplicate our base element; we don't need to clone deep
96
+ const wrapperElm = this.baseElem.cloneNode() as HTMLDivElement
97
+ this.editor.getContainer().appendChild(wrapperElm)
98
+ wrapperElm.innerHTML = html
99
+ this.baseElem.insertAdjacentElement('afterend', wrapperElm)
100
+
101
+ wrapperElm.setAttribute('dir', 'auto')
102
+ // N.B. This property, while discouraged ("intended for Document Type Definition (DTD) designers")
103
+ // is necessary for ensuring correct mixed RTL/LTR behavior when exporting SVGs.
104
+ wrapperElm.style.setProperty('unicode-bidi', 'plaintext')
105
+ wrapperElm.style.setProperty('font-family', opts.fontFamily)
106
+ wrapperElm.style.setProperty('font-style', opts.fontStyle)
107
+ wrapperElm.style.setProperty('font-weight', opts.fontWeight)
108
+ wrapperElm.style.setProperty('font-size', opts.fontSize + 'px')
109
+ wrapperElm.style.setProperty('line-height', opts.lineHeight * opts.fontSize + 'px')
110
+ wrapperElm.style.setProperty('max-width', opts.maxWidth === null ? null : opts.maxWidth + 'px')
111
+ wrapperElm.style.setProperty('min-width', opts.minWidth === null ? null : opts.minWidth + 'px')
112
+ wrapperElm.style.setProperty('padding', opts.padding)
113
+ wrapperElm.style.setProperty(
114
+ 'overflow-wrap',
115
+ opts.disableOverflowWrapBreaking ? 'normal' : 'break-word'
116
+ )
143
117
  if (opts.otherStyles) {
144
118
  for (const [key, value] of Object.entries(opts.otherStyles)) {
145
- elm.style.setProperty(key, value)
119
+ wrapperElm.style.setProperty(key, value)
146
120
  }
147
121
  }
148
122
 
149
- const scrollWidth = opts.measureScrollWidth ? elm.scrollWidth : 0
150
- const rect = elm.getBoundingClientRect()
123
+ const scrollWidth = wrapperElm.scrollWidth
124
+ const rect = wrapperElm.getBoundingClientRect()
125
+ wrapperElm.remove()
151
126
 
152
127
  return {
153
128
  x: 0,
@@ -272,29 +247,27 @@ export class TextManager {
272
247
  ): { text: string; box: BoxModel }[] {
273
248
  if (textToMeasure === '') return []
274
249
 
275
- const { elm } = this
276
-
277
- if (opts.otherStyles) {
278
- for (const key in opts.otherStyles) {
279
- if (!this.defaultStyles[key]) {
280
- // we need to save the original style so that we can restore it when we're done
281
- this.defaultStyles[key] = elm.style.getPropertyValue(key)
282
- }
283
- }
284
- }
285
-
286
- this.resetElmStyles()
287
-
288
- elm.style.setProperty('font-family', opts.fontFamily)
289
- elm.style.setProperty('font-style', opts.fontStyle)
290
- elm.style.setProperty('font-weight', opts.fontWeight)
291
- elm.style.setProperty('font-size', opts.fontSize + 'px')
292
- elm.style.setProperty('line-height', opts.lineHeight.toString())
250
+ const elm = this.baseElem.cloneNode() as HTMLDivElement
251
+ this.editor.getContainer().appendChild(elm)
293
252
 
294
253
  const elementWidth = Math.ceil(opts.width - opts.padding * 2)
254
+ elm.setAttribute('dir', 'auto')
255
+ // N.B. This property, while discouraged ("intended for Document Type Definition (DTD) designers")
256
+ // is necessary for ensuring correct mixed RTL/LTR behavior when exporting SVGs.
257
+ elm.style.setProperty('unicode-bidi', 'plaintext')
295
258
  elm.style.setProperty('width', `${elementWidth}px`)
296
259
  elm.style.setProperty('height', 'min-content')
260
+ elm.style.setProperty('font-size', `${opts.fontSize}px`)
261
+ elm.style.setProperty('font-family', opts.fontFamily)
262
+ elm.style.setProperty('font-weight', opts.fontWeight)
263
+ elm.style.setProperty('line-height', `${opts.lineHeight * opts.fontSize}px`)
297
264
  elm.style.setProperty('text-align', textAlignmentsForLtr[opts.textAlign])
265
+ elm.style.setProperty('font-style', opts.fontStyle)
266
+ if (opts.otherStyles) {
267
+ for (const [key, value] of Object.entries(opts.otherStyles)) {
268
+ elm.style.setProperty(key, value)
269
+ }
270
+ }
298
271
 
299
272
  const shouldTruncateToFirstLine =
300
273
  opts.overflow === 'truncate-ellipsis' || opts.overflow === 'truncate-clip'
@@ -304,12 +277,6 @@ export class TextManager {
304
277
  elm.style.setProperty('word-break', 'break-all')
305
278
  }
306
279
 
307
- if (opts.otherStyles) {
308
- for (const [key, value] of Object.entries(opts.otherStyles)) {
309
- elm.style.setProperty(key, value)
310
- }
311
- }
312
-
313
280
  const normalizedText = normalizeTextForDom(textToMeasure)
314
281
 
315
282
  // Render the text into the measurement element:
@@ -346,10 +313,11 @@ export class TextManager {
346
313
  h: lastSpan.box.h,
347
314
  },
348
315
  })
349
-
350
316
  return truncatedSpans
351
317
  }
352
318
 
319
+ elm.remove()
320
+
353
321
  return spans
354
322
  }
355
323
  }
@@ -745,7 +745,6 @@ export interface TLCropInfo<T extends TLShape> {
745
745
  crop: TLShapeCrop
746
746
  uncroppedSize: { w: number; h: number }
747
747
  initialShape: T
748
- aspectRatioLocked?: boolean
749
748
  }
750
749
 
751
750
  /**
@@ -206,15 +206,15 @@ export abstract class StateNode implements Partial<TLEventHandlers> {
206
206
  }
207
207
 
208
208
  // todo: move this logic into transition
209
- exit(info: any, to: string) {
209
+ exit(info: any, from: string) {
210
210
  if (debugFlags.measurePerformance.get() && this.performanceTracker.isStarted()) {
211
211
  this.performanceTracker.stop()
212
212
  }
213
213
  this._isActive.set(false)
214
- this.onExit?.(info, to)
214
+ this.onExit?.(info, from)
215
215
 
216
216
  if (!this.getIsActive()) {
217
- this.getCurrent()?.exit(info, to)
217
+ this.getCurrent()?.exit(info, from)
218
218
  }
219
219
  }
220
220
 
@@ -18,10 +18,6 @@ export interface TLEventMap {
18
18
  frame: [number]
19
19
  'select-all-text': [{ shapeId: TLShapeId }]
20
20
  'place-caret': [{ shapeId: TLShapeId; point: { x: number; y: number } }]
21
- 'created-shapes': [TLRecord[]]
22
- 'edited-shapes': [TLRecord[]]
23
- 'deleted-shapes': [TLShapeId[]]
24
- edit: []
25
21
  }
26
22
 
27
23
  /** @public */
@@ -1,4 +1,4 @@
1
- import { TLAssetId, TLShapeId } from '@tldraw/tlschema'
1
+ import { TLAssetId } from '@tldraw/tlschema'
2
2
  import { VecLike } from '../../primitives/Vec'
3
3
  import { TLContent } from './clipboard-types'
4
4
 
@@ -52,15 +52,7 @@ export interface TLTextExternalContent extends TLBaseExternalContent {
52
52
  export interface TLFilesExternalContent extends TLBaseExternalContent {
53
53
  type: 'files'
54
54
  files: File[]
55
- ignoreParent?: boolean
56
- }
57
-
58
- /** @public */
59
- export interface TLFileReplaceExternalContent extends TLBaseExternalContent {
60
- type: 'file-replace'
61
- file: File
62
- shapeId: TLShapeId
63
- isImage: boolean
55
+ ignoreParent: boolean
64
56
  }
65
57
 
66
58
  /** @public */
@@ -98,7 +90,6 @@ export interface TLExcalidrawExternalContent extends TLBaseExternalContent {
98
90
  export type TLExternalContent<EmbedDefinition> =
99
91
  | TLTextExternalContent
100
92
  | TLFilesExternalContent
101
- | TLFileReplaceExternalContent
102
93
  | TLUrlExternalContent
103
94
  | TLSvgTextExternalContent
104
95
  | TLEmbedExternalContent<EmbedDefinition>
@@ -137,6 +137,7 @@ export function useCanvasEvents() {
137
137
  type: 'files',
138
138
  files,
139
139
  point: editor.screenToPage({ x: e.clientX, y: e.clientY }),
140
+ ignoreParent: false,
140
141
  })
141
142
  return
142
143
  }
package/src/version.ts CHANGED
@@ -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.14.0-canary.efa8f9545620'
4
+ export const version = '3.14.0-canary.f27d19561239'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-06-24T11:15:20.974Z',
8
- patch: '2025-06-24T11:15:20.974Z',
7
+ minor: '2025-06-12T10:52:09.975Z',
8
+ patch: '2025-06-12T10:52:09.975Z',
9
9
  }