@plait/core 0.62.0-next.1 → 0.62.0-next.10

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.
@@ -1,6 +1,6 @@
1
1
  import { createDraft, finishDraft, isDraft } from 'immer';
2
2
  import { isKeyHotkey, isHotkey } from 'is-hotkey';
3
- import { timer, Subject } from 'rxjs';
3
+ import { Subject } from 'rxjs';
4
4
 
5
5
  /**
6
6
  * @license
@@ -1571,6 +1571,96 @@ const sortElements = (board, elements, ascendingOrder = true) => {
1571
1571
  });
1572
1572
  };
1573
1573
 
1574
+ const TEMPORARY_G = new Map();
1575
+ const getTemporaryGArray = (debugKey) => {
1576
+ return TEMPORARY_G.get(debugKey) || [];
1577
+ };
1578
+ const setTemporaryGArray = (debugKey, gArray) => {
1579
+ TEMPORARY_G.set(debugKey, gArray);
1580
+ };
1581
+ class DebugGenerator {
1582
+ constructor(debugKey) {
1583
+ this.debugKey = debugKey;
1584
+ }
1585
+ isDebug() {
1586
+ return isDebug(this.debugKey);
1587
+ }
1588
+ clear() {
1589
+ if (!this.isDebug()) {
1590
+ return;
1591
+ }
1592
+ const gArray = getTemporaryGArray(this.debugKey);
1593
+ setTemporaryGArray(this.debugKey, []);
1594
+ gArray.forEach(g => g.remove());
1595
+ }
1596
+ drawPolygon(board, points, options) {
1597
+ if (!isDebug(this.debugKey)) {
1598
+ return;
1599
+ }
1600
+ const polygonG = PlaitBoard.getRoughSVG(board).polygon(points, options || { stroke: 'red' });
1601
+ polygonG.classList.add(this.debugKey);
1602
+ PlaitBoard.getElementActiveHost(board).append(polygonG);
1603
+ const gArray = getTemporaryGArray(this.debugKey);
1604
+ gArray.push(polygonG);
1605
+ setTemporaryGArray(this.debugKey, gArray);
1606
+ return polygonG;
1607
+ }
1608
+ drawLine(board, points, options) {
1609
+ if (!isDebug(this.debugKey)) {
1610
+ return;
1611
+ }
1612
+ const lineG = PlaitBoard.getRoughSVG(board).linearPath(points, options || { stroke: 'red' });
1613
+ lineG.classList.add(this.debugKey);
1614
+ PlaitBoard.getElementActiveHost(board).append(lineG);
1615
+ const gArray = getTemporaryGArray(this.debugKey);
1616
+ gArray.push(lineG);
1617
+ setTemporaryGArray(this.debugKey, gArray);
1618
+ return lineG;
1619
+ }
1620
+ drawRectangle(board, data, options) {
1621
+ if (!isDebug(this.debugKey)) {
1622
+ return;
1623
+ }
1624
+ let rectangle;
1625
+ if (data instanceof Array) {
1626
+ rectangle = RectangleClient.getRectangleByPoints(data);
1627
+ }
1628
+ else {
1629
+ rectangle = data;
1630
+ }
1631
+ const rectangleG = PlaitBoard.getRoughSVG(board).rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height, options || { stroke: 'red' });
1632
+ rectangleG.classList.add(this.debugKey);
1633
+ PlaitBoard.getElementActiveHost(board).append(rectangleG);
1634
+ const gArray = getTemporaryGArray(this.debugKey);
1635
+ gArray.push(rectangleG);
1636
+ setTemporaryGArray(this.debugKey, gArray);
1637
+ return rectangleG;
1638
+ }
1639
+ drawCircles(board, points, diameter = 0, isCumulativeDiameter = false, options) {
1640
+ if (!isDebug(this.debugKey)) {
1641
+ return;
1642
+ }
1643
+ const result = [];
1644
+ points.forEach((p, i) => {
1645
+ const circle = PlaitBoard.getRoughSVG(board).circle(p[0], p[1], isCumulativeDiameter ? diameter * (i + 1) : diameter, Object.assign({}, { stroke: 'red', fill: 'red', fillStyle: 'solid' }, options || {}));
1646
+ circle.classList.add(this.debugKey);
1647
+ PlaitBoard.getElementActiveHost(board).append(circle);
1648
+ const gArray = getTemporaryGArray(this.debugKey);
1649
+ gArray.push(circle);
1650
+ result.push(circle);
1651
+ setTemporaryGArray(this.debugKey, gArray);
1652
+ });
1653
+ return result;
1654
+ }
1655
+ }
1656
+ const createDebugGenerator = (debugKey) => {
1657
+ return new DebugGenerator(debugKey);
1658
+ };
1659
+ const isDebug = (key) => {
1660
+ const defaultKey = 'debug:plait';
1661
+ return localStorage.getItem(key || defaultKey) === 'true';
1662
+ };
1663
+
1574
1664
  var PlaitPluginKey;
1575
1665
  (function (PlaitPluginKey) {
1576
1666
  PlaitPluginKey["withSelection"] = "withSelection";
@@ -1584,47 +1674,58 @@ const getHitElementsBySelection = (board, selection, match = () => true) => {
1584
1674
  }
1585
1675
  const isCollapsed = Selection.isCollapsed(newSelection);
1586
1676
  if (isCollapsed) {
1587
- const hitElement = getHitElementByPoint(board, newSelection.anchor, match);
1588
- if (hitElement) {
1589
- return [hitElement];
1677
+ const hitElements = getHitElementsByPoint(board, newSelection.anchor, match);
1678
+ if (hitElements?.length) {
1679
+ return hitElements;
1590
1680
  }
1591
1681
  else {
1592
1682
  return [];
1593
1683
  }
1594
1684
  }
1595
1685
  depthFirstRecursion(board, node => {
1596
- if (!PlaitBoard.isBoard(node) && match(node) && board.isRectangleHit(node, newSelection)) {
1597
- rectangleHitElements.push(node);
1686
+ if (!PlaitBoard.isBoard(node) && match(node)) {
1687
+ let isRectangleHit = false;
1688
+ try {
1689
+ isRectangleHit = board.isRectangleHit(node, newSelection);
1690
+ }
1691
+ catch (error) {
1692
+ if (isDebug()) {
1693
+ console.error('isRectangleHit', error, 'node', node);
1694
+ }
1695
+ }
1696
+ if (isRectangleHit) {
1697
+ rectangleHitElements.push(node);
1698
+ }
1598
1699
  }
1599
1700
  }, getIsRecursionFunc(board), true);
1600
1701
  return rectangleHitElements;
1601
1702
  };
1602
- const getHitElementByPoint = (board, point, match = () => true) => {
1603
- let hitElement = undefined;
1604
- let hitInsideElement = undefined;
1703
+ const getHitElementsByPoint = (board, point, match = () => true) => {
1704
+ let hitElements = [];
1605
1705
  depthFirstRecursion(board, node => {
1606
- if (hitElement) {
1607
- return;
1608
- }
1609
1706
  if (PlaitBoard.isBoard(node) || !match(node) || !PlaitElement.hasMounted(node)) {
1610
1707
  return;
1611
1708
  }
1612
- if (board.isHit(node, point)) {
1613
- hitElement = node;
1614
- return;
1709
+ let isHit = false;
1710
+ try {
1711
+ isHit = board.isHit(node, point);
1615
1712
  }
1616
- /**
1617
- * 需要增加场景测试
1618
- * hitInsideElement 存的是第一个符合 isInsidePoint 的元素
1619
- * 当有元素符合 isHit 时结束遍历,并返回 hitElement
1620
- * 当所有元素都不符合 isHit ,则返回第一个符合 isInsidePoint 的元素
1621
- * 这样保证最上面的元素优先被探测到;
1622
- */
1623
- if (!hitInsideElement && board.isInsidePoint(node, point)) {
1624
- hitInsideElement = node;
1713
+ catch (error) {
1714
+ if (isDebug()) {
1715
+ console.error('isHit', error, 'node', node);
1716
+ }
1717
+ }
1718
+ if (isHit) {
1719
+ hitElements.push(node);
1720
+ return;
1625
1721
  }
1626
1722
  }, getIsRecursionFunc(board), true);
1627
- return hitElement || hitInsideElement;
1723
+ return hitElements;
1724
+ };
1725
+ const getHitElementByPoint = (board, point, match = () => true) => {
1726
+ const pointHitElements = getHitElementsByPoint(board, point, match);
1727
+ const hitElement = board.getHitElement(pointHitElements);
1728
+ return hitElement;
1628
1729
  };
1629
1730
  const getHitSelectedElements = (board, point) => {
1630
1731
  const selectedElements = getSelectedElements(board);
@@ -1681,7 +1782,7 @@ const isSelectedElement = (board, element) => {
1681
1782
  const temporaryDisableSelection = (board) => {
1682
1783
  const currentOptions = board.getPluginOptions(PlaitPluginKey.withSelection);
1683
1784
  board.setPluginOptions(PlaitPluginKey.withSelection, {
1684
- isDisabledSelect: true
1785
+ isDisabledSelection: true
1685
1786
  });
1686
1787
  setTimeout(() => {
1687
1788
  board.setPluginOptions(PlaitPluginKey.withSelection, { ...currentOptions });
@@ -1718,7 +1819,9 @@ function drawRoundRectangle(rs, x1, y1, x2, y2, options, outline = false, border
1718
1819
  const point6 = [x1 + radius, y2];
1719
1820
  const point7 = [x1, y2 - radius];
1720
1821
  const point8 = [x1, y1 + radius];
1721
- return rs.path(`M${point2[0]} ${point2[1]} A ${radius} ${radius}, 0, 0, 1, ${point3[0]} ${point3[1]} L ${point4[0]} ${point4[1]} A ${radius} ${radius}, 0, 0, 1, ${point5[0]} ${point5[1]} L ${point6[0]} ${point6[1]} A ${radius} ${radius}, 0, 0, 1, ${point7[0]} ${point7[1]} L ${point8[0]} ${point8[1]} A ${radius} ${radius}, 0, 0, 1, ${point1[0]} ${point1[1]} Z`, options);
1822
+ const rectangleG = rs.path(`M${point2[0]} ${point2[1]} A ${radius} ${radius}, 0, 0, 1, ${point3[0]} ${point3[1]} L ${point4[0]} ${point4[1]} A ${radius} ${radius}, 0, 0, 1, ${point5[0]} ${point5[1]} L ${point6[0]} ${point6[1]} A ${radius} ${radius}, 0, 0, 1, ${point7[0]} ${point7[1]} L ${point8[0]} ${point8[1]} A ${radius} ${radius}, 0, 0, 1, ${point1[0]} ${point1[1]} Z`, options);
1823
+ setStrokeLinecap(rectangleG, 'round');
1824
+ return rectangleG;
1722
1825
  }
1723
1826
  const drawRectangle = (board, rectangle, options) => {
1724
1827
  const roughSVG = PlaitBoard.getRoughSVG(board);
@@ -1914,11 +2017,7 @@ function updateThemeColor(board, mode) {
1914
2017
  const updatePointerType = (board, pointer) => {
1915
2018
  if (board.pointer === pointer)
1916
2019
  return;
1917
- const previousPointer = board.pointer;
1918
2020
  board.pointer = pointer;
1919
- const boardContainer = PlaitBoard.getBoardContainer(board);
1920
- boardContainer.classList.remove(`pointer-${previousPointer}`);
1921
- boardContainer.classList.add(`pointer-${pointer}`);
1922
2021
  };
1923
2022
  const BoardTransforms = {
1924
2023
  updatePointerType,
@@ -2218,21 +2317,25 @@ const throttleRAF = (board, key, fn) => {
2218
2317
  scheduleFunc();
2219
2318
  };
2220
2319
  const debounce = (func, wait, options) => {
2221
- let timerSubscription = null;
2222
- return () => {
2223
- if (timerSubscription && !timerSubscription.closed) {
2224
- timerSubscription.unsubscribe();
2225
- timerSubscription = timer(wait).subscribe(() => {
2226
- func();
2227
- });
2320
+ let timeout = null;
2321
+ return (args) => {
2322
+ if (timeout !== null) {
2323
+ clearTimeout(timeout);
2324
+ timeout = setTimeout(() => {
2325
+ func(args);
2326
+ timeout = null;
2327
+ }, wait);
2228
2328
  }
2229
2329
  else {
2230
2330
  if (options?.leading) {
2231
- timer(0).subscribe(() => {
2232
- func();
2233
- });
2331
+ func(args);
2332
+ }
2333
+ else {
2334
+ timeout = setTimeout(() => {
2335
+ func(args);
2336
+ timeout = null;
2337
+ }, wait);
2234
2338
  }
2235
- timerSubscription = timer(wait).subscribe();
2236
2339
  }
2237
2340
  };
2238
2341
  };
@@ -2286,7 +2389,7 @@ const cacheMovingElements = (board, elements) => {
2286
2389
  setDragging(board, true);
2287
2390
  };
2288
2391
 
2289
- const IMAGE_CONTAINER = 'plait-image-container';
2392
+ const FOREIGN_OBJECT_EXPRESSION = `foreignObject[class^='foreign-object']`;
2290
2393
  /**
2291
2394
  * Is element node
2292
2395
  * @param node
@@ -2373,7 +2476,7 @@ function cloneCSSStyle(nativeNode, clonedNode) {
2373
2476
  */
2374
2477
  function batchCloneCSSStyle(sourceNode, cloneNode, inlineStyleClassNames) {
2375
2478
  if (inlineStyleClassNames) {
2376
- const classNames = inlineStyleClassNames + `,.${IMAGE_CONTAINER}`;
2479
+ const classNames = inlineStyleClassNames + `, ${FOREIGN_OBJECT_EXPRESSION}`;
2377
2480
  const sourceNodes = Array.from(sourceNode.querySelectorAll(classNames));
2378
2481
  const cloneNodes = Array.from(cloneNode.querySelectorAll(classNames));
2379
2482
  sourceNodes.forEach((node, index) => {
@@ -2394,8 +2497,8 @@ function batchCloneCSSStyle(sourceNode, cloneNode, inlineStyleClassNames) {
2394
2497
  * @param cloneNode
2395
2498
  */
2396
2499
  async function batchConvertImage(sourceNode, cloneNode) {
2397
- const sourceImageNodes = Array.from(sourceNode.querySelectorAll(`.${IMAGE_CONTAINER}`));
2398
- const cloneImageNodes = Array.from(cloneNode.querySelectorAll(`.${IMAGE_CONTAINER}`));
2500
+ const sourceImageNodes = Array.from(sourceNode.querySelectorAll(`${FOREIGN_OBJECT_EXPRESSION}`));
2501
+ const cloneImageNodes = Array.from(cloneNode.querySelectorAll(`${FOREIGN_OBJECT_EXPRESSION}`));
2399
2502
  await Promise.all(sourceImageNodes.map((_, index) => {
2400
2503
  return new Promise(resolve => {
2401
2504
  const cloneImageNode = cloneImageNodes[index];
@@ -2497,15 +2600,16 @@ var WritableClipboardOperationType;
2497
2600
  })(WritableClipboardOperationType || (WritableClipboardOperationType = {}));
2498
2601
 
2499
2602
  const buildPlaitHtml = (type, data) => {
2500
- const stringifiedClipboard = JSON.stringify({
2603
+ const stringifiedClipboard = replaceAngleBrackets(JSON.stringify({
2501
2604
  type,
2502
2605
  data
2503
- });
2606
+ }));
2504
2607
  return `<plait>${stringifiedClipboard}</plait>`;
2505
2608
  };
2506
2609
  const getClipboardFromHtml = (html) => {
2507
- const plaitString = html?.match(/<plait[^>]*>(.*)<\/plait>/)?.[1];
2610
+ let plaitString = html?.match(/<plait[^>]*>(.*)<\/plait>/)?.[1];
2508
2611
  if (plaitString) {
2612
+ plaitString = reverseReplaceAngleBrackets(plaitString);
2509
2613
  try {
2510
2614
  const plaitJson = JSON.parse(plaitString);
2511
2615
  if (plaitJson) {
@@ -2561,6 +2665,12 @@ const addClipboardContext = (clipboardContext, addition) => {
2561
2665
  }
2562
2666
  return clipboardContext;
2563
2667
  };
2668
+ const replaceAngleBrackets = (str) => {
2669
+ return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');
2670
+ };
2671
+ const reverseReplaceAngleBrackets = (str) => {
2672
+ return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
2673
+ };
2564
2674
 
2565
2675
  const setDataTransferClipboard = (dataTransfer, type, data) => {
2566
2676
  dataTransfer?.setData(`text/html`, buildPlaitHtml(type, data));
@@ -2760,11 +2870,11 @@ function clearSelectionMoving(board) {
2760
2870
  setDragging(board, false);
2761
2871
  }
2762
2872
  function isHandleSelection(board) {
2763
- const options = board.getPluginOptions(PlaitPluginKey.withSelection);
2764
- return board.pointer !== PlaitPointerType.hand && !options.isDisabledSelect && !PlaitBoard.isReadonly(board);
2873
+ const options = getSelectionOptions(board);
2874
+ return board.pointer !== PlaitPointerType.hand && !options.isDisabledSelection && !PlaitBoard.isReadonly(board);
2765
2875
  }
2766
- function isSetSelectionOperation(board) {
2767
- return !!board.operations.find(value => value.type === 'set_selection');
2876
+ function hasSetSelectionOperation(board) {
2877
+ return !!board.operations.find(op => PlaitOperation.isSetSelectionOperation(op));
2768
2878
  }
2769
2879
  function getTemporaryElements(board) {
2770
2880
  const ref = BOARD_TO_TEMPORARY_ELEMENTS.get(board);
@@ -2876,6 +2986,13 @@ function cacheSelectedElementsWithGroup(board, elements, isSelectGroupElement, h
2876
2986
  }
2877
2987
  cacheSelectedElements(board, uniqueById(newElements));
2878
2988
  }
2989
+ const getSelectionOptions = (board) => {
2990
+ const options = board.getPluginOptions(PlaitPluginKey.withSelection);
2991
+ return options;
2992
+ };
2993
+ const setSelectionOptions = (board, options) => {
2994
+ board.setPluginOptions(PlaitPluginKey.withSelection, options);
2995
+ };
2879
2996
 
2880
2997
  const getElementsInGroup = (board, group, recursion, includeGroup) => {
2881
2998
  let result = [];
@@ -4007,6 +4124,12 @@ var PlaitPointerType;
4007
4124
  const isSetViewportOperation = (value) => {
4008
4125
  return value.type === 'set_viewport';
4009
4126
  };
4127
+ const isSetSelectionOperation = (value) => {
4128
+ return value.type === 'set_selection';
4129
+ };
4130
+ const isSetThemeOperation = (value) => {
4131
+ return value.type === 'set_theme';
4132
+ };
4010
4133
  const inverse = (op) => {
4011
4134
  switch (op.type) {
4012
4135
  case 'insert_node': {
@@ -4088,6 +4211,8 @@ const inverse = (op) => {
4088
4211
  };
4089
4212
  const PlaitOperation = {
4090
4213
  isSetViewportOperation,
4214
+ isSetSelectionOperation,
4215
+ isSetThemeOperation,
4091
4216
  inverse
4092
4217
  };
4093
4218
 
@@ -4888,7 +5013,14 @@ const trackBy = (index, element) => {
4888
5013
  const createPluginComponent = (board, componentType, context, childrenContext) => {
4889
5014
  const instance = new componentType();
4890
5015
  instance.context = context;
4891
- instance.initialize();
5016
+ try {
5017
+ instance.initialize();
5018
+ }
5019
+ catch (error) {
5020
+ if (isDebug()) {
5021
+ console.error('list-render-initialize', error, 'context', context);
5022
+ }
5023
+ }
4892
5024
  const g = instance.getContainerG();
4893
5025
  mountElementG(context.index, g, childrenContext);
4894
5026
  instance.initializeListRender();
@@ -5240,6 +5372,7 @@ function createBoard(children, options) {
5240
5372
  isRectangleHit: element => false,
5241
5373
  isHit: element => false,
5242
5374
  isInsidePoint: element => false,
5375
+ getHitElement: (data) => data[0],
5243
5376
  isRecursion: element => true,
5244
5377
  isMovable: element => false,
5245
5378
  getRectangle: element => null,
@@ -5422,7 +5555,7 @@ const withHotkey = (board) => {
5422
5555
  const { keyDown, keyUp, globalKeyDown } = board;
5423
5556
  board.keyDown = (event) => {
5424
5557
  const options = board.getPluginOptions(PlaitPluginKey.withSelection);
5425
- if (!PlaitBoard.isReadonly(board) && options.isMultiple && isHotkey('mod+a', event)) {
5558
+ if (!PlaitBoard.isReadonly(board) && options.isMultipleSelection && isHotkey('mod+a', event)) {
5426
5559
  event.preventDefault();
5427
5560
  let elements = [];
5428
5561
  depthFirstRecursion(board, node => {
@@ -6034,11 +6167,10 @@ function withSelection(board) {
6034
6167
  if (isShift && !event.shiftKey) {
6035
6168
  isShift = false;
6036
6169
  }
6037
- const isHitText = !!(event.target instanceof Element && event.target.closest('.plait-text-container'));
6038
6170
  const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
6039
6171
  const isHitTarget = isHitElement(board, point);
6040
- const options = board.getPluginOptions(PlaitPluginKey.withSelection);
6041
- if (PlaitBoard.isPointer(board, PlaitPointerType.selection) && !isHitTarget && options.isMultiple && !options.isDisabledSelect) {
6172
+ const options = getSelectionOptions(board);
6173
+ if (PlaitBoard.isPointer(board, PlaitPointerType.selection) && !isHitTarget && options.isMultipleSelection && !options.isDisabledSelection) {
6042
6174
  preventTouchMove(board, event, true);
6043
6175
  // start rectangle selection
6044
6176
  start = toViewBoxPoint(board, toHostPoint(board, event.x, event.y));
@@ -6088,7 +6220,8 @@ function withSelection(board) {
6088
6220
  clearSelectionMoving(board);
6089
6221
  Transforms.setSelection(board, { anchor: start, focus: end });
6090
6222
  }
6091
- if (PlaitBoard.isFocus(board)) {
6223
+ const options = getSelectionOptions(board);
6224
+ if (PlaitBoard.isFocus(board) && !options.isPreventClearSelection) {
6092
6225
  const isInBoard = event.target instanceof Node && PlaitBoard.getBoardContainer(board).contains(event.target);
6093
6226
  const isInDocument = event.target instanceof Node && document.contains(event.target);
6094
6227
  const isAttachedElement = event.target instanceof Element && event.target.closest(`.${ATTACHED_ELEMENT_CLASS_NAME}`);
@@ -6104,8 +6237,8 @@ function withSelection(board) {
6104
6237
  globalPointerUp(event);
6105
6238
  };
6106
6239
  board.onChange = () => {
6107
- const options = board.getPluginOptions(PlaitPluginKey.withSelection);
6108
- if (options.isDisabledSelect) {
6240
+ const options = getSelectionOptions(board);
6241
+ if (options.isDisabledSelection) {
6109
6242
  clearSelectedElement(board);
6110
6243
  }
6111
6244
  // remove selected element if include
@@ -6114,7 +6247,7 @@ function withSelection(board) {
6114
6247
  removeSelectedElement(board, op.node, true);
6115
6248
  }
6116
6249
  });
6117
- if (isHandleSelection(board) && isSetSelectionOperation(board)) {
6250
+ if (isHandleSelection(board) && hasSetSelectionOperation(board)) {
6118
6251
  try {
6119
6252
  if (!isShift) {
6120
6253
  selectionRectangleG?.remove();
@@ -6125,7 +6258,7 @@ function withSelection(board) {
6125
6258
  }
6126
6259
  else {
6127
6260
  let elements = getHitElementsBySelection(board);
6128
- if (!options.isMultiple && elements.length > 1) {
6261
+ if (!options.isMultipleSelection && elements.length > 1) {
6129
6262
  elements = [elements[0]];
6130
6263
  }
6131
6264
  const isHitElementWithGroup = elements.some(item => item.groupId);
@@ -6134,6 +6267,12 @@ function withSelection(board) {
6134
6267
  setSelectedElementsWithGroup(board, elements, isShift);
6135
6268
  }
6136
6269
  else {
6270
+ if (board.selection && Selection.isCollapsed(board.selection)) {
6271
+ const element = board.getHitElement(elements);
6272
+ if (element) {
6273
+ elements = [element];
6274
+ }
6275
+ }
6137
6276
  if (isShift) {
6138
6277
  const newElements = [...selectedElements];
6139
6278
  if (board.selection && Selection.isCollapsed(board.selection)) {
@@ -6179,7 +6318,7 @@ function withSelection(board) {
6179
6318
  onChange();
6180
6319
  };
6181
6320
  board.afterChange = () => {
6182
- if (isHandleSelection(board) && !isSetSelectionOperation(board)) {
6321
+ if (isHandleSelection(board) && !hasSetSelectionOperation(board)) {
6183
6322
  try {
6184
6323
  const currentSelectedElements = getSelectedElements(board);
6185
6324
  if (currentSelectedElements.length && currentSelectedElements.length > 1) {
@@ -6202,9 +6341,10 @@ function withSelection(board) {
6202
6341
  }
6203
6342
  afterChange();
6204
6343
  };
6205
- board.setPluginOptions(PlaitPluginKey.withSelection, {
6206
- isMultiple: true,
6207
- isDisabledSelect: false
6344
+ setSelectionOptions(board, {
6345
+ isMultipleSelection: true,
6346
+ isDisabledSelection: false,
6347
+ isPreventClearSelection: false
6208
6348
  });
6209
6349
  return board;
6210
6350
  }
@@ -6396,96 +6536,6 @@ function createModModifierKeys() {
6396
6536
  return modifiers;
6397
6537
  }
6398
6538
 
6399
- const TEMPORARY_G = new Map();
6400
- const getTemporaryGArray = (debugKey) => {
6401
- return TEMPORARY_G.get(debugKey) || [];
6402
- };
6403
- const setTemporaryGArray = (debugKey, gArray) => {
6404
- TEMPORARY_G.set(debugKey, gArray);
6405
- };
6406
- class DebugGenerator {
6407
- constructor(debugKey) {
6408
- this.debugKey = debugKey;
6409
- }
6410
- isDebug() {
6411
- return isDebug(this.debugKey);
6412
- }
6413
- clear() {
6414
- if (!this.isDebug()) {
6415
- return;
6416
- }
6417
- const gArray = getTemporaryGArray(this.debugKey);
6418
- setTemporaryGArray(this.debugKey, []);
6419
- gArray.forEach(g => g.remove());
6420
- }
6421
- drawPolygon(board, points, options) {
6422
- if (!isDebug(this.debugKey)) {
6423
- return;
6424
- }
6425
- const polygonG = PlaitBoard.getRoughSVG(board).polygon(points, options || { stroke: 'red' });
6426
- polygonG.classList.add(this.debugKey);
6427
- PlaitBoard.getElementActiveHost(board).append(polygonG);
6428
- const gArray = getTemporaryGArray(this.debugKey);
6429
- gArray.push(polygonG);
6430
- setTemporaryGArray(this.debugKey, gArray);
6431
- return polygonG;
6432
- }
6433
- drawLine(board, points, options) {
6434
- if (!isDebug(this.debugKey)) {
6435
- return;
6436
- }
6437
- const lineG = PlaitBoard.getRoughSVG(board).linearPath(points, options || { stroke: 'red' });
6438
- lineG.classList.add(this.debugKey);
6439
- PlaitBoard.getElementActiveHost(board).append(lineG);
6440
- const gArray = getTemporaryGArray(this.debugKey);
6441
- gArray.push(lineG);
6442
- setTemporaryGArray(this.debugKey, gArray);
6443
- return lineG;
6444
- }
6445
- drawRectangle(board, data, options) {
6446
- if (!isDebug(this.debugKey)) {
6447
- return;
6448
- }
6449
- let rectangle;
6450
- if (data instanceof Array) {
6451
- rectangle = RectangleClient.getRectangleByPoints(data);
6452
- }
6453
- else {
6454
- rectangle = data;
6455
- }
6456
- const rectangleG = PlaitBoard.getRoughSVG(board).rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height, options || { stroke: 'red' });
6457
- rectangleG.classList.add(this.debugKey);
6458
- PlaitBoard.getElementActiveHost(board).append(rectangleG);
6459
- const gArray = getTemporaryGArray(this.debugKey);
6460
- gArray.push(rectangleG);
6461
- setTemporaryGArray(this.debugKey, gArray);
6462
- return rectangleG;
6463
- }
6464
- drawCircles(board, points, diameter = 0, isCumulativeDiameter = false, options) {
6465
- if (!isDebug(this.debugKey)) {
6466
- return;
6467
- }
6468
- const result = [];
6469
- points.forEach((p, i) => {
6470
- const circle = PlaitBoard.getRoughSVG(board).circle(p[0], p[1], isCumulativeDiameter ? diameter * (i + 1) : diameter, Object.assign({}, { stroke: 'red', fill: 'red', fillStyle: 'solid' }, options || {}));
6471
- circle.classList.add(this.debugKey);
6472
- PlaitBoard.getElementActiveHost(board).append(circle);
6473
- const gArray = getTemporaryGArray(this.debugKey);
6474
- gArray.push(circle);
6475
- result.push(circle);
6476
- setTemporaryGArray(this.debugKey, gArray);
6477
- });
6478
- return result;
6479
- }
6480
- }
6481
- const createDebugGenerator = (debugKey) => {
6482
- return new DebugGenerator(debugKey);
6483
- };
6484
- const isDebug = (key) => {
6485
- const defaultKey = 'debug:plait';
6486
- return localStorage.getItem(key || defaultKey) === 'true';
6487
- };
6488
-
6489
6539
  /*
6490
6540
  * Public API Surface of plait
6491
6541
  */
@@ -6494,5 +6544,5 @@ const isDebug = (key) => {
6494
6544
  * Generated bundle index. Do not edit.
6495
6545
  */
6496
6546
 
6497
- 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_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_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, 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_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, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, 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, drawEntireActiveRectangleG, drawLine, drawLinearPath, drawPendingNodesG, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getAngleByElement, getBarPoint, getBoardRectangle, getBoundingRectangleByElements, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, getElementsInGroup, getElementsInGroupByElement, getElementsIndices, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestIndexOfElement, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMinPointDelta, getMovingElements, getNearestDelta, getNearestPointBetweenPointAndEllipse, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getNearestPointRectangle, getOffsetAfterRotate, getOneMoveOptions, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByAngle, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectedIsolatedElementsCanAddToGroup, getSelectedTargetElements, getSelectionAngle, getSnapRectangles, getTemporaryElements, getTemporaryRef, getTripleAxis, getValidElements, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, 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, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, isSnapPoint, mountElementG, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, preventTouchMove, radiansToDegrees, removeMovingElements, removeSelectedElement, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, rotatePointsByElement, rotatedDataPoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setFragment, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectedElementsWithGroup, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, sortElements, stripHtml, temporaryDisableSelection, throttleRAF, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, uniqueById, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withBoard, withHandPointer, withHistory, withHotkey, withMoving, withOptions, withRelatedFragment, withSelection, withViewport };
6547
+ 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_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DebugGenerator, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_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, 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_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, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, cacheSelectedElementsWithGroup, cacheSelectedElementsWithGroupOnShift, calcNewViewBox, canAddGroup, canRemoveGroup, canSetZIndex, catmullRomFitting, 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, drawEntireActiveRectangleG, drawLine, drawLinearPath, drawPendingNodesG, drawPointSnapLines, drawRectangle, drawRoundRectangle, drawSolidLines, duplicateElements, fakeNodeWeakMap, filterSelectedGroups, findElements, findIndex, findLastIndex, getAllElementsInGroup, getAllMoveOptions, getAngleBetweenPoints, getAngleByElement, getBarPoint, getBoardRectangle, getBoundingRectangleByElements, getClipboardData, getClipboardFromHtml, getCrossingPointsBetweenEllipseAndSegment, getDataTransferClipboard, getDataTransferClipboardText, getEditingGroup, getElementById, getElementHostBBox, 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, handleTouchTarget, 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, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetThemeOperation, isSetViewportOperation, isSnapPoint, mountElementG, moveElementsToNewPath, moveElementsToNewPathAfterAddGroup, nonGroupInHighestSelectedElements, normalizeAngle, normalizePoint, preventTouchMove, radiansToDegrees, removeMovingElements, removeSelectedElement, replaceAngleBrackets, reverseReplaceAngleBrackets, rotate, rotateAntiPointsByElement, rotateElements, rotatePoints, 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 };
6498
6548
  //# sourceMappingURL=plait-core.mjs.map