telva 1.1.0 → 1.1.2
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/README.md +25 -270
- package/dist/Telva.d.ts +3 -3
- package/dist/Telva.d.ts.map +1 -1
- package/dist/components/CenterToolbar/CenterToolbar.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/Primitives/DropdownMenu/DMCheckboxItem.d.ts +1 -1
- package/dist/components/Primitives/DropdownMenu/DMItem.d.ts +1 -1
- package/dist/components/Primitives/DropdownMenu/DMRadioItem.d.ts +1 -1
- package/dist/components/Primitives/DropdownMenu/DMTriggerIcon.d.ts +1 -1
- package/dist/components/Primitives/Panel/Panel.d.ts +1 -1
- package/dist/components/Primitives/RowButton/RowButton.d.ts +1 -1
- package/dist/components/Primitives/TextField/TextField.d.ts +1 -1
- package/dist/components/Primitives/ToolButton/ToolButton.d.ts +2 -2
- package/dist/components/RightPanel/PropertiesPanel.d.ts.map +1 -1
- package/dist/components/ToolsPanel/PrimaryTools.d.ts.map +1 -1
- package/dist/components/ToolsPanel/ShapesMenu.d.ts +1 -1
- package/dist/components/TopPanel/Menu/Menu.d.ts.map +1 -1
- package/dist/components/TopPanel/PageMenu/PageMenu.d.ts +1 -1
- package/dist/components/TopPanel/PageOptionsDialog/PageOptionsDialog.d.ts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/hooks/useFileSystem.d.ts +1 -1
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/dist/hooks/useTelvaApp.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTranslation.d.ts +2 -2
- package/dist/hooks/useTranslation.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +30283 -18
- package/dist/index.mjs.map +3 -3
- package/dist/state/StateManager/StateManager.d.ts +1 -1
- package/dist/state/TVDR.d.ts +1 -1
- package/dist/state/TelvaApp.d.ts +8 -8
- package/dist/state/TelvaApp.d.ts.map +1 -1
- package/dist/state/commands/alignShapes/alignShapes.d.ts +2 -2
- package/dist/state/commands/changePage/changePage.d.ts +2 -2
- package/dist/state/commands/createPage/createPage.d.ts +2 -2
- package/dist/state/commands/createShapes/createShapes.d.ts +2 -2
- package/dist/state/commands/deletePage/deletePage.d.ts +2 -2
- package/dist/state/commands/deleteShapes/deleteShapes.d.ts +2 -2
- package/dist/state/commands/distributeShapes/distributeShapes.d.ts +2 -2
- package/dist/state/commands/duplicatePage/duplicatePage.d.ts +2 -2
- package/dist/state/commands/duplicateShapes/duplicateShapes.d.ts +2 -2
- package/dist/state/commands/flipShapes/flipShapes.d.ts +3 -3
- package/dist/state/commands/groupShapes/groupShapes.d.ts +2 -2
- package/dist/state/commands/insertContent/insertContent.d.ts +2 -2
- package/dist/state/commands/movePage/movePage.d.ts +2 -2
- package/dist/state/commands/moveShapesToPage/moveShapesToPage.d.ts +2 -2
- package/dist/state/commands/renamePage/renamePage.d.ts +2 -2
- package/dist/state/commands/reorderShapes/reorderShapes.d.ts +2 -2
- package/dist/state/commands/resetBounds/resetBounds.d.ts +2 -2
- package/dist/state/commands/rotateShapes/rotateShapes.d.ts +2 -2
- package/dist/state/commands/setShapesProps/setShapesProps.d.ts +2 -2
- package/dist/state/commands/shared/removeShapesFromPage.d.ts +1 -1
- package/dist/state/commands/stretchShapes/stretchShapes.d.ts +3 -3
- package/dist/state/commands/styleShapes/styleShapes.d.ts +2 -2
- package/dist/state/commands/toggleShapesDecoration/toggleShapesDecoration.d.ts +2 -2
- package/dist/state/commands/toggleShapesProp/toggleShapesProp.d.ts +2 -2
- package/dist/state/commands/translateShapes/translateShapes.d.ts +2 -2
- package/dist/state/commands/ungroupShapes/ungroupShapes.d.ts +3 -3
- package/dist/state/commands/updateShapes/updateShapes.d.ts +2 -2
- package/dist/state/data/filesystem.d.ts +1 -1
- package/dist/state/data/filesystem.d.ts.map +1 -1
- package/dist/state/data/migrate.d.ts +1 -1
- package/dist/state/data/migrate.d.ts.map +1 -1
- package/dist/state/sessions/ArrowSession/ArrowSession.d.ts +3 -3
- package/dist/state/sessions/BaseSession.d.ts +2 -2
- package/dist/state/sessions/BrushSession/BrushSession.d.ts +3 -3
- package/dist/state/sessions/DrawSession/DrawSession.d.ts +3 -3
- package/dist/state/sessions/EditSession/EditSession.d.ts +3 -3
- package/dist/state/sessions/EraseSession/EraseSession.d.ts +4 -4
- package/dist/state/sessions/GridSession/GridSession.d.ts +3 -3
- package/dist/state/sessions/HandleSession/HandleSession.d.ts +3 -3
- package/dist/state/sessions/RotateSession/RotateSession.d.ts +3 -3
- package/dist/state/sessions/TransformSession/TransformSession.d.ts +3 -3
- package/dist/state/sessions/TransformSingleSession/TransformSingleSession.d.ts +3 -3
- package/dist/state/sessions/TranslateLabelSession/TranslateLabelSession.d.ts +3 -3
- package/dist/state/sessions/TranslateSession/TranslateSession.d.ts +3 -3
- package/dist/state/sessions/index.d.ts +1 -1
- package/dist/state/shapes/ArrowUtil/ArrowUtil.d.ts +3 -3
- package/dist/state/shapes/ArrowUtil/ArrowUtil.d.ts.map +1 -1
- package/dist/state/shapes/ArrowUtil/arrowHelpers.d.ts +1 -1
- package/dist/state/shapes/ArrowUtil/components/CurvedArrow.tsx.d.ts +1 -1
- package/dist/state/shapes/ArrowUtil/components/StraightArrow.d.ts +1 -1
- package/dist/state/shapes/DrawUtil/DrawUtil.d.ts +3 -3
- package/dist/state/shapes/DrawUtil/DrawUtil.d.ts.map +1 -1
- package/dist/state/shapes/DrawUtil/drawHelpers.d.ts +1 -1
- package/dist/state/shapes/EllipseUtil/EllipseUtil.d.ts +3 -3
- package/dist/state/shapes/EllipseUtil/EllipseUtil.d.ts.map +1 -1
- package/dist/state/shapes/EllipseUtil/components/DashedEllipse.d.ts +1 -1
- package/dist/state/shapes/EllipseUtil/components/DrawEllipse.d.ts +1 -1
- package/dist/state/shapes/EllipseUtil/ellipseHelpers.d.ts +1 -1
- package/dist/state/shapes/GroupUtil/GroupUtil.d.ts +5 -5
- package/dist/state/shapes/GroupUtil/GroupUtil.d.ts.map +1 -1
- package/dist/state/shapes/ImageUtil/ImageUtil.d.ts +6 -6
- package/dist/state/shapes/ImageUtil/ImageUtil.d.ts.map +1 -1
- package/dist/state/shapes/PenUtil/PenUtil.d.ts +3 -3
- package/dist/state/shapes/PenUtil/PenUtil.d.ts.map +1 -1
- package/dist/state/shapes/PenUtil/penHelpers.d.ts +9 -6
- package/dist/state/shapes/PenUtil/penHelpers.d.ts.map +1 -1
- package/dist/state/shapes/ReactComponentUtil/ReactComponentUtil.d.ts +6 -6
- package/dist/state/shapes/ReactComponentUtil/ReactComponentUtil.d.ts.map +1 -1
- package/dist/state/shapes/RectangleUtil/RectangleUtil.d.ts +6 -6
- package/dist/state/shapes/RectangleUtil/RectangleUtil.d.ts.map +1 -1
- package/dist/state/shapes/RectangleUtil/components/DashedRectangle.d.ts +1 -1
- package/dist/state/shapes/RectangleUtil/components/DrawRectangle.d.ts +1 -1
- package/dist/state/shapes/RectangleUtil/rectangleHelpers.d.ts +1 -1
- package/dist/state/shapes/StickyUtil/StickyUtil.d.ts +3 -3
- package/dist/state/shapes/StickyUtil/StickyUtil.d.ts.map +1 -1
- package/dist/state/shapes/TVShapeUtil.d.ts +1 -1
- package/dist/state/shapes/TextUtil/TextUtil.d.ts +9 -9
- package/dist/state/shapes/TextUtil/TextUtil.d.ts.map +1 -1
- package/dist/state/shapes/TriangleUtil/TriangleUtil.d.ts +4 -4
- package/dist/state/shapes/TriangleUtil/TriangleUtil.d.ts.map +1 -1
- package/dist/state/shapes/TriangleUtil/components/DashedTriangle.d.ts +1 -1
- package/dist/state/shapes/TriangleUtil/components/DrawTriangle.d.ts +1 -1
- package/dist/state/shapes/TriangleUtil/triangleHelpers.d.ts +1 -1
- package/dist/state/shapes/VideoUtil/VideoUtil.d.ts +6 -6
- package/dist/state/shapes/VideoUtil/VideoUtil.d.ts.map +1 -1
- package/dist/state/shapes/index.d.ts +2 -2
- package/dist/state/shapes/shared/TextLabel.d.ts +1 -1
- package/dist/state/shapes/shared/TextLabel.d.ts.map +1 -1
- package/dist/state/shapes/shared/getTextAlign.d.ts +2 -2
- package/dist/state/shapes/shared/getTextSvgElement.d.ts +1 -1
- package/dist/state/shapes/shared/gradient-fill.d.ts +1 -1
- package/dist/state/shapes/shared/shape-styles.d.ts +1 -1
- package/dist/state/tools/ArrowTool/ArrowTool.d.ts +2 -2
- package/dist/state/tools/BaseTool.d.ts +2 -2
- package/dist/state/tools/DrawTool/DrawTool.d.ts +2 -2
- package/dist/state/tools/EllipseTool/EllipseTool.d.ts +2 -2
- package/dist/state/tools/EraseTool/EraseTool.d.ts +1 -1
- package/dist/state/tools/LineTool/LineTool.d.ts +2 -2
- package/dist/state/tools/PenEditTool.d.ts +3 -2
- package/dist/state/tools/PenEditTool.d.ts.map +1 -1
- package/dist/state/tools/PenTool/PenTool.d.ts +4 -3
- package/dist/state/tools/PenTool/PenTool.d.ts.map +1 -1
- package/dist/state/tools/RectangleTool/RectangleTool.d.ts +2 -2
- package/dist/state/tools/SelectTool/SelectTool.d.ts +56 -56
- package/dist/state/tools/StickyTool/StickyTool.d.ts +2 -2
- package/dist/state/tools/TextTool/TextTool.d.ts +2 -2
- package/dist/state/tools/TriangleTool/TriangleTool.d.ts +2 -2
- package/dist/state/tools/index.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AlignStyle } from '
|
|
1
|
+
import { AlignStyle } from '~types';
|
|
2
2
|
export declare function getTextSvgElement(text: string, fontSize: number, fontFamily: string, textAlign: AlignStyle, width: number, wrap?: boolean): SVGTextElement;
|
|
3
3
|
//# sourceMappingURL=getTextSvgElement.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorStyle, FontStyle, ShapeStyles, SizeStyle, Theme } from '
|
|
1
|
+
import { ColorStyle, FontStyle, ShapeStyles, SizeStyle, Theme } from '~types';
|
|
2
2
|
export declare const stickyFills: Record<Theme, Record<ColorStyle, string>>;
|
|
3
3
|
export declare const strokes: Record<Theme, Record<ColorStyle, string>>;
|
|
4
4
|
export declare const fills: Record<Theme, Record<ColorStyle, string>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class ArrowTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Arrow;
|
|
6
6
|
onPointerDown: TLPointerEventHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLKeyboardEventHandler, TLPinchEventHandler, TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import type { TelvaApp } from '
|
|
3
|
-
import { TVEventHandler, TVToolType } from '
|
|
2
|
+
import type { TelvaApp } from '~state/TelvaApp';
|
|
3
|
+
import { TVEventHandler, TVToolType } from '~types';
|
|
4
4
|
export declare enum Status {
|
|
5
5
|
Idle = "idle",
|
|
6
6
|
Creating = "creating",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class DrawTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Draw;
|
|
6
6
|
private lastShapeId?;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class EllipseTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Ellipse;
|
|
6
6
|
onPointerDown: TLPointerEventHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class LineTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Line;
|
|
6
6
|
onPointerDown: TLPointerEventHandler;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TLBoundsCorner, TLBoundsEdge, TLKeyboardEventHandler, TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
3
4
|
declare enum Status {
|
|
4
5
|
Idle = "idle",
|
|
5
6
|
Creating = "creating",
|
|
@@ -19,7 +20,7 @@ declare enum Status {
|
|
|
19
20
|
ClonePainting = "clonePainting"
|
|
20
21
|
}
|
|
21
22
|
export declare class PenEditTool extends BaseTool<Status> {
|
|
22
|
-
type:
|
|
23
|
+
type: TVShapeType.Pen;
|
|
23
24
|
pointedId?: string;
|
|
24
25
|
selectedGroupId?: string;
|
|
25
26
|
pointedHandleId?: 'start' | 'end' | 'bend';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PenEditTool.d.ts","sourceRoot":"","sources":["../../../src/state/tools/PenEditTool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EAIZ,sBAAsB,EACtB,qBAAqB,EAGtB,MAAM,YAAY,CAAA;AAKnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"PenEditTool.d.ts","sourceRoot":"","sources":["../../../src/state/tools/PenEditTool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EAIZ,sBAAsB,EACtB,qBAAqB,EAGtB,MAAM,YAAY,CAAA;AAKnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAA0B,WAAW,EAAE,MAAM,QAAQ,CAAA;AAE5D,aAAK,MAAM;IACT,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAChC;AAED,qBAAa,WAAY,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAC/C,IAAI,kBAA2B;IAE/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;IAE1C,mBAAmB,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAE5F,mBAAmB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IAIjD,OAAO,aAEN;IAED,MAAM,aAEL;IAID,QAAQ,aAMP;IAED,aAAa,EAAE,qBAAqB,CAInC;IAED,aAAa,EAAE,qBAAqB,CAInC;IAED,WAAW,EAAE,qBAAqB,CAIjC;IAED,SAAS,EAAE,sBAAsB,CAQhC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLCanvasEventHandler, TLKeyboardEventHandler, TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
declare enum Status {
|
|
5
5
|
Idle = "idle",
|
|
6
6
|
Drawing = "drawing",
|
|
@@ -16,10 +16,11 @@ export declare class PenTool extends BaseTool<Status> {
|
|
|
16
16
|
onCancel: () => void;
|
|
17
17
|
private getShape;
|
|
18
18
|
private get currentSegments();
|
|
19
|
+
private patchCurrentShape;
|
|
20
|
+
private setPreview;
|
|
19
21
|
private startNewShape;
|
|
20
22
|
private addSegment;
|
|
21
23
|
private updateLastSegmentHandles;
|
|
22
|
-
private commitHandles;
|
|
23
24
|
/** Convert page coordinates to shape-local coordinates */
|
|
24
25
|
private toLocal;
|
|
25
26
|
/** Detect if a page point is near the first segment (to close path) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PenTool.d.ts","sourceRoot":"","sources":["../../../../src/state/tools/PenTool/PenTool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EAEtB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAwB,WAAW,EAAE,MAAM,QAAQ,CAAA;AAE1D,aAAK,MAAM;IACT,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,aAAa,YAAY;CAC1B;AAID,qBAAa,OAAQ,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAC3C,IAAI,kBAA2B;IAE/B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,iBAAiB,SAAI;IAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"PenTool.d.ts","sourceRoot":"","sources":["../../../../src/state/tools/PenTool/PenTool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EAEtB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAwB,WAAW,EAAE,MAAM,QAAQ,CAAA;AAE1D,aAAK,MAAM;IACT,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,aAAa,YAAY;CAC1B;AAID,qBAAa,OAAQ,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAC3C,IAAI,kBAA2B;IAE/B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,iBAAiB,SAAI;IAErB,OAAO,aAKN;IAED,MAAM,aAOL;IAED,QAAQ,aASP;IAGD,OAAO,CAAC,QAAQ;IAKhB,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,wBAAwB;IAehC,0DAA0D;IAC1D,OAAO,CAAC,OAAO;IAMf,uEAAuE;IACvE,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,WAAW;IA6BnB,aAAa,EAAE,qBAAqB,CA0CnC;IAED,aAAa,EAAE,qBAAqB,CAoCnC;IAED,WAAW,EAAE,qBAAqB,CAQjC;IAED,mBAAmB,EAAE,oBAAoB,CAYxC;IAED,SAAS,EAAE,sBAAsB,CAchC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class RectangleTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Rectangle;
|
|
6
6
|
onPointerDown: TLPointerEventHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLBoundsCorner, TLBoundsEdge, TLBoundsEventHandler, TLBoundsHandleEventHandler, TLCanvasEventHandler, TLKeyboardEventHandler, TLPointerEventHandler, TLShapeCloneHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
declare enum Status {
|
|
5
5
|
Idle = "idle",
|
|
6
6
|
Creating = "creating",
|
|
@@ -35,14 +35,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
35
35
|
clonePaint: (point: number[]) => void;
|
|
36
36
|
getShapeClone: (id: string, side: 'top' | 'right' | 'bottom' | 'left' | 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft') => {
|
|
37
37
|
id: string;
|
|
38
|
-
point: number[];
|
|
38
|
+
point: any[] | number[];
|
|
39
39
|
type: TVShapeType.Rectangle;
|
|
40
40
|
size: number[];
|
|
41
41
|
label?: string | undefined;
|
|
42
42
|
labelPoint?: number[] | undefined;
|
|
43
|
-
style: import("
|
|
44
|
-
handles?: Record<string, import("
|
|
45
|
-
effects?: Record<string, any> | import("
|
|
43
|
+
style: import("~types").ShapeStyles;
|
|
44
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
45
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
46
46
|
parentId: string;
|
|
47
47
|
childIndex: number;
|
|
48
48
|
name: string;
|
|
@@ -56,14 +56,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
56
56
|
isAspectRatioLocked?: boolean | undefined;
|
|
57
57
|
} | {
|
|
58
58
|
id: string;
|
|
59
|
-
point: number[];
|
|
59
|
+
point: any[] | number[];
|
|
60
60
|
type: TVShapeType.Ellipse;
|
|
61
61
|
radius: number[];
|
|
62
62
|
label?: string | undefined;
|
|
63
63
|
labelPoint?: number[] | undefined;
|
|
64
|
-
style: import("
|
|
65
|
-
handles?: Record<string, import("
|
|
66
|
-
effects?: Record<string, any> | import("
|
|
64
|
+
style: import("~types").ShapeStyles;
|
|
65
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
66
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
67
67
|
parentId: string;
|
|
68
68
|
childIndex: number;
|
|
69
69
|
name: string;
|
|
@@ -77,14 +77,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
77
77
|
isAspectRatioLocked?: boolean | undefined;
|
|
78
78
|
} | {
|
|
79
79
|
id: string;
|
|
80
|
-
point: number[];
|
|
80
|
+
point: any[] | number[];
|
|
81
81
|
type: TVShapeType.Triangle;
|
|
82
82
|
size: number[];
|
|
83
83
|
label?: string | undefined;
|
|
84
84
|
labelPoint?: number[] | undefined;
|
|
85
|
-
style: import("
|
|
86
|
-
handles?: Record<string, import("
|
|
87
|
-
effects?: Record<string, any> | import("
|
|
85
|
+
style: import("~types").ShapeStyles;
|
|
86
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
87
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
88
88
|
parentId: string;
|
|
89
89
|
childIndex: number;
|
|
90
90
|
name: string;
|
|
@@ -98,14 +98,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
98
98
|
isAspectRatioLocked?: boolean | undefined;
|
|
99
99
|
} | {
|
|
100
100
|
id: string;
|
|
101
|
-
point: number[];
|
|
101
|
+
point: any[] | number[];
|
|
102
102
|
type: TVShapeType.Draw;
|
|
103
103
|
points: number[][];
|
|
104
104
|
isComplete: boolean;
|
|
105
|
-
style: import("
|
|
105
|
+
style: import("~types").ShapeStyles;
|
|
106
106
|
label?: string | undefined;
|
|
107
|
-
handles?: Record<string, import("
|
|
108
|
-
effects?: Record<string, any> | import("
|
|
107
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
108
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
109
109
|
parentId: string;
|
|
110
110
|
childIndex: number;
|
|
111
111
|
name: string;
|
|
@@ -119,23 +119,23 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
119
119
|
isAspectRatioLocked?: boolean | undefined;
|
|
120
120
|
} | {
|
|
121
121
|
id: string;
|
|
122
|
-
point: number[];
|
|
122
|
+
point: any[] | number[];
|
|
123
123
|
type: TVShapeType.Arrow;
|
|
124
124
|
bend: number;
|
|
125
125
|
handles: {
|
|
126
|
-
start: import("
|
|
127
|
-
bend: import("
|
|
128
|
-
end: import("
|
|
126
|
+
start: import("~types").TVHandle;
|
|
127
|
+
bend: import("~types").TVHandle;
|
|
128
|
+
end: import("~types").TVHandle;
|
|
129
129
|
};
|
|
130
130
|
decorations?: {
|
|
131
|
-
start?: import("
|
|
132
|
-
end?: import("
|
|
133
|
-
middle?: import("
|
|
131
|
+
start?: import("~types").Decoration | undefined;
|
|
132
|
+
end?: import("~types").Decoration | undefined;
|
|
133
|
+
middle?: import("~types").Decoration | undefined;
|
|
134
134
|
} | undefined;
|
|
135
135
|
label?: string | undefined;
|
|
136
136
|
labelPoint?: number[] | undefined;
|
|
137
|
-
style: import("
|
|
138
|
-
effects?: Record<string, any> | import("
|
|
137
|
+
style: import("~types").ShapeStyles;
|
|
138
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
139
139
|
parentId: string;
|
|
140
140
|
childIndex: number;
|
|
141
141
|
name: string;
|
|
@@ -149,14 +149,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
149
149
|
isAspectRatioLocked?: boolean | undefined;
|
|
150
150
|
} | {
|
|
151
151
|
id: string;
|
|
152
|
-
point: number[];
|
|
152
|
+
point: any[] | number[];
|
|
153
153
|
type: TVShapeType.Text;
|
|
154
154
|
text: string;
|
|
155
155
|
size?: number[] | undefined;
|
|
156
|
-
style: import("
|
|
156
|
+
style: import("~types").ShapeStyles;
|
|
157
157
|
label?: string | undefined;
|
|
158
|
-
handles?: Record<string, import("
|
|
159
|
-
effects?: Record<string, any> | import("
|
|
158
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
159
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
160
160
|
parentId: string;
|
|
161
161
|
childIndex: number;
|
|
162
162
|
name: string;
|
|
@@ -170,14 +170,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
170
170
|
isAspectRatioLocked?: boolean | undefined;
|
|
171
171
|
} | {
|
|
172
172
|
id: string;
|
|
173
|
-
point: number[];
|
|
173
|
+
point: any[] | number[];
|
|
174
174
|
type: TVShapeType.Group;
|
|
175
175
|
size: number[];
|
|
176
176
|
children: string[];
|
|
177
|
-
style: import("
|
|
177
|
+
style: import("~types").ShapeStyles;
|
|
178
178
|
label?: string | undefined;
|
|
179
|
-
handles?: Record<string, import("
|
|
180
|
-
effects?: Record<string, any> | import("
|
|
179
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
180
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
181
181
|
parentId: string;
|
|
182
182
|
childIndex: number;
|
|
183
183
|
name: string;
|
|
@@ -190,14 +190,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
190
190
|
isAspectRatioLocked?: boolean | undefined;
|
|
191
191
|
} | {
|
|
192
192
|
id: string;
|
|
193
|
-
point: number[];
|
|
193
|
+
point: any[] | number[];
|
|
194
194
|
type: TVShapeType.Sticky;
|
|
195
195
|
size: number[];
|
|
196
196
|
text: string;
|
|
197
|
-
style: import("
|
|
197
|
+
style: import("~types").ShapeStyles;
|
|
198
198
|
label?: string | undefined;
|
|
199
|
-
handles?: Record<string, import("
|
|
200
|
-
effects?: Record<string, any> | import("
|
|
199
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
200
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
201
201
|
parentId: string;
|
|
202
202
|
childIndex: number;
|
|
203
203
|
name: string;
|
|
@@ -211,14 +211,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
211
211
|
isAspectRatioLocked?: boolean | undefined;
|
|
212
212
|
} | {
|
|
213
213
|
id: string;
|
|
214
|
-
point: number[];
|
|
214
|
+
point: any[] | number[];
|
|
215
215
|
type: TVShapeType.Image;
|
|
216
216
|
size: number[];
|
|
217
217
|
assetId: string;
|
|
218
|
-
style: import("
|
|
218
|
+
style: import("~types").ShapeStyles;
|
|
219
219
|
label?: string | undefined;
|
|
220
|
-
handles?: Record<string, import("
|
|
221
|
-
effects?: Record<string, any> | import("
|
|
220
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
221
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
222
222
|
parentId: string;
|
|
223
223
|
childIndex: number;
|
|
224
224
|
name: string;
|
|
@@ -231,16 +231,16 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
231
231
|
isAspectRatioLocked?: boolean | undefined;
|
|
232
232
|
} | {
|
|
233
233
|
id: string;
|
|
234
|
-
point: number[];
|
|
234
|
+
point: any[] | number[];
|
|
235
235
|
type: TVShapeType.Video;
|
|
236
236
|
size: number[];
|
|
237
237
|
assetId: string;
|
|
238
238
|
isPlaying: boolean;
|
|
239
239
|
currentTime: number;
|
|
240
|
-
style: import("
|
|
240
|
+
style: import("~types").ShapeStyles;
|
|
241
241
|
label?: string | undefined;
|
|
242
|
-
handles?: Record<string, import("
|
|
243
|
-
effects?: Record<string, any> | import("
|
|
242
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
243
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
244
244
|
parentId: string;
|
|
245
245
|
childIndex: number;
|
|
246
246
|
name: string;
|
|
@@ -253,14 +253,14 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
253
253
|
isAspectRatioLocked?: boolean | undefined;
|
|
254
254
|
} | {
|
|
255
255
|
id: string;
|
|
256
|
-
point: number[];
|
|
256
|
+
point: any[] | number[];
|
|
257
257
|
type: TVShapeType.ReactComponent;
|
|
258
258
|
size: number[];
|
|
259
259
|
componentId: string;
|
|
260
|
-
style: import("
|
|
260
|
+
style: import("~types").ShapeStyles;
|
|
261
261
|
label?: string | undefined;
|
|
262
|
-
handles?: Record<string, import("
|
|
263
|
-
effects?: Record<string, any> | import("
|
|
262
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
263
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
264
264
|
parentId: string;
|
|
265
265
|
childIndex: number;
|
|
266
266
|
name: string;
|
|
@@ -274,17 +274,17 @@ export declare class SelectTool extends BaseTool<Status> {
|
|
|
274
274
|
isAspectRatioLocked?: boolean | undefined;
|
|
275
275
|
} | {
|
|
276
276
|
id: string;
|
|
277
|
-
point: number[];
|
|
277
|
+
point: any[] | number[];
|
|
278
278
|
type: TVShapeType.Pen;
|
|
279
|
-
segments: import("
|
|
279
|
+
segments: import("~types").PenSegment[];
|
|
280
280
|
isClosed: boolean;
|
|
281
281
|
isComplete: boolean;
|
|
282
282
|
previewPoint?: number[] | undefined;
|
|
283
283
|
isPlacingHandle?: boolean | undefined;
|
|
284
|
-
style: import("
|
|
284
|
+
style: import("~types").ShapeStyles;
|
|
285
285
|
label?: string | undefined;
|
|
286
|
-
handles?: Record<string, import("
|
|
287
|
-
effects?: Record<string, any> | import("
|
|
286
|
+
handles?: Record<string, import("~types").TVHandle> | undefined;
|
|
287
|
+
effects?: Record<string, any> | import("~types").TVEffect[] | undefined;
|
|
288
288
|
parentId: string;
|
|
289
289
|
childIndex: number;
|
|
290
290
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class StickyTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Sticky;
|
|
6
6
|
shapeId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TLKeyboardEventHandler, TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class TextTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Text;
|
|
6
6
|
stopEditingShape: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TLPointerEventHandler } from 'telva-core';
|
|
2
|
-
import { BaseTool } from '
|
|
3
|
-
import { TVShapeType } from '
|
|
2
|
+
import { BaseTool } from '~state/tools/BaseTool';
|
|
3
|
+
import { TVShapeType } from '~types';
|
|
4
4
|
export declare class TriangleTool extends BaseTool {
|
|
5
5
|
type: TVShapeType.Triangle;
|
|
6
6
|
onPointerDown: TLPointerEventHandler;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TLAsset, TLBinding, TLBoundsCorner, TLBoundsEdge, TLBoundsEventHandler, TLBoundsHandleEventHandler, TLCanvasEventHandler, TLHandle, TLKeyboardEventHandler, TLPage, TLPageState, TLPinchEventHandler, TLPointerEventHandler, TLShape, TLShapeBlurHandler, TLShapeCloneHandler, TLSnapLine, TLUser, TLWheelEventHandler } from 'telva-core';
|
|
2
|
-
import { TVLanguage } from '
|
|
2
|
+
import { TVLanguage } from '~translations';
|
|
3
3
|
export declare class TVEventHandler {
|
|
4
4
|
onPinchStart?: TLPinchEventHandler;
|
|
5
5
|
onPinchEnd?: TLPinchEventHandler;
|