@plait/core 0.24.0-next.7 → 0.24.0-next.9

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.
@@ -19,6 +19,12 @@ export declare const RectangleClient: {
19
19
  width: number;
20
20
  height: number;
21
21
  };
22
+ inflate: (rectangle: RectangleClient, delta: number) => {
23
+ x: number;
24
+ y: number;
25
+ width: number;
26
+ height: number;
27
+ };
22
28
  isEqual: (rectangle: RectangleClient, otherRectangle: RectangleClient) => boolean;
23
29
  getCornerPoints: (rectangle: RectangleClient) => [Point, Point, Point, Point];
24
30
  getEdgeCenterPoints: (rectangle: RectangleClient) => [Point, Point, Point, Point];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/core",
3
- "version": "0.24.0-next.7",
3
+ "version": "0.24.0-next.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.0.0",
6
6
  "@angular/core": "^16.0.0"
@@ -2,5 +2,5 @@ import { RoughSVG } from 'roughjs/bin/svg';
2
2
  import { Point } from '../../interfaces/point';
3
3
  import { Options } from 'roughjs/bin/core';
4
4
  export declare function drawLine(rs: RoughSVG, start: Point, end: Point, options: Options): SVGGElement;
5
- export declare function drawLinearPath(points: Point[], options?: Options): SVGGElement;
5
+ export declare function drawLinearPath(points: Point[], options?: Options, closePath?: boolean): SVGGElement;
6
6
  export declare function drawBezierPath(points: Point[], options?: Options): SVGGElement;
package/utils/touch.d.ts CHANGED
@@ -1,3 +1,16 @@
1
1
  import { PlaitBoard } from '../interfaces/board';
2
+ export interface TouchRef {
3
+ target?: SVGElement;
4
+ state: boolean;
5
+ host?: SVGGElement;
6
+ }
7
+ export declare const BOARD_TO_TOUCH_REF: WeakMap<PlaitBoard, TouchRef>;
2
8
  export declare const isPreventTouchMove: (board: PlaitBoard) => boolean;
3
- export declare const preventTouchMove: (board: PlaitBoard, state: Boolean) => void;
9
+ export declare const preventTouchMove: (board: PlaitBoard, event: PointerEvent, state: boolean) => void;
10
+ /**
11
+ * some intersection maybe cause target is removed from current browser window,
12
+ * after it was removed touch move event will not be fired
13
+ * so scroll behavior will can not be prevented in mobile browser device
14
+ * this function will prevent target element being remove.
15
+ */
16
+ export declare const handleTouchTarget: (board: PlaitBoard) => void;
@@ -22,5 +22,4 @@ export declare const BOARD_TO_VIEWPORT_ORIGINATION: WeakMap<PlaitBoard, Point>;
22
22
  export declare const BOARD_TO_IS_SELECTION_MOVING: WeakMap<PlaitBoard, boolean>;
23
23
  export declare const BOARD_TO_TEMPORARY_ELEMENTS: WeakMap<PlaitBoard, PlaitElement[]>;
24
24
  export declare const BOARD_TO_MOVING_ELEMENT: WeakMap<PlaitBoard, PlaitElement[]>;
25
- export declare const IS_PREVENT_TOUCH_MOVE: WeakMap<PlaitBoard, Boolean>;
26
25
  export declare const PATH_REFS: WeakMap<PlaitBoard, Set<PathRef>>;