@plait/core 0.90.1 → 0.92.0-next.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/index.d.ts +1464 -3
- package/package.json +1 -1
- package/constants/cursor.d.ts +0 -10
- package/constants/index.d.ts +0 -19
- package/constants/keycodes.d.ts +0 -126
- package/constants/selection.d.ts +0 -5
- package/constants/zoom.d.ts +0 -3
- package/context.d.ts +0 -7
- package/core/element/context-change.d.ts +0 -10
- package/core/element/context.d.ts +0 -14
- package/core/element/element-flavour.d.ts +0 -30
- package/core/element/element-ref.d.ts +0 -5
- package/core/list-render.d.ts +0 -14
- package/differs/default_iterable_differ.d.ts +0 -141
- package/differs/iterable_differs.d.ts +0 -141
- package/interfaces/board.d.ts +0 -113
- package/interfaces/custom-types.d.ts +0 -9
- package/interfaces/direction.d.ts +0 -11
- package/interfaces/element.d.ts +0 -27
- package/interfaces/group.d.ts +0 -7
- package/interfaces/history.d.ts +0 -10
- package/interfaces/index.d.ts +0 -18
- package/interfaces/node.d.ts +0 -21
- package/interfaces/operation.d.ts +0 -53
- package/interfaces/path-ref.d.ts +0 -13
- package/interfaces/path.d.ts +0 -52
- package/interfaces/plugin.d.ts +0 -17
- package/interfaces/point.d.ts +0 -15
- package/interfaces/pointer.d.ts +0 -4
- package/interfaces/rectangle-client.d.ts +0 -49
- package/interfaces/selection.d.ts +0 -10
- package/interfaces/svg-arc-command.d.ts +0 -9
- package/interfaces/theme.d.ts +0 -24
- package/interfaces/viewport.d.ts +0 -18
- package/plugins/create-board.d.ts +0 -3
- package/plugins/index.d.ts +0 -11
- package/plugins/with-board.d.ts +0 -2
- package/plugins/with-hand.d.ts +0 -4
- package/plugins/with-history.d.ts +0 -2
- package/plugins/with-hotkey.d.ts +0 -2
- package/plugins/with-i18n.d.ts +0 -6
- package/plugins/with-moving.d.ts +0 -8
- package/plugins/with-options.d.ts +0 -7
- package/plugins/with-related-fragment.d.ts +0 -2
- package/plugins/with-selection.d.ts +0 -2
- package/public-api.d.ts +0 -12
- package/testing/core/create-board.d.ts +0 -6
- package/testing/core/fake-weak-map.d.ts +0 -4
- package/testing/core/index.d.ts +0 -2
- package/testing/fake-events/event-objects.d.ts +0 -46
- package/testing/fake-events/index.d.ts +0 -1
- package/testing/index.d.ts +0 -2
- package/testing/test-element.d.ts +0 -14
- package/transforms/board.d.ts +0 -25
- package/transforms/element.d.ts +0 -6
- package/transforms/general.d.ts +0 -6
- package/transforms/group.d.ts +0 -11
- package/transforms/index.d.ts +0 -9
- package/transforms/node.d.ts +0 -14
- package/transforms/selection.d.ts +0 -10
- package/transforms/theme.d.ts +0 -7
- package/transforms/viewport.d.ts +0 -7
- package/transforms/z-index.d.ts +0 -13
- package/utils/angle.d.ts +0 -24
- package/utils/board.d.ts +0 -11
- package/utils/clipboard/clipboard.d.ts +0 -5
- package/utils/clipboard/common.d.ts +0 -12
- package/utils/clipboard/data-transfer.d.ts +0 -5
- package/utils/clipboard/index.d.ts +0 -2
- package/utils/clipboard/navigator-clipboard.d.ts +0 -3
- package/utils/clipboard/types.d.ts +0 -24
- package/utils/common.d.ts +0 -13
- package/utils/debug.d.ts +0 -14
- package/utils/dnd.d.ts +0 -4
- package/utils/dom/common.d.ts +0 -23
- package/utils/dom/environment.d.ts +0 -1
- package/utils/dom/foreign.d.ts +0 -3
- package/utils/dom/index.d.ts +0 -3
- package/utils/drawing/arrow.d.ts +0 -8
- package/utils/drawing/circle.d.ts +0 -4
- package/utils/drawing/line.d.ts +0 -6
- package/utils/drawing/rectangle.d.ts +0 -9
- package/utils/element.d.ts +0 -11
- package/utils/environment.d.ts +0 -8
- package/utils/fragment.d.ts +0 -5
- package/utils/group.d.ts +0 -25
- package/utils/helper.d.ts +0 -17
- package/utils/history.d.ts +0 -49
- package/utils/hotkeys.d.ts +0 -37
- package/utils/id-creator.d.ts +0 -1
- package/utils/index.d.ts +0 -34
- package/utils/iterable.d.ts +0 -10
- package/utils/math.d.ts +0 -67
- package/utils/moving-element.d.ts +0 -5
- package/utils/pointer.d.ts +0 -5
- package/utils/position.d.ts +0 -2
- package/utils/selected-element.d.ts +0 -19
- package/utils/selection.d.ts +0 -18
- package/utils/snap/snap-moving.d.ts +0 -5
- package/utils/snap/snap.d.ts +0 -31
- package/utils/to-image.d.ts +0 -22
- package/utils/to-point.d.ts +0 -31
- package/utils/tree.d.ts +0 -7
- package/utils/viewport.d.ts +0 -50
- package/utils/weak-maps.d.ts +0 -43
- package/utils/z-index.d.ts +0 -5
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare enum Direction {
|
|
2
|
-
left = "left",
|
|
3
|
-
top = "top",
|
|
4
|
-
right = "right",
|
|
5
|
-
bottom = "bottom"
|
|
6
|
-
}
|
|
7
|
-
export declare const isHorizontalDirection: (direction: Direction) => direction is Direction.left | Direction.right;
|
|
8
|
-
export declare const isVerticalDirection: (direction: Direction) => direction is Direction.top | Direction.bottom;
|
|
9
|
-
export type Vector = [number, number];
|
|
10
|
-
export type DirectionFactor = -1 | 0 | 1;
|
|
11
|
-
export type DirectionFactors = [DirectionFactor, DirectionFactor];
|
package/interfaces/element.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Point } from './point';
|
|
2
|
-
import { PlaitElementRef } from '../core/element/element-ref';
|
|
3
|
-
export interface PlaitElement {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
id: string;
|
|
6
|
-
children?: PlaitElement[];
|
|
7
|
-
points?: Point[];
|
|
8
|
-
type?: string;
|
|
9
|
-
groupId?: string;
|
|
10
|
-
angle?: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const PlaitElement: {
|
|
13
|
-
isRootElement(value: PlaitElement): boolean;
|
|
14
|
-
getElementRef<T extends PlaitElementRef = PlaitElementRef>(value: PlaitElement): T;
|
|
15
|
-
getElementG(value: PlaitElement): SVGGElement;
|
|
16
|
-
hasMounted(element: PlaitElement): boolean;
|
|
17
|
-
getContainerG<T extends boolean>(value: PlaitElement, options: {
|
|
18
|
-
suppressThrow: T;
|
|
19
|
-
}): T extends true ? SVGGElement | null : SVGGElement;
|
|
20
|
-
};
|
|
21
|
-
export interface ComponentType<T> {
|
|
22
|
-
new (...args: any[]): T;
|
|
23
|
-
}
|
|
24
|
-
export interface ImageEntry {
|
|
25
|
-
url: string;
|
|
26
|
-
file: File;
|
|
27
|
-
}
|
package/interfaces/group.d.ts
DELETED
package/interfaces/history.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from './board';
|
|
2
|
-
import { PlaitOperation } from './operation';
|
|
3
|
-
export interface PlaitHistory {
|
|
4
|
-
redos: PlaitOperation[][];
|
|
5
|
-
undos: PlaitOperation[][];
|
|
6
|
-
}
|
|
7
|
-
export declare const SAVING: WeakMap<PlaitBoard, boolean | undefined>;
|
|
8
|
-
export declare const MERGING: WeakMap<PlaitBoard, boolean | undefined>;
|
|
9
|
-
export declare const HISTORY: WeakMap<PlaitBoard, History>;
|
|
10
|
-
export declare const SPLITTING_ONCE: WeakMap<PlaitBoard, boolean | undefined>;
|
package/interfaces/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './board';
|
|
2
|
-
export * from './pointer';
|
|
3
|
-
export * from '../core/element/context';
|
|
4
|
-
export * from './custom-types';
|
|
5
|
-
export * from './element';
|
|
6
|
-
export * from './rectangle-client';
|
|
7
|
-
export * from './node';
|
|
8
|
-
export * from './operation';
|
|
9
|
-
export * from './path';
|
|
10
|
-
export * from './plugin';
|
|
11
|
-
export * from './point';
|
|
12
|
-
export * from './selection';
|
|
13
|
-
export * from './viewport';
|
|
14
|
-
export * from './history';
|
|
15
|
-
export * from './theme';
|
|
16
|
-
export * from './direction';
|
|
17
|
-
export * from './group';
|
|
18
|
-
export * from './svg-arc-command';
|
package/interfaces/node.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PlaitElement } from './element';
|
|
2
|
-
import { PlaitBoard } from './board';
|
|
3
|
-
import { Path } from './path';
|
|
4
|
-
export type PlaitNode = PlaitElement;
|
|
5
|
-
export type Ancestor = PlaitBoard | PlaitElement;
|
|
6
|
-
export interface NodeParentsOptions {
|
|
7
|
-
reverse?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const PlaitNode: {
|
|
10
|
-
parent: (board: PlaitBoard, path: Path) => PlaitElement;
|
|
11
|
-
/**
|
|
12
|
-
* Return a generator of all the ancestor nodes above a specific path.
|
|
13
|
-
*
|
|
14
|
-
* By default the order is top-down, from highest to lowest ancestor in
|
|
15
|
-
* the tree, but you can pass the `reverse: true` option to go bottom-up.
|
|
16
|
-
*/
|
|
17
|
-
parents(root: PlaitBoard, path: Path, options?: NodeParentsOptions): Generator<PlaitNode, void, undefined>;
|
|
18
|
-
get<T extends PlaitNode = PlaitElement>(root: PlaitBoard, path: Path): T;
|
|
19
|
-
last(board: PlaitBoard, path: Path): PlaitElement;
|
|
20
|
-
first(board: PlaitBoard, path: Path): PlaitElement;
|
|
21
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { PlaitNode } from './node';
|
|
2
|
-
import { Path } from './path';
|
|
3
|
-
import { Selection } from './selection';
|
|
4
|
-
import { PlaitTheme } from './theme';
|
|
5
|
-
import { Viewport } from './viewport';
|
|
6
|
-
export type InsertNodeOperation = {
|
|
7
|
-
type: 'insert_node';
|
|
8
|
-
path: Path;
|
|
9
|
-
node: PlaitNode;
|
|
10
|
-
};
|
|
11
|
-
export type RemoveNodeOperation = {
|
|
12
|
-
type: 'remove_node';
|
|
13
|
-
path: Path;
|
|
14
|
-
node: PlaitNode;
|
|
15
|
-
};
|
|
16
|
-
export type MoveNodeOperation = {
|
|
17
|
-
type: 'move_node';
|
|
18
|
-
path: Path;
|
|
19
|
-
newPath: Path;
|
|
20
|
-
};
|
|
21
|
-
export type SetThemeOperation = {
|
|
22
|
-
type: 'set_theme';
|
|
23
|
-
properties: Partial<PlaitTheme>;
|
|
24
|
-
newProperties: Partial<PlaitTheme>;
|
|
25
|
-
};
|
|
26
|
-
export type SetViewportOperation = {
|
|
27
|
-
type: 'set_viewport';
|
|
28
|
-
properties: Partial<Viewport>;
|
|
29
|
-
newProperties: Partial<Viewport>;
|
|
30
|
-
};
|
|
31
|
-
export type SetSelectionOperation = {
|
|
32
|
-
type: 'set_selection';
|
|
33
|
-
properties: Selection | null;
|
|
34
|
-
newProperties: Selection | null;
|
|
35
|
-
};
|
|
36
|
-
export type SetNodeOperation = {
|
|
37
|
-
type: 'set_node';
|
|
38
|
-
path: Path;
|
|
39
|
-
properties: Partial<PlaitNode>;
|
|
40
|
-
newProperties: Partial<PlaitNode>;
|
|
41
|
-
};
|
|
42
|
-
export type PlaitOperation = InsertNodeOperation | SetViewportOperation | SetSelectionOperation | SetNodeOperation | RemoveNodeOperation | MoveNodeOperation | SetThemeOperation;
|
|
43
|
-
export interface PlaitOperationInterface {
|
|
44
|
-
inverse: (op: PlaitOperation) => PlaitOperation;
|
|
45
|
-
isSetViewportOperation: (value: PlaitOperation) => boolean;
|
|
46
|
-
isSetSelectionOperation: (value: PlaitOperation) => boolean;
|
|
47
|
-
isSetThemeOperation: (value: PlaitOperation) => boolean;
|
|
48
|
-
}
|
|
49
|
-
export declare const isSetViewportOperation: (value: any) => value is SetViewportOperation;
|
|
50
|
-
export declare const isSetSelectionOperation: (value: any) => value is SetSelectionOperation;
|
|
51
|
-
export declare const isSetThemeOperation: (value: any) => value is SetThemeOperation;
|
|
52
|
-
export declare const inverse: (op: PlaitOperation) => PlaitOperation;
|
|
53
|
-
export declare const PlaitOperation: PlaitOperationInterface;
|
package/interfaces/path-ref.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PlaitOperation } from './operation';
|
|
2
|
-
import { Path } from './path';
|
|
3
|
-
export interface PathRef {
|
|
4
|
-
current: Path | null;
|
|
5
|
-
affinity: 'forward' | 'backward' | null;
|
|
6
|
-
unref(): Path | null;
|
|
7
|
-
}
|
|
8
|
-
export interface PathRefOptions {
|
|
9
|
-
affinity?: 'forward' | 'backward' | null;
|
|
10
|
-
}
|
|
11
|
-
export declare const PathRef: {
|
|
12
|
-
transform(ref: PathRef, op: PlaitOperation): void;
|
|
13
|
-
};
|
package/interfaces/path.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { PlaitOperation } from './operation';
|
|
2
|
-
export interface PathLevelsOptions {
|
|
3
|
-
reverse?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type Path = number[];
|
|
6
|
-
export declare const Path: {
|
|
7
|
-
/**
|
|
8
|
-
* Get a list of ancestor paths for a given path.
|
|
9
|
-
*
|
|
10
|
-
* The paths are sorted from shallowest to deepest ancestor. However, if the
|
|
11
|
-
* `reverse: true` option is passed, they are reversed.
|
|
12
|
-
*/
|
|
13
|
-
ancestors(path: Path, options?: PathLevelsOptions): Path[];
|
|
14
|
-
/**
|
|
15
|
-
* Get a list of paths at every level down to a path. Note: this is the same
|
|
16
|
-
* as `Path.ancestors`, but including the path itself.
|
|
17
|
-
*
|
|
18
|
-
* The paths are sorted from shallowest to deepest. However, if the `reverse:
|
|
19
|
-
* true` option is passed, they are reversed.
|
|
20
|
-
*/
|
|
21
|
-
levels(path: Path, options?: PathLevelsOptions): Path[];
|
|
22
|
-
parent(path: Path): Path;
|
|
23
|
-
next(path: Path): Path;
|
|
24
|
-
hasPrevious(path: Path): boolean;
|
|
25
|
-
previous(path: Path): Path;
|
|
26
|
-
/**
|
|
27
|
-
* Check if a path is an ancestor of another.
|
|
28
|
-
*/
|
|
29
|
-
isAncestor(path: Path, another: Path): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Compare a path to another, returning an integer indicating whether the path
|
|
32
|
-
* was before, at, or after the other.
|
|
33
|
-
*
|
|
34
|
-
* Note: Two paths of unequal length can still receive a `0` result if one is
|
|
35
|
-
* directly above or below the other. If you want exact matching, use
|
|
36
|
-
* [[Path.equals]] instead.
|
|
37
|
-
*/
|
|
38
|
-
compare(path: Path, another: Path): -1 | 0 | 1;
|
|
39
|
-
/**
|
|
40
|
-
* Check if a path is exactly equal to another.
|
|
41
|
-
*/
|
|
42
|
-
equals(path: Path, another: Path): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Check if a path ends before one of the indexes in another.
|
|
45
|
-
*/
|
|
46
|
-
endsBefore(path: Path, another: Path): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a path is a sibling of another.
|
|
49
|
-
*/
|
|
50
|
-
isSibling(path: Path, another: Path): boolean;
|
|
51
|
-
transform(path: Path | null, operation: PlaitOperation): Path | null;
|
|
52
|
-
};
|
package/interfaces/plugin.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from './board';
|
|
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/interfaces/point.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type Point = [number, number];
|
|
2
|
-
export interface XYPosition {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const Point: {
|
|
7
|
-
isEquals(point?: Point, otherPoint?: Point): boolean | undefined;
|
|
8
|
-
isHorizontal(point?: Point, otherPoint?: Point, tolerance?: number): boolean | undefined;
|
|
9
|
-
isOverHorizontal(points: Point[], tolerance?: number): boolean;
|
|
10
|
-
isVertical(point?: Point, otherPoint?: Point, tolerance?: number): boolean | undefined;
|
|
11
|
-
isOverVertical(points: Point[], tolerance?: number): boolean;
|
|
12
|
-
isAlign(points: Point[], tolerance?: number): boolean;
|
|
13
|
-
getOffsetX(point1: Point, point2: Point): number;
|
|
14
|
-
getOffsetY(point1: Point, point2: Point): number;
|
|
15
|
-
};
|
package/interfaces/pointer.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Point } from './point';
|
|
2
|
-
export interface RectangleClient {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* [x, y] x,y between 0 and 1
|
|
10
|
-
* represents a point in the rectangle
|
|
11
|
-
*/
|
|
12
|
-
export type PointOfRectangle = [number, number];
|
|
13
|
-
export declare const RectangleClient: {
|
|
14
|
-
isHit: (origin: RectangleClient, target: RectangleClient) => boolean;
|
|
15
|
-
isHitX: (origin: RectangleClient, target: RectangleClient) => boolean;
|
|
16
|
-
isHitY: (origin: RectangleClient, target: RectangleClient) => boolean;
|
|
17
|
-
getPoints(rectangle: RectangleClient): [Point, Point];
|
|
18
|
-
getRectangleByCenterPoint(point: Point, width: number, height: number): RectangleClient;
|
|
19
|
-
getRectangleByPoint(point: Point, width: number, height: number): RectangleClient;
|
|
20
|
-
getRectangleByPoints(points: Point[] | Point[][]): RectangleClient;
|
|
21
|
-
getCornerPointsByPoints(points: Point[]): [Point, Point, Point, Point];
|
|
22
|
-
getOutlineRectangle: (rectangle: RectangleClient, offset: number) => {
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
|
-
};
|
|
28
|
-
inflate: (rectangle: RectangleClient, delta: number) => {
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
width: number;
|
|
32
|
-
height: number;
|
|
33
|
-
};
|
|
34
|
-
isEqual: (rectangle: RectangleClient, otherRectangle: RectangleClient) => boolean;
|
|
35
|
-
getCornerPoints: (rectangle: RectangleClient) => [Point, Point, Point, Point];
|
|
36
|
-
getCenterPoint: (rectangle: RectangleClient) => Point;
|
|
37
|
-
getCenterPointByPoints: (points: Point[]) => Point;
|
|
38
|
-
getEdgeCenterPoints: (rectangle: RectangleClient) => [Point, Point, Point, Point];
|
|
39
|
-
getConnectionPoint: (rectangle: RectangleClient, point: PointOfRectangle) => Point;
|
|
40
|
-
expand(rectangle: RectangleClient, left: number, top?: number, right?: number, bottom?: number): {
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
};
|
|
46
|
-
getGapCenter(rectangle1: RectangleClient, rectangle2: RectangleClient, isHorizontal: boolean): number;
|
|
47
|
-
isPointInRectangle(rectangle: RectangleClient, point: Point): boolean;
|
|
48
|
-
getBoundingRectangle(rectangles: RectangleClient[]): RectangleClient;
|
|
49
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Point } from './point';
|
|
2
|
-
export declare const SELECTION_BORDER_COLOR = "#6698FF";
|
|
3
|
-
export declare const SELECTION_FILL_COLOR = "#6698FF25";
|
|
4
|
-
export interface Selection {
|
|
5
|
-
anchor: Point;
|
|
6
|
-
focus: Point;
|
|
7
|
-
}
|
|
8
|
-
export declare const Selection: {
|
|
9
|
-
isCollapsed(selection: Selection): boolean;
|
|
10
|
-
};
|
package/interfaces/theme.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface PlaitTheme {
|
|
2
|
-
themeColorMode: ThemeColorMode;
|
|
3
|
-
}
|
|
4
|
-
export interface ThemeColor {
|
|
5
|
-
mode: ThemeColorMode | string;
|
|
6
|
-
boardBackground?: string;
|
|
7
|
-
textColor: string;
|
|
8
|
-
}
|
|
9
|
-
export declare enum ThemeColorMode {
|
|
10
|
-
'default' = "default",
|
|
11
|
-
'colorful' = "colorful",
|
|
12
|
-
'soft' = "soft",
|
|
13
|
-
'retro' = "retro",
|
|
14
|
-
'dark' = "dark",
|
|
15
|
-
'starry' = "starry"
|
|
16
|
-
}
|
|
17
|
-
export declare const DEFAULT_COLOR = "#333333";
|
|
18
|
-
export declare const DefaultThemeColor: ThemeColor;
|
|
19
|
-
export declare const ColorfulThemeColor: ThemeColor;
|
|
20
|
-
export declare const SoftThemeColor: ThemeColor;
|
|
21
|
-
export declare const RetroThemeColor: ThemeColor;
|
|
22
|
-
export declare const DarkThemeColor: ThemeColor;
|
|
23
|
-
export declare const StarryThemeColor: ThemeColor;
|
|
24
|
-
export declare const ThemeColors: ThemeColor[];
|
package/interfaces/viewport.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ExtendedType } from './custom-types';
|
|
2
|
-
import { Point } from './point';
|
|
3
|
-
export interface BaseViewport {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
zoom: number;
|
|
6
|
-
origination?: Point;
|
|
7
|
-
}
|
|
8
|
-
export type Viewport = ExtendedType<'Viewport', BaseViewport>;
|
|
9
|
-
export interface ViewportInterface {
|
|
10
|
-
isViewport: (value: any) => value is Viewport;
|
|
11
|
-
}
|
|
12
|
-
export declare const Viewport: ViewportInterface;
|
|
13
|
-
export interface FitViewportOptions {
|
|
14
|
-
maxWidth?: number;
|
|
15
|
-
limitHeight: number;
|
|
16
|
-
autoFitPadding: number;
|
|
17
|
-
containerClass: string;
|
|
18
|
-
}
|
package/plugins/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './create-board';
|
|
2
|
-
export * from './with-board';
|
|
3
|
-
export * from './with-hand';
|
|
4
|
-
export * from './with-history';
|
|
5
|
-
export * from './with-hotkey';
|
|
6
|
-
export * from './with-moving';
|
|
7
|
-
export * from './with-options';
|
|
8
|
-
export * from './with-related-fragment';
|
|
9
|
-
export * from './with-selection';
|
|
10
|
-
export * from './with-i18n';
|
|
11
|
-
export * from './with-hand';
|
package/plugins/with-board.d.ts
DELETED
package/plugins/with-hand.d.ts
DELETED
package/plugins/with-hotkey.d.ts
DELETED
package/plugins/with-i18n.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
export interface PlaitI18nBoard extends PlaitBoard {
|
|
3
|
-
getI18nValue: (key: string) => string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const withI18n: (board: PlaitBoard) => PlaitI18nBoard;
|
|
6
|
-
export declare const getI18nValue: (board: PlaitBoard, key: string, defaultValue?: string) => string;
|
package/plugins/with-moving.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
import { PlaitElement } from '../interfaces/element';
|
|
3
|
-
export declare function withMoving(board: PlaitBoard): PlaitBoard;
|
|
4
|
-
export declare function withArrowMoving(board: PlaitBoard): PlaitBoard;
|
|
5
|
-
export declare function getSelectedTargetElements(board: PlaitBoard): PlaitElement[];
|
|
6
|
-
export declare function getValidElements(board: PlaitBoard, activeElements: PlaitElement[]): PlaitElement[];
|
|
7
|
-
export declare function updatePoints(board: PlaitBoard, activeElements: PlaitElement[], offsetX: number, offsetY: number): PlaitElement[];
|
|
8
|
-
export declare function drawPendingNodesG(board: PlaitBoard, activeElements: PlaitElement[], offsetX: number, offsetY: number): null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
import { WithPluginOptions } from '../interfaces/plugin';
|
|
3
|
-
export interface PlaitOptionsBoard extends PlaitBoard {
|
|
4
|
-
getPluginOptions: <K = WithPluginOptions>(key: string) => K;
|
|
5
|
-
setPluginOptions: <K = WithPluginOptions>(key: string, value: Partial<K>) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const withOptions: (board: PlaitBoard) => PlaitOptionsBoard;
|
package/public-api.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './core/element/context-change';
|
|
3
|
-
export * from './core/element/element-flavour';
|
|
4
|
-
export * from './core/element/element-ref';
|
|
5
|
-
export * from './core/list-render';
|
|
6
|
-
export * from './interfaces';
|
|
7
|
-
export * from './transforms';
|
|
8
|
-
export * from './utils';
|
|
9
|
-
export * from './context';
|
|
10
|
-
export * from './plugins';
|
|
11
|
-
export * from './testing';
|
|
12
|
-
export * from './utils/debug';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlaitBoardOptions, PlaitElement, PlaitPlugin } from '../../interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* 1.create board instance
|
|
4
|
-
* 2.build fake node weak map
|
|
5
|
-
*/
|
|
6
|
-
export declare const createTestingBoard: (plugins: PlaitPlugin[], children: PlaitElement[], options?: PlaitBoardOptions) => import("../../interfaces").PlaitBoard;
|
package/testing/core/index.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ModifierKeys } from '../test-element';
|
|
9
|
-
/**
|
|
10
|
-
* Creates a browser MouseEvent with the specified options.
|
|
11
|
-
* @docs-private
|
|
12
|
-
*/
|
|
13
|
-
export declare function createMouseEvent(type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, button?: number, modifiers?: ModifierKeys): MouseEvent;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a browser `PointerEvent` with the specified options. Pointer events
|
|
16
|
-
* by default will appear as if they are the primary pointer of their type.
|
|
17
|
-
* https://www.w3.org/TR/pointerevents2/#dom-pointerevent-isprimary.
|
|
18
|
-
*
|
|
19
|
-
* For example, if pointer events for a multi-touch interaction are created, the non-primary
|
|
20
|
-
* pointer touches would need to be represented by non-primary pointer events.
|
|
21
|
-
*
|
|
22
|
-
* @docs-private
|
|
23
|
-
*/
|
|
24
|
-
export declare function createPointerEvent(type: string, clientX?: number, clientY?: number, offsetX?: number, offsetY?: number, options?: PointerEventInit): PointerEvent;
|
|
25
|
-
/**
|
|
26
|
-
* Creates a browser TouchEvent with the specified pointer coordinates.
|
|
27
|
-
* @docs-private
|
|
28
|
-
*/
|
|
29
|
-
export declare function createTouchEvent(type: string, pageX?: number, pageY?: number, clientX?: number, clientY?: number): UIEvent;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a keyboard event with the specified key and modifiers.
|
|
32
|
-
* @docs-private
|
|
33
|
-
*/
|
|
34
|
-
export declare function createKeyboardEvent(type: string, keyCode?: number, key?: string, modifiers?: ModifierKeys): KeyboardEvent;
|
|
35
|
-
/**
|
|
36
|
-
* Creates a fake event object with any desired event type.
|
|
37
|
-
* @docs-private
|
|
38
|
-
*/
|
|
39
|
-
export declare function createFakeEvent(type: string, bubbles?: boolean, cancelable?: boolean, composed?: boolean): Event;
|
|
40
|
-
export declare function createModModifierKeys(): {
|
|
41
|
-
meta: boolean;
|
|
42
|
-
control?: undefined;
|
|
43
|
-
} | {
|
|
44
|
-
control: boolean;
|
|
45
|
-
meta?: undefined;
|
|
46
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './event-objects';
|
package/testing/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
/** Modifier keys that may be held while typing. */
|
|
9
|
-
export interface ModifierKeys {
|
|
10
|
-
control?: boolean;
|
|
11
|
-
alt?: boolean;
|
|
12
|
-
shift?: boolean;
|
|
13
|
-
meta?: boolean;
|
|
14
|
-
}
|
package/transforms/board.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ThemeColorMode } from '../interfaces/theme';
|
|
2
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
3
|
-
import { Point } from '../interfaces/point';
|
|
4
|
-
import { FitViewportOptions } from '../interfaces/viewport';
|
|
5
|
-
import { PlaitPointerType } from '../interfaces/pointer';
|
|
6
|
-
declare function updateViewport(board: PlaitBoard, origination: Point, zoom?: number): void;
|
|
7
|
-
declare function updateZoom(board: PlaitBoard, newZoom: number, center?: Point): void;
|
|
8
|
-
declare function fitViewport(board: PlaitBoard): void;
|
|
9
|
-
declare function fitViewportWidth(board: PlaitBoard, options: FitViewportOptions): void;
|
|
10
|
-
/**
|
|
11
|
-
* apply theme to every element (remove element custom properties)
|
|
12
|
-
* invoke applyThemeColor
|
|
13
|
-
*/
|
|
14
|
-
declare function updateThemeColor(board: PlaitBoard, mode: ThemeColorMode): void;
|
|
15
|
-
declare function moveToCenter(board: PlaitBoard, centerPoint: Point): void;
|
|
16
|
-
export declare const BoardTransforms: {
|
|
17
|
-
updatePointerType: <T extends string = PlaitPointerType>(board: PlaitBoard, pointer: T) => void;
|
|
18
|
-
updateViewport: typeof updateViewport;
|
|
19
|
-
fitViewport: typeof fitViewport;
|
|
20
|
-
updateZoom: typeof updateZoom;
|
|
21
|
-
updateThemeColor: typeof updateThemeColor;
|
|
22
|
-
fitViewportWidth: typeof fitViewportWidth;
|
|
23
|
-
moveToCenter: typeof moveToCenter;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
package/transforms/element.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
import { PlaitElement } from '../interfaces/element';
|
|
3
|
-
export declare const removeElements: (board: PlaitBoard, elements: PlaitElement[]) => void;
|
|
4
|
-
export declare const CoreTransforms: {
|
|
5
|
-
removeElements: (board: PlaitBoard, elements: PlaitElement[]) => void;
|
|
6
|
-
};
|
package/transforms/general.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PlaitOperation } from '../interfaces/operation';
|
|
2
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
3
|
-
export interface GeneralTransforms {
|
|
4
|
-
transform: (board: PlaitBoard, op: PlaitOperation) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const GeneralTransforms: GeneralTransforms;
|
package/transforms/group.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard, PlaitElement } from '../interfaces';
|
|
2
|
-
export declare const addGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
3
|
-
export declare const removeGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
4
|
-
export interface GroupTransforms {
|
|
5
|
-
addGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
6
|
-
removeGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const GroupTransforms: {
|
|
9
|
-
addGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
10
|
-
removeGroup: (board: PlaitBoard, elements?: PlaitElement[]) => void;
|
|
11
|
-
};
|
package/transforms/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GeneralTransforms } from './general';
|
|
2
|
-
import { GroupTransforms } from './group';
|
|
3
|
-
import { NodeTransforms } from './node';
|
|
4
|
-
import { SelectionTransforms } from './selection';
|
|
5
|
-
import { ViewportTransforms } from './viewport';
|
|
6
|
-
import { ZIndexTransforms } from './z-index';
|
|
7
|
-
export { BoardTransforms } from './board';
|
|
8
|
-
export { CoreTransforms } from './element';
|
|
9
|
-
export declare const Transforms: GeneralTransforms & ViewportTransforms & SelectionTransforms & NodeTransforms & GroupTransforms & ZIndexTransforms;
|
package/transforms/node.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PlaitBoard } from '../interfaces/board';
|
|
2
|
-
import { PlaitNode } from '../interfaces/node';
|
|
3
|
-
import { Path } from '../interfaces/path';
|
|
4
|
-
export declare function insertNode(board: PlaitBoard, node: PlaitNode, path: Path): void;
|
|
5
|
-
export declare function setNode(board: PlaitBoard, props: Partial<PlaitNode>, path: Path): void;
|
|
6
|
-
export declare function removeNode(board: PlaitBoard, path: Path): void;
|
|
7
|
-
export declare function moveNode(board: PlaitBoard, path: Path, newPath: Path): void;
|
|
8
|
-
export interface NodeTransforms {
|
|
9
|
-
insertNode: (board: PlaitBoard, node: PlaitNode, path: Path) => void;
|
|
10
|
-
setNode: (board: PlaitBoard, node: Partial<PlaitNode>, path: Path) => void;
|
|
11
|
-
removeNode: (board: PlaitBoard, path: Path) => void;
|
|
12
|
-
moveNode: (board: PlaitBoard, path: Path, newPath: Path) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const NodeTransforms: NodeTransforms;
|