microboard-temp 0.13.92 → 0.13.93
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 +27156 -27128
- package/dist/cjs/index.js +27156 -27128
- package/dist/cjs/node.js +27156 -27128
- package/dist/esm/browser.js +27159 -27131
- package/dist/esm/index.js +27159 -27131
- package/dist/esm/node.js +27156 -27128
- package/dist/types/Items/AINode/AINode.d.ts +0 -4
- package/dist/types/Items/Audio/Audio.d.ts +0 -6
- package/dist/types/Items/Audio/audioOps.d.ts +5 -0
- package/dist/types/Items/BaseItem/BaseItem.d.ts +1 -1
- package/dist/types/Items/Comment/Comment.d.ts +1 -4
- package/dist/types/Items/Connector/Connector.d.ts +4 -19
- package/dist/types/Items/Connector/connectorOps.d.ts +20 -0
- package/dist/types/Items/Drawing/Drawing.d.ts +1 -9
- package/dist/types/Items/Drawing/DrawingOperation.d.ts +3 -3
- package/dist/types/Items/Drawing/drawingOps.d.ts +14 -0
- package/dist/types/Items/Drawing/index.d.ts +2 -0
- package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +1 -2
- package/dist/types/Items/Examples/CardGame/Card/CardOperation.d.ts +2 -1
- package/dist/types/Items/Examples/CardGame/Deck/Deck.d.ts +1 -2
- package/dist/types/Items/Examples/CardGame/Deck/DeckOperation.d.ts +2 -1
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +2 -1
- package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +1 -2
- package/dist/types/Items/Examples/Counter/CounterOperation.d.ts +2 -1
- package/dist/types/Items/Examples/Star/Star.d.ts +1 -2
- package/dist/types/Items/Frame/Frame.d.ts +1 -17
- package/dist/types/Items/Group/Group.d.ts +0 -4
- package/dist/types/Items/Image/Image.d.ts +1 -7
- package/dist/types/Items/Image/imageOps.d.ts +5 -0
- package/dist/types/Items/Placeholder/Placeholder.d.ts +0 -2
- package/dist/types/Items/Shape/Shape.d.ts +1 -12
- package/dist/types/Items/Shape/index.d.ts +1 -0
- package/dist/types/Items/Shape/shapeOps.d.ts +19 -0
- package/dist/types/Items/Sticker/Sticker.d.ts +3 -5
- package/dist/types/Items/Sticker/index.d.ts +1 -0
- package/dist/types/Items/Sticker/stickerOps.d.ts +9 -0
- package/dist/types/Items/Transformation/Transformation.d.ts +37 -59
- package/dist/types/Items/Transformation/TransformationCommand.d.ts +2 -1
- package/dist/types/Items/Transformation/TransformationOperations.d.ts +3 -12
- package/dist/types/Items/Transformation/transformOps.d.ts +35 -0
- package/dist/types/Items/Video/Video.d.ts +3 -15
- package/dist/types/Items/Video/videoOps.d.ts +9 -0
- package/dist/types/Items/index.d.ts +4 -0
- package/dist/types/Selection/Selection.d.ts +11 -4
- package/dist/types/Selection/Transformer/TransformerHelpers/transformAINode.d.ts +1 -1
- package/dist/types/Selection/Transformer/TransformerHelpers/transformRichText.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,13 +5,11 @@ import { AINodeData } from "./AINodeData";
|
|
|
5
5
|
import { DrawingContext } from "../DrawingContext";
|
|
6
6
|
import { GeometricNormal } from "../GeometricNormal";
|
|
7
7
|
import { Line } from "../Line/Line";
|
|
8
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
9
8
|
import { Mbr } from "../Mbr/Mbr";
|
|
10
9
|
import { Path } from "../Path/Path";
|
|
11
10
|
import { Paths } from "../Path/Paths";
|
|
12
11
|
import { Point } from "../Point/Point";
|
|
13
12
|
import { RichText } from "../RichText/RichText";
|
|
14
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
15
13
|
import { Subject } from "../../Subject";
|
|
16
14
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
17
15
|
export declare const CONTEXT_NODE_HIGHLIGHT_COLOR = "rgba(183, 138, 240, 1)";
|
|
@@ -20,9 +18,7 @@ export type ThreadDirection = typeof threadDirections[number];
|
|
|
20
18
|
export declare class AINode extends BaseItem<AINode> {
|
|
21
19
|
readonly itemType = "AINode";
|
|
22
20
|
parent: string;
|
|
23
|
-
readonly transformation: Transformation;
|
|
24
21
|
readonly text: RichText;
|
|
25
|
-
readonly linkTo: LinkTo;
|
|
26
22
|
private path;
|
|
27
23
|
readonly subject: Subject<AINode>;
|
|
28
24
|
private parentNodeId?;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Events, Operation } from "../../Events";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
3
|
import { DrawingContext } from "../DrawingContext";
|
|
4
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
5
4
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
6
5
|
import { Board } from "../../Board";
|
|
7
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
8
6
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
7
|
import { Path } from "../Path/Path";
|
|
10
8
|
import { Point } from "../Point/Point";
|
|
@@ -21,8 +19,6 @@ export declare class AudioItem extends BaseItem<AudioItem> {
|
|
|
21
19
|
private extension?;
|
|
22
20
|
readonly itemType = "Audio";
|
|
23
21
|
parent: string;
|
|
24
|
-
readonly transformation: Transformation;
|
|
25
|
-
readonly linkTo: LinkTo;
|
|
26
22
|
readonly subject: Subject<AudioItem>;
|
|
27
23
|
loadCallbacks: ((audio: AudioItem) => void)[];
|
|
28
24
|
beforeLoadCallbacks: ((audio: AudioItem) => void)[];
|
|
@@ -33,12 +29,10 @@ export declare class AudioItem extends BaseItem<AudioItem> {
|
|
|
33
29
|
constructor(board: Board, url?: string, events?: Events | undefined, id?: string, extension?: string | undefined);
|
|
34
30
|
setCurrentTime(time: number): void;
|
|
35
31
|
getCurrentTime(): number;
|
|
36
|
-
onTransform: () => void;
|
|
37
32
|
doOnceBeforeOnLoad: (callback: (audio: AudioItem) => void) => void;
|
|
38
33
|
doOnceOnLoad: (callback: (audio: AudioItem) => void) => void;
|
|
39
34
|
setIsPlaying(isPlaying: boolean): void;
|
|
40
35
|
getIsPlaying(): boolean;
|
|
41
|
-
setUrl(url: string): void;
|
|
42
36
|
getStorageId(): string | undefined;
|
|
43
37
|
getUrl(): string;
|
|
44
38
|
onLoad: () => Promise<void>;
|
|
@@ -83,7 +83,7 @@ export declare class BaseItem<T extends BaseItem<any> = any> extends Mbr impleme
|
|
|
83
83
|
getChildrenIds(): string[] | null;
|
|
84
84
|
addChildItems(children: BaseItem[]): void;
|
|
85
85
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
86
|
-
rotate(
|
|
86
|
+
rotate(degree: number): void;
|
|
87
87
|
emitNesting(children: BaseItem[]): void;
|
|
88
88
|
handleNesting(item: BaseItem | Mbr, options?: {
|
|
89
89
|
onlyForOut?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subject } from "../../Subject";
|
|
2
2
|
import { Events, Operation } from "../../Events";
|
|
3
3
|
import { Point } from "../Point";
|
|
4
|
-
import {
|
|
4
|
+
import { TransformationData } from "../Transformation";
|
|
5
5
|
import { CommentOperation } from "./CommentOperation";
|
|
6
6
|
import { Mbr } from "../Mbr";
|
|
7
7
|
import { GeometricNormal } from "../GeometricNormal";
|
|
@@ -9,7 +9,6 @@ import { RichText } from "../RichText";
|
|
|
9
9
|
import { DrawingContext } from "../DrawingContext";
|
|
10
10
|
import { SerializedItemData } from "../BaseItem";
|
|
11
11
|
import { Line } from "../Line";
|
|
12
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
13
12
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
14
13
|
import { BaseItem } from "../BaseItem/BaseItem";
|
|
15
14
|
import { Board } from "../../Board";
|
|
@@ -40,14 +39,12 @@ export declare class Comment extends BaseItem<Comment> {
|
|
|
40
39
|
private anchor;
|
|
41
40
|
private events?;
|
|
42
41
|
parent: string;
|
|
43
|
-
readonly transformation: Transformation;
|
|
44
42
|
private commentators;
|
|
45
43
|
private thread;
|
|
46
44
|
private usersUnreadMarks;
|
|
47
45
|
private resolved;
|
|
48
46
|
private itemToFollow?;
|
|
49
47
|
readonly subject: Subject<Comment>;
|
|
50
|
-
readonly linkTo: LinkTo;
|
|
51
48
|
transformationRenderBlock?: boolean;
|
|
52
49
|
resizeEnabled: boolean;
|
|
53
50
|
constructor(board: Board, anchor?: Point, events?: Events | undefined, id?: string);
|
|
@@ -11,15 +11,12 @@ import { Path } from '../Path/Path';
|
|
|
11
11
|
import { Paths } from '../Path/Paths';
|
|
12
12
|
import type { BorderStyle } from '../Path/Path';
|
|
13
13
|
import { Point } from '../Point/Point';
|
|
14
|
-
import { Transformation } from '../Transformation/Transformation';
|
|
15
14
|
import { ConnectorData, ConnectorOperation } from './ConnectorOperations';
|
|
16
15
|
import { BoardPoint, ControlPoint, ControlPointData, FindItemFn } from './ControlPoint';
|
|
17
16
|
import { ConnectorPointerStyle, Pointer } from './Pointers/Pointers';
|
|
18
|
-
import { LinkTo } from '../LinkTo/LinkTo';
|
|
19
17
|
import { DocumentFactory } from '../../api/DocumentFactory';
|
|
20
18
|
import { ConnectorAnchorColors } from './types';
|
|
21
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
22
|
-
import type { SerializedItemData } from "../BaseItem/BaseItem";
|
|
19
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
23
20
|
import { ColorValue } from '../../..';
|
|
24
21
|
import { ConnectionLineWidth, ConnectorLineStyle } from './ConnectorTypes';
|
|
25
22
|
export declare const CONNECTOR_ANCHOR_COLOR: ConnectorAnchorColors;
|
|
@@ -32,11 +29,9 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
32
29
|
private endPointerStyle;
|
|
33
30
|
readonly itemType = "Connector";
|
|
34
31
|
parent: string;
|
|
35
|
-
readonly transformation: Transformation;
|
|
36
32
|
private middlePoint;
|
|
37
33
|
private lineColor;
|
|
38
34
|
private smartJump;
|
|
39
|
-
readonly linkTo: LinkTo;
|
|
40
35
|
private lineWidth;
|
|
41
36
|
borderStyle: BorderStyle;
|
|
42
37
|
readonly subject: Subject<Connector>;
|
|
@@ -60,7 +55,6 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
60
55
|
private smartJumpStartEdge;
|
|
61
56
|
/** Mirror of smartJumpStartEdge for the end point. */
|
|
62
57
|
private smartJumpEndEdge;
|
|
63
|
-
setSmartJump(value: boolean): void;
|
|
64
58
|
private applySmartJump;
|
|
65
59
|
getSmartJump(): boolean;
|
|
66
60
|
clearObservedItems(): void;
|
|
@@ -71,25 +65,16 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
71
65
|
getId(): string;
|
|
72
66
|
apply(operation: Operation): void;
|
|
73
67
|
complete(id: string): void;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
applyEndPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
78
|
-
applyMiddlePoint(pointData: ControlPointData | null, updatePath?: boolean): void;
|
|
68
|
+
protected applyStartPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
69
|
+
protected applyEndPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
70
|
+
protected applyMiddlePoint(pointData: ControlPointData | null, updatePath?: boolean): void;
|
|
79
71
|
private applySwitchPointers;
|
|
80
72
|
addMiddlePoint(point: BoardPoint): void;
|
|
81
|
-
setMiddlePoint(point: ControlPoint | ControlPointData, timestamp?: number): void;
|
|
82
|
-
setStartPointerStyle(style: ConnectorPointerStyle): void;
|
|
83
73
|
private applyStartPointerStyle;
|
|
84
|
-
setEndPointerStyle(style: ConnectorPointerStyle): void;
|
|
85
74
|
private applyEndPointerStyle;
|
|
86
|
-
setLineColor(color: ColorValue): void;
|
|
87
75
|
private applyLineColor;
|
|
88
|
-
setLineStyle(style: ConnectorLineStyle): void;
|
|
89
76
|
private applyLineStyle;
|
|
90
|
-
private setBorderStyle;
|
|
91
77
|
private applyBorderStyle;
|
|
92
|
-
setLineWidth(width: ConnectionLineWidth): void;
|
|
93
78
|
private applyLineWidth;
|
|
94
79
|
getStartPoint(): ControlPoint;
|
|
95
80
|
getEndPoint(): ControlPoint;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColorValue } from "../../..";
|
|
2
|
+
import { BorderStyle } from "../Path";
|
|
3
|
+
import { Connector } from "./Connector";
|
|
4
|
+
import { ControlPoint, ControlPointData } from "./ControlPoint";
|
|
5
|
+
import { ConnectorOperation } from "./ConnectorOperations";
|
|
6
|
+
import { ConnectionLineWidth, ConnectorLineStyle } from "./ConnectorTypes";
|
|
7
|
+
import { ConnectorPointerStyle } from "./Pointers/Pointers";
|
|
8
|
+
export declare const connectorOps: {
|
|
9
|
+
setStartPoint: (items: Connector[], point: ControlPoint | ControlPointData, timestamp?: number) => ConnectorOperation;
|
|
10
|
+
setEndPoint: (items: Connector[], point: ControlPoint | ControlPointData, timestamp?: number) => ConnectorOperation;
|
|
11
|
+
setMiddlePoint: (items: Connector[], point: ControlPoint | ControlPointData | null, timestamp?: number) => ConnectorOperation;
|
|
12
|
+
setStartPointerStyle: (items: Connector[], style: ConnectorPointerStyle) => ConnectorOperation;
|
|
13
|
+
setEndPointerStyle: (items: Connector[], style: ConnectorPointerStyle) => ConnectorOperation;
|
|
14
|
+
setLineStyle: (items: Connector[], style: ConnectorLineStyle) => ConnectorOperation;
|
|
15
|
+
setBorderStyle: (items: Connector[], borderStyle: BorderStyle) => ConnectorOperation;
|
|
16
|
+
setLineColor: (items: Connector[], color: ColorValue) => ConnectorOperation;
|
|
17
|
+
setLineWidth: (items: Connector[], width: ConnectionLineWidth) => ConnectorOperation;
|
|
18
|
+
switchPointers: (items: Connector[]) => ConnectorOperation;
|
|
19
|
+
setSmartJump: (items: Connector[], smartJump: boolean) => ConnectorOperation;
|
|
20
|
+
};
|
|
@@ -6,10 +6,8 @@ import { Mbr } from "../Mbr/Mbr";
|
|
|
6
6
|
import { Path } from "../Path/Path";
|
|
7
7
|
import type { BorderStyle, BorderWidth } from "../Path/Path";
|
|
8
8
|
import { Point } from "../Point/Point";
|
|
9
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
10
9
|
import { DrawingOperation } from "./DrawingOperation";
|
|
11
10
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
12
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
13
11
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
14
12
|
import { Board } from "../../Board";
|
|
15
13
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
@@ -32,12 +30,10 @@ export declare class Drawing extends BaseItem<Drawing> {
|
|
|
32
30
|
private events?;
|
|
33
31
|
readonly itemType = "Drawing";
|
|
34
32
|
parent: string;
|
|
35
|
-
readonly transformation: Transformation;
|
|
36
33
|
private path2d;
|
|
37
34
|
readonly subject: Subject<Drawing>;
|
|
38
35
|
untransformedMbr: Mbr;
|
|
39
36
|
private lines;
|
|
40
|
-
readonly linkTo: LinkTo;
|
|
41
37
|
strokeWidth: BorderWidth;
|
|
42
38
|
borderColor: ColorValue;
|
|
43
39
|
borderStyle: BorderStyle;
|
|
@@ -66,17 +62,13 @@ export declare class Drawing extends BaseItem<Drawing> {
|
|
|
66
62
|
isEnclosedOrCrossedBy(rect: Mbr): boolean;
|
|
67
63
|
emit(operation: DrawingOperation): void;
|
|
68
64
|
apply(op: Operation): void;
|
|
69
|
-
setStrokeOpacity(opacity: number): this;
|
|
70
65
|
getStrokeOpacity(): number;
|
|
71
|
-
setBorderStyle(style: BorderStyle): this;
|
|
72
66
|
getBorderStyle(): BorderStyle;
|
|
73
|
-
setStrokeColor(color: ColorValue): this;
|
|
74
67
|
getStrokeColor(): ColorValue;
|
|
75
68
|
setColorRole(role: ColorRole): this;
|
|
76
69
|
getColorRole(): ColorRole;
|
|
77
|
-
setStrokeWidth(width: number): this;
|
|
78
70
|
getLinkTo(): string | undefined;
|
|
79
|
-
getStrokeWidth():
|
|
71
|
+
getStrokeWidth(): BorderWidth;
|
|
80
72
|
getRichText(): null;
|
|
81
73
|
isPointNearLine(point: Point, threshold?: number | undefined): boolean;
|
|
82
74
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BorderStyle } from "../Path";
|
|
1
|
+
import { BorderStyle, BorderWidth } from "../Path";
|
|
2
2
|
import { ColorValue } from "../../..";
|
|
3
3
|
interface DrawingSetStrokeColorOp {
|
|
4
4
|
class: "Drawing";
|
|
@@ -10,8 +10,8 @@ interface DrawingSetStrokeWidthOp {
|
|
|
10
10
|
class: "Drawing";
|
|
11
11
|
method: "setStrokeWidth";
|
|
12
12
|
item: string[];
|
|
13
|
-
width:
|
|
14
|
-
prevWidth:
|
|
13
|
+
width: BorderWidth;
|
|
14
|
+
prevWidth: BorderWidth;
|
|
15
15
|
}
|
|
16
16
|
interface DrawingSetStrokeOpacityOp {
|
|
17
17
|
class: "Drawing";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ColorValue } from "../../..";
|
|
2
|
+
import { Operation } from "../../Events";
|
|
3
|
+
import { BorderStyle, BorderWidth } from "../Path";
|
|
4
|
+
interface ItemLike {
|
|
5
|
+
getId(): string;
|
|
6
|
+
getStrokeWidth(): BorderWidth;
|
|
7
|
+
}
|
|
8
|
+
export declare const drawingOps: {
|
|
9
|
+
setStrokeColor(items: ItemLike[], color: ColorValue): Operation;
|
|
10
|
+
setStrokeWidth(items: ItemLike[], width: BorderWidth): Operation;
|
|
11
|
+
setBorderStyle(items: ItemLike[], style: BorderStyle): Operation;
|
|
12
|
+
setStrokeOpacity(items: ItemLike[], opacity: number): Operation;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -5,7 +5,6 @@ import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
|
5
5
|
import { Path } from "../../../Path/Path";
|
|
6
6
|
import { Subject } from "../../../../Subject";
|
|
7
7
|
import { Paths } from "../../../Path/Paths";
|
|
8
|
-
import { CardOperation } from "../../../Examples/CardGame/Card/CardOperation";
|
|
9
8
|
export interface CardData extends BaseItemData {
|
|
10
9
|
isOpen?: boolean;
|
|
11
10
|
faceUrl?: string;
|
|
@@ -46,5 +45,5 @@ export declare class Card extends BaseItem<Card> {
|
|
|
46
45
|
getPath(): Path | Paths;
|
|
47
46
|
deserialize(data: SerializedItemData): this;
|
|
48
47
|
toggleIsOpen(cards: Card[]): void;
|
|
49
|
-
apply(op:
|
|
48
|
+
apply(op: any): void;
|
|
50
49
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseOperation } from "../../../../Events/EventsOperations";
|
|
2
|
-
|
|
2
|
+
import { TransformationOperation } from "../../../Transformation/TransformationOperations";
|
|
3
|
+
export type CardOperation = SetIsOpen | SetIsInDeck | TransformationOperation;
|
|
3
4
|
export interface SetIsOpen extends BaseOperation<{
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
}> {
|
|
@@ -3,7 +3,6 @@ import { Board } from "../../../../Board";
|
|
|
3
3
|
import { Subject } from "../../../../Subject";
|
|
4
4
|
import { Card } from "../../../Examples/CardGame/Card/Card";
|
|
5
5
|
import { DrawingContext } from "../../../DrawingContext";
|
|
6
|
-
import { DeckOperation } from "../../../Examples/CardGame/Deck/DeckOperation";
|
|
7
6
|
import { Path } from "../../../Path";
|
|
8
7
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
9
8
|
export declare const defaultDeckData: BaseItemData;
|
|
@@ -28,7 +27,7 @@ export declare class Deck extends BaseItem<Deck> {
|
|
|
28
27
|
getRandomCard(): Card | undefined;
|
|
29
28
|
shuffleDeck(): void;
|
|
30
29
|
flipDeck(): void;
|
|
31
|
-
apply(op:
|
|
30
|
+
apply(op: any): void;
|
|
32
31
|
updateMbr(): void;
|
|
33
32
|
deserialize(data: SerializedItemData): this;
|
|
34
33
|
render(context: DrawingContext): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseOperation } from "../../../../Events/EventsOperations";
|
|
2
|
-
|
|
2
|
+
import { TransformationOperation } from "../../../Transformation/TransformationOperations";
|
|
3
|
+
export type DeckOperation = StartAnimation | TransformationOperation;
|
|
3
4
|
export interface StartAnimation extends BaseOperation<{
|
|
4
5
|
timeStamp?: number;
|
|
5
6
|
}> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/BaseItem";
|
|
2
|
+
import { Operation } from "../../../../Events";
|
|
2
3
|
import { BorderWidth, Path, BorderStyle } from "../../../../Items";
|
|
3
4
|
import { Subject } from "../../../../Subject";
|
|
4
5
|
import { Board } from "../../../../Board";
|
|
@@ -52,7 +53,7 @@ export declare class Dice extends BaseItem<Dice> {
|
|
|
52
53
|
setValues(values: number[]): void;
|
|
53
54
|
setValueIndex(valueIndex: number): void;
|
|
54
55
|
throwDice(): void;
|
|
55
|
-
apply(op: DiceOperation): void;
|
|
56
|
+
apply(op: Operation | DiceOperation): void;
|
|
56
57
|
startRotation(): void;
|
|
57
58
|
stopRotation(): void;
|
|
58
59
|
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -3,7 +3,6 @@ import { Board } from "../../../../Board";
|
|
|
3
3
|
import { Subject } from "../../../../Subject";
|
|
4
4
|
import { DrawingContext } from "../../../DrawingContext";
|
|
5
5
|
import { BorderWidth, BorderStyle } from "../../../Path";
|
|
6
|
-
import { ScreenOperation } from "./ScreenOperation";
|
|
7
6
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
8
7
|
export interface ScreenData extends BaseItemData {
|
|
9
8
|
ownerId?: string;
|
|
@@ -21,7 +20,7 @@ export declare class Screen extends BaseItem<Screen> {
|
|
|
21
20
|
backgroundImage: HTMLImageElement | null;
|
|
22
21
|
ownerId: string;
|
|
23
22
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
24
|
-
apply(op:
|
|
23
|
+
apply(op: any): void;
|
|
25
24
|
getOwnerId(): string;
|
|
26
25
|
getBackgroundColor(): string;
|
|
27
26
|
getBorderStyle(): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseOperation } from "../../../Events/EventsOperations";
|
|
2
|
-
|
|
2
|
+
import { TransformationOperation } from "../../Transformation/TransformationOperations";
|
|
3
|
+
export type CounterOperation = UpdateCounter | TransformationOperation;
|
|
3
4
|
export interface UpdateCounter extends BaseOperation<{
|
|
4
5
|
count: number;
|
|
5
6
|
}> {
|
|
@@ -6,7 +6,6 @@ import { BorderStyle, BorderWidth, Path } from "../../Path/Path";
|
|
|
6
6
|
import { Subject } from "../../../Subject";
|
|
7
7
|
import { TransformationData } from "../../Transformation/TransformationData";
|
|
8
8
|
import { Paths } from "../../Path/Paths";
|
|
9
|
-
import { StarOperation } from "../../Examples/Star/StarOperation";
|
|
10
9
|
export interface StarData {
|
|
11
10
|
readonly itemType: "Star";
|
|
12
11
|
backgroundColor: string;
|
|
@@ -34,5 +33,5 @@ export declare class Star extends BaseItem<Star> {
|
|
|
34
33
|
deserialize(data: SerializedItemData): this;
|
|
35
34
|
isClosed(): boolean;
|
|
36
35
|
toggleIsShining(): void;
|
|
37
|
-
apply(op:
|
|
36
|
+
apply(op: any): void;
|
|
38
37
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Mbr } from "../Mbr/Mbr";
|
|
2
2
|
import { Line } from "../Line/Line";
|
|
3
3
|
import { Point } from "../Point/Point";
|
|
4
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
5
4
|
import { Path } from "../Path/Path";
|
|
6
5
|
import { Paths } from "../Path/Paths";
|
|
7
6
|
import type { Item } from "../Item";
|
|
8
7
|
import { RichText } from "../RichText/RichText";
|
|
9
8
|
import { Matrix } from "../Transformation/Matrix";
|
|
10
|
-
import
|
|
11
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
9
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
12
10
|
import { Subject } from "../../Subject";
|
|
13
11
|
import { DrawingContext } from "../DrawingContext";
|
|
14
12
|
import { Operation } from "../../Events";
|
|
@@ -17,7 +15,6 @@ import { FrameType } from "./Basic";
|
|
|
17
15
|
import { GeometricNormal } from "../GeometricNormal";
|
|
18
16
|
import { Board } from "../../Board";
|
|
19
17
|
import { SnapshotInfo } from "../../Tools/ExportSnapshot/exportBoardSnapshot";
|
|
20
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
21
18
|
import { FrameData } from "./FrameData";
|
|
22
19
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
23
20
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
@@ -34,12 +31,10 @@ export declare class Frame extends BaseItem<Frame> {
|
|
|
34
31
|
borderWidth: number;
|
|
35
32
|
readonly itemType = "Frame";
|
|
36
33
|
parent: string;
|
|
37
|
-
readonly transformation: Transformation;
|
|
38
34
|
readonly subject: Subject<Frame>;
|
|
39
35
|
private textContainer;
|
|
40
36
|
private path;
|
|
41
37
|
private mbr;
|
|
42
|
-
readonly linkTo: LinkTo;
|
|
43
38
|
readonly text: RichText;
|
|
44
39
|
private canChangeRatio;
|
|
45
40
|
canBeNested: boolean;
|
|
@@ -47,20 +42,9 @@ export declare class Frame extends BaseItem<Frame> {
|
|
|
47
42
|
transformationRenderBlock?: boolean;
|
|
48
43
|
constructor(board: Board, getItemById: (id: string) => Item | undefined, id?: string, name?: string, shapeType?: "Custom" | "A4" | "Letter" | "Frame16x9" | "Frame4x3" | "Frame1x1" | "Frame3x2" | "Frame9x18", backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash", borderWidth?: number);
|
|
49
44
|
setBoard(board: Board): this;
|
|
50
|
-
/** Sets parent of child and emits add child message */
|
|
51
|
-
/**
|
|
52
|
-
* Parent cant be child,
|
|
53
|
-
* Child cant be itself,
|
|
54
|
-
* frame cant be child
|
|
55
|
-
*/
|
|
56
45
|
addChildItems(children: BaseItem[]): void;
|
|
57
46
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
58
47
|
getLinkTo(): string | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Returns:
|
|
61
|
-
* true - if can be child of the frame
|
|
62
|
-
* false - if outside of the frame
|
|
63
|
-
*/
|
|
64
48
|
private initPath;
|
|
65
49
|
private updateTextContainer;
|
|
66
50
|
getPaths(): Path | Paths;
|
|
@@ -6,10 +6,8 @@ import { Events, Operation } from "../../Events";
|
|
|
6
6
|
import { Mbr } from "../Mbr/Mbr";
|
|
7
7
|
import { Line } from "../Line/Line";
|
|
8
8
|
import { Point } from "../Point/Point";
|
|
9
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
10
9
|
import type { Item } from "../Item";
|
|
11
10
|
import { Board } from "../../Board";
|
|
12
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
13
11
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
14
12
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
15
13
|
export interface GroupData {
|
|
@@ -21,10 +19,8 @@ export interface GroupData {
|
|
|
21
19
|
}
|
|
22
20
|
export declare class Group extends BaseItem<Group> {
|
|
23
21
|
private events?;
|
|
24
|
-
readonly linkTo: LinkTo;
|
|
25
22
|
readonly itemType = "Group";
|
|
26
23
|
parent: string;
|
|
27
|
-
readonly transformation: Transformation;
|
|
28
24
|
readonly subject: Subject<Group>;
|
|
29
25
|
transformationRenderBlock?: boolean;
|
|
30
26
|
isLockedGroup: boolean;
|
|
@@ -4,10 +4,8 @@ import { DrawingContext } from "../DrawingContext";
|
|
|
4
4
|
import { Path } from "../Path/Path";
|
|
5
5
|
import { Paths } from "../Path/Paths";
|
|
6
6
|
import { Point } from "../Point/Point";
|
|
7
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
8
7
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
9
8
|
import { Board } from "../../Board";
|
|
10
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
11
9
|
import { ImageOperation } from "./ImageOperation";
|
|
12
10
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
13
11
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
@@ -34,8 +32,6 @@ export declare class ImageItem extends BaseItem<ImageItem> {
|
|
|
34
32
|
readonly itemType = "Image";
|
|
35
33
|
parent: string;
|
|
36
34
|
image: HTMLImageElement;
|
|
37
|
-
readonly transformation: Transformation;
|
|
38
|
-
readonly linkTo: LinkTo;
|
|
39
35
|
readonly subject: Subject<ImageItem>;
|
|
40
36
|
loadCallbacks: ((image: ImageItem) => void)[];
|
|
41
37
|
beforeLoadCallbacks: ((image: ImageItem) => void)[];
|
|
@@ -46,12 +42,11 @@ export declare class ImageItem extends BaseItem<ImageItem> {
|
|
|
46
42
|
board: Board;
|
|
47
43
|
constructor({ base64, storageLink, imageDimension }: ImageConstructorData, board: Board, events?: Events | undefined, id?: string);
|
|
48
44
|
private setImage;
|
|
49
|
-
setStorageLink
|
|
45
|
+
private setStorageLink;
|
|
50
46
|
getStorageId(): string | undefined;
|
|
51
47
|
handleError: () => void;
|
|
52
48
|
onLoad: () => Promise<void>;
|
|
53
49
|
onError: () => void;
|
|
54
|
-
onTransform: () => void;
|
|
55
50
|
updateMbr(): void;
|
|
56
51
|
doOnceBeforeOnLoad: (callback: (image: ImageItem) => void) => void;
|
|
57
52
|
doOnceOnLoad: (callback: (image: ImageItem) => void) => void;
|
|
@@ -63,7 +58,6 @@ export declare class ImageItem extends BaseItem<ImageItem> {
|
|
|
63
58
|
private shootLoadCallbacks;
|
|
64
59
|
deserialize(data: SerializedItemData<ImageItemData> | ImageItemData): this;
|
|
65
60
|
emit(operation: ImageOperation): void;
|
|
66
|
-
setDimensions(dim: Dimension): void;
|
|
67
61
|
apply(op: Operation): void;
|
|
68
62
|
render(context: DrawingContext): void;
|
|
69
63
|
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -9,7 +9,6 @@ import { Mbr } from "../Mbr/Mbr";
|
|
|
9
9
|
import { Path } from "../Path/Path";
|
|
10
10
|
import { Paths } from "../Path/Paths";
|
|
11
11
|
import { Point } from "../Point/Point";
|
|
12
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
13
12
|
import { Matrix } from "../Transformation/Matrix";
|
|
14
13
|
import type { TransformationData } from "../Transformation/TransformationData";
|
|
15
14
|
import { PlaceholderOperation } from "./PlaceholderOperation";
|
|
@@ -33,7 +32,6 @@ export declare class Placeholder extends BaseItem<Placeholder> {
|
|
|
33
32
|
readonly itemType = "Placeholder";
|
|
34
33
|
shapeType: ShapeType;
|
|
35
34
|
parent: string;
|
|
36
|
-
readonly transformation: Transformation;
|
|
37
35
|
private path;
|
|
38
36
|
private mbr;
|
|
39
37
|
readonly subject: Subject<Placeholder>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Mbr } from "../Mbr/Mbr";
|
|
2
2
|
import { Line } from "../Line/Line";
|
|
3
3
|
import { Point } from "../Point/Point";
|
|
4
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
5
4
|
import { Path } from "../Path/Path";
|
|
6
5
|
import { Paths } from "../Path/Paths";
|
|
7
6
|
import { Matrix } from "../Transformation/Matrix";
|
|
@@ -14,7 +13,6 @@ import { DrawingContext } from "../DrawingContext";
|
|
|
14
13
|
import { Operation } from "../../Events";
|
|
15
14
|
import { GeometricNormal } from "../GeometricNormal";
|
|
16
15
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
17
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
18
16
|
import { Board } from "../../Board";
|
|
19
17
|
import { Subject } from "../../Subject";
|
|
20
18
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
@@ -361,11 +359,9 @@ export declare class Shape extends BaseItem<Shape> {
|
|
|
361
359
|
private mbr;
|
|
362
360
|
readonly itemType = "Shape";
|
|
363
361
|
parent: string;
|
|
364
|
-
readonly transformation: Transformation;
|
|
365
362
|
private path;
|
|
366
363
|
private textContainer;
|
|
367
364
|
readonly text: RichText;
|
|
368
|
-
readonly linkTo: LinkTo;
|
|
369
365
|
readonly subject: Subject<Shape>;
|
|
370
366
|
transformationRenderBlock?: boolean;
|
|
371
367
|
constructor(board: Board, id?: string, shapeType?: ShapeType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash", borderWidth?: number, mbr?: Mbr);
|
|
@@ -381,27 +377,20 @@ export declare class Shape extends BaseItem<Shape> {
|
|
|
381
377
|
getShapeType(): ShapeType;
|
|
382
378
|
getLinkTo(): string | undefined;
|
|
383
379
|
private applyShapeType;
|
|
384
|
-
setShapeType(shapeType: ShapeType): void;
|
|
385
380
|
getBackgroundColor(): ColorValue;
|
|
386
381
|
private applyBackgroundColor;
|
|
387
|
-
setBackgroundColor(backgroundColor: ColorValue): void;
|
|
388
382
|
getBackgroundOpacity(): number;
|
|
389
383
|
getBorderColor(): ColorValue;
|
|
390
384
|
getBorderWidth(): number;
|
|
391
385
|
private applyBackgroundOpacity;
|
|
392
|
-
setBackgroundOpacity(backgroundOpacity: number): void;
|
|
393
386
|
getStrokeColor(): ColorValue;
|
|
394
387
|
private applyBorderColor;
|
|
395
|
-
setBorderColor(borderColor: ColorValue): void;
|
|
396
388
|
getBorderOpacity(): number;
|
|
397
389
|
private applyBorderOpacity;
|
|
398
|
-
setBorderOpacity(borderOpacity: number): void;
|
|
399
390
|
getBorderStyle(): BorderStyle;
|
|
400
391
|
private applyBorderStyle;
|
|
401
|
-
setBorderStyle(borderStyle: BorderStyle): void;
|
|
402
392
|
getStrokeWidth(): BorderWidth;
|
|
403
393
|
private applyBorderWidth;
|
|
404
|
-
setBorderWidth(borderWidth: BorderWidth): void;
|
|
405
394
|
getIntersectionPoints(segment: Line): Point[];
|
|
406
395
|
updateMbr(): Mbr;
|
|
407
396
|
getMbr(): Mbr;
|
|
@@ -423,7 +412,7 @@ export declare class Shape extends BaseItem<Shape> {
|
|
|
423
412
|
private transformPath;
|
|
424
413
|
getPath(): Path | Paths;
|
|
425
414
|
getSnapAnchorPoints(): Point[];
|
|
426
|
-
doResize(resizeType: ResizeType, pointer: Point, mbr: Mbr, opposite: Point,
|
|
415
|
+
doResize(resizeType: ResizeType, pointer: Point, mbr: Mbr, opposite: Point, _startMbr: Mbr, timeStamp: number): {
|
|
427
416
|
matrix: Matrix;
|
|
428
417
|
mbr: Mbr;
|
|
429
418
|
};
|
|
@@ -2,5 +2,6 @@ export { Shape, Shapes } from "./Shape";
|
|
|
2
2
|
export { ShapeCommand } from "./ShapeCommand";
|
|
3
3
|
export type { ShapeOperation } from "./ShapeOperation";
|
|
4
4
|
export * from "./ShapeData";
|
|
5
|
+
export { shapeOps } from "./shapeOps";
|
|
5
6
|
export type { ShapeType } from "./ShapeType";
|
|
6
7
|
export { DefaultShapeData } from "./ShapeData";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ColorValue } from "../../Color";
|
|
2
|
+
import { BorderStyle } from "../Path";
|
|
3
|
+
import { ShapeOperation } from "./ShapeOperation";
|
|
4
|
+
import { ShapeType } from "./ShapeType";
|
|
5
|
+
type ItemLike = {
|
|
6
|
+
getId(): string;
|
|
7
|
+
getBorderWidth?(): number;
|
|
8
|
+
};
|
|
9
|
+
type ItemOrId = ItemLike | string;
|
|
10
|
+
export declare const shapeOps: {
|
|
11
|
+
setBackgroundColor(items: readonly ItemOrId[], backgroundColor: ColorValue): ShapeOperation;
|
|
12
|
+
setBackgroundOpacity(items: readonly ItemOrId[], backgroundOpacity: number): ShapeOperation;
|
|
13
|
+
setBorderColor(items: readonly ItemOrId[], borderColor: ColorValue): ShapeOperation;
|
|
14
|
+
setBorderOpacity(items: readonly ItemOrId[], borderOpacity: number): ShapeOperation;
|
|
15
|
+
setBorderStyle(items: readonly ItemOrId[], borderStyle: BorderStyle): ShapeOperation;
|
|
16
|
+
setBorderWidth(items: readonly ItemLike[], borderWidth: number): ShapeOperation;
|
|
17
|
+
setShapeType(items: readonly ItemOrId[], shapeType: ShapeType): ShapeOperation;
|
|
18
|
+
};
|
|
19
|
+
export {};
|