microboard-temp 0.13.39 → 0.13.41
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 +8242 -8155
- package/dist/cjs/index.js +8242 -8155
- package/dist/cjs/node.js +3833 -3746
- package/dist/esm/browser.js +3822 -3735
- package/dist/esm/index.js +3822 -3735
- package/dist/esm/node.js +3822 -3735
- package/dist/types/Board.d.ts +7 -3
- package/dist/types/Events/BaseCommand.d.ts +16 -0
- package/dist/types/Events/Command.d.ts +2 -15
- package/dist/types/Events/Events.d.ts +1 -1
- package/dist/types/Events/Log/getSnapshotFromList.d.ts +5 -2
- package/dist/types/Items/AINode/AINode.d.ts +3 -4
- package/dist/types/Items/AINode/AINodeData.d.ts +1 -0
- package/dist/types/Items/Audio/Audio.d.ts +4 -3
- package/dist/types/Items/BaseItem/BaseItem.d.ts +11 -8
- package/dist/types/Items/BaseItem/index.d.ts +1 -0
- package/dist/types/Items/Comment/Comment.d.ts +11 -15
- package/dist/types/Items/Connector/Connector.d.ts +3 -3
- package/dist/types/Items/Connector/ConnectorOperations.d.ts +2 -2
- package/dist/types/Items/Connector/Pointers/Pointers.d.ts +18 -2
- package/dist/types/Items/Curve/Curve.d.ts +5 -6
- package/dist/types/Items/Drawing/Drawing.d.ts +4 -3
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +6 -7
- package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +4 -3
- package/dist/types/Items/Frame/Frame.d.ts +2 -3
- package/dist/types/Items/Frame/FrameData.d.ts +2 -0
- package/dist/types/Items/Frame/FrameOperation.d.ts +13 -1
- package/dist/types/Items/Group/Group.d.ts +4 -3
- package/dist/types/Items/Image/Image.d.ts +4 -3
- package/dist/types/Items/Mbr/updateRects.d.ts +1 -2
- package/dist/types/Items/Path/Path.d.ts +1 -0
- package/dist/types/Items/Path/Paths.d.ts +2 -0
- package/dist/types/Items/Placeholder/Placeholder.d.ts +5 -4
- package/dist/types/Items/RichText/CanvasText/Render.d.ts +1 -1
- package/dist/types/Items/RichText/Editor/BlockNode.d.ts +10 -3
- package/dist/types/Items/RichText/EditorContainer.d.ts +5 -6
- package/dist/types/Items/RichText/RichText.d.ts +3 -3
- package/dist/types/Items/RichText/RichTextData.d.ts +2 -0
- package/dist/types/Items/RichText/RichTextOperations.d.ts +3 -2
- package/dist/types/Items/RichText/setNodeStyles.d.ts +2 -5
- package/dist/types/Items/Shape/Shape.d.ts +2 -2
- package/dist/types/Items/Shape/ShapeData.d.ts +2 -0
- package/dist/types/Items/Sticker/Sticker.d.ts +3 -3
- package/dist/types/Items/Sticker/StickerOperation.d.ts +3 -3
- package/dist/types/Items/Video/Video.d.ts +7 -6
- package/dist/types/Items/index.d.ts +2 -0
- package/dist/types/Keyboard/types.d.ts +2 -1
- package/dist/types/Selection/Selection.d.ts +7 -7
- package/dist/types/Selection/Transformer/TextTransformer/getTextResizeType.d.ts +1 -1
- package/dist/types/Selection/Transformer/TransformerHelpers/AnchorType.d.ts +1 -1
- package/dist/types/Selection/Transformer/TransformerHelpers/getOppositePoint.d.ts +1 -1
- package/dist/types/Selection/Transformer/TransformerHelpers/getResizeMatrix.d.ts +1 -1
- package/dist/types/Selection/Transformer/TransformerHelpers/getResizedMbr.d.ts +1 -1
- package/dist/types/Settings.d.ts +1 -1
- package/dist/types/Tools/AddDrawing/AddDrawing.d.ts +1 -1
- package/dist/types/Tools/AddDrawing/AddHighlighter.d.ts +1 -1
- package/dist/types/Tools/Tools.d.ts +1 -1
- package/dist/types/parserHTML.d.ts +9 -1
- package/package.json +1 -1
package/dist/types/Board.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BoardOps, ItemsIndexRecord } from "./BoardOperations";
|
|
|
2
2
|
import { Camera } from "./Camera";
|
|
3
3
|
import { Events, Operation } from "./Events";
|
|
4
4
|
import { SyncBoardEvent } from "./Events/Events";
|
|
5
|
-
import {
|
|
5
|
+
import { Item, ItemData, Matrix, Mbr } from "./Items";
|
|
6
6
|
import { AINode } from "./Items/AINode";
|
|
7
7
|
import { DrawingContext } from "./Items/DrawingContext";
|
|
8
8
|
import { Group } from "./Items/Group";
|
|
@@ -11,11 +11,13 @@ import { Keyboard } from "./Keyboard";
|
|
|
11
11
|
import { Pointer } from "./Pointer";
|
|
12
12
|
import { Presence } from "./Presence/Presence";
|
|
13
13
|
import { BoardSelection } from "./Selection";
|
|
14
|
+
import { Theme } from "./Settings";
|
|
14
15
|
import { SpatialIndex } from "./SpatialIndex";
|
|
15
16
|
import { Subject } from "./Subject";
|
|
16
17
|
import { Tools } from "./Tools";
|
|
17
18
|
import { ItemsMap } from "./Validators";
|
|
18
19
|
import { BaseItem } from "./Items/BaseItem";
|
|
20
|
+
import { BaseItemData } from "./Items/BaseItem/BaseItem";
|
|
19
21
|
import { ItemDataWithId } from "./Items/Item";
|
|
20
22
|
import { Account } from "./types/Account";
|
|
21
23
|
export type InterfaceType = "edit" | "view" | "loading";
|
|
@@ -50,6 +52,7 @@ export declare class Board {
|
|
|
50
52
|
*/
|
|
51
53
|
disconnect(): void;
|
|
52
54
|
getAccount(): Account | null;
|
|
55
|
+
getTheme(): Theme;
|
|
53
56
|
getNewItemId(): string;
|
|
54
57
|
emit(operation: BoardOps): void;
|
|
55
58
|
getBoardId(): string;
|
|
@@ -64,7 +67,6 @@ export declare class Board {
|
|
|
64
67
|
private applyAddLockedGroupOperation;
|
|
65
68
|
private applyAddGroupOperation;
|
|
66
69
|
private applyRemoveOperation;
|
|
67
|
-
private applyRemoveLockedGroupOperation;
|
|
68
70
|
private applyRemoveGroupOperation;
|
|
69
71
|
private applyItemOperation;
|
|
70
72
|
private findItemAndApply;
|
|
@@ -73,7 +75,9 @@ export declare class Board {
|
|
|
73
75
|
handleNesting(items: Item | Item[]): void;
|
|
74
76
|
createItem(id: string, data: ItemData): Item;
|
|
75
77
|
parseHTML(el: HTMLElement): ItemDataWithId | {
|
|
76
|
-
data:
|
|
78
|
+
data: BaseItemData & {
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
77
81
|
childrenMap: {
|
|
78
82
|
[id: string]: ItemDataWithId;
|
|
79
83
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Board } from "../Board";
|
|
2
|
+
import { BaseOperation } from "./EventsOperations";
|
|
3
|
+
export declare class BaseCommand {
|
|
4
|
+
private board;
|
|
5
|
+
itemIds: string[];
|
|
6
|
+
operation: BaseOperation;
|
|
7
|
+
private reverse;
|
|
8
|
+
constructor(board: Board, itemIds: string[], operation: BaseOperation);
|
|
9
|
+
merge(op: BaseOperation): this;
|
|
10
|
+
apply(): void;
|
|
11
|
+
revert(): void;
|
|
12
|
+
getReverse(): {
|
|
13
|
+
itemId: string;
|
|
14
|
+
operation: BaseOperation;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import { Board } from '../Board';
|
|
2
|
-
import {
|
|
2
|
+
import { ItemOperation, Operation } from './EventsOperations';
|
|
3
3
|
import { Item, TransformationOperation } from '../Items';
|
|
4
4
|
export interface Command {
|
|
5
5
|
apply(): void;
|
|
6
6
|
revert(): void;
|
|
7
7
|
merge?: (op: any) => Command;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
private board;
|
|
11
|
-
itemIds: string[];
|
|
12
|
-
operation: BaseOperation;
|
|
13
|
-
private reverse;
|
|
14
|
-
constructor(board: Board, itemIds: string[], operation: BaseOperation);
|
|
15
|
-
merge(op: BaseOperation): this;
|
|
16
|
-
apply(): void;
|
|
17
|
-
revert(): void;
|
|
18
|
-
getReverse(): {
|
|
19
|
-
itemId: string;
|
|
20
|
-
operation: BaseOperation;
|
|
21
|
-
}[];
|
|
22
|
-
}
|
|
9
|
+
export { BaseCommand } from "./BaseCommand";
|
|
23
10
|
export interface ItemCommandFactory {
|
|
24
11
|
(items: Item[], operation: ItemOperation | TransformationOperation, board?: Board): Command;
|
|
25
12
|
}
|
|
@@ -13,12 +13,11 @@ import { Point } from "../Point/Point";
|
|
|
13
13
|
import { RichText } from "../RichText/RichText";
|
|
14
14
|
import { Transformation } from "../Transformation/Transformation";
|
|
15
15
|
import { Subject } from "../../Subject";
|
|
16
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
16
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
17
17
|
export declare const CONTEXT_NODE_HIGHLIGHT_COLOR = "rgba(183, 138, 240, 1)";
|
|
18
18
|
export declare const threadDirections: readonly [0, 1, 2, 3];
|
|
19
19
|
export type ThreadDirection = typeof threadDirections[number];
|
|
20
20
|
export declare class AINode extends BaseItem {
|
|
21
|
-
private id;
|
|
22
21
|
readonly itemType = "AINode";
|
|
23
22
|
parent: string;
|
|
24
23
|
readonly transformation: Transformation;
|
|
@@ -37,8 +36,8 @@ export declare class AINode extends BaseItem {
|
|
|
37
36
|
prevMbr: Mbr | null;
|
|
38
37
|
constructor(board: Board, isUserRequest?: boolean, parentNodeId?: string, contextItems?: string[], threadDirection?: ThreadDirection, id?: string);
|
|
39
38
|
transformPath(): void;
|
|
40
|
-
serialize(
|
|
41
|
-
deserialize(data:
|
|
39
|
+
serialize(): SerializedItemData<AINodeData>;
|
|
40
|
+
deserialize(data: SerializedItemData<AINodeData> | AINodeData): this;
|
|
42
41
|
setId(id: string): this;
|
|
43
42
|
protected onParentChanged(newParent: string): void;
|
|
44
43
|
getId(): string;
|
|
@@ -8,12 +8,13 @@ import { LinkTo } from "../LinkTo/LinkTo";
|
|
|
8
8
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
9
|
import { Path } from "../Path";
|
|
10
10
|
import { Point } from "../Point/Point";
|
|
11
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
11
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
12
12
|
export interface AudioItemData {
|
|
13
13
|
itemType: "Audio";
|
|
14
14
|
url: string;
|
|
15
15
|
transformation: TransformationData;
|
|
16
16
|
extension?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
17
18
|
}
|
|
18
19
|
export declare class AudioItem extends BaseItem {
|
|
19
20
|
private events?;
|
|
@@ -45,8 +46,8 @@ export declare class AudioItem extends BaseItem {
|
|
|
45
46
|
updateMbr(): void;
|
|
46
47
|
render(context: DrawingContext): void;
|
|
47
48
|
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
48
|
-
serialize(): AudioItemData
|
|
49
|
-
deserialize(data:
|
|
49
|
+
serialize(): SerializedItemData<AudioItemData>;
|
|
50
|
+
deserialize(data: SerializedItemData<AudioItemData> | AudioItemData): this;
|
|
50
51
|
apply(op: Operation): void;
|
|
51
52
|
emit(operation: Operation): void;
|
|
52
53
|
setId(id: string): this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mbr } from "../Mbr/Mbr";
|
|
2
2
|
import { Geometry } from "../Geometry";
|
|
3
|
-
import { RichText } from "../RichText/RichText";
|
|
3
|
+
import type { RichText } from "../RichText/RichText";
|
|
4
4
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
5
5
|
import { Transformation } from "../Transformation/Transformation";
|
|
6
6
|
import { Board } from "../../Board";
|
|
@@ -15,17 +15,20 @@ import { BaseItemOperation } from "./BaseItemOperation";
|
|
|
15
15
|
import { SimpleSpatialIndex } from "../../SpatialIndex/SimpleSpatialIndex";
|
|
16
16
|
import { Point } from "../Point";
|
|
17
17
|
import { Matrix } from "../Transformation/Matrix";
|
|
18
|
-
export
|
|
18
|
+
export interface BaseItemData {
|
|
19
19
|
itemType: string;
|
|
20
|
-
|
|
21
|
-
export type SerializedItemData<T extends BaseItemData = BaseItemData> = {
|
|
20
|
+
transformation?: TransformationData;
|
|
22
21
|
linkTo?: string;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
25
|
+
id: string;
|
|
23
26
|
transformation: TransformationData;
|
|
24
|
-
|
|
25
|
-
} & T;
|
|
27
|
+
};
|
|
26
28
|
export declare class BaseItem extends Mbr implements Geometry {
|
|
27
29
|
private defaultItemData?;
|
|
28
30
|
[key: string]: any;
|
|
31
|
+
static createCommand?: (board: Board, operation: Operation) => any;
|
|
29
32
|
readonly transformation: Transformation;
|
|
30
33
|
readonly linkTo: LinkTo;
|
|
31
34
|
parent: string;
|
|
@@ -94,8 +97,8 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
94
97
|
updateMbr(): void;
|
|
95
98
|
getLinkTo(): string | undefined;
|
|
96
99
|
getRichText(): RichText | null;
|
|
97
|
-
deserialize(data: SerializedItemData): this;
|
|
98
|
-
serialize(): SerializedItemData
|
|
100
|
+
deserialize(data: SerializedItemData<any> | BaseItemData): this;
|
|
101
|
+
serialize(): SerializedItemData<BaseItemData>;
|
|
99
102
|
isClosed(): boolean;
|
|
100
103
|
emit(operation: Operation | BaseOperation): void;
|
|
101
104
|
emitForManyItems(operation: Operation | BaseOperation): void;
|
|
@@ -2,14 +2,17 @@ import { Subject } from "../../Subject";
|
|
|
2
2
|
import { Events, Operation } from "../../Events";
|
|
3
3
|
import { Point } from "../Point";
|
|
4
4
|
import { Transformation, TransformationData } from "../Transformation";
|
|
5
|
+
import { CommentOperation } from "./CommentOperation";
|
|
5
6
|
import { Mbr } from "../Mbr";
|
|
6
|
-
import { Geometry } from "../Geometry";
|
|
7
7
|
import { GeometricNormal } from "../GeometricNormal";
|
|
8
8
|
import { RichText } from "../RichText";
|
|
9
9
|
import { DrawingContext } from "../DrawingContext";
|
|
10
|
+
import { SerializedItemData } from "../BaseItem";
|
|
10
11
|
import { Line } from "../Line";
|
|
11
12
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
12
13
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
14
|
+
import { BaseItem } from "../BaseItem/BaseItem";
|
|
15
|
+
import { Board } from "../../Board";
|
|
13
16
|
export interface Commentator {
|
|
14
17
|
username: string;
|
|
15
18
|
id: number;
|
|
@@ -31,12 +34,11 @@ export interface CommentData {
|
|
|
31
34
|
usersUnreadMarks: number[];
|
|
32
35
|
resolved: boolean;
|
|
33
36
|
itemToFollow?: string;
|
|
37
|
+
[key: string]: unknown;
|
|
34
38
|
}
|
|
35
|
-
export declare class Comment
|
|
39
|
+
export declare class Comment extends BaseItem {
|
|
36
40
|
private anchor;
|
|
37
41
|
private events?;
|
|
38
|
-
private id;
|
|
39
|
-
readonly itemType = "Comment";
|
|
40
42
|
parent: string;
|
|
41
43
|
readonly transformation: Transformation;
|
|
42
44
|
private commentators;
|
|
@@ -48,14 +50,10 @@ export declare class Comment implements Geometry {
|
|
|
48
50
|
readonly linkTo: LinkTo;
|
|
49
51
|
transformationRenderBlock?: boolean;
|
|
50
52
|
resizeEnabled: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
constructor(anchor?: Point, events?: Events | undefined, id?: string);
|
|
56
|
-
serialize(): CommentData;
|
|
57
|
-
deserialize(data: CommentData): this;
|
|
58
|
-
private emit;
|
|
53
|
+
constructor(board: Board, anchor?: Point, events?: Events | undefined, id?: string);
|
|
54
|
+
serialize(): SerializedItemData<CommentData>;
|
|
55
|
+
deserialize(data: SerializedItemData<CommentData> | CommentData): this;
|
|
56
|
+
emit(operation: CommentOperation): void;
|
|
59
57
|
getItemToFollow(): string | undefined;
|
|
60
58
|
getMbrWithChildren(): Mbr;
|
|
61
59
|
setItemToFollow(itemId: string | undefined): void;
|
|
@@ -71,7 +69,7 @@ export declare class Comment implements Geometry {
|
|
|
71
69
|
markThreadAsUnread(userId: number): void;
|
|
72
70
|
markThreadAsRead(userId: number): void;
|
|
73
71
|
private _syncing;
|
|
74
|
-
|
|
72
|
+
transform(): void;
|
|
75
73
|
getUnreadMessages(userId?: number): Message[] | null;
|
|
76
74
|
getIsThreadMarkedAsUnread(userId: number): boolean;
|
|
77
75
|
isClosed(): boolean;
|
|
@@ -95,8 +93,6 @@ export declare class Comment implements Geometry {
|
|
|
95
93
|
isUnderPoint(point: Point): boolean;
|
|
96
94
|
private generateMessageId;
|
|
97
95
|
getLinkTo(): string | undefined;
|
|
98
|
-
getPath(): null;
|
|
99
|
-
getSnapAnchorPoints(): Point[] | null;
|
|
100
96
|
getChildrenIds(): string[] | null;
|
|
101
97
|
addChildItems(_children: unknown[]): void;
|
|
102
98
|
removeChildItems(_children: unknown | unknown[]): void;
|
|
@@ -16,7 +16,7 @@ import { ConnectorPointerStyle, Pointer } from './Pointers/Pointers';
|
|
|
16
16
|
import { LinkTo } from '../LinkTo/LinkTo';
|
|
17
17
|
import { DocumentFactory } from '../../api/DocumentFactory';
|
|
18
18
|
import { ConnectorAnchorColors } from './types';
|
|
19
|
-
import { BaseItem } from "../BaseItem";
|
|
19
|
+
import { BaseItem, SerializedItemData } from "../BaseItem";
|
|
20
20
|
import { ColorValue } from '../../..';
|
|
21
21
|
export declare const ConnectorLineStyles: readonly ["straight", "curved", "orthogonal"];
|
|
22
22
|
export type ConnectorLineStyle = (typeof ConnectorLineStyles)[number];
|
|
@@ -129,8 +129,8 @@ export declare class Connector extends BaseItem {
|
|
|
129
129
|
getPaths(): Path;
|
|
130
130
|
copyPaths(): Path;
|
|
131
131
|
isClosed(): boolean;
|
|
132
|
-
serialize(): ConnectorData
|
|
133
|
-
deserialize(data:
|
|
132
|
+
serialize(): SerializedItemData<ConnectorData>;
|
|
133
|
+
deserialize(data: SerializedItemData<ConnectorData> | ConnectorData): this;
|
|
134
134
|
getConnectorById(items: Item[], connectorId: string): Connector | undefined;
|
|
135
135
|
updateTitle(): void;
|
|
136
136
|
private scalePoints;
|
|
@@ -3,7 +3,6 @@ import { ConnectionLineWidth, ConnectorLineStyle } from "./Connector";
|
|
|
3
3
|
import { ConnectorPointerStyle } from "./Pointers/Pointers";
|
|
4
4
|
import { DefaultRichTextData } from "../RichText/RichTextData";
|
|
5
5
|
import { DefaultTransformationData } from "../Transformation/TransformationData";
|
|
6
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
7
6
|
import { BorderStyle } from "../Path";
|
|
8
7
|
import { ColorValue } from "../../..";
|
|
9
8
|
export declare class ConnectorData {
|
|
@@ -15,12 +14,13 @@ export declare class ConnectorData {
|
|
|
15
14
|
endPointerStyle: ConnectorPointerStyle;
|
|
16
15
|
lineStyle: ConnectorLineStyle;
|
|
17
16
|
lineColor: ColorValue;
|
|
18
|
-
linkTo?: string
|
|
17
|
+
linkTo?: string;
|
|
19
18
|
lineWidth: ConnectionLineWidth;
|
|
20
19
|
borderStyle: BorderStyle;
|
|
21
20
|
transformation: DefaultTransformationData;
|
|
22
21
|
text: DefaultRichTextData;
|
|
23
22
|
optionalFindItemFn?: FindItemFn;
|
|
23
|
+
[key: string]: unknown;
|
|
24
24
|
}
|
|
25
25
|
interface SetStartPoint {
|
|
26
26
|
class: "Connector";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Path, Paths } from '../../Path';
|
|
2
2
|
import { Point } from '../../Point';
|
|
3
3
|
export interface Pointer {
|
|
4
|
-
name:
|
|
4
|
+
name: string;
|
|
5
5
|
path: Path | Paths;
|
|
6
6
|
start: Point;
|
|
7
7
|
end: Point;
|
|
8
|
-
middle: Point[];
|
|
8
|
+
middle: readonly Point[];
|
|
9
9
|
}
|
|
10
10
|
export declare function getPointer(style: string): Pointer;
|
|
11
11
|
declare const Pointers: {
|
|
@@ -14,96 +14,112 @@ declare const Pointers: {
|
|
|
14
14
|
readonly path: Path;
|
|
15
15
|
readonly start: Point;
|
|
16
16
|
readonly end: Point;
|
|
17
|
+
readonly middle: readonly [];
|
|
17
18
|
};
|
|
18
19
|
readonly Angle: {
|
|
19
20
|
readonly name: "Angle";
|
|
20
21
|
readonly path: Path;
|
|
21
22
|
readonly start: Point;
|
|
22
23
|
readonly end: Point;
|
|
24
|
+
readonly middle: readonly [];
|
|
23
25
|
};
|
|
24
26
|
readonly ArrowBroad: {
|
|
25
27
|
readonly name: "ArrowBroad";
|
|
26
28
|
readonly path: Path;
|
|
27
29
|
readonly start: Point;
|
|
28
30
|
readonly end: Point;
|
|
31
|
+
readonly middle: readonly [];
|
|
29
32
|
};
|
|
30
33
|
readonly ArrowThin: {
|
|
31
34
|
readonly name: "ArrowThin";
|
|
32
35
|
readonly path: Path;
|
|
33
36
|
readonly start: Point;
|
|
34
37
|
readonly end: Point;
|
|
38
|
+
readonly middle: readonly [];
|
|
35
39
|
};
|
|
36
40
|
readonly CircleFilled: {
|
|
37
41
|
readonly name: "CircleFilled";
|
|
38
42
|
readonly path: Path;
|
|
39
43
|
readonly start: Point;
|
|
40
44
|
readonly end: Point;
|
|
45
|
+
readonly middle: readonly [];
|
|
41
46
|
};
|
|
42
47
|
readonly DiamondEmpty: {
|
|
43
48
|
readonly name: "DiamondEmpty";
|
|
44
49
|
readonly path: Path;
|
|
45
50
|
readonly start: Point;
|
|
46
51
|
readonly end: Point;
|
|
52
|
+
readonly middle: readonly [];
|
|
47
53
|
};
|
|
48
54
|
readonly DiamondFilled: {
|
|
49
55
|
readonly name: "DiamondFilled";
|
|
50
56
|
readonly path: Path;
|
|
51
57
|
readonly start: Point;
|
|
52
58
|
readonly end: Point;
|
|
59
|
+
readonly middle: readonly [];
|
|
53
60
|
};
|
|
54
61
|
readonly Many: {
|
|
55
62
|
readonly name: "Many";
|
|
56
63
|
readonly path: Paths;
|
|
57
64
|
readonly start: Point;
|
|
58
65
|
readonly end: Point;
|
|
66
|
+
readonly middle: readonly [];
|
|
59
67
|
};
|
|
60
68
|
readonly ManyMandatory: {
|
|
61
69
|
readonly name: "ManyManadatory";
|
|
62
70
|
readonly path: Paths;
|
|
63
71
|
readonly start: Point;
|
|
64
72
|
readonly end: Point;
|
|
73
|
+
readonly middle: readonly [];
|
|
65
74
|
};
|
|
66
75
|
readonly ManyOptional: {
|
|
67
76
|
readonly name: "ManyOptional";
|
|
68
77
|
readonly path: Paths;
|
|
69
78
|
readonly start: Point;
|
|
70
79
|
readonly end: Point;
|
|
80
|
+
readonly middle: readonly [];
|
|
71
81
|
};
|
|
72
82
|
readonly One: {
|
|
73
83
|
readonly name: "One";
|
|
74
84
|
readonly path: Paths;
|
|
75
85
|
readonly start: Point;
|
|
76
86
|
readonly end: Point;
|
|
87
|
+
readonly middle: readonly [];
|
|
77
88
|
};
|
|
78
89
|
readonly OneMandatory: {
|
|
79
90
|
readonly name: "OneMandatory";
|
|
80
91
|
readonly path: Paths;
|
|
81
92
|
readonly start: Point;
|
|
82
93
|
readonly end: Point;
|
|
94
|
+
readonly middle: readonly [];
|
|
83
95
|
};
|
|
84
96
|
readonly OneOptional: {
|
|
85
97
|
readonly name: "OneOptional";
|
|
86
98
|
readonly path: Paths;
|
|
87
99
|
readonly start: Point;
|
|
88
100
|
readonly end: Point;
|
|
101
|
+
readonly middle: readonly [];
|
|
89
102
|
};
|
|
90
103
|
readonly TriangleEmpty: {
|
|
91
104
|
readonly name: "TriangleEmpty";
|
|
92
105
|
readonly path: Path;
|
|
93
106
|
readonly start: Point;
|
|
94
107
|
readonly end: Point;
|
|
108
|
+
readonly middle: readonly [];
|
|
95
109
|
};
|
|
96
110
|
readonly TriangleFilled: {
|
|
97
111
|
readonly name: "TriangleFilled";
|
|
98
112
|
readonly path: Path;
|
|
99
113
|
readonly start: Point;
|
|
100
114
|
readonly end: Point;
|
|
115
|
+
readonly middle: readonly [];
|
|
101
116
|
};
|
|
102
117
|
readonly Zero: {
|
|
103
118
|
readonly name: "Zero";
|
|
104
119
|
readonly path: Path;
|
|
105
120
|
readonly start: Point;
|
|
106
121
|
readonly end: Point;
|
|
122
|
+
readonly middle: readonly [];
|
|
107
123
|
};
|
|
108
124
|
};
|
|
109
125
|
export type ConnectorPointerStyle = keyof typeof Pointers;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Bezier } from 'bezier-js';
|
|
2
1
|
import { Mbr } from '../Mbr';
|
|
3
2
|
import { Line } from '../Line';
|
|
4
3
|
import { Point } from '../Point';
|
|
5
4
|
import { Matrix } from '../Transformation';
|
|
6
5
|
import { GeometricNormal } from '../GeometricNormal';
|
|
7
6
|
export declare class BaseCurve {
|
|
8
|
-
curve:
|
|
9
|
-
constructor(curve:
|
|
10
|
-
protected updateCache(curve:
|
|
7
|
+
curve: any;
|
|
8
|
+
constructor(curve: any);
|
|
9
|
+
protected updateCache(curve: any): void;
|
|
11
10
|
getIntersectionPoints(segment: Line): Point[];
|
|
12
11
|
getNearestEdgePointTo(point: Point): Point;
|
|
13
12
|
getDistance(point: Point): number;
|
|
@@ -26,7 +25,7 @@ export declare class QuadraticBezier extends BaseCurve {
|
|
|
26
25
|
control: Point;
|
|
27
26
|
end: Point;
|
|
28
27
|
type: "QuadBezier";
|
|
29
|
-
static getCache(start?: Point, control?: Point, end?: Point):
|
|
28
|
+
static getCache(start?: Point, control?: Point, end?: Point): any;
|
|
30
29
|
constructor(start?: Point, control?: Point, end?: Point);
|
|
31
30
|
protected updateCache(): void;
|
|
32
31
|
getStartPoint(): Point;
|
|
@@ -43,7 +42,7 @@ export declare class CubicBezier extends BaseCurve {
|
|
|
43
42
|
end: Point;
|
|
44
43
|
endControl: Point;
|
|
45
44
|
type: "CubicBezier";
|
|
46
|
-
static getCache(start?: Point, startControl?: Point, end?: Point, endControl?: Point):
|
|
45
|
+
static getCache(start?: Point, startControl?: Point, end?: Point, endControl?: Point): any;
|
|
47
46
|
constructor(start?: Point, startControl?: Point, end?: Point, endControl?: Point);
|
|
48
47
|
protected updateCache(): void;
|
|
49
48
|
getStartPoint(): Point;
|
|
@@ -11,7 +11,7 @@ import { TransformationData } from "../Transformation/TransformationData";
|
|
|
11
11
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
12
12
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
13
13
|
import { Board } from "../../Board";
|
|
14
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
14
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
15
15
|
import { ColorValue, ColorRole } from "../../..";
|
|
16
16
|
export interface DrawingData {
|
|
17
17
|
itemType: "Drawing";
|
|
@@ -24,6 +24,7 @@ export interface DrawingData {
|
|
|
24
24
|
strokeWidth: number;
|
|
25
25
|
colorRole?: ColorRole;
|
|
26
26
|
linkTo?: string;
|
|
27
|
+
[key: string]: unknown;
|
|
27
28
|
}
|
|
28
29
|
export declare class Drawing extends BaseItem {
|
|
29
30
|
points: Point[];
|
|
@@ -44,8 +45,8 @@ export declare class Drawing extends BaseItem {
|
|
|
44
45
|
private borderOpacity;
|
|
45
46
|
transformationRenderBlock?: boolean;
|
|
46
47
|
constructor(board: Board, points: Point[], events?: Events | undefined, id?: string);
|
|
47
|
-
serialize(): DrawingData
|
|
48
|
-
deserialize(data: DrawingData): this;
|
|
48
|
+
serialize(): SerializedItemData<DrawingData>;
|
|
49
|
+
deserialize(data: SerializedItemData<DrawingData>): this;
|
|
49
50
|
updateGeometry(): void;
|
|
50
51
|
updateMbr(): void;
|
|
51
52
|
updatePath2d(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/BaseItem";
|
|
2
|
-
import { BorderWidth, Path } from "../../../../Items";
|
|
2
|
+
import { BorderWidth, Path, BorderStyle } from "../../../../Items";
|
|
3
3
|
import { Subject } from "../../../../Subject";
|
|
4
4
|
import { Board } from "../../../../Board";
|
|
5
5
|
import { DrawingContext } from "../../../../Items";
|
|
@@ -12,13 +12,12 @@ export declare class Dice extends BaseItem {
|
|
|
12
12
|
private type;
|
|
13
13
|
private path;
|
|
14
14
|
readonly subject: Subject<Dice>;
|
|
15
|
-
private borderWidth;
|
|
16
|
-
valueIndex: number;
|
|
17
|
-
values: (number | string)[];
|
|
18
|
-
renderValues: Record<number, number | HTMLImageElement>;
|
|
19
|
-
private animationFrameId?;
|
|
20
15
|
drawingContext: DrawingContext | null;
|
|
21
|
-
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
borderColor: string;
|
|
18
|
+
borderStyle: BorderStyle;
|
|
19
|
+
private borderWidth;
|
|
20
|
+
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
22
21
|
private transformPath;
|
|
23
22
|
updateRenderValues(): Promise<void>;
|
|
24
23
|
render(context: DrawingContext): void;
|
|
@@ -2,19 +2,20 @@ import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/Ba
|
|
|
2
2
|
import { Board } from "../../../../Board";
|
|
3
3
|
import { Subject } from "../../../../Subject";
|
|
4
4
|
import { DrawingContext } from "../../../DrawingContext";
|
|
5
|
-
import { BorderWidth } from "../../../Path";
|
|
5
|
+
import { BorderWidth, BorderStyle } from "../../../Path";
|
|
6
6
|
import { ScreenOperation } from "./ScreenOperation";
|
|
7
7
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
8
8
|
export declare const defaultScreenData: BaseItemData;
|
|
9
9
|
export declare class Screen extends BaseItem {
|
|
10
|
-
private ownerId;
|
|
11
10
|
readonly subject: Subject<Screen>;
|
|
12
11
|
private path;
|
|
13
12
|
private borderWidth;
|
|
14
13
|
backgroundColor: string;
|
|
14
|
+
borderColor: string;
|
|
15
|
+
borderStyle: BorderStyle;
|
|
15
16
|
backgroundUrl: string;
|
|
16
17
|
backgroundImage: HTMLImageElement | null;
|
|
17
|
-
constructor(board: Board, id?: string,
|
|
18
|
+
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
18
19
|
apply(op: ScreenOperation): void;
|
|
19
20
|
getOwnerId(): string;
|
|
20
21
|
getBackgroundColor(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mbr, Line, Point, Transformation, Path, Paths, Item, RichText, Matrix } from "..";
|
|
1
|
+
import { Mbr, Line, Point, Transformation, Path, Paths, Item, RichText, Matrix, SerializedItemData } from "..";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
3
|
import { DrawingContext } from "../DrawingContext";
|
|
4
4
|
import { Operation } from "../../Events";
|
|
@@ -29,7 +29,6 @@ export declare class Frame extends BaseItem {
|
|
|
29
29
|
readonly subject: Subject<Frame>;
|
|
30
30
|
private textContainer;
|
|
31
31
|
private path;
|
|
32
|
-
private children;
|
|
33
32
|
private mbr;
|
|
34
33
|
readonly linkTo: LinkTo;
|
|
35
34
|
readonly text: RichText;
|
|
@@ -74,7 +73,7 @@ export declare class Frame extends BaseItem {
|
|
|
74
73
|
};
|
|
75
74
|
scaleLikeLastFrame(): void;
|
|
76
75
|
setLastFrameScale(): void;
|
|
77
|
-
serialize(): FrameData
|
|
76
|
+
serialize(): SerializedItemData<FrameData>;
|
|
78
77
|
deserialize(data: Partial<FrameData>): this;
|
|
79
78
|
getSavedProportionsMatrix(): Matrix;
|
|
80
79
|
private transformPath;
|
|
@@ -49,6 +49,7 @@ export interface FrameData {
|
|
|
49
49
|
text?: RichTextData;
|
|
50
50
|
canChangeRatio?: boolean;
|
|
51
51
|
linkTo?: string;
|
|
52
|
+
[key: string]: unknown;
|
|
52
53
|
}
|
|
53
54
|
export declare class DefaultFrameData implements FrameData {
|
|
54
55
|
shapeType: FrameType;
|
|
@@ -64,5 +65,6 @@ export declare class DefaultFrameData implements FrameData {
|
|
|
64
65
|
canChangeRatio: boolean;
|
|
65
66
|
linkTo?: string | undefined;
|
|
66
67
|
readonly itemType = "Frame";
|
|
68
|
+
[key: string]: unknown;
|
|
67
69
|
constructor(shapeType?: FrameType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, children?: string[], text?: RichTextData, canChangeRatio?: boolean, linkTo?: string | undefined);
|
|
68
70
|
}
|
|
@@ -31,5 +31,17 @@ interface RemoveChild {
|
|
|
31
31
|
item: string[];
|
|
32
32
|
childId: string[];
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
interface AddChildren {
|
|
35
|
+
class: "Frame";
|
|
36
|
+
method: "addChildren";
|
|
37
|
+
item: string[];
|
|
38
|
+
childId: string[];
|
|
39
|
+
}
|
|
40
|
+
interface RemoveChildren {
|
|
41
|
+
class: "Frame";
|
|
42
|
+
method: "removeChildren";
|
|
43
|
+
item: string[];
|
|
44
|
+
childId: string[];
|
|
45
|
+
}
|
|
46
|
+
export type FrameOperation = SetBackgroundColor | SetCanChangeRatio | SetFrameType | AddChild | RemoveChild | AddChildren | RemoveChildren;
|
|
35
47
|
export {};
|