microboard-temp 0.4.39 → 0.4.40
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 +29980 -29719
- package/dist/cjs/index.js +29980 -29719
- package/dist/cjs/node.js +30041 -29780
- package/dist/esm/browser.js +29980 -29719
- package/dist/esm/index.js +29980 -29719
- package/dist/esm/node.js +30041 -29780
- package/dist/types/Items/BaseItem/BaseItem.d.ts +8 -7
- package/dist/types/Items/BaseItem/BaseItemOperation.d.ts +9 -4
- package/dist/types/SpatialIndex/SpacialIndex.d.ts +35 -2
- package/package.json +1 -1
|
@@ -11,23 +11,24 @@ import { TransformationData } from "Items/Transformation/TransformationData";
|
|
|
11
11
|
import { BaseOperation } from "Events/EventsOperations";
|
|
12
12
|
import { Subject } from "../../Subject";
|
|
13
13
|
import { Path, Paths } from "../Path";
|
|
14
|
-
import {
|
|
14
|
+
import { BaseItemOperation } from "./BaseItemOperation";
|
|
15
|
+
import { SimpleSpatialIndex } from "../../SpatialIndex/SpacialIndex";
|
|
15
16
|
export type BaseItemData = {
|
|
16
17
|
itemType: string;
|
|
17
18
|
} & Record<string, any>;
|
|
18
19
|
export type SerializedItemData<T extends BaseItemData = BaseItemData> = {
|
|
19
20
|
linkTo?: string;
|
|
20
21
|
transformation: TransformationData;
|
|
22
|
+
children?: string[];
|
|
21
23
|
} & T;
|
|
22
24
|
export declare class BaseItem extends Mbr implements Geometry {
|
|
23
25
|
private defaultItemData?;
|
|
24
26
|
readonly transformation: Transformation;
|
|
25
27
|
readonly linkTo: LinkTo;
|
|
26
28
|
parent: string;
|
|
27
|
-
private children;
|
|
28
29
|
canBeNested: boolean;
|
|
29
30
|
transformationRenderBlock?: boolean;
|
|
30
|
-
|
|
31
|
+
readonly index: SimpleSpatialIndex | null;
|
|
31
32
|
board: Board;
|
|
32
33
|
id: string;
|
|
33
34
|
subject: Subject<any>;
|
|
@@ -35,19 +36,19 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
35
36
|
shouldUseCustomRender: boolean;
|
|
36
37
|
shouldRenderOutsideViewRect: boolean;
|
|
37
38
|
itemType: string;
|
|
38
|
-
constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined);
|
|
39
|
+
constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
|
|
39
40
|
getId(): string;
|
|
40
41
|
setId(id: string): this;
|
|
41
42
|
getChildrenIds(): string[] | null;
|
|
42
43
|
addChildItems(children: BaseItem[]): void;
|
|
43
44
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
44
45
|
emitNesting(children: BaseItem[]): void;
|
|
45
|
-
private updateChildren;
|
|
46
46
|
handleNesting(item: BaseItem | Mbr, options?: {
|
|
47
47
|
onlyForOut?: boolean;
|
|
48
48
|
cancelIfChild?: boolean;
|
|
49
49
|
}): boolean;
|
|
50
|
-
|
|
50
|
+
applyAddChildren(childIds: string[]): void;
|
|
51
|
+
applyRemoveChildren(childIds: string[]): void;
|
|
51
52
|
updateMbr(): void;
|
|
52
53
|
getLinkTo(): string | undefined;
|
|
53
54
|
getRichText(): RichText | null;
|
|
@@ -55,7 +56,7 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
55
56
|
serialize(): SerializedItemData;
|
|
56
57
|
isClosed(): boolean;
|
|
57
58
|
emit(operation: Operation | BaseOperation): void;
|
|
58
|
-
apply(op: Operation | BaseOperation): void;
|
|
59
|
+
apply(op: Operation | BaseItemOperation | BaseOperation): void;
|
|
59
60
|
addOnRemoveCallback(cb: () => void): void;
|
|
60
61
|
onRemove(): void;
|
|
61
62
|
getPathMbr(): Mbr;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { BaseOperation } from "../../Events/EventsOperations";
|
|
2
|
-
export type BaseItemOperation =
|
|
3
|
-
export interface
|
|
4
|
-
|
|
2
|
+
export type BaseItemOperation = RemoveChildren | AddChildren;
|
|
3
|
+
export interface RemoveChildren extends BaseOperation<{
|
|
4
|
+
childIds: string[];
|
|
5
5
|
}> {
|
|
6
|
-
method: "
|
|
6
|
+
method: "removeChildren";
|
|
7
|
+
}
|
|
8
|
+
export interface AddChildren extends BaseOperation<{
|
|
9
|
+
childIds: string;
|
|
10
|
+
}> {
|
|
11
|
+
method: "addChildren";
|
|
7
12
|
}
|
|
@@ -19,6 +19,9 @@ export declare class SpatialIndex {
|
|
|
19
19
|
change: (item: Item) => void;
|
|
20
20
|
remove(item: Item): void;
|
|
21
21
|
copy(): ItemDataWithId[];
|
|
22
|
+
getItemsWithIncludedChildren(items: Item[]): Item[];
|
|
23
|
+
getItemChildren(item: Item): Item[];
|
|
24
|
+
getItemParent(item: Item): Item | undefined;
|
|
22
25
|
moveToZIndex(item: Item, zIndex: number): void;
|
|
23
26
|
moveManyToZIndex(itemsRecord: ItemsIndexRecord): void;
|
|
24
27
|
sendToBack(item: Item, shouldPublish?: boolean): void;
|
|
@@ -31,7 +34,7 @@ export declare class SpatialIndex {
|
|
|
31
34
|
findById(id: string): Item | undefined;
|
|
32
35
|
getEnclosed(left: number, top: number, right: number, bottom: number): Item[];
|
|
33
36
|
getEnclosedOrCrossed(left: number, top: number, right: number, bottom: number): Item[];
|
|
34
|
-
getUnderPoint(point: Point,
|
|
37
|
+
getUnderPoint(point: Point, tolerance?: number): Item[];
|
|
35
38
|
getRectsEnclosedOrCrossed(left: number, top: number, right: number, bottom: number): Item[];
|
|
36
39
|
getItemsEnclosedOrCrossed(left: number, top: number, right: number, bottom: number): Item[];
|
|
37
40
|
getComments(): Comment[];
|
|
@@ -50,7 +53,6 @@ export declare class Items {
|
|
|
50
53
|
constructor(index: SpatialIndex, view: Camera, pointer: Pointer, subject: Subject<Items>);
|
|
51
54
|
update(item: Item): void;
|
|
52
55
|
listAll(): Item[];
|
|
53
|
-
listFrames(): BaseItem[];
|
|
54
56
|
listGroupItems(): BaseItem[];
|
|
55
57
|
getById(id: string): BaseItem | undefined;
|
|
56
58
|
findById(id: string): Item | undefined;
|
|
@@ -75,3 +77,34 @@ export declare class Items {
|
|
|
75
77
|
getWholeHTML(documentFactory: DocumentFactory): string;
|
|
76
78
|
getHTML(documentFactory: DocumentFactory, items: Item[]): string;
|
|
77
79
|
}
|
|
80
|
+
export declare class SimpleSpatialIndex {
|
|
81
|
+
subject: Subject<Items>;
|
|
82
|
+
private itemsArray;
|
|
83
|
+
private Mbr;
|
|
84
|
+
readonly items: Items;
|
|
85
|
+
constructor(view: Camera, pointer: Pointer);
|
|
86
|
+
clear(): void;
|
|
87
|
+
insert(item: Item): void;
|
|
88
|
+
change: (item: Item) => void;
|
|
89
|
+
remove(item: Item): void;
|
|
90
|
+
copy(): ItemDataWithId[];
|
|
91
|
+
moveToZIndex(item: Item, zIndex: number): void;
|
|
92
|
+
moveManyToZIndex(itemsRecord: ItemsIndexRecord): void;
|
|
93
|
+
sendToBack(item: Item, shouldPublish?: boolean): void;
|
|
94
|
+
sendManyToBack(items: Item[]): void;
|
|
95
|
+
bringToFront(item: Item, shouldPublish?: boolean): void;
|
|
96
|
+
bringManyToFront(items: Item[]): void;
|
|
97
|
+
moveSecondAfterFirst(first: Item, second: Item): void;
|
|
98
|
+
moveSecondBeforeFirst(first: Item, second: Item): void;
|
|
99
|
+
getById(id: string): BaseItem | undefined;
|
|
100
|
+
findById(id: string): Item | undefined;
|
|
101
|
+
getEnclosed(left: number, top: number, right: number, bottom: number): Item[];
|
|
102
|
+
getEnclosedOrCrossed(left: number, top: number, right: number, bottom: number): Item[];
|
|
103
|
+
getUnderPoint(point: Point, tolerace?: number): Item[];
|
|
104
|
+
getMbr(): Mbr;
|
|
105
|
+
list(): Item[];
|
|
106
|
+
getZIndex(item: Item): number;
|
|
107
|
+
getLastZIndex(): number;
|
|
108
|
+
getByZIndex(index: number): Item;
|
|
109
|
+
render(context: DrawingContext): void;
|
|
110
|
+
}
|