microboard-temp 0.13.41 → 0.13.42
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 +56773 -53598
- package/dist/cjs/index.js +56767 -53597
- package/dist/cjs/node.js +56335 -53160
- package/dist/esm/browser.js +54045 -50933
- package/dist/esm/index.js +54041 -50934
- package/dist/esm/node.js +57517 -54411
- package/dist/types/Board.d.ts +9 -7
- package/dist/types/BoardCommand.d.ts +2 -2
- package/dist/types/Camera/Camera.d.ts +4 -1
- package/dist/types/Events/BaseCommand.d.ts +5 -4
- package/dist/types/Events/Command.d.ts +11 -7
- package/dist/types/Events/CreateCommand.d.ts +5 -0
- package/dist/types/Events/Events.d.ts +2 -1
- package/dist/types/Events/EventsOperations.d.ts +23 -15
- package/dist/types/Events/Log/EventsLog.d.ts +4 -3
- package/dist/types/Events/Log/createEventsList.d.ts +3 -1
- package/dist/types/Events/index.d.ts +2 -1
- package/dist/types/Items/AINode/AINode.d.ts +1 -1
- package/dist/types/Items/Anchor/Anchor.d.ts +2 -1
- package/dist/types/Items/Arc/Arc.d.ts +4 -1
- package/dist/types/Items/Audio/Audio.d.ts +2 -2
- package/dist/types/Items/BaseItem/BaseItem.d.ts +8 -7
- package/dist/types/Items/Connector/Connector.d.ts +12 -17
- package/dist/types/Items/Connector/ConnectorCommand.d.ts +2 -2
- package/dist/types/Items/Connector/ConnectorOperations.d.ts +1 -1
- package/dist/types/Items/Connector/ConnectorTypes.d.ts +10 -0
- package/dist/types/Items/Connector/Pointers/Pointers.d.ts +3 -2
- package/dist/types/Items/Connector/Pointers/index.d.ts +1 -1
- package/dist/types/Items/Connector/getLine/getLine.d.ts +1 -1
- package/dist/types/Items/Connector/index.d.ts +3 -2
- package/dist/types/Items/Curve/Curve.d.ts +4 -4
- package/dist/types/Items/Drawing/Drawing.d.ts +6 -5
- package/dist/types/Items/Drawing/DrawingCommand.d.ts +2 -2
- package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +11 -8
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +10 -1
- package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +6 -1
- package/dist/types/Items/Frame/Frame.d.ts +11 -2
- package/dist/types/Items/Frame/FrameData.d.ts +3 -3
- package/dist/types/Items/Geometry.d.ts +1 -1
- package/dist/types/Items/Group/Group.d.ts +7 -3
- package/dist/types/Items/Image/Image.d.ts +4 -3
- package/dist/types/Items/Item.d.ts +15 -15
- package/dist/types/Items/Line/Line.d.ts +1 -1
- package/dist/types/Items/Mbr/Mbr.d.ts +5 -5
- package/dist/types/Items/Placeholder/Placeholder.d.ts +12 -7
- package/dist/types/Items/Point/Point.d.ts +1 -1
- package/dist/types/Items/RegisterItem.d.ts +4 -2
- package/dist/types/Items/RichText/EditorContainer.d.ts +2 -2
- package/dist/types/Items/RichText/RichText.d.ts +11 -5
- package/dist/types/Items/RichText/RichTextCommand.d.ts +2 -2
- package/dist/types/Items/RichText/RichTextOperations.d.ts +1 -1
- package/dist/types/Items/RichText/editorHelpers/common/getAreAllChildrenEmpty.d.ts +1 -1
- package/dist/types/Items/RichText/editorHelpers/lists/getBlockParentList.d.ts +2 -2
- package/dist/types/Items/Shape/BPMN/BPMN_Annotation/index.d.ts +2 -1
- package/dist/types/Items/Shape/BPMN/BPMN_DataObject/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_DataStore/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_EndEvent/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_EventSubprocess/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_Gateway/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_GatewayParallel/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_GatewayXOR/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_Group/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEvent/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEventNoneInterrupting/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_Participant/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_StartEvent/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_StartEventNoneInterrupting/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_Task/index.d.ts +3 -1
- package/dist/types/Items/Shape/BPMN/BPMN_Transaction/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ArrowBlockLeft/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ArrowBlockRigth/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ArrowLeft/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ArrowLeftRight/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ArrowRight/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/BracesLeft/index.d.ts +2 -1
- package/dist/types/Items/Shape/Basic/BracesRight/index.d.ts +2 -1
- package/dist/types/Items/Shape/Basic/Circle/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Cloud/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Cross/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Cylinder/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Hexagon/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Octagon/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Parallelogram/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Pentagon/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/PredefinedProcess/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Rectangle/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ReversedParallelogram/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/ReversedTriangle/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Rhombus/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/RoundedRectangle/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/SpeachBubble/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Star/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Trapezoid/index.d.ts +3 -1
- package/dist/types/Items/Shape/Basic/Triangle/index.d.ts +3 -1
- package/dist/types/Items/Shape/Shape.d.ts +7 -1
- package/dist/types/Items/Shape/ShapeCommand.d.ts +2 -2
- package/dist/types/Items/Shape/ShapeOperation.d.ts +1 -1
- package/dist/types/Items/Shape/ShapeType.d.ts +3 -0
- package/dist/types/Items/Shape/index.d.ts +1 -3
- package/dist/types/Items/Sticker/Sticker.d.ts +6 -4
- package/dist/types/Items/Transformation/Matrix.d.ts +1 -1
- package/dist/types/Items/Transformation/TransformationCommand.d.ts +1 -1
- package/dist/types/Items/Video/Video.d.ts +1 -1
- package/dist/types/Items/index.d.ts +2 -3
- package/dist/types/Selection/Selection.d.ts +10 -7
- package/dist/types/SessionStorage.d.ts +1 -1
- package/dist/types/Settings.d.ts +14 -9
- package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +5 -3
- package/dist/types/SpatialIndex/SpacialIndex.d.ts +8 -1
- package/dist/types/Tools/AddConnector/AddConnector.d.ts +1 -1
- package/dist/types/Tools/Tools.d.ts +3 -2
- package/dist/types/Validators/Validators.d.ts +4 -3
- package/dist/types/api/MockPath2D.d.ts +3 -3
- package/dist/types/api/Path2DFactory.d.ts +1 -1
- package/dist/types/itemFactories.d.ts +27 -1
- package/dist/types/parserHTML.d.ts +1 -2
- package/dist/types/sha256.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/Board.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ 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 {
|
|
6
|
-
import {
|
|
5
|
+
import { Matrix } from "./Items/Transformation/Matrix";
|
|
6
|
+
import { Mbr } from "./Items/Mbr/Mbr";
|
|
7
|
+
import type { Item, ItemData } from "./Items/Item";
|
|
8
|
+
import type { AINode } from "./Items/AINode";
|
|
7
9
|
import { DrawingContext } from "./Items/DrawingContext";
|
|
8
|
-
import { Group } from "./Items/Group";
|
|
9
|
-
import { ImageItem } from "./Items/Image";
|
|
10
|
+
import type { Group } from "./Items/Group";
|
|
11
|
+
import type { ImageItem } from "./Items/Image";
|
|
10
12
|
import { Keyboard } from "./Keyboard";
|
|
11
13
|
import { Pointer } from "./Pointer";
|
|
12
14
|
import { Presence } from "./Presence/Presence";
|
|
@@ -16,8 +18,8 @@ import { SpatialIndex } from "./SpatialIndex";
|
|
|
16
18
|
import { Subject } from "./Subject";
|
|
17
19
|
import { Tools } from "./Tools";
|
|
18
20
|
import { ItemsMap } from "./Validators";
|
|
19
|
-
import { BaseItem } from "./Items/BaseItem";
|
|
20
|
-
import { BaseItemData } from "./Items/BaseItem/BaseItem";
|
|
21
|
+
import type { BaseItem } from "./Items/BaseItem";
|
|
22
|
+
import type { BaseItemData } from "./Items/BaseItem/BaseItem";
|
|
21
23
|
import { ItemDataWithId } from "./Items/Item";
|
|
22
24
|
import { Account } from "./types/Account";
|
|
23
25
|
export type InterfaceType = "edit" | "view" | "loading";
|
|
@@ -27,7 +29,7 @@ export declare class Board {
|
|
|
27
29
|
saveEditingFile?: (() => Promise<void>) | undefined;
|
|
28
30
|
private account?;
|
|
29
31
|
events: Events;
|
|
30
|
-
|
|
32
|
+
isBoardMenuOpen: boolean;
|
|
31
33
|
readonly selection: BoardSelection;
|
|
32
34
|
readonly tools: Tools;
|
|
33
35
|
readonly pointer: Pointer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from './Events';
|
|
1
|
+
import { Command, Operation } from './Events';
|
|
2
2
|
import { BoardOps } from './BoardOperations';
|
|
3
3
|
import { Board } from './Board';
|
|
4
4
|
export declare class BoardCommand implements Command {
|
|
@@ -9,5 +9,5 @@ export declare class BoardCommand implements Command {
|
|
|
9
9
|
apply(): void;
|
|
10
10
|
revert(): void;
|
|
11
11
|
getReverse(): BoardOps | BoardOps[];
|
|
12
|
-
merge(op:
|
|
12
|
+
merge(op: Operation): this;
|
|
13
13
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Matrix
|
|
1
|
+
import { Matrix } from '../Items/Transformation/Matrix';
|
|
2
|
+
import { Point } from '../Items/Point/Point';
|
|
3
|
+
import { Mbr } from '../Items/Mbr/Mbr';
|
|
4
|
+
import type { Item } from '../Items/Item';
|
|
2
5
|
import { Keyboard } from '../Keyboard';
|
|
3
6
|
import { Pointer } from '../Pointer';
|
|
4
7
|
import { Subject } from '../Subject';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Board } from "../Board";
|
|
2
|
-
import { BaseOperation } from "./EventsOperations";
|
|
3
|
-
|
|
1
|
+
import type { Board } from "../Board";
|
|
2
|
+
import { BaseOperation, Operation } from "./EventsOperations";
|
|
3
|
+
import { Command } from "./Command";
|
|
4
|
+
export declare class BaseCommand implements Command {
|
|
4
5
|
private board;
|
|
5
6
|
itemIds: string[];
|
|
6
7
|
operation: BaseOperation;
|
|
7
8
|
private reverse;
|
|
8
9
|
constructor(board: Board, itemIds: string[], operation: BaseOperation);
|
|
9
|
-
merge(op:
|
|
10
|
+
merge(op: Operation): this;
|
|
10
11
|
apply(): void;
|
|
11
12
|
revert(): void;
|
|
12
13
|
getReverse(): {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { Board } from '../Board';
|
|
2
|
-
import {
|
|
3
|
-
import { Item, TransformationOperation } from '../Items';
|
|
1
|
+
import type { Board } from '../Board';
|
|
2
|
+
import { Operation } from './EventsOperations';
|
|
4
3
|
export interface Command {
|
|
5
4
|
apply(): void;
|
|
6
5
|
revert(): void;
|
|
7
|
-
merge?: (op:
|
|
6
|
+
merge?: (op: Operation) => Command;
|
|
8
7
|
}
|
|
9
8
|
export { BaseCommand } from "./BaseCommand";
|
|
10
9
|
export interface ItemCommandFactory {
|
|
11
|
-
(items:
|
|
10
|
+
(items: any[], operation: any, board?: Board): Command;
|
|
11
|
+
}
|
|
12
|
+
export declare class NoOpCommand {
|
|
13
|
+
reason: string;
|
|
14
|
+
constructor(reason: string);
|
|
15
|
+
merge(_op: unknown): this;
|
|
16
|
+
apply(): void;
|
|
17
|
+
revert(): void;
|
|
12
18
|
}
|
|
13
|
-
export declare const itemCommandFactories: Record<string, ItemCommandFactory>;
|
|
14
|
-
export declare function createCommand(board: Board, operation: Operation): Command;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Board } from '../Board';
|
|
2
|
+
import { Operation } from './EventsOperations';
|
|
3
|
+
import { Command, ItemCommandFactory } from './Command';
|
|
4
|
+
export declare const itemCommandFactories: Record<string, ItemCommandFactory>;
|
|
5
|
+
export declare function createCommand(board: Board, operation: Operation): Command;
|
|
@@ -29,7 +29,7 @@ export interface BoardEventPackBody {
|
|
|
29
29
|
}
|
|
30
30
|
export interface SyncBoardEvent extends BoardEvent {
|
|
31
31
|
lastKnownOrder: number;
|
|
32
|
-
userId:
|
|
32
|
+
userId: number;
|
|
33
33
|
}
|
|
34
34
|
interface SyncBoardEventPackBody extends BoardEventPackBody {
|
|
35
35
|
lastKnownOrder: number;
|
|
@@ -39,6 +39,7 @@ export interface SyncBoardEventPack extends BoardEventPack {
|
|
|
39
39
|
}
|
|
40
40
|
export type SyncEvent = SyncBoardEvent | SyncBoardEventPack;
|
|
41
41
|
export declare class Events {
|
|
42
|
+
static createCommand: (board: Board, operation: Operation) => Command;
|
|
42
43
|
subject: Subject<BoardEvent>;
|
|
43
44
|
log: EventsLog;
|
|
44
45
|
board: Board;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { TransformationOperation } from "../Items";
|
|
2
|
-
import { ShapeOperation } from "../Items/Shape";
|
|
3
|
-
import { RichTextOperation } from "../Items";
|
|
4
|
-
import { BoardOps } from "../BoardOperations";
|
|
5
|
-
import { ConnectorOperation } from "../Items/Connector";
|
|
6
|
-
import { DrawingOperation } from "../Items/Drawing/DrawingOperation";
|
|
7
|
-
import { StickerOperation } from "../Items/Sticker/StickerOperation";
|
|
8
|
-
import { FrameOperation } from "../Items/Frame";
|
|
9
|
-
import { LinkToOperation } from "../Items/LinkTo/LinkToOperation";
|
|
10
|
-
import { PlaceholderOperation } from "../Items/Placeholder/PlaceholderOperation";
|
|
11
|
-
import { GroupOperation } from "../Items/Group/GroupOperation";
|
|
12
|
-
import { CommentOperation } from "../Items/Comment";
|
|
13
|
-
import { ImageOperation } from "../Items/Image";
|
|
14
|
-
import { VideoOperation } from "../Items/Video/VideoOperation";
|
|
15
|
-
import { AudioOperation } from "../Items/Audio/AudioOperation";
|
|
1
|
+
import type { TransformationOperation } from "../Items/Transformation/TransformationOperations";
|
|
2
|
+
import type { ShapeOperation } from "../Items/Shape/ShapeOperation";
|
|
3
|
+
import type { RichTextOperation } from "../Items/RichText/RichTextOperations";
|
|
4
|
+
import type { BoardOps } from "../BoardOperations";
|
|
5
|
+
import type { ConnectorOperation } from "../Items/Connector/ConnectorOperations";
|
|
6
|
+
import type { DrawingOperation } from "../Items/Drawing/DrawingOperation";
|
|
7
|
+
import type { StickerOperation } from "../Items/Sticker/StickerOperation";
|
|
8
|
+
import type { FrameOperation } from "../Items/Frame/FrameOperation";
|
|
9
|
+
import type { LinkToOperation } from "../Items/LinkTo/LinkToOperation";
|
|
10
|
+
import type { PlaceholderOperation } from "../Items/Placeholder/PlaceholderOperation";
|
|
11
|
+
import type { GroupOperation } from "../Items/Group/GroupOperation";
|
|
12
|
+
import type { CommentOperation } from "../Items/Comment/CommentOperation";
|
|
13
|
+
import type { ImageOperation } from "../Items/Image/ImageOperation";
|
|
14
|
+
import type { VideoOperation } from "../Items/Video/VideoOperation";
|
|
15
|
+
import type { AudioOperation } from "../Items/Audio/AudioOperation";
|
|
16
16
|
interface Undo {
|
|
17
17
|
class: "Events";
|
|
18
18
|
method: "undo";
|
|
@@ -35,4 +35,12 @@ export type ItemOperation = LinkToOperation | TransformationOperation | ShapeOpe
|
|
|
35
35
|
export type UndoableOperation = BoardOps | ItemOperation;
|
|
36
36
|
export type Operation = UndoableOperation | EventsOperation;
|
|
37
37
|
export type MethodType = Operation["method"];
|
|
38
|
+
export declare function isTransformation(op: Operation): op is TransformationOperation;
|
|
39
|
+
export declare function isBoardOp(op: Operation): op is BoardOps;
|
|
40
|
+
export declare function isRichTextOp(op: Operation): op is RichTextOperation;
|
|
41
|
+
export declare function isShapeOp(op: Operation): op is ShapeOperation;
|
|
42
|
+
export declare function isConnectorOp(op: Operation): op is ConnectorOperation;
|
|
43
|
+
export declare function isDrawingOp(op: Operation): op is DrawingOperation;
|
|
44
|
+
export declare function isItemOp(op: Operation): op is ItemOperation;
|
|
45
|
+
export declare function isEventsOp(op: Operation): op is EventsOperation;
|
|
38
46
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Board, BoardSnapshot } from '../../Board';
|
|
2
2
|
import { BoardEvent, BoardEventPack, SyncBoardEvent, SyncEvent } from '../Events';
|
|
3
|
+
import { Operation } from '../EventsOperations';
|
|
3
4
|
import { EventsList } from './createEventsList';
|
|
4
5
|
import { Command } from '../Command';
|
|
5
6
|
export interface HistoryRecord {
|
|
@@ -27,7 +28,7 @@ export declare class EventsLog {
|
|
|
27
28
|
publishIntervalTimer: NodeJS.Timeout | null;
|
|
28
29
|
resendIntervalTimer: NodeJS.Timeout | null;
|
|
29
30
|
saveFileTimeout: NodeJS.Timeout | null;
|
|
30
|
-
constructor(board: Board);
|
|
31
|
+
constructor(board: Board, commandFactory: (ops: Operation) => Command);
|
|
31
32
|
/**
|
|
32
33
|
* Inserts new events into the events log, handling transformations and merging
|
|
33
34
|
*/
|
|
@@ -40,7 +41,7 @@ export declare class EventsLog {
|
|
|
40
41
|
* Confirms events that have been sent, updating their status in the log
|
|
41
42
|
* Note: Implementation treats the parameter as BoardEventPack
|
|
42
43
|
*/
|
|
43
|
-
confirmSentLocalEvent(event:
|
|
44
|
+
confirmSentLocalEvent(event: SyncEvent): void;
|
|
44
45
|
/**
|
|
45
46
|
* Retrieves unordered records (records to send and new records)
|
|
46
47
|
*/
|
|
@@ -84,4 +85,4 @@ export declare class EventsLog {
|
|
|
84
85
|
*/
|
|
85
86
|
getLastConfirmed(): BoardEvent | null;
|
|
86
87
|
}
|
|
87
|
-
export declare function createEventsLog(board: Board): EventsLog;
|
|
88
|
+
export declare function createEventsLog(board: Board, commandFactory: (ops: Operation) => Command): EventsLog;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BoardEvent } from "../Events";
|
|
2
2
|
import { SyncLog, SyncLogSubject } from "../SyncLog";
|
|
3
3
|
import { HistoryRecord } from "./EventsLog";
|
|
4
|
+
import { Operation } from "../EventsOperations";
|
|
4
5
|
import { Command } from "../Command";
|
|
5
6
|
export type FilterPredicate = (value: HistoryRecord, index: number, array: HistoryRecord[]) => boolean;
|
|
6
7
|
export interface EventsList {
|
|
8
|
+
commandFactory: (ops: Operation) => Command;
|
|
7
9
|
addConfirmedRecords(records: HistoryRecord[]): void;
|
|
8
10
|
addNewRecords(records: HistoryRecord[]): void;
|
|
9
11
|
confirmSentRecords(records: BoardEvent[]): void;
|
|
@@ -33,4 +35,4 @@ export interface EventsList {
|
|
|
33
35
|
setSnapshotLastIndex(index: number): void;
|
|
34
36
|
getSnapshotLastIndex(): number;
|
|
35
37
|
}
|
|
36
|
-
export declare function createEventsList(
|
|
38
|
+
export declare function createEventsList(commandFactory: (ops: Operation) => Command): EventsList;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Events, createEvents } from "./Events";
|
|
2
2
|
export type { BoardEventBody, BoardEvent, SyncBoardEvent, SyncEvent, } from "./Events";
|
|
3
|
-
export type { ItemOperation, EventsOperation, Operation, } from "./EventsOperations";
|
|
3
|
+
export type { ItemOperation, EventsOperation, Operation, BaseOperation, } from "./EventsOperations";
|
|
4
|
+
export { isTransformation, isBoardOp, isRichTextOp, isShapeOp, isConnectorOp, isDrawingOp, isEventsOp, isItemOp } from "./EventsOperations";
|
|
4
5
|
export type { Command } from "./Command";
|
|
5
6
|
export type { SyncLog } from "./SyncLog";
|
|
6
7
|
export * from "./MessageRouter";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
2
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
3
3
|
import { Operation } from "../../Events/EventsOperations";
|
|
4
|
-
import { AINodeData } from "
|
|
4
|
+
import { AINodeData } from "./AINodeData";
|
|
5
5
|
import { DrawingContext } from "../DrawingContext";
|
|
6
6
|
import { GeometricNormal } from "../GeometricNormal";
|
|
7
7
|
import { Line } from "../Line/Line";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DrawingContext } from '../DrawingContext';
|
|
2
|
-
import { Mbr
|
|
2
|
+
import { Mbr } from '../Mbr/Mbr';
|
|
3
|
+
import { Point } from '../Point/Point';
|
|
3
4
|
export declare const ANCHOR_BORDER_COLOR = "rgb(147, 175, 246)";
|
|
4
5
|
export declare const ANCHOR_BACKGROUND_COLOR = "rgb(255, 255, 255)";
|
|
5
6
|
export declare const ANCHOR_STROKE_WIDTH = 1;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Point
|
|
1
|
+
import { Point } from "../Point/Point";
|
|
2
|
+
import { Line } from "../Line/Line";
|
|
3
|
+
import { Mbr } from "../Mbr/Mbr";
|
|
4
|
+
import { Matrix } from "../Transformation/Matrix";
|
|
2
5
|
import { GeometricNormal } from "../GeometricNormal";
|
|
3
6
|
export declare class ArcData {
|
|
4
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Events, Operation } from "../../Events";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
3
|
import { DrawingContext } from "../DrawingContext";
|
|
4
|
-
import { Transformation } from "../Transformation";
|
|
4
|
+
import { Transformation } from "../Transformation/Transformation";
|
|
5
5
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
6
6
|
import { Board } from "../../Board";
|
|
7
7
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
8
8
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
|
-
import { Path } from "../Path";
|
|
9
|
+
import { Path } from "../Path/Path";
|
|
10
10
|
import { Point } from "../Point/Point";
|
|
11
11
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
12
12
|
export interface AudioItemData {
|
|
@@ -6,11 +6,12 @@ import { Transformation } from "../Transformation/Transformation";
|
|
|
6
6
|
import { Board } from "../../Board";
|
|
7
7
|
import { DrawingContext } from "../DrawingContext";
|
|
8
8
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
9
|
-
import { Operation } from "../../Events";
|
|
9
|
+
import type { Operation } from "../../Events/EventsOperations";
|
|
10
|
+
import type { Command } from "../../Events/Command";
|
|
10
11
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
11
12
|
import { BaseOperation } from "../../Events/EventsOperations";
|
|
12
13
|
import { Subject } from "../../Subject";
|
|
13
|
-
import { Path, Paths } from "../Path";
|
|
14
|
+
import { Path, Paths } from "../Path/index";
|
|
14
15
|
import { BaseItemOperation } from "./BaseItemOperation";
|
|
15
16
|
import { SimpleSpatialIndex } from "../../SpatialIndex/SimpleSpatialIndex";
|
|
16
17
|
import { Point } from "../Point";
|
|
@@ -19,7 +20,8 @@ export interface BaseItemData {
|
|
|
19
20
|
itemType: string;
|
|
20
21
|
transformation?: TransformationData;
|
|
21
22
|
linkTo?: string;
|
|
22
|
-
|
|
23
|
+
childIds?: string[];
|
|
24
|
+
[key: string]: unknown;
|
|
23
25
|
}
|
|
24
26
|
export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
25
27
|
id: string;
|
|
@@ -27,8 +29,7 @@ export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
|
27
29
|
};
|
|
28
30
|
export declare class BaseItem extends Mbr implements Geometry {
|
|
29
31
|
private defaultItemData?;
|
|
30
|
-
|
|
31
|
-
static createCommand?: (board: Board, operation: Operation) => any;
|
|
32
|
+
static createCommand?: (board: Board, operation: Operation) => Command;
|
|
32
33
|
readonly transformation: Transformation;
|
|
33
34
|
readonly linkTo: LinkTo;
|
|
34
35
|
parent: string;
|
|
@@ -45,7 +46,7 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
45
46
|
resizeEnabled: boolean;
|
|
46
47
|
onlyProportionalResize: boolean;
|
|
47
48
|
itemType: string;
|
|
48
|
-
|
|
49
|
+
childIds: string[];
|
|
49
50
|
isHoverHighlighted: boolean;
|
|
50
51
|
static readonly HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
|
|
51
52
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
|
|
@@ -97,7 +98,7 @@ export declare class BaseItem extends Mbr implements Geometry {
|
|
|
97
98
|
updateMbr(): void;
|
|
98
99
|
getLinkTo(): string | undefined;
|
|
99
100
|
getRichText(): RichText | null;
|
|
100
|
-
deserialize(data: SerializedItemData
|
|
101
|
+
deserialize(data: SerializedItemData | BaseItemData): this;
|
|
101
102
|
serialize(): SerializedItemData<BaseItemData>;
|
|
102
103
|
isClosed(): boolean;
|
|
103
104
|
emit(operation: Operation | BaseOperation): void;
|
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { RichText } from '
|
|
1
|
+
import { RichText } from '../RichText/RichText';
|
|
2
2
|
import { Subject } from '../../Subject';
|
|
3
3
|
import { Board } from '../../Board';
|
|
4
4
|
import { Operation } from '../../Events';
|
|
5
5
|
import { DrawingContext } from '../DrawingContext';
|
|
6
6
|
import { GeometricNormal } from '../GeometricNormal';
|
|
7
|
-
import { Item } from '../Item';
|
|
8
|
-
import { Line } from '../Line';
|
|
9
|
-
import { Mbr } from '../Mbr';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import type { Item } from '../Item';
|
|
8
|
+
import { Line } from '../Line/Line';
|
|
9
|
+
import { Mbr } from '../Mbr/Mbr';
|
|
10
|
+
import { Path } from '../Path/Path';
|
|
11
|
+
import { Paths } from '../Path/Paths';
|
|
12
|
+
import type { BorderStyle } from '../Path/Path';
|
|
13
|
+
import { Point } from '../Point/Point';
|
|
14
|
+
import { Transformation } from '../Transformation/Transformation';
|
|
13
15
|
import { ConnectorData, ConnectorOperation } from './ConnectorOperations';
|
|
14
16
|
import { BoardPoint, ControlPoint, ControlPointData, FindItemFn } from './ControlPoint';
|
|
15
17
|
import { ConnectorPointerStyle, Pointer } from './Pointers/Pointers';
|
|
16
18
|
import { LinkTo } from '../LinkTo/LinkTo';
|
|
17
19
|
import { DocumentFactory } from '../../api/DocumentFactory';
|
|
18
20
|
import { ConnectorAnchorColors } from './types';
|
|
19
|
-
import { BaseItem
|
|
21
|
+
import { BaseItem } from "../BaseItem/BaseItem";
|
|
22
|
+
import type { SerializedItemData } from "../BaseItem/BaseItem";
|
|
20
23
|
import { ColorValue } from '../../..';
|
|
21
|
-
|
|
22
|
-
export type ConnectorLineStyle = (typeof ConnectorLineStyles)[number];
|
|
23
|
-
export declare const ConnectionLineWidths: readonly [1, 2, 3, 4, 5, 6, 7, 8, 12];
|
|
24
|
-
export type ConnectionLineWidth = (typeof ConnectionLineWidths)[number];
|
|
25
|
-
export declare const CONNECTOR_COLOR = "rgb(20, 21, 26)";
|
|
26
|
-
export declare const CONNECTOR_LINE_WIDTH = 1;
|
|
27
|
-
export declare const CONNECTOR_BORDER_STYLE: BorderStyle;
|
|
28
|
-
export declare const DEFAULT_END_POINTER = "TriangleFilled";
|
|
24
|
+
import { ConnectionLineWidth, ConnectorLineStyle } from './ConnectorTypes';
|
|
29
25
|
export declare const DRAW_TEXT_BORDER = false;
|
|
30
26
|
export declare const TEXT_BORDER_PADDING = 0;
|
|
31
27
|
export declare const CONNECTOR_ANCHOR_COLOR: ConnectorAnchorColors;
|
|
@@ -147,4 +143,3 @@ export declare class Connector extends BaseItem {
|
|
|
147
143
|
getRichText(): RichText;
|
|
148
144
|
getLinkTo(): string | undefined;
|
|
149
145
|
}
|
|
150
|
-
export declare const CONNECTOR_POINTER_TYPES: readonly ["None", "ArrowBroad", "ArrowThin", "TriangleFilled", "CircleFilled", "Angle", "TriangleEmpty", "DiamondFilled", "DiamondEmpty", "Zero", "One", "Many", "ManyMandatory", "OneMandatory", "ManyOptional", "OneOptional"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connector } from ".";
|
|
2
|
-
import { Command } from "../../Events";
|
|
2
|
+
import { Command, Operation } from "../../Events";
|
|
3
3
|
import { ConnectorOperation } from "./ConnectorOperations";
|
|
4
4
|
type ReverseOperation = {
|
|
5
5
|
item: Connector;
|
|
@@ -10,7 +10,7 @@ export declare class ConnectorCommand implements Command {
|
|
|
10
10
|
private operation;
|
|
11
11
|
reverse: ReverseOperation;
|
|
12
12
|
constructor(connector: Connector[], operation: ConnectorOperation);
|
|
13
|
-
merge(op:
|
|
13
|
+
merge(op: Operation): this;
|
|
14
14
|
apply(): void;
|
|
15
15
|
revert(): void;
|
|
16
16
|
getReverse(): ReverseOperation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlPointData, FindItemFn } from "./ControlPoint";
|
|
2
|
-
import { ConnectionLineWidth, ConnectorLineStyle } from "./
|
|
2
|
+
import { ConnectionLineWidth, ConnectorLineStyle } from "./ConnectorTypes";
|
|
3
3
|
import { ConnectorPointerStyle } from "./Pointers/Pointers";
|
|
4
4
|
import { DefaultRichTextData } from "../RichText/RichTextData";
|
|
5
5
|
import { DefaultTransformationData } from "../Transformation/TransformationData";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BorderStyle } from "../Path";
|
|
2
|
+
export declare const ConnectorLineStyles: readonly ["straight", "curved", "orthogonal"];
|
|
3
|
+
export type ConnectorLineStyle = (typeof ConnectorLineStyles)[number];
|
|
4
|
+
export declare const ConnectionLineWidths: readonly [1, 2, 3, 4, 5, 6, 7, 8, 12];
|
|
5
|
+
export type ConnectionLineWidth = (typeof ConnectionLineWidths)[number];
|
|
6
|
+
export declare const CONNECTOR_COLOR = "rgb(20, 21, 26)";
|
|
7
|
+
export declare const CONNECTOR_LINE_WIDTH = 1;
|
|
8
|
+
export declare const CONNECTOR_BORDER_STYLE: BorderStyle;
|
|
9
|
+
export declare const DEFAULT_END_POINTER = "TriangleFilled";
|
|
10
|
+
export declare const CONNECTOR_POINTER_TYPES: readonly ["None", "ArrowThin", "ArrowHeavy", "TriangleFilled", "TriangleOutline", "CircleFilled", "CircleOutline", "DiamondFilled", "DiamondOutline"];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Path
|
|
2
|
-
import {
|
|
1
|
+
import { Path } from '../../Path/Path';
|
|
2
|
+
import { Paths } from '../../Path/Paths';
|
|
3
|
+
import { Point } from '../../Point/Point';
|
|
3
4
|
export interface Pointer {
|
|
4
5
|
name: string;
|
|
5
6
|
path: Path | Paths;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Path } from '../../../Items';
|
|
2
|
-
import { ConnectorLineStyle } from '../
|
|
2
|
+
import { ConnectorLineStyle } from '../ConnectorTypes';
|
|
3
3
|
import { ControlPoint } from '../ControlPoint';
|
|
4
4
|
import { Pointer } from './Pointers';
|
|
5
5
|
export type ConnectedPointerDirection = 'top' | 'bottom' | 'right' | 'left';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Path } from "../../Path";
|
|
2
|
-
import { ConnectorLineStyle } from "../
|
|
2
|
+
import { ConnectorLineStyle } from "../ConnectorTypes";
|
|
3
3
|
import { ControlPoint } from "../ControlPoint";
|
|
4
4
|
export declare function getLine(lineStyle: ConnectorLineStyle, start: ControlPoint, end: ControlPoint, middle: ControlPoint | null): Path;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { Connector
|
|
1
|
+
export { Connector } from "./Connector";
|
|
2
|
+
export { ConnectionLineWidths, CONNECTOR_COLOR, CONNECTOR_POINTER_TYPES } from "./ConnectorTypes";
|
|
2
3
|
export { ConnectorData } from "./ConnectorOperations";
|
|
3
|
-
export type { ConnectorLineStyle, ConnectionLineWidth } from "./
|
|
4
|
+
export type { ConnectorLineStyle, ConnectionLineWidth } from "./ConnectorTypes";
|
|
4
5
|
export type { ConnectorOperation } from "./ConnectorOperations";
|
|
5
6
|
export { BoardPoint, FloatingPoint, FixedPoint, FixedConnectorPoint, toRelativePoint, } from "./ControlPoint";
|
|
6
7
|
export type { ControlPoint } from "./ControlPoint";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Mbr } from
|
|
2
|
-
import { Line } from
|
|
3
|
-
import { Point } from
|
|
4
|
-
import { Matrix } from
|
|
1
|
+
import { Mbr } from "../Mbr/Mbr";
|
|
2
|
+
import { Line } from "../Line/Line";
|
|
3
|
+
import { Point } from "../Point/Point";
|
|
4
|
+
import { Matrix } from "../Transformation/Matrix";
|
|
5
5
|
import { GeometricNormal } from '../GeometricNormal';
|
|
6
6
|
export declare class BaseCurve {
|
|
7
7
|
curve: any;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Events, Operation } from "../../Events";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
3
|
import { DrawingContext } from "../DrawingContext";
|
|
4
|
-
import { Line } from "../Line";
|
|
5
|
-
import { Mbr } from "../Mbr";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { Line } from "../Line/Line";
|
|
5
|
+
import { Mbr } from "../Mbr/Mbr";
|
|
6
|
+
import { Path } from "../Path/Path";
|
|
7
|
+
import type { BorderStyle, BorderWidth } from "../Path/Path";
|
|
8
|
+
import { Point } from "../Point/Point";
|
|
9
|
+
import { Transformation } from "../Transformation/Transformation";
|
|
9
10
|
import { DrawingOperation } from "./DrawingOperation";
|
|
10
11
|
import { TransformationData } from "../Transformation/TransformationData";
|
|
11
12
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from '../../Events';
|
|
1
|
+
import { Command, Operation } from '../../Events';
|
|
2
2
|
import { Drawing } from './Drawing';
|
|
3
3
|
import { DrawingOperation } from './DrawingOperation';
|
|
4
4
|
export declare class DrawingCommand implements Command {
|
|
@@ -6,7 +6,7 @@ export declare class DrawingCommand implements Command {
|
|
|
6
6
|
private operation;
|
|
7
7
|
private reverse;
|
|
8
8
|
constructor(item: Drawing[], operation: DrawingOperation);
|
|
9
|
-
merge(op:
|
|
9
|
+
merge(op: Operation): this;
|
|
10
10
|
apply(): void;
|
|
11
11
|
revert(): void;
|
|
12
12
|
getReverse(): {
|
|
@@ -6,7 +6,16 @@ import { Path } from "../../../Path/Path";
|
|
|
6
6
|
import { Subject } from "../../../../Subject";
|
|
7
7
|
import { Paths } from "../../../Path/Paths";
|
|
8
8
|
import { CardOperation } from "../../../Examples/CardGame/Card/CardOperation";
|
|
9
|
-
export
|
|
9
|
+
export interface CardData extends BaseItemData {
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
faceUrl?: string;
|
|
12
|
+
backsideUrl?: string;
|
|
13
|
+
dimensions?: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultCardData: CardData;
|
|
10
19
|
export declare class Card extends BaseItem {
|
|
11
20
|
readonly subject: Subject<Card>;
|
|
12
21
|
private faceUrl;
|
|
@@ -22,13 +31,7 @@ export declare class Card extends BaseItem {
|
|
|
22
31
|
width: number;
|
|
23
32
|
height: number;
|
|
24
33
|
};
|
|
25
|
-
constructor(board: Board, id?: string,
|
|
26
|
-
faceUrl: string;
|
|
27
|
-
backsideUrl: string;
|
|
28
|
-
}, dimensions?: {
|
|
29
|
-
width: number;
|
|
30
|
-
height: number;
|
|
31
|
-
});
|
|
34
|
+
constructor(board: Board, id?: string, defaultData?: CardData);
|
|
32
35
|
getDimensions(): {
|
|
33
36
|
width: number;
|
|
34
37
|
height: number;
|
|
@@ -6,7 +6,12 @@ import { DrawingContext } from "../../../../Items";
|
|
|
6
6
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
7
7
|
import { DiceOperation } from "./DiceOperation";
|
|
8
8
|
export type DiceType = "common" | "custom";
|
|
9
|
-
export
|
|
9
|
+
export interface DiceData extends BaseItemData {
|
|
10
|
+
type?: DiceType;
|
|
11
|
+
valueIndex?: number;
|
|
12
|
+
values?: (number | string)[];
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultDiceData: DiceData;
|
|
10
15
|
export declare class Dice extends BaseItem {
|
|
11
16
|
readonly itemType = "Dice";
|
|
12
17
|
private type;
|
|
@@ -17,6 +22,10 @@ export declare class Dice extends BaseItem {
|
|
|
17
22
|
borderColor: string;
|
|
18
23
|
borderStyle: BorderStyle;
|
|
19
24
|
private borderWidth;
|
|
25
|
+
private values;
|
|
26
|
+
private valueIndex;
|
|
27
|
+
private renderValues;
|
|
28
|
+
private animationFrameId;
|
|
20
29
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
21
30
|
private transformPath;
|
|
22
31
|
updateRenderValues(): Promise<void>;
|
|
@@ -5,7 +5,11 @@ import { DrawingContext } from "../../../DrawingContext";
|
|
|
5
5
|
import { BorderWidth, BorderStyle } from "../../../Path";
|
|
6
6
|
import { ScreenOperation } from "./ScreenOperation";
|
|
7
7
|
import { DocumentFactory } from "../../../../api/DocumentFactory";
|
|
8
|
-
export
|
|
8
|
+
export interface ScreenData extends BaseItemData {
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
backgroundUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultScreenData: ScreenData;
|
|
9
13
|
export declare class Screen extends BaseItem {
|
|
10
14
|
readonly subject: Subject<Screen>;
|
|
11
15
|
private path;
|
|
@@ -15,6 +19,7 @@ export declare class Screen extends BaseItem {
|
|
|
15
19
|
borderStyle: BorderStyle;
|
|
16
20
|
backgroundUrl: string;
|
|
17
21
|
backgroundImage: HTMLImageElement | null;
|
|
22
|
+
ownerId: string;
|
|
18
23
|
constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
|
|
19
24
|
apply(op: ScreenOperation): void;
|
|
20
25
|
getOwnerId(): string;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import { Mbr
|
|
1
|
+
import { Mbr } from "../Mbr/Mbr";
|
|
2
|
+
import { Line } from "../Line/Line";
|
|
3
|
+
import { Point } from "../Point/Point";
|
|
4
|
+
import { Transformation } from "../Transformation/Transformation";
|
|
5
|
+
import { Path } from "../Path/Path";
|
|
6
|
+
import { Paths } from "../Path/Paths";
|
|
7
|
+
import type { Item } from "../Item";
|
|
8
|
+
import { RichText } from "../RichText/RichText";
|
|
9
|
+
import { Matrix } from "../Transformation/Matrix";
|
|
10
|
+
import type { SerializedItemData } from "../BaseItem/BaseItem";
|
|
2
11
|
import { Subject } from "../../Subject";
|
|
3
12
|
import { DrawingContext } from "../DrawingContext";
|
|
4
13
|
import { Operation } from "../../Events";
|
|
@@ -74,7 +83,7 @@ export declare class Frame extends BaseItem {
|
|
|
74
83
|
scaleLikeLastFrame(): void;
|
|
75
84
|
setLastFrameScale(): void;
|
|
76
85
|
serialize(): SerializedItemData<FrameData>;
|
|
77
|
-
deserialize(data:
|
|
86
|
+
deserialize(data: SerializedItemData<FrameData> | FrameData): this;
|
|
78
87
|
getSavedProportionsMatrix(): Matrix;
|
|
79
88
|
private transformPath;
|
|
80
89
|
apply(op: Operation): void;
|