@plait/core 0.47.0 → 0.49.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/board/board.component.mjs +3 -3
- package/esm2022/plugins/with-moving.mjs +7 -10
- package/esm2022/plugins/with-selection.mjs +15 -21
- package/esm2022/plugins/with-viewport.mjs +2 -2
- package/esm2022/transforms/board.mjs +4 -5
- package/esm2022/utils/board.mjs +1 -15
- package/esm2022/utils/dom/common.mjs +1 -23
- package/esm2022/utils/index.mjs +2 -1
- package/esm2022/utils/to-image.mjs +1 -1
- package/esm2022/utils/to-point.mjs +49 -0
- package/esm2022/utils/viewport.mjs +8 -20
- package/fesm2022/plait-core.mjs +74 -81
- package/fesm2022/plait-core.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/board.d.ts +0 -3
- package/utils/dom/common.d.ts +1 -16
- package/utils/index.d.ts +1 -0
- package/utils/to-point.d.ts +21 -0
- package/utils/viewport.d.ts +2 -7
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -335,27 +335,6 @@ const POINTER_BUTTON = {
|
|
|
335
335
|
const PRESS_AND_MOVE_BUFFER = 3;
|
|
336
336
|
|
|
337
337
|
const NS = 'http://www.w3.org/2000/svg';
|
|
338
|
-
/**
|
|
339
|
-
* Get the screen coordinates starting from the upper left corner of the svg element (based on the svg screen coordinate system)
|
|
340
|
-
* @param x screen x
|
|
341
|
-
* @param y screen x
|
|
342
|
-
* @returns
|
|
343
|
-
*/
|
|
344
|
-
function toPoint(x, y, svg) {
|
|
345
|
-
const rect = svg.getBoundingClientRect();
|
|
346
|
-
return [x - rect.x, y - rect.y];
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* `toPoint` reverse processing
|
|
350
|
-
* Get the screen coordinate starting from the upper left corner of the browser window (based on the screen coordinate system)
|
|
351
|
-
* @param point screen coordinates based on the upper left corner of the svg
|
|
352
|
-
* @returns
|
|
353
|
-
*/
|
|
354
|
-
function toScreenPoint(board, point) {
|
|
355
|
-
const host = PlaitBoard.getHost(board);
|
|
356
|
-
const rect = host.getBoundingClientRect();
|
|
357
|
-
return [point[0] + rect.x, point[1] + rect.y];
|
|
358
|
-
}
|
|
359
338
|
function createG() {
|
|
360
339
|
const newG = document.createElementNS(NS, 'g');
|
|
361
340
|
return newG;
|
|
@@ -838,20 +817,6 @@ const catmullRomFitting = function (points) {
|
|
|
838
817
|
return result;
|
|
839
818
|
};
|
|
840
819
|
|
|
841
|
-
function transformPoints(board, points) {
|
|
842
|
-
const newPoints = points.map(point => {
|
|
843
|
-
return transformPoint(board, point);
|
|
844
|
-
});
|
|
845
|
-
return newPoints;
|
|
846
|
-
}
|
|
847
|
-
function transformPoint(board, point) {
|
|
848
|
-
const { width, height } = PlaitBoard.getHost(board).getBoundingClientRect();
|
|
849
|
-
const viewBox = PlaitBoard.getHost(board).viewBox.baseVal;
|
|
850
|
-
const x = (point[0] / width) * viewBox.width + viewBox.x;
|
|
851
|
-
const y = (point[1] / height) * viewBox.height + viewBox.y;
|
|
852
|
-
const newPoint = [x, y];
|
|
853
|
-
return newPoint;
|
|
854
|
-
}
|
|
855
820
|
function isInPlaitBoard(board, x, y) {
|
|
856
821
|
const plaitBoardElement = PlaitBoard.getBoardContainer(board);
|
|
857
822
|
const plaitBoardRect = plaitBoardElement.getBoundingClientRect();
|
|
@@ -1246,13 +1211,13 @@ const updatePointerType = (board, pointer) => {
|
|
|
1246
1211
|
};
|
|
1247
1212
|
function updateZoom(board, newZoom, isCenter = true) {
|
|
1248
1213
|
newZoom = clampZoomLevel(newZoom);
|
|
1249
|
-
const
|
|
1214
|
+
const movingPoint = PlaitBoard.getMovingPointInBoard(board);
|
|
1250
1215
|
const nativeElement = PlaitBoard.getBoardContainer(board);
|
|
1251
1216
|
const nativeElementRect = nativeElement.getBoundingClientRect();
|
|
1252
1217
|
const boardContainerRect = PlaitBoard.getBoardContainer(board).getBoundingClientRect();
|
|
1253
1218
|
let focusPoint = [boardContainerRect.width / 2, boardContainerRect.height / 2];
|
|
1254
|
-
if (!isCenter &&
|
|
1255
|
-
focusPoint =
|
|
1219
|
+
if (!isCenter && movingPoint && distanceBetweenPointAndRectangle(movingPoint[0], movingPoint[1], nativeElementRect) === 0) {
|
|
1220
|
+
focusPoint = [movingPoint[0] - nativeElementRect.x, movingPoint[1] - nativeElementRect.y];
|
|
1256
1221
|
}
|
|
1257
1222
|
const zoom = board.viewport.zoom;
|
|
1258
1223
|
const origination = getViewportOrigination(board);
|
|
@@ -1340,15 +1305,56 @@ const BoardTransforms = {
|
|
|
1340
1305
|
fitViewportWidth
|
|
1341
1306
|
};
|
|
1342
1307
|
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
|
|
1308
|
+
const getViewBox = (board) => {
|
|
1309
|
+
return PlaitBoard.getHost(board).viewBox.baseVal;
|
|
1310
|
+
};
|
|
1311
|
+
/**
|
|
1312
|
+
* Get the screen point starting from the upper left corner of the svg element (based on the svg screen coordinate system)
|
|
1313
|
+
*/
|
|
1314
|
+
function toHostPoint(board, x, y) {
|
|
1315
|
+
const host = PlaitBoard.getHost(board);
|
|
1316
|
+
const rect = host.getBoundingClientRect();
|
|
1317
|
+
return [x - rect.x, y - rect.y];
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Get the point in the coordinate system of the svg viewBox
|
|
1321
|
+
*/
|
|
1322
|
+
function toViewBoxPoint(board, hostPoint) {
|
|
1323
|
+
const viewBox = getViewBox(board);
|
|
1324
|
+
const { zoom } = board.viewport;
|
|
1325
|
+
const x = hostPoint[0] / zoom + viewBox.x;
|
|
1326
|
+
const y = hostPoint[1] / zoom + viewBox.y;
|
|
1327
|
+
const newPoint = [x, y];
|
|
1328
|
+
return newPoint;
|
|
1329
|
+
}
|
|
1330
|
+
function toViewBoxPoints(board, hostPoints) {
|
|
1331
|
+
const newPoints = hostPoints.map(point => {
|
|
1332
|
+
return toViewBoxPoint(board, point);
|
|
1333
|
+
});
|
|
1334
|
+
return newPoints;
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* `toHostPoint` reverse processing
|
|
1338
|
+
* Get the screen point starting from the upper left corner of the browser window or the viewport (based on the screen coordinate system)
|
|
1339
|
+
*/
|
|
1340
|
+
function toScreenPointFromHostPoint(board, hostPoint) {
|
|
1341
|
+
const host = PlaitBoard.getHost(board);
|
|
1342
|
+
const rect = host.getBoundingClientRect();
|
|
1343
|
+
return [hostPoint[0] + rect.x, hostPoint[1] + rect.y];
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* `toViewBoxPoint` reverse processing
|
|
1347
|
+
*/
|
|
1348
|
+
function toHostPointFromViewBoxPoint(board, viewBoxPoint) {
|
|
1346
1349
|
const { zoom } = board.viewport;
|
|
1347
|
-
const viewBox = getViewBox(board
|
|
1348
|
-
const x = (
|
|
1349
|
-
const y = (
|
|
1350
|
+
const viewBox = getViewBox(board);
|
|
1351
|
+
const x = (viewBoxPoint[0] - viewBox.x) * zoom;
|
|
1352
|
+
const y = (viewBoxPoint[1] - viewBox.y) * zoom;
|
|
1350
1353
|
return [x, y];
|
|
1351
1354
|
}
|
|
1355
|
+
|
|
1356
|
+
const IS_FROM_SCROLLING = new WeakMap();
|
|
1357
|
+
const IS_FROM_VIEWPORT_CHANGE = new WeakMap();
|
|
1352
1358
|
function getViewportContainerRect(board) {
|
|
1353
1359
|
const { hideScrollbar } = board.options;
|
|
1354
1360
|
const scrollBarWidth = hideScrollbar ? SCROLL_BAR_WIDTH : 0;
|
|
@@ -1395,16 +1401,12 @@ function getElementHostBBox(board, zoom) {
|
|
|
1395
1401
|
};
|
|
1396
1402
|
}
|
|
1397
1403
|
/**
|
|
1398
|
-
*
|
|
1399
|
-
* @param zoom 缩放比
|
|
1400
|
-
* @param minZoom 最小缩放比
|
|
1401
|
-
* @param maxZoom 最大缩放比
|
|
1402
|
-
* @returns 正确的缩放比
|
|
1404
|
+
* Normalize the scaling ratio, or return the corrected scaling ratio if the limit is exceeded
|
|
1403
1405
|
*/
|
|
1404
1406
|
function clampZoomLevel(zoom, minZoom = MIN_ZOOM, maxZoom = MAX_ZOOM) {
|
|
1405
1407
|
return zoom < minZoom ? minZoom : zoom > maxZoom ? maxZoom : zoom;
|
|
1406
1408
|
}
|
|
1407
|
-
function
|
|
1409
|
+
function calcNewViewBox(board, zoom) {
|
|
1408
1410
|
const boardContainerRectangle = PlaitBoard.getBoardContainer(board).getBoundingClientRect();
|
|
1409
1411
|
const elementHostBBox = getElementHostBBox(board, zoom);
|
|
1410
1412
|
const horizontalPadding = boardContainerRectangle.width / 2;
|
|
@@ -1436,7 +1438,7 @@ function updateViewportOffset(board) {
|
|
|
1436
1438
|
if (!origination) {
|
|
1437
1439
|
return;
|
|
1438
1440
|
}
|
|
1439
|
-
const [scrollLeft, scrollTop] =
|
|
1441
|
+
const [scrollLeft, scrollTop] = toHostPointFromViewBoxPoint(board, origination);
|
|
1440
1442
|
updateViewportContainerScroll(board, scrollLeft, scrollTop);
|
|
1441
1443
|
}
|
|
1442
1444
|
function updateViewportContainerScroll(board, left, top, isFromViewportChange = true) {
|
|
@@ -1467,9 +1469,7 @@ function updateViewportContainerScroll(board, left, top, isFromViewportChange =
|
|
|
1467
1469
|
}
|
|
1468
1470
|
}
|
|
1469
1471
|
function updateViewportByScrolling(board, scrollLeft, scrollTop) {
|
|
1470
|
-
const
|
|
1471
|
-
const viewBox = getViewBox(board, zoom);
|
|
1472
|
-
const origination = [scrollLeft / zoom + viewBox[0], scrollTop / zoom + viewBox[1]];
|
|
1472
|
+
const origination = toViewBoxPoint(board, [scrollLeft, scrollTop]);
|
|
1473
1473
|
if (Point.isEquals(origination, getViewportOrigination(board))) {
|
|
1474
1474
|
return;
|
|
1475
1475
|
}
|
|
@@ -1484,14 +1484,14 @@ function initializeViewportContainer(board) {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
function initializeViewBox(board) {
|
|
1486
1486
|
const zoom = board.viewport.zoom;
|
|
1487
|
-
const viewBox =
|
|
1487
|
+
const viewBox = calcNewViewBox(board, zoom);
|
|
1488
1488
|
setSVGViewBox(board, viewBox);
|
|
1489
1489
|
}
|
|
1490
1490
|
function initializeViewportOffset(board) {
|
|
1491
1491
|
if (!board.viewport?.origination) {
|
|
1492
1492
|
const zoom = board.viewport.zoom;
|
|
1493
1493
|
const viewportContainerRect = PlaitBoard.getBoardContainer(board).getBoundingClientRect();
|
|
1494
|
-
const viewBox =
|
|
1494
|
+
const viewBox = calcNewViewBox(board, zoom);
|
|
1495
1495
|
const centerX = viewBox[0] + viewBox[2] / 2;
|
|
1496
1496
|
const centerY = viewBox[1] + viewBox[3] / 2;
|
|
1497
1497
|
const origination = [centerX - viewportContainerRect.width / 2 / zoom, centerY - viewportContainerRect.height / 2 / zoom];
|
|
@@ -2625,41 +2625,35 @@ function withSelection(board) {
|
|
|
2625
2625
|
let isShift = false;
|
|
2626
2626
|
let isTextSelection = false;
|
|
2627
2627
|
board.pointerDown = (event) => {
|
|
2628
|
+
if (!isShift && event.shiftKey) {
|
|
2629
|
+
isShift = true;
|
|
2630
|
+
}
|
|
2631
|
+
if (isShift && !event.shiftKey) {
|
|
2632
|
+
isShift = false;
|
|
2633
|
+
}
|
|
2628
2634
|
const isHitText = !!(event.target instanceof Element && event.target.closest('.plait-richtext-container'));
|
|
2629
2635
|
isTextSelection = isHitText && PlaitBoard.hasBeenTextEditing(board);
|
|
2630
2636
|
// prevent text from being selected
|
|
2631
2637
|
if (event.shiftKey && !isTextSelection) {
|
|
2632
2638
|
event.preventDefault();
|
|
2633
2639
|
}
|
|
2634
|
-
const point =
|
|
2640
|
+
const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
2635
2641
|
const hitElement = getHitElementByPoint(board, point);
|
|
2636
2642
|
const options = board.getPluginOptions(PlaitPluginKey.withSelection);
|
|
2637
2643
|
if (PlaitBoard.isPointer(board, PlaitPointerType.selection) && !hitElement && options.isMultiple && !options.isDisabledSelect) {
|
|
2638
2644
|
preventTouchMove(board, event, true);
|
|
2639
2645
|
// start rectangle selection
|
|
2640
|
-
start =
|
|
2646
|
+
start = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
2641
2647
|
}
|
|
2642
2648
|
pointerDown(event);
|
|
2643
2649
|
};
|
|
2644
|
-
board.keydown = (event) => {
|
|
2645
|
-
if (!isShift && event.key === 'Shift') {
|
|
2646
|
-
isShift = true;
|
|
2647
|
-
}
|
|
2648
|
-
keydown(event);
|
|
2649
|
-
};
|
|
2650
|
-
board.keyup = (event) => {
|
|
2651
|
-
if (isShift && event.key === 'Shift') {
|
|
2652
|
-
isShift = false;
|
|
2653
|
-
}
|
|
2654
|
-
keyup(event);
|
|
2655
|
-
};
|
|
2656
2650
|
board.pointerMove = (event) => {
|
|
2657
2651
|
if (!isTextSelection) {
|
|
2658
2652
|
// prevent text from being selected
|
|
2659
2653
|
event.preventDefault();
|
|
2660
2654
|
}
|
|
2661
2655
|
if (start && PlaitBoard.isPointer(board, PlaitPointerType.selection)) {
|
|
2662
|
-
const movedTarget =
|
|
2656
|
+
const movedTarget = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
2663
2657
|
const rectangle = RectangleClient.toRectangleClient([start, movedTarget]);
|
|
2664
2658
|
selectionMovingG?.remove();
|
|
2665
2659
|
if (Math.hypot(rectangle.width, rectangle.height) > PRESS_AND_MOVE_BUFFER || isSelectionMoving(board)) {
|
|
@@ -2683,12 +2677,13 @@ function withSelection(board) {
|
|
|
2683
2677
|
};
|
|
2684
2678
|
// handle the end of click select
|
|
2685
2679
|
board.pointerUp = (event) => {
|
|
2686
|
-
const
|
|
2680
|
+
const isSetSelectionPointer = PlaitBoard.isPointer(board, PlaitPointerType.selection) || PlaitBoard.isPointer(board, PlaitPointerType.hand);
|
|
2681
|
+
const isSkip = !isMainPointer(event) || isDragging(board) || !isSetSelectionPointer;
|
|
2687
2682
|
if (isSkip) {
|
|
2688
2683
|
pointerDown(event);
|
|
2689
2684
|
return;
|
|
2690
2685
|
}
|
|
2691
|
-
const point =
|
|
2686
|
+
const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
2692
2687
|
const selection = { anchor: point, focus: point };
|
|
2693
2688
|
Transforms.setSelection(board, selection);
|
|
2694
2689
|
pointerUp(event);
|
|
@@ -3177,7 +3172,7 @@ function withViewport(board) {
|
|
|
3177
3172
|
}, 500, { leading: true });
|
|
3178
3173
|
board.onChange = () => {
|
|
3179
3174
|
const isSetViewport = board.operations.some(op => op.type === 'set_viewport');
|
|
3180
|
-
const isOnlySetSelection = board.operations.
|
|
3175
|
+
const isOnlySetSelection = board.operations.every(op => op.type === 'set_selection');
|
|
3181
3176
|
if (isOnlySetSelection) {
|
|
3182
3177
|
return onChange();
|
|
3183
3178
|
}
|
|
@@ -3574,8 +3569,7 @@ function withMoving(board) {
|
|
|
3574
3569
|
let alignG = null;
|
|
3575
3570
|
let activeElementsRectangle = null;
|
|
3576
3571
|
board.pointerDown = (event) => {
|
|
3577
|
-
const
|
|
3578
|
-
const point = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3572
|
+
const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
3579
3573
|
let movableElements = board.children.filter(item => board.isMovable(item));
|
|
3580
3574
|
if (!PlaitBoard.isReadonly(board) &&
|
|
3581
3575
|
PlaitBoard.isPointer(board, PlaitPointerType.selection) &&
|
|
@@ -3607,8 +3601,7 @@ function withMoving(board) {
|
|
|
3607
3601
|
isPreventDefault = true;
|
|
3608
3602
|
}
|
|
3609
3603
|
alignG?.remove();
|
|
3610
|
-
const
|
|
3611
|
-
const endPoint = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3604
|
+
const endPoint = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
|
|
3612
3605
|
offsetX = endPoint[0] - startPoint[0];
|
|
3613
3606
|
offsetY = endPoint[1] - startPoint[1];
|
|
3614
3607
|
const distance = distanceBetweenPointAndPoint(...endPoint, ...startPoint);
|
|
@@ -3647,7 +3640,7 @@ function withMoving(board) {
|
|
|
3647
3640
|
}
|
|
3648
3641
|
}
|
|
3649
3642
|
if (isPreventDefault) {
|
|
3650
|
-
//
|
|
3643
|
+
// Prevent canvas scrolling behavior from being triggered during move
|
|
3651
3644
|
event.preventDefault();
|
|
3652
3645
|
}
|
|
3653
3646
|
pointerMove(event);
|
|
@@ -4279,7 +4272,7 @@ class PlaitBoardComponent {
|
|
|
4279
4272
|
.subscribe((clipboardEvent) => {
|
|
4280
4273
|
const mousePoint = PlaitBoard.getMovingPointInBoard(this.board);
|
|
4281
4274
|
if (mousePoint) {
|
|
4282
|
-
const targetPoint =
|
|
4275
|
+
const targetPoint = toViewBoxPoint(this.board, toHostPoint(this.board, mousePoint[0], mousePoint[1]));
|
|
4283
4276
|
this.board.insertFragment(clipboardEvent.clipboardData, targetPoint);
|
|
4284
4277
|
}
|
|
4285
4278
|
});
|
|
@@ -4618,5 +4611,5 @@ function createModModifierKeys() {
|
|
|
4618
4611
|
* Generated bundle index. Do not edit.
|
|
4619
4612
|
*/
|
|
4620
4613
|
|
|
4621
|
-
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, CLIP_BOARD_FORMAT_KEY, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, 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, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, 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_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, PlaitChildrenElementComponent, PlaitContextService, PlaitElement, PlaitElementComponent, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RIGHT_ARROW, 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, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, X, Y, Z, ZERO, addMovingElements, addSelectedElement, arrowPoints, cacheMovingElements, cacheSelectedElements, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createFakeEvent, createForeignObject, createG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createSelectionRectangleG, createTestingBoard, createText, createTouchEvent, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downScale, downloadImage, drawArrow, drawBezierPath, drawCircle, drawLine, drawLinearPath, drawRectangle, drawRoundRectangle, fakeNodeWeakMap, findElements, getBoardRectangle, getClipboardByKey, getClipboardDataByMedia, getDataFromClipboard, getElementById, getElementHostBBox, getHitElementByPoint, getHitElementsBySelection, getIsRecursionFunc, getMovingElements, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getRealScrollBarWidth, getRectangleByElements, getSelectedElements, getTemporaryElements, getTemporaryRef, getTextFromClipboard, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isDOMElement, isDOMNode, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedElement, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, normalizePoint, preventTouchMove, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setClipboardData, setClipboardDataByMedia, setClipboardDataByText, setDragging, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, temporaryDisableSelection, throttleRAF,
|
|
4614
|
+
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, CLIP_BOARD_FORMAT_KEY, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, 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, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, 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_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, PlaitChildrenElementComponent, PlaitContextService, PlaitElement, PlaitElementComponent, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RIGHT_ARROW, 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, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, X, Y, Z, ZERO, addMovingElements, addSelectedElement, arrowPoints, cacheMovingElements, cacheSelectedElements, calcNewViewBox, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createFakeEvent, createForeignObject, createG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createSelectionRectangleG, createTestingBoard, createText, createTouchEvent, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downScale, downloadImage, drawArrow, drawBezierPath, drawCircle, drawLine, drawLinearPath, drawRectangle, drawRoundRectangle, fakeNodeWeakMap, findElements, getBoardRectangle, getClipboardByKey, getClipboardDataByMedia, getDataFromClipboard, getElementById, getElementHostBBox, getHitElementByPoint, getHitElementsBySelection, getIsRecursionFunc, getMovingElements, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getRealScrollBarWidth, getRectangleByElements, getSelectedElements, getTemporaryElements, getTemporaryRef, getTextFromClipboard, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isDOMElement, isDOMNode, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedElement, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, normalizePoint, preventTouchMove, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setClipboardData, setClipboardDataByMedia, setClipboardDataByText, setDragging, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, temporaryDisableSelection, throttleRAF, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, updateForeignObject, updateForeignObjectWidth, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withMoving, withOptions, withSelection };
|
|
4622
4615
|
//# sourceMappingURL=plait-core.mjs.map
|