@plait/draw 0.38.0 → 0.40.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/draw",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.0.0",
6
6
  "@angular/core": "^16.0.0",
@@ -1,7 +1,7 @@
1
1
  import { PlaitBoard } from '@plait/core';
2
2
  import { PlaitLine } from '../interfaces';
3
+ export declare const WithLineAutoCompletePluginKey = "plait-line-auto-complete-plugin-key";
3
4
  export interface LineAutoCompleteOptions {
4
5
  afterComplete: (element: PlaitLine) => {};
5
6
  }
6
- export declare const withLineAutoCompletePluginKey = "plait-line-auto-complete-plugin-key";
7
7
  export declare const withLineAutoComplete: (board: PlaitBoard) => PlaitBoard;
@@ -0,0 +1,2 @@
1
+ import { PlaitBoard } from '@plait/core';
2
+ export declare const withLineTextMove: (board: PlaitBoard) => PlaitBoard;
package/public-api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './interfaces';
2
2
  export * from './plugins/with-draw';
3
+ export * from './plugins/with-line-auto-complete';
3
4
  export * from './constants';
4
5
  export * from './utils';
5
6
  export * from './geometry.component';
@@ -12,4 +12,8 @@
12
12
  &.draw-line-resizing .element-active-host .line-handle {
13
13
  display: none;
14
14
  }
15
+ &.line-text-resizing ,
16
+ &.line-text-resizing .slate-editable-container {
17
+ cursor: move;
18
+ }
15
19
  }
@@ -1,7 +1,7 @@
1
1
  import { PlaitBoard, Point, Path } from '@plait/core';
2
- import { PlaitGeometry, GeometryShapes } from '../interfaces';
2
+ import { GeometryShapes } from '../interfaces';
3
3
  import { Element } from 'slate';
4
4
  export declare const insertGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => void;
5
5
  export declare const insertText: (board: PlaitBoard, points: [Point, Point], text?: string | Element) => void;
6
6
  export declare const resizeGeometry: (board: PlaitBoard, points: [Point, Point], textHeight: number, path: Path) => void;
7
- export declare const transformShape: (board: PlaitBoard, element: PlaitGeometry, shape: GeometryShapes) => void;
7
+ export declare const switchGeometryShape: (board: PlaitBoard, shape: GeometryShapes) => void;
@@ -9,5 +9,5 @@ export declare const DrawTransforms: {
9
9
  removeLineText: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitLine, index: number) => void;
10
10
  setLineMark: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitLine, handleKey: import("@plait/draw").LineHandleKey, marker: import("@plait/draw").LineMarkerType) => void;
11
11
  insertImage: (board: import("@plait/core").PlaitBoard, imageItem: import("@plait/common").CommonImageItem, startPoint?: import("@plait/core").Point | undefined) => void;
12
- transformShape: (board: import("@plait/core").PlaitBoard, element: import("@plait/draw").PlaitGeometry, shape: import("@plait/draw").GeometryShapes) => void;
12
+ switchGeometryShape: (board: import("@plait/core").PlaitBoard, shape: import("@plait/draw").GeometryShapes) => void;
13
13
  };
@@ -1,6 +1,10 @@
1
1
  import { Path, PlaitBoard } from '@plait/core';
2
- import { LineHandleKey, LineMarkerType, LineText, PlaitLine } from '../interfaces';
2
+ import { LineHandleKey, LineMarkerType, LineText, PlaitGeometry, PlaitLine } from '../interfaces';
3
3
  export declare const resizeLine: (board: PlaitBoard, options: Partial<PlaitLine>, path: Path) => void;
4
4
  export declare const setLineTexts: (board: PlaitBoard, element: PlaitLine, texts: LineText[]) => void;
5
5
  export declare const removeLineText: (board: PlaitBoard, element: PlaitLine, index: number) => void;
6
6
  export declare const setLineMark: (board: PlaitBoard, element: PlaitLine, handleKey: LineHandleKey, marker: LineMarkerType) => void;
7
+ export declare const collectRefs: (board: PlaitBoard, geometry: PlaitGeometry, refs: {
8
+ property: Partial<PlaitLine>;
9
+ path: Path;
10
+ }[]) => void;
@@ -58,3 +58,6 @@ export declare const getDefaultGeometryProperty: (pointer: DrawPointerType) => {
58
58
  height: number;
59
59
  };
60
60
  export declare const getDefaultTextPoints: (board: PlaitBoard, centerPoint: Point, fontSize?: number | string) => [Point, Point];
61
+ export declare const insertElement: (board: PlaitBoard, element: PlaitGeometry) => void;
62
+ export declare const createDefaultText: (board: PlaitBoard, points: [Point, Point]) => PlaitGeometry;
63
+ export declare const createDefaultGeometry: (board: PlaitBoard, points: [Point, Point], shape: GeometryShapes) => PlaitGeometry;