@tldraw/editor 3.14.0-canary.b026f27e2cab → 3.14.0-canary.b1a9df6c4d78
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.d.ts +15 -1
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +9 -0
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/types/external-content.js.map +1 -1
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +15 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +9 -0
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +1 -0
- package/src/lib/editor/Editor.ts +10 -0
- package/src/lib/editor/types/external-content.ts +10 -1
- package/src/version.ts +3 -3
package/dist-esm/version.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const version = "3.14.0-canary.
|
|
1
|
+
const version = "3.14.0-canary.b1a9df6c4d78";
|
|
2
2
|
const publishDates = {
|
|
3
3
|
major: "2024-09-13T14:36:29.063Z",
|
|
4
|
-
minor: "2025-06-
|
|
5
|
-
patch: "2025-06-
|
|
4
|
+
minor: "2025-06-18T12:21:49.668Z",
|
|
5
|
+
patch: "2025-06-18T12:21:49.668Z"
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
publishDates,
|
package/dist-esm/version.mjs.map
CHANGED
|
@@ -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.14.0-canary.
|
|
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.14.0-canary.b1a9df6c4d78'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-06-18T12:21:49.668Z',\n\tpatch: '2025-06-18T12:21:49.668Z',\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": "A tiny little drawing app (editor).",
|
|
4
|
-
"version": "3.14.0-canary.
|
|
4
|
+
"version": "3.14.0-canary.b1a9df6c4d78",
|
|
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.
|
|
52
|
-
"@tldraw/state-react": "3.14.0-canary.
|
|
53
|
-
"@tldraw/store": "3.14.0-canary.
|
|
54
|
-
"@tldraw/tlschema": "3.14.0-canary.
|
|
55
|
-
"@tldraw/utils": "3.14.0-canary.
|
|
56
|
-
"@tldraw/validate": "3.14.0-canary.
|
|
51
|
+
"@tldraw/state": "3.14.0-canary.b1a9df6c4d78",
|
|
52
|
+
"@tldraw/state-react": "3.14.0-canary.b1a9df6c4d78",
|
|
53
|
+
"@tldraw/store": "3.14.0-canary.b1a9df6c4d78",
|
|
54
|
+
"@tldraw/tlschema": "3.14.0-canary.b1a9df6c4d78",
|
|
55
|
+
"@tldraw/utils": "3.14.0-canary.b1a9df6c4d78",
|
|
56
|
+
"@tldraw/validate": "3.14.0-canary.b1a9df6c4d78",
|
|
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
package/src/lib/editor/Editor.ts
CHANGED
|
@@ -8827,6 +8827,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
8827
8827
|
} = {
|
|
8828
8828
|
text: null,
|
|
8829
8829
|
files: null,
|
|
8830
|
+
'file-replace': null,
|
|
8830
8831
|
embed: null,
|
|
8831
8832
|
'svg-text': null,
|
|
8832
8833
|
url: null,
|
|
@@ -8876,6 +8877,15 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
8876
8877
|
return this.externalContentHandlers[info.type]?.(info as any)
|
|
8877
8878
|
}
|
|
8878
8879
|
|
|
8880
|
+
/**
|
|
8881
|
+
* Handle replacing external content.
|
|
8882
|
+
*
|
|
8883
|
+
* @param info - Info about the external content.
|
|
8884
|
+
*/
|
|
8885
|
+
async replaceExternalContent<E>(info: TLExternalContent<E>): Promise<void> {
|
|
8886
|
+
return this.externalContentHandlers[info.type]?.(info as any)
|
|
8887
|
+
}
|
|
8888
|
+
|
|
8879
8889
|
/**
|
|
8880
8890
|
* Get content that can be exported for the given shape ids.
|
|
8881
8891
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLAssetId } from '@tldraw/tlschema'
|
|
1
|
+
import { TLAssetId, TLShapeId } from '@tldraw/tlschema'
|
|
2
2
|
import { VecLike } from '../../primitives/Vec'
|
|
3
3
|
import { TLContent } from './clipboard-types'
|
|
4
4
|
|
|
@@ -55,6 +55,14 @@ export interface TLFilesExternalContent extends TLBaseExternalContent {
|
|
|
55
55
|
ignoreParent?: boolean
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/** @public */
|
|
59
|
+
export interface TLFileReplaceExternalContent extends TLBaseExternalContent {
|
|
60
|
+
type: 'file-replace'
|
|
61
|
+
file: File
|
|
62
|
+
shapeId: TLShapeId
|
|
63
|
+
isImage: boolean
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
/** @public */
|
|
59
67
|
export interface TLUrlExternalContent extends TLBaseExternalContent {
|
|
60
68
|
type: 'url'
|
|
@@ -90,6 +98,7 @@ export interface TLExcalidrawExternalContent extends TLBaseExternalContent {
|
|
|
90
98
|
export type TLExternalContent<EmbedDefinition> =
|
|
91
99
|
| TLTextExternalContent
|
|
92
100
|
| TLFilesExternalContent
|
|
101
|
+
| TLFileReplaceExternalContent
|
|
93
102
|
| TLUrlExternalContent
|
|
94
103
|
| TLSvgTextExternalContent
|
|
95
104
|
| TLEmbedExternalContent<EmbedDefinition>
|
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.
|
|
4
|
+
export const version = '3.14.0-canary.b1a9df6c4d78'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2024-09-13T14:36:29.063Z',
|
|
7
|
-
minor: '2025-06-
|
|
8
|
-
patch: '2025-06-
|
|
7
|
+
minor: '2025-06-18T12:21:49.668Z',
|
|
8
|
+
patch: '2025-06-18T12:21:49.668Z',
|
|
9
9
|
}
|