@plait/core 0.1.4 → 0.1.6
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/esm2020/board/board.component.mjs +12 -14
- package/esm2020/interfaces/board.mjs +1 -1
- package/esm2020/interfaces/viewport.mjs +2 -2
- package/esm2020/plugins/create-board.mjs +2 -2
- package/esm2020/plugins/with-moving.mjs +8 -5
- package/esm2020/plugins/with-selection.mjs +29 -11
- package/esm2020/plugins/with-viewport.mjs +6 -2
- package/esm2020/utils/draw/rectangle.mjs +1 -9
- package/esm2020/utils/moving-element.mjs +3 -2
- package/esm2020/utils/selected-element.mjs +3 -3
- package/esm2020/utils/viewport.mjs +19 -13
- package/esm2020/utils/weak-maps.mjs +1 -2
- package/fesm2015/plait-core.mjs +149 -130
- package/fesm2015/plait-core.mjs.map +1 -1
- package/fesm2020/plait-core.mjs +149 -130
- package/fesm2020/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +1 -1
- package/package.json +1 -1
- package/plugins/with-selection.d.ts +3 -1
- package/styles/styles.scss +5 -0
- package/utils/draw/rectangle.d.ts +0 -8
- package/utils/viewport.d.ts +4 -3
- package/utils/weak-maps.d.ts +0 -1
package/interfaces/board.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface PlaitBoard {
|
|
|
36
36
|
drawElement: (context: PlaitPluginElementContext) => SVGGElement[] | ComponentType<PlaitPluginElementComponent>;
|
|
37
37
|
redrawElement: (context: PlaitPluginElementContext, previousContext?: PlaitPluginElementContext) => SVGGElement[] | void;
|
|
38
38
|
destroyElement: (context: PlaitPluginElementContext) => void;
|
|
39
|
-
|
|
39
|
+
isHitSelection: (element: PlaitElement, range: Range) => boolean;
|
|
40
40
|
isMovable: (element: PlaitElement) => boolean;
|
|
41
41
|
getRectangle: (element: PlaitElement) => RectangleClient | null;
|
|
42
42
|
isWithinSelection: (element: PlaitElement) => boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
+
import { PlaitElement } from '../interfaces';
|
|
2
3
|
export declare function withSelection(board: PlaitBoard): PlaitBoard;
|
|
3
|
-
export declare function getTemporaryElements(board: PlaitBoard):
|
|
4
|
+
export declare function getTemporaryElements(board: PlaitBoard): PlaitElement[] | undefined;
|
|
4
5
|
export declare function deleteTemporaryElements(board: PlaitBoard): void;
|
|
5
6
|
export declare function isSelectionMoving(board: PlaitBoard): boolean;
|
|
6
7
|
export declare function setSelectionMoving(board: PlaitBoard): void;
|
|
7
8
|
export declare function clearSelectionMoving(board: PlaitBoard): void;
|
|
9
|
+
export declare function createSelectionOuterG(board: PlaitBoard, selectElements: PlaitElement[]): SVGGElement;
|
package/styles/styles.scss
CHANGED
|
@@ -2,13 +2,5 @@ import { Options } from 'roughjs/bin/core';
|
|
|
2
2
|
import { RoughSVG } from 'roughjs/bin/svg';
|
|
3
3
|
/**
|
|
4
4
|
* drawRoundRectangle
|
|
5
|
-
* @param rs RoughSVG
|
|
6
|
-
* @param x1 number
|
|
7
|
-
* @param y1 number
|
|
8
|
-
* @param x2 number
|
|
9
|
-
* @param y2 number
|
|
10
|
-
* @param options Options
|
|
11
|
-
* @param outline boolean
|
|
12
|
-
* @returns SVGGElement
|
|
13
5
|
*/
|
|
14
6
|
export declare function drawRoundRectangle(rs: RoughSVG, x1: number, y1: number, x2: number, y2: number, options: Options, outline?: boolean, borderRadius?: number): SVGGElement;
|
package/utils/viewport.d.ts
CHANGED
|
@@ -30,7 +30,8 @@ export declare function fitViewport(board: PlaitBoard): void;
|
|
|
30
30
|
export declare const updateViewportOrigination: (board: PlaitBoard, origination: Point) => void;
|
|
31
31
|
export declare const clearViewportOrigination: (board: PlaitBoard) => void;
|
|
32
32
|
export declare const getViewportOrigination: (board: PlaitBoard) => Point | undefined;
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const
|
|
35
|
-
export declare const
|
|
33
|
+
export declare const isFromScrolling: (board: PlaitBoard) => boolean;
|
|
34
|
+
export declare const setIsFromScrolling: (board: PlaitBoard, state: boolean) => void;
|
|
35
|
+
export declare const isFromViewportChange: (board: PlaitBoard) => boolean;
|
|
36
|
+
export declare const setIsFromViewportChange: (board: PlaitBoard, state: boolean) => void;
|
|
36
37
|
export declare function scrollToRectangle(board: PlaitBoard, client: RectangleClient): void;
|
package/utils/weak-maps.d.ts
CHANGED
|
@@ -16,4 +16,3 @@ export declare const BOARD_TO_VIEWPORT_ORIGINATION: WeakMap<PlaitBoard, Point>;
|
|
|
16
16
|
export declare const BOARD_TO_IS_SELECTION_MOVING: WeakMap<PlaitBoard, boolean>;
|
|
17
17
|
export declare const BOARD_TO_TEMPORARY_ELEMENTS: WeakMap<PlaitBoard, PlaitElement[]>;
|
|
18
18
|
export declare const BOARD_TO_MOVING_ELEMENT: WeakMap<PlaitBoard, PlaitElement[]>;
|
|
19
|
-
export declare const BOARD_TO_SCROLLING: WeakMap<PlaitBoard, boolean>;
|