@tldraw/editor 3.14.0-canary.7b5fb115ed17 → 3.14.0-canary.7c3d5520bd87

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 (57) hide show
  1. package/dist-cjs/index.d.ts +31 -39
  2. package/dist-cjs/index.js +1 -3
  3. package/dist-cjs/index.js.map +2 -2
  4. package/dist-cjs/lib/config/TLSessionStateSnapshot.js +1 -12
  5. package/dist-cjs/lib/config/TLSessionStateSnapshot.js.map +3 -3
  6. package/dist-cjs/lib/editor/Editor.js +9 -5
  7. package/dist-cjs/lib/editor/Editor.js.map +2 -2
  8. package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +2 -2
  9. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js +1 -2
  10. package/dist-cjs/lib/editor/managers/FontManager/FontManager.js.map +2 -2
  11. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +72 -42
  12. package/dist-cjs/lib/editor/managers/TextManager/TextManager.js.map +2 -2
  13. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js +1 -1
  14. package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +1 -1
  15. package/dist-cjs/lib/primitives/Box.js +0 -6
  16. package/dist-cjs/lib/primitives/Box.js.map +2 -2
  17. package/dist-cjs/lib/utils/areShapesContentEqual.js +1 -1
  18. package/dist-cjs/lib/utils/areShapesContentEqual.js.map +2 -2
  19. package/dist-cjs/lib/utils/richText.js +7 -2
  20. package/dist-cjs/lib/utils/richText.js.map +2 -2
  21. package/dist-cjs/version.js +3 -3
  22. package/dist-cjs/version.js.map +1 -1
  23. package/dist-esm/index.d.mts +31 -39
  24. package/dist-esm/index.mjs +1 -3
  25. package/dist-esm/index.mjs.map +2 -2
  26. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs +1 -1
  27. package/dist-esm/lib/config/TLSessionStateSnapshot.mjs.map +2 -2
  28. package/dist-esm/lib/editor/Editor.mjs +9 -5
  29. package/dist-esm/lib/editor/Editor.mjs.map +2 -2
  30. package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
  31. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs +1 -2
  32. package/dist-esm/lib/editor/managers/FontManager/FontManager.mjs.map +2 -2
  33. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +72 -42
  34. package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs.map +2 -2
  35. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs +1 -1
  36. package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +1 -1
  37. package/dist-esm/lib/primitives/Box.mjs +0 -6
  38. package/dist-esm/lib/primitives/Box.mjs.map +2 -2
  39. package/dist-esm/lib/utils/areShapesContentEqual.mjs +1 -1
  40. package/dist-esm/lib/utils/areShapesContentEqual.mjs.map +2 -2
  41. package/dist-esm/lib/utils/richText.mjs +8 -3
  42. package/dist-esm/lib/utils/richText.mjs.map +2 -2
  43. package/dist-esm/version.mjs +3 -3
  44. package/dist-esm/version.mjs.map +1 -1
  45. package/editor.css +458 -523
  46. package/package.json +8 -9
  47. package/src/index.ts +1 -1
  48. package/src/lib/config/TLSessionStateSnapshot.ts +1 -1
  49. package/src/lib/editor/Editor.ts +6 -2
  50. package/src/lib/editor/bindings/BindingUtil.ts +6 -0
  51. package/src/lib/editor/managers/FontManager/FontManager.ts +1 -2
  52. package/src/lib/editor/managers/TextManager/TextManager.ts +114 -86
  53. package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -1
  54. package/src/lib/primitives/Box.ts +0 -8
  55. package/src/lib/utils/areShapesContentEqual.ts +1 -2
  56. package/src/lib/utils/richText.ts +9 -3
  57. 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.7b5fb115ed17",
4
+ "version": "3.14.0-canary.7c3d5520bd87",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -48,20 +48,19 @@
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.7b5fb115ed17",
52
- "@tldraw/state-react": "3.14.0-canary.7b5fb115ed17",
53
- "@tldraw/store": "3.14.0-canary.7b5fb115ed17",
54
- "@tldraw/tlschema": "3.14.0-canary.7b5fb115ed17",
55
- "@tldraw/utils": "3.14.0-canary.7b5fb115ed17",
56
- "@tldraw/validate": "3.14.0-canary.7b5fb115ed17",
51
+ "@tldraw/state": "3.14.0-canary.7c3d5520bd87",
52
+ "@tldraw/state-react": "3.14.0-canary.7c3d5520bd87",
53
+ "@tldraw/store": "3.14.0-canary.7c3d5520bd87",
54
+ "@tldraw/tlschema": "3.14.0-canary.7c3d5520bd87",
55
+ "@tldraw/utils": "3.14.0-canary.7c3d5520bd87",
56
+ "@tldraw/validate": "3.14.0-canary.7c3d5520bd87",
57
57
  "@types/core-js": "^2.5.8",
58
58
  "@use-gesture/react": "^10.3.1",
59
59
  "classnames": "^2.5.1",
60
60
  "core-js": "^3.40.0",
61
61
  "eventemitter3": "^4.0.7",
62
62
  "idb": "^7.1.1",
63
- "is-plain-object": "^5.0.0",
64
- "lodash.isequal": "^4.5.0"
63
+ "is-plain-object": "^5.0.0"
65
64
  },
66
65
  "peerDependencies": {
67
66
  "react": "^18.2.0 || ^19.0.0",
package/src/index.ts CHANGED
@@ -4,7 +4,6 @@ import 'core-js/stable/array/flat-map.js'
4
4
  import 'core-js/stable/array/flat.js'
5
5
  import 'core-js/stable/string/at.js'
6
6
  import 'core-js/stable/string/replace-all.js'
7
- export { areShapesContentEqual } from './lib/utils/areShapesContentEqual'
8
7
 
9
8
  // eslint-disable-next-line local/no-export-star
10
9
  export * from '@tldraw/state'
@@ -175,6 +174,7 @@ export {
175
174
  } from './lib/editor/managers/SnapManager/SnapManager'
176
175
  export {
177
176
  TextManager,
177
+ type TLMeasureTextOpts,
178
178
  type TLMeasureTextSpanOpts,
179
179
  } from './lib/editor/managers/TextManager/TextManager'
180
180
  export { UserPreferencesManager } from './lib/editor/managers/UserPreferencesManager/UserPreferencesManager'
@@ -14,12 +14,12 @@ import {
14
14
  import {
15
15
  deleteFromSessionStorage,
16
16
  getFromSessionStorage,
17
+ isEqual,
17
18
  setInSessionStorage,
18
19
  structuredClone,
19
20
  uniqueId,
20
21
  } from '@tldraw/utils'
21
22
  import { T } from '@tldraw/validate'
22
- import isEqual from 'lodash.isequal'
23
23
  import { tlenv } from '../globals/environment'
24
24
 
25
25
  const tabIdKey = 'TLDRAW_TAB_ID_v2' as const
@@ -348,6 +348,8 @@ 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
+
351
353
  this.fonts = new FontManager(this, fontAssetUrls)
352
354
 
353
355
  this._tickManager = new TickManager(this)
@@ -506,14 +508,13 @@ export class Editor extends EventEmitter<TLEventMap> {
506
508
  shape: {
507
509
  afterChange: (shapeBefore, shapeAfter) => {
508
510
  for (const binding of this.getBindingsInvolvingShape(shapeAfter)) {
509
- if (areShapesContentEqual(shapeBefore, shapeAfter)) continue
510
-
511
511
  invalidBindingTypes.add(binding.type)
512
512
  if (binding.fromId === shapeAfter.id) {
513
513
  this.getBindingUtil(binding).onAfterChangeFromShape?.({
514
514
  binding,
515
515
  shapeBefore,
516
516
  shapeAfter,
517
+ reason: 'self',
517
518
  })
518
519
  }
519
520
  if (binding.toId === shapeAfter.id) {
@@ -521,6 +522,7 @@ export class Editor extends EventEmitter<TLEventMap> {
521
522
  binding,
522
523
  shapeBefore,
523
524
  shapeAfter,
525
+ reason: 'self',
524
526
  })
525
527
  }
526
528
  }
@@ -539,6 +541,7 @@ export class Editor extends EventEmitter<TLEventMap> {
539
541
  binding,
540
542
  shapeBefore: descendantShape,
541
543
  shapeAfter: descendantShape,
544
+ reason: 'ancestry',
542
545
  })
543
546
  }
544
547
  if (binding.toId === descendantShape.id) {
@@ -546,6 +549,7 @@ export class Editor extends EventEmitter<TLEventMap> {
546
549
  binding,
547
550
  shapeBefore: descendantShape,
548
551
  shapeAfter: descendantShape,
552
+ reason: 'ancestry',
549
553
  })
550
554
  }
551
555
  }
@@ -62,6 +62,12 @@ export interface BindingOnShapeChangeOptions<Binding extends TLUnknownBinding> {
62
62
  shapeBefore: TLShape
63
63
  /** The shape record after the change is made. */
64
64
  shapeAfter: TLShape
65
+ /**
66
+ * Why did this shape change?
67
+ * - 'self': the shape itself changed
68
+ * - 'ancestry': the ancestry of the shape changed, but the shape itself may not have done
69
+ */
70
+ reason: 'self' | 'ancestry'
65
71
  }
66
72
 
67
73
  /**
@@ -96,8 +96,7 @@ export class FontManager {
96
96
  },
97
97
  {
98
98
  areResultsEqual: areArraysShallowEqual,
99
- // @ts-expect-error
100
- areRecordsEqual: (a, b) => a.props.richText === b.props.richText,
99
+ areRecordsEqual: (a, b) => a.props === b.props && a.meta === b.meta,
101
100
  }
102
101
  )
103
102
 
@@ -20,6 +20,26 @@ 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
+ lineHeight: number
30
+ /**
31
+ * When maxWidth is a number, the text will be wrapped to that maxWidth. When maxWidth
32
+ * is null, the text will be measured without wrapping, but explicit line breaks and
33
+ * space are preserved.
34
+ */
35
+ maxWidth: null | number
36
+ minWidth?: null | number
37
+ // todo: make this a number so that it is consistent with other TLMeasureTextSpanOpts
38
+ padding: string
39
+ otherStyles?: Record<string, string>
40
+ disableOverflowWrapBreaking?: boolean
41
+ }
42
+
23
43
  /** @public */
24
44
  export interface TLMeasureTextSpanOpts {
25
45
  overflow: 'wrap' | 'truncate-ellipsis' | 'truncate-clip'
@@ -39,90 +59,91 @@ const spaceCharacterRegex = /\s/
39
59
 
40
60
  /** @public */
41
61
  export class TextManager {
42
- private baseElem: HTMLDivElement
62
+ private elm: HTMLDivElement
63
+ private defaultStyles: Record<string, string | null>
43
64
 
44
65
  constructor(public editor: Editor) {
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
66
+ const elm = document.createElement('div')
67
+ elm.classList.add('tl-text')
68
+ elm.classList.add('tl-text-measure')
69
+ elm.setAttribute('dir', 'auto')
70
+ elm.tabIndex = -1
71
+ this.editor.getContainer().appendChild(elm)
72
+
73
+ // we need to save the default styles so that we can restore them when we're done
74
+ // these must be the css names, not the js names for the styles
75
+ this.defaultStyles = {
76
+ 'word-break': 'auto',
77
+ width: null,
78
+ height: null,
79
+ 'max-width': null,
80
+ 'min-width': null,
81
+ }
82
+
83
+ this.elm = elm
49
84
  }
50
85
 
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
86
+ dispose() {
87
+ return this.elm.remove()
88
+ }
89
+
90
+ private resetElmStyles() {
91
+ const { elm, defaultStyles } = this
92
+ for (const key in defaultStyles) {
93
+ elm.style.setProperty(key, defaultStyles[key])
68
94
  }
69
- ): BoxModel & { scrollWidth: number } {
95
+ }
96
+
97
+ measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & { scrollWidth: number } {
70
98
  const div = document.createElement('div')
71
99
  div.textContent = normalizeTextForDom(textToMeasure)
72
100
  return this.measureHtml(div.innerHTML, opts)
73
101
  }
74
102
 
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
103
+ measureHtml(html: string, opts: TLMeasureTextOpts): BoxModel & { scrollWidth: number } {
104
+ const { elm } = this
105
+
106
+ if (opts.otherStyles) {
107
+ for (const key in opts.otherStyles) {
108
+ if (!this.defaultStyles[key]) {
109
+ // we need to save the original style so that we can restore it when we're done
110
+ this.defaultStyles[key] = elm.style.getPropertyValue(key)
111
+ }
112
+ }
93
113
  }
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
- )
114
+
115
+ elm.innerHTML = html
116
+
117
+ // Apply the default styles to the element (for all styles here or that were ever seen in opts.otherStyles)
118
+ this.resetElmStyles()
119
+
120
+ elm.style.setProperty('font-family', opts.fontFamily)
121
+ elm.style.setProperty('font-style', opts.fontStyle)
122
+ elm.style.setProperty('font-weight', opts.fontWeight)
123
+ elm.style.setProperty('font-size', opts.fontSize + 'px')
124
+ elm.style.setProperty('line-height', opts.lineHeight * opts.fontSize + 'px')
125
+ elm.style.setProperty('padding', opts.padding)
126
+
127
+ if (opts.maxWidth) {
128
+ elm.style.setProperty('max-width', opts.maxWidth + 'px')
129
+ }
130
+
131
+ if (opts.minWidth) {
132
+ elm.style.setProperty('min-width', opts.minWidth + 'px')
133
+ }
134
+
135
+ if (opts.disableOverflowWrapBreaking) {
136
+ elm.style.setProperty('overflow-wrap', 'normal')
137
+ }
138
+
117
139
  if (opts.otherStyles) {
118
140
  for (const [key, value] of Object.entries(opts.otherStyles)) {
119
- wrapperElm.style.setProperty(key, value)
141
+ elm.style.setProperty(key, value)
120
142
  }
121
143
  }
122
144
 
123
- const scrollWidth = wrapperElm.scrollWidth
124
- const rect = wrapperElm.getBoundingClientRect()
125
- wrapperElm.remove()
145
+ const scrollWidth = elm.scrollWidth
146
+ const rect = elm.getBoundingClientRect()
126
147
 
127
148
  return {
128
149
  x: 0,
@@ -247,27 +268,29 @@ export class TextManager {
247
268
  ): { text: string; box: BoxModel }[] {
248
269
  if (textToMeasure === '') return []
249
270
 
250
- const elm = this.baseElem.cloneNode() as HTMLDivElement
251
- this.editor.getContainer().appendChild(elm)
271
+ const { elm } = this
272
+
273
+ if (opts.otherStyles) {
274
+ for (const key in opts.otherStyles) {
275
+ if (!this.defaultStyles[key]) {
276
+ // we need to save the original style so that we can restore it when we're done
277
+ this.defaultStyles[key] = elm.style.getPropertyValue(key)
278
+ }
279
+ }
280
+ }
281
+
282
+ this.resetElmStyles()
283
+
284
+ elm.style.setProperty('font-family', opts.fontFamily)
285
+ elm.style.setProperty('font-style', opts.fontStyle)
286
+ elm.style.setProperty('font-weight', opts.fontWeight)
287
+ elm.style.setProperty('font-size', opts.fontSize + 'px')
288
+ elm.style.setProperty('line-height', opts.lineHeight * opts.fontSize + 'px')
252
289
 
253
290
  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')
258
291
  elm.style.setProperty('width', `${elementWidth}px`)
259
292
  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`)
264
293
  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
- }
271
294
 
272
295
  const shouldTruncateToFirstLine =
273
296
  opts.overflow === 'truncate-ellipsis' || opts.overflow === 'truncate-clip'
@@ -277,6 +300,12 @@ export class TextManager {
277
300
  elm.style.setProperty('word-break', 'break-all')
278
301
  }
279
302
 
303
+ if (opts.otherStyles) {
304
+ for (const [key, value] of Object.entries(opts.otherStyles)) {
305
+ elm.style.setProperty(key, value)
306
+ }
307
+ }
308
+
280
309
  const normalizedText = normalizeTextForDom(textToMeasure)
281
310
 
282
311
  // Render the text into the measurement element:
@@ -313,11 +342,10 @@ export class TextManager {
313
342
  h: lastSpan.box.h,
314
343
  },
315
344
  })
345
+
316
346
  return truncatedSpans
317
347
  }
318
348
 
319
- elm.remove()
320
-
321
349
  return spans
322
350
  }
323
351
  }
@@ -21,7 +21,7 @@ export class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
21
21
  }
22
22
 
23
23
  canResize() {
24
- return false
24
+ return true
25
25
  }
26
26
 
27
27
  canResizeChildren() {
@@ -591,14 +591,6 @@ export class Box {
591
591
  return b.x === a.x && b.y === a.y && b.w === a.w && b.h === a.h
592
592
  }
593
593
 
594
- prettyMuchEquals(other: Box | BoxModel) {
595
- return this.clone().toFixed().equals(Box.From(other).toFixed())
596
- }
597
-
598
- static PrettyMuchEquals(a: Box | BoxModel, b: Box | BoxModel) {
599
- return b.x === a.x && b.y === a.y && b.w === a.w && b.h === a.h
600
- }
601
-
602
594
  zeroFix() {
603
595
  this.w = Math.max(1, this.w)
604
596
  this.h = Math.max(1, this.h)
@@ -1,5 +1,4 @@
1
1
  import { TLShape } from '@tldraw/tlschema'
2
2
 
3
- /** @public */
4
3
  export const areShapesContentEqual = (a: TLShape, b: TLShape) =>
5
- a.parentId === b.parentId && a.props === b.props && a.meta === b.meta
4
+ a.props === b.props && a.meta === b.meta
@@ -1,8 +1,8 @@
1
1
  import { getSchema, JSONContent, Editor as TTEditor } from '@tiptap/core'
2
- import { Node } from '@tiptap/pm/model'
2
+ import { Node, Schema } from '@tiptap/pm/model'
3
3
  import { EditorProviderProps } from '@tiptap/react'
4
4
  import { TLRichText } from '@tldraw/tlschema'
5
- import { assert } from '@tldraw/utils'
5
+ import { assert, WeakCache } from '@tldraw/utils'
6
6
  import { Editor } from '../editor/Editor'
7
7
  import { TLFontFace } from '../editor/managers/FontManager/FontManager'
8
8
 
@@ -39,6 +39,11 @@ export type RichTextFontVisitor = (
39
39
  addFont: (font: TLFontFace) => void
40
40
  ) => RichTextFontVisitorState
41
41
 
42
+ const schemaCache = new WeakCache<EditorProviderProps, Schema>()
43
+ export function getTipTapSchema(tipTapConfig: EditorProviderProps) {
44
+ return schemaCache.get(tipTapConfig, () => getSchema(tipTapConfig.extensions ?? []))
45
+ }
46
+
42
47
  /** @public */
43
48
  export function getFontsFromRichText(
44
49
  editor: Editor,
@@ -49,7 +54,8 @@ export function getFontsFromRichText(
49
54
  assert(tipTapConfig, 'textOptions.tipTapConfig must be set to use rich text')
50
55
  assert(addFontsFromNode, 'textOptions.addFontsFromNode must be set to use rich text')
51
56
 
52
- const schema = getSchema(tipTapConfig.extensions ?? [])
57
+ const schema = getTipTapSchema(tipTapConfig)
58
+
53
59
  const rootNode = Node.fromJSON(schema, richText as JSONContent)
54
60
 
55
61
  const fonts = new Set<TLFontFace>()
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.7b5fb115ed17'
4
+ export const version = '3.14.0-canary.7c3d5520bd87'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-06-10T07:39:27.416Z',
8
- patch: '2025-06-10T07:39:27.416Z',
7
+ minor: '2025-06-15T21:37:09.721Z',
8
+ patch: '2025-06-15T21:37:09.721Z',
9
9
  }