microboard-temp 0.13.40 → 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.
Files changed (140) hide show
  1. package/dist/cjs/browser.js +55017 -51755
  2. package/dist/cjs/index.js +55012 -51755
  3. package/dist/cjs/node.js +56725 -53463
  4. package/dist/esm/browser.js +55493 -52294
  5. package/dist/esm/index.js +55462 -52268
  6. package/dist/esm/node.js +57248 -54055
  7. package/dist/types/Board.d.ts +14 -8
  8. package/dist/types/BoardCommand.d.ts +2 -2
  9. package/dist/types/Camera/Camera.d.ts +4 -1
  10. package/dist/types/Events/BaseCommand.d.ts +17 -0
  11. package/dist/types/Events/Command.d.ts +11 -20
  12. package/dist/types/Events/CreateCommand.d.ts +5 -0
  13. package/dist/types/Events/Events.d.ts +2 -1
  14. package/dist/types/Events/EventsOperations.d.ts +23 -15
  15. package/dist/types/Events/Log/EventsLog.d.ts +4 -3
  16. package/dist/types/Events/Log/createEventsList.d.ts +3 -1
  17. package/dist/types/Events/Log/getSnapshotFromList.d.ts +5 -2
  18. package/dist/types/Events/index.d.ts +2 -1
  19. package/dist/types/Items/AINode/AINode.d.ts +4 -5
  20. package/dist/types/Items/AINode/AINodeData.d.ts +1 -0
  21. package/dist/types/Items/Anchor/Anchor.d.ts +2 -1
  22. package/dist/types/Items/Arc/Arc.d.ts +4 -1
  23. package/dist/types/Items/Audio/Audio.d.ts +6 -5
  24. package/dist/types/Items/BaseItem/BaseItem.d.ts +16 -12
  25. package/dist/types/Items/BaseItem/index.d.ts +1 -0
  26. package/dist/types/Items/Comment/Comment.d.ts +11 -15
  27. package/dist/types/Items/Connector/Connector.d.ts +14 -19
  28. package/dist/types/Items/Connector/ConnectorCommand.d.ts +2 -2
  29. package/dist/types/Items/Connector/ConnectorOperations.d.ts +3 -3
  30. package/dist/types/Items/Connector/ConnectorTypes.d.ts +10 -0
  31. package/dist/types/Items/Connector/Pointers/Pointers.d.ts +21 -4
  32. package/dist/types/Items/Connector/Pointers/index.d.ts +1 -1
  33. package/dist/types/Items/Connector/getLine/getLine.d.ts +1 -1
  34. package/dist/types/Items/Connector/index.d.ts +3 -2
  35. package/dist/types/Items/Curve/Curve.d.ts +9 -10
  36. package/dist/types/Items/Drawing/Drawing.d.ts +10 -8
  37. package/dist/types/Items/Drawing/DrawingCommand.d.ts +2 -2
  38. package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +11 -8
  39. package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +16 -8
  40. package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +10 -4
  41. package/dist/types/Items/Frame/Frame.d.ts +12 -4
  42. package/dist/types/Items/Frame/FrameData.d.ts +5 -3
  43. package/dist/types/Items/Frame/FrameOperation.d.ts +13 -1
  44. package/dist/types/Items/Geometry.d.ts +1 -1
  45. package/dist/types/Items/Group/Group.d.ts +11 -6
  46. package/dist/types/Items/Image/Image.d.ts +8 -6
  47. package/dist/types/Items/Item.d.ts +15 -15
  48. package/dist/types/Items/Line/Line.d.ts +1 -1
  49. package/dist/types/Items/Mbr/Mbr.d.ts +5 -5
  50. package/dist/types/Items/Mbr/updateRects.d.ts +1 -2
  51. package/dist/types/Items/Path/Path.d.ts +1 -0
  52. package/dist/types/Items/Path/Paths.d.ts +2 -0
  53. package/dist/types/Items/Placeholder/Placeholder.d.ts +16 -10
  54. package/dist/types/Items/Point/Point.d.ts +1 -1
  55. package/dist/types/Items/RegisterItem.d.ts +4 -2
  56. package/dist/types/Items/RichText/CanvasText/Render.d.ts +1 -1
  57. package/dist/types/Items/RichText/Editor/BlockNode.d.ts +10 -3
  58. package/dist/types/Items/RichText/EditorContainer.d.ts +5 -6
  59. package/dist/types/Items/RichText/RichText.d.ts +13 -7
  60. package/dist/types/Items/RichText/RichTextCommand.d.ts +2 -2
  61. package/dist/types/Items/RichText/RichTextData.d.ts +2 -0
  62. package/dist/types/Items/RichText/RichTextOperations.d.ts +4 -3
  63. package/dist/types/Items/RichText/editorHelpers/common/getAreAllChildrenEmpty.d.ts +1 -1
  64. package/dist/types/Items/RichText/editorHelpers/lists/getBlockParentList.d.ts +2 -2
  65. package/dist/types/Items/RichText/setNodeStyles.d.ts +2 -5
  66. package/dist/types/Items/Shape/BPMN/BPMN_Annotation/index.d.ts +2 -1
  67. package/dist/types/Items/Shape/BPMN/BPMN_DataObject/index.d.ts +3 -1
  68. package/dist/types/Items/Shape/BPMN/BPMN_DataStore/index.d.ts +3 -1
  69. package/dist/types/Items/Shape/BPMN/BPMN_EndEvent/index.d.ts +3 -1
  70. package/dist/types/Items/Shape/BPMN/BPMN_EventSubprocess/index.d.ts +3 -1
  71. package/dist/types/Items/Shape/BPMN/BPMN_Gateway/index.d.ts +3 -1
  72. package/dist/types/Items/Shape/BPMN/BPMN_GatewayParallel/index.d.ts +3 -1
  73. package/dist/types/Items/Shape/BPMN/BPMN_GatewayXOR/index.d.ts +3 -1
  74. package/dist/types/Items/Shape/BPMN/BPMN_Group/index.d.ts +3 -1
  75. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEvent/index.d.ts +3 -1
  76. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEventNoneInterrupting/index.d.ts +3 -1
  77. package/dist/types/Items/Shape/BPMN/BPMN_Participant/index.d.ts +3 -1
  78. package/dist/types/Items/Shape/BPMN/BPMN_StartEvent/index.d.ts +3 -1
  79. package/dist/types/Items/Shape/BPMN/BPMN_StartEventNoneInterrupting/index.d.ts +3 -1
  80. package/dist/types/Items/Shape/BPMN/BPMN_Task/index.d.ts +3 -1
  81. package/dist/types/Items/Shape/BPMN/BPMN_Transaction/index.d.ts +3 -1
  82. package/dist/types/Items/Shape/Basic/ArrowBlockLeft/index.d.ts +3 -1
  83. package/dist/types/Items/Shape/Basic/ArrowBlockRigth/index.d.ts +3 -1
  84. package/dist/types/Items/Shape/Basic/ArrowLeft/index.d.ts +3 -1
  85. package/dist/types/Items/Shape/Basic/ArrowLeftRight/index.d.ts +3 -1
  86. package/dist/types/Items/Shape/Basic/ArrowRight/index.d.ts +3 -1
  87. package/dist/types/Items/Shape/Basic/BracesLeft/index.d.ts +2 -1
  88. package/dist/types/Items/Shape/Basic/BracesRight/index.d.ts +2 -1
  89. package/dist/types/Items/Shape/Basic/Circle/index.d.ts +3 -1
  90. package/dist/types/Items/Shape/Basic/Cloud/index.d.ts +3 -1
  91. package/dist/types/Items/Shape/Basic/Cross/index.d.ts +3 -1
  92. package/dist/types/Items/Shape/Basic/Cylinder/index.d.ts +3 -1
  93. package/dist/types/Items/Shape/Basic/Hexagon/index.d.ts +3 -1
  94. package/dist/types/Items/Shape/Basic/Octagon/index.d.ts +3 -1
  95. package/dist/types/Items/Shape/Basic/Parallelogram/index.d.ts +3 -1
  96. package/dist/types/Items/Shape/Basic/Pentagon/index.d.ts +3 -1
  97. package/dist/types/Items/Shape/Basic/PredefinedProcess/index.d.ts +3 -1
  98. package/dist/types/Items/Shape/Basic/Rectangle/index.d.ts +3 -1
  99. package/dist/types/Items/Shape/Basic/ReversedParallelogram/index.d.ts +3 -1
  100. package/dist/types/Items/Shape/Basic/ReversedTriangle/index.d.ts +3 -1
  101. package/dist/types/Items/Shape/Basic/Rhombus/index.d.ts +3 -1
  102. package/dist/types/Items/Shape/Basic/RoundedRectangle/index.d.ts +3 -1
  103. package/dist/types/Items/Shape/Basic/SpeachBubble/index.d.ts +3 -1
  104. package/dist/types/Items/Shape/Basic/Star/index.d.ts +3 -1
  105. package/dist/types/Items/Shape/Basic/Trapezoid/index.d.ts +3 -1
  106. package/dist/types/Items/Shape/Basic/Triangle/index.d.ts +3 -1
  107. package/dist/types/Items/Shape/Shape.d.ts +9 -3
  108. package/dist/types/Items/Shape/ShapeCommand.d.ts +2 -2
  109. package/dist/types/Items/Shape/ShapeData.d.ts +2 -0
  110. package/dist/types/Items/Shape/ShapeOperation.d.ts +1 -1
  111. package/dist/types/Items/Shape/ShapeType.d.ts +3 -0
  112. package/dist/types/Items/Shape/index.d.ts +1 -3
  113. package/dist/types/Items/Sticker/Sticker.d.ts +8 -6
  114. package/dist/types/Items/Sticker/StickerOperation.d.ts +3 -3
  115. package/dist/types/Items/Transformation/Matrix.d.ts +1 -1
  116. package/dist/types/Items/Transformation/TransformationCommand.d.ts +1 -1
  117. package/dist/types/Items/Video/Video.d.ts +8 -7
  118. package/dist/types/Items/index.d.ts +2 -1
  119. package/dist/types/Keyboard/types.d.ts +2 -1
  120. package/dist/types/Selection/Selection.d.ts +15 -12
  121. package/dist/types/Selection/Transformer/TextTransformer/getTextResizeType.d.ts +1 -1
  122. package/dist/types/Selection/Transformer/TransformerHelpers/AnchorType.d.ts +1 -1
  123. package/dist/types/Selection/Transformer/TransformerHelpers/getOppositePoint.d.ts +1 -1
  124. package/dist/types/Selection/Transformer/TransformerHelpers/getResizeMatrix.d.ts +1 -1
  125. package/dist/types/Selection/Transformer/TransformerHelpers/getResizedMbr.d.ts +1 -1
  126. package/dist/types/SessionStorage.d.ts +1 -1
  127. package/dist/types/Settings.d.ts +15 -10
  128. package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +5 -3
  129. package/dist/types/SpatialIndex/SpacialIndex.d.ts +8 -1
  130. package/dist/types/Tools/AddConnector/AddConnector.d.ts +1 -1
  131. package/dist/types/Tools/AddDrawing/AddDrawing.d.ts +1 -1
  132. package/dist/types/Tools/AddDrawing/AddHighlighter.d.ts +1 -1
  133. package/dist/types/Tools/Tools.d.ts +3 -2
  134. package/dist/types/Validators/Validators.d.ts +4 -3
  135. package/dist/types/api/MockPath2D.d.ts +3 -3
  136. package/dist/types/api/Path2DFactory.d.ts +1 -1
  137. package/dist/types/itemFactories.d.ts +27 -1
  138. package/dist/types/parserHTML.d.ts +10 -3
  139. package/dist/types/sha256.d.ts +1 -1
  140. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
- import { Path, Paths } from '../../Path';
2
- import { Point } from '../../Point';
1
+ import { Path } from '../../Path/Path';
2
+ import { Paths } from '../../Path/Paths';
3
+ import { Point } from '../../Point/Point';
3
4
  export interface Pointer {
4
- name: ConnectorPointerStyle;
5
+ name: string;
5
6
  path: Path | Paths;
6
7
  start: Point;
7
8
  end: Point;
8
- middle: Point[];
9
+ middle: readonly Point[];
9
10
  }
10
11
  export declare function getPointer(style: string): Pointer;
11
12
  declare const Pointers: {
@@ -14,96 +15,112 @@ declare const Pointers: {
14
15
  readonly path: Path;
15
16
  readonly start: Point;
16
17
  readonly end: Point;
18
+ readonly middle: readonly [];
17
19
  };
18
20
  readonly Angle: {
19
21
  readonly name: "Angle";
20
22
  readonly path: Path;
21
23
  readonly start: Point;
22
24
  readonly end: Point;
25
+ readonly middle: readonly [];
23
26
  };
24
27
  readonly ArrowBroad: {
25
28
  readonly name: "ArrowBroad";
26
29
  readonly path: Path;
27
30
  readonly start: Point;
28
31
  readonly end: Point;
32
+ readonly middle: readonly [];
29
33
  };
30
34
  readonly ArrowThin: {
31
35
  readonly name: "ArrowThin";
32
36
  readonly path: Path;
33
37
  readonly start: Point;
34
38
  readonly end: Point;
39
+ readonly middle: readonly [];
35
40
  };
36
41
  readonly CircleFilled: {
37
42
  readonly name: "CircleFilled";
38
43
  readonly path: Path;
39
44
  readonly start: Point;
40
45
  readonly end: Point;
46
+ readonly middle: readonly [];
41
47
  };
42
48
  readonly DiamondEmpty: {
43
49
  readonly name: "DiamondEmpty";
44
50
  readonly path: Path;
45
51
  readonly start: Point;
46
52
  readonly end: Point;
53
+ readonly middle: readonly [];
47
54
  };
48
55
  readonly DiamondFilled: {
49
56
  readonly name: "DiamondFilled";
50
57
  readonly path: Path;
51
58
  readonly start: Point;
52
59
  readonly end: Point;
60
+ readonly middle: readonly [];
53
61
  };
54
62
  readonly Many: {
55
63
  readonly name: "Many";
56
64
  readonly path: Paths;
57
65
  readonly start: Point;
58
66
  readonly end: Point;
67
+ readonly middle: readonly [];
59
68
  };
60
69
  readonly ManyMandatory: {
61
70
  readonly name: "ManyManadatory";
62
71
  readonly path: Paths;
63
72
  readonly start: Point;
64
73
  readonly end: Point;
74
+ readonly middle: readonly [];
65
75
  };
66
76
  readonly ManyOptional: {
67
77
  readonly name: "ManyOptional";
68
78
  readonly path: Paths;
69
79
  readonly start: Point;
70
80
  readonly end: Point;
81
+ readonly middle: readonly [];
71
82
  };
72
83
  readonly One: {
73
84
  readonly name: "One";
74
85
  readonly path: Paths;
75
86
  readonly start: Point;
76
87
  readonly end: Point;
88
+ readonly middle: readonly [];
77
89
  };
78
90
  readonly OneMandatory: {
79
91
  readonly name: "OneMandatory";
80
92
  readonly path: Paths;
81
93
  readonly start: Point;
82
94
  readonly end: Point;
95
+ readonly middle: readonly [];
83
96
  };
84
97
  readonly OneOptional: {
85
98
  readonly name: "OneOptional";
86
99
  readonly path: Paths;
87
100
  readonly start: Point;
88
101
  readonly end: Point;
102
+ readonly middle: readonly [];
89
103
  };
90
104
  readonly TriangleEmpty: {
91
105
  readonly name: "TriangleEmpty";
92
106
  readonly path: Path;
93
107
  readonly start: Point;
94
108
  readonly end: Point;
109
+ readonly middle: readonly [];
95
110
  };
96
111
  readonly TriangleFilled: {
97
112
  readonly name: "TriangleFilled";
98
113
  readonly path: Path;
99
114
  readonly start: Point;
100
115
  readonly end: Point;
116
+ readonly middle: readonly [];
101
117
  };
102
118
  readonly Zero: {
103
119
  readonly name: "Zero";
104
120
  readonly path: Path;
105
121
  readonly start: Point;
106
122
  readonly end: Point;
123
+ readonly middle: readonly [];
107
124
  };
108
125
  };
109
126
  export type ConnectorPointerStyle = keyof typeof Pointers;
@@ -1,5 +1,5 @@
1
1
  import { Path } from '../../../Items';
2
- import { ConnectorLineStyle } from '../Connector';
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 "../Connector";
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, ConnectionLineWidths, CONNECTOR_POINTER_TYPES } from "./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 "./Connector";
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,13 +1,12 @@
1
- import { Bezier } from 'bezier-js';
2
- import { Mbr } from '../Mbr';
3
- import { Line } from '../Line';
4
- import { Point } from '../Point';
5
- import { Matrix } from '../Transformation';
1
+ import { Mbr } from "../Mbr/Mbr";
2
+ import { Line } from "../Line/Line";
3
+ import { Point } from "../Point/Point";
4
+ import { Matrix } from "../Transformation/Matrix";
6
5
  import { GeometricNormal } from '../GeometricNormal';
7
6
  export declare class BaseCurve {
8
- curve: Bezier;
9
- constructor(curve: Bezier);
10
- protected updateCache(curve: Bezier): void;
7
+ curve: any;
8
+ constructor(curve: any);
9
+ protected updateCache(curve: any): void;
11
10
  getIntersectionPoints(segment: Line): Point[];
12
11
  getNearestEdgePointTo(point: Point): Point;
13
12
  getDistance(point: Point): number;
@@ -26,7 +25,7 @@ export declare class QuadraticBezier extends BaseCurve {
26
25
  control: Point;
27
26
  end: Point;
28
27
  type: "QuadBezier";
29
- static getCache(start?: Point, control?: Point, end?: Point): Bezier;
28
+ static getCache(start?: Point, control?: Point, end?: Point): any;
30
29
  constructor(start?: Point, control?: Point, end?: Point);
31
30
  protected updateCache(): void;
32
31
  getStartPoint(): Point;
@@ -43,7 +42,7 @@ export declare class CubicBezier extends BaseCurve {
43
42
  end: Point;
44
43
  endControl: Point;
45
44
  type: "CubicBezier";
46
- static getCache(start?: Point, startControl?: Point, end?: Point, endControl?: Point): Bezier;
45
+ static getCache(start?: Point, startControl?: Point, end?: Point, endControl?: Point): any;
47
46
  constructor(start?: Point, startControl?: Point, end?: Point, endControl?: Point);
48
47
  protected updateCache(): void;
49
48
  getStartPoint(): Point;
@@ -1,17 +1,18 @@
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 { BorderStyle, BorderWidth, Path } from "../Path";
7
- import { Point } from "../Point";
8
- import { Transformation } from "../Transformation";
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";
12
13
  import { DocumentFactory } from "../../api/DocumentFactory";
13
14
  import { Board } from "../../Board";
14
- import { BaseItem } from "../BaseItem/BaseItem";
15
+ import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
15
16
  import { ColorValue, ColorRole } from "../../..";
16
17
  export interface DrawingData {
17
18
  itemType: "Drawing";
@@ -24,6 +25,7 @@ export interface DrawingData {
24
25
  strokeWidth: number;
25
26
  colorRole?: ColorRole;
26
27
  linkTo?: string;
28
+ [key: string]: unknown;
27
29
  }
28
30
  export declare class Drawing extends BaseItem {
29
31
  points: Point[];
@@ -44,8 +46,8 @@ export declare class Drawing extends BaseItem {
44
46
  private borderOpacity;
45
47
  transformationRenderBlock?: boolean;
46
48
  constructor(board: Board, points: Point[], events?: Events | undefined, id?: string);
47
- serialize(): DrawingData;
48
- deserialize(data: DrawingData): this;
49
+ serialize(): SerializedItemData<DrawingData>;
50
+ deserialize(data: SerializedItemData<DrawingData>): this;
49
51
  updateGeometry(): void;
50
52
  updateMbr(): void;
51
53
  updatePath2d(): void;
@@ -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: DrawingOperation): this;
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 declare const defaultCardData: BaseItemData;
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, urls?: {
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;
@@ -1,24 +1,32 @@
1
1
  import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/BaseItem";
2
- import { BorderWidth, Path } from "../../../../Items";
2
+ import { BorderWidth, Path, BorderStyle } from "../../../../Items";
3
3
  import { Subject } from "../../../../Subject";
4
4
  import { Board } from "../../../../Board";
5
5
  import { DrawingContext } from "../../../../Items";
6
6
  import { DocumentFactory } from "../../../../api/DocumentFactory";
7
7
  import { DiceOperation } from "./DiceOperation";
8
8
  export type DiceType = "common" | "custom";
9
- export declare const defaultDiceData: BaseItemData;
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;
13
18
  private path;
14
19
  readonly subject: Subject<Dice>;
15
- private borderWidth;
16
- valueIndex: number;
17
- values: (number | string)[];
18
- renderValues: Record<number, number | HTMLImageElement>;
19
- private animationFrameId?;
20
20
  drawingContext: DrawingContext | null;
21
- constructor(board: Board, id?: string, type?: DiceType, values?: (number | string)[]);
21
+ backgroundColor: string;
22
+ borderColor: string;
23
+ borderStyle: BorderStyle;
24
+ private borderWidth;
25
+ private values;
26
+ private valueIndex;
27
+ private renderValues;
28
+ private animationFrameId;
29
+ constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
22
30
  private transformPath;
23
31
  updateRenderValues(): Promise<void>;
24
32
  render(context: DrawingContext): void;
@@ -2,19 +2,25 @@ import { BaseItem, BaseItemData, SerializedItemData } from "../../../BaseItem/Ba
2
2
  import { Board } from "../../../../Board";
3
3
  import { Subject } from "../../../../Subject";
4
4
  import { DrawingContext } from "../../../DrawingContext";
5
- import { BorderWidth } from "../../../Path";
5
+ import { BorderWidth, BorderStyle } from "../../../Path";
6
6
  import { ScreenOperation } from "./ScreenOperation";
7
7
  import { DocumentFactory } from "../../../../api/DocumentFactory";
8
- export declare const defaultScreenData: BaseItemData;
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
- private ownerId;
11
14
  readonly subject: Subject<Screen>;
12
15
  private path;
13
16
  private borderWidth;
14
17
  backgroundColor: string;
18
+ borderColor: string;
19
+ borderStyle: BorderStyle;
15
20
  backgroundUrl: string;
16
21
  backgroundImage: HTMLImageElement | null;
17
- constructor(board: Board, id?: string, ownerId?: string);
22
+ ownerId: string;
23
+ constructor(board: Board, id?: string, defaultItemData?: BaseItemData, isGroupItem?: boolean);
18
24
  apply(op: ScreenOperation): void;
19
25
  getOwnerId(): string;
20
26
  getBackgroundColor(): string;
@@ -1,4 +1,13 @@
1
- import { Mbr, Line, Point, Transformation, Path, Paths, Item, RichText, Matrix } from "..";
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";
@@ -29,7 +38,6 @@ export declare class Frame extends BaseItem {
29
38
  readonly subject: Subject<Frame>;
30
39
  private textContainer;
31
40
  private path;
32
- private children;
33
41
  private mbr;
34
42
  readonly linkTo: LinkTo;
35
43
  readonly text: RichText;
@@ -74,8 +82,8 @@ export declare class Frame extends BaseItem {
74
82
  };
75
83
  scaleLikeLastFrame(): void;
76
84
  setLastFrameScale(): void;
77
- serialize(): FrameData;
78
- deserialize(data: Partial<FrameData>): this;
85
+ serialize(): SerializedItemData<FrameData>;
86
+ deserialize(data: SerializedItemData<FrameData> | FrameData): this;
79
87
  getSavedProportionsMatrix(): Matrix;
80
88
  private transformPath;
81
89
  apply(op: Operation): void;
@@ -44,11 +44,12 @@ export interface FrameData {
44
44
  borderOpacity: number;
45
45
  borderStyle: BorderStyle;
46
46
  borderWidth: BorderWidth;
47
- children: string[];
47
+ childIds: string[];
48
48
  transformation?: TransformationData;
49
49
  text?: RichTextData;
50
50
  canChangeRatio?: boolean;
51
51
  linkTo?: string;
52
+ [key: string]: unknown;
52
53
  }
53
54
  export declare class DefaultFrameData implements FrameData {
54
55
  shapeType: FrameType;
@@ -59,10 +60,11 @@ export declare class DefaultFrameData implements FrameData {
59
60
  borderStyle: BorderStyle;
60
61
  borderWidth: BorderWidth;
61
62
  transformation: DefaultTransformationData;
62
- children: string[];
63
+ childIds: string[];
63
64
  text: RichTextData;
64
65
  canChangeRatio: boolean;
65
66
  linkTo?: string | undefined;
66
67
  readonly itemType = "Frame";
67
- constructor(shapeType?: FrameType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, children?: string[], text?: RichTextData, canChangeRatio?: boolean, linkTo?: string | undefined);
68
+ [key: string]: unknown;
69
+ constructor(shapeType?: FrameType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, childIds?: string[], text?: RichTextData, canChangeRatio?: boolean, linkTo?: string | undefined);
68
70
  }
@@ -31,5 +31,17 @@ interface RemoveChild {
31
31
  item: string[];
32
32
  childId: string[];
33
33
  }
34
- export type FrameOperation = SetBackgroundColor | SetCanChangeRatio | SetFrameType | AddChild | RemoveChild;
34
+ interface AddChildren {
35
+ class: "Frame";
36
+ method: "addChildren";
37
+ item: string[];
38
+ childId: string[];
39
+ }
40
+ interface RemoveChildren {
41
+ class: "Frame";
42
+ method: "removeChildren";
43
+ item: string[];
44
+ childId: string[];
45
+ }
46
+ export type FrameOperation = SetBackgroundColor | SetCanChangeRatio | SetFrameType | AddChild | RemoveChild | AddChildren | RemoveChildren;
35
47
  export {};
@@ -3,7 +3,7 @@ import { Point } from "./Point";
3
3
  import { Line } from "./Line";
4
4
  import { DrawingContext } from "./DrawingContext";
5
5
  import { GeometricNormal } from "./GeometricNormal";
6
- import { RichText } from "./RichText";
6
+ import type { RichText } from "./RichText";
7
7
  /**
8
8
  * Methods that define the geometry of an item.
9
9
  */
@@ -3,16 +3,21 @@ import { DrawingContext } from "../DrawingContext";
3
3
  import { TransformationData } from "../Transformation/TransformationData";
4
4
  import { GroupOperation } from "./GroupOperation";
5
5
  import { Events, Operation } from "../../Events";
6
- import { Mbr, Line, Point, Transformation, Item } from "..";
6
+ import { Mbr } from "../Mbr/Mbr";
7
+ import { Line } from "../Line/Line";
8
+ import { Point } from "../Point/Point";
9
+ import { Transformation } from "../Transformation/Transformation";
10
+ import type { Item } from "../Item";
7
11
  import { Board } from "../../Board";
8
12
  import { LinkTo } from "../LinkTo/LinkTo";
9
- import { BaseItem } from "../BaseItem/BaseItem";
13
+ import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
10
14
  import { DocumentFactory } from "../../api/DocumentFactory";
11
15
  export interface GroupData {
12
16
  readonly itemType: "Group";
13
- children: string[];
17
+ childIds: string[];
14
18
  transformation: TransformationData;
15
19
  isLockedGroup?: boolean;
20
+ [key: string]: any;
16
21
  }
17
22
  export declare class Group extends BaseItem {
18
23
  private events?;
@@ -23,7 +28,7 @@ export declare class Group extends BaseItem {
23
28
  readonly subject: Subject<Group>;
24
29
  transformationRenderBlock?: boolean;
25
30
  isLockedGroup: boolean;
26
- constructor(board: Board, events?: Events | undefined, children?: string[], id?: string);
31
+ constructor(board: Board, events?: Events | undefined, childIds?: string[], id?: string);
27
32
  isClosed(): boolean;
28
33
  getRichText(): null;
29
34
  apply(op: Operation): void;
@@ -34,8 +39,8 @@ export declare class Group extends BaseItem {
34
39
  getChildrenIds(): string[];
35
40
  getChildren(): Item[];
36
41
  getLinkTo(): string | undefined;
37
- serialize(): GroupData;
38
- deserialize(data: GroupData): this;
42
+ serialize(): SerializedItemData<GroupData>;
43
+ deserialize(data: SerializedItemData<GroupData>): this;
39
44
  getId(): string;
40
45
  getIntersectionPoints(segment: Line): Point[];
41
46
  render(context: DrawingContext): void;
@@ -1,21 +1,23 @@
1
1
  import { Events, Operation } from "../../Events";
2
2
  import { Subject } from "../../Subject";
3
3
  import { DrawingContext } from "../DrawingContext";
4
- import { Path, Paths } from "../Path";
5
- import { Point } from "../Point";
6
- import { Transformation } from "../Transformation";
4
+ import { Path } from "../Path/Path";
5
+ import { Paths } from "../Path/Paths";
6
+ import { Point } from "../Point/Point";
7
+ import { Transformation } from "../Transformation/Transformation";
7
8
  import { TransformationData } from "../Transformation/TransformationData";
8
9
  import { Board } from "../../Board";
9
10
  import { LinkTo } from "../LinkTo/LinkTo";
10
11
  import { ImageOperation } from "./ImageOperation";
11
12
  import { DocumentFactory } from "../../api/DocumentFactory";
12
- import { BaseItem } from "../BaseItem/BaseItem";
13
+ import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
13
14
  export interface ImageItemData {
14
15
  itemType: "Image";
15
16
  storageLink: string;
16
17
  imageDimension: Dimension;
17
18
  transformation: TransformationData;
18
19
  linkTo?: string;
20
+ [key: string]: unknown;
19
21
  }
20
22
  export interface Dimension {
21
23
  height: number;
@@ -55,11 +57,11 @@ export declare class ImageItem extends BaseItem {
55
57
  doOnceOnLoad: (callback: (image: ImageItem) => void) => void;
56
58
  setId(id: string): this;
57
59
  getId(): string;
58
- serialize(): ImageItemData;
60
+ serialize(): SerializedItemData<ImageItemData>;
59
61
  private setCoordinates;
60
62
  private shootBeforeLoadCallbacks;
61
63
  private shootLoadCallbacks;
62
- deserialize(data: Partial<ImageItemData>): ImageItem;
64
+ deserialize(data: SerializedItemData<ImageItemData> | ImageItemData): this;
63
65
  emit(operation: ImageOperation): void;
64
66
  setDimensions(dim: Dimension): void;
65
67
  apply(op: Operation): void;
@@ -1,18 +1,18 @@
1
- import { AINode, AINodeData } from "./AINode";
2
- import { AudioItem, AudioItemData } from "./Audio";
3
- import { Comment, CommentData } from "./Comment";
4
- import { Connector, ConnectorData } from "./Connector";
5
- import { Drawing, DrawingData } from "./Drawing";
6
- import { Frame, FrameData } from "./Frame";
7
- import { Group, GroupData } from "./Group";
8
- import { ImageItem, ImageItemData } from "./Image";
9
- import { Placeholder, PlaceholderData } from "./Placeholder";
10
- import { RichText, RichTextData } from "./RichText";
11
- import { Shape, ShapeData } from "./Shape";
12
- import { Sticker } from "./Sticker";
13
- import { StickerData } from "./Sticker/StickerOperation";
14
- import { VideoItem, VideoItemData } from "./Video";
15
- import { BaseItem, SerializedItemData } from "./BaseItem/BaseItem";
1
+ import type { AINode, AINodeData } from "./AINode";
2
+ import type { AudioItem, AudioItemData } from "./Audio";
3
+ import type { Comment, CommentData } from "./Comment";
4
+ import type { Connector, ConnectorData } from "./Connector";
5
+ import type { Drawing, DrawingData } from "./Drawing";
6
+ import type { Frame, FrameData } from "./Frame";
7
+ import type { Group, GroupData } from "./Group";
8
+ import type { ImageItem, ImageItemData } from "./Image";
9
+ import type { Placeholder, PlaceholderData } from "./Placeholder";
10
+ import type { RichText, RichTextData } from "./RichText";
11
+ import type { Shape, ShapeData } from "./Shape";
12
+ import type { Sticker } from "./Sticker";
13
+ import type { StickerData } from "./Sticker/StickerOperation";
14
+ import type { VideoItem, VideoItemData } from "./Video";
15
+ import type { BaseItem, SerializedItemData } from "./BaseItem/BaseItem";
16
16
  export type Item = RichText | Shape | Connector | ImageItem | Drawing | Sticker | Frame | Placeholder | Comment | Group | AINode | VideoItem | AudioItem | BaseItem;
17
17
  export type ItemType = Item["itemType"];
18
18
  export type ItemData = ShapeData | RichTextData | ConnectorData | ImageItemData | DrawingData | StickerData | FrameData | PlaceholderData | CommentData | GroupData | AINodeData | VideoItemData | AudioItemData | SerializedItemData;
@@ -1,6 +1,6 @@
1
1
  import { Point } from '../Point';
2
2
  import { Mbr } from '../Mbr';
3
- import { Matrix } from '../Transformation';
3
+ import { Matrix } from "../Transformation/Matrix";
4
4
  import { GeometricNormal } from '../GeometricNormal';
5
5
  interface RelationBase {
6
6
  lineA: Line;
@@ -1,12 +1,12 @@
1
- import { Point } from "../Point";
2
- import { Line } from "../Line";
3
- import { Matrix } from "../Transformation";
1
+ import { Point } from "../Point/Point";
2
+ import { Line } from "../Line/Line";
3
+ import { Matrix } from "../Transformation/Matrix";
4
4
  import { VerticalAlignment } from "../Alignment";
5
5
  import { DrawingContext } from "../DrawingContext";
6
6
  import { Geometry } from "../Geometry";
7
7
  import { GeometricNormal } from "../GeometricNormal";
8
- import { BorderStyle } from "../Path";
9
- import { RichText } from "..";
8
+ import type { BorderStyle } from "../Path/Path";
9
+ import type { RichText } from "../RichText/RichText";
10
10
  /**
11
11
  * The minimum bounding rectangle (MBR), also known as bounding box (BBOX) or envelope.
12
12
  * https://en.wikipedia.org/wiki/Minimum_bounding_rectangle
@@ -1,8 +1,7 @@
1
1
  import { Board } from '../../Board';
2
2
  import { Camera } from '../../Camera';
3
3
  import { Mbr } from './Mbr';
4
- import { RefObject } from 'react';
5
- export declare function updateRects(board: Board, ref: RefObject<HTMLElement>, mbr?: Mbr, verticalOffset?: number, horizontalOffset?: number, fit?: 'hyperLink' | 'boardMenu' | 'contextPanel' | 'linkToBtn' | 'comment' | 'threadPanel'): Mbr | null;
4
+ export declare function updateRects(board: Board, ref: any, mbr?: Mbr, verticalOffset?: number, horizontalOffset?: number, fit?: 'hyperLink' | 'boardMenu' | 'contextPanel' | 'linkToBtn' | 'comment' | 'threadPanel'): Mbr | null;
6
5
  export declare function getContextPanelRect(selectionMbr: Mbr, camera: Camera, panel: HTMLElement, toLeft: boolean, horizontalOffset?: number, verticalOffset?: number): Mbr;
7
6
  export declare function fitContextPanelToLeft(selectionMbr: Mbr, view: Mbr, panel: Mbr, verticalOffset?: number, horizontalOffset?: number): Mbr;
8
7
  export declare function fitContextPanelToCenter(selectionMbr: Mbr, view: Mbr, panel: Mbr, verticalOffset?: number, horizontalOffset?: number): Mbr;
@@ -111,5 +111,6 @@ export declare class Path implements Geometry, PathStylize {
111
111
  getSegments(): Segment[];
112
112
  isClosed(): boolean;
113
113
  addConnectedItemType(name: string): this;
114
+ getRichText(): null;
114
115
  }
115
116
  export {};
@@ -7,6 +7,7 @@ import { BorderStyle, BorderWidth, Path, PathStylize } from './Path';
7
7
  import { Matrix } from '../Transformation';
8
8
  import { GeometricNormal } from '../GeometricNormal';
9
9
  import { DocumentFactory } from '../../api/DocumentFactory';
10
+ import { RichText } from '../RichText/RichText';
10
11
  export declare class Paths implements Geometry {
11
12
  private paths;
12
13
  private backgroundColor;
@@ -55,4 +56,5 @@ export declare class Paths implements Geometry {
55
56
  copy(): Paths;
56
57
  copyPaths(): Path[];
57
58
  isClosed(): boolean;
59
+ getRichText(): RichText | null;
58
60
  }