@tldraw/editor 3.11.0-canary.e4e632644179 → 3.11.0-canary.e999671f7c64
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 +7 -7
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +11 -9
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +7 -7
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +11 -9
- 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/lib/editor/Editor.ts +13 -10
- package/src/version.ts +3 -3
package/dist-esm/version.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const version = "3.11.0-canary.
|
|
1
|
+
const version = "3.11.0-canary.e999671f7c64";
|
|
2
2
|
const publishDates = {
|
|
3
3
|
major: "2024-09-13T14:36:29.063Z",
|
|
4
|
-
minor: "2025-03-
|
|
5
|
-
patch: "2025-03-
|
|
4
|
+
minor: "2025-03-15T12:23:31.016Z",
|
|
5
|
+
patch: "2025-03-15T12:23:31.016Z"
|
|
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.11.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.11.0-canary.e999671f7c64'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-03-15T12:23:31.016Z',\n\tpatch: '2025-03-15T12:23:31.016Z',\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.11.0-canary.
|
|
4
|
+
"version": "3.11.0-canary.e999671f7c64",
|
|
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.11.0-canary.
|
|
52
|
-
"@tldraw/state-react": "3.11.0-canary.
|
|
53
|
-
"@tldraw/store": "3.11.0-canary.
|
|
54
|
-
"@tldraw/tlschema": "3.11.0-canary.
|
|
55
|
-
"@tldraw/utils": "3.11.0-canary.
|
|
56
|
-
"@tldraw/validate": "3.11.0-canary.
|
|
51
|
+
"@tldraw/state": "3.11.0-canary.e999671f7c64",
|
|
52
|
+
"@tldraw/state-react": "3.11.0-canary.e999671f7c64",
|
|
53
|
+
"@tldraw/store": "3.11.0-canary.e999671f7c64",
|
|
54
|
+
"@tldraw/tlschema": "3.11.0-canary.e999671f7c64",
|
|
55
|
+
"@tldraw/utils": "3.11.0-canary.e999671f7c64",
|
|
56
|
+
"@tldraw/validate": "3.11.0-canary.e999671f7c64",
|
|
57
57
|
"@types/core-js": "^2.5.8",
|
|
58
58
|
"@use-gesture/react": "^10.3.1",
|
|
59
59
|
"classnames": "^2.5.1",
|
package/src/lib/editor/Editor.ts
CHANGED
|
@@ -6328,21 +6328,22 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
6328
6328
|
*
|
|
6329
6329
|
* @example
|
|
6330
6330
|
* ```ts
|
|
6331
|
-
* editor.stackShapes([box1, box2], 'horizontal'
|
|
6332
|
-
* editor.stackShapes(editor.getSelectedShapeIds(), 'horizontal'
|
|
6331
|
+
* editor.stackShapes([box1, box2], 'horizontal')
|
|
6332
|
+
* editor.stackShapes(editor.getSelectedShapeIds(), 'horizontal')
|
|
6333
6333
|
* ```
|
|
6334
6334
|
*
|
|
6335
6335
|
* @param shapes - The shapes (or shape ids) to stack.
|
|
6336
6336
|
* @param operation - Whether to stack horizontally or vertically.
|
|
6337
|
-
* @param gap - The gap to leave between shapes.
|
|
6337
|
+
* @param gap - The gap to leave between shapes. By default, uses the editor's `adjacentShapeMargin` option.
|
|
6338
6338
|
*
|
|
6339
6339
|
* @public
|
|
6340
6340
|
*/
|
|
6341
6341
|
stackShapes(
|
|
6342
6342
|
shapes: TLShapeId[] | TLShape[],
|
|
6343
6343
|
operation: 'horizontal' | 'vertical',
|
|
6344
|
-
gap
|
|
6344
|
+
gap?: number
|
|
6345
6345
|
): this {
|
|
6346
|
+
const _gap = gap ?? this.options.adjacentShapeMargin
|
|
6346
6347
|
const ids =
|
|
6347
6348
|
typeof shapes[0] === 'string'
|
|
6348
6349
|
? (shapes as TLShapeId[])
|
|
@@ -6400,7 +6401,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
6400
6401
|
}
|
|
6401
6402
|
|
|
6402
6403
|
const len = shapeClustersToStack.length
|
|
6403
|
-
if ((
|
|
6404
|
+
if ((_gap === 0 && len < 3) || len < 2) return this
|
|
6404
6405
|
|
|
6405
6406
|
let val: 'x' | 'y'
|
|
6406
6407
|
let min: 'minX' | 'minY'
|
|
@@ -6421,7 +6422,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
6421
6422
|
|
|
6422
6423
|
let shapeGap: number = 0
|
|
6423
6424
|
|
|
6424
|
-
if (
|
|
6425
|
+
if (_gap === 0) {
|
|
6425
6426
|
// note: this is not used in the current tldraw.com; there we use a specified stack
|
|
6426
6427
|
|
|
6427
6428
|
const gaps: Record<number, number> = {}
|
|
@@ -6461,7 +6462,7 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
6461
6462
|
}
|
|
6462
6463
|
} else {
|
|
6463
6464
|
// If a gap was provided, then use that instead.
|
|
6464
|
-
shapeGap =
|
|
6465
|
+
shapeGap = _gap
|
|
6465
6466
|
}
|
|
6466
6467
|
|
|
6467
6468
|
const changes: TLShapePartial[] = []
|
|
@@ -6500,17 +6501,19 @@ export class Editor extends EventEmitter<TLEventMap> {
|
|
|
6500
6501
|
*
|
|
6501
6502
|
* @example
|
|
6502
6503
|
* ```ts
|
|
6503
|
-
* editor.packShapes([box1, box2]
|
|
6504
|
+
* editor.packShapes([box1, box2])
|
|
6504
6505
|
* editor.packShapes(editor.getSelectedShapeIds(), 32)
|
|
6505
6506
|
* ```
|
|
6506
6507
|
*
|
|
6507
6508
|
*
|
|
6508
6509
|
* @param shapes - The shapes (or shape ids) to pack.
|
|
6509
|
-
* @param gap - The padding to apply to the packed shapes. Defaults to
|
|
6510
|
+
* @param gap - The padding to apply to the packed shapes. Defaults to the editor's `adjacentShapeMargin` option.
|
|
6510
6511
|
*/
|
|
6511
|
-
packShapes(shapes: TLShapeId[] | TLShape[],
|
|
6512
|
+
packShapes(shapes: TLShapeId[] | TLShape[], _gap?: number): this {
|
|
6512
6513
|
if (this.getIsReadonly()) return this
|
|
6513
6514
|
|
|
6515
|
+
const gap = _gap ?? this.options.adjacentShapeMargin
|
|
6516
|
+
|
|
6514
6517
|
const ids =
|
|
6515
6518
|
typeof shapes[0] === 'string'
|
|
6516
6519
|
? (shapes as TLShapeId[])
|
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.11.0-canary.
|
|
4
|
+
export const version = '3.11.0-canary.e999671f7c64'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2024-09-13T14:36:29.063Z',
|
|
7
|
-
minor: '2025-03-
|
|
8
|
-
patch: '2025-03-
|
|
7
|
+
minor: '2025-03-15T12:23:31.016Z',
|
|
8
|
+
patch: '2025-03-15T12:23:31.016Z',
|
|
9
9
|
}
|