@plait/core 0.1.0 → 0.1.2
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/board/board.component.d.ts +4 -17
- package/board/board.component.interface.d.ts +0 -2
- package/constants/selection.d.ts +1 -0
- package/esm2020/board/board.component.interface.mjs +1 -1
- package/esm2020/board/board.component.mjs +49 -248
- package/esm2020/constants/selection.mjs +2 -0
- package/esm2020/core/element/element.component.mjs +2 -2
- package/esm2020/interfaces/board.mjs +11 -2
- package/esm2020/interfaces/viewport.mjs +1 -1
- package/esm2020/plugins/create-board.mjs +2 -1
- package/esm2020/plugins/with-hand.mjs +9 -6
- package/esm2020/plugins/with-moving.mjs +91 -0
- package/esm2020/plugins/with-selection.mjs +54 -13
- package/esm2020/plugins/with-viewport.mjs +11 -0
- package/esm2020/public-api.mjs +3 -1
- package/esm2020/transforms/selection.mjs +10 -2
- package/esm2020/utils/board.mjs +7 -3
- package/esm2020/utils/common.mjs +15 -0
- package/esm2020/utils/element.mjs +3 -3
- package/esm2020/utils/helper.mjs +14 -1
- package/esm2020/utils/index.mjs +4 -2
- package/esm2020/utils/moving-element.mjs +15 -0
- package/esm2020/utils/selected-element.mjs +14 -1
- package/esm2020/utils/viewport.mjs +170 -0
- package/esm2020/utils/weak-maps.mjs +5 -1
- package/fesm2015/plait-core.mjs +567 -562
- package/fesm2015/plait-core.mjs.map +1 -1
- package/fesm2020/plait-core.mjs +567 -559
- package/fesm2020/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +4 -10
- package/interfaces/viewport.d.ts +2 -2
- package/package.json +1 -1
- package/plugins/with-moving.d.ts +2 -0
- package/plugins/with-selection.d.ts +6 -1
- package/plugins/with-viewport.d.ts +2 -0
- package/public-api.d.ts +2 -0
- package/transforms/selection.d.ts +3 -0
- package/utils/board.d.ts +1 -1
- package/utils/common.d.ts +1 -0
- package/utils/helper.d.ts +9 -0
- package/utils/index.d.ts +3 -1
- package/utils/moving-element.d.ts +5 -0
- package/utils/selected-element.d.ts +2 -0
- package/utils/viewport.d.ts +29 -0
- package/utils/weak-maps.d.ts +3 -0
- package/esm2020/utils/matrix.mjs +0 -170
- package/utils/matrix.d.ts +0 -82
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
2
|
import { RoughSVG } from 'roughjs/bin/svg';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
|
-
import { PlaitBoard, PlaitBoardChangeEvent, PlaitBoardOptions
|
|
4
|
+
import { PlaitBoard, PlaitBoardChangeEvent, PlaitBoardOptions } from '../interfaces/board';
|
|
5
5
|
import { PlaitElement } from '../interfaces/element';
|
|
6
6
|
import { PlaitPlugin } from '../interfaces/plugin';
|
|
7
7
|
import { Viewport } from '../interfaces/viewport';
|
|
8
8
|
import { BoardComponentInterface } from './board.component.interface';
|
|
9
|
-
import { RectangleClient } from '../interfaces/rectangle-client';
|
|
10
9
|
import * as i0 from "@angular/core";
|
|
11
10
|
export declare class PlaitBoardComponent implements BoardComponentInterface, OnInit, OnChanges, AfterViewInit, OnDestroy {
|
|
12
11
|
cdr: ChangeDetectorRef;
|
|
@@ -16,7 +15,6 @@ export declare class PlaitBoardComponent implements BoardComponentInterface, OnI
|
|
|
16
15
|
board: PlaitBoard;
|
|
17
16
|
roughSVG: RoughSVG;
|
|
18
17
|
destroy$: Subject<void>;
|
|
19
|
-
viewportState: PlaitBoardViewport;
|
|
20
18
|
private resizeObserver;
|
|
21
19
|
plaitValue: PlaitElement[];
|
|
22
20
|
plaitViewport: Viewport;
|
|
@@ -24,42 +22,31 @@ export declare class PlaitBoardComponent implements BoardComponentInterface, OnI
|
|
|
24
22
|
plaitOptions: PlaitBoardOptions;
|
|
25
23
|
plaitChange: EventEmitter<PlaitBoardChangeEvent>;
|
|
26
24
|
plaitBoardInitialized: EventEmitter<PlaitBoard>;
|
|
27
|
-
get isFocused(): import("@plait/core").Selection | null;
|
|
28
25
|
get host(): SVGSVGElement;
|
|
29
26
|
get hostClass(): string;
|
|
30
27
|
get readonly(): boolean;
|
|
31
|
-
get
|
|
28
|
+
get isFocused(): boolean;
|
|
32
29
|
get nativeElement(): HTMLElement;
|
|
33
30
|
svg: ElementRef;
|
|
34
31
|
toolbarTemplateRef: TemplateRef<any>;
|
|
35
32
|
viewportContainer: ElementRef;
|
|
36
33
|
constructor(cdr: ChangeDetectorRef, renderer2: Renderer2, elementRef: ElementRef<HTMLElement>);
|
|
37
34
|
ngOnInit(): void;
|
|
35
|
+
mouseLeaveListener(): void;
|
|
38
36
|
ngOnChanges(changes: SimpleChanges): void;
|
|
39
37
|
ngAfterViewInit(): void;
|
|
40
38
|
private initializePlugins;
|
|
41
39
|
private initializeEvents;
|
|
42
40
|
private viewportScrollListener;
|
|
43
41
|
private elementResizeListener;
|
|
44
|
-
private updateViewportState;
|
|
45
42
|
initViewportContainer(): void;
|
|
46
|
-
initViewport(viewport?: import("../interfaces/viewport").BaseViewport): void;
|
|
47
|
-
calcViewBox(zoom?: number): void;
|
|
48
|
-
getMatrix(): number[];
|
|
49
|
-
setScrollLeft(left: number): void;
|
|
50
|
-
setScrollTop(top: number): void;
|
|
51
|
-
setScroll(left: number, top: number): void;
|
|
52
|
-
private updateViewBoxStyles;
|
|
53
|
-
private updateViewportScrolling;
|
|
54
|
-
setViewport(): void;
|
|
55
43
|
trackBy: (index: number, element: PlaitElement) => number;
|
|
56
44
|
adaptHandle(): void;
|
|
57
|
-
zoomInHandle(): void;
|
|
45
|
+
zoomInHandle(isCenter?: boolean): void;
|
|
58
46
|
zoomOutHandle(): void;
|
|
59
47
|
resetZoomHandel(): void;
|
|
60
48
|
ngOnDestroy(): void;
|
|
61
49
|
markForCheck(): void;
|
|
62
|
-
scrollToRectangle(client: RectangleClient): void;
|
|
63
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<PlaitBoardComponent, never>;
|
|
64
51
|
static ɵcmp: i0.ɵɵComponentDeclaration<PlaitBoardComponent, "plait-board", never, { "plaitValue": "plaitValue"; "plaitViewport": "plaitViewport"; "plaitPlugins": "plaitPlugins"; "plaitOptions": "plaitOptions"; }, { "plaitChange": "plaitChange"; "plaitBoardInitialized": "plaitBoardInitialized"; }, ["toolbarTemplateRef"], ["*"]>;
|
|
65
52
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { RectangleClient } from '../interfaces/rectangle-client';
|
|
3
2
|
export interface BoardComponentInterface {
|
|
4
3
|
markForCheck: () => void;
|
|
5
|
-
scrollToRectangle: (client: RectangleClient) => void;
|
|
6
4
|
cdr: ChangeDetectorRef;
|
|
7
5
|
nativeElement: HTMLElement;
|
|
8
6
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ATTACHED_ELEMENT_CLASS_NAME = "plait-board-attached";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9hcmQuY29tcG9uZW50LmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL3BsYWl0L3NyYy9ib2FyZC9ib2FyZC5jb21wb25lbnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDaGFuZ2VEZXRlY3RvclJlZiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgaW50ZXJmYWNlIEJvYXJkQ29tcG9uZW50SW50ZXJmYWNlIHtcbiAgICBtYXJrRm9yQ2hlY2s6ICgpID0+IHZvaWQ7XG4gICAgY2RyOiBDaGFuZ2VEZXRlY3RvclJlZjtcbiAgICBuYXRpdmVFbGVtZW50OiBIVE1MRWxlbWVudDtcbn1cbiJdfQ==
|