microboard-temp 0.10.2 → 0.11.0
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/browser.js +290 -168
- package/dist/cjs/index.js +290 -168
- package/dist/cjs/node.js +290 -168
- package/dist/esm/browser.js +290 -168
- package/dist/esm/index.js +290 -168
- package/dist/esm/node.js +290 -168
- package/dist/types/Board.d.ts +11 -0
- package/dist/types/Items/BaseItem/BaseItem.d.ts +14 -0
- package/dist/types/Items/Group/Group.d.ts +5 -15
- package/dist/types/Items/Transformation/Matrix.d.ts +19 -0
- package/dist/types/Items/Transformation/Transformation.d.ts +5 -0
- package/dist/types/Selection/Selection.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/Board.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { SpatialIndex } from "./SpatialIndex";
|
|
|
15
15
|
import { Subject } from "./Subject";
|
|
16
16
|
import { Tools } from "./Tools";
|
|
17
17
|
import { ItemsMap } from "./Validators";
|
|
18
|
+
import { BaseItem } from "./Items/BaseItem";
|
|
18
19
|
import { ItemDataWithId } from "./Items/Item";
|
|
19
20
|
import { Account } from "./types/Account";
|
|
20
21
|
export type InterfaceType = "edit" | "view" | "loading";
|
|
@@ -79,6 +80,16 @@ export declare class Board {
|
|
|
79
80
|
addLockedGroup(item: Group): Item;
|
|
80
81
|
remove(item: Item, withConnectors?: boolean): void;
|
|
81
82
|
removeLockedGroup(item: Group): void;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a Group containing the given items.
|
|
85
|
+
* Items are moved from the board into the group's local coordinate space.
|
|
86
|
+
* Returns the newly created Group.
|
|
87
|
+
*/
|
|
88
|
+
group(items: BaseItem[]): Group;
|
|
89
|
+
/**
|
|
90
|
+
* Dissolves a Group, returning its children to the board with world-space transforms.
|
|
91
|
+
*/
|
|
92
|
+
ungroup(group: Group): void;
|
|
82
93
|
getByZIndex(index: number): Item;
|
|
83
94
|
getZIndex(item: Item): number;
|
|
84
95
|
getLastZIndex(): number;
|
|
@@ -14,6 +14,7 @@ import { Path, Paths } from "../Path";
|
|
|
14
14
|
import { BaseItemOperation } from "./BaseItemOperation";
|
|
15
15
|
import { SimpleSpatialIndex } from "../../SpatialIndex/SimpleSpatialIndex";
|
|
16
16
|
import { Point } from "../Point";
|
|
17
|
+
import { Matrix } from "../Transformation/Matrix";
|
|
17
18
|
export type BaseItemData = {
|
|
18
19
|
itemType: string;
|
|
19
20
|
} & Record<string, any>;
|
|
@@ -46,6 +47,12 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
46
47
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
|
|
47
48
|
updateChildrenIds(): void;
|
|
48
49
|
getId(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the full world-space matrix by walking up the parent chain.
|
|
52
|
+
* For top-level items (parent === "Board") this is identical to the item's
|
|
53
|
+
* own transformation matrix. For nested items it is parentWorld × localMatrix.
|
|
54
|
+
*/
|
|
55
|
+
getWorldMatrix(): Matrix;
|
|
49
56
|
setId(id: string): this;
|
|
50
57
|
getChildrenIds(): string[] | null;
|
|
51
58
|
addChildItems(children: BaseItem[]): void;
|
|
@@ -57,6 +64,13 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
57
64
|
cancelIfChild?: boolean;
|
|
58
65
|
}): boolean;
|
|
59
66
|
getMbr(): Mbr;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the world-space axis-aligned bounding box.
|
|
69
|
+
* For top-level items this is identical to getMbr().
|
|
70
|
+
* For nested items (parent !== "Board") it transforms the local Mbr corners
|
|
71
|
+
* through the world matrix to produce the correct world-space bounds.
|
|
72
|
+
*/
|
|
73
|
+
getWorldMbr(): Mbr;
|
|
60
74
|
applyAddChildren(childIds: string[]): void;
|
|
61
75
|
applyRemoveChildren(childIds: string[]): void;
|
|
62
76
|
updateMbr(): void;
|
|
@@ -15,37 +15,27 @@ export interface GroupData {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class Group extends BaseItem {
|
|
17
17
|
private events?;
|
|
18
|
-
private children;
|
|
19
18
|
readonly linkTo: LinkTo;
|
|
20
19
|
readonly itemType = "Group";
|
|
21
20
|
parent: string;
|
|
22
21
|
readonly transformation: Transformation;
|
|
23
22
|
readonly subject: Subject<Group>;
|
|
24
|
-
private mbr;
|
|
25
23
|
transformationRenderBlock?: boolean;
|
|
26
24
|
constructor(board: Board, events?: Events | undefined, children?: string[], id?: string);
|
|
27
25
|
isClosed(): boolean;
|
|
28
26
|
getRichText(): null;
|
|
29
|
-
addChild(childId: string): void;
|
|
30
|
-
private applyAddChild;
|
|
31
|
-
private applyRemoveChild;
|
|
32
|
-
removeChild(childId: string): void;
|
|
33
|
-
emitRemoveChild(child: Item): void;
|
|
34
27
|
apply(op: Operation): void;
|
|
35
28
|
emit(operation: GroupOperation): void;
|
|
36
29
|
setId(id: string): this;
|
|
37
|
-
serialize(): GroupData;
|
|
38
|
-
deserialize(data: GroupData): this;
|
|
39
|
-
getId(): string;
|
|
40
|
-
getIntersectionPoints(segment: Line): Point[];
|
|
41
30
|
getMbr(): Mbr;
|
|
31
|
+
updateMbr(): void;
|
|
42
32
|
getChildrenIds(): string[];
|
|
43
33
|
getChildren(): Item[];
|
|
44
|
-
updateMbr(): void;
|
|
45
|
-
setBoard(board: Board): void;
|
|
46
|
-
setChildren(items: string[]): void;
|
|
47
|
-
removeChildren(): void;
|
|
48
34
|
getLinkTo(): string | undefined;
|
|
35
|
+
serialize(): GroupData;
|
|
36
|
+
deserialize(data: GroupData): this;
|
|
37
|
+
getId(): string;
|
|
38
|
+
getIntersectionPoints(segment: Line): Point[];
|
|
49
39
|
render(context: DrawingContext): void;
|
|
50
40
|
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
51
41
|
}
|
|
@@ -42,4 +42,23 @@ export declare class Matrix {
|
|
|
42
42
|
mirrorX(): Matrix;
|
|
43
43
|
mirrorY(): Matrix;
|
|
44
44
|
compare(matrix: Matrix): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Returns parent × this (local → world).
|
|
47
|
+
* Use when `this` is a local matrix and you need the world matrix.
|
|
48
|
+
*/
|
|
49
|
+
composeWith(parent: Matrix): Matrix;
|
|
50
|
+
/**
|
|
51
|
+
* Returns parent⁻¹ × this (world → local).
|
|
52
|
+
* Use when `this` is a world matrix and you need the local matrix relative to `parent`.
|
|
53
|
+
*/
|
|
54
|
+
toLocalOf(parent: Matrix): Matrix;
|
|
55
|
+
/**
|
|
56
|
+
* Applies the inverse of the linear (rotation/scale) part of this matrix to a 2D delta vector.
|
|
57
|
+
* Used to convert a world-space translation delta to the equivalent local-space delta.
|
|
58
|
+
* Does not involve the translation component of the matrix.
|
|
59
|
+
*/
|
|
60
|
+
applyInverseLinear(dx: number, dy: number): {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
45
64
|
}
|
|
@@ -26,6 +26,11 @@ export declare class Transformation {
|
|
|
26
26
|
y: number;
|
|
27
27
|
};
|
|
28
28
|
getRotation(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Replaces the internal matrix entirely with `matrix` without emitting an operation.
|
|
31
|
+
* Used by the nesting system to convert between world and local coordinate spaces.
|
|
32
|
+
*/
|
|
33
|
+
setLocalMatrix(matrix: Matrix): void;
|
|
29
34
|
setLocal(x: number, y: number, scaleX?: number, scaleY?: number): void;
|
|
30
35
|
setLocal(data: Partial<MatrixData>): void;
|
|
31
36
|
serialize(): TransformationData;
|
|
@@ -112,7 +112,7 @@ export declare class BoardSelection {
|
|
|
112
112
|
nestSelectedItems(unselectedItem?: Item | null, checkFrames?: boolean): void;
|
|
113
113
|
/** Emits applyMatrix with multiple items */
|
|
114
114
|
transformMany(items: ApplyMatrixItem[], timeStamp?: number): void;
|
|
115
|
-
/** transforms selected items
|
|
115
|
+
/** transforms selected items (container children follow via local transform hierarchy) */
|
|
116
116
|
getManyItemsTranslation(x: number, y: number, unselectedItem?: Item): ApplyMatrixItem[];
|
|
117
117
|
setStrokeStyle(borderStyle: BorderStyle): void;
|
|
118
118
|
setStrokeColor(borderColor: string): void;
|