tldraw 4.3.0-canary.ad0c967b6497 → 4.3.0-canary.b19495d1a0fa
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 +1 -1
- package/dist-cjs/lib/ui/version.js +3 -3
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/ui/version.mjs +3 -3
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/package.json +3 -3
- package/src/lib/ui/version.ts +3 -3
- package/src/test/commands/putContent.test.ts +79 -1
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.3.0-canary.
|
|
587
|
+
"4.3.0-canary.b19495d1a0fa",
|
|
588
588
|
"cjs"
|
|
589
589
|
);
|
|
590
590
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,10 +22,10 @@ __export(version_exports, {
|
|
|
22
22
|
version: () => version
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(version_exports);
|
|
25
|
-
const version = "4.3.0-canary.
|
|
25
|
+
const version = "4.3.0-canary.b19495d1a0fa";
|
|
26
26
|
const publishDates = {
|
|
27
27
|
major: "2025-09-18T14:39:22.803Z",
|
|
28
|
-
minor: "2025-12-
|
|
29
|
-
patch: "2025-12-
|
|
28
|
+
minor: "2025-12-03T10:58:13.473Z",
|
|
29
|
+
patch: "2025-12-03T10:58:13.473Z"
|
|
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.3.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 = '4.3.0-canary.b19495d1a0fa'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-12-03T10:58:13.473Z',\n\tpatch: '2025-12-03T10:58:13.473Z',\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
|
}
|
package/dist-esm/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const version = "4.3.0-canary.
|
|
1
|
+
const version = "4.3.0-canary.b19495d1a0fa";
|
|
2
2
|
const publishDates = {
|
|
3
3
|
major: "2025-09-18T14:39:22.803Z",
|
|
4
|
-
minor: "2025-12-
|
|
5
|
-
patch: "2025-12-
|
|
4
|
+
minor: "2025-12-03T10:58:13.473Z",
|
|
5
|
+
patch: "2025-12-03T10:58:13.473Z"
|
|
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.3.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 = '4.3.0-canary.b19495d1a0fa'\nexport const publishDates = {\n\tmajor: '2025-09-18T14:39:22.803Z',\n\tminor: '2025-12-03T10:58:13.473Z',\n\tpatch: '2025-12-03T10:58:13.473Z',\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.3.0-canary.
|
|
4
|
+
"version": "4.3.0-canary.b19495d1a0fa",
|
|
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.3.0-canary.
|
|
66
|
-
"@tldraw/store": "4.3.0-canary.
|
|
65
|
+
"@tldraw/editor": "4.3.0-canary.b19495d1a0fa",
|
|
66
|
+
"@tldraw/store": "4.3.0-canary.b19495d1a0fa",
|
|
67
67
|
"classnames": "^2.5.1",
|
|
68
68
|
"hotkeys-js": "^3.13.9",
|
|
69
69
|
"idb": "^7.1.1",
|
package/src/lib/ui/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 = '4.3.0-canary.
|
|
4
|
+
export const version = '4.3.0-canary.b19495d1a0fa'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2025-12-
|
|
8
|
-
patch: '2025-12-
|
|
7
|
+
minor: '2025-12-03T10:58:13.473Z',
|
|
8
|
+
patch: '2025-12-03T10:58:13.473Z',
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TLContent, structuredClone } from '@tldraw/editor'
|
|
1
|
+
import { TLContent, createShapeId, structuredClone } from '@tldraw/editor'
|
|
2
2
|
import { TestEditor } from '../TestEditor'
|
|
3
3
|
|
|
4
4
|
let editor: TestEditor
|
|
@@ -38,3 +38,81 @@ describe('Migrations', () => {
|
|
|
38
38
|
expect(() => editor.putContentOntoCurrentPage(withInvalidShapeModel)).toThrow()
|
|
39
39
|
})
|
|
40
40
|
})
|
|
41
|
+
|
|
42
|
+
describe('Paste parent selection with explicit point', () => {
|
|
43
|
+
it('falls back to the page when the cursor is outside the original parent', () => {
|
|
44
|
+
const frameId = createShapeId('frame')
|
|
45
|
+
const childId = createShapeId('child')
|
|
46
|
+
|
|
47
|
+
editor.createShapes([
|
|
48
|
+
{
|
|
49
|
+
id: frameId,
|
|
50
|
+
type: 'frame',
|
|
51
|
+
x: 0,
|
|
52
|
+
y: 0,
|
|
53
|
+
props: { w: 200, h: 200 },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: childId,
|
|
57
|
+
type: 'geo',
|
|
58
|
+
parentId: frameId,
|
|
59
|
+
x: 40,
|
|
60
|
+
y: 40,
|
|
61
|
+
props: { w: 60, h: 60 },
|
|
62
|
+
},
|
|
63
|
+
])
|
|
64
|
+
|
|
65
|
+
editor.select(childId)
|
|
66
|
+
editor.copy()
|
|
67
|
+
|
|
68
|
+
editor.putContentOntoCurrentPage(editor.clipboard!, {
|
|
69
|
+
point: { x: 500, y: 500 },
|
|
70
|
+
select: true,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const [pastedId] = editor.getSelectedShapeIds()
|
|
74
|
+
expect(editor.getShape(pastedId)?.parentId).toBe(editor.getCurrentPageId())
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('uses the parent under the cursor when it can accept the pasted shapes', () => {
|
|
78
|
+
const frameAId = createShapeId('frameA')
|
|
79
|
+
const frameBId = createShapeId('frameB')
|
|
80
|
+
const childId = createShapeId('child')
|
|
81
|
+
|
|
82
|
+
editor.createShapes([
|
|
83
|
+
{
|
|
84
|
+
id: frameAId,
|
|
85
|
+
type: 'frame',
|
|
86
|
+
x: 0,
|
|
87
|
+
y: 0,
|
|
88
|
+
props: { w: 200, h: 200 },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: frameBId,
|
|
92
|
+
type: 'frame',
|
|
93
|
+
x: 400,
|
|
94
|
+
y: 0,
|
|
95
|
+
props: { w: 200, h: 200 },
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: childId,
|
|
99
|
+
type: 'geo',
|
|
100
|
+
parentId: frameAId,
|
|
101
|
+
x: 40,
|
|
102
|
+
y: 40,
|
|
103
|
+
props: { w: 60, h: 60 },
|
|
104
|
+
},
|
|
105
|
+
])
|
|
106
|
+
|
|
107
|
+
editor.select(childId)
|
|
108
|
+
editor.copy()
|
|
109
|
+
|
|
110
|
+
editor.putContentOntoCurrentPage(editor.clipboard!, {
|
|
111
|
+
point: { x: 450, y: 50 },
|
|
112
|
+
select: true,
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const [pastedId] = editor.getSelectedShapeIds()
|
|
116
|
+
expect(editor.getShape(pastedId)?.parentId).toBe(frameBId)
|
|
117
|
+
})
|
|
118
|
+
})
|