@tldraw/editor 3.16.0-canary.dbaaa1b0049c → 3.16.0-canary.df865b5492aa

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.
@@ -1,8 +1,8 @@
1
- const version = "3.16.0-canary.dbaaa1b0049c";
1
+ const version = "3.16.0-canary.df865b5492aa";
2
2
  const publishDates = {
3
3
  major: "2024-09-13T14:36:29.063Z",
4
- minor: "2025-08-20T10:00:26.481Z",
5
- patch: "2025-08-20T10:00:26.481Z"
4
+ minor: "2025-08-21T13:20:36.366Z",
5
+ patch: "2025-08-21T13:20:36.366Z"
6
6
  };
7
7
  export {
8
8
  publishDates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/version.ts"],
4
- "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.16.0-canary.dbaaa1b0049c'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-08-20T10:00:26.481Z',\n\tpatch: '2025-08-20T10:00:26.481Z',\n}\n"],
4
+ "sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.16.0-canary.df865b5492aa'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-08-21T13:20:36.366Z',\n\tpatch: '2025-08-21T13:20:36.366Z',\n}\n"],
5
5
  "mappings": "AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tldraw/editor",
3
3
  "description": "tldraw infinite canvas SDK (editor).",
4
- "version": "3.16.0-canary.dbaaa1b0049c",
4
+ "version": "3.16.0-canary.df865b5492aa",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -50,12 +50,12 @@
50
50
  "@tiptap/core": "^2.9.1",
51
51
  "@tiptap/pm": "^2.9.1",
52
52
  "@tiptap/react": "^2.9.1",
53
- "@tldraw/state": "3.16.0-canary.dbaaa1b0049c",
54
- "@tldraw/state-react": "3.16.0-canary.dbaaa1b0049c",
55
- "@tldraw/store": "3.16.0-canary.dbaaa1b0049c",
56
- "@tldraw/tlschema": "3.16.0-canary.dbaaa1b0049c",
57
- "@tldraw/utils": "3.16.0-canary.dbaaa1b0049c",
58
- "@tldraw/validate": "3.16.0-canary.dbaaa1b0049c",
53
+ "@tldraw/state": "3.16.0-canary.df865b5492aa",
54
+ "@tldraw/state-react": "3.16.0-canary.df865b5492aa",
55
+ "@tldraw/store": "3.16.0-canary.df865b5492aa",
56
+ "@tldraw/tlschema": "3.16.0-canary.df865b5492aa",
57
+ "@tldraw/utils": "3.16.0-canary.df865b5492aa",
58
+ "@tldraw/validate": "3.16.0-canary.df865b5492aa",
59
59
  "@types/core-js": "^2.5.8",
60
60
  "@use-gesture/react": "^10.3.1",
61
61
  "classnames": "^2.5.1",
@@ -586,8 +586,13 @@ function TldrawEditorWithReadyStore({
586
586
  if (editor !== fontLoadingState?.editor) {
587
587
  fontLoadingState = null
588
588
  }
589
- useEffect(() => {
589
+ useLayoutEffect(() => {
590
590
  if (!editor) return
591
+ if (editor.options.maxFontsToLoadBeforeRender === 0) {
592
+ setFontLoadingState({ editor, isLoaded: true })
593
+ return
594
+ }
595
+
591
596
  let isCancelled = false
592
597
 
593
598
  setFontLoadingState({ editor, isLoaded: false })
@@ -9519,6 +9519,24 @@ export class Editor extends EventEmitter<TLEventMap> {
9519
9519
  }
9520
9520
  }
9521
9521
 
9522
+ /**
9523
+ * Get an exported image of the given shapes as a data URL.
9524
+ *
9525
+ * @param shapes - The shapes (or shape ids) to export.
9526
+ * @param opts - Options for the export.
9527
+ *
9528
+ * @returns A data URL of the image.
9529
+ * @public
9530
+ */
9531
+ async toImageDataUrl(shapes: TLShapeId[] | TLShape[], opts: TLImageExportOptions = {}) {
9532
+ const { blob, width, height } = await this.toImage(shapes, opts)
9533
+ return {
9534
+ url: await FileHelpers.blobToDataUrl(blob),
9535
+ width,
9536
+ height,
9537
+ }
9538
+ }
9539
+
9522
9540
  /* --------------------- Events --------------------- */
9523
9541
 
9524
9542
  /**
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.16.0-canary.dbaaa1b0049c'
4
+ export const version = '3.16.0-canary.df865b5492aa'
5
5
  export const publishDates = {
6
6
  major: '2024-09-13T14:36:29.063Z',
7
- minor: '2025-08-20T10:00:26.481Z',
8
- patch: '2025-08-20T10:00:26.481Z',
7
+ minor: '2025-08-21T13:20:36.366Z',
8
+ patch: '2025-08-21T13:20:36.366Z',
9
9
  }