@plait/core 0.62.0-next.9 → 0.63.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/esm2022/interfaces/index.mjs +1 -2
- package/esm2022/interfaces/plugin.mjs +6 -2
- package/esm2022/plugins/with-hand.mjs +29 -19
- package/esm2022/plugins/with-hotkey.mjs +2 -2
- package/esm2022/plugins/with-options.mjs +1 -1
- package/esm2022/plugins/with-selection.mjs +13 -13
- package/esm2022/transforms/board.mjs +24 -3
- package/esm2022/utils/selected-element.mjs +3 -3
- package/esm2022/utils/selection.mjs +10 -3
- package/fesm2022/plait-core.mjs +78 -38
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/index.d.ts +0 -1
- package/interfaces/plugin.d.ts +15 -0
- package/package.json +2 -2
- package/plugins/with-options.d.ts +3 -5
- package/plugins/with-selection.d.ts +0 -5
- package/transforms/board.d.ts +2 -0
- package/utils/selection.d.ts +3 -1
- package/esm2022/interfaces/plugin-key.mjs +0 -5
- package/interfaces/plugin-key.d.ts +0 -3
package/interfaces/index.d.ts
CHANGED
package/interfaces/plugin.d.ts
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
import { PlaitBoard } from './board';
|
|
2
2
|
export type PlaitPlugin = (board: PlaitBoard) => PlaitBoard;
|
|
3
|
+
export interface WithPluginOptions {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface WithSelectionPluginOptions extends WithPluginOptions {
|
|
7
|
+
isMultipleSelection: boolean;
|
|
8
|
+
isDisabledSelection: boolean;
|
|
9
|
+
isPreventClearSelection: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface WithHandPluginOptions extends WithPluginOptions {
|
|
12
|
+
isHandMode: (board: PlaitBoard, event: PointerEvent) => boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare enum PlaitPluginKey {
|
|
15
|
+
'withSelection' = "withSelection",
|
|
16
|
+
'withHand' = "withHand"
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
}
|
|
2
|
+
import { WithPluginOptions } from '../interfaces/plugin';
|
|
5
3
|
export interface PlaitOptionsBoard extends PlaitBoard {
|
|
6
|
-
getPluginOptions: <K =
|
|
7
|
-
setPluginOptions: <K =
|
|
4
|
+
getPluginOptions: <K = WithPluginOptions>(key: string) => K;
|
|
5
|
+
setPluginOptions: <K = WithPluginOptions>(key: string, value: Partial<K>) => void;
|
|
8
6
|
}
|
|
9
7
|
export declare const withOptions: (board: PlaitBoard) => PlaitOptionsBoard;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
import { PlaitPluginOptions } from './with-options';
|
|
3
|
-
export interface WithPluginOptions extends PlaitPluginOptions {
|
|
4
|
-
isMultiple: boolean;
|
|
5
|
-
isDisabledSelect: boolean;
|
|
6
|
-
}
|
|
7
2
|
export declare function withSelection(board: PlaitBoard): PlaitBoard;
|
package/transforms/board.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare function fitViewportWidth(board: PlaitBoard, options: FitViewportOptions
|
|
|
12
12
|
* invoke applyThemeColor
|
|
13
13
|
*/
|
|
14
14
|
declare function updateThemeColor(board: PlaitBoard, mode: ThemeColorMode): void;
|
|
15
|
+
declare function moveToCenter(board: PlaitBoard, centerPoint: Point): void;
|
|
15
16
|
export declare const BoardTransforms: {
|
|
16
17
|
updatePointerType: <T extends string = PlaitPointerType>(board: PlaitBoard, pointer: T) => void;
|
|
17
18
|
updateViewport: typeof updateViewport;
|
|
@@ -19,5 +20,6 @@ export declare const BoardTransforms: {
|
|
|
19
20
|
updateZoom: typeof updateZoom;
|
|
20
21
|
updateThemeColor: typeof updateThemeColor;
|
|
21
22
|
fitViewportWidth: typeof fitViewportWidth;
|
|
23
|
+
moveToCenter: typeof moveToCenter;
|
|
22
24
|
};
|
|
23
25
|
export {};
|
package/utils/selection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlaitBoard, PlaitElement, PlaitGroup } from '../interfaces';
|
|
1
|
+
import { PlaitBoard, PlaitElement, PlaitGroup, WithSelectionPluginOptions } from '../interfaces';
|
|
2
2
|
export declare function isSelectionMoving(board: PlaitBoard): boolean;
|
|
3
3
|
export declare function setSelectionMoving(board: PlaitBoard): void;
|
|
4
4
|
export declare function clearSelectionMoving(board: PlaitBoard): void;
|
|
@@ -14,3 +14,5 @@ export declare function drawEntireActiveRectangleG(board: PlaitBoard): SVGGEleme
|
|
|
14
14
|
export declare function setSelectedElementsWithGroup(board: PlaitBoard, elements: PlaitElement[], isShift: boolean): void;
|
|
15
15
|
export declare function cacheSelectedElementsWithGroupOnShift(board: PlaitBoard, elements: PlaitElement[], isSelectGroupElement: boolean, elementsInHighestGroup: PlaitElement[]): void;
|
|
16
16
|
export declare function cacheSelectedElementsWithGroup(board: PlaitBoard, elements: PlaitElement[], isSelectGroupElement: boolean, hitElementGroups: PlaitGroup[]): void;
|
|
17
|
+
export declare const getSelectionOptions: (board: PlaitBoard) => WithSelectionPluginOptions;
|
|
18
|
+
export declare const setSelectionOptions: (board: PlaitBoard, options: Partial<WithSelectionPluginOptions>) => void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export var PlaitPluginKey;
|
|
2
|
-
(function (PlaitPluginKey) {
|
|
3
|
-
PlaitPluginKey["withSelection"] = "withSelection";
|
|
4
|
-
})(PlaitPluginKey || (PlaitPluginKey = {}));
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2luLWtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL2ludGVyZmFjZXMvcGx1Z2luLWtleS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxjQUVYO0FBRkQsV0FBWSxjQUFjO0lBQ3RCLGlEQUFpQyxDQUFBO0FBQ3JDLENBQUMsRUFGVyxjQUFjLEtBQWQsY0FBYyxRQUV6QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIFBsYWl0UGx1Z2luS2V5IHtcbiAgICAnd2l0aFNlbGVjdGlvbicgPSAnd2l0aFNlbGVjdGlvbidcbn1cbiJdfQ==
|