tldraw 4.2.0-next.ee2c79e2a3cb → 4.2.0-next.f100cedfc45b

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.
package/dist-cjs/index.js CHANGED
@@ -584,7 +584,7 @@ var import_buildFromV1Document = require("./lib/utils/tldr/buildFromV1Document")
584
584
  var import_file = require("./lib/utils/tldr/file");
585
585
  (0, import_editor.registerTldrawLibraryVersion)(
586
586
  "tldraw",
587
- "4.2.0-next.ee2c79e2a3cb",
587
+ "4.2.0-next.f100cedfc45b",
588
588
  "cjs"
589
589
  );
590
590
  //# sourceMappingURL=index.js.map
@@ -28,15 +28,30 @@ function getLocalFiles(options) {
28
28
  input.type = "file";
29
29
  input.accept = mimeTypes?.join(",");
30
30
  input.multiple = allowMultiple;
31
+ input.style.display = "none";
32
+ function dispose() {
33
+ input.removeEventListener("change", onchange);
34
+ input.removeEventListener("cancel", oncancel);
35
+ input.remove();
36
+ }
31
37
  async function onchange(e) {
32
38
  const fileList = e.target.files;
33
- if (!fileList || fileList.length === 0) return;
39
+ if (!fileList || fileList.length === 0) {
40
+ resolve([]);
41
+ dispose();
42
+ return;
43
+ }
34
44
  const files = Array.from(fileList);
35
45
  input.value = "";
36
46
  resolve(files);
37
- input.removeEventListener("change", onchange);
38
- input.remove();
47
+ dispose();
48
+ }
49
+ function oncancel() {
50
+ resolve([]);
51
+ dispose();
39
52
  }
53
+ document.body.appendChild(input);
54
+ input.addEventListener("cancel", oncancel);
40
55
  input.addEventListener("change", onchange);
41
56
  input?.click();
42
57
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/ui/getLocalFiles.ts"],
4
- "sourcesContent": ["export function getLocalFiles(options?: {\n\tallowMultiple?: boolean\n\tmimeTypes?: string[] | readonly string[]\n}) {\n\treturn new Promise<File[]>((resolve) => {\n\t\tconst { allowMultiple = true, mimeTypes = [] } = options || {}\n\n\t\tconst input = document.createElement('input')\n\t\tinput.type = 'file'\n\t\tinput.accept = mimeTypes?.join(',')\n\t\tinput.multiple = allowMultiple\n\n\t\tasync function onchange(e: Event) {\n\t\t\tconst fileList = (e.target as HTMLInputElement).files\n\t\t\tif (!fileList || fileList.length === 0) return\n\t\t\tconst files = Array.from(fileList)\n\t\t\tinput.value = ''\n\t\t\tresolve(files)\n\t\t\tinput.removeEventListener('change', onchange)\n\t\t\tinput.remove()\n\t\t}\n\n\t\tinput.addEventListener('change', onchange)\n\t\tinput?.click()\n\t})\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,cAAc,SAG3B;AACF,SAAO,IAAI,QAAgB,CAAC,YAAY;AACvC,UAAM,EAAE,gBAAgB,MAAM,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC;AAE7D,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,SAAS,WAAW,KAAK,GAAG;AAClC,UAAM,WAAW;AAEjB,mBAAe,SAAS,GAAU;AACjC,YAAM,WAAY,EAAE,OAA4B;AAChD,UAAI,CAAC,YAAY,SAAS,WAAW,EAAG;AACxC,YAAM,QAAQ,MAAM,KAAK,QAAQ;AACjC,YAAM,QAAQ;AACd,cAAQ,KAAK;AACb,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,OAAO;AAAA,IACd;AAEA,UAAM,iBAAiB,UAAU,QAAQ;AACzC,WAAO,MAAM;AAAA,EACd,CAAC;AACF;",
4
+ "sourcesContent": ["export function getLocalFiles(options?: {\n\tallowMultiple?: boolean\n\tmimeTypes?: string[] | readonly string[]\n}) {\n\treturn new Promise<File[]>((resolve) => {\n\t\tconst { allowMultiple = true, mimeTypes = [] } = options || {}\n\n\t\tconst input = document.createElement('input')\n\t\tinput.type = 'file'\n\t\tinput.accept = mimeTypes?.join(',')\n\t\tinput.multiple = allowMultiple\n\t\tinput.style.display = 'none'\n\n\t\tfunction dispose() {\n\t\t\tinput.removeEventListener('change', onchange)\n\t\t\tinput.removeEventListener('cancel', oncancel)\n\t\t\tinput.remove()\n\t\t}\n\n\t\tasync function onchange(e: Event) {\n\t\t\tconst fileList = (e.target as HTMLInputElement).files\n\t\t\tif (!fileList || fileList.length === 0) {\n\t\t\t\tresolve([])\n\t\t\t\tdispose()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst files = Array.from(fileList)\n\t\t\tinput.value = ''\n\t\t\tresolve(files)\n\t\t\tdispose()\n\t\t}\n\n\t\tfunction oncancel() {\n\t\t\tresolve([])\n\t\t\tdispose()\n\t\t}\n\n\t\tdocument.body.appendChild(input)\n\t\tinput.addEventListener('cancel', oncancel)\n\t\tinput.addEventListener('change', onchange)\n\t\tinput?.click()\n\t})\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,cAAc,SAG3B;AACF,SAAO,IAAI,QAAgB,CAAC,YAAY;AACvC,UAAM,EAAE,gBAAgB,MAAM,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC;AAE7D,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,SAAS,WAAW,KAAK,GAAG;AAClC,UAAM,WAAW;AACjB,UAAM,MAAM,UAAU;AAEtB,aAAS,UAAU;AAClB,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,OAAO;AAAA,IACd;AAEA,mBAAe,SAAS,GAAU;AACjC,YAAM,WAAY,EAAE,OAA4B;AAChD,UAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACvC,gBAAQ,CAAC,CAAC;AACV,gBAAQ;AACR;AAAA,MACD;AACA,YAAM,QAAQ,MAAM,KAAK,QAAQ;AACjC,YAAM,QAAQ;AACd,cAAQ,KAAK;AACb,cAAQ;AAAA,IACT;AAEA,aAAS,WAAW;AACnB,cAAQ,CAAC,CAAC;AACV,cAAQ;AAAA,IACT;AAEA,aAAS,KAAK,YAAY,KAAK;AAC/B,UAAM,iBAAiB,UAAU,QAAQ;AACzC,UAAM,iBAAiB,UAAU,QAAQ;AACzC,WAAO,MAAM;AAAA,EACd,CAAC;AACF;",
6
6
  "names": []
7
7
  }
@@ -22,10 +22,10 @@ __export(version_exports, {
22
22
  version: () => version
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const version = "4.2.0-next.ee2c79e2a3cb";
25
+ const version = "4.2.0-next.f100cedfc45b";
26
26
  const publishDates = {
27
27
  major: "2025-09-18T14:39:22.803Z",
28
- minor: "2025-10-29T10:36:48.845Z",
29
- patch: "2025-10-29T10:36:48.845Z"
28
+ minor: "2025-10-29T17:33:15.385Z",
29
+ patch: "2025-10-29T17:33:15.385Z"
30
30
  };
31
31
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/ui/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 = '4.2.0-next.ee2c79e2a3cb'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-10-29T10:36:48.845Z',\n\tpatch: '2025-10-29T10:36:48.845Z',\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 = '4.2.0-next.f100cedfc45b'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-10-29T17:33:15.385Z',\n\tpatch: '2025-10-29T17:33:15.385Z',\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -533,7 +533,7 @@ import {
533
533
  } from "./lib/utils/tldr/file.mjs";
534
534
  registerTldrawLibraryVersion(
535
535
  "tldraw",
536
- "4.2.0-next.ee2c79e2a3cb",
536
+ "4.2.0-next.f100cedfc45b",
537
537
  "esm"
538
538
  );
539
539
  export {
@@ -5,15 +5,30 @@ function getLocalFiles(options) {
5
5
  input.type = "file";
6
6
  input.accept = mimeTypes?.join(",");
7
7
  input.multiple = allowMultiple;
8
+ input.style.display = "none";
9
+ function dispose() {
10
+ input.removeEventListener("change", onchange);
11
+ input.removeEventListener("cancel", oncancel);
12
+ input.remove();
13
+ }
8
14
  async function onchange(e) {
9
15
  const fileList = e.target.files;
10
- if (!fileList || fileList.length === 0) return;
16
+ if (!fileList || fileList.length === 0) {
17
+ resolve([]);
18
+ dispose();
19
+ return;
20
+ }
11
21
  const files = Array.from(fileList);
12
22
  input.value = "";
13
23
  resolve(files);
14
- input.removeEventListener("change", onchange);
15
- input.remove();
24
+ dispose();
25
+ }
26
+ function oncancel() {
27
+ resolve([]);
28
+ dispose();
16
29
  }
30
+ document.body.appendChild(input);
31
+ input.addEventListener("cancel", oncancel);
17
32
  input.addEventListener("change", onchange);
18
33
  input?.click();
19
34
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/ui/getLocalFiles.ts"],
4
- "sourcesContent": ["export function getLocalFiles(options?: {\n\tallowMultiple?: boolean\n\tmimeTypes?: string[] | readonly string[]\n}) {\n\treturn new Promise<File[]>((resolve) => {\n\t\tconst { allowMultiple = true, mimeTypes = [] } = options || {}\n\n\t\tconst input = document.createElement('input')\n\t\tinput.type = 'file'\n\t\tinput.accept = mimeTypes?.join(',')\n\t\tinput.multiple = allowMultiple\n\n\t\tasync function onchange(e: Event) {\n\t\t\tconst fileList = (e.target as HTMLInputElement).files\n\t\t\tif (!fileList || fileList.length === 0) return\n\t\t\tconst files = Array.from(fileList)\n\t\t\tinput.value = ''\n\t\t\tresolve(files)\n\t\t\tinput.removeEventListener('change', onchange)\n\t\t\tinput.remove()\n\t\t}\n\n\t\tinput.addEventListener('change', onchange)\n\t\tinput?.click()\n\t})\n}\n"],
5
- "mappings": "AAAO,SAAS,cAAc,SAG3B;AACF,SAAO,IAAI,QAAgB,CAAC,YAAY;AACvC,UAAM,EAAE,gBAAgB,MAAM,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC;AAE7D,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,SAAS,WAAW,KAAK,GAAG;AAClC,UAAM,WAAW;AAEjB,mBAAe,SAAS,GAAU;AACjC,YAAM,WAAY,EAAE,OAA4B;AAChD,UAAI,CAAC,YAAY,SAAS,WAAW,EAAG;AACxC,YAAM,QAAQ,MAAM,KAAK,QAAQ;AACjC,YAAM,QAAQ;AACd,cAAQ,KAAK;AACb,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,OAAO;AAAA,IACd;AAEA,UAAM,iBAAiB,UAAU,QAAQ;AACzC,WAAO,MAAM;AAAA,EACd,CAAC;AACF;",
4
+ "sourcesContent": ["export function getLocalFiles(options?: {\n\tallowMultiple?: boolean\n\tmimeTypes?: string[] | readonly string[]\n}) {\n\treturn new Promise<File[]>((resolve) => {\n\t\tconst { allowMultiple = true, mimeTypes = [] } = options || {}\n\n\t\tconst input = document.createElement('input')\n\t\tinput.type = 'file'\n\t\tinput.accept = mimeTypes?.join(',')\n\t\tinput.multiple = allowMultiple\n\t\tinput.style.display = 'none'\n\n\t\tfunction dispose() {\n\t\t\tinput.removeEventListener('change', onchange)\n\t\t\tinput.removeEventListener('cancel', oncancel)\n\t\t\tinput.remove()\n\t\t}\n\n\t\tasync function onchange(e: Event) {\n\t\t\tconst fileList = (e.target as HTMLInputElement).files\n\t\t\tif (!fileList || fileList.length === 0) {\n\t\t\t\tresolve([])\n\t\t\t\tdispose()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst files = Array.from(fileList)\n\t\t\tinput.value = ''\n\t\t\tresolve(files)\n\t\t\tdispose()\n\t\t}\n\n\t\tfunction oncancel() {\n\t\t\tresolve([])\n\t\t\tdispose()\n\t\t}\n\n\t\tdocument.body.appendChild(input)\n\t\tinput.addEventListener('cancel', oncancel)\n\t\tinput.addEventListener('change', onchange)\n\t\tinput?.click()\n\t})\n}\n"],
5
+ "mappings": "AAAO,SAAS,cAAc,SAG3B;AACF,SAAO,IAAI,QAAgB,CAAC,YAAY;AACvC,UAAM,EAAE,gBAAgB,MAAM,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC;AAE7D,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,SAAS,WAAW,KAAK,GAAG;AAClC,UAAM,WAAW;AACjB,UAAM,MAAM,UAAU;AAEtB,aAAS,UAAU;AAClB,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,oBAAoB,UAAU,QAAQ;AAC5C,YAAM,OAAO;AAAA,IACd;AAEA,mBAAe,SAAS,GAAU;AACjC,YAAM,WAAY,EAAE,OAA4B;AAChD,UAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACvC,gBAAQ,CAAC,CAAC;AACV,gBAAQ;AACR;AAAA,MACD;AACA,YAAM,QAAQ,MAAM,KAAK,QAAQ;AACjC,YAAM,QAAQ;AACd,cAAQ,KAAK;AACb,cAAQ;AAAA,IACT;AAEA,aAAS,WAAW;AACnB,cAAQ,CAAC,CAAC;AACV,cAAQ;AAAA,IACT;AAEA,aAAS,KAAK,YAAY,KAAK;AAC/B,UAAM,iBAAiB,UAAU,QAAQ;AACzC,UAAM,iBAAiB,UAAU,QAAQ;AACzC,WAAO,MAAM;AAAA,EACd,CAAC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,8 @@
1
- const version = "4.2.0-next.ee2c79e2a3cb";
1
+ const version = "4.2.0-next.f100cedfc45b";
2
2
  const publishDates = {
3
3
  major: "2025-09-18T14:39:22.803Z",
4
- minor: "2025-10-29T10:36:48.845Z",
5
- patch: "2025-10-29T10:36:48.845Z"
4
+ minor: "2025-10-29T17:33:15.385Z",
5
+ patch: "2025-10-29T17:33:15.385Z"
6
6
  };
7
7
  export {
8
8
  publishDates,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/ui/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 = '4.2.0-next.ee2c79e2a3cb'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-10-29T10:36:48.845Z',\n\tpatch: '2025-10-29T10:36:48.845Z',\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 = '4.2.0-next.f100cedfc45b'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-10-29T17:33:15.385Z',\n\tpatch: '2025-10-29T17:33:15.385Z',\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",
3
3
  "description": "A tiny little drawing editor.",
4
- "version": "4.2.0-next.ee2c79e2a3cb",
4
+ "version": "4.2.0-next.f100cedfc45b",
5
5
  "author": {
6
6
  "name": "tldraw Inc.",
7
7
  "email": "hello@tldraw.com"
@@ -62,8 +62,8 @@
62
62
  "@tiptap/pm": "3.6.2",
63
63
  "@tiptap/react": "3.6.2",
64
64
  "@tiptap/starter-kit": "3.6.2",
65
- "@tldraw/editor": "4.2.0-next.ee2c79e2a3cb",
66
- "@tldraw/store": "4.2.0-next.ee2c79e2a3cb",
65
+ "@tldraw/editor": "4.2.0-next.f100cedfc45b",
66
+ "@tldraw/store": "4.2.0-next.f100cedfc45b",
67
67
  "classnames": "^2.5.1",
68
68
  "hotkeys-js": "^3.13.9",
69
69
  "idb": "^7.1.1",
@@ -9,17 +9,34 @@ export function getLocalFiles(options?: {
9
9
  input.type = 'file'
10
10
  input.accept = mimeTypes?.join(',')
11
11
  input.multiple = allowMultiple
12
+ input.style.display = 'none'
13
+
14
+ function dispose() {
15
+ input.removeEventListener('change', onchange)
16
+ input.removeEventListener('cancel', oncancel)
17
+ input.remove()
18
+ }
12
19
 
13
20
  async function onchange(e: Event) {
14
21
  const fileList = (e.target as HTMLInputElement).files
15
- if (!fileList || fileList.length === 0) return
22
+ if (!fileList || fileList.length === 0) {
23
+ resolve([])
24
+ dispose()
25
+ return
26
+ }
16
27
  const files = Array.from(fileList)
17
28
  input.value = ''
18
29
  resolve(files)
19
- input.removeEventListener('change', onchange)
20
- input.remove()
30
+ dispose()
31
+ }
32
+
33
+ function oncancel() {
34
+ resolve([])
35
+ dispose()
21
36
  }
22
37
 
38
+ document.body.appendChild(input)
39
+ input.addEventListener('cancel', oncancel)
23
40
  input.addEventListener('change', onchange)
24
41
  input?.click()
25
42
  })
@@ -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 = '4.2.0-next.ee2c79e2a3cb'
4
+ export const version = '4.2.0-next.f100cedfc45b'
5
5
  export const publishDates = {
6
6
  major: '2025-09-18T14:39:22.803Z',
7
- minor: '2025-10-29T10:36:48.845Z',
8
- patch: '2025-10-29T10:36:48.845Z',
7
+ minor: '2025-10-29T17:33:15.385Z',
8
+ patch: '2025-10-29T17:33:15.385Z',
9
9
  }