telva 1.1.1 → 1.1.3

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 (143) hide show
  1. package/README.md +25 -270
  2. package/dist/Telva.d.ts +3 -3
  3. package/dist/components/CenterToolbar/CenterToolbar.d.ts.map +1 -1
  4. package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
  5. package/dist/components/Primitives/DropdownMenu/DMCheckboxItem.d.ts +1 -1
  6. package/dist/components/Primitives/DropdownMenu/DMItem.d.ts +1 -1
  7. package/dist/components/Primitives/DropdownMenu/DMRadioItem.d.ts +1 -1
  8. package/dist/components/Primitives/DropdownMenu/DMTriggerIcon.d.ts +1 -1
  9. package/dist/components/Primitives/Panel/Panel.d.ts +1 -1
  10. package/dist/components/Primitives/RowButton/RowButton.d.ts +1 -1
  11. package/dist/components/Primitives/TextField/TextField.d.ts +1 -1
  12. package/dist/components/Primitives/ToolButton/ToolButton.d.ts +2 -2
  13. package/dist/components/RightPanel/PropertiesPanel.d.ts.map +1 -1
  14. package/dist/components/ToolsPanel/PrimaryTools.d.ts.map +1 -1
  15. package/dist/components/ToolsPanel/ShapesMenu.d.ts +1 -1
  16. package/dist/components/TopPanel/Menu/Menu.d.ts.map +1 -1
  17. package/dist/components/TopPanel/PageMenu/PageMenu.d.ts +1 -1
  18. package/dist/components/TopPanel/PageOptionsDialog/PageOptionsDialog.d.ts +1 -1
  19. package/dist/constants.d.ts +1 -1
  20. package/dist/hooks/useFileSystem.d.ts +1 -1
  21. package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -1
  22. package/dist/hooks/useTelvaApp.d.ts +1 -1
  23. package/dist/hooks/useTheme.d.ts +1 -1
  24. package/dist/hooks/useTranslation.d.ts +2 -2
  25. package/dist/hooks/useTranslation.d.ts.map +1 -1
  26. package/dist/index.js +10 -10
  27. package/dist/index.js.map +3 -3
  28. package/dist/index.mjs +30283 -18
  29. package/dist/index.mjs.map +3 -3
  30. package/dist/state/StateManager/StateManager.d.ts +1 -1
  31. package/dist/state/TVDR.d.ts +1 -1
  32. package/dist/state/TelvaApp.d.ts +8 -8
  33. package/dist/state/TelvaApp.d.ts.map +1 -1
  34. package/dist/state/commands/alignShapes/alignShapes.d.ts +2 -2
  35. package/dist/state/commands/changePage/changePage.d.ts +2 -2
  36. package/dist/state/commands/createPage/createPage.d.ts +2 -2
  37. package/dist/state/commands/createShapes/createShapes.d.ts +2 -2
  38. package/dist/state/commands/deletePage/deletePage.d.ts +2 -2
  39. package/dist/state/commands/deleteShapes/deleteShapes.d.ts +2 -2
  40. package/dist/state/commands/distributeShapes/distributeShapes.d.ts +2 -2
  41. package/dist/state/commands/duplicatePage/duplicatePage.d.ts +2 -2
  42. package/dist/state/commands/duplicateShapes/duplicateShapes.d.ts +2 -2
  43. package/dist/state/commands/flipShapes/flipShapes.d.ts +3 -3
  44. package/dist/state/commands/groupShapes/groupShapes.d.ts +2 -2
  45. package/dist/state/commands/insertContent/insertContent.d.ts +2 -2
  46. package/dist/state/commands/movePage/movePage.d.ts +2 -2
  47. package/dist/state/commands/moveShapesToPage/moveShapesToPage.d.ts +2 -2
  48. package/dist/state/commands/renamePage/renamePage.d.ts +2 -2
  49. package/dist/state/commands/reorderShapes/reorderShapes.d.ts +2 -2
  50. package/dist/state/commands/resetBounds/resetBounds.d.ts +2 -2
  51. package/dist/state/commands/rotateShapes/rotateShapes.d.ts +2 -2
  52. package/dist/state/commands/setShapesProps/setShapesProps.d.ts +2 -2
  53. package/dist/state/commands/shared/removeShapesFromPage.d.ts +1 -1
  54. package/dist/state/commands/stretchShapes/stretchShapes.d.ts +3 -3
  55. package/dist/state/commands/styleShapes/styleShapes.d.ts +2 -2
  56. package/dist/state/commands/toggleShapesDecoration/toggleShapesDecoration.d.ts +2 -2
  57. package/dist/state/commands/toggleShapesProp/toggleShapesProp.d.ts +2 -2
  58. package/dist/state/commands/translateShapes/translateShapes.d.ts +2 -2
  59. package/dist/state/commands/ungroupShapes/ungroupShapes.d.ts +3 -3
  60. package/dist/state/commands/updateShapes/updateShapes.d.ts +2 -2
  61. package/dist/state/data/filesystem.d.ts +1 -1
  62. package/dist/state/data/filesystem.d.ts.map +1 -1
  63. package/dist/state/data/migrate.d.ts +1 -1
  64. package/dist/state/data/migrate.d.ts.map +1 -1
  65. package/dist/state/sessions/ArrowSession/ArrowSession.d.ts +3 -3
  66. package/dist/state/sessions/BaseSession.d.ts +2 -2
  67. package/dist/state/sessions/BrushSession/BrushSession.d.ts +3 -3
  68. package/dist/state/sessions/DrawSession/DrawSession.d.ts +3 -3
  69. package/dist/state/sessions/EditSession/EditSession.d.ts +3 -3
  70. package/dist/state/sessions/EraseSession/EraseSession.d.ts +4 -4
  71. package/dist/state/sessions/GridSession/GridSession.d.ts +3 -3
  72. package/dist/state/sessions/HandleSession/HandleSession.d.ts +3 -3
  73. package/dist/state/sessions/RotateSession/RotateSession.d.ts +3 -3
  74. package/dist/state/sessions/TransformSession/TransformSession.d.ts +3 -3
  75. package/dist/state/sessions/TransformSingleSession/TransformSingleSession.d.ts +3 -3
  76. package/dist/state/sessions/TranslateLabelSession/TranslateLabelSession.d.ts +3 -3
  77. package/dist/state/sessions/TranslateSession/TranslateSession.d.ts +3 -3
  78. package/dist/state/sessions/index.d.ts +1 -1
  79. package/dist/state/shapes/ArrowUtil/ArrowUtil.d.ts +3 -3
  80. package/dist/state/shapes/ArrowUtil/ArrowUtil.d.ts.map +1 -1
  81. package/dist/state/shapes/ArrowUtil/arrowHelpers.d.ts +1 -1
  82. package/dist/state/shapes/ArrowUtil/components/CurvedArrow.tsx.d.ts +1 -1
  83. package/dist/state/shapes/ArrowUtil/components/StraightArrow.d.ts +1 -1
  84. package/dist/state/shapes/DrawUtil/DrawUtil.d.ts +3 -3
  85. package/dist/state/shapes/DrawUtil/DrawUtil.d.ts.map +1 -1
  86. package/dist/state/shapes/DrawUtil/drawHelpers.d.ts +1 -1
  87. package/dist/state/shapes/EllipseUtil/EllipseUtil.d.ts +3 -3
  88. package/dist/state/shapes/EllipseUtil/EllipseUtil.d.ts.map +1 -1
  89. package/dist/state/shapes/EllipseUtil/components/DashedEllipse.d.ts +1 -1
  90. package/dist/state/shapes/EllipseUtil/components/DrawEllipse.d.ts +1 -1
  91. package/dist/state/shapes/EllipseUtil/ellipseHelpers.d.ts +1 -1
  92. package/dist/state/shapes/GroupUtil/GroupUtil.d.ts +5 -5
  93. package/dist/state/shapes/GroupUtil/GroupUtil.d.ts.map +1 -1
  94. package/dist/state/shapes/ImageUtil/ImageUtil.d.ts +6 -6
  95. package/dist/state/shapes/ImageUtil/ImageUtil.d.ts.map +1 -1
  96. package/dist/state/shapes/PenUtil/PenUtil.d.ts +3 -3
  97. package/dist/state/shapes/PenUtil/PenUtil.d.ts.map +1 -1
  98. package/dist/state/shapes/PenUtil/penHelpers.d.ts +9 -6
  99. package/dist/state/shapes/PenUtil/penHelpers.d.ts.map +1 -1
  100. package/dist/state/shapes/ReactComponentUtil/ReactComponentUtil.d.ts +6 -6
  101. package/dist/state/shapes/ReactComponentUtil/ReactComponentUtil.d.ts.map +1 -1
  102. package/dist/state/shapes/RectangleUtil/RectangleUtil.d.ts +6 -6
  103. package/dist/state/shapes/RectangleUtil/RectangleUtil.d.ts.map +1 -1
  104. package/dist/state/shapes/RectangleUtil/components/DashedRectangle.d.ts +1 -1
  105. package/dist/state/shapes/RectangleUtil/components/DrawRectangle.d.ts +1 -1
  106. package/dist/state/shapes/RectangleUtil/rectangleHelpers.d.ts +1 -1
  107. package/dist/state/shapes/StickyUtil/StickyUtil.d.ts +3 -3
  108. package/dist/state/shapes/StickyUtil/StickyUtil.d.ts.map +1 -1
  109. package/dist/state/shapes/TVShapeUtil.d.ts +1 -1
  110. package/dist/state/shapes/TextUtil/TextUtil.d.ts +9 -9
  111. package/dist/state/shapes/TextUtil/TextUtil.d.ts.map +1 -1
  112. package/dist/state/shapes/TriangleUtil/TriangleUtil.d.ts +4 -4
  113. package/dist/state/shapes/TriangleUtil/TriangleUtil.d.ts.map +1 -1
  114. package/dist/state/shapes/TriangleUtil/components/DashedTriangle.d.ts +1 -1
  115. package/dist/state/shapes/TriangleUtil/components/DrawTriangle.d.ts +1 -1
  116. package/dist/state/shapes/TriangleUtil/triangleHelpers.d.ts +1 -1
  117. package/dist/state/shapes/VideoUtil/VideoUtil.d.ts +6 -6
  118. package/dist/state/shapes/VideoUtil/VideoUtil.d.ts.map +1 -1
  119. package/dist/state/shapes/index.d.ts +2 -2
  120. package/dist/state/shapes/shared/TextLabel.d.ts +1 -1
  121. package/dist/state/shapes/shared/TextLabel.d.ts.map +1 -1
  122. package/dist/state/shapes/shared/getTextAlign.d.ts +2 -2
  123. package/dist/state/shapes/shared/getTextSvgElement.d.ts +1 -1
  124. package/dist/state/shapes/shared/gradient-fill.d.ts +1 -1
  125. package/dist/state/shapes/shared/shape-styles.d.ts +1 -1
  126. package/dist/state/tools/ArrowTool/ArrowTool.d.ts +2 -2
  127. package/dist/state/tools/BaseTool.d.ts +2 -2
  128. package/dist/state/tools/DrawTool/DrawTool.d.ts +2 -2
  129. package/dist/state/tools/EllipseTool/EllipseTool.d.ts +2 -2
  130. package/dist/state/tools/EraseTool/EraseTool.d.ts +1 -1
  131. package/dist/state/tools/LineTool/LineTool.d.ts +2 -2
  132. package/dist/state/tools/PenEditTool.d.ts +3 -2
  133. package/dist/state/tools/PenEditTool.d.ts.map +1 -1
  134. package/dist/state/tools/PenTool/PenTool.d.ts +4 -3
  135. package/dist/state/tools/PenTool/PenTool.d.ts.map +1 -1
  136. package/dist/state/tools/RectangleTool/RectangleTool.d.ts +2 -2
  137. package/dist/state/tools/SelectTool/SelectTool.d.ts +56 -56
  138. package/dist/state/tools/StickyTool/StickyTool.d.ts +2 -2
  139. package/dist/state/tools/TextTool/TextTool.d.ts +2 -2
  140. package/dist/state/tools/TriangleTool/TriangleTool.d.ts +2 -2
  141. package/dist/state/tools/index.d.ts +1 -1
  142. package/dist/types.d.ts +1 -1
  143. package/package.json +5 -4
@@ -1,3 +1,3 @@
1
- import { AlignStyle } from '../../../types';
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,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ShapeStyles } from '../../../types';
2
+ import type { ShapeStyles } from '~types';
3
3
  /**
4
4
  * Returns SVG <defs> element for a gradient defined in style.gradient,
5
5
  * and an SVG fill string to reference it.
@@ -1,4 +1,4 @@
1
- import { ColorStyle, FontStyle, ShapeStyles, SizeStyle, Theme } from '../../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 '../TelvaApp';
3
- import { TVEventHandler, TVToolType } from '../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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,5 +1,5 @@
1
1
  import type { TLPointerEventHandler } from 'telva-core';
2
- import { BaseTool } from '../BaseTool';
2
+ import { BaseTool } from '~state/tools/BaseTool';
3
3
  declare enum Status {
4
4
  Idle = "idle",
5
5
  Pointing = "pointing",
@@ -1,6 +1,6 @@
1
1
  import { TLPointerEventHandler } from 'telva-core';
2
- import { BaseTool } from '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 './BaseTool';
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: "penEdit";
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;AAGhD,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,YAAqB;IAEzB,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,CAQnC;IAED,WAAW,EAAE,qBAAqB,CAIjC;IAED,SAAS,EAAE,sBAAsB,CAQhC;CACF"}
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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,aAGN;IAED,MAAM,aAKL;IAED,QAAQ,aAOP;IAGD,OAAO,CAAC,QAAQ;IAKhB,OAAO,KAAK,eAAe,GAE1B;IAGD,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,wBAAwB;IAuBhC,OAAO,CAAC,aAAa;IAuBrB,0DAA0D;IAC1D,OAAO,CAAC,OAAO;IAMf,uEAAuE;IACvE,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,WAAW;IA0BnB,aAAa,EAAE,qBAAqB,CAsCnC;IAED,aAAa,EAAE,qBAAqB,CAwBnC;IAED,WAAW,EAAE,qBAAqB,CAIjC;IAED,mBAAmB,EAAE,oBAAoB,CAmBxC;IAED,SAAS,EAAE,sBAAsB,CAchC;CACF"}
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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("../../../types").ShapeStyles;
44
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
45
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
65
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
66
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
86
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
87
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
105
+ style: import("~types").ShapeStyles;
106
106
  label?: string | undefined;
107
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
108
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").TVHandle;
127
- bend: import("../../../types").TVHandle;
128
- end: import("../../../types").TVHandle;
126
+ start: import("~types").TVHandle;
127
+ bend: import("~types").TVHandle;
128
+ end: import("~types").TVHandle;
129
129
  };
130
130
  decorations?: {
131
- start?: import("../../../types").Decoration | undefined;
132
- end?: import("../../../types").Decoration | undefined;
133
- middle?: import("../../../types").Decoration | undefined;
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("../../../types").ShapeStyles;
138
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
156
+ style: import("~types").ShapeStyles;
157
157
  label?: string | undefined;
158
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
159
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
177
+ style: import("~types").ShapeStyles;
178
178
  label?: string | undefined;
179
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
180
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
197
+ style: import("~types").ShapeStyles;
198
198
  label?: string | undefined;
199
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
200
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
218
+ style: import("~types").ShapeStyles;
219
219
  label?: string | undefined;
220
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
221
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
240
+ style: import("~types").ShapeStyles;
241
241
  label?: string | undefined;
242
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
243
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").ShapeStyles;
260
+ style: import("~types").ShapeStyles;
261
261
  label?: string | undefined;
262
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
263
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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("../../../types").PenSegment[];
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("../../../types").ShapeStyles;
284
+ style: import("~types").ShapeStyles;
285
285
  label?: string | undefined;
286
- handles?: Record<string, import("../../../types").TVHandle> | undefined;
287
- effects?: Record<string, any> | import("../../../types").TVEffect[] | undefined;
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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 '../BaseTool';
3
- import { TVShapeType } from '../../../types';
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;
@@ -1,4 +1,4 @@
1
- import { TVShapeType, TVToolType } from '../../types';
1
+ import { TVShapeType, TVToolType } from '~types';
2
2
  import { ArrowTool } from './ArrowTool';
3
3
  import { DrawTool } from './DrawTool';
4
4
  import { EllipseTool } from './EllipseTool';
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 './translations';
2
+ import { TVLanguage } from '~translations';
3
3
  export declare class TVEventHandler {
4
4
  onPinchStart?: TLPinchEventHandler;
5
5
  onPinchEnd?: TLPinchEventHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telva",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "A little drawing app (editor)",
5
5
  "author": "@vmaspad",
6
6
  "repository": {
@@ -50,17 +50,18 @@
50
50
  "@radix-ui/react-popover": "^1.0.0",
51
51
  "@radix-ui/react-tooltip": "^1.0.0",
52
52
  "@stitches/react": "^1.2.8",
53
- "telva-core": "^1.1.0",
54
- "telva-intersect": "^1.1.0",
55
- "telva-vec": "^1.1.0",
56
53
  "atlas-fonts": "^1.2.1",
57
54
  "browser-fs-access": "^0.31.0",
58
55
  "html2canvas": "^1.4.1",
56
+ "html2canvas-pro": "^2.0.2",
59
57
  "idb-keyval": "^6.2.0",
60
58
  "perfect-freehand": "^1.2.0",
61
59
  "react-error-boundary": "^3.1.4",
62
60
  "react-hotkeys-hook": "^3.4.7",
63
61
  "react-intl": "^6.1.1",
62
+ "telva-core": "^1.1.0",
63
+ "telva-intersect": "^1.1.0",
64
+ "telva-vec": "^1.1.0",
64
65
  "tslib": "^2.4.0",
65
66
  "zustand": "^4.1.1"
66
67
  },