@plait/core 0.55.1 → 0.56.1
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/core/element/element-ref.d.ts +5 -0
- package/core/element/plugin-element.d.ts +9 -6
- package/esm2022/board/board.component.mjs +10 -7
- package/esm2022/core/element/element-ref.mjs +2 -0
- package/esm2022/core/element/plugin-element.mjs +16 -7
- package/esm2022/interfaces/board.mjs +1 -1
- package/esm2022/interfaces/element.mjs +5 -2
- package/esm2022/plugins/create-board.mjs +3 -3
- package/esm2022/plugins/with-hotkey.mjs +2 -2
- package/esm2022/plugins/with-moving.mjs +88 -10
- package/esm2022/plugins/with-related-fragment.mjs +20 -13
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/utils/angle.mjs +24 -1
- package/esm2022/utils/clipboard/types.mjs +8 -1
- package/esm2022/utils/dom/common.mjs +1 -21
- package/esm2022/utils/fragment.mjs +9 -8
- package/esm2022/utils/group.mjs +19 -19
- package/esm2022/utils/math.mjs +36 -1
- package/esm2022/utils/selected-element.mjs +3 -2
- package/esm2022/utils/selection.mjs +2 -3
- package/esm2022/utils/weak-maps.mjs +2 -1
- package/fesm2022/plait-core.mjs +221 -76
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +3 -3
- package/interfaces/element.d.ts +6 -4
- package/package.json +1 -1
- package/plugins/with-moving.d.ts +3 -1
- package/public-api.d.ts +1 -0
- package/utils/angle.d.ts +2 -0
- package/utils/clipboard/types.d.ts +7 -0
- package/utils/dom/common.d.ts +1 -2
- package/utils/fragment.d.ts +4 -3
- package/utils/group.d.ts +5 -5
- package/utils/math.d.ts +1 -0
- package/utils/weak-maps.d.ts +2 -0
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { IterableDiffers, inject, ViewContainerRef, Directive, Input, Injectable, EventEmitter, ElementRef, Component, ChangeDetectionStrategy, Output, HostBinding, ViewChild, ContentChildren } from '@angular/core';
|
|
2
|
+
import { IterableDiffers, inject, ViewContainerRef, ChangeDetectorRef, Directive, Input, Injectable, EventEmitter, ElementRef, Component, ChangeDetectionStrategy, Output, HostBinding, ViewChild, ContentChildren } from '@angular/core';
|
|
3
3
|
import rough from 'roughjs/bin/rough';
|
|
4
4
|
import { timer, Subject, fromEvent } from 'rxjs';
|
|
5
5
|
import { takeUntil, filter, tap } from 'rxjs/operators';
|
|
@@ -30,6 +30,7 @@ const BOARD_TO_IS_SELECTION_MOVING = new WeakMap();
|
|
|
30
30
|
const BOARD_TO_TEMPORARY_ELEMENTS = new WeakMap();
|
|
31
31
|
const BOARD_TO_MOVING_ELEMENT = new WeakMap();
|
|
32
32
|
const PATH_REFS = new WeakMap();
|
|
33
|
+
const ELEMENT_TO_REF = new WeakMap();
|
|
33
34
|
|
|
34
35
|
var PlaitPointerType;
|
|
35
36
|
(function (PlaitPointerType) {
|
|
@@ -278,7 +279,7 @@ const getHitElementByPoint = (board, point, match = () => true) => {
|
|
|
278
279
|
if (hitElement) {
|
|
279
280
|
return;
|
|
280
281
|
}
|
|
281
|
-
if (PlaitBoard.isBoard(node) || !match(node)) {
|
|
282
|
+
if (PlaitBoard.isBoard(node) || !match(node) || !PlaitElement.hasMounted(node)) {
|
|
282
283
|
return;
|
|
283
284
|
}
|
|
284
285
|
if (board.isHit(node, point)) {
|
|
@@ -544,26 +545,6 @@ function createRect(rectangle, options) {
|
|
|
544
545
|
const setStrokeLinecap = (g, value) => {
|
|
545
546
|
g.setAttribute('stroke-linecap', value);
|
|
546
547
|
};
|
|
547
|
-
const setAngleForG = (g, centerPoint, angle) => {
|
|
548
|
-
if (angle === 0) {
|
|
549
|
-
g.removeAttribute('transform');
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
var centerX = centerPoint[0];
|
|
553
|
-
var centerY = centerPoint[1];
|
|
554
|
-
let cosTheta = Math.cos(angle);
|
|
555
|
-
let sinTheta = Math.sin(angle);
|
|
556
|
-
let transformMatrix = [
|
|
557
|
-
cosTheta,
|
|
558
|
-
sinTheta,
|
|
559
|
-
-sinTheta,
|
|
560
|
-
cosTheta,
|
|
561
|
-
centerX * (1 - cosTheta) + centerY * sinTheta,
|
|
562
|
-
centerY * (1 - cosTheta) - centerX * sinTheta
|
|
563
|
-
];
|
|
564
|
-
let matrix = 'matrix(' + transformMatrix.join(',') + ')';
|
|
565
|
-
g.setAttribute('transform', `${matrix}`);
|
|
566
|
-
};
|
|
567
548
|
const setPathStrokeLinecap = (g, value) => {
|
|
568
549
|
g.querySelectorAll('path').forEach(path => {
|
|
569
550
|
path.setAttribute('stroke-linecap', value);
|
|
@@ -848,6 +829,7 @@ class PlaitPluginElementComponent {
|
|
|
848
829
|
const containerG = this.getContainerG();
|
|
849
830
|
NODE_TO_G.set(this.element, elementG);
|
|
850
831
|
NODE_TO_CONTAINER_G.set(this.element, containerG);
|
|
832
|
+
ELEMENT_TO_REF.set(this.element, this.ref);
|
|
851
833
|
this.updateListRender();
|
|
852
834
|
this.cdr.markForCheck();
|
|
853
835
|
if (hasOnContextChanged(this)) {
|
|
@@ -866,6 +848,7 @@ class PlaitPluginElementComponent {
|
|
|
866
848
|
}
|
|
867
849
|
NODE_TO_G.set(this.element, this._g);
|
|
868
850
|
NODE_TO_CONTAINER_G.set(this.element, this._containerG);
|
|
851
|
+
ELEMENT_TO_REF.set(this.element, this.ref);
|
|
869
852
|
}
|
|
870
853
|
}
|
|
871
854
|
get context() {
|
|
@@ -886,9 +869,10 @@ class PlaitPluginElementComponent {
|
|
|
886
869
|
getElementG() {
|
|
887
870
|
return this._g;
|
|
888
871
|
}
|
|
889
|
-
constructor(
|
|
890
|
-
this.
|
|
872
|
+
constructor(ref) {
|
|
873
|
+
this.ref = ref;
|
|
891
874
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
875
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
892
876
|
this.initialized = false;
|
|
893
877
|
}
|
|
894
878
|
ngOnInit() {
|
|
@@ -916,6 +900,9 @@ class PlaitPluginElementComponent {
|
|
|
916
900
|
}
|
|
917
901
|
}
|
|
918
902
|
}
|
|
903
|
+
getRef() {
|
|
904
|
+
return this.ref;
|
|
905
|
+
}
|
|
919
906
|
updateListRender() {
|
|
920
907
|
if (this.hasChildren) {
|
|
921
908
|
if (!this.listRender) {
|
|
@@ -951,15 +938,18 @@ class PlaitPluginElementComponent {
|
|
|
951
938
|
if (NODE_TO_CONTAINER_G.get(this.element) === this._containerG) {
|
|
952
939
|
NODE_TO_CONTAINER_G.delete(this.element);
|
|
953
940
|
}
|
|
941
|
+
if (ELEMENT_TO_REF.get(this.element) === this.ref) {
|
|
942
|
+
ELEMENT_TO_REF.set(this.element, this.ref);
|
|
943
|
+
}
|
|
954
944
|
removeSelectedElement(this.board, this.element);
|
|
955
945
|
this.getContainerG().remove();
|
|
956
946
|
}
|
|
957
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitPluginElementComponent, deps:
|
|
947
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitPluginElementComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
|
958
948
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: PlaitPluginElementComponent, inputs: { context: "context" }, ngImport: i0 }); }
|
|
959
949
|
}
|
|
960
950
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitPluginElementComponent, decorators: [{
|
|
961
951
|
type: Directive
|
|
962
|
-
}], ctorParameters: () => [{ type:
|
|
952
|
+
}], ctorParameters: () => [{ type: undefined }], propDecorators: { context: [{
|
|
963
953
|
type: Input
|
|
964
954
|
}] } });
|
|
965
955
|
const ELEMENT_TO_COMPONENT = new WeakMap();
|
|
@@ -1052,6 +1042,41 @@ function getNearestPointBetweenPointAndSegments(point, points, isClose = true) {
|
|
|
1052
1042
|
}
|
|
1053
1043
|
return result;
|
|
1054
1044
|
}
|
|
1045
|
+
function getNearestPointBetweenPointAndEllipse(point, center, rx, ry, rotation = 0) {
|
|
1046
|
+
const rectangleClient = {
|
|
1047
|
+
x: center[0] - rx,
|
|
1048
|
+
y: center[1] - ry,
|
|
1049
|
+
height: ry * 2,
|
|
1050
|
+
width: rx * 2
|
|
1051
|
+
};
|
|
1052
|
+
// https://stackoverflow.com/a/46007540/232122
|
|
1053
|
+
const px = Math.abs(point[0] - rectangleClient.x - rectangleClient.width / 2);
|
|
1054
|
+
const py = Math.abs(point[1] - rectangleClient.y - rectangleClient.height / 2);
|
|
1055
|
+
let tx = 0.707;
|
|
1056
|
+
let ty = 0.707;
|
|
1057
|
+
const a = Math.abs(rectangleClient.width) / 2;
|
|
1058
|
+
const b = Math.abs(rectangleClient.height) / 2;
|
|
1059
|
+
[0, 1, 2, 3].forEach(x => {
|
|
1060
|
+
const xx = a * tx;
|
|
1061
|
+
const yy = b * ty;
|
|
1062
|
+
const ex = ((a * a - b * b) * tx ** 3) / a;
|
|
1063
|
+
const ey = ((b * b - a * a) * ty ** 3) / b;
|
|
1064
|
+
const rx = xx - ex;
|
|
1065
|
+
const ry = yy - ey;
|
|
1066
|
+
const qx = px - ex;
|
|
1067
|
+
const qy = py - ey;
|
|
1068
|
+
const r = Math.hypot(ry, rx);
|
|
1069
|
+
const q = Math.hypot(qy, qx);
|
|
1070
|
+
tx = Math.min(1, Math.max(0, ((qx * r) / q + ex) / a));
|
|
1071
|
+
ty = Math.min(1, Math.max(0, ((qy * r) / q + ey) / b));
|
|
1072
|
+
const t = Math.hypot(ty, tx);
|
|
1073
|
+
tx /= t;
|
|
1074
|
+
ty /= t;
|
|
1075
|
+
});
|
|
1076
|
+
const signX = point[0] > center[0] ? 1 : -1;
|
|
1077
|
+
const signY = point[1] > center[1] ? 1 : -1;
|
|
1078
|
+
return [center[0] + a * tx * signX, center[1] + b * ty * signY];
|
|
1079
|
+
}
|
|
1055
1080
|
function rotate(x1, y1, x2, y2, angle) {
|
|
1056
1081
|
// 𝑎′𝑥=(𝑎𝑥−𝑐𝑥)cos𝜃−(𝑎𝑦−𝑐𝑦)sin𝜃+𝑐𝑥
|
|
1057
1082
|
// 𝑎′𝑦=(𝑎𝑥−𝑐𝑥)sin𝜃+(𝑎𝑦−𝑐𝑦)cos𝜃+𝑐𝑦.
|
|
@@ -2612,6 +2637,13 @@ var WritableClipboardType;
|
|
|
2612
2637
|
WritableClipboardType["medias"] = "medias";
|
|
2613
2638
|
WritableClipboardType["elements"] = "elements";
|
|
2614
2639
|
})(WritableClipboardType || (WritableClipboardType = {}));
|
|
2640
|
+
var WritableClipboardOperationType;
|
|
2641
|
+
(function (WritableClipboardOperationType) {
|
|
2642
|
+
WritableClipboardOperationType["copy"] = "copy";
|
|
2643
|
+
WritableClipboardOperationType["cut"] = "cut";
|
|
2644
|
+
WritableClipboardOperationType["duplicate"] = "duplicate";
|
|
2645
|
+
WritableClipboardOperationType["paste"] = "paste";
|
|
2646
|
+
})(WritableClipboardOperationType || (WritableClipboardOperationType = {}));
|
|
2615
2647
|
|
|
2616
2648
|
const buildPlaitHtml = (type, data) => {
|
|
2617
2649
|
const stringifiedClipboard = JSON.stringify({
|
|
@@ -3425,6 +3457,29 @@ const getAngleBetweenPoints = (startPoint, endPoint, centerPoint) => {
|
|
|
3425
3457
|
const endAngle = (5 * Math.PI) / 2 + Math.atan2(endPoint[1] - centerPoint[1], endPoint[0] - centerPoint[0]);
|
|
3426
3458
|
return normalizeAngle(endAngle - startAngle);
|
|
3427
3459
|
};
|
|
3460
|
+
const getAngleByElement = (element) => {
|
|
3461
|
+
return element?.angle;
|
|
3462
|
+
};
|
|
3463
|
+
const setAngleForG = (g, centerPoint, angle) => {
|
|
3464
|
+
if (angle === 0) {
|
|
3465
|
+
g.removeAttribute('transform');
|
|
3466
|
+
return;
|
|
3467
|
+
}
|
|
3468
|
+
var centerX = centerPoint[0];
|
|
3469
|
+
var centerY = centerPoint[1];
|
|
3470
|
+
let cosTheta = Math.cos(angle);
|
|
3471
|
+
let sinTheta = Math.sin(angle);
|
|
3472
|
+
let transformMatrix = [
|
|
3473
|
+
cosTheta,
|
|
3474
|
+
sinTheta,
|
|
3475
|
+
-sinTheta,
|
|
3476
|
+
cosTheta,
|
|
3477
|
+
centerX * (1 - cosTheta) + centerY * sinTheta,
|
|
3478
|
+
centerY * (1 - cosTheta) - centerX * sinTheta
|
|
3479
|
+
];
|
|
3480
|
+
let matrix = 'matrix(' + transformMatrix.join(',') + ')';
|
|
3481
|
+
g.setAttribute('transform', `${matrix}`);
|
|
3482
|
+
};
|
|
3428
3483
|
|
|
3429
3484
|
function isSelectionMoving(board) {
|
|
3430
3485
|
return !!BOARD_TO_IS_SELECTION_MOVING.get(board);
|
|
@@ -3592,14 +3647,14 @@ const getRectangleByGroup = (board, group, recursion) => {
|
|
|
3592
3647
|
const elementsInGroup = getAllElementsInGroup(board, group, recursion);
|
|
3593
3648
|
return getRectangleByElements(board, elementsInGroup, false);
|
|
3594
3649
|
};
|
|
3595
|
-
const getGroupByElement = (board, element, recursion,
|
|
3596
|
-
const group = (
|
|
3650
|
+
const getGroupByElement = (board, element, recursion, originElements) => {
|
|
3651
|
+
const group = (originElements || board.children).find(item => item.id === element?.groupId);
|
|
3597
3652
|
if (!group) {
|
|
3598
3653
|
return recursion ? [] : null;
|
|
3599
3654
|
}
|
|
3600
3655
|
if (recursion) {
|
|
3601
3656
|
const groups = [group];
|
|
3602
|
-
const grandGroups = getGroupByElement(board, group, recursion,
|
|
3657
|
+
const grandGroups = getGroupByElement(board, group, recursion, originElements);
|
|
3603
3658
|
if (grandGroups.length) {
|
|
3604
3659
|
groups.push(...grandGroups);
|
|
3605
3660
|
}
|
|
@@ -3626,14 +3681,14 @@ const getElementsInGroupByElement = (board, element) => {
|
|
|
3626
3681
|
}
|
|
3627
3682
|
};
|
|
3628
3683
|
const isSelectedElementOrGroup = (board, element, elements) => {
|
|
3629
|
-
const selectedElements = elements
|
|
3684
|
+
const selectedElements = elements?.length ? elements : getSelectedElements(board);
|
|
3630
3685
|
if (PlaitGroupElement.isGroup(element)) {
|
|
3631
3686
|
return isSelectedAllElementsInGroup(board, element, elements);
|
|
3632
3687
|
}
|
|
3633
3688
|
return selectedElements.map(item => item.id).includes(element.id);
|
|
3634
3689
|
};
|
|
3635
3690
|
const isSelectedAllElementsInGroup = (board, group, elements) => {
|
|
3636
|
-
const selectedElements = elements
|
|
3691
|
+
const selectedElements = elements?.length ? elements : getSelectedElements(board);
|
|
3637
3692
|
const elementsInGroup = getElementsInGroup(board, group, true);
|
|
3638
3693
|
return elementsInGroup.every(item => selectedElements.map(element => element.id).includes(item.id));
|
|
3639
3694
|
};
|
|
@@ -3646,8 +3701,8 @@ const filterSelectedGroups = (board, groups, elements) => {
|
|
|
3646
3701
|
});
|
|
3647
3702
|
return selectedGroups;
|
|
3648
3703
|
};
|
|
3649
|
-
const getSelectedGroups = (board, elements) => {
|
|
3650
|
-
const highestSelectedGroups = getHighestSelectedGroups(board, elements);
|
|
3704
|
+
const getSelectedGroups = (board, elements, originElements) => {
|
|
3705
|
+
const highestSelectedGroups = getHighestSelectedGroups(board, elements, originElements);
|
|
3651
3706
|
const groups = [];
|
|
3652
3707
|
highestSelectedGroups.forEach(item => {
|
|
3653
3708
|
groups.push(item);
|
|
@@ -3656,20 +3711,20 @@ const getSelectedGroups = (board, elements) => {
|
|
|
3656
3711
|
});
|
|
3657
3712
|
return groups;
|
|
3658
3713
|
};
|
|
3659
|
-
const getHighestSelectedGroup = (board, element, elements) => {
|
|
3660
|
-
const hitElementGroups = getGroupByElement(board, element, true,
|
|
3714
|
+
const getHighestSelectedGroup = (board, element, elements, originElements) => {
|
|
3715
|
+
const hitElementGroups = getGroupByElement(board, element, true, originElements);
|
|
3661
3716
|
const selectedGroups = filterSelectedGroups(board, hitElementGroups, elements);
|
|
3662
3717
|
if (selectedGroups.length) {
|
|
3663
3718
|
return selectedGroups[selectedGroups.length - 1];
|
|
3664
3719
|
}
|
|
3665
3720
|
return null;
|
|
3666
3721
|
};
|
|
3667
|
-
const getHighestSelectedGroups = (board, elements) => {
|
|
3722
|
+
const getHighestSelectedGroups = (board, elements, originElements) => {
|
|
3668
3723
|
let result = [];
|
|
3669
|
-
const selectedElements = elements
|
|
3724
|
+
const selectedElements = elements?.length ? elements : getSelectedElements(board);
|
|
3670
3725
|
selectedElements.forEach(item => {
|
|
3671
3726
|
if (item.groupId) {
|
|
3672
|
-
const group = getHighestSelectedGroup(board, item, elements);
|
|
3727
|
+
const group = getHighestSelectedGroup(board, item, elements, originElements);
|
|
3673
3728
|
if (group && !result.includes(group)) {
|
|
3674
3729
|
result.push(group);
|
|
3675
3730
|
}
|
|
@@ -3679,7 +3734,7 @@ const getHighestSelectedGroups = (board, elements) => {
|
|
|
3679
3734
|
};
|
|
3680
3735
|
const getSelectedIsolatedElements = (board, elements) => {
|
|
3681
3736
|
let result = [];
|
|
3682
|
-
const selectedElements = elements
|
|
3737
|
+
const selectedElements = elements?.length ? elements : getSelectedElements(board);
|
|
3683
3738
|
selectedElements
|
|
3684
3739
|
.filter(item => !PlaitGroupElement.isGroup(item))
|
|
3685
3740
|
.forEach(item => {
|
|
@@ -3754,9 +3809,9 @@ const canAddGroup = (board, elements) => {
|
|
|
3754
3809
|
}
|
|
3755
3810
|
return false;
|
|
3756
3811
|
};
|
|
3757
|
-
const canRemoveGroup = (board, elements) => {
|
|
3758
|
-
const selectedGroups = getHighestSelectedGroups(board, elements);
|
|
3759
|
-
const selectedElements = elements
|
|
3812
|
+
const canRemoveGroup = (board, elements, originElements) => {
|
|
3813
|
+
const selectedGroups = getHighestSelectedGroups(board, elements, originElements);
|
|
3814
|
+
const selectedElements = elements?.length ? elements : getSelectedElements(board);
|
|
3760
3815
|
return selectedElements.length > 0 && selectedGroups.length > 0;
|
|
3761
3816
|
};
|
|
3762
3817
|
const getEditingGroup = (board, element) => {
|
|
@@ -3788,23 +3843,23 @@ const deleteFragment = (board) => {
|
|
|
3788
3843
|
const elements = board.getDeletedFragment([]);
|
|
3789
3844
|
board.deleteFragment(elements);
|
|
3790
3845
|
};
|
|
3791
|
-
const setFragment = (board,
|
|
3846
|
+
const setFragment = (board, operationType, clipboardData) => {
|
|
3792
3847
|
const selectedElements = getSelectedElements(board);
|
|
3793
3848
|
const rectangle = getRectangleByElements(board, selectedElements, false);
|
|
3794
|
-
const clipboardContext = board.buildFragment(null, rectangle,
|
|
3849
|
+
const clipboardContext = board.buildFragment(null, rectangle, operationType);
|
|
3795
3850
|
clipboardContext && setClipboardData(clipboardData, clipboardContext);
|
|
3796
3851
|
};
|
|
3797
|
-
const duplicateElements = (board, elements) => {
|
|
3798
|
-
const
|
|
3799
|
-
const
|
|
3800
|
-
const clipboardContext = board.buildFragment(null,
|
|
3852
|
+
const duplicateElements = (board, elements, point) => {
|
|
3853
|
+
const targetElements = elements?.length ? elements : getSelectedElements(board);
|
|
3854
|
+
const targetRectangle = getRectangleByElements(board, targetElements, false);
|
|
3855
|
+
const clipboardContext = board.buildFragment(null, targetRectangle, WritableClipboardOperationType.duplicate, targetElements);
|
|
3801
3856
|
const stringifiedContext = clipboardContext && JSON.stringify(clipboardContext);
|
|
3802
3857
|
const clonedContext = stringifiedContext && JSON.parse(stringifiedContext);
|
|
3803
3858
|
clonedContext &&
|
|
3804
3859
|
board.insertFragment({
|
|
3805
3860
|
...clonedContext,
|
|
3806
3861
|
text: undefined
|
|
3807
|
-
}, [
|
|
3862
|
+
}, point || [targetRectangle.x + targetRectangle.width / 2, targetRectangle.y + targetRectangle.height / 2], WritableClipboardOperationType.duplicate);
|
|
3808
3863
|
};
|
|
3809
3864
|
|
|
3810
3865
|
const SNAP_TOLERANCE = 2;
|
|
@@ -4024,6 +4079,9 @@ const PlaitElement = {
|
|
|
4024
4079
|
getComponent(value) {
|
|
4025
4080
|
return ELEMENT_TO_COMPONENT.get(value);
|
|
4026
4081
|
},
|
|
4082
|
+
getElementRef(value) {
|
|
4083
|
+
return ELEMENT_TO_REF.get(value);
|
|
4084
|
+
},
|
|
4027
4085
|
getElementG(value) {
|
|
4028
4086
|
const g = NODE_TO_G.get(value);
|
|
4029
4087
|
if (!g) {
|
|
@@ -4490,8 +4548,8 @@ function createBoard(children, options) {
|
|
|
4490
4548
|
globalKeyDown: (event) => { },
|
|
4491
4549
|
keyUp: (event) => { },
|
|
4492
4550
|
dblClick: (event) => { },
|
|
4493
|
-
buildFragment: (clipboardContext) => clipboardContext,
|
|
4494
|
-
insertFragment: () => { },
|
|
4551
|
+
buildFragment: (clipboardContext, rectangle, operationType, originData) => clipboardContext,
|
|
4552
|
+
insertFragment: (clipboardData, targetPoint, operationType) => { },
|
|
4495
4553
|
deleteFragment: (elements) => {
|
|
4496
4554
|
CoreTransforms.removeElements(board, elements);
|
|
4497
4555
|
},
|
|
@@ -5111,7 +5169,7 @@ function isVerticalCross(rectangle, other) {
|
|
|
5111
5169
|
}
|
|
5112
5170
|
|
|
5113
5171
|
function withMoving(board) {
|
|
5114
|
-
const { pointerDown, pointerMove, globalPointerUp, globalPointerMove } = board;
|
|
5172
|
+
const { pointerDown, pointerMove, globalPointerUp, globalPointerMove, globalKeyDown, keyUp } = board;
|
|
5115
5173
|
let offsetX = 0;
|
|
5116
5174
|
let offsetY = 0;
|
|
5117
5175
|
let isPreventDefault = false;
|
|
@@ -5122,6 +5180,31 @@ function withMoving(board) {
|
|
|
5122
5180
|
let selectedTargetElements = null;
|
|
5123
5181
|
let hitTargetElement = undefined;
|
|
5124
5182
|
let isHitSelectedTarget = undefined;
|
|
5183
|
+
let pendingNodesG = null;
|
|
5184
|
+
board.globalKeyDown = (event) => {
|
|
5185
|
+
if (!PlaitBoard.isReadonly(board)) {
|
|
5186
|
+
if (isKeyHotkey('option', event)) {
|
|
5187
|
+
event.preventDefault();
|
|
5188
|
+
if (startPoint && activeElements.length && !PlaitBoard.hasBeenTextEditing(board)) {
|
|
5189
|
+
pendingNodesG = drawPendingNodesG(board, activeElements, offsetX, offsetY);
|
|
5190
|
+
pendingNodesG && PlaitBoard.getElementActiveHost(board).append(pendingNodesG);
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
globalKeyDown(event);
|
|
5195
|
+
};
|
|
5196
|
+
board.keyUp = (event) => {
|
|
5197
|
+
if (!PlaitBoard.isReadonly(board)) {
|
|
5198
|
+
if (pendingNodesG && startPoint && activeElements.length && !PlaitBoard.hasBeenTextEditing(board)) {
|
|
5199
|
+
event.preventDefault();
|
|
5200
|
+
const currentElements = updatePoints(board, activeElements, offsetX, offsetY);
|
|
5201
|
+
PlaitBoard.getBoardContainer(board).classList.add('element-moving');
|
|
5202
|
+
cacheMovingElements(board, currentElements);
|
|
5203
|
+
}
|
|
5204
|
+
}
|
|
5205
|
+
pendingNodesG?.remove();
|
|
5206
|
+
keyUp(event);
|
|
5207
|
+
};
|
|
5125
5208
|
board.pointerDown = (event) => {
|
|
5126
5209
|
if (PlaitBoard.isReadonly(board) ||
|
|
5127
5210
|
!PlaitBoard.isPointer(board, PlaitPointerType.selection) ||
|
|
@@ -5167,6 +5250,7 @@ function withMoving(board) {
|
|
|
5167
5250
|
isPreventDefault = true;
|
|
5168
5251
|
}
|
|
5169
5252
|
snapG?.remove();
|
|
5253
|
+
pendingNodesG?.remove();
|
|
5170
5254
|
const endPoint = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
5171
5255
|
offsetX = endPoint[0] - startPoint[0];
|
|
5172
5256
|
offsetY = endPoint[1] - startPoint[1];
|
|
@@ -5195,9 +5279,15 @@ function withMoving(board) {
|
|
|
5195
5279
|
snapG.classList.add(ACTIVE_MOVING_CLASS_NAME);
|
|
5196
5280
|
PlaitBoard.getElementActiveHost(board).append(snapG);
|
|
5197
5281
|
handleTouchTarget(board);
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5282
|
+
if (event.altKey) {
|
|
5283
|
+
pendingNodesG = drawPendingNodesG(board, activeElements, offsetX, offsetY);
|
|
5284
|
+
pendingNodesG && PlaitBoard.getElementActiveHost(board).append(pendingNodesG);
|
|
5285
|
+
}
|
|
5286
|
+
else {
|
|
5287
|
+
const currentElements = updatePoints(board, activeElements, offsetX, offsetY);
|
|
5288
|
+
PlaitBoard.getBoardContainer(board).classList.add('element-moving');
|
|
5289
|
+
cacheMovingElements(board, currentElements);
|
|
5290
|
+
}
|
|
5201
5291
|
});
|
|
5202
5292
|
}
|
|
5203
5293
|
}
|
|
@@ -5217,6 +5307,11 @@ function withMoving(board) {
|
|
|
5217
5307
|
globalPointerMove(event);
|
|
5218
5308
|
};
|
|
5219
5309
|
board.globalPointerUp = event => {
|
|
5310
|
+
if (event.altKey && activeElements.length) {
|
|
5311
|
+
const validElements = getValidElements(board, activeElements);
|
|
5312
|
+
const rectangle = getRectangleByElements(board, validElements, false);
|
|
5313
|
+
duplicateElements(board, validElements, [rectangle.x + offsetX, rectangle.y + offsetY]);
|
|
5314
|
+
}
|
|
5220
5315
|
isPreventDefault = false;
|
|
5221
5316
|
hitTargetElement = undefined;
|
|
5222
5317
|
selectedTargetElements = null;
|
|
@@ -5229,6 +5324,7 @@ function withMoving(board) {
|
|
|
5229
5324
|
};
|
|
5230
5325
|
function cancelMove(board) {
|
|
5231
5326
|
snapG?.remove();
|
|
5327
|
+
pendingNodesG?.remove();
|
|
5232
5328
|
startPoint = null;
|
|
5233
5329
|
activeElementsRectangle = null;
|
|
5234
5330
|
offsetX = 0;
|
|
@@ -5292,8 +5388,12 @@ function getSelectedTargetElements(board) {
|
|
|
5292
5388
|
targetElements.push(...relatedElements);
|
|
5293
5389
|
return targetElements;
|
|
5294
5390
|
}
|
|
5295
|
-
function
|
|
5296
|
-
const validElements =
|
|
5391
|
+
function getValidElements(board, activeElements) {
|
|
5392
|
+
const validElements = [...activeElements].filter(element => !PlaitGroupElement.isGroup(element) && board.children.findIndex(item => item.id === element.id) > -1);
|
|
5393
|
+
return validElements;
|
|
5394
|
+
}
|
|
5395
|
+
function updatePoints(board, activeElements, offsetX, offsetY) {
|
|
5396
|
+
const validElements = getValidElements(board, activeElements);
|
|
5297
5397
|
const currentElements = validElements.map(element => {
|
|
5298
5398
|
const points = element.points || [];
|
|
5299
5399
|
const newPoints = points.map(p => [p[0] + offsetX, p[1] + offsetY]);
|
|
@@ -5306,6 +5406,41 @@ function updatePoints(board, targetElements, offsetX, offsetY) {
|
|
|
5306
5406
|
});
|
|
5307
5407
|
return currentElements;
|
|
5308
5408
|
}
|
|
5409
|
+
function drawPendingNodesG(board, activeElements, offsetX, offsetY) {
|
|
5410
|
+
let pendingNodesG = null;
|
|
5411
|
+
const elements = [];
|
|
5412
|
+
const validElements = getValidElements(board, activeElements);
|
|
5413
|
+
validElements.forEach(element => {
|
|
5414
|
+
depthFirstRecursion(element, node => {
|
|
5415
|
+
elements.push(node);
|
|
5416
|
+
}, () => true);
|
|
5417
|
+
});
|
|
5418
|
+
elements.forEach(item => {
|
|
5419
|
+
let rectangle = board.getRectangle(item);
|
|
5420
|
+
if (rectangle) {
|
|
5421
|
+
rectangle = {
|
|
5422
|
+
x: rectangle.x + offsetX,
|
|
5423
|
+
y: rectangle.y + offsetY,
|
|
5424
|
+
width: rectangle.width,
|
|
5425
|
+
height: rectangle.height
|
|
5426
|
+
};
|
|
5427
|
+
const movingG = drawRectangle(board, rectangle, {
|
|
5428
|
+
stroke: SELECTION_BORDER_COLOR,
|
|
5429
|
+
strokeWidth: 1,
|
|
5430
|
+
fill: SELECTION_FILL_COLOR,
|
|
5431
|
+
fillStyle: 'solid'
|
|
5432
|
+
});
|
|
5433
|
+
if (!pendingNodesG) {
|
|
5434
|
+
pendingNodesG = createG();
|
|
5435
|
+
pendingNodesG.classList.add(ACTIVE_MOVING_CLASS_NAME);
|
|
5436
|
+
}
|
|
5437
|
+
const angle = getAngleByElement(item);
|
|
5438
|
+
angle && setAngleForG(movingG, RectangleClient.getCenterPoint(rectangle), angle);
|
|
5439
|
+
pendingNodesG.append(movingG);
|
|
5440
|
+
}
|
|
5441
|
+
});
|
|
5442
|
+
return pendingNodesG;
|
|
5443
|
+
}
|
|
5309
5444
|
|
|
5310
5445
|
const withOptions = (board) => {
|
|
5311
5446
|
const pluginOptions = new Map();
|
|
@@ -5438,7 +5573,7 @@ const withHotkey = (board) => {
|
|
|
5438
5573
|
if (!PlaitBoard.isReadonly(board) && selectedElements.length > 0) {
|
|
5439
5574
|
if (isKeyHotkey('mod+d', event)) {
|
|
5440
5575
|
event.preventDefault();
|
|
5441
|
-
duplicateElements(board
|
|
5576
|
+
duplicateElements(board);
|
|
5442
5577
|
return;
|
|
5443
5578
|
}
|
|
5444
5579
|
}
|
|
@@ -5510,19 +5645,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
5510
5645
|
|
|
5511
5646
|
function withRelatedFragment(board) {
|
|
5512
5647
|
const { buildFragment } = board;
|
|
5513
|
-
board.buildFragment = (clipboardContext, rectangle,
|
|
5514
|
-
|
|
5515
|
-
if (
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5648
|
+
board.buildFragment = (clipboardContext, rectangle, operationType, originData) => {
|
|
5649
|
+
let relatedFragment = board.getRelatedFragment(originData || []);
|
|
5650
|
+
if (relatedFragment) {
|
|
5651
|
+
if (originData?.length) {
|
|
5652
|
+
relatedFragment = relatedFragment.filter(item => !originData.map(element => element.id).includes(item.id));
|
|
5653
|
+
}
|
|
5654
|
+
if (relatedFragment.length) {
|
|
5655
|
+
if (!clipboardContext) {
|
|
5656
|
+
clipboardContext = createClipboardContext(WritableClipboardType.elements, relatedFragment, '');
|
|
5657
|
+
}
|
|
5658
|
+
else {
|
|
5659
|
+
clipboardContext = addClipboardContext(clipboardContext, {
|
|
5660
|
+
text: '',
|
|
5661
|
+
type: WritableClipboardType.elements,
|
|
5662
|
+
elements: relatedFragment
|
|
5663
|
+
});
|
|
5664
|
+
}
|
|
5665
|
+
}
|
|
5524
5666
|
}
|
|
5525
|
-
return buildFragment(clipboardContext, rectangle,
|
|
5667
|
+
return buildFragment(clipboardContext, rectangle, operationType, originData);
|
|
5526
5668
|
};
|
|
5527
5669
|
return board;
|
|
5528
5670
|
}
|
|
@@ -5636,10 +5778,13 @@ class PlaitBoardComponent {
|
|
|
5636
5778
|
if (this.hasInitialized) {
|
|
5637
5779
|
const valueChange = changes['plaitValue'];
|
|
5638
5780
|
const options = changes['plaitOptions'];
|
|
5639
|
-
if (valueChange)
|
|
5781
|
+
if (valueChange) {
|
|
5640
5782
|
this.board.children = valueChange.currentValue;
|
|
5641
|
-
|
|
5783
|
+
this.updateListRender();
|
|
5784
|
+
}
|
|
5785
|
+
if (options) {
|
|
5642
5786
|
this.board.options = options.currentValue;
|
|
5787
|
+
}
|
|
5643
5788
|
this.cdr.markForCheck();
|
|
5644
5789
|
}
|
|
5645
5790
|
}
|
|
@@ -5750,7 +5895,7 @@ class PlaitBoardComponent {
|
|
|
5750
5895
|
.pipe(takeUntil(this.destroy$), filter(() => this.isFocused && !PlaitBoard.hasBeenTextEditing(this.board)))
|
|
5751
5896
|
.subscribe((event) => {
|
|
5752
5897
|
event.preventDefault();
|
|
5753
|
-
setFragment(this.board,
|
|
5898
|
+
setFragment(this.board, WritableClipboardOperationType.copy, event.clipboardData);
|
|
5754
5899
|
});
|
|
5755
5900
|
fromEvent(document, 'paste')
|
|
5756
5901
|
.pipe(takeUntil(this.destroy$), filter(() => this.isFocused && !PlaitBoard.isReadonly(this.board) && !PlaitBoard.hasBeenTextEditing(this.board)))
|
|
@@ -5759,14 +5904,14 @@ class PlaitBoardComponent {
|
|
|
5759
5904
|
if (mousePoint) {
|
|
5760
5905
|
const targetPoint = toViewBoxPoint(this.board, toHostPoint(this.board, mousePoint[0], mousePoint[1]));
|
|
5761
5906
|
const clipboardData = await getClipboardData(clipboardEvent.clipboardData);
|
|
5762
|
-
this.board.insertFragment(clipboardData, targetPoint);
|
|
5907
|
+
this.board.insertFragment(clipboardData, targetPoint, WritableClipboardOperationType.paste);
|
|
5763
5908
|
}
|
|
5764
5909
|
});
|
|
5765
5910
|
fromEvent(document, 'cut')
|
|
5766
5911
|
.pipe(takeUntil(this.destroy$), filter(() => this.isFocused && !PlaitBoard.isReadonly(this.board) && !PlaitBoard.hasBeenTextEditing(this.board)))
|
|
5767
5912
|
.subscribe((event) => {
|
|
5768
5913
|
event.preventDefault();
|
|
5769
|
-
setFragment(this.board,
|
|
5914
|
+
setFragment(this.board, WritableClipboardOperationType.cut, event.clipboardData);
|
|
5770
5915
|
deleteFragment(this.board);
|
|
5771
5916
|
});
|
|
5772
5917
|
}
|
|
@@ -6199,5 +6344,5 @@ const isDebug = (key) => {
|
|
|
6199
6344
|
* Generated bundle index. Do not edit.
|
|
6200
6345
|
*/
|
|
6201
6346
|
|
|
6202
|
-
export { A, ACTIVE_MOVING_CLASS_NAME, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, BOARD_TO_AFTER_CHANGE, BOARD_TO_COMPONENT, BOARD_TO_ELEMENT_HOST, BOARD_TO_HOST, BOARD_TO_IS_SELECTION_MOVING, BOARD_TO_MOVING_ELEMENT, BOARD_TO_MOVING_POINT, BOARD_TO_MOVING_POINT_IN_BOARD, BOARD_TO_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_COMPONENT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FLUSHING, FOUR, G, H, HIT_DISTANCE_BUFFER, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, IS_BOARD_ALIVE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_MAC, IS_SAFARI, IS_TEXT_EDITABLE, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MERGING, META, MUTE, N, NINE, NODE_TO_CONTAINER_G, NODE_TO_G, NODE_TO_INDEX, NODE_TO_PARENT, NS, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PATH_REFS, PAUSE, PERIOD, PLUS_SIGN, POINTER_BUTTON, PRESS_AND_MOVE_BUFFER, PRINT_SCREEN, Path, PlaitBoard, PlaitBoardComponent, PlaitContextService, PlaitElement, PlaitGroupElement, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RESIZE_CURSORS, RESIZE_HANDLE_CLASS_NAME, RIGHT_ARROW, ROTATE_HANDLE_CLASS_NAME, RectangleClient, ResizeCursorClass, RetroThemeColor, RgbaToHEX, S, SAVING, SCROLL_BAR_WIDTH, SCROLL_LOCK, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SNAPPING_STROKE_WIDTH, SNAP_TOLERANCE, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, WritableClipboardType, X, Y, Z, ZERO, addClipboardContext, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createClipboardContext, createDebugGenerator, createFakeEvent, createForeignObject, createG, createGroup, createGroupRectangleG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createTestingBoard, createText, createTouchEvent, debounce, degreesToRadians, deleteFragment, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downloadImage, drawArrow, drawBezierPath, drawCircle, drawDashedLines, drawEntireActiveRectangleG, drawLine, drawLinearPath, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getBarPoint, getBoardRectangle, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, getElementsInGroup, getElementsInGroupByElement, getElementsIndices, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getNearestPointRectangle, getOffsetAfterRotate, getOneMoveOptions, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByAngle, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectedIsolatedElementsCanAddToGroup, getSelectedTargetElements, getSelectionAngle, getSnapRectangles, getTemporaryElements, getTemporaryRef, getTripleAxis, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, hasValidAngle, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isAxisChangedByAngle, isContextmenu, isDOMElement, isDOMNode, isDebug, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isIndicesContinuous, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, isSnapPoint, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, preventTouchMove, radiansToDegrees, removeMovingElements, removeSelectedElement, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, rotatePointsByElement, rotatedDataPoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setFragment, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectedElementsWithGroup, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, sortElements, stripHtml, temporaryDisableSelection, throttleRAF, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, uniqueById, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withMoving, withOptions, withSelection };
|
|
6347
|
+
export { A, ACTIVE_MOVING_CLASS_NAME, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, BOARD_TO_AFTER_CHANGE, BOARD_TO_COMPONENT, BOARD_TO_ELEMENT_HOST, BOARD_TO_HOST, BOARD_TO_IS_SELECTION_MOVING, BOARD_TO_MOVING_ELEMENT, BOARD_TO_MOVING_POINT, BOARD_TO_MOVING_POINT_IN_BOARD, BOARD_TO_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_COMPONENT, ELEMENT_TO_REF, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FLUSHING, FOUR, G, H, HIT_DISTANCE_BUFFER, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, IS_BOARD_ALIVE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_MAC, IS_SAFARI, IS_TEXT_EDITABLE, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MERGING, META, MUTE, N, NINE, NODE_TO_CONTAINER_G, NODE_TO_G, NODE_TO_INDEX, NODE_TO_PARENT, NS, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PATH_REFS, PAUSE, PERIOD, PLUS_SIGN, POINTER_BUTTON, PRESS_AND_MOVE_BUFFER, PRINT_SCREEN, Path, PlaitBoard, PlaitBoardComponent, PlaitContextService, PlaitElement, PlaitGroupElement, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RESIZE_CURSORS, RESIZE_HANDLE_CLASS_NAME, RIGHT_ARROW, ROTATE_HANDLE_CLASS_NAME, RectangleClient, ResizeCursorClass, RetroThemeColor, RgbaToHEX, S, SAVING, SCROLL_BAR_WIDTH, SCROLL_LOCK, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SNAPPING_STROKE_WIDTH, SNAP_TOLERANCE, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, WritableClipboardOperationType, WritableClipboardType, X, Y, Z, ZERO, addClipboardContext, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createClipboardContext, createDebugGenerator, createFakeEvent, createForeignObject, createG, createGroup, createGroupRectangleG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createTestingBoard, createText, createTouchEvent, debounce, degreesToRadians, deleteFragment, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downloadImage, drawArrow, drawBezierPath, drawCircle, drawDashedLines, drawEntireActiveRectangleG, drawLine, drawLinearPath, drawPendingNodesG, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getAngleByElement, getBarPoint, getBoardRectangle, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, getElementsInGroup, getElementsInGroupByElement, getElementsIndices, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, getNearestPointBetweenPointAndEllipse, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getNearestPointRectangle, getOffsetAfterRotate, getOneMoveOptions, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByAngle, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectedIsolatedElementsCanAddToGroup, getSelectedTargetElements, getSelectionAngle, getSnapRectangles, getTemporaryElements, getTemporaryRef, getTripleAxis, getValidElements, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, hasValidAngle, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isAxisChangedByAngle, isContextmenu, isDOMElement, isDOMNode, isDebug, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isIndicesContinuous, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, isSnapPoint, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, preventTouchMove, radiansToDegrees, removeMovingElements, removeSelectedElement, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, rotatePointsByElement, rotatedDataPoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setFragment, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectedElementsWithGroup, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, sortElements, stripHtml, temporaryDisableSelection, throttleRAF, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, uniqueById, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withMoving, withOptions, withSelection };
|
|
6203
6348
|
//# sourceMappingURL=plait-core.mjs.map
|