microboard-temp 0.13.92 → 0.13.94
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 +55356 -55286
- package/dist/cjs/index.js +55356 -55286
- package/dist/cjs/node.js +57671 -57601
- package/dist/esm/browser.js +55115 -55046
- package/dist/esm/index.js +55115 -55046
- package/dist/esm/node.js +57596 -57527
- package/dist/types/HTMLRender/HTMLRender.d.ts +5 -0
- package/dist/types/Items/AINode/AINode.d.ts +0 -6
- package/dist/types/Items/Audio/Audio.d.ts +0 -8
- package/dist/types/Items/Audio/audioOps.d.ts +5 -0
- package/dist/types/Items/BaseItem/BaseItem.d.ts +1 -3
- package/dist/types/Items/Comment/Comment.d.ts +1 -6
- package/dist/types/Items/Connector/Connector.d.ts +4 -22
- package/dist/types/Items/Connector/connectorOps.d.ts +20 -0
- package/dist/types/Items/Drawing/Drawing.d.ts +1 -11
- 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 -4
- package/dist/types/Items/Examples/CardGame/Card/CardOperation.d.ts +2 -1
- package/dist/types/Items/Examples/CardGame/Deck/Deck.d.ts +1 -4
- package/dist/types/Items/Examples/CardGame/Deck/DeckOperation.d.ts +2 -1
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +2 -3
- package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +1 -4
- package/dist/types/Items/Examples/Counter/Counter.d.ts +0 -2
- package/dist/types/Items/Examples/Counter/CounterOperation.d.ts +2 -1
- package/dist/types/Items/Examples/Star/Star.d.ts +1 -4
- package/dist/types/Items/Frame/Frame.d.ts +1 -19
- package/dist/types/Items/Group/Group.d.ts +0 -6
- package/dist/types/Items/Image/Image.d.ts +1 -9
- package/dist/types/Items/Image/imageOps.d.ts +5 -0
- package/dist/types/Items/LinkTo/LinkTo.d.ts +0 -2
- package/dist/types/Items/Path/Path.d.ts +0 -2
- package/dist/types/Items/Path/Paths.d.ts +0 -2
- package/dist/types/Items/Placeholder/Placeholder.d.ts +0 -4
- package/dist/types/Items/Renderers/AINodeHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/AudioHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/CommentHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/ConnectorHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/DrawingHTMLRenderer.d.ts +7 -0
- package/dist/types/Items/Renderers/FrameHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/GroupHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/HTMLItemRenderer.d.ts +7 -0
- package/dist/types/Items/Renderers/ImageHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/PlaceholderHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/RichTextHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/ShapeHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/StickerHTMLRenderer.d.ts +6 -0
- package/dist/types/Items/Renderers/VideoHTMLRenderer.d.ts +7 -0
- package/dist/types/Items/Renderers/index.d.ts +13 -0
- package/dist/types/Items/RichText/RichText.d.ts +0 -2
- package/dist/types/Items/Shape/Shape.d.ts +1 -14
- package/dist/types/Items/Shape/Shapes.d.ts +330 -0
- 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 -7
- 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 -17
- 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
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { DocumentFactory } from "../api/DocumentFactory";
|
|
2
|
+
import { Path, Paths } from "../Items/Path";
|
|
3
|
+
import { LinkTo } from "../Items/LinkTo/LinkTo";
|
|
1
4
|
export declare function getTranslationFromHTML(el: HTMLElement): [number, number];
|
|
2
5
|
export declare function getScaleFromHTML(el: HTMLElement): [number, number];
|
|
3
6
|
export declare function translateElementBy(el: HTMLElement, x: number, y: number): HTMLElement;
|
|
@@ -5,3 +8,5 @@ export declare function scaleElementBy(el: HTMLElement, scaleX: number, scaleY:
|
|
|
5
8
|
export declare function resetElementScale(el: HTMLElement): HTMLElement;
|
|
6
9
|
export declare function positionRelatively(toPosition: HTMLElement, positionBy: HTMLElement, padding?: number): HTMLElement;
|
|
7
10
|
export declare function positionAbsolutely(toPosition: HTMLElement, positionBy: HTMLElement): HTMLElement;
|
|
11
|
+
export declare function renderPathToHTML(path: Path | Paths, documentFactory: DocumentFactory): SVGPathElement | SVGPathElement[];
|
|
12
|
+
export declare function renderLinkToHTML(linkTo: LinkTo, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
3
2
|
import { Operation } from "../../Events/EventsOperations";
|
|
4
3
|
import { AINodeData } from "./AINodeData";
|
|
5
4
|
import { DrawingContext } from "../DrawingContext";
|
|
6
5
|
import { GeometricNormal } from "../GeometricNormal";
|
|
7
6
|
import { Line } from "../Line/Line";
|
|
8
|
-
import { LinkTo } from "../LinkTo/LinkTo";
|
|
9
7
|
import { Mbr } from "../Mbr/Mbr";
|
|
10
8
|
import { Path } from "../Path/Path";
|
|
11
9
|
import { Paths } from "../Path/Paths";
|
|
12
10
|
import { Point } from "../Point/Point";
|
|
13
11
|
import { RichText } from "../RichText/RichText";
|
|
14
|
-
import { Transformation } from "../Transformation/Transformation";
|
|
15
12
|
import { Subject } from "../../Subject";
|
|
16
13
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
17
14
|
export declare const CONTEXT_NODE_HIGHLIGHT_COLOR = "rgba(183, 138, 240, 1)";
|
|
@@ -20,9 +17,7 @@ export type ThreadDirection = typeof threadDirections[number];
|
|
|
20
17
|
export declare class AINode extends BaseItem<AINode> {
|
|
21
18
|
readonly itemType = "AINode";
|
|
22
19
|
parent: string;
|
|
23
|
-
readonly transformation: Transformation;
|
|
24
20
|
readonly text: RichText;
|
|
25
|
-
readonly linkTo: LinkTo;
|
|
26
21
|
private path;
|
|
27
22
|
readonly subject: Subject<AINode>;
|
|
28
23
|
private parentNodeId?;
|
|
@@ -65,6 +60,5 @@ export declare class AINode extends BaseItem<AINode> {
|
|
|
65
60
|
getLinkTo(): string | undefined;
|
|
66
61
|
renderButton(context: DrawingContext): void;
|
|
67
62
|
render(context: DrawingContext): void;
|
|
68
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
69
63
|
getPrevMbr(): Mbr | null;
|
|
70
64
|
}
|
|
@@ -1,11 +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
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
6
|
import { Path } from "../Path/Path";
|
|
10
7
|
import { Point } from "../Point/Point";
|
|
11
8
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
@@ -21,8 +18,6 @@ export declare class AudioItem extends BaseItem<AudioItem> {
|
|
|
21
18
|
private extension?;
|
|
22
19
|
readonly itemType = "Audio";
|
|
23
20
|
parent: string;
|
|
24
|
-
readonly transformation: Transformation;
|
|
25
|
-
readonly linkTo: LinkTo;
|
|
26
21
|
readonly subject: Subject<AudioItem>;
|
|
27
22
|
loadCallbacks: ((audio: AudioItem) => void)[];
|
|
28
23
|
beforeLoadCallbacks: ((audio: AudioItem) => void)[];
|
|
@@ -33,19 +28,16 @@ export declare class AudioItem extends BaseItem<AudioItem> {
|
|
|
33
28
|
constructor(board: Board, url?: string, events?: Events | undefined, id?: string, extension?: string | undefined);
|
|
34
29
|
setCurrentTime(time: number): void;
|
|
35
30
|
getCurrentTime(): number;
|
|
36
|
-
onTransform: () => void;
|
|
37
31
|
doOnceBeforeOnLoad: (callback: (audio: AudioItem) => void) => void;
|
|
38
32
|
doOnceOnLoad: (callback: (audio: AudioItem) => void) => void;
|
|
39
33
|
setIsPlaying(isPlaying: boolean): void;
|
|
40
34
|
getIsPlaying(): boolean;
|
|
41
|
-
setUrl(url: string): void;
|
|
42
35
|
getStorageId(): string | undefined;
|
|
43
36
|
getUrl(): string;
|
|
44
37
|
onLoad: () => Promise<void>;
|
|
45
38
|
onError: (_error: any) => void;
|
|
46
39
|
updateMbr(): void;
|
|
47
40
|
render(context: DrawingContext): void;
|
|
48
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
49
41
|
serialize(): SerializedItemData<AudioItemData>;
|
|
50
42
|
deserialize(data: SerializedItemData<AudioItemData> | AudioItemData): this;
|
|
51
43
|
apply(op: Operation): void;
|
|
@@ -5,7 +5,6 @@ import { LinkTo } from "../LinkTo/LinkTo";
|
|
|
5
5
|
import { Transformation } from "../Transformation/Transformation";
|
|
6
6
|
import { Board } from "../../Board";
|
|
7
7
|
import { DrawingContext } from "../DrawingContext";
|
|
8
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
8
|
import type { Operation } from "../../Events/EventsOperations";
|
|
10
9
|
import type { Command } from "../../Events/Command";
|
|
11
10
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
@@ -83,7 +82,7 @@ export declare class BaseItem<T extends BaseItem<any> = any> extends Mbr impleme
|
|
|
83
82
|
getChildrenIds(): string[] | null;
|
|
84
83
|
addChildItems(children: BaseItem[]): void;
|
|
85
84
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
86
|
-
rotate(
|
|
85
|
+
rotate(degree: number): void;
|
|
87
86
|
emitNesting(children: BaseItem[]): void;
|
|
88
87
|
handleNesting(item: BaseItem | Mbr, options?: {
|
|
89
88
|
onlyForOut?: boolean;
|
|
@@ -124,5 +123,4 @@ export declare class BaseItem<T extends BaseItem<any> = any> extends Mbr impleme
|
|
|
124
123
|
clearHighlightMbr(): void;
|
|
125
124
|
renderHoverHighlight(context: DrawingContext): void;
|
|
126
125
|
render(context: DrawingContext): void;
|
|
127
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
128
126
|
}
|
|
@@ -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,8 +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
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
14
12
|
import { BaseItem } from "../BaseItem/BaseItem";
|
|
15
13
|
import { Board } from "../../Board";
|
|
16
14
|
export interface Commentator {
|
|
@@ -40,14 +38,12 @@ export declare class Comment extends BaseItem<Comment> {
|
|
|
40
38
|
private anchor;
|
|
41
39
|
private events?;
|
|
42
40
|
parent: string;
|
|
43
|
-
readonly transformation: Transformation;
|
|
44
41
|
private commentators;
|
|
45
42
|
private thread;
|
|
46
43
|
private usersUnreadMarks;
|
|
47
44
|
private resolved;
|
|
48
45
|
private itemToFollow?;
|
|
49
46
|
readonly subject: Subject<Comment>;
|
|
50
|
-
readonly linkTo: LinkTo;
|
|
51
47
|
transformationRenderBlock?: boolean;
|
|
52
48
|
resizeEnabled: boolean;
|
|
53
49
|
constructor(board: Board, anchor?: Point, events?: Events | undefined, id?: string);
|
|
@@ -104,5 +100,4 @@ export declare class Comment extends BaseItem<Comment> {
|
|
|
104
100
|
clearHighlightMbr(): void;
|
|
105
101
|
renderHoverHighlight(_context: DrawingContext): void;
|
|
106
102
|
render(context: DrawingContext): void;
|
|
107
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
108
103
|
}
|
|
@@ -11,15 +11,11 @@ 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
|
-
import { DocumentFactory } from '../../api/DocumentFactory';
|
|
20
17
|
import { ConnectorAnchorColors } from './types';
|
|
21
|
-
import { BaseItem } from "../BaseItem/BaseItem";
|
|
22
|
-
import type { SerializedItemData } from "../BaseItem/BaseItem";
|
|
18
|
+
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
23
19
|
import { ColorValue } from '../../..';
|
|
24
20
|
import { ConnectionLineWidth, ConnectorLineStyle } from './ConnectorTypes';
|
|
25
21
|
export declare const CONNECTOR_ANCHOR_COLOR: ConnectorAnchorColors;
|
|
@@ -32,11 +28,9 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
32
28
|
private endPointerStyle;
|
|
33
29
|
readonly itemType = "Connector";
|
|
34
30
|
parent: string;
|
|
35
|
-
readonly transformation: Transformation;
|
|
36
31
|
private middlePoint;
|
|
37
32
|
private lineColor;
|
|
38
33
|
private smartJump;
|
|
39
|
-
readonly linkTo: LinkTo;
|
|
40
34
|
private lineWidth;
|
|
41
35
|
borderStyle: BorderStyle;
|
|
42
36
|
readonly subject: Subject<Connector>;
|
|
@@ -60,7 +54,6 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
60
54
|
private smartJumpStartEdge;
|
|
61
55
|
/** Mirror of smartJumpStartEdge for the end point. */
|
|
62
56
|
private smartJumpEndEdge;
|
|
63
|
-
setSmartJump(value: boolean): void;
|
|
64
57
|
private applySmartJump;
|
|
65
58
|
getSmartJump(): boolean;
|
|
66
59
|
clearObservedItems(): void;
|
|
@@ -71,25 +64,16 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
71
64
|
getId(): string;
|
|
72
65
|
apply(operation: Operation): void;
|
|
73
66
|
complete(id: string): void;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
applyEndPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
78
|
-
applyMiddlePoint(pointData: ControlPointData | null, updatePath?: boolean): void;
|
|
67
|
+
protected applyStartPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
68
|
+
protected applyEndPoint(pointData: ControlPointData, updatePath?: boolean): void;
|
|
69
|
+
protected applyMiddlePoint(pointData: ControlPointData | null, updatePath?: boolean): void;
|
|
79
70
|
private applySwitchPointers;
|
|
80
71
|
addMiddlePoint(point: BoardPoint): void;
|
|
81
|
-
setMiddlePoint(point: ControlPoint | ControlPointData, timestamp?: number): void;
|
|
82
|
-
setStartPointerStyle(style: ConnectorPointerStyle): void;
|
|
83
72
|
private applyStartPointerStyle;
|
|
84
|
-
setEndPointerStyle(style: ConnectorPointerStyle): void;
|
|
85
73
|
private applyEndPointerStyle;
|
|
86
|
-
setLineColor(color: ColorValue): void;
|
|
87
74
|
private applyLineColor;
|
|
88
|
-
setLineStyle(style: ConnectorLineStyle): void;
|
|
89
75
|
private applyLineStyle;
|
|
90
|
-
private setBorderStyle;
|
|
91
76
|
private applyBorderStyle;
|
|
92
|
-
setLineWidth(width: ConnectionLineWidth): void;
|
|
93
77
|
private applyLineWidth;
|
|
94
78
|
getStartPoint(): ControlPoint;
|
|
95
79
|
getEndPoint(): ControlPoint;
|
|
@@ -121,8 +105,6 @@ export declare class Connector extends BaseItem<Connector> {
|
|
|
121
105
|
isConnectedOnePoint(): boolean;
|
|
122
106
|
render(context: DrawingContext): void;
|
|
123
107
|
clipText(context: DrawingContext): void;
|
|
124
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
125
|
-
private renderPathHTML;
|
|
126
108
|
getPaths(): Path;
|
|
127
109
|
copyPaths(): Path;
|
|
128
110
|
isClosed(): boolean;
|
|
@@ -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,11 +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
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
14
11
|
import { Board } from "../../Board";
|
|
15
12
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
16
13
|
import { ColorValue, ColorRole } from "../../..";
|
|
@@ -32,12 +29,10 @@ export declare class Drawing extends BaseItem<Drawing> {
|
|
|
32
29
|
private events?;
|
|
33
30
|
readonly itemType = "Drawing";
|
|
34
31
|
parent: string;
|
|
35
|
-
readonly transformation: Transformation;
|
|
36
32
|
private path2d;
|
|
37
33
|
readonly subject: Subject<Drawing>;
|
|
38
34
|
untransformedMbr: Mbr;
|
|
39
35
|
private lines;
|
|
40
|
-
readonly linkTo: LinkTo;
|
|
41
36
|
strokeWidth: BorderWidth;
|
|
42
37
|
borderColor: ColorValue;
|
|
43
38
|
borderStyle: BorderStyle;
|
|
@@ -57,7 +52,6 @@ export declare class Drawing extends BaseItem<Drawing> {
|
|
|
57
52
|
setId(id: string): this;
|
|
58
53
|
getId(): string;
|
|
59
54
|
render(context: DrawingContext): void;
|
|
60
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
61
55
|
private getPathData;
|
|
62
56
|
getPath(): Path;
|
|
63
57
|
getSnapAnchorPoints(): Point[];
|
|
@@ -66,17 +60,13 @@ export declare class Drawing extends BaseItem<Drawing> {
|
|
|
66
60
|
isEnclosedOrCrossedBy(rect: Mbr): boolean;
|
|
67
61
|
emit(operation: DrawingOperation): void;
|
|
68
62
|
apply(op: Operation): void;
|
|
69
|
-
setStrokeOpacity(opacity: number): this;
|
|
70
63
|
getStrokeOpacity(): number;
|
|
71
|
-
setBorderStyle(style: BorderStyle): this;
|
|
72
64
|
getBorderStyle(): BorderStyle;
|
|
73
|
-
setStrokeColor(color: ColorValue): this;
|
|
74
65
|
getStrokeColor(): ColorValue;
|
|
75
66
|
setColorRole(role: ColorRole): this;
|
|
76
67
|
getColorRole(): ColorRole;
|
|
77
|
-
setStrokeWidth(width: number): this;
|
|
78
68
|
getLinkTo(): string | undefined;
|
|
79
|
-
getStrokeWidth():
|
|
69
|
+
getStrokeWidth(): BorderWidth;
|
|
80
70
|
getRichText(): null;
|
|
81
71
|
isPointNearLine(point: Point, threshold?: number | undefined): boolean;
|
|
82
72
|
}
|
|
@@ -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 {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/BaseItem";
|
|
2
2
|
import { Board } from "../../../../Board";
|
|
3
3
|
import { DrawingContext } from "../../../DrawingContext";
|
|
4
|
-
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
5
4
|
import { Path } from "../../../Path/Path";
|
|
6
5
|
import { Subject } from "../../../../Subject";
|
|
7
6
|
import { Paths } from "../../../Path/Paths";
|
|
8
|
-
import { CardOperation } from "../../../Examples/CardGame/Card/CardOperation";
|
|
9
7
|
export interface CardData extends BaseItemData {
|
|
10
8
|
isOpen?: boolean;
|
|
11
9
|
faceUrl?: string;
|
|
@@ -41,10 +39,9 @@ export declare class Card extends BaseItem<Card> {
|
|
|
41
39
|
getImage(): HTMLImageElement | null;
|
|
42
40
|
getIsRotatedPerpendicular(): boolean;
|
|
43
41
|
render(context: DrawingContext, left?: number, top?: number): void;
|
|
44
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
45
42
|
updateMbr(): void;
|
|
46
43
|
getPath(): Path | Paths;
|
|
47
44
|
deserialize(data: SerializedItemData): this;
|
|
48
45
|
toggleIsOpen(cards: Card[]): void;
|
|
49
|
-
apply(op:
|
|
46
|
+
apply(op: any): void;
|
|
50
47
|
}
|
|
@@ -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,9 +3,7 @@ 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
|
-
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
9
7
|
export declare const defaultDeckData: BaseItemData;
|
|
10
8
|
export declare class Deck extends BaseItem<Deck> {
|
|
11
9
|
readonly subject: Subject<Deck>;
|
|
@@ -28,14 +26,13 @@ export declare class Deck extends BaseItem<Deck> {
|
|
|
28
26
|
getRandomCard(): Card | undefined;
|
|
29
27
|
shuffleDeck(): void;
|
|
30
28
|
flipDeck(): void;
|
|
31
|
-
apply(op:
|
|
29
|
+
apply(op: any): void;
|
|
32
30
|
updateMbr(): void;
|
|
33
31
|
deserialize(data: SerializedItemData): this;
|
|
34
32
|
render(context: DrawingContext): void;
|
|
35
33
|
emitAnimation(): void;
|
|
36
34
|
startAnimation(): void;
|
|
37
35
|
stopAnimation(): void;
|
|
38
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
39
36
|
private updateCache;
|
|
40
37
|
getFirstCard(): Card | undefined;
|
|
41
38
|
}
|
|
@@ -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,9 +1,9 @@
|
|
|
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";
|
|
5
6
|
import { DrawingContext } from "../../../../Items";
|
|
6
|
-
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
7
7
|
import { DiceOperation } from "./DiceOperation";
|
|
8
8
|
export type DiceType = "common" | "custom";
|
|
9
9
|
export interface DiceData extends BaseItemData {
|
|
@@ -52,8 +52,7 @@ export declare class Dice extends BaseItem<Dice> {
|
|
|
52
52
|
setValues(values: number[]): void;
|
|
53
53
|
setValueIndex(valueIndex: number): void;
|
|
54
54
|
throwDice(): void;
|
|
55
|
-
apply(op: DiceOperation): void;
|
|
55
|
+
apply(op: Operation | DiceOperation): void;
|
|
56
56
|
startRotation(): void;
|
|
57
57
|
stopRotation(): void;
|
|
58
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
59
58
|
}
|
|
@@ -3,8 +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
|
-
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
8
6
|
export interface ScreenData extends BaseItemData {
|
|
9
7
|
ownerId?: string;
|
|
10
8
|
backgroundUrl?: string;
|
|
@@ -21,7 +19,7 @@ export declare class Screen extends BaseItem<Screen> {
|
|
|
21
19
|
backgroundImage: HTMLImageElement | null;
|
|
22
20
|
ownerId: string;
|
|
23
21
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
24
|
-
apply(op:
|
|
22
|
+
apply(op: any): void;
|
|
25
23
|
getOwnerId(): string;
|
|
26
24
|
getBackgroundColor(): string;
|
|
27
25
|
getBorderStyle(): string;
|
|
@@ -41,5 +39,4 @@ export declare class Screen extends BaseItem<Screen> {
|
|
|
41
39
|
deserialize(data: SerializedItemData): this;
|
|
42
40
|
getRandomItem(): BaseItem | undefined;
|
|
43
41
|
render(context: DrawingContext): void;
|
|
44
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
45
42
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseItem, BaseItemData, SerializedItemData } from "../../BaseItem/BaseItem";
|
|
2
2
|
import { Board } from "../../../Board";
|
|
3
3
|
import { DrawingContext } from "../../DrawingContext";
|
|
4
|
-
import { DocumentFactory } from "../../../api/DocumentFactory";
|
|
5
4
|
import { Path } from "../../Path/Path";
|
|
6
5
|
import { Subject } from "../../../Subject";
|
|
7
6
|
import { Paths } from "../../Path/Paths";
|
|
@@ -19,7 +18,6 @@ export declare class Counter extends BaseItem<Counter> {
|
|
|
19
18
|
render(context: DrawingContext): void;
|
|
20
19
|
updateMbr(): void;
|
|
21
20
|
getPath(): Path | Paths;
|
|
22
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
23
21
|
deserialize(data: SerializedItemData): this;
|
|
24
22
|
getCount(): number;
|
|
25
23
|
setCount(count: number): void;
|
|
@@ -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
|
}> {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { BaseItem, BaseItemData, SerializedItemData } from "../../BaseItem/BaseItem";
|
|
2
2
|
import { Board } from "../../../Board";
|
|
3
3
|
import { DrawingContext } from "../../DrawingContext";
|
|
4
|
-
import { DocumentFactory } from "../../../api/DocumentFactory";
|
|
5
4
|
import { BorderStyle, BorderWidth, Path } from "../../Path/Path";
|
|
6
5
|
import { Subject } from "../../../Subject";
|
|
7
6
|
import { TransformationData } from "../../Transformation/TransformationData";
|
|
8
7
|
import { Paths } from "../../Path/Paths";
|
|
9
|
-
import { StarOperation } from "../../Examples/Star/StarOperation";
|
|
10
8
|
export interface StarData {
|
|
11
9
|
readonly itemType: "Star";
|
|
12
10
|
backgroundColor: string;
|
|
@@ -30,9 +28,8 @@ export declare class Star extends BaseItem<Star> {
|
|
|
30
28
|
render(context: DrawingContext): void;
|
|
31
29
|
updateMbr(): void;
|
|
32
30
|
getPath(): Path | Paths;
|
|
33
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
34
31
|
deserialize(data: SerializedItemData): this;
|
|
35
32
|
isClosed(): boolean;
|
|
36
33
|
toggleIsShining(): void;
|
|
37
|
-
apply(op:
|
|
34
|
+
apply(op: any): void;
|
|
38
35
|
}
|
|
@@ -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,9 +15,7 @@ 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
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
23
19
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
24
20
|
import { ColorValue } from "../../..";
|
|
25
21
|
export declare class Frame extends BaseItem<Frame> {
|
|
@@ -34,12 +30,10 @@ export declare class Frame extends BaseItem<Frame> {
|
|
|
34
30
|
borderWidth: number;
|
|
35
31
|
readonly itemType = "Frame";
|
|
36
32
|
parent: string;
|
|
37
|
-
readonly transformation: Transformation;
|
|
38
33
|
readonly subject: Subject<Frame>;
|
|
39
34
|
private textContainer;
|
|
40
35
|
private path;
|
|
41
36
|
private mbr;
|
|
42
|
-
readonly linkTo: LinkTo;
|
|
43
37
|
readonly text: RichText;
|
|
44
38
|
private canChangeRatio;
|
|
45
39
|
canBeNested: boolean;
|
|
@@ -47,20 +41,9 @@ export declare class Frame extends BaseItem<Frame> {
|
|
|
47
41
|
transformationRenderBlock?: boolean;
|
|
48
42
|
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
43
|
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
44
|
addChildItems(children: BaseItem[]): void;
|
|
57
45
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
58
46
|
getLinkTo(): string | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Returns:
|
|
61
|
-
* true - if can be child of the frame
|
|
62
|
-
* false - if outside of the frame
|
|
63
|
-
*/
|
|
64
47
|
private initPath;
|
|
65
48
|
private updateTextContainer;
|
|
66
49
|
getPaths(): Path | Paths;
|
|
@@ -115,6 +98,5 @@ export declare class Frame extends BaseItem<Frame> {
|
|
|
115
98
|
renderBorders(context: DrawingContext): void;
|
|
116
99
|
renderPath(context: DrawingContext): void;
|
|
117
100
|
renderNewShape(context: DrawingContext): void;
|
|
118
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
119
101
|
getRichText(): RichText;
|
|
120
102
|
}
|
|
@@ -6,12 +6,9 @@ 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
|
-
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
15
12
|
export interface GroupData {
|
|
16
13
|
readonly itemType: "Group";
|
|
17
14
|
childIds: string[];
|
|
@@ -21,10 +18,8 @@ export interface GroupData {
|
|
|
21
18
|
}
|
|
22
19
|
export declare class Group extends BaseItem<Group> {
|
|
23
20
|
private events?;
|
|
24
|
-
readonly linkTo: LinkTo;
|
|
25
21
|
readonly itemType = "Group";
|
|
26
22
|
parent: string;
|
|
27
|
-
readonly transformation: Transformation;
|
|
28
23
|
readonly subject: Subject<Group>;
|
|
29
24
|
transformationRenderBlock?: boolean;
|
|
30
25
|
isLockedGroup: boolean;
|
|
@@ -44,5 +39,4 @@ export declare class Group extends BaseItem<Group> {
|
|
|
44
39
|
getId(): string;
|
|
45
40
|
getIntersectionPoints(segment: Line): Point[];
|
|
46
41
|
render(context: DrawingContext): void;
|
|
47
|
-
renderHTML(documentFactory: DocumentFactory): HTMLElement;
|
|
48
42
|
}
|