@plait/core 0.73.0 → 0.75.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/core/list-render.mjs +3 -2
- package/esm2022/interfaces/board.mjs +1 -1
- package/esm2022/interfaces/history.mjs +3 -1
- package/esm2022/interfaces/node.mjs +2 -2
- package/esm2022/plugins/with-history.mjs +5 -1
- package/esm2022/plugins/with-hotkey.mjs +2 -2
- package/esm2022/transforms/board.mjs +4 -5
- package/esm2022/utils/history.mjs +35 -2
- package/esm2022/utils/math.mjs +38 -9
- package/esm2022/utils/selected-element.mjs +11 -11
- package/fesm2022/plait-core.mjs +94 -26
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/board.d.ts +1 -1
- package/interfaces/history.d.ts +2 -0
- package/package.json +1 -1
- package/transforms/board.d.ts +1 -1
- package/utils/history.d.ts +16 -0
- package/utils/math.d.ts +12 -1
- package/utils/selected-element.d.ts +2 -2
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -504,7 +504,7 @@ const PlaitNode = {
|
|
|
504
504
|
first(board, path) {
|
|
505
505
|
const p = path.slice();
|
|
506
506
|
let n = PlaitNode.get(board, p);
|
|
507
|
-
if (!n.children) {
|
|
507
|
+
if (!n.children || !board.isExpanded(n)) {
|
|
508
508
|
return n;
|
|
509
509
|
}
|
|
510
510
|
while (n) {
|
|
@@ -935,7 +935,7 @@ function getNearestPointBetweenPointAndEllipse(point, center, rx, ry, rotation =
|
|
|
935
935
|
let ty = 0.707;
|
|
936
936
|
const a = Math.abs(rectangleClient.width) / 2;
|
|
937
937
|
const b = Math.abs(rectangleClient.height) / 2;
|
|
938
|
-
[0, 1, 2, 3].forEach(x => {
|
|
938
|
+
[0, 1, 2, 3].forEach((x) => {
|
|
939
939
|
const xx = a * tx;
|
|
940
940
|
const yy = b * ty;
|
|
941
941
|
const ex = ((a * a - b * b) * tx ** 3) / a;
|
|
@@ -983,7 +983,7 @@ const isLineHitLine = (a, b, c, d) => {
|
|
|
983
983
|
const cd = [d[0] - c[0], d[1] - c[1]];
|
|
984
984
|
return crossProduct(ab, ac) * crossProduct(ab, ad) <= 0 && crossProduct(cd, ca) * crossProduct(cd, cb) <= 0;
|
|
985
985
|
};
|
|
986
|
-
const
|
|
986
|
+
const isLineHitRectangle = (points, rectangle, isClose = true) => {
|
|
987
987
|
const rectanglePoints = RectangleClient.getCornerPoints(rectangle);
|
|
988
988
|
const len = points.length;
|
|
989
989
|
for (let i = 0; i < len; i++) {
|
|
@@ -991,16 +991,34 @@ const isPolylineHitRectangle = (points, rectangle, isClose = true) => {
|
|
|
991
991
|
continue;
|
|
992
992
|
const p1 = points[i];
|
|
993
993
|
const p2 = points[(i + 1) % len];
|
|
994
|
-
const isHit =
|
|
995
|
-
isLineHitLine(p1, p2, rectanglePoints[1], rectanglePoints[2]) ||
|
|
996
|
-
isLineHitLine(p1, p2, rectanglePoints[2], rectanglePoints[3]) ||
|
|
997
|
-
isLineHitLine(p1, p2, rectanglePoints[3], rectanglePoints[0]);
|
|
994
|
+
const isHit = isSingleLineHitRectangleEdge(p1, p2, rectangle);
|
|
998
995
|
if (isHit || isPointInPolygon(p1, rectanglePoints) || isPointInPolygon(p2, rectanglePoints)) {
|
|
999
996
|
return true;
|
|
1000
997
|
}
|
|
1001
998
|
}
|
|
1002
999
|
return false;
|
|
1003
1000
|
};
|
|
1001
|
+
const isLineHitRectangleEdge = (points, rectangle, isClose = true) => {
|
|
1002
|
+
const len = points.length;
|
|
1003
|
+
for (let i = 0; i < len; i++) {
|
|
1004
|
+
if (i === len - 1 && !isClose)
|
|
1005
|
+
continue;
|
|
1006
|
+
const p1 = points[i];
|
|
1007
|
+
const p2 = points[(i + 1) % len];
|
|
1008
|
+
const isHit = isSingleLineHitRectangleEdge(p1, p2, rectangle);
|
|
1009
|
+
if (isHit) {
|
|
1010
|
+
return true;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return false;
|
|
1014
|
+
};
|
|
1015
|
+
const isSingleLineHitRectangleEdge = (p1, p2, rectangle) => {
|
|
1016
|
+
const rectanglePoints = RectangleClient.getCornerPoints(rectangle);
|
|
1017
|
+
return (isLineHitLine(p1, p2, rectanglePoints[0], rectanglePoints[1]) ||
|
|
1018
|
+
isLineHitLine(p1, p2, rectanglePoints[1], rectanglePoints[2]) ||
|
|
1019
|
+
isLineHitLine(p1, p2, rectanglePoints[2], rectanglePoints[3]) ||
|
|
1020
|
+
isLineHitLine(p1, p2, rectanglePoints[3], rectanglePoints[0]));
|
|
1021
|
+
};
|
|
1004
1022
|
//https://stackoverflow.com/questions/22521982/check-if-point-is-inside-a-polygon
|
|
1005
1023
|
const isPointInPolygon = (point, points) => {
|
|
1006
1024
|
// ray-casting algorithm based on
|
|
@@ -1182,9 +1200,20 @@ function getCrossingPointsBetweenEllipseAndSegment(startPoint, endPoint, cx, cy,
|
|
|
1182
1200
|
}
|
|
1183
1201
|
return (tValues
|
|
1184
1202
|
// Filter to only points that are on the segment.
|
|
1185
|
-
.filter(t => !segment_only || (t >= 0 && t <= 1))
|
|
1203
|
+
.filter((t) => !segment_only || (t >= 0 && t <= 1))
|
|
1186
1204
|
// Solve for points.
|
|
1187
|
-
.map(t => [startPoint[0] + (endPoint[0] - startPoint[0]) * t + cx, startPoint[1] + (endPoint[1] - startPoint[1]) * t + cy]));
|
|
1205
|
+
.map((t) => [startPoint[0] + (endPoint[0] - startPoint[0]) * t + cx, startPoint[1] + (endPoint[1] - startPoint[1]) * t + cy]));
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Get a point between two points.
|
|
1209
|
+
* @param x0 The x-axis coordinate of the first point.
|
|
1210
|
+
* @param y0 The y-axis coordinate of the first point.
|
|
1211
|
+
* @param x1 The x-axis coordinate of the second point.
|
|
1212
|
+
* @param y1 The y-axis coordinate of the second point.
|
|
1213
|
+
* @param d Normalized
|
|
1214
|
+
*/
|
|
1215
|
+
function getPointBetween(x0, y0, x1, y1, d = 0.5) {
|
|
1216
|
+
return [x0 + (x1 - x0) * d, y0 + (y1 - y0) * d];
|
|
1188
1217
|
}
|
|
1189
1218
|
|
|
1190
1219
|
function isInPlaitBoard(board, x, y) {
|
|
@@ -1313,6 +1342,7 @@ const IS_CHROME = typeof navigator !== 'undefined' && /Chrome/i.test(navigator.u
|
|
|
1313
1342
|
// Native beforeInput events don't work well with react on Chrome 75 and older, Chrome 76+ can use beforeInput
|
|
1314
1343
|
const IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent);
|
|
1315
1344
|
|
|
1345
|
+
// Credits to slate - https://github.com/ianstormtaylor/slate
|
|
1316
1346
|
/**
|
|
1317
1347
|
* Check whether to merge an operation into the previous operation.
|
|
1318
1348
|
*/
|
|
@@ -1353,6 +1383,38 @@ const PlaitHistoryBoard = {
|
|
|
1353
1383
|
isMerging(board) {
|
|
1354
1384
|
return MERGING.get(board);
|
|
1355
1385
|
},
|
|
1386
|
+
/**
|
|
1387
|
+
* Get the splitting once flag's current value.
|
|
1388
|
+
*/
|
|
1389
|
+
isSplittingOnce(board) {
|
|
1390
|
+
return SPLITTING_ONCE.get(board);
|
|
1391
|
+
},
|
|
1392
|
+
setSplittingOnce(board, value) {
|
|
1393
|
+
SPLITTING_ONCE.set(board, value);
|
|
1394
|
+
},
|
|
1395
|
+
/**
|
|
1396
|
+
* Apply a series of changes inside a synchronous `fn`, These operations will
|
|
1397
|
+
* be merged into the previous history.
|
|
1398
|
+
*/
|
|
1399
|
+
withMerging(board, fn) {
|
|
1400
|
+
const prev = PlaitHistoryBoard.isMerging(board);
|
|
1401
|
+
MERGING.set(board, true);
|
|
1402
|
+
fn();
|
|
1403
|
+
MERGING.set(board, prev);
|
|
1404
|
+
},
|
|
1405
|
+
/**
|
|
1406
|
+
* Apply a series of changes inside a synchronous `fn`, ensuring that the first
|
|
1407
|
+
* operation starts a new batch in the history. Subsequent operations will be
|
|
1408
|
+
* merged as usual.
|
|
1409
|
+
*/
|
|
1410
|
+
withNewBatch(board, fn) {
|
|
1411
|
+
const prev = PlaitHistoryBoard.isMerging(board);
|
|
1412
|
+
MERGING.set(board, true);
|
|
1413
|
+
SPLITTING_ONCE.set(board, true);
|
|
1414
|
+
fn();
|
|
1415
|
+
MERGING.set(board, prev);
|
|
1416
|
+
SPLITTING_ONCE.delete(board);
|
|
1417
|
+
},
|
|
1356
1418
|
/**
|
|
1357
1419
|
* Apply a series of changes inside a synchronous `fn`, without merging any of
|
|
1358
1420
|
* the new operations into previous save point in the history.
|
|
@@ -1686,7 +1748,7 @@ const getHitElementsBySelection = (board, selection, match = () => true) => {
|
|
|
1686
1748
|
return [];
|
|
1687
1749
|
}
|
|
1688
1750
|
}
|
|
1689
|
-
depthFirstRecursion(board, node => {
|
|
1751
|
+
depthFirstRecursion(board, (node) => {
|
|
1690
1752
|
if (!PlaitBoard.isBoard(node) && match(node)) {
|
|
1691
1753
|
let isRectangleHit = false;
|
|
1692
1754
|
try {
|
|
@@ -1704,15 +1766,15 @@ const getHitElementsBySelection = (board, selection, match = () => true) => {
|
|
|
1704
1766
|
}, getIsRecursionFunc(board), true);
|
|
1705
1767
|
return rectangleHitElements;
|
|
1706
1768
|
};
|
|
1707
|
-
const getHitElementsByPoint = (board, point, match = () => true) => {
|
|
1769
|
+
const getHitElementsByPoint = (board, point, match = () => true, isStrict = true) => {
|
|
1708
1770
|
let hitElements = [];
|
|
1709
|
-
depthFirstRecursion(board, node => {
|
|
1771
|
+
depthFirstRecursion(board, (node) => {
|
|
1710
1772
|
if (PlaitBoard.isBoard(node) || !match(node) || !PlaitElement.hasMounted(node)) {
|
|
1711
1773
|
return;
|
|
1712
1774
|
}
|
|
1713
1775
|
let isHit = false;
|
|
1714
1776
|
try {
|
|
1715
|
-
isHit = board.isHit(node, point);
|
|
1777
|
+
isHit = board.isHit(node, point, isStrict);
|
|
1716
1778
|
}
|
|
1717
1779
|
catch (error) {
|
|
1718
1780
|
if (isDebug()) {
|
|
@@ -1726,8 +1788,8 @@ const getHitElementsByPoint = (board, point, match = () => true) => {
|
|
|
1726
1788
|
}, getIsRecursionFunc(board), true);
|
|
1727
1789
|
return hitElements;
|
|
1728
1790
|
};
|
|
1729
|
-
const getHitElementByPoint = (board, point, match = () => true) => {
|
|
1730
|
-
const pointHitElements = getHitElementsByPoint(board, point, match);
|
|
1791
|
+
const getHitElementByPoint = (board, point, match = () => true, isStrict = true) => {
|
|
1792
|
+
const pointHitElements = getHitElementsByPoint(board, point, match, isStrict);
|
|
1731
1793
|
const hitElement = board.getOneHitElement(pointHitElements);
|
|
1732
1794
|
return hitElement;
|
|
1733
1795
|
};
|
|
@@ -1765,14 +1827,14 @@ const removeSelectedElement = (board, element, isRemoveChildren = false) => {
|
|
|
1765
1827
|
if (selectedElements.includes(element)) {
|
|
1766
1828
|
const targetElements = [];
|
|
1767
1829
|
if (board.isRecursion(element) && isRemoveChildren) {
|
|
1768
|
-
depthFirstRecursion(element, node => {
|
|
1830
|
+
depthFirstRecursion(element, (node) => {
|
|
1769
1831
|
targetElements.push(node);
|
|
1770
|
-
}, node => board.isRecursion(node));
|
|
1832
|
+
}, (node) => board.isRecursion(node));
|
|
1771
1833
|
}
|
|
1772
1834
|
else {
|
|
1773
1835
|
targetElements.push(element);
|
|
1774
1836
|
}
|
|
1775
|
-
const newSelectedElements = selectedElements.filter(value => !targetElements.includes(value));
|
|
1837
|
+
const newSelectedElements = selectedElements.filter((value) => !targetElements.includes(value));
|
|
1776
1838
|
cacheSelectedElements(board, newSelectedElements);
|
|
1777
1839
|
}
|
|
1778
1840
|
};
|
|
@@ -1785,7 +1847,7 @@ const clearSelectedElement = (board) => {
|
|
|
1785
1847
|
};
|
|
1786
1848
|
const isSelectedElement = (board, element) => {
|
|
1787
1849
|
const selectedElements = getSelectedElements(board);
|
|
1788
|
-
return !!selectedElements.find(value => value === element);
|
|
1850
|
+
return !!selectedElements.find((value) => value === element);
|
|
1789
1851
|
};
|
|
1790
1852
|
const temporaryDisableSelection = (board) => {
|
|
1791
1853
|
const currentOptions = board.getPluginOptions(PlaitPluginKey.withSelection);
|
|
@@ -1935,15 +1997,14 @@ function updateViewport(board, origination, zoom) {
|
|
|
1935
1997
|
});
|
|
1936
1998
|
clearViewportOrigination(board);
|
|
1937
1999
|
}
|
|
1938
|
-
function updateZoom(board, newZoom,
|
|
2000
|
+
function updateZoom(board, newZoom, center) {
|
|
1939
2001
|
newZoom = clampZoomLevel(newZoom);
|
|
1940
|
-
const movingPoint = PlaitBoard.getMovingPointInBoard(board);
|
|
1941
2002
|
const nativeElement = PlaitBoard.getBoardContainer(board);
|
|
1942
2003
|
const nativeElementRect = nativeElement.getBoundingClientRect();
|
|
1943
2004
|
const boardContainerRect = PlaitBoard.getBoardContainer(board).getBoundingClientRect();
|
|
1944
2005
|
let focusPoint = [boardContainerRect.width / 2, boardContainerRect.height / 2];
|
|
1945
|
-
if (
|
|
1946
|
-
focusPoint = [
|
|
2006
|
+
if (center && distanceBetweenPointAndRectangle(center[0], center[1], nativeElementRect) === 0) {
|
|
2007
|
+
focusPoint = [center[0] - nativeElementRect.x, center[1] - nativeElementRect.y];
|
|
1947
2008
|
}
|
|
1948
2009
|
const zoom = board.viewport.zoom;
|
|
1949
2010
|
const origination = getViewportOrigination(board);
|
|
@@ -4265,6 +4326,8 @@ const Point = {
|
|
|
4265
4326
|
|
|
4266
4327
|
const SAVING = new WeakMap();
|
|
4267
4328
|
const MERGING = new WeakMap();
|
|
4329
|
+
const HISTORY = new WeakMap();
|
|
4330
|
+
const SPLITTING_ONCE = new WeakMap();
|
|
4268
4331
|
|
|
4269
4332
|
var Direction;
|
|
4270
4333
|
(function (Direction) {
|
|
@@ -4962,6 +5025,7 @@ class ListRender {
|
|
|
4962
5025
|
if (diffResult) {
|
|
4963
5026
|
const newContexts = [];
|
|
4964
5027
|
const newInstances = [];
|
|
5028
|
+
// for moving scene: the current index for first element before moving
|
|
4965
5029
|
let currentIndexForFirstElement = null;
|
|
4966
5030
|
diffResult.forEachItem((record) => {
|
|
4967
5031
|
NODE_TO_INDEX.set(record.item, record.currentIndex);
|
|
@@ -5128,7 +5192,7 @@ currentIndexForFirstElement = null) => {
|
|
|
5128
5192
|
const mountOnItemMove = (element, index, childrenContext, currentIndexForFirstElement) => {
|
|
5129
5193
|
const containerG = PlaitElement.getContainerG(element, { suppressThrow: false });
|
|
5130
5194
|
mountElementG(index, containerG, childrenContext, currentIndexForFirstElement);
|
|
5131
|
-
if (element.children && !PlaitElement.isRootElement(element)) {
|
|
5195
|
+
if (element.children && !PlaitElement.isRootElement(element) && childrenContext.board.isExpanded(element)) {
|
|
5132
5196
|
element.children.forEach((child, index) => {
|
|
5133
5197
|
mountOnItemMove(child, index, { ...childrenContext, parent: element }, null);
|
|
5134
5198
|
});
|
|
@@ -5554,6 +5618,10 @@ function withHistory(board) {
|
|
|
5554
5618
|
merge = shouldMerge(op, lastOp);
|
|
5555
5619
|
}
|
|
5556
5620
|
}
|
|
5621
|
+
if (PlaitHistoryBoard.isSplittingOnce(board)) {
|
|
5622
|
+
merge = false;
|
|
5623
|
+
PlaitHistoryBoard.setSplittingOnce(board, undefined);
|
|
5624
|
+
}
|
|
5557
5625
|
if (lastBatch && merge) {
|
|
5558
5626
|
lastBatch.push(op);
|
|
5559
5627
|
}
|
|
@@ -5652,7 +5720,7 @@ const withHotkey = (board) => {
|
|
|
5652
5720
|
if (PlaitBoard.getMovingPointInBoard(board) || PlaitBoard.isMovingPointInBoard(board)) {
|
|
5653
5721
|
if (isHotkey(['mod+=', 'mod++'], { byKey: true })(event)) {
|
|
5654
5722
|
event.preventDefault();
|
|
5655
|
-
BoardTransforms.updateZoom(board, board.viewport.zoom + 0.1
|
|
5723
|
+
BoardTransforms.updateZoom(board, board.viewport.zoom + 0.1);
|
|
5656
5724
|
return;
|
|
5657
5725
|
}
|
|
5658
5726
|
if (isHotkey(['mod+shift+=', 'mod+shift++'], { byKey: true })(event)) {
|
|
@@ -6567,5 +6635,5 @@ function createModModifierKeys() {
|
|
|
6567
6635
|
* Generated bundle index. Do not edit.
|
|
6568
6636
|
*/
|
|
6569
6637
|
|
|
6570
|
-
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, 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, 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, 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, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsByPoint, 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, 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, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle,
|
|
6638
|
+
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, 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, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, 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, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetThemeOperation, isSetViewportOperation, isSingleLineHitRectangleEdge, isSnapPoint, 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, withViewport };
|
|
6571
6639
|
//# sourceMappingURL=plait-core.mjs.map
|