@plait/core 0.75.0 → 0.76.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/board.mjs +5 -2
- package/esm2022/plugins/index.mjs +1 -2
- package/esm2022/plugins/with-hand.mjs +43 -21
- package/esm2022/plugins/with-moving.mjs +4 -4
- package/esm2022/plugins/with-selection.mjs +32 -30
- package/esm2022/utils/angle.mjs +10 -8
- package/esm2022/utils/debug.mjs +6 -6
- package/esm2022/utils/dom/common.mjs +4 -1
- package/esm2022/utils/environment.mjs +2 -1
- package/esm2022/utils/mobile.mjs +2 -3
- package/esm2022/utils/selection.mjs +13 -11
- package/esm2022/utils/to-point.mjs +27 -2
- package/esm2022/utils/weak-maps.mjs +1 -1
- package/fesm2022/plait-core.mjs +133 -104
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +2 -1
- package/package.json +1 -1
- package/plugins/index.d.ts +0 -1
- package/utils/angle.d.ts +1 -1
- package/utils/dom/common.d.ts +1 -0
- package/utils/environment.d.ts +1 -0
- package/utils/to-point.d.ts +8 -0
- package/utils/weak-maps.d.ts +1 -0
- package/esm2022/plugins/with-viewport.mjs +0 -30
- package/plugins/with-viewport.d.ts +0 -2
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -1398,6 +1398,9 @@ const isSecondaryPointer = (event) => {
|
|
|
1398
1398
|
const isMainPointer = (event) => {
|
|
1399
1399
|
return event.button === POINTER_BUTTON.MAIN;
|
|
1400
1400
|
};
|
|
1401
|
+
const isWheelPointer = (event) => {
|
|
1402
|
+
return event.button === POINTER_BUTTON.WHEEL;
|
|
1403
|
+
};
|
|
1401
1404
|
|
|
1402
1405
|
function createForeignObject(x, y, width, height) {
|
|
1403
1406
|
var newForeignObject = document.createElementNS(NS, 'foreignObject');
|
|
@@ -1437,6 +1440,7 @@ const IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /Edge?\/(?:[0-6][0-9]
|
|
|
1437
1440
|
const IS_CHROME = typeof navigator !== 'undefined' && /Chrome/i.test(navigator.userAgent);
|
|
1438
1441
|
// Native beforeInput events don't work well with react on Chrome 75 and older, Chrome 76+ can use beforeInput
|
|
1439
1442
|
const IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent);
|
|
1443
|
+
const IS_WINDOWS = typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent);
|
|
1440
1444
|
|
|
1441
1445
|
// Credits to slate - https://github.com/ianstormtaylor/slate
|
|
1442
1446
|
/**
|
|
@@ -1752,7 +1756,7 @@ class DebugGenerator {
|
|
|
1752
1756
|
}
|
|
1753
1757
|
const gArray = getTemporaryGArray(this.debugKey);
|
|
1754
1758
|
setTemporaryGArray(this.debugKey, []);
|
|
1755
|
-
gArray.forEach(g => g.remove());
|
|
1759
|
+
gArray.forEach((g) => g.remove());
|
|
1756
1760
|
}
|
|
1757
1761
|
drawPolygon(board, points, options) {
|
|
1758
1762
|
if (!isDebug(this.debugKey)) {
|
|
@@ -1760,7 +1764,7 @@ class DebugGenerator {
|
|
|
1760
1764
|
}
|
|
1761
1765
|
const polygonG = PlaitBoard.getRoughSVG(board).polygon(points, options || { stroke: 'red' });
|
|
1762
1766
|
polygonG.classList.add(this.debugKey);
|
|
1763
|
-
PlaitBoard.
|
|
1767
|
+
PlaitBoard.getElementTopHost(board).append(polygonG);
|
|
1764
1768
|
const gArray = getTemporaryGArray(this.debugKey);
|
|
1765
1769
|
gArray.push(polygonG);
|
|
1766
1770
|
setTemporaryGArray(this.debugKey, gArray);
|
|
@@ -1772,7 +1776,7 @@ class DebugGenerator {
|
|
|
1772
1776
|
}
|
|
1773
1777
|
const lineG = PlaitBoard.getRoughSVG(board).linearPath(points, options || { stroke: 'red' });
|
|
1774
1778
|
lineG.classList.add(this.debugKey);
|
|
1775
|
-
PlaitBoard.
|
|
1779
|
+
PlaitBoard.getElementTopHost(board).append(lineG);
|
|
1776
1780
|
const gArray = getTemporaryGArray(this.debugKey);
|
|
1777
1781
|
gArray.push(lineG);
|
|
1778
1782
|
setTemporaryGArray(this.debugKey, gArray);
|
|
@@ -1791,7 +1795,7 @@ class DebugGenerator {
|
|
|
1791
1795
|
}
|
|
1792
1796
|
const rectangleG = PlaitBoard.getRoughSVG(board).rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height, options || { stroke: 'red' });
|
|
1793
1797
|
rectangleG.classList.add(this.debugKey);
|
|
1794
|
-
PlaitBoard.
|
|
1798
|
+
PlaitBoard.getElementTopHost(board).append(rectangleG);
|
|
1795
1799
|
const gArray = getTemporaryGArray(this.debugKey);
|
|
1796
1800
|
gArray.push(rectangleG);
|
|
1797
1801
|
setTemporaryGArray(this.debugKey, gArray);
|
|
@@ -1805,7 +1809,7 @@ class DebugGenerator {
|
|
|
1805
1809
|
points.forEach((p, i) => {
|
|
1806
1810
|
const circle = PlaitBoard.getRoughSVG(board).circle(p[0], p[1], isCumulativeDiameter ? diameter * (i + 1) : diameter, Object.assign({}, { stroke: 'red', fill: 'red', fillStyle: 'solid' }, options || {}));
|
|
1807
1811
|
circle.classList.add(this.debugKey);
|
|
1808
|
-
PlaitBoard.
|
|
1812
|
+
PlaitBoard.getElementTopHost(board).append(circle);
|
|
1809
1813
|
const gArray = getTemporaryGArray(this.debugKey);
|
|
1810
1814
|
gArray.push(circle);
|
|
1811
1815
|
result.push(circle);
|
|
@@ -2225,6 +2229,30 @@ function toHostPoint(board, x, y) {
|
|
|
2225
2229
|
const rect = host.getBoundingClientRect();
|
|
2226
2230
|
return [x - rect.x, y - rect.y];
|
|
2227
2231
|
}
|
|
2232
|
+
function toActiveRectangleFromViewBoxRectangle(board, rectangle) {
|
|
2233
|
+
const leftTop = [rectangle.x, rectangle.y];
|
|
2234
|
+
const rightBottom = [rectangle.x + rectangle.width, rectangle.y + rectangle.height];
|
|
2235
|
+
const leftTopOfActive = toActivePointFromViewBoxPoint(board, leftTop);
|
|
2236
|
+
const rightBottomOfActive = toActivePointFromViewBoxPoint(board, rightBottom);
|
|
2237
|
+
return RectangleClient.getRectangleByPoints([leftTopOfActive, rightBottomOfActive]);
|
|
2238
|
+
}
|
|
2239
|
+
function toActivePointFromViewBoxPoint(board, point) {
|
|
2240
|
+
const screenPoint = toScreenPointFromHostPoint(board, toHostPointFromViewBoxPoint(board, point));
|
|
2241
|
+
return toActivePoint(board, screenPoint[0], screenPoint[1]);
|
|
2242
|
+
}
|
|
2243
|
+
/**
|
|
2244
|
+
* Get the screen point starting from the upper left corner of the svg element (based on the svg screen coordinate system)
|
|
2245
|
+
*/
|
|
2246
|
+
function toActivePoint(board, x, y) {
|
|
2247
|
+
const boardContainer = PlaitBoard.getBoardContainer(board);
|
|
2248
|
+
const rect = boardContainer.getBoundingClientRect();
|
|
2249
|
+
return [x - rect.x, y - rect.y];
|
|
2250
|
+
}
|
|
2251
|
+
function toScreenPointFromActivePoint(board, activePoint) {
|
|
2252
|
+
const boardContainer = PlaitBoard.getBoardContainer(board);
|
|
2253
|
+
const rect = boardContainer.getBoundingClientRect();
|
|
2254
|
+
return [rect.x + activePoint[0], rect.y + activePoint[1]];
|
|
2255
|
+
}
|
|
2228
2256
|
/**
|
|
2229
2257
|
* Get the point in the coordinate system of the svg viewBox
|
|
2230
2258
|
*/
|
|
@@ -2237,7 +2265,7 @@ function toViewBoxPoint(board, hostPoint) {
|
|
|
2237
2265
|
return newPoint;
|
|
2238
2266
|
}
|
|
2239
2267
|
function toViewBoxPoints(board, hostPoints) {
|
|
2240
|
-
const newPoints = hostPoints.map(point => {
|
|
2268
|
+
const newPoints = hostPoints.map((point) => {
|
|
2241
2269
|
return toViewBoxPoint(board, point);
|
|
2242
2270
|
});
|
|
2243
2271
|
return newPoints;
|
|
@@ -3026,7 +3054,7 @@ function isHandleSelection(board) {
|
|
|
3026
3054
|
return board.pointer !== PlaitPointerType.hand && !options.isDisabledSelection && !PlaitBoard.isReadonly(board);
|
|
3027
3055
|
}
|
|
3028
3056
|
function hasSetSelectionOperation(board) {
|
|
3029
|
-
return !!board.operations.find(op => PlaitOperation.isSetSelectionOperation(op));
|
|
3057
|
+
return !!board.operations.find((op) => PlaitOperation.isSetSelectionOperation(op));
|
|
3030
3058
|
}
|
|
3031
3059
|
function getTemporaryElements(board) {
|
|
3032
3060
|
const ref = BOARD_TO_TEMPORARY_ELEMENTS.get(board);
|
|
@@ -3046,8 +3074,9 @@ function deleteTemporaryElements(board) {
|
|
|
3046
3074
|
function drawSelectionRectangleG(board) {
|
|
3047
3075
|
const elements = getSelectedElements(board);
|
|
3048
3076
|
const rectangle = getRectangleByElements(board, elements, false);
|
|
3049
|
-
|
|
3050
|
-
|
|
3077
|
+
const activeRectangle = toActiveRectangleFromViewBoxRectangle(board, rectangle);
|
|
3078
|
+
if (activeRectangle.width > 0 && activeRectangle.height > 0 && elements.length > 1) {
|
|
3079
|
+
const selectionRectangleG = drawRectangle(board, RectangleClient.inflate(activeRectangle, ACTIVE_STROKE_WIDTH), {
|
|
3051
3080
|
stroke: SELECTION_BORDER_COLOR,
|
|
3052
3081
|
strokeWidth: ACTIVE_STROKE_WIDTH,
|
|
3053
3082
|
fillStyle: 'solid'
|
|
@@ -3055,7 +3084,7 @@ function drawSelectionRectangleG(board) {
|
|
|
3055
3084
|
selectionRectangleG.classList.add(SELECTION_RECTANGLE_CLASS_NAME, SELECTION_RECTANGLE_BOUNDING_CLASS_NAME);
|
|
3056
3085
|
const angle = getSelectionAngle(elements);
|
|
3057
3086
|
if (angle) {
|
|
3058
|
-
setAngleForG(selectionRectangleG, RectangleClient.getCenterPoint(
|
|
3087
|
+
setAngleForG(selectionRectangleG, RectangleClient.getCenterPoint(activeRectangle), angle);
|
|
3059
3088
|
}
|
|
3060
3089
|
return selectionRectangleG;
|
|
3061
3090
|
}
|
|
@@ -3068,7 +3097,7 @@ function setSelectedElementsWithGroup(board, elements, isShift) {
|
|
|
3068
3097
|
const selectedElements = getSelectedElements(board);
|
|
3069
3098
|
if (!Selection.isCollapsed(board.selection)) {
|
|
3070
3099
|
let newElements = [...selectedElements];
|
|
3071
|
-
elements.forEach(item => {
|
|
3100
|
+
elements.forEach((item) => {
|
|
3072
3101
|
if (!item.groupId) {
|
|
3073
3102
|
newElements.push(item);
|
|
3074
3103
|
}
|
|
@@ -3084,7 +3113,7 @@ function setSelectedElementsWithGroup(board, elements, isShift) {
|
|
|
3084
3113
|
const hitElementGroups = getGroupByElement(board, hitElement, true);
|
|
3085
3114
|
if (hitElementGroups.length) {
|
|
3086
3115
|
const elementsInHighestGroup = getElementsInGroup(board, hitElementGroups[hitElementGroups.length - 1], true) || [];
|
|
3087
|
-
const isSelectGroupElement = selectedElements.some(element => elementsInHighestGroup.map(item => item.id).includes(element.id));
|
|
3116
|
+
const isSelectGroupElement = selectedElements.some((element) => elementsInHighestGroup.map((item) => item.id).includes(element.id));
|
|
3088
3117
|
if (isShift) {
|
|
3089
3118
|
cacheSelectedElementsWithGroupOnShift(board, elements, isSelectGroupElement, elementsInHighestGroup);
|
|
3090
3119
|
}
|
|
@@ -3103,16 +3132,16 @@ function cacheSelectedElementsWithGroupOnShift(board, elements, isSelectGroupEle
|
|
|
3103
3132
|
pendingElements = elementsInHighestGroup;
|
|
3104
3133
|
}
|
|
3105
3134
|
else {
|
|
3106
|
-
const isHitSelectedElement = selectedElements.some(item => item.id === hitElement.id);
|
|
3107
|
-
const selectedElementsInGroup = elementsInHighestGroup.filter(item => selectedElements.includes(item));
|
|
3135
|
+
const isHitSelectedElement = selectedElements.some((item) => item.id === hitElement.id);
|
|
3136
|
+
const selectedElementsInGroup = elementsInHighestGroup.filter((item) => selectedElements.includes(item));
|
|
3108
3137
|
if (isHitSelectedElement) {
|
|
3109
|
-
pendingElements = selectedElementsInGroup.filter(item => item.id !== hitElement.id);
|
|
3138
|
+
pendingElements = selectedElementsInGroup.filter((item) => item.id !== hitElement.id);
|
|
3110
3139
|
}
|
|
3111
3140
|
else {
|
|
3112
3141
|
pendingElements.push(...selectedElementsInGroup, ...elements);
|
|
3113
3142
|
}
|
|
3114
3143
|
}
|
|
3115
|
-
elementsInHighestGroup.forEach(element => {
|
|
3144
|
+
elementsInHighestGroup.forEach((element) => {
|
|
3116
3145
|
if (newElements.includes(element)) {
|
|
3117
3146
|
newElements.splice(newElements.indexOf(element), 1);
|
|
3118
3147
|
}
|
|
@@ -3915,14 +3944,14 @@ const rotatePoints = (points, centerPoint, angle) => {
|
|
|
3915
3944
|
return rotate(points[0], points[1], centerPoint[0], centerPoint[1], angle);
|
|
3916
3945
|
}
|
|
3917
3946
|
else {
|
|
3918
|
-
return points.map(point => {
|
|
3947
|
+
return points.map((point) => {
|
|
3919
3948
|
return rotate(point[0], point[1], centerPoint[0], centerPoint[1], angle || 0);
|
|
3920
3949
|
});
|
|
3921
3950
|
}
|
|
3922
3951
|
};
|
|
3923
3952
|
const getSelectionAngle = (elements) => {
|
|
3924
3953
|
let angle = elements[0]?.angle || 0;
|
|
3925
|
-
elements.forEach(item => {
|
|
3954
|
+
elements.forEach((item) => {
|
|
3926
3955
|
if (item.angle !== angle && !approximately(((item.angle || 0) % (Math.PI / 2)) - (angle % (Math.PI / 2)), 0)) {
|
|
3927
3956
|
angle = 0;
|
|
3928
3957
|
}
|
|
@@ -3937,7 +3966,7 @@ const hasSameAngle = (elements) => {
|
|
|
3937
3966
|
if (angle === undefined) {
|
|
3938
3967
|
return false;
|
|
3939
3968
|
}
|
|
3940
|
-
return !elements.some(item => item.angle !== angle);
|
|
3969
|
+
return !elements.some((item) => item.angle !== angle);
|
|
3941
3970
|
};
|
|
3942
3971
|
const getRotatedBoundingRectangle = (rectanglesCornerPoints, angle) => {
|
|
3943
3972
|
let rectanglesFromOrigin = [];
|
|
@@ -3961,7 +3990,7 @@ const getOffsetAfterRotate = (rectangle, rotateCenterPoint, angle) => {
|
|
|
3961
3990
|
};
|
|
3962
3991
|
const rotatedDataPoints = (points, rotateCenterPoint, angle) => {
|
|
3963
3992
|
const { offsetX, offsetY } = getOffsetAfterRotate(RectangleClient.getRectangleByPoints(points), rotateCenterPoint, angle);
|
|
3964
|
-
return points.map(p => [p[0] + offsetX, p[1] + offsetY]);
|
|
3993
|
+
return points.map((p) => [p[0] + offsetX, p[1] + offsetY]);
|
|
3965
3994
|
};
|
|
3966
3995
|
const hasValidAngle = (node) => {
|
|
3967
3996
|
return isValidAngle(node.angle);
|
|
@@ -3989,10 +4018,11 @@ const rotatePointsByAngle = (points, angle) => {
|
|
|
3989
4018
|
return null;
|
|
3990
4019
|
}
|
|
3991
4020
|
};
|
|
3992
|
-
const rotateAntiPointsByElement = (points, element) => {
|
|
4021
|
+
const rotateAntiPointsByElement = (board, points, element, isToActive = false) => {
|
|
3993
4022
|
if (hasValidAngle(element)) {
|
|
3994
4023
|
let rectangle = RectangleClient.getRectangleByPoints(element.points);
|
|
3995
|
-
const
|
|
4024
|
+
const activeRectangle = isToActive ? toActiveRectangleFromViewBoxRectangle(board, rectangle) : rectangle;
|
|
4025
|
+
const centerPoint = RectangleClient.getCenterPoint(activeRectangle);
|
|
3996
4026
|
return rotatePoints(points, centerPoint, element.angle ? -element.angle : 0);
|
|
3997
4027
|
}
|
|
3998
4028
|
else {
|
|
@@ -4020,7 +4050,7 @@ function radiansToDegrees(r) {
|
|
|
4020
4050
|
function rotateElements(board, elements, angle) {
|
|
4021
4051
|
const selectionRectangle = getRectangleByElements(board, elements, false);
|
|
4022
4052
|
const selectionCenterPoint = RectangleClient.getCenterPoint(selectionRectangle);
|
|
4023
|
-
elements.forEach(item => {
|
|
4053
|
+
elements.forEach((item) => {
|
|
4024
4054
|
const originAngle = item.angle;
|
|
4025
4055
|
const points = rotatedDataPoints(item.points, selectionCenterPoint, normalizeAngle(angle));
|
|
4026
4056
|
const path = PlaitBoard.findPath(board, item);
|
|
@@ -4248,7 +4278,10 @@ const PlaitBoard = {
|
|
|
4248
4278
|
getElementUpperHost(board) {
|
|
4249
4279
|
return BOARD_TO_ELEMENT_HOST.get(board)?.upperHost;
|
|
4250
4280
|
},
|
|
4251
|
-
|
|
4281
|
+
getElementTopHost(board) {
|
|
4282
|
+
return BOARD_TO_ELEMENT_HOST.get(board)?.topHost;
|
|
4283
|
+
},
|
|
4284
|
+
getActiveHost(board) {
|
|
4252
4285
|
return BOARD_TO_ELEMENT_HOST.get(board)?.activeHost;
|
|
4253
4286
|
},
|
|
4254
4287
|
getRoughSVG(board) {
|
|
@@ -5613,24 +5646,44 @@ function withBoard(board) {
|
|
|
5613
5646
|
}
|
|
5614
5647
|
|
|
5615
5648
|
const isSmartHand = (board, event) => {
|
|
5616
|
-
return
|
|
5617
|
-
(PlaitBoard.isPointer(board, PlaitPointerType.selection) && isMobileDeviceEvent(event)));
|
|
5649
|
+
return PlaitBoard.isPointer(board, PlaitPointerType.selection) && isMobileDeviceEvent(event);
|
|
5618
5650
|
};
|
|
5619
5651
|
|
|
5652
|
+
const ShortcutKey = 'Space';
|
|
5620
5653
|
function withHandPointer(board) {
|
|
5621
5654
|
const { pointerDown, pointerMove, globalPointerUp, keyDown, keyUp, pointerUp } = board;
|
|
5622
|
-
let
|
|
5655
|
+
let isHandMoving = false;
|
|
5623
5656
|
let movingPoint = null;
|
|
5624
5657
|
let pointerDownEvent = null;
|
|
5658
|
+
let hasWheelPressed = false;
|
|
5659
|
+
let beingPressedShortcutKey = false;
|
|
5625
5660
|
board.pointerDown = (event) => {
|
|
5626
5661
|
const options = board.getPluginOptions(PlaitPluginKey.withHand);
|
|
5627
5662
|
const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
5628
5663
|
const isHitTarget = isHitElement(board, point);
|
|
5629
|
-
|
|
5664
|
+
const canEnterHandMode = options?.isHandMode(board, event) ||
|
|
5665
|
+
PlaitBoard.isPointer(board, PlaitPointerType.hand) ||
|
|
5666
|
+
(isSmartHand(board, event) && !isHitTarget) ||
|
|
5667
|
+
beingPressedShortcutKey;
|
|
5668
|
+
if (canEnterHandMode && isMainPointer(event)) {
|
|
5630
5669
|
movingPoint = {
|
|
5631
5670
|
x: event.x,
|
|
5632
5671
|
y: event.y
|
|
5633
5672
|
};
|
|
5673
|
+
if (!PlaitBoard.isPointer(board, PlaitPointerType.hand)) {
|
|
5674
|
+
PlaitBoard.getBoardContainer(board).classList.add('viewport-moving');
|
|
5675
|
+
}
|
|
5676
|
+
}
|
|
5677
|
+
else if (isWheelPointer(event)) {
|
|
5678
|
+
hasWheelPressed = true;
|
|
5679
|
+
// Prevent the browser's default behavior of scrolling the page when the mouse wheel is pressed.
|
|
5680
|
+
event.preventDefault();
|
|
5681
|
+
movingPoint = {
|
|
5682
|
+
x: event.x,
|
|
5683
|
+
y: event.y
|
|
5684
|
+
};
|
|
5685
|
+
isHandMoving = true;
|
|
5686
|
+
PlaitBoard.getBoardContainer(board).classList.add('viewport-moving');
|
|
5634
5687
|
}
|
|
5635
5688
|
pointerDownEvent = event;
|
|
5636
5689
|
pointerDown(event);
|
|
@@ -5645,19 +5698,20 @@ function withHandPointer(board) {
|
|
|
5645
5698
|
// withHand behavior is only triggered if drag selection state is not initiated.
|
|
5646
5699
|
const triggerDistance = DRAG_SELECTION_PRESS_AND_MOVE_BUFFER + 4;
|
|
5647
5700
|
if (movingPoint &&
|
|
5648
|
-
!
|
|
5701
|
+
!isHandMoving &&
|
|
5649
5702
|
!isSelectionMoving(board) &&
|
|
5650
5703
|
pointerDownEvent &&
|
|
5651
5704
|
distanceBetweenPointAndPoint(pointerDownEvent.x, pointerDownEvent.y, event.x, event.y) > triggerDistance &&
|
|
5652
5705
|
!isMovingElements(board)) {
|
|
5653
|
-
|
|
5706
|
+
isHandMoving = true;
|
|
5654
5707
|
PlaitBoard.getBoardContainer(board).classList.add('viewport-moving');
|
|
5655
5708
|
}
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5709
|
+
const canEnterHandMode = options?.isHandMode(board, event) ||
|
|
5710
|
+
PlaitBoard.isPointer(board, PlaitPointerType.hand) ||
|
|
5711
|
+
isSmartHand(board, event) ||
|
|
5712
|
+
hasWheelPressed ||
|
|
5713
|
+
beingPressedShortcutKey;
|
|
5714
|
+
if (canEnterHandMode && isHandMoving && movingPoint && !isSelectionMoving(board) && !isMovingElements(board)) {
|
|
5661
5715
|
const viewportContainer = PlaitBoard.getViewportContainer(board);
|
|
5662
5716
|
const left = viewportContainer.scrollLeft - (event.x - movingPoint.x);
|
|
5663
5717
|
const top = viewportContainer.scrollTop - (event.y - movingPoint.y);
|
|
@@ -5668,7 +5722,7 @@ function withHandPointer(board) {
|
|
|
5668
5722
|
pointerMove(event);
|
|
5669
5723
|
};
|
|
5670
5724
|
board.pointerUp = (event) => {
|
|
5671
|
-
if (
|
|
5725
|
+
if (isHandMoving) {
|
|
5672
5726
|
return;
|
|
5673
5727
|
}
|
|
5674
5728
|
pointerUp(event);
|
|
@@ -5677,24 +5731,25 @@ function withHandPointer(board) {
|
|
|
5677
5731
|
if (movingPoint) {
|
|
5678
5732
|
movingPoint = null;
|
|
5679
5733
|
}
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
}
|
|
5734
|
+
isHandMoving = false;
|
|
5735
|
+
PlaitBoard.getBoardContainer(board).classList.remove('viewport-moving');
|
|
5736
|
+
hasWheelPressed = false;
|
|
5684
5737
|
globalPointerUp(event);
|
|
5685
5738
|
};
|
|
5686
5739
|
board.keyDown = (event) => {
|
|
5687
|
-
if (event.code ===
|
|
5740
|
+
if (event.code === ShortcutKey) {
|
|
5688
5741
|
if (!PlaitBoard.isPointer(board, PlaitPointerType.hand)) {
|
|
5689
|
-
|
|
5742
|
+
beingPressedShortcutKey = true;
|
|
5743
|
+
PlaitBoard.getBoardContainer(board).classList.add('viewport-moving');
|
|
5690
5744
|
}
|
|
5691
5745
|
event.preventDefault();
|
|
5692
5746
|
}
|
|
5693
5747
|
keyDown(event);
|
|
5694
5748
|
};
|
|
5695
5749
|
board.keyUp = (event) => {
|
|
5696
|
-
if (!board.options.readonly && event.code ===
|
|
5697
|
-
|
|
5750
|
+
if (!board.options.readonly && event.code === ShortcutKey) {
|
|
5751
|
+
beingPressedShortcutKey = true;
|
|
5752
|
+
PlaitBoard.getBoardContainer(board).classList.remove('viewport-moving');
|
|
5698
5753
|
}
|
|
5699
5754
|
keyUp(event);
|
|
5700
5755
|
};
|
|
@@ -6096,7 +6151,7 @@ function withMoving(board) {
|
|
|
6096
6151
|
event.preventDefault();
|
|
6097
6152
|
if (startPoint && activeElements.length && !PlaitBoard.hasBeenTextEditing(board)) {
|
|
6098
6153
|
pendingNodesG = drawPendingNodesG(board, activeElements, offsetX, offsetY);
|
|
6099
|
-
pendingNodesG && PlaitBoard.
|
|
6154
|
+
pendingNodesG && PlaitBoard.getElementTopHost(board).append(pendingNodesG);
|
|
6100
6155
|
}
|
|
6101
6156
|
}
|
|
6102
6157
|
}
|
|
@@ -6180,10 +6235,10 @@ function withMoving(board) {
|
|
|
6180
6235
|
offsetY += ref.deltaY;
|
|
6181
6236
|
snapG = ref.snapG;
|
|
6182
6237
|
snapG.classList.add(ACTIVE_MOVING_CLASS_NAME);
|
|
6183
|
-
PlaitBoard.
|
|
6238
|
+
PlaitBoard.getElementTopHost(board).append(snapG);
|
|
6184
6239
|
if (event.altKey) {
|
|
6185
6240
|
pendingNodesG = drawPendingNodesG(board, activeElements, offsetX, offsetY);
|
|
6186
|
-
pendingNodesG && PlaitBoard.
|
|
6241
|
+
pendingNodesG && PlaitBoard.getElementTopHost(board).append(pendingNodesG);
|
|
6187
6242
|
}
|
|
6188
6243
|
else {
|
|
6189
6244
|
const currentElements = updatePoints(board, activeElements, offsetX, offsetY);
|
|
@@ -6380,11 +6435,10 @@ function withRelatedFragment(board) {
|
|
|
6380
6435
|
|
|
6381
6436
|
function withSelection(board) {
|
|
6382
6437
|
const { pointerDown, pointerUp, pointerMove, globalPointerUp, onChange, afterChange, drawSelectionRectangle } = board;
|
|
6383
|
-
let
|
|
6384
|
-
let
|
|
6438
|
+
let screenStart = null;
|
|
6439
|
+
let screenEnd = null;
|
|
6385
6440
|
let selectionMovingG;
|
|
6386
6441
|
let selectionRectangleG;
|
|
6387
|
-
let previousSelectedElements;
|
|
6388
6442
|
let isShift = false;
|
|
6389
6443
|
let timerId = null;
|
|
6390
6444
|
let pointerDownEvent = null;
|
|
@@ -6399,18 +6453,18 @@ function withSelection(board) {
|
|
|
6399
6453
|
const isHitTarget = isHitElement(board, point);
|
|
6400
6454
|
const options = getSelectionOptions(board);
|
|
6401
6455
|
if (PlaitBoard.isPointer(board, PlaitPointerType.selection) &&
|
|
6456
|
+
isMainPointer(event) &&
|
|
6402
6457
|
!isHitTarget &&
|
|
6403
6458
|
options.isMultipleSelection &&
|
|
6404
6459
|
!options.isDisabledSelection) {
|
|
6405
|
-
// start drag selection
|
|
6406
6460
|
if (isMobileDeviceEvent(event)) {
|
|
6407
6461
|
timerId = setTimeout(() => {
|
|
6408
|
-
|
|
6462
|
+
screenStart = [event.x, event.y];
|
|
6409
6463
|
timerId = null;
|
|
6410
6464
|
}, 120);
|
|
6411
6465
|
}
|
|
6412
6466
|
else {
|
|
6413
|
-
|
|
6467
|
+
screenStart = [event.x, event.y];
|
|
6414
6468
|
}
|
|
6415
6469
|
}
|
|
6416
6470
|
pointerDownEvent = event;
|
|
@@ -6423,14 +6477,20 @@ function withSelection(board) {
|
|
|
6423
6477
|
clearTimeout(timerId);
|
|
6424
6478
|
timerId = null;
|
|
6425
6479
|
}
|
|
6426
|
-
if (PlaitBoard.isPointer(board, PlaitPointerType.selection) &&
|
|
6427
|
-
|
|
6428
|
-
|
|
6480
|
+
if (PlaitBoard.isPointer(board, PlaitPointerType.selection) && screenStart) {
|
|
6481
|
+
event.preventDefault();
|
|
6482
|
+
screenEnd = [event.x, event.y];
|
|
6483
|
+
const rectangle = RectangleClient.getRectangleByPoints([
|
|
6484
|
+
toActivePoint(board, ...screenStart),
|
|
6485
|
+
toActivePoint(board, ...screenEnd)
|
|
6486
|
+
]);
|
|
6429
6487
|
selectionMovingG?.remove();
|
|
6430
|
-
end = movedTarget;
|
|
6431
6488
|
throttleRAF(board, 'with-selection', () => {
|
|
6432
|
-
if (
|
|
6433
|
-
Transforms.setSelection(board, {
|
|
6489
|
+
if (screenStart && screenEnd) {
|
|
6490
|
+
Transforms.setSelection(board, {
|
|
6491
|
+
anchor: toViewBoxPoint(board, toHostPoint(board, screenStart[0], screenStart[1])),
|
|
6492
|
+
focus: toViewBoxPoint(board, toHostPoint(board, screenEnd[0], screenEnd[1]))
|
|
6493
|
+
});
|
|
6434
6494
|
}
|
|
6435
6495
|
});
|
|
6436
6496
|
setSelectionMoving(board);
|
|
@@ -6440,7 +6500,7 @@ function withSelection(board) {
|
|
|
6440
6500
|
fill: SELECTION_FILL_COLOR,
|
|
6441
6501
|
fillStyle: 'solid'
|
|
6442
6502
|
});
|
|
6443
|
-
PlaitBoard.
|
|
6503
|
+
PlaitBoard.getActiveHost(board).append(selectionMovingG);
|
|
6444
6504
|
}
|
|
6445
6505
|
pointerMove(event);
|
|
6446
6506
|
};
|
|
@@ -6458,10 +6518,13 @@ function withSelection(board) {
|
|
|
6458
6518
|
pointerUp(event);
|
|
6459
6519
|
};
|
|
6460
6520
|
board.globalPointerUp = (event) => {
|
|
6461
|
-
if (
|
|
6521
|
+
if (screenStart && screenEnd) {
|
|
6462
6522
|
selectionMovingG?.remove();
|
|
6463
6523
|
clearSelectionMoving(board);
|
|
6464
|
-
Transforms.setSelection(board, {
|
|
6524
|
+
Transforms.setSelection(board, {
|
|
6525
|
+
anchor: toViewBoxPoint(board, toHostPoint(board, screenStart[0], screenStart[1])),
|
|
6526
|
+
focus: toViewBoxPoint(board, toHostPoint(board, screenEnd[0], screenEnd[1]))
|
|
6527
|
+
});
|
|
6465
6528
|
}
|
|
6466
6529
|
const options = getSelectionOptions(board);
|
|
6467
6530
|
if (PlaitBoard.isFocus(board) && !options.isPreventClearSelection) {
|
|
@@ -6470,12 +6533,12 @@ function withSelection(board) {
|
|
|
6470
6533
|
const isAttachedElement = event.target instanceof Element && event.target.closest(`.${ATTACHED_ELEMENT_CLASS_NAME}`);
|
|
6471
6534
|
// Clear selection when mouse board outside area
|
|
6472
6535
|
// The framework needs to determine whether the board is focused through selection
|
|
6473
|
-
if (!isInBoard && !
|
|
6536
|
+
if (!isInBoard && !screenStart && !isAttachedElement && isInDocument) {
|
|
6474
6537
|
Transforms.setSelection(board, null);
|
|
6475
6538
|
}
|
|
6476
6539
|
}
|
|
6477
|
-
|
|
6478
|
-
|
|
6540
|
+
screenStart = null;
|
|
6541
|
+
screenEnd = null;
|
|
6479
6542
|
if (timerId) {
|
|
6480
6543
|
clearTimeout(timerId);
|
|
6481
6544
|
timerId = null;
|
|
@@ -6548,13 +6611,12 @@ function withSelection(board) {
|
|
|
6548
6611
|
}
|
|
6549
6612
|
}
|
|
6550
6613
|
const newElements = getSelectedElements(board);
|
|
6551
|
-
previousSelectedElements = [...newElements];
|
|
6552
6614
|
deleteTemporaryElements(board);
|
|
6553
6615
|
if (!isSelectionMoving(board)) {
|
|
6554
6616
|
selectionRectangleG?.remove();
|
|
6555
6617
|
if (newElements.length > 1) {
|
|
6556
6618
|
selectionRectangleG = board.drawSelectionRectangle();
|
|
6557
|
-
PlaitBoard.
|
|
6619
|
+
PlaitBoard.getActiveHost(board).append(selectionRectangleG);
|
|
6558
6620
|
}
|
|
6559
6621
|
}
|
|
6560
6622
|
}
|
|
@@ -6569,14 +6631,9 @@ function withSelection(board) {
|
|
|
6569
6631
|
try {
|
|
6570
6632
|
const currentSelectedElements = getSelectedElements(board);
|
|
6571
6633
|
if (currentSelectedElements.length && currentSelectedElements.length > 1) {
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
selectionRectangleG?.remove();
|
|
6576
|
-
selectionRectangleG = board.drawSelectionRectangle();
|
|
6577
|
-
PlaitBoard.getElementActiveHost(board).append(selectionRectangleG);
|
|
6578
|
-
previousSelectedElements = [...currentSelectedElements];
|
|
6579
|
-
}
|
|
6634
|
+
selectionRectangleG?.remove();
|
|
6635
|
+
selectionRectangleG = board.drawSelectionRectangle();
|
|
6636
|
+
PlaitBoard.getActiveHost(board).append(selectionRectangleG);
|
|
6580
6637
|
}
|
|
6581
6638
|
else {
|
|
6582
6639
|
selectionRectangleG?.remove();
|
|
@@ -6596,34 +6653,6 @@ function withSelection(board) {
|
|
|
6596
6653
|
return board;
|
|
6597
6654
|
}
|
|
6598
6655
|
|
|
6599
|
-
function withViewport(board) {
|
|
6600
|
-
const { onChange } = board;
|
|
6601
|
-
const throttleUpdate = debounce(() => {
|
|
6602
|
-
initializeViewBox(board);
|
|
6603
|
-
updateViewportOffset(board);
|
|
6604
|
-
}, 500, { leading: true });
|
|
6605
|
-
board.onChange = () => {
|
|
6606
|
-
const isSetViewport = board.operations.length && board.operations.some(op => op.type === 'set_viewport');
|
|
6607
|
-
const isOnlySetSelection = board.operations.length && board.operations.every(op => op.type === 'set_selection');
|
|
6608
|
-
if (isOnlySetSelection) {
|
|
6609
|
-
return onChange();
|
|
6610
|
-
}
|
|
6611
|
-
if (isSetViewport && isFromScrolling(board)) {
|
|
6612
|
-
setIsFromScrolling(board, false);
|
|
6613
|
-
return onChange();
|
|
6614
|
-
}
|
|
6615
|
-
if (isSetViewport) {
|
|
6616
|
-
initializeViewBox(board);
|
|
6617
|
-
updateViewportOffset(board);
|
|
6618
|
-
}
|
|
6619
|
-
else {
|
|
6620
|
-
throttleUpdate();
|
|
6621
|
-
}
|
|
6622
|
-
onChange();
|
|
6623
|
-
};
|
|
6624
|
-
return board;
|
|
6625
|
-
}
|
|
6626
|
-
|
|
6627
6656
|
/**
|
|
6628
6657
|
* 1.create board instance
|
|
6629
6658
|
* 2.build fake node weak map
|
|
@@ -6792,5 +6821,5 @@ function createModModifierKeys() {
|
|
|
6792
6821
|
* Generated bundle index. Do not edit.
|
|
6793
6822
|
*/
|
|
6794
6823
|
|
|
6795
|
-
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_CONTEXT, 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_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DEFAULT_COLOR, DELETE, DOWN_ARROW, DRAG_SELECTION_PRESS_AND_MOVE_BUFFER, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_REF, END, ENTER, EQUALS, ESCAPE, ElementFlavour, 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, HISTORY, 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, KEY_TO_ELEMENT_MAP, L, LAST_MEDIA, LEFT_ARROW, ListRender, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MAX_ZOOM, MERGING, META, MIN_ZOOM, 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, PlaitBoardContext, PlaitElement, PlaitGroupElement, PlaitHistoryBoard, PlaitNode, PlaitOperation, 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_BOUNDING_CLASS_NAME, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SNAPPING_STROKE_WIDTH, SNAP_TOLERANCE, SPACE, SPLITTING_ONCE, 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, ZOOM_STEP, addClipboardContext, addOrCreateClipboardContext, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, ceilToDecimal, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createBoard, 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, drawLine, drawLinearPath, drawPendingNodesG, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSelectionRectangleG, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getAngleByElement, getBarPoint, getBoardRectangle, getBoundingRectangleByElements, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, getElementMap, getElementsInGroup, getElementsInGroupByElement, getElementsIndices, getEllipseArcCenter, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, getNearestPointBetweenPointAndArc, getNearestPointBetweenPointAndDiscreteSegments, getNearestPointBetweenPointAndEllipse, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getNearestPointRectangle, getOffsetAfterRotate, getOneMoveOptions, getPointBetween, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByAngle, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectedIsolatedElementsCanAddToGroup, getSelectedTargetElements, getSelectionAngle, getSelectionOptions, getSnapRectangles, getTemporaryElements, getTemporaryRef, getTripleAxis, getValidElements, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, hasSetSelectionOperation, hasValidAngle, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isAxisChangedByAngle, isContextmenu, isDOMElement, isDOMNode, isDebug, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isHitElement, isHitSelectedRectangle, isInPlaitBoard, isIndicesContinuous, isLineHitLine, isLineHitRectangle, isLineHitRectangleEdge, isMainPointer, isMobileDeviceEvent, isMouseEvent, isMovingElements, isNullOrUndefined, isPencilEvent, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetThemeOperation, isSetViewportOperation, isSingleLineHitRectangleEdge, isSnapPoint, isTouchEvent, isValidAngle, mountElementG, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, radiansToDegrees, removeMovingElements, removeSelectedElement, replaceAngleBrackets, replaceSelectedElement, reverseReplaceAngleBrackets, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, rotatePointsByAngle, rotatePointsByElement, rotatedDataPoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setFragment, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectedElementsWithGroup, setSelectionMoving, setSelectionOptions, 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, withBoard, withHandPointer, withHistory, withHotkey, withMoving, withOptions, withRelatedFragment, withSelection
|
|
6824
|
+
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_CONTEXT, 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_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DEFAULT_COLOR, DELETE, DOWN_ARROW, DRAG_SELECTION_PRESS_AND_MOVE_BUFFER, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_REF, END, ENTER, EQUALS, ESCAPE, ElementFlavour, 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, HISTORY, 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, IS_WINDOWS, J, K, KEY_TO_ELEMENT_MAP, L, LAST_MEDIA, LEFT_ARROW, ListRender, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MAX_ZOOM, MERGING, META, MIN_ZOOM, 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, PlaitBoardContext, PlaitElement, PlaitGroupElement, PlaitHistoryBoard, PlaitNode, PlaitOperation, 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_BOUNDING_CLASS_NAME, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SNAPPING_STROKE_WIDTH, SNAP_TOLERANCE, SPACE, SPLITTING_ONCE, 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, ZOOM_STEP, addClipboardContext, addOrCreateClipboardContext, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, ceilToDecimal, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createBoard, 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, drawLine, drawLinearPath, drawPendingNodesG, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSelectionRectangleG, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getAngleByElement, getBarPoint, getBoardRectangle, getBoundingRectangleByElements, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, getElementMap, getElementsInGroup, getElementsInGroupByElement, getElementsIndices, getEllipseArcCenter, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, getNearestPointBetweenPointAndArc, getNearestPointBetweenPointAndDiscreteSegments, getNearestPointBetweenPointAndEllipse, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getNearestPointRectangle, getOffsetAfterRotate, getOneMoveOptions, getPointBetween, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByAngle, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectedIsolatedElementsCanAddToGroup, getSelectedTargetElements, getSelectionAngle, getSelectionOptions, getSnapRectangles, getTemporaryElements, getTemporaryRef, getTripleAxis, getValidElements, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, hasSetSelectionOperation, hasValidAngle, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isAxisChangedByAngle, isContextmenu, isDOMElement, isDOMNode, isDebug, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isHitElement, isHitSelectedRectangle, isInPlaitBoard, isIndicesContinuous, isLineHitLine, isLineHitRectangle, isLineHitRectangleEdge, isMainPointer, isMobileDeviceEvent, isMouseEvent, isMovingElements, isNullOrUndefined, isPencilEvent, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetThemeOperation, isSetViewportOperation, isSingleLineHitRectangleEdge, isSnapPoint, isTouchEvent, isValidAngle, isWheelPointer, mountElementG, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, radiansToDegrees, removeMovingElements, removeSelectedElement, replaceAngleBrackets, replaceSelectedElement, reverseReplaceAngleBrackets, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, rotatePointsByAngle, rotatePointsByElement, rotatedDataPoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setFragment, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectedElementsWithGroup, setSelectionMoving, setSelectionOptions, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, sortElements, stripHtml, temporaryDisableSelection, throttleRAF, toActivePoint, toActivePointFromViewBoxPoint, toActiveRectangleFromViewBoxRectangle, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromActivePoint, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, uniqueById, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withBoard, withHandPointer, withHistory, withHotkey, withMoving, withOptions, withRelatedFragment, withSelection };
|
|
6796
6825
|
//# sourceMappingURL=plait-core.mjs.map
|