@tldraw/editor 4.3.0-next.705b6ec94f43 → 4.3.0-next.7f179bd04d6c
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 +57 -35
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +5 -12
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/bindings/BindingUtil.js.map +2 -2
- package/dist-cjs/lib/editor/derivations/bindingsIndex.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/SnapManager.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/BaseBoxShapeUtil.js.map +1 -1
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/group/GroupShapeUtil.js.map +2 -2
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.js.map +2 -2
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/exports/getSvgJsx.js.map +2 -2
- package/dist-cjs/lib/globals/menus.js +1 -1
- package/dist-cjs/lib/globals/menus.js.map +2 -2
- package/dist-cjs/lib/utils/reparenting.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 +57 -35
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +5 -12
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/bindings/BindingUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/derivations/bindingsIndex.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/SnapManager.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/BaseBoxShapeUtil.mjs.map +1 -1
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/group/GroupShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +2 -2
- package/dist-esm/lib/exports/getSvgJsx.mjs.map +2 -2
- package/dist-esm/lib/globals/menus.mjs +1 -1
- package/dist-esm/lib/globals/menus.mjs.map +2 -2
- package/dist-esm/lib/utils/reparenting.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +10 -10
- package/src/lib/components/default-components/DefaultCanvas.tsx +1 -0
- package/src/lib/editor/Editor.test.ts +10 -10
- package/src/lib/editor/Editor.ts +86 -59
- package/src/lib/editor/bindings/BindingUtil.ts +15 -9
- package/src/lib/editor/derivations/bindingsIndex.ts +2 -2
- package/src/lib/editor/managers/FontManager/FontManager.test.ts +14 -4
- package/src/lib/editor/managers/SnapManager/SnapManager.ts +3 -3
- package/src/lib/editor/shapes/BaseBoxShapeUtil.tsx +2 -2
- package/src/lib/editor/shapes/ShapeUtil.ts +5 -8
- package/src/lib/editor/shapes/group/GroupShapeUtil.tsx +1 -3
- package/src/lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool.ts +2 -1
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +3 -3
- package/src/lib/editor/types/emit-types.ts +3 -1
- package/src/lib/exports/getSvgJsx.test.ts +10 -19
- package/src/lib/exports/getSvgJsx.tsx +2 -5
- package/src/lib/globals/menus.ts +1 -1
- package/src/lib/utils/reparenting.ts +5 -5
- package/src/version.ts +3 -3
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
RecordProps,
|
|
3
|
+
TLBinding,
|
|
4
|
+
TLPropsMigrations,
|
|
5
|
+
TLShape,
|
|
6
|
+
TLUnknownBinding,
|
|
7
|
+
} from '@tldraw/tlschema'
|
|
2
8
|
import { Editor } from '../Editor'
|
|
3
9
|
|
|
4
10
|
/** @public */
|
|
5
11
|
export interface TLBindingUtilConstructor<
|
|
6
|
-
T extends
|
|
12
|
+
T extends TLBinding,
|
|
7
13
|
U extends BindingUtil<T> = BindingUtil<T>,
|
|
8
14
|
> {
|
|
9
15
|
new (editor: Editor): U
|
|
@@ -20,7 +26,7 @@ export interface TLBindingUtilConstructor<
|
|
|
20
26
|
*
|
|
21
27
|
* @public
|
|
22
28
|
*/
|
|
23
|
-
export interface BindingOnCreateOptions<Binding extends
|
|
29
|
+
export interface BindingOnCreateOptions<Binding extends TLBinding = TLBinding> {
|
|
24
30
|
/** The binding being created. */
|
|
25
31
|
binding: Binding
|
|
26
32
|
}
|
|
@@ -31,7 +37,7 @@ export interface BindingOnCreateOptions<Binding extends TLUnknownBinding> {
|
|
|
31
37
|
*
|
|
32
38
|
* @public
|
|
33
39
|
*/
|
|
34
|
-
export interface BindingOnChangeOptions<Binding extends
|
|
40
|
+
export interface BindingOnChangeOptions<Binding extends TLBinding = TLBinding> {
|
|
35
41
|
/** The binding record before the change is made. */
|
|
36
42
|
bindingBefore: Binding
|
|
37
43
|
/** The binding record after the change is made. */
|
|
@@ -44,7 +50,7 @@ export interface BindingOnChangeOptions<Binding extends TLUnknownBinding> {
|
|
|
44
50
|
*
|
|
45
51
|
* @public
|
|
46
52
|
*/
|
|
47
|
-
export interface BindingOnDeleteOptions<Binding extends
|
|
53
|
+
export interface BindingOnDeleteOptions<Binding extends TLBinding = TLBinding> {
|
|
48
54
|
/** The binding being deleted. */
|
|
49
55
|
binding: Binding
|
|
50
56
|
}
|
|
@@ -55,7 +61,7 @@ export interface BindingOnDeleteOptions<Binding extends TLUnknownBinding> {
|
|
|
55
61
|
*
|
|
56
62
|
* @public
|
|
57
63
|
*/
|
|
58
|
-
export interface BindingOnShapeChangeOptions<Binding extends
|
|
64
|
+
export interface BindingOnShapeChangeOptions<Binding extends TLBinding = TLBinding> {
|
|
59
65
|
/** The binding record linking these two shapes. */
|
|
60
66
|
binding: Binding
|
|
61
67
|
/** The shape record before the change is made. */
|
|
@@ -95,7 +101,7 @@ export interface BindingOnShapeChangeOptions<Binding extends TLUnknownBinding> {
|
|
|
95
101
|
*
|
|
96
102
|
* @public
|
|
97
103
|
*/
|
|
98
|
-
export interface BindingOnShapeIsolateOptions<Binding extends
|
|
104
|
+
export interface BindingOnShapeIsolateOptions<Binding extends TLBinding = TLBinding> {
|
|
99
105
|
/** The binding record that refers to the shape in question. */
|
|
100
106
|
binding: Binding
|
|
101
107
|
/**
|
|
@@ -114,7 +120,7 @@ export interface BindingOnShapeIsolateOptions<Binding extends TLUnknownBinding>
|
|
|
114
120
|
*
|
|
115
121
|
* @public
|
|
116
122
|
*/
|
|
117
|
-
export interface BindingOnShapeDeleteOptions<Binding extends
|
|
123
|
+
export interface BindingOnShapeDeleteOptions<Binding extends TLBinding = TLBinding> {
|
|
118
124
|
/** The binding record that refers to the shape in question. */
|
|
119
125
|
binding: Binding
|
|
120
126
|
/** The shape that is about to be deleted. */
|
|
@@ -122,7 +128,7 @@ export interface BindingOnShapeDeleteOptions<Binding extends TLUnknownBinding> {
|
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
/** @public */
|
|
125
|
-
export abstract class BindingUtil<Binding extends
|
|
131
|
+
export abstract class BindingUtil<Binding extends TLBinding = TLBinding> {
|
|
126
132
|
constructor(public editor: Editor) {}
|
|
127
133
|
static props?: RecordProps<TLUnknownBinding>
|
|
128
134
|
static migrations?: TLPropsMigrations
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Computed, RESET_VALUE, computed, isUninitialized } from '@tldraw/state'
|
|
2
|
-
import {
|
|
2
|
+
import { TLBinding, TLShapeId } from '@tldraw/tlschema'
|
|
3
3
|
import { objectMapValues } from '@tldraw/utils'
|
|
4
4
|
import { Editor } from '../Editor'
|
|
5
5
|
|
|
6
6
|
type TLBindingsIndex = Map<TLShapeId, TLBinding[]>
|
|
7
7
|
|
|
8
|
-
function fromScratch(bindingsQuery: Computed<
|
|
8
|
+
function fromScratch(bindingsQuery: Computed<TLBinding[], unknown>) {
|
|
9
9
|
const allBindings = bindingsQuery.get() as TLBinding[]
|
|
10
10
|
|
|
11
11
|
const shapesToBindings: TLBindingsIndex = new Map()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TLShape, TLShapeId, createShapeId } from '@tldraw/tlschema'
|
|
1
|
+
import { TLParentId, TLShape, TLShapeId, createShapeId, toRichText } from '@tldraw/tlschema'
|
|
2
|
+
import { IndexKey } from '@tldraw/utils'
|
|
2
3
|
import { Mock, Mocked, vi } from 'vitest'
|
|
3
4
|
import { Editor } from '../../Editor'
|
|
4
5
|
import { FontManager, TLFontFace } from './FontManager'
|
|
@@ -41,12 +42,21 @@ describe('FontManager', () => {
|
|
|
41
42
|
x: 0,
|
|
42
43
|
y: 0,
|
|
43
44
|
rotation: 0,
|
|
44
|
-
index: 'a1' as
|
|
45
|
-
parentId: 'page:page' as
|
|
45
|
+
index: 'a1' as IndexKey,
|
|
46
|
+
parentId: 'page:page' as TLParentId,
|
|
46
47
|
opacity: 1,
|
|
47
48
|
isLocked: false,
|
|
48
49
|
meta: {},
|
|
49
|
-
props: {
|
|
50
|
+
props: {
|
|
51
|
+
color: 'black',
|
|
52
|
+
size: 'xl',
|
|
53
|
+
font: 'serif',
|
|
54
|
+
textAlign: 'middle',
|
|
55
|
+
w: 100,
|
|
56
|
+
richText: toRichText('❤️'),
|
|
57
|
+
scale: 2,
|
|
58
|
+
autoSize: true,
|
|
59
|
+
},
|
|
50
60
|
typeName: 'shape' as const,
|
|
51
61
|
})
|
|
52
62
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EMPTY_ARRAY, atom, computed } from '@tldraw/state'
|
|
2
|
-
import {
|
|
2
|
+
import { TLParentId, TLShapeId, isShapeId } from '@tldraw/tlschema'
|
|
3
3
|
import { Vec, VecLike } from '../../../primitives/Vec'
|
|
4
4
|
import type { Editor } from '../../Editor'
|
|
5
5
|
import { BoundsSnaps } from './BoundsSnaps'
|
|
@@ -72,7 +72,7 @@ export class SnapManager {
|
|
|
72
72
|
const collectSnappableShapesFromParent = (parentId: TLParentId) => {
|
|
73
73
|
if (isShapeId(parentId)) {
|
|
74
74
|
const parent = editor.getShape(parentId)
|
|
75
|
-
if (parent && editor.isShapeOfType
|
|
75
|
+
if (parent && editor.isShapeOfType(parent, 'frame')) {
|
|
76
76
|
snappableShapes.add(parentId)
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -89,7 +89,7 @@ export class SnapManager {
|
|
|
89
89
|
const pageBounds = editor.getShapePageBounds(childId)
|
|
90
90
|
if (!(pageBounds && renderingBounds.includes(pageBounds))) continue
|
|
91
91
|
// Snap to children of groups but not group itself
|
|
92
|
-
if (editor.isShapeOfType
|
|
92
|
+
if (editor.isShapeOfType(childShape, 'group')) {
|
|
93
93
|
collectSnappableShapesFromParent(childId)
|
|
94
94
|
continue
|
|
95
95
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractShapeByProps } from '@tldraw/tlschema'
|
|
2
2
|
import { lerp } from '@tldraw/utils'
|
|
3
3
|
import { Geometry2d } from '../../primitives/geometry/Geometry2d'
|
|
4
4
|
import { Rectangle2d } from '../../primitives/geometry/Rectangle2d'
|
|
@@ -7,7 +7,7 @@ import { ShapeUtil, TLResizeInfo } from './ShapeUtil'
|
|
|
7
7
|
import { resizeBox } from './shared/resizeBox'
|
|
8
8
|
|
|
9
9
|
/** @public */
|
|
10
|
-
export type TLBaseBoxShape =
|
|
10
|
+
export type TLBaseBoxShape = ExtractShapeByProps<{ w: number; h: number }>
|
|
11
11
|
|
|
12
12
|
/** @public */
|
|
13
13
|
export abstract class BaseBoxShapeUtil<Shape extends TLBaseBoxShape> extends ShapeUtil<Shape> {
|
|
@@ -26,10 +26,7 @@ import { TLClickEventInfo } from '../types/event-types'
|
|
|
26
26
|
import { TLResizeHandle } from '../types/selection-types'
|
|
27
27
|
|
|
28
28
|
/** @public */
|
|
29
|
-
export interface TLShapeUtilConstructor<
|
|
30
|
-
T extends TLUnknownShape,
|
|
31
|
-
U extends ShapeUtil<T> = ShapeUtil<T>,
|
|
32
|
-
> {
|
|
29
|
+
export interface TLShapeUtilConstructor<T extends TLShape, U extends ShapeUtil<T> = ShapeUtil<T>> {
|
|
33
30
|
new (editor: Editor): U
|
|
34
31
|
type: T['type']
|
|
35
32
|
props?: RecordProps<T>
|
|
@@ -42,11 +39,11 @@ export interface TLShapeUtilConstructor<
|
|
|
42
39
|
*
|
|
43
40
|
* @public
|
|
44
41
|
*/
|
|
45
|
-
export interface TLShapeUtilCanBindOpts<Shape extends
|
|
42
|
+
export interface TLShapeUtilCanBindOpts<Shape extends TLShape = TLShape> {
|
|
46
43
|
/** The type of shape referenced by the `fromId` of the binding. */
|
|
47
|
-
fromShapeType:
|
|
44
|
+
fromShapeType: TLShape['type']
|
|
48
45
|
/** The type of shape referenced by the `toId` of the binding. */
|
|
49
|
-
toShapeType:
|
|
46
|
+
toShapeType: TLShape['type']
|
|
50
47
|
/** The type of binding. */
|
|
51
48
|
bindingType: string
|
|
52
49
|
}
|
|
@@ -79,7 +76,7 @@ export interface TLShapeUtilCanvasSvgDef {
|
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
/** @public */
|
|
82
|
-
export abstract class ShapeUtil<Shape extends
|
|
79
|
+
export abstract class ShapeUtil<Shape extends TLShape = TLShape> {
|
|
83
80
|
/** Configure this shape utils {@link ShapeUtil.options | `options`}. */
|
|
84
81
|
static configure<T extends TLShapeUtilConstructor<any, any>>(
|
|
85
82
|
this: T,
|
|
@@ -55,9 +55,7 @@ export class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
|
|
|
55
55
|
const isHintingOtherGroup =
|
|
56
56
|
hintingShapeIds.length > 0 &&
|
|
57
57
|
hintingShapeIds.some(
|
|
58
|
-
(id) =>
|
|
59
|
-
id !== shape.id &&
|
|
60
|
-
this.editor.isShapeOfType<TLGroupShape>(this.editor.getShape(id)!, 'group')
|
|
58
|
+
(id) => id !== shape.id && this.editor.isShapeOfType(this.editor.getShape(id)!, 'group')
|
|
61
59
|
)
|
|
62
60
|
|
|
63
61
|
const isFocused = this.editor.getCurrentPageState().focusedGroupId !== shape.id
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TLShape } from '@tldraw/tlschema'
|
|
2
|
+
import { TLBaseBoxShape } from '../../shapes/BaseBoxShapeUtil'
|
|
2
3
|
import { StateNode, TLStateNodeConstructor } from '../StateNode'
|
|
3
4
|
import { Idle } from './children/Idle'
|
|
4
5
|
import { Pointing } from './children/Pointing'
|
|
@@ -11,7 +12,7 @@ export abstract class BaseBoxShapeTool extends StateNode {
|
|
|
11
12
|
return [Idle, Pointing]
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
abstract override shapeType:
|
|
15
|
+
abstract override shapeType: TLBaseBoxShape['type']
|
|
15
16
|
|
|
16
17
|
onCreate?(_shape: TLShape | null): void | null
|
|
17
18
|
}
|
|
@@ -23,7 +23,7 @@ export class Pointing extends StateNode {
|
|
|
23
23
|
const newPoint = maybeSnapToGrid(originPagePoint, editor)
|
|
24
24
|
|
|
25
25
|
// Allow this to trigger the max shapes reached alert
|
|
26
|
-
this.editor.createShapes
|
|
26
|
+
this.editor.createShapes([
|
|
27
27
|
{
|
|
28
28
|
id,
|
|
29
29
|
type: shapeType,
|
|
@@ -88,7 +88,7 @@ export class Pointing extends StateNode {
|
|
|
88
88
|
|
|
89
89
|
// Allow this to trigger the max shapes reached alert
|
|
90
90
|
// todo: add scale here when dynamic size is enabled (is this still needed?)
|
|
91
|
-
this.editor.createShapes
|
|
91
|
+
this.editor.createShapes([
|
|
92
92
|
{
|
|
93
93
|
id,
|
|
94
94
|
type: shapeType,
|
|
@@ -127,7 +127,7 @@ export class Pointing extends StateNode {
|
|
|
127
127
|
;(next as TLBaseBoxShape & { props: { scale: number } }).props.scale = scale
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
this.editor.updateShape
|
|
130
|
+
this.editor.updateShape(next)
|
|
131
131
|
|
|
132
132
|
this.editor.setSelectedShapes([id])
|
|
133
133
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HistoryEntry } from '@tldraw/store'
|
|
2
|
-
import { TLPageId, TLRecord, TLShapeId } from '@tldraw/tlschema'
|
|
2
|
+
import { BoxModel, TLPageId, TLRecord, TLShapeId } from '@tldraw/tlschema'
|
|
3
3
|
import { TLEventInfo } from './event-types'
|
|
4
4
|
|
|
5
5
|
/** @public */
|
|
@@ -16,12 +16,14 @@ export interface TLEventMap {
|
|
|
16
16
|
event: [TLEventInfo]
|
|
17
17
|
tick: [number]
|
|
18
18
|
frame: [number]
|
|
19
|
+
resize: [BoxModel]
|
|
19
20
|
'select-all-text': [{ shapeId: TLShapeId }]
|
|
20
21
|
'place-caret': [{ shapeId: TLShapeId; point: { x: number; y: number } }]
|
|
21
22
|
'created-shapes': [TLRecord[]]
|
|
22
23
|
'edited-shapes': [TLRecord[]]
|
|
23
24
|
'deleted-shapes': [TLShapeId[]]
|
|
24
25
|
edit: []
|
|
26
|
+
dispose: []
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/** @public */
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Geometry2d,
|
|
3
|
-
RecordProps,
|
|
4
|
-
Rectangle2d,
|
|
5
|
-
ShapeUtil,
|
|
6
|
-
T,
|
|
7
|
-
TLBaseShape,
|
|
8
|
-
createShapeId,
|
|
9
|
-
} from '../..'
|
|
1
|
+
import { Geometry2d, RecordProps, Rectangle2d, ShapeUtil, T, TLShape, createShapeId } from '../..'
|
|
10
2
|
import { createTLStore } from '../config/createTLStore'
|
|
11
3
|
import { Editor } from '../editor/Editor'
|
|
12
4
|
import { Box } from '../primitives/Box'
|
|
13
5
|
import { getExportDefaultBounds } from './getSvgJsx'
|
|
14
6
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
h: number
|
|
20
|
-
x: number
|
|
21
|
-
y: number
|
|
22
|
-
isContainer?: boolean
|
|
7
|
+
const TEST_SHAPE_TYPE = 'test-shape'
|
|
8
|
+
|
|
9
|
+
declare module '@tldraw/tlschema' {
|
|
10
|
+
export interface TLGlobalShapePropsMap {
|
|
11
|
+
[TEST_SHAPE_TYPE]: { w: number; h: number; x: number; y: number; isContainer?: boolean }
|
|
23
12
|
}
|
|
24
|
-
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type ITestShape = TLShape<typeof TEST_SHAPE_TYPE>
|
|
25
16
|
|
|
26
17
|
class TestShape extends ShapeUtil<ITestShape> {
|
|
27
|
-
static override type =
|
|
18
|
+
static override type = TEST_SHAPE_TYPE
|
|
28
19
|
static override props: RecordProps<ITestShape> = {
|
|
29
20
|
w: T.number,
|
|
30
21
|
h: T.number,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useAtom, useValue } from '@tldraw/state-react'
|
|
2
2
|
import {
|
|
3
3
|
TLFrameShape,
|
|
4
|
-
TLGroupShape,
|
|
5
4
|
TLShape,
|
|
6
5
|
TLShapeId,
|
|
7
6
|
getColorValue,
|
|
@@ -58,9 +57,7 @@ export function getSvgJsx(editor: Editor, ids: TLShapeId[], opts: TLImageExportO
|
|
|
58
57
|
|
|
59
58
|
// --- Common bounding box of all shapes
|
|
60
59
|
const singleFrameShapeId =
|
|
61
|
-
ids.length === 1 && editor.isShapeOfType
|
|
62
|
-
? ids[0]
|
|
63
|
-
: null
|
|
60
|
+
ids.length === 1 && editor.isShapeOfType(editor.getShape(ids[0])!, 'frame') ? ids[0] : null
|
|
64
61
|
|
|
65
62
|
let bbox: null | Box = null
|
|
66
63
|
if (opts.bounds) {
|
|
@@ -272,7 +269,7 @@ function SvgExport({
|
|
|
272
269
|
|
|
273
270
|
const shape = editor.getShape(id)!
|
|
274
271
|
|
|
275
|
-
if (editor.isShapeOfType
|
|
272
|
+
if (editor.isShapeOfType(shape, 'group')) return []
|
|
276
273
|
|
|
277
274
|
const elements = []
|
|
278
275
|
const util = editor.getShapeUtil(shape)
|
package/src/lib/globals/menus.ts
CHANGED
|
@@ -95,8 +95,8 @@ export function kickoutOccludedShapes(
|
|
|
95
95
|
if (remainingShapesToReparent.size > 0) {
|
|
96
96
|
// The remaining shapes are going to be reparented to the old parent's containing group, if there was one, or else to the page
|
|
97
97
|
const newParentId =
|
|
98
|
-
editor.findShapeAncestor(prevParent, (s) => editor.isShapeOfType
|
|
99
|
-
|
|
98
|
+
editor.findShapeAncestor(prevParent, (s) => editor.isShapeOfType(s, 'group'))?.id ??
|
|
99
|
+
editor.getCurrentPageId()
|
|
100
100
|
|
|
101
101
|
remainingShapesToReparent.forEach((shape) => {
|
|
102
102
|
if (!parentsToNewChildren[newParentId]) {
|
|
@@ -211,7 +211,7 @@ export function getDroppedShapesToNewParents(
|
|
|
211
211
|
|
|
212
212
|
for (const shape of shapes) {
|
|
213
213
|
const parent = editor.getShapeParent(shape)
|
|
214
|
-
if (parent && editor.isShapeOfType
|
|
214
|
+
if (parent && editor.isShapeOfType(parent, 'group')) {
|
|
215
215
|
if (!movingGroups.has(parent)) {
|
|
216
216
|
movingGroups.add(parent)
|
|
217
217
|
}
|
|
@@ -248,7 +248,7 @@ export function getDroppedShapesToNewParents(
|
|
|
248
248
|
parentCheck: for (let i = potentialParentShapes.length - 1; i >= 0; i--) {
|
|
249
249
|
const parentShape = potentialParentShapes[i]
|
|
250
250
|
const parentShapeContainingGroupId = editor.findShapeAncestor(parentShape, (s) =>
|
|
251
|
-
editor.isShapeOfType
|
|
251
|
+
editor.isShapeOfType(s, 'group')
|
|
252
252
|
)?.id
|
|
253
253
|
|
|
254
254
|
const parentGeometry = editor.getShapeGeometry(parentShape)
|
|
@@ -274,7 +274,7 @@ export function getDroppedShapesToNewParents(
|
|
|
274
274
|
if (!shapeGroupIds.has(shape.id)) {
|
|
275
275
|
shapeGroupIds.set(
|
|
276
276
|
shape.id,
|
|
277
|
-
editor.findShapeAncestor(shape, (s) => editor.isShapeOfType
|
|
277
|
+
editor.findShapeAncestor(shape, (s) => editor.isShapeOfType(s, 'group'))?.id
|
|
278
278
|
)
|
|
279
279
|
}
|
|
280
280
|
|
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 = '4.3.0-next.
|
|
4
|
+
export const version = '4.3.0-next.7f179bd04d6c'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2025-
|
|
8
|
-
patch: '2025-
|
|
7
|
+
minor: '2025-12-03T15:46:20.535Z',
|
|
8
|
+
patch: '2025-12-03T15:46:20.535Z',
|
|
9
9
|
}
|