microboard-temp 0.14.14 → 0.14.16
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 +4862 -3698
- package/dist/cjs/index.js +4862 -3698
- package/dist/cjs/node.js +4862 -3698
- package/dist/cjs/protocol.js +25 -0
- package/dist/esm/browser.js +4862 -3698
- package/dist/esm/index.js +4862 -3698
- package/dist/esm/node.js +4862 -3698
- package/dist/esm/protocol.js +25 -0
- package/dist/types/Background/drawBackground.d.ts +1 -1
- package/dist/types/Board.d.ts +4 -3
- package/dist/types/Camera/Camera.d.ts +3 -3
- package/dist/types/Events/EventsOperations.d.ts +1 -1
- package/dist/types/Events/MessageRouter/socketContract.d.ts +1249 -9
- package/dist/types/Events/Transform/transformTransformationOperation.d.ts +2 -0
- package/dist/types/{Items → Geometry}/Geometry.d.ts +1 -1
- package/dist/types/{Items → Geometry}/Mbr/Mbr.d.ts +2 -1
- package/dist/types/{Items → Geometry}/Path/Paths.d.ts +1 -1
- package/dist/types/{Items → Geometry}/Transformation/Matrix.d.ts +16 -0
- package/dist/types/{Items → Geometry}/Transformation/TransformationData.d.ts +5 -1
- package/dist/types/{Items → Geometry}/Transformation/TransformationOperations.d.ts +27 -1
- package/dist/types/{Items → Geometry}/Transformation/transformOps.d.ts +3 -1
- package/dist/types/Geometry/index.d.ts +12 -0
- package/dist/types/HTMLAdapter/BoardHTMLAdapter.d.ts +15 -0
- package/dist/types/{parserHTML.d.ts → HTMLAdapter/Parser.d.ts} +2 -2
- package/dist/types/{Items → HTMLAdapter}/Renderers/AINodeHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/AudioHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/CommentHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/ConnectorHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/DrawingHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/FrameHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/GroupHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/HTMLItemRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/ImageHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/PlaceholderHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/RichTextHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/ShapeHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/StickerHTMLRenderer.d.ts +1 -1
- package/dist/types/{Items → HTMLAdapter}/Renderers/VideoHTMLRenderer.d.ts +1 -1
- package/dist/types/{HTMLRender/HTMLRender.d.ts → HTMLAdapter/Utils.d.ts} +1 -1
- package/dist/types/Items/AINode/AINode.d.ts +5 -20
- package/dist/types/Items/AINode/AINodeData.d.ts +4 -4
- package/dist/types/Items/Audio/Audio.d.ts +8 -5
- package/dist/types/Items/Audio/AudioHelpers.d.ts +1 -1
- package/dist/types/Items/BaseItem/BaseItem.d.ts +50 -28
- package/dist/types/Items/BaseItem/TransformContext.d.ts +3 -3
- package/dist/types/Items/BaseItem/UpdateHint.d.ts +12 -0
- package/dist/types/Items/{Examples/CardGame/Card → Card}/Card.d.ts +11 -7
- package/dist/types/Items/Card/CardActions.d.ts +2 -0
- package/dist/types/Items/{Examples/CardGame/Card → Card}/CardOperation.d.ts +2 -2
- package/dist/types/Items/Card/CardOverlay.d.ts +2 -0
- package/dist/types/Items/Comment/Comment.d.ts +10 -7
- package/dist/types/{Tools/AddComment → Items/Comment/Tool}/AddComment.d.ts +3 -3
- package/dist/types/Items/Connector/Connector.d.ts +14 -10
- package/dist/types/Items/Connector/ConnectorOperations.d.ts +2 -2
- package/dist/types/Items/Connector/ConnectorOverlay.d.ts +3 -0
- package/dist/types/Items/Connector/ConnectorSnap.d.ts +4 -4
- package/dist/types/Items/Connector/ConnectorTypes.d.ts +1 -1
- package/dist/types/Items/Connector/ControlPoint.d.ts +1 -1
- package/dist/types/Items/Connector/Pointers/Pointers.d.ts +3 -3
- package/dist/types/{Tools/AddConnector → Items/Connector/Tool}/AddConnector.d.ts +9 -9
- package/dist/types/Items/Connector/getLine/findOrthogonalPath.d.ts +1 -1
- package/dist/types/Items/Connector/getLine/getCurvedLine.d.ts +1 -1
- package/dist/types/Items/Connector/getLine/getLine.d.ts +1 -1
- package/dist/types/Items/{Examples/CardGame/Deck → Deck}/Deck.d.ts +10 -7
- package/dist/types/Items/Deck/DeckActions.d.ts +2 -0
- package/dist/types/Items/{Examples/CardGame/Deck → Deck}/DeckOperation.d.ts +2 -2
- package/dist/types/Items/Deck/DeckOverlay.d.ts +3 -0
- package/dist/types/Items/Dice/AddDice.d.ts +5 -0
- package/dist/types/Items/{Examples/CardGame/Dice → Dice}/Dice.d.ts +12 -8
- package/dist/types/Items/Dice/DiceActions.d.ts +2 -0
- package/dist/types/Items/{Examples/CardGame/Dice → Dice}/DiceOperation.d.ts +1 -1
- package/dist/types/Items/Dice/DiceOverlay.d.ts +3 -0
- package/dist/types/Items/Drawing/Drawing.d.ts +13 -9
- package/dist/types/Items/Drawing/DrawingOperation.d.ts +1 -1
- package/dist/types/Items/Drawing/DrawingOverlay.d.ts +4 -0
- package/dist/types/{Tools/AddDrawing → Items/Drawing/Tool}/AddDrawing.d.ts +7 -7
- package/dist/types/{Tools/AddDrawing → Items/Drawing/Tool}/AddHighlighter.d.ts +4 -4
- package/dist/types/{Tools → Items/Drawing/Tool}/Eraser/Eraser.d.ts +5 -5
- package/dist/types/Items/Frame/Basic/1-1/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/16-9/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/3-2/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/4-3/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/9-18/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/A4/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/Custom/index.d.ts +3 -3
- package/dist/types/Items/Frame/Basic/Letter/index.d.ts +3 -3
- package/dist/types/Items/Frame/Frame.d.ts +13 -20
- package/dist/types/Items/Frame/FrameData.d.ts +2 -2
- package/dist/types/Items/Frame/FrameOverlay.d.ts +2 -0
- package/dist/types/{Tools/AddFrame → Items/Frame/Tool}/AddFrame.d.ts +6 -6
- package/dist/types/Items/Group/Group.d.ts +9 -8
- package/dist/types/Items/Image/Image.d.ts +11 -7
- package/dist/types/Items/Item.d.ts +1 -1
- package/dist/types/Items/ItemActions.d.ts +160 -0
- package/dist/types/Items/LinkTo/LinkTo.d.ts +1 -1
- package/dist/types/Items/Placeholder/Placeholder.d.ts +11 -32
- package/dist/types/Items/RegisterItem.d.ts +8 -4
- package/dist/types/Items/RichText/Editor/BlockNode.d.ts +1 -1
- package/dist/types/Items/RichText/Editor/TextNode.d.ts +1 -1
- package/dist/types/Items/RichText/EditorContainer.d.ts +1 -1
- package/dist/types/Items/RichText/RichText.d.ts +11 -6
- package/dist/types/Items/RichText/RichTextData.d.ts +2 -2
- package/dist/types/Items/RichText/RichTextOperations.d.ts +1 -1
- package/dist/types/Items/RichText/RichTextOverlay.d.ts +3 -0
- package/dist/types/{Tools/AddText → Items/RichText/Tool}/AddText.d.ts +4 -4
- package/dist/types/Items/RichText/editorHelpers/common/createParagraphNode.d.ts +1 -1
- package/dist/types/Items/RichText/editorHelpers/common/getParagraph.d.ts +1 -1
- package/dist/types/Items/RichText/editorHelpers/selectionOps/setSelectionHorisontalAlignment.d.ts +1 -1
- package/dist/types/Items/RichText/setNodeStyles.d.ts +1 -1
- package/dist/types/Items/{Examples/CardGame/Screen → Screen}/AddScreen.d.ts +2 -2
- package/dist/types/Items/{Examples/CardGame/Screen → Screen}/Screen.d.ts +10 -6
- package/dist/types/Items/Screen/ScreenActions.d.ts +12 -0
- package/dist/types/Items/{Examples/CardGame/Screen → Screen}/ScreenOperation.d.ts +1 -1
- package/dist/types/Items/Screen/ScreenOverlay.d.ts +4 -0
- package/dist/types/Items/Shape/BPMN/BPMN_Annotation/index.d.ts +2 -2
- package/dist/types/Items/Shape/BPMN/BPMN_DataObject/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_DataStore/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_EndEvent/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_EventSubprocess/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_Gateway/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_GatewayParallel/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_GatewayXOR/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_Group/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEvent/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEventNoneInterrupting/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_Participant/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_StartEvent/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_StartEventNoneInterrupting/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_Task/index.d.ts +3 -3
- package/dist/types/Items/Shape/BPMN/BPMN_Transaction/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ArrowBlockLeft/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ArrowBlockRigth/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ArrowLeft/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ArrowLeftRight/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ArrowRight/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/BracesLeft/index.d.ts +2 -2
- package/dist/types/Items/Shape/Basic/BracesRight/index.d.ts +2 -2
- package/dist/types/Items/Shape/Basic/Circle/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Cloud/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Cross/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Cylinder/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Hexagon/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Octagon/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Parallelogram/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Pentagon/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/PredefinedProcess/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Rectangle/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ReversedParallelogram/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/ReversedTriangle/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Rhombus/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/RoundedRectangle/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/SpeachBubble/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Star/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Trapezoid/index.d.ts +3 -3
- package/dist/types/Items/Shape/Basic/Triangle/index.d.ts +3 -3
- package/dist/types/Items/Shape/Shape.d.ts +15 -11
- package/dist/types/Items/Shape/ShapeData.d.ts +2 -2
- package/dist/types/Items/Shape/ShapeOperation.d.ts +1 -1
- package/dist/types/Items/Shape/ShapeOverlay.d.ts +4 -0
- package/dist/types/{Tools/AddShape → Items/Shape/Tool}/AddShape.d.ts +6 -6
- package/dist/types/Items/Sticker/Sticker.d.ts +14 -10
- package/dist/types/Items/Sticker/StickerOperation.d.ts +1 -1
- package/dist/types/Items/Sticker/StickerOverlay.d.ts +2 -0
- package/dist/types/{Tools/AddSticker → Items/Sticker/Tool}/AddSticker.d.ts +8 -6
- package/dist/types/Items/Video/Video.d.ts +9 -6
- package/dist/types/Items/index.d.ts +13 -15
- package/dist/types/Items/itemActionsRegistry.d.ts +11 -0
- package/dist/types/Overlay/OverlayMetadata.d.ts +182 -0
- package/dist/types/Overlay/index.d.ts +2 -0
- package/dist/types/Overlay/overlayRegistry.d.ts +24 -0
- package/dist/types/Pointer/Pointer.d.ts +1 -1
- package/dist/types/Presence/Presence.d.ts +1 -1
- package/dist/types/RegistryMaps.d.ts +3 -1
- package/dist/types/Selection/ConnectorTransformer/ConnectorTransformer.d.ts +1 -1
- package/dist/types/Selection/QuickAddButtons/QuickAddButtons.d.ts +1 -1
- package/dist/types/Selection/Selection.d.ts +9 -8
- package/dist/types/Selection/SelectionTransformer.d.ts +1 -1
- package/dist/types/Selection/Transformer/Transformer.d.ts +2 -2
- package/dist/types/Selection/Transformer/TransformerHelpers/getResizeType.d.ts +2 -2
- package/dist/types/Selection/Transformer/TransformerHelpers/handleMultipleItemsResize.d.ts +31 -4
- package/dist/types/Selection/Transformer/TransformerHelpers/transformAINode.d.ts +12 -7
- package/dist/types/Selection/Transformer/TransformerHelpers/transformItems.d.ts +2 -2
- package/dist/types/Selection/Transformer/TransformerHelpers/transformRichText.d.ts +5 -3
- package/dist/types/Selection/Transformer/TransformerHelpers/transformShape.d.ts +4 -4
- package/dist/types/Selection/Transformer/TransformerHelpers/updateFrameChildren.d.ts +1 -1
- package/dist/types/SessionStorage.d.ts +1 -1
- package/dist/types/Settings.d.ts +2 -2
- package/dist/types/SpatialIndex/LayeredIndex/index.d.ts +2 -2
- package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +3 -3
- package/dist/types/SpatialIndex/SpacialIndex.d.ts +4 -3
- package/dist/types/Tools/CustomTool.d.ts +3 -3
- package/dist/types/Tools/{ExportSnapshot/ExportSnapshot.d.ts → ExportScreenshot/ExportScreenshot.d.ts} +5 -6
- package/dist/types/Tools/{ExportSnapshot/exportBoardSnapshot.d.ts → ExportScreenshot/exportBoardScreenshot.d.ts} +2 -2
- package/dist/types/Tools/NestingHighlighter/NestingHighlighter.d.ts +1 -1
- package/dist/types/Tools/RelativeAlignment/RelativeAlignment.d.ts +1 -1
- package/dist/types/Tools/Select/Select.d.ts +32 -4
- package/dist/types/Tools/Tool.d.ts +1 -1
- package/dist/types/Tools/ToolContext.d.ts +1 -1
- package/dist/types/Tools/Tools.d.ts +14 -13
- package/dist/types/Tools/index.d.ts +2 -2
- package/dist/types/Tools/initTools.d.ts +13 -0
- package/dist/types/drawMbrOnCanvas.d.ts +3 -3
- package/dist/types/index.d.ts +4 -2
- package/dist/types/itemFactories.d.ts +4 -6
- package/package.json +1 -1
- package/dist/types/HTMLRender/index.d.ts +0 -1
- package/dist/types/Items/Examples/CardGame/Dice/AddDice.d.ts +0 -5
- package/dist/types/Items/Examples/Counter/AddCounter.d.ts +0 -7
- package/dist/types/Items/Examples/Counter/Counter.d.ts +0 -25
- package/dist/types/Items/Examples/Counter/CounterOperation.d.ts +0 -9
- package/dist/types/Items/Examples/Counter/index.d.ts +0 -1
- package/dist/types/Items/Examples/Star/AddStar.d.ts +0 -7
- package/dist/types/Items/Examples/Star/Star.d.ts +0 -38
- package/dist/types/Items/Examples/Star/StarOperation.d.ts +0 -9
- package/dist/types/Items/Examples/Star/index.d.ts +0 -1
- /package/dist/types/{Items → Geometry}/Alignment.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Anchor/Anchor.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Anchor/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Arc/Arc.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Arc/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Curve/Curve.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Curve/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/DrawingContext.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/GeometricNormal.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Line/Line.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Line/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Mbr/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Path/Path.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Path/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Point/Point.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Point/Point.schema.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Point/index.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Transformation/Transformation.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Transformation/Transformation.schema.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Transformation/TransformationCommand.d.ts +0 -0
- /package/dist/types/{Items → Geometry}/Transformation/index.d.ts +0 -0
- /package/dist/types/{Items → HTMLAdapter}/Renderers/index.d.ts +0 -0
- /package/dist/types/Items/{Examples/CardGame/Card → Card}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddComment → Items/Comment/Tool}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddConnector → Items/Connector/Tool}/index.d.ts +0 -0
- /package/dist/types/Items/{Examples/CardGame/Deck → Deck}/index.d.ts +0 -0
- /package/dist/types/Items/{Examples/CardGame/Dice → Dice}/index.d.ts +0 -0
- /package/dist/types/{Tools → Items/Drawing/Tool}/Eraser/index.d.ts +0 -0
- /package/dist/types/{Tools/AddDrawing → Items/Drawing/Tool}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddFrame → Items/Frame/Tool}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddText → Items/RichText/Tool}/index.d.ts +0 -0
- /package/dist/types/Items/{Examples/CardGame/Screen → Screen}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddShape → Items/Shape/Tool}/index.d.ts +0 -0
- /package/dist/types/{Tools/AddSticker → Items/Sticker/Tool}/index.d.ts +0 -0
- /package/dist/types/Tools/{ExportSnapshot → ExportScreenshot}/getDecorationResizeType.d.ts +0 -0
|
@@ -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 type { RichText } from "
|
|
6
|
+
import type { RichText } from "../Items/RichText/RichText";
|
|
7
7
|
/**
|
|
8
8
|
* Methods that define the geometry of an item.
|
|
9
9
|
*/
|
|
@@ -6,7 +6,7 @@ import { DrawingContext } from "../DrawingContext";
|
|
|
6
6
|
import { Geometry } from "../Geometry";
|
|
7
7
|
import { GeometricNormal } from "../GeometricNormal";
|
|
8
8
|
import type { BorderStyle } from "../Path/Path";
|
|
9
|
-
import type { RichText } from "
|
|
9
|
+
import type { RichText } from "../../Items/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
|
|
@@ -21,6 +21,7 @@ export declare class Mbr implements Geometry {
|
|
|
21
21
|
strokeWidth: number;
|
|
22
22
|
borderStyle: BorderStyle;
|
|
23
23
|
static fromDomRect(rect: DOMRect): Mbr;
|
|
24
|
+
static unionOf(mbrs: Mbr[]): Mbr;
|
|
24
25
|
constructor(left?: number, top?: number, right?: number, bottom?: number, borderColor?: string | import("../../Color/ColorValue").ColorValue, backgroundColor?: string | import("../../Color/ColorValue").ColorValue, strokeWidth?: number, borderStyle?: BorderStyle);
|
|
25
26
|
getWidth(): number;
|
|
26
27
|
getHeight(): number;
|
|
@@ -6,7 +6,7 @@ import { Point } from '../Point';
|
|
|
6
6
|
import { BorderStyle, BorderWidth, Path, PathStylize } from './Path';
|
|
7
7
|
import { Matrix } from '../Transformation';
|
|
8
8
|
import { GeometricNormal } from '../GeometricNormal';
|
|
9
|
-
import { RichText } from '
|
|
9
|
+
import { RichText } from '../../Items/RichText/RichText';
|
|
10
10
|
export declare class Paths implements Geometry {
|
|
11
11
|
private paths;
|
|
12
12
|
private backgroundColor;
|
|
@@ -7,6 +7,14 @@ export declare class Matrix {
|
|
|
7
7
|
shearX: number;
|
|
8
8
|
shearY: number;
|
|
9
9
|
constructor(translateX?: number, translateY?: number, scaleX?: number, scaleY?: number, shearX?: number, shearY?: number);
|
|
10
|
+
static fromData(data: {
|
|
11
|
+
translateX: number;
|
|
12
|
+
translateY: number;
|
|
13
|
+
scaleX: number;
|
|
14
|
+
scaleY: number;
|
|
15
|
+
shearX: number;
|
|
16
|
+
shearY: number;
|
|
17
|
+
}): Matrix;
|
|
10
18
|
translate(x: number, y: number): void;
|
|
11
19
|
scale(x: number, y: number): void;
|
|
12
20
|
multiplyByMatrix(matrix: Matrix): this;
|
|
@@ -61,4 +69,12 @@ export declare class Matrix {
|
|
|
61
69
|
x: number;
|
|
62
70
|
y: number;
|
|
63
71
|
};
|
|
72
|
+
getMatrixData(): {
|
|
73
|
+
translateX: number;
|
|
74
|
+
translateY: number;
|
|
75
|
+
scaleX: number;
|
|
76
|
+
scaleY: number;
|
|
77
|
+
shearX: number;
|
|
78
|
+
shearY: number;
|
|
79
|
+
};
|
|
64
80
|
}
|
|
@@ -3,6 +3,8 @@ export interface TransformationData {
|
|
|
3
3
|
translateY: number;
|
|
4
4
|
scaleX: number;
|
|
5
5
|
scaleY: number;
|
|
6
|
+
shearX: number;
|
|
7
|
+
shearY: number;
|
|
6
8
|
rotate: number;
|
|
7
9
|
isLocked: boolean;
|
|
8
10
|
}
|
|
@@ -11,7 +13,9 @@ export declare class DefaultTransformationData implements TransformationData {
|
|
|
11
13
|
translateY: number;
|
|
12
14
|
scaleX: number;
|
|
13
15
|
scaleY: number;
|
|
16
|
+
shearX: number;
|
|
17
|
+
shearY: number;
|
|
14
18
|
rotate: number;
|
|
15
19
|
isLocked: boolean;
|
|
16
|
-
constructor(translateX?: number, translateY?: number, scaleX?: number, scaleY?: number, rotate?: number, isLocked?: boolean);
|
|
20
|
+
constructor(translateX?: number, translateY?: number, scaleX?: number, scaleY?: number, shearX?: number, shearY?: number, rotate?: number, isLocked?: boolean);
|
|
17
21
|
}
|
|
@@ -64,6 +64,7 @@ export interface ApplyMatrixItem {
|
|
|
64
64
|
id: string;
|
|
65
65
|
matrix: MatrixData;
|
|
66
66
|
}
|
|
67
|
+
/** @deprecated Use MoveOperation or SetPlacementOperation instead */
|
|
67
68
|
export interface ApplyMatrixOperation {
|
|
68
69
|
class: "Transformation";
|
|
69
70
|
method: "applyMatrix";
|
|
@@ -71,6 +72,31 @@ export interface ApplyMatrixOperation {
|
|
|
71
72
|
timeStamp?: number;
|
|
72
73
|
silent?: boolean;
|
|
73
74
|
}
|
|
75
|
+
export interface MoveItem {
|
|
76
|
+
id: string;
|
|
77
|
+
worldMatrix: MatrixData;
|
|
78
|
+
prevWorldMatrix: MatrixData;
|
|
79
|
+
}
|
|
80
|
+
export interface MoveOperation {
|
|
81
|
+
class: "Transformation";
|
|
82
|
+
method: "move";
|
|
83
|
+
items: MoveItem[];
|
|
84
|
+
timeStamp?: number;
|
|
85
|
+
}
|
|
86
|
+
export interface SetPlacementItem {
|
|
87
|
+
id: string;
|
|
88
|
+
parentId: string;
|
|
89
|
+
zOrderIndex: number;
|
|
90
|
+
worldMatrix: MatrixData;
|
|
91
|
+
prevParentId: string;
|
|
92
|
+
prevWorldMatrix: MatrixData;
|
|
93
|
+
}
|
|
94
|
+
export interface SetPlacementOperation {
|
|
95
|
+
class: "Transformation";
|
|
96
|
+
method: "setPlacement";
|
|
97
|
+
items: SetPlacementItem[];
|
|
98
|
+
timeStamp?: number;
|
|
99
|
+
}
|
|
74
100
|
export interface TransformManyItems {
|
|
75
101
|
[key: string]: ApplyMatrixOperation | ScaleByTranslateByOperation | ScaleOperation | TranslateOperation;
|
|
76
102
|
}
|
|
@@ -80,5 +106,5 @@ export interface TransformMany {
|
|
|
80
106
|
items: TransformManyItems;
|
|
81
107
|
timeStamp?: number;
|
|
82
108
|
}
|
|
83
|
-
export type TransformationOperation = ApplyMatrixOperation | RotateOperation | DeserializeOperation | TransformMany | Locked | Unlocked | TranslateOperation | ScaleOperation | ScaleByTranslateByOperation;
|
|
109
|
+
export type TransformationOperation = ApplyMatrixOperation | MoveOperation | SetPlacementOperation | RotateOperation | DeserializeOperation | TransformMany | Locked | Unlocked | TranslateOperation | ScaleOperation | ScaleByTranslateByOperation;
|
|
84
110
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MatrixData, TransformationOperation } from "./TransformationOperations";
|
|
1
|
+
import { MatrixData, TransformationOperation, MoveOperation, SetPlacementOperation } from "./TransformationOperations";
|
|
2
2
|
interface ItemLike {
|
|
3
3
|
getId(): string;
|
|
4
4
|
transformation: {
|
|
@@ -31,5 +31,7 @@ export declare const transformOps: {
|
|
|
31
31
|
}, timeStamp?: number): TransformationOperation;
|
|
32
32
|
setLocal(item: ItemOrId, data: Partial<MatrixData>): TransformationOperation;
|
|
33
33
|
lock(items: readonly ItemOrId[] | ItemOrId, locked: boolean): TransformationOperation;
|
|
34
|
+
move(items: MoveOperation["items"], timeStamp?: number): TransformationOperation;
|
|
35
|
+
setPlacement(items: SetPlacementOperation["items"], timeStamp?: number): TransformationOperation;
|
|
34
36
|
};
|
|
35
37
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Point } from "./Point";
|
|
2
|
+
export { Line } from "./Line";
|
|
3
|
+
export { CubicBezier, QuadraticBezier } from "./Curve";
|
|
4
|
+
export { Arc } from "./Arc";
|
|
5
|
+
export { Mbr } from "./Mbr";
|
|
6
|
+
export { Anchor } from "./Anchor";
|
|
7
|
+
export { DrawingContext } from "./DrawingContext";
|
|
8
|
+
export * from "./Path";
|
|
9
|
+
export * from "./Transformation";
|
|
10
|
+
export * from "./Geometry";
|
|
11
|
+
export * from "./GeometricNormal";
|
|
12
|
+
export * from "./Alignment";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Board } from "../Board";
|
|
2
|
+
import { BaseItemData } from "../Items/BaseItem/BaseItem";
|
|
3
|
+
import { ItemDataWithId } from "../Items/Item";
|
|
4
|
+
export declare function parseHTML(el: HTMLElement): ItemDataWithId | {
|
|
5
|
+
data: BaseItemData & {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
childrenMap: {
|
|
9
|
+
[id: string]: ItemDataWithId;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function serializeBoardToHTML(board: Board): string;
|
|
13
|
+
/** @returns ids of added items */
|
|
14
|
+
export declare function deserializeHTMLAndEmitToBoard(board: Board, stringedHTML: string): string[];
|
|
15
|
+
export declare function deserializeHTMLToBoard(board: Board, stringedHTML: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ItemType, ItemDataWithId } from "
|
|
2
|
-
import { BaseItemData } from "
|
|
1
|
+
import { ItemType, ItemDataWithId } from "../Items/Item";
|
|
2
|
+
import { BaseItemData } from "../Items/BaseItem/BaseItem";
|
|
3
3
|
type MapTagByType = Partial<Record<ItemType, string>>;
|
|
4
4
|
export declare const tagByType: MapTagByType;
|
|
5
5
|
type TagFactories = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class AINodeHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class AudioHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class CommentHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class ConnectorHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class DrawingHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class FrameHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class GroupHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
export interface IItemHTMLRenderer {
|
|
4
4
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class ImageHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class PlaceholderHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class RichTextHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class ShapeHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare class StickerHTMLRenderer implements IItemHTMLRenderer {
|
|
5
5
|
render(item: BaseItem, documentFactory: DocumentFactory): HTMLElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../../api/DocumentFactory";
|
|
2
|
-
import { BaseItem } from "
|
|
2
|
+
import { BaseItem } from "../../Items/BaseItem/BaseItem";
|
|
3
3
|
import { IItemHTMLRenderer } from "./HTMLItemRenderer";
|
|
4
4
|
export declare const createPlaceholderImage: (documentFactory: DocumentFactory, width: number, height: number) => HTMLImageElement;
|
|
5
5
|
export declare class VideoHTMLRenderer implements IItemHTMLRenderer {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentFactory } from "../api/DocumentFactory";
|
|
2
|
-
import { Path, Paths } from "../
|
|
2
|
+
import { Path, Paths } from "../Geometry/Path";
|
|
3
3
|
import { LinkTo } from "../Items/LinkTo/LinkTo";
|
|
4
4
|
export declare function getTranslationFromHTML(el: HTMLElement): [number, number];
|
|
5
5
|
export declare function getScaleFromHTML(el: HTMLElement): [number, number];
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Board } from "../../Board";
|
|
2
2
|
import { Operation } from "../../Events/EventsOperations";
|
|
3
3
|
import { AINodeData } from "./AINodeData";
|
|
4
|
-
import { DrawingContext } from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Paths } from "../Path/Paths";
|
|
10
|
-
import { Point } from "../Point/Point";
|
|
4
|
+
import { DrawingContext } from "../../Geometry/DrawingContext";
|
|
5
|
+
import { Mbr } from "../../Geometry/Mbr/Mbr";
|
|
6
|
+
import { Path } from "../../Geometry/Path/Path";
|
|
7
|
+
import { Paths } from "../../Geometry/Path/Paths";
|
|
8
|
+
import { Point } from "../../Geometry/Point/Point";
|
|
11
9
|
import { RichText } from "../RichText/RichText";
|
|
12
10
|
import { Subject } from "../../Subject";
|
|
13
11
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
@@ -45,19 +43,6 @@ export declare class AINode extends BaseItem<AINode> {
|
|
|
45
43
|
isClosed(): boolean;
|
|
46
44
|
getPath(): Path | Paths;
|
|
47
45
|
apply(op: Operation): void;
|
|
48
|
-
getSnapAnchorPoints(): Point[];
|
|
49
|
-
getButtonMbr(): Mbr;
|
|
50
|
-
getDistanceToPoint(point: Point): number;
|
|
51
|
-
getIntersectionPoints(segment: Line): Point[];
|
|
52
|
-
getMbr(): Mbr;
|
|
53
|
-
getNearestEdgePointTo(point: Point): Point;
|
|
54
|
-
getNormal(point: Point): GeometricNormal;
|
|
55
|
-
isEnclosedBy(rect: Mbr): boolean;
|
|
56
|
-
isEnclosedOrCrossedBy(rect: Mbr): boolean;
|
|
57
|
-
isInView(rect: Mbr): boolean;
|
|
58
|
-
isNearPoint(point: Point, distance: number): boolean;
|
|
59
|
-
isUnderPoint(point: Point, tolerance?: number): boolean;
|
|
60
|
-
getRichText(): RichText;
|
|
61
46
|
getLinkTo(): string | undefined;
|
|
62
47
|
renderButton(context: DrawingContext): void;
|
|
63
48
|
render(context: DrawingContext): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TransformationData } from '
|
|
1
|
+
import { TransformationData } from '../../Geometry/Transformation/TransformationData';
|
|
2
2
|
import { RichTextData } from '../RichText/RichTextData';
|
|
3
3
|
import { ThreadDirection } from '../AINode/AINode';
|
|
4
|
-
import { Mbr } from '
|
|
5
|
-
import { Path } from '
|
|
6
|
-
import { Matrix } from '
|
|
4
|
+
import { Mbr } from '../../Geometry/Mbr/Mbr';
|
|
5
|
+
import { Path } from '../../Geometry/Path/Path';
|
|
6
|
+
import { Matrix } from '../../Geometry/Transformation/Matrix';
|
|
7
7
|
export interface AINodeData {
|
|
8
8
|
readonly itemType: 'AINode';
|
|
9
9
|
transformation: TransformationData;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Operation } from "../../Events";
|
|
2
2
|
import { Subject } from "../../Subject";
|
|
3
|
-
import { DrawingContext } from "
|
|
4
|
-
import { TransformationData } from "
|
|
3
|
+
import { DrawingContext } from "../../Geometry/DrawingContext";
|
|
4
|
+
import { TransformationData } from "../../Geometry/Transformation/TransformationData";
|
|
5
5
|
import { Board } from "../../Board";
|
|
6
|
-
import { Path } from "
|
|
7
|
-
import { Point } from "
|
|
6
|
+
import { Path } from "../../Geometry/Path/Path";
|
|
7
|
+
import { Point } from "../../Geometry/Point/Point";
|
|
8
8
|
import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
|
|
9
|
+
import { UpdateHint } from "../BaseItem/UpdateHint";
|
|
9
10
|
export interface AudioItemData {
|
|
10
11
|
itemType: "Audio";
|
|
11
12
|
url: string;
|
|
@@ -39,7 +40,9 @@ export declare class AudioItem extends BaseItem<AudioItem> {
|
|
|
39
40
|
render(context: DrawingContext): void;
|
|
40
41
|
serialize(): SerializedItemData<AudioItemData>;
|
|
41
42
|
deserialize(data: SerializedItemData<AudioItemData> | AudioItemData): this;
|
|
42
|
-
apply(
|
|
43
|
+
apply(opIn: Operation): void;
|
|
44
|
+
protected updateVisuals(_op: Operation, hint: UpdateHint): void;
|
|
45
|
+
protected getPropertyUpdateHint(property: string): UpdateHint;
|
|
43
46
|
emit(operation: Operation): void;
|
|
44
47
|
setId(id: string): this;
|
|
45
48
|
getId(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Board } from '../../Board';
|
|
2
2
|
import { AudioItem } from '../Audio/Audio';
|
|
3
|
-
import { Matrix } from '
|
|
3
|
+
import { Matrix } from '../../Geometry/Transformation/Matrix';
|
|
4
4
|
export declare const prepareAudio: (file: File, boardId: string, baseUrl?: string) => Promise<string>;
|
|
5
5
|
export declare const calculateAudioPosition: (board: Board, audioItem: AudioItem) => Matrix;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { Mbr } from "
|
|
2
|
-
import { Line } from "
|
|
1
|
+
import { Mbr } from "../../Geometry/Mbr/Mbr";
|
|
2
|
+
import { Line } from "../../Geometry/Line/Line";
|
|
3
3
|
import { Item } from "../Item";
|
|
4
|
-
import { Geometry } from "
|
|
4
|
+
import { Geometry } from "../../Geometry/Geometry";
|
|
5
5
|
import type { RichText } from "../RichText/RichText";
|
|
6
6
|
import { LinkTo } from "../LinkTo/LinkTo";
|
|
7
|
-
import { Transformation } from "
|
|
7
|
+
import { Transformation } from "../../Geometry/Transformation/Transformation";
|
|
8
8
|
import { Board } from "../../Board";
|
|
9
|
-
import { DrawingContext } from "
|
|
9
|
+
import { DrawingContext } from "../../Geometry/DrawingContext";
|
|
10
10
|
import { BaseOperation, Operation } from "../../Events/EventsOperations";
|
|
11
11
|
import { Command } from "../../Events/Command";
|
|
12
|
-
import { TransformationData } from "
|
|
12
|
+
import { TransformationData } from "../../Geometry/Transformation/TransformationData";
|
|
13
13
|
import { Subject } from "../../Subject";
|
|
14
|
-
import { Path, Paths } from "
|
|
14
|
+
import { Path, Paths } from "../../Geometry/Path/index";
|
|
15
15
|
import { BaseItemOperation } from "./BaseItemOperation";
|
|
16
16
|
import { SimpleSpatialIndex } from "../../SpatialIndex/SimpleSpatialIndex";
|
|
17
|
-
import { Point } from "
|
|
18
|
-
import { Matrix } from "
|
|
17
|
+
import { Point } from "../../Geometry/Point";
|
|
18
|
+
import { Matrix } from "../../Geometry/Transformation/Matrix";
|
|
19
|
+
import { MoveItem, SetPlacementItem } from "../../Geometry/Transformation/TransformationOperations";
|
|
19
20
|
import { TransformParams, TransformResult } from "./TransformContext";
|
|
20
|
-
import { GeometricNormal } from "
|
|
21
|
+
import { GeometricNormal } from "../../Geometry/GeometricNormal";
|
|
21
22
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
22
23
|
import type { ItemType } from "../Item";
|
|
24
|
+
import type { ItemOverlayDefinition } from "../../Overlay";
|
|
25
|
+
import { UpdateHint } from "./UpdateHint";
|
|
23
26
|
export interface BaseItemData {
|
|
24
27
|
itemType: string;
|
|
25
28
|
transformation?: TransformationData;
|
|
26
29
|
linkTo?: string;
|
|
27
30
|
childIds?: string[];
|
|
31
|
+
parent?: string;
|
|
28
32
|
[key: string]: unknown;
|
|
29
33
|
}
|
|
30
34
|
export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
@@ -34,14 +38,14 @@ export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
|
|
|
34
38
|
export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry {
|
|
35
39
|
static createCommand?: (board: Board, operation: Operation) => Command;
|
|
36
40
|
protected mbr: Mbr;
|
|
37
|
-
|
|
38
|
-
linkTo: LinkTo;
|
|
41
|
+
id: string;
|
|
42
|
+
readonly linkTo: LinkTo;
|
|
43
|
+
readonly transformation: Transformation;
|
|
39
44
|
parent: string;
|
|
40
45
|
canBeNested: boolean;
|
|
41
46
|
transformationRenderBlock?: boolean;
|
|
42
47
|
index: SimpleSpatialIndex | null;
|
|
43
48
|
board: Board;
|
|
44
|
-
id: string;
|
|
45
49
|
subject: Subject<T>;
|
|
46
50
|
onRemoveCallbacks: (() => void)[];
|
|
47
51
|
shouldUseCustomRender: boolean;
|
|
@@ -66,28 +70,39 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
66
70
|
*/
|
|
67
71
|
protected onParentChanged(_newParent: string): void;
|
|
68
72
|
getId(): string;
|
|
73
|
+
getOverlay(): ItemOverlayDefinition | undefined;
|
|
69
74
|
/**
|
|
70
|
-
*
|
|
71
|
-
* is returned to ensure children are not affected by frame scaling.
|
|
75
|
+
* Updates the local axis-aligned bounding box.
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
updateMbr(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Returns whether this item should scale its children when it is resized.
|
|
80
|
+
* Frames/Decks/Screens are typically non-scaling containers.
|
|
81
|
+
*/
|
|
82
|
+
getIsScalingContainer(): boolean;
|
|
74
83
|
/**
|
|
75
|
-
* Returns the
|
|
76
|
-
*
|
|
77
|
-
* own transformation matrix. For nested items it is parentTransform × localMatrix.
|
|
78
|
-
* Note: Frames act as non-scaling containers.
|
|
84
|
+
* Returns the world matrix for this item by composing its local matrix with its parent's
|
|
85
|
+
* nesting matrix recursively. Calculates on-the-fly to ensure it is always up-to-date.
|
|
79
86
|
*/
|
|
80
87
|
getWorldMatrix(): Matrix;
|
|
81
88
|
/**
|
|
82
|
-
* Returns the matrix used for nesting children. For
|
|
83
|
-
*
|
|
89
|
+
* Returns the matrix used for nesting children. For non-scaling containers,
|
|
90
|
+
* this is only the translation portion of the world matrix.
|
|
84
91
|
*/
|
|
85
92
|
getNestingMatrix(): Matrix;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the parent's nesting matrix. If at top-level, returns an identity matrix.
|
|
95
|
+
*/
|
|
96
|
+
getParentWorldMatrix(): Matrix;
|
|
86
97
|
setId(id: string): this;
|
|
87
98
|
getChildrenIds(): string[] | null;
|
|
99
|
+
/** @deprecated Use transformOps.setPlacement instead */
|
|
88
100
|
addChildItems(children: BaseItem[]): void;
|
|
101
|
+
/** @deprecated Use transformOps.setPlacement instead */
|
|
89
102
|
removeChildItems(children: BaseItem[] | BaseItem): void;
|
|
90
103
|
rotate(degree: number): void;
|
|
104
|
+
applySetPlacement(op: SetPlacementItem): void;
|
|
105
|
+
applyMove(op: MoveItem): void;
|
|
91
106
|
emitNesting(children: BaseItem[]): void;
|
|
92
107
|
handleNesting(item: BaseItem | Mbr, options?: {
|
|
93
108
|
onlyForOut?: boolean;
|
|
@@ -101,9 +116,9 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
101
116
|
getCenter(): Point;
|
|
102
117
|
/**
|
|
103
118
|
* Returns the world-space axis-aligned bounding box.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
119
|
+
* Since this.mbr always represents bounds in parent-space (with the item's local
|
|
120
|
+
* transformation already baked in), we only need to transform it through its
|
|
121
|
+
* parent's world matrix. Calculates on-the-fly to ensure it is always fresh.
|
|
107
122
|
*/
|
|
108
123
|
getWorldMbr(): Mbr;
|
|
109
124
|
getIntersectionPoints(segment: Line): Point[];
|
|
@@ -111,9 +126,10 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
111
126
|
isInView(rect: Mbr): boolean;
|
|
112
127
|
getNormal(point: Point): GeometricNormal;
|
|
113
128
|
private hasAncestor;
|
|
129
|
+
/** @deprecated Use applySetPlacement instead */
|
|
114
130
|
applyAddChildren(childIds: string[]): void;
|
|
131
|
+
/** @deprecated Use applySetPlacement instead */
|
|
115
132
|
applyRemoveChildren(childIds: string[]): void;
|
|
116
|
-
updateMbr(): void;
|
|
117
133
|
getLinkTo(): string | undefined;
|
|
118
134
|
getRichText(): RichText | null;
|
|
119
135
|
deserialize(data: SerializedItemData | BaseItemData): this;
|
|
@@ -123,7 +139,7 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
123
139
|
emitForManyItems(operation: Operation | BaseOperation): void;
|
|
124
140
|
disableResize(items: BaseItem[]): void;
|
|
125
141
|
enableResize(items: BaseItem[]): void;
|
|
126
|
-
apply(
|
|
142
|
+
apply(opIn: Operation | BaseItemOperation | BaseOperation): void;
|
|
127
143
|
protected onPropertyUpdated(property: string, value: any, prevValue: any): void;
|
|
128
144
|
addOnRemoveCallback(cb: () => void): void;
|
|
129
145
|
onRemove(): void;
|
|
@@ -140,7 +156,6 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
140
156
|
clearHighlightMbr(): void;
|
|
141
157
|
renderHoverHighlight(context: DrawingContext): void;
|
|
142
158
|
render(context: DrawingContext): void;
|
|
143
|
-
getIsScalingContainer(): boolean;
|
|
144
159
|
getSnapAnchorPoints(): Point[];
|
|
145
160
|
getPointOnEdge(point: Point, _edge?: string): Point;
|
|
146
161
|
handleTransform(params: TransformParams): TransformResult;
|
|
@@ -149,6 +164,13 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
|
|
|
149
164
|
shouldFollowItems(): boolean;
|
|
150
165
|
isAlignmentSource(): boolean;
|
|
151
166
|
isReady(): boolean;
|
|
167
|
+
protected calculateUpdateHint(op: Operation): UpdateHint;
|
|
168
|
+
/**
|
|
169
|
+
* Determines the update requirement for a specific property change.
|
|
170
|
+
* Concrete items should override this to provide hints for their own properties.
|
|
171
|
+
*/
|
|
172
|
+
protected getPropertyUpdateHint(property: string): UpdateHint;
|
|
173
|
+
protected updateVisuals(_op: Operation, _hint: UpdateHint): void;
|
|
152
174
|
onSelectEnd(_topItem?: Item): void;
|
|
153
175
|
canBeInteractedWithWhileLocked(_isAiGenerating: boolean): boolean;
|
|
154
176
|
}
|
|
@@ -2,13 +2,13 @@ import { Board } from "../../Board";
|
|
|
2
2
|
import { Mbr, Point } from "../../Items";
|
|
3
3
|
import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
|
|
4
4
|
import { Comment } from "../Comment/Comment";
|
|
5
|
-
import {
|
|
5
|
+
import { MoveItem } from "../../Geometry/Transformation/TransformationOperations";
|
|
6
6
|
/** Minimal interface for BoardSelection to avoid circular dependencies */
|
|
7
7
|
export interface ISelection {
|
|
8
8
|
items: {
|
|
9
9
|
list(): any[];
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
moveMany(items: MoveItem[], timeStamp: number): void;
|
|
12
12
|
shouldRenderItemsMbr: boolean;
|
|
13
13
|
}
|
|
14
14
|
/** Minimal interface for tools used during transformation */
|
|
@@ -35,6 +35,6 @@ export type TransformParams = {
|
|
|
35
35
|
};
|
|
36
36
|
export type TransformResult = {
|
|
37
37
|
resizedMbr: Mbr | null;
|
|
38
|
-
translation?:
|
|
38
|
+
translation?: MoveItem[] | null;
|
|
39
39
|
onPointerUpCb?: () => void;
|
|
40
40
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum UpdateHint {
|
|
2
|
+
/** Only position changed. No geometry or layout recalculation needed. */
|
|
3
|
+
TranslateOnly = "TranslateOnly",
|
|
4
|
+
/** Size, rotation, or shear changed. Geometery (paths, vectors) must be recalculated, but text layout can often be skipped. */
|
|
5
|
+
TransformGeometry = "TransformGeometry",
|
|
6
|
+
/** Only non-geometric styling properties (colors, opacity) changed. */
|
|
7
|
+
VisualOnly = "VisualOnly",
|
|
8
|
+
/** Structural change affecting text flow, wrapping, or container bounds. Full layout recalculation needed. */
|
|
9
|
+
LayoutAffecting = "LayoutAffecting",
|
|
10
|
+
/** Everything changed or fallback for unknown operations. Recalculate all state. */
|
|
11
|
+
FullRebuild = "FullRebuild"
|
|
12
|
+
}
|