@plait/core 0.34.0 → 0.36.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/board/board.component.d.ts +1 -0
- package/constants/cursor.d.ts +9 -0
- package/constants/index.d.ts +1 -1
- package/constants/zoom.d.ts +3 -0
- package/esm2022/board/board.component.mjs +49 -22
- package/esm2022/constants/cursor.mjs +12 -0
- package/esm2022/constants/index.mjs +2 -2
- package/esm2022/constants/zoom.mjs +4 -0
- package/esm2022/plugins/with-moving.mjs +6 -5
- package/esm2022/plugins/with-selection.mjs +3 -3
- package/esm2022/utils/helper.mjs +4 -1
- package/esm2022/utils/to-image.mjs +55 -34
- package/esm2022/utils/viewport.mjs +3 -2
- package/fesm2022/plait-core.mjs +120 -60
- package/fesm2022/plait-core.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/styles.scss +3 -0
- package/utils/helper.d.ts +1 -0
- package/utils/to-image.d.ts +2 -1
- package/constants/resize.d.ts +0 -3
- package/esm2022/constants/resize.mjs +0 -5
package/fesm2022/plait-core.mjs
CHANGED
|
@@ -281,8 +281,15 @@ const MAC_META = 224;
|
|
|
281
281
|
|
|
282
282
|
var ResizeCursorClass;
|
|
283
283
|
(function (ResizeCursorClass) {
|
|
284
|
-
ResizeCursorClass["ew
|
|
284
|
+
ResizeCursorClass["ew"] = "ew-resize";
|
|
285
|
+
ResizeCursorClass["ns"] = "ns-resize";
|
|
286
|
+
ResizeCursorClass["nesw"] = "nesw-resize";
|
|
287
|
+
ResizeCursorClass["nwse"] = "nwse-resize";
|
|
285
288
|
})(ResizeCursorClass || (ResizeCursorClass = {}));
|
|
289
|
+
var CursorClass;
|
|
290
|
+
(function (CursorClass) {
|
|
291
|
+
CursorClass["crosshair"] = "crosshair";
|
|
292
|
+
})(CursorClass || (CursorClass = {}));
|
|
286
293
|
|
|
287
294
|
const ATTACHED_ELEMENT_CLASS_NAME = 'plait-board-attached';
|
|
288
295
|
const ACTIVE_STROKE_WIDTH = 1;
|
|
@@ -870,6 +877,9 @@ function normalizePoint(point) {
|
|
|
870
877
|
}
|
|
871
878
|
: point;
|
|
872
879
|
}
|
|
880
|
+
const RgbaToHEX = (Rgb, opacity) => {
|
|
881
|
+
return Rgb + Math.floor(opacity * 255).toString(16);
|
|
882
|
+
};
|
|
873
883
|
|
|
874
884
|
/**
|
|
875
885
|
* Check whether to merge an operation into the previous operation.
|
|
@@ -1142,6 +1152,10 @@ function drawBezierPath(points, options) {
|
|
|
1142
1152
|
return g;
|
|
1143
1153
|
}
|
|
1144
1154
|
|
|
1155
|
+
const ZOOM_STEP = 0.1;
|
|
1156
|
+
const MIN_ZOOM = 0.1;
|
|
1157
|
+
const MAX_ZOOM = 4;
|
|
1158
|
+
|
|
1145
1159
|
function setViewport(board, viewport) {
|
|
1146
1160
|
const operation = { type: 'set_viewport', properties: board.viewport, newProperties: viewport };
|
|
1147
1161
|
board.apply(operation);
|
|
@@ -1322,7 +1336,7 @@ function getElementHostBBox(board, zoom) {
|
|
|
1322
1336
|
* @param maxZoom 最大缩放比
|
|
1323
1337
|
* @returns 正确的缩放比
|
|
1324
1338
|
*/
|
|
1325
|
-
function clampZoomLevel(zoom, minZoom =
|
|
1339
|
+
function clampZoomLevel(zoom, minZoom = MIN_ZOOM, maxZoom = MAX_ZOOM) {
|
|
1326
1340
|
return zoom < minZoom ? minZoom : zoom > maxZoom ? maxZoom : zoom;
|
|
1327
1341
|
}
|
|
1328
1342
|
function getViewBox(board, zoom) {
|
|
@@ -1561,7 +1575,7 @@ function convertImageToBase64(url) {
|
|
|
1561
1575
|
* @param clonedNode clone node
|
|
1562
1576
|
*/
|
|
1563
1577
|
function cloneCSSStyle(nativeNode, clonedNode) {
|
|
1564
|
-
const targetStyle = clonedNode
|
|
1578
|
+
const targetStyle = clonedNode?.style;
|
|
1565
1579
|
if (!targetStyle) {
|
|
1566
1580
|
return;
|
|
1567
1581
|
}
|
|
@@ -1578,48 +1592,41 @@ function cloneCSSStyle(nativeNode, clonedNode) {
|
|
|
1578
1592
|
}
|
|
1579
1593
|
}
|
|
1580
1594
|
/**
|
|
1581
|
-
* clone
|
|
1582
|
-
* @param
|
|
1583
|
-
* @param
|
|
1584
|
-
* @
|
|
1595
|
+
* batch clone target styles
|
|
1596
|
+
* @param sourceNode
|
|
1597
|
+
* @param cloneNode
|
|
1598
|
+
* @param inlineStyleClassNames
|
|
1585
1599
|
*/
|
|
1586
|
-
|
|
1587
|
-
const elementHostBox = getRectangleByElements(board, board.children, true);
|
|
1588
|
-
const { width, height, x, y } = elementHostBox;
|
|
1589
|
-
const { padding = 4, inlineStyleClassNames } = options;
|
|
1590
|
-
const sourceSvg = PlaitBoard.getHost(board);
|
|
1591
|
-
const cloneSvgElement = sourceSvg.cloneNode(true);
|
|
1592
|
-
cloneSvgElement.style.width = `${width}px`;
|
|
1593
|
-
cloneSvgElement.style.height = `${height}px`;
|
|
1594
|
-
cloneSvgElement.style.backgroundColor = '';
|
|
1595
|
-
cloneSvgElement.setAttribute('width', `${width}`);
|
|
1596
|
-
cloneSvgElement.setAttribute('height', `${height}`);
|
|
1597
|
-
cloneSvgElement.setAttribute('viewBox', [x - padding, y - padding, width + 2 * padding, height + 2 * padding].join(','));
|
|
1600
|
+
function batchCloneCSSStyle(sourceNode, cloneNode, inlineStyleClassNames) {
|
|
1598
1601
|
if (inlineStyleClassNames) {
|
|
1599
1602
|
const classNames = inlineStyleClassNames + `,.${IMAGE_CONTAINER}`;
|
|
1600
|
-
const sourceNodes = Array.from(
|
|
1601
|
-
const cloneNodes = Array.from(
|
|
1603
|
+
const sourceNodes = Array.from(sourceNode.querySelectorAll(classNames));
|
|
1604
|
+
const cloneNodes = Array.from(cloneNode.querySelectorAll(classNames));
|
|
1602
1605
|
sourceNodes.forEach((node, index) => {
|
|
1603
|
-
const cloneNode = cloneNodes[index];
|
|
1604
1606
|
const childElements = Array.from(node.querySelectorAll('*')).filter(isElementNode);
|
|
1605
|
-
const cloneChildElements = Array.from(
|
|
1607
|
+
const cloneChildElements = Array.from(cloneNodes[index].querySelectorAll('*')).filter(isElementNode);
|
|
1606
1608
|
sourceNodes.push(...childElements);
|
|
1607
1609
|
cloneNodes.push(...cloneChildElements);
|
|
1608
1610
|
});
|
|
1609
1611
|
// processing styles
|
|
1610
1612
|
sourceNodes.map((node, index) => {
|
|
1611
|
-
|
|
1612
|
-
cloneCSSStyle(node, cloneNode);
|
|
1613
|
+
cloneCSSStyle(node, cloneNodes[index]);
|
|
1613
1614
|
});
|
|
1614
1615
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* convert images in target nodes in batches
|
|
1619
|
+
* @param sourceNode
|
|
1620
|
+
* @param cloneNode
|
|
1621
|
+
*/
|
|
1622
|
+
async function batchConvertImage(sourceNode, cloneNode) {
|
|
1623
|
+
const sourceImageNodes = Array.from(sourceNode.querySelectorAll(`.${IMAGE_CONTAINER}`));
|
|
1624
|
+
const cloneImageNodes = Array.from(cloneNode.querySelectorAll(`.${IMAGE_CONTAINER}`));
|
|
1618
1625
|
await Promise.all(sourceImageNodes.map((_, index) => {
|
|
1619
1626
|
return new Promise(resolve => {
|
|
1620
|
-
const
|
|
1627
|
+
const cloneImageNode = cloneImageNodes[index];
|
|
1621
1628
|
// processing image
|
|
1622
|
-
const image =
|
|
1629
|
+
const image = cloneImageNode.querySelector('img');
|
|
1623
1630
|
const url = image?.getAttribute('src');
|
|
1624
1631
|
if (!url) {
|
|
1625
1632
|
return resolve(true);
|
|
@@ -1630,6 +1637,33 @@ async function cloneSvg(board, options) {
|
|
|
1630
1637
|
});
|
|
1631
1638
|
});
|
|
1632
1639
|
}));
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* clone svg element
|
|
1643
|
+
* @param board board
|
|
1644
|
+
* @param options parameter configuration
|
|
1645
|
+
* @returns clone svg element
|
|
1646
|
+
*/
|
|
1647
|
+
function cloneSvg(board, elements, rectangle, options) {
|
|
1648
|
+
const { width, height, x, y } = rectangle;
|
|
1649
|
+
const { padding = 4, inlineStyleClassNames } = options;
|
|
1650
|
+
const sourceSvg = PlaitBoard.getHost(board);
|
|
1651
|
+
const selectedGElements = elements.map(value => PlaitElement.getComponent(value).g);
|
|
1652
|
+
const cloneSvgElement = sourceSvg.cloneNode();
|
|
1653
|
+
const newHostElement = PlaitBoard.getElementHost(board).cloneNode();
|
|
1654
|
+
cloneSvgElement.style.width = `${width}px`;
|
|
1655
|
+
cloneSvgElement.style.height = `${height}px`;
|
|
1656
|
+
cloneSvgElement.style.backgroundColor = '';
|
|
1657
|
+
cloneSvgElement.setAttribute('width', `${width}`);
|
|
1658
|
+
cloneSvgElement.setAttribute('height', `${height}`);
|
|
1659
|
+
cloneSvgElement.setAttribute('viewBox', [x - padding, y - padding, width + 2 * padding, height + 2 * padding].join(','));
|
|
1660
|
+
selectedGElements.forEach((child, i) => {
|
|
1661
|
+
const cloneChild = child.cloneNode(true);
|
|
1662
|
+
batchCloneCSSStyle(child, cloneChild, inlineStyleClassNames);
|
|
1663
|
+
batchConvertImage(child, cloneChild);
|
|
1664
|
+
newHostElement.appendChild(cloneChild);
|
|
1665
|
+
});
|
|
1666
|
+
cloneSvgElement.appendChild(newHostElement);
|
|
1633
1667
|
return cloneSvgElement;
|
|
1634
1668
|
}
|
|
1635
1669
|
/**
|
|
@@ -1642,12 +1676,13 @@ async function toImage(board, options) {
|
|
|
1642
1676
|
if (!board) {
|
|
1643
1677
|
return undefined;
|
|
1644
1678
|
}
|
|
1645
|
-
const
|
|
1679
|
+
const elements = options?.elements || findElements(board, { match: () => true, recursion: () => true });
|
|
1680
|
+
const targetRectangle = getRectangleByElements(board, elements, false);
|
|
1646
1681
|
const { ratio = 2, fillStyle = 'transparent' } = options;
|
|
1647
|
-
const { width, height } =
|
|
1682
|
+
const { width, height } = targetRectangle;
|
|
1648
1683
|
const ratioWidth = width * ratio;
|
|
1649
1684
|
const ratioHeight = height * ratio;
|
|
1650
|
-
const cloneSvgElement = await cloneSvg(board, options);
|
|
1685
|
+
const cloneSvgElement = await cloneSvg(board, elements, targetRectangle, options);
|
|
1651
1686
|
const { canvas, ctx } = createCanvas(ratioWidth, ratioHeight, fillStyle);
|
|
1652
1687
|
const svgStr = new XMLSerializer().serializeToString(cloneSvgElement);
|
|
1653
1688
|
const imgSrc = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgStr)}`;
|
|
@@ -2560,7 +2595,7 @@ function withSelection(board) {
|
|
|
2560
2595
|
fill: SELECTION_FILL_COLOR,
|
|
2561
2596
|
fillStyle: 'solid'
|
|
2562
2597
|
});
|
|
2563
|
-
PlaitBoard.
|
|
2598
|
+
PlaitBoard.getElementActiveHost(board).append(selectionMovingG);
|
|
2564
2599
|
}
|
|
2565
2600
|
}
|
|
2566
2601
|
globalPointerMove(event);
|
|
@@ -2678,7 +2713,7 @@ function createSelectionRectangleG(board) {
|
|
|
2678
2713
|
fillStyle: 'solid'
|
|
2679
2714
|
});
|
|
2680
2715
|
selectionRectangleG.classList.add(SELECTION_RECTANGLE_CLASS_NAME);
|
|
2681
|
-
PlaitBoard.
|
|
2716
|
+
PlaitBoard.getElementActiveHost(board).append(selectionRectangleG);
|
|
2682
2717
|
return selectionRectangleG;
|
|
2683
2718
|
}
|
|
2684
2719
|
return null;
|
|
@@ -3409,7 +3444,7 @@ function withMoving(board) {
|
|
|
3409
3444
|
const host = BOARD_TO_HOST.get(board);
|
|
3410
3445
|
const point = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3411
3446
|
let movableElements = board.children.filter(item => board.isMovable(item));
|
|
3412
|
-
if (movableElements.length && !isPreventTouchMove(board)) {
|
|
3447
|
+
if (!PlaitBoard.isReadonly(board) && movableElements.length && !isPreventTouchMove(board)) {
|
|
3413
3448
|
startPoint = point;
|
|
3414
3449
|
const selectedMovableElements = getSelectedElements(board).filter(item => movableElements.includes(item));
|
|
3415
3450
|
const hitElement = getHitElementByPoint(board, point);
|
|
@@ -3438,8 +3473,8 @@ function withMoving(board) {
|
|
|
3438
3473
|
const endPoint = transformPoint(board, toPoint(event.x, event.y, host));
|
|
3439
3474
|
offsetX = endPoint[0] - startPoint[0];
|
|
3440
3475
|
offsetY = endPoint[1] - startPoint[1];
|
|
3441
|
-
const
|
|
3442
|
-
if (
|
|
3476
|
+
const distance = distanceBetweenPointAndPoint(...endPoint, ...startPoint);
|
|
3477
|
+
if (distance > PRESS_AND_MOVE_BUFFER || getMovingElements(board).length > 0) {
|
|
3443
3478
|
throttleRAF(() => {
|
|
3444
3479
|
if (!activeElementsRectangle) {
|
|
3445
3480
|
return;
|
|
@@ -3886,6 +3921,7 @@ class PlaitBoardComponent {
|
|
|
3886
3921
|
this.ngZone.runOutsideAngular(() => {
|
|
3887
3922
|
this.initializeHookListener();
|
|
3888
3923
|
this.viewportScrollListener();
|
|
3924
|
+
this.wheelZoomListener();
|
|
3889
3925
|
this.elementResizeListener();
|
|
3890
3926
|
fromEvent(document, 'mouseleave')
|
|
3891
3927
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -4066,28 +4102,24 @@ class PlaitBoardComponent {
|
|
|
4066
4102
|
});
|
|
4067
4103
|
}
|
|
4068
4104
|
viewportScrollListener() {
|
|
4069
|
-
this.
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
updateViewportByScrolling(this.board, scrollLeft, scrollTop);
|
|
4081
|
-
});
|
|
4105
|
+
fromEvent(this.viewportContainer.nativeElement, 'scroll')
|
|
4106
|
+
.pipe(takeUntil(this.destroy$), filter(() => {
|
|
4107
|
+
if (isFromViewportChange(this.board)) {
|
|
4108
|
+
setIsFromViewportChange(this.board, false);
|
|
4109
|
+
return false;
|
|
4110
|
+
}
|
|
4111
|
+
return true;
|
|
4112
|
+
}))
|
|
4113
|
+
.subscribe((event) => {
|
|
4114
|
+
const { scrollLeft, scrollTop } = event.target;
|
|
4115
|
+
updateViewportByScrolling(this.board, scrollLeft, scrollTop);
|
|
4082
4116
|
});
|
|
4083
|
-
this.
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
}
|
|
4090
|
-
});
|
|
4117
|
+
fromEvent(this.viewportContainer.nativeElement, 'touchmove', { passive: false })
|
|
4118
|
+
.pipe(takeUntil(this.destroy$))
|
|
4119
|
+
.subscribe((event) => {
|
|
4120
|
+
if (isPreventTouchMove(this.board)) {
|
|
4121
|
+
event.preventDefault();
|
|
4122
|
+
}
|
|
4091
4123
|
});
|
|
4092
4124
|
}
|
|
4093
4125
|
elementResizeListener() {
|
|
@@ -4111,6 +4143,34 @@ class PlaitBoardComponent {
|
|
|
4111
4143
|
island.markForCheck();
|
|
4112
4144
|
});
|
|
4113
4145
|
}
|
|
4146
|
+
wheelZoomListener() {
|
|
4147
|
+
fromEvent(this.host, 'wheel', { passive: false })
|
|
4148
|
+
.pipe(takeUntil(this.destroy$))
|
|
4149
|
+
.subscribe((event) => {
|
|
4150
|
+
// Credits to excalidraw
|
|
4151
|
+
// https://github.com/excalidraw/excalidraw/blob/b7d7ccc929696cc17b4cc34452e4afd846d59f4f/src/components/App.tsx#L9060
|
|
4152
|
+
if (event.metaKey || event.ctrlKey) {
|
|
4153
|
+
event.preventDefault();
|
|
4154
|
+
const { deltaX, deltaY } = event;
|
|
4155
|
+
const zoom = this.board.viewport.zoom;
|
|
4156
|
+
const sign = Math.sign(deltaY);
|
|
4157
|
+
const MAX_STEP = ZOOM_STEP * 100;
|
|
4158
|
+
const absDelta = Math.abs(deltaY);
|
|
4159
|
+
let delta = deltaY;
|
|
4160
|
+
if (absDelta > MAX_STEP) {
|
|
4161
|
+
delta = MAX_STEP * sign;
|
|
4162
|
+
}
|
|
4163
|
+
let newZoom = zoom - delta / 100;
|
|
4164
|
+
// increase zoom steps the more zoomed-in we are (applies to >100% only)
|
|
4165
|
+
newZoom +=
|
|
4166
|
+
Math.log10(Math.max(1, zoom)) *
|
|
4167
|
+
-sign *
|
|
4168
|
+
// reduced amplification for small deltas (small movements on a trackpad)
|
|
4169
|
+
Math.min(1, absDelta / 20);
|
|
4170
|
+
BoardTransforms.updateZoom(this.board, newZoom, false);
|
|
4171
|
+
}
|
|
4172
|
+
});
|
|
4173
|
+
}
|
|
4114
4174
|
ngOnDestroy() {
|
|
4115
4175
|
this.destroy$.next();
|
|
4116
4176
|
this.destroy$.complete();
|
|
@@ -4366,5 +4426,5 @@ function createModModifierKeys() {
|
|
|
4366
4426
|
* Generated bundle index. Do not edit.
|
|
4367
4427
|
*/
|
|
4368
4428
|
|
|
4369
|
-
export { A, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, 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, 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_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, 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, isFromScrolling, isFromViewportChange, isInPlaitBoard, isLineHitLine, isMainPointer, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedElement, isSelectionMoving, isSetViewportOperation, normalizePoint, preventTouchMove, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setClipboardData, setClipboardDataByMedia, setClipboardDataByText, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, temporaryDisableSelection, throttleRAF, toImage, toPoint, transformPoint, transformPoints, updateForeignObject, updateForeignObjectWidth, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withMoving, withOptions, withSelection };
|
|
4429
|
+
export { A, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, 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_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, isFromScrolling, isFromViewportChange, isInPlaitBoard, isLineHitLine, isMainPointer, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedElement, isSelectionMoving, isSetViewportOperation, normalizePoint, preventTouchMove, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setClipboardData, setClipboardDataByMedia, setClipboardDataByText, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, temporaryDisableSelection, throttleRAF, toImage, toPoint, transformPoint, transformPoints, updateForeignObject, updateForeignObjectWidth, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withMoving, withOptions, withSelection };
|
|
4370
4430
|
//# sourceMappingURL=plait-core.mjs.map
|