@plait/core 0.2.4 → 0.3.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.
Files changed (40) hide show
  1. package/board/board.component.d.ts +4 -3
  2. package/board/board.component.interface.d.ts +2 -1
  3. package/esm2020/board/board.component.interface.mjs +1 -1
  4. package/esm2020/board/board.component.mjs +10 -9
  5. package/esm2020/core/children/children.component.mjs +3 -3
  6. package/esm2020/core/element/element.component.mjs +3 -3
  7. package/esm2020/core/element/plugin-element.mjs +5 -5
  8. package/esm2020/core/toolbar/toolbar.component.mjs +3 -3
  9. package/esm2020/interfaces/board.mjs +11 -2
  10. package/esm2020/interfaces/node.mjs +1 -1
  11. package/esm2020/interfaces/path-ref.mjs +15 -0
  12. package/esm2020/plait.module.mjs +4 -4
  13. package/esm2020/plugins/create-board.mjs +32 -3
  14. package/esm2020/plugins/with-hand.mjs +5 -11
  15. package/esm2020/plugins/with-selection.mjs +17 -15
  16. package/esm2020/public-api.mjs +2 -1
  17. package/esm2020/testing/core/create-board.mjs +13 -0
  18. package/esm2020/testing/core/fake-weak-map.mjs +18 -0
  19. package/esm2020/testing/core/index.mjs +3 -0
  20. package/esm2020/testing/index.mjs +2 -0
  21. package/esm2020/transforms/board.mjs +1 -1
  22. package/esm2020/utils/selected-element.mjs +5 -3
  23. package/esm2020/utils/weak-maps.mjs +2 -1
  24. package/fesm2015/plait-core.mjs +134 -55
  25. package/fesm2015/plait-core.mjs.map +1 -1
  26. package/fesm2020/plait-core.mjs +133 -53
  27. package/fesm2020/plait-core.mjs.map +1 -1
  28. package/interfaces/board.d.ts +8 -2
  29. package/interfaces/node.d.ts +1 -1
  30. package/interfaces/path-ref.d.ts +13 -0
  31. package/package.json +3 -3
  32. package/plugins/create-board.d.ts +1 -1
  33. package/public-api.d.ts +1 -0
  34. package/testing/core/create-board.d.ts +6 -0
  35. package/testing/core/fake-weak-map.d.ts +4 -0
  36. package/testing/core/index.d.ts +2 -0
  37. package/testing/index.d.ts +1 -0
  38. package/transforms/board.d.ts +2 -2
  39. package/utils/selected-element.d.ts +2 -2
  40. package/utils/weak-maps.d.ts +2 -0
@@ -26,6 +26,7 @@ const BOARD_TO_IS_SELECTION_MOVING = new WeakMap();
26
26
  // save no standard selected elements
27
27
  const BOARD_TO_TEMPORARY_ELEMENTS = new WeakMap();
28
28
  const BOARD_TO_MOVING_ELEMENT = new WeakMap();
29
+ const PATH_REFS = new WeakMap();
29
30
 
30
31
  function depthFirstRecursion(node, callback, recursion) {
31
32
  if (!recursion || recursion(node)) {
@@ -132,6 +133,15 @@ const PlaitBoard = {
132
133
  },
133
134
  hasBeenTextEditing(board) {
134
135
  return !!IS_TEXT_EDITABLE.get(board);
136
+ },
137
+ getPointer(board) {
138
+ return board.pointer;
139
+ },
140
+ isPointer(board, pointer) {
141
+ return board.pointer === pointer;
142
+ },
143
+ getMovingPoint(board) {
144
+ return BOARD_TO_MOVING_POINT.get(board);
135
145
  }
136
146
  };
137
147
 
@@ -722,11 +732,13 @@ const IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /Chrome?\/(?:[0-7][
722
732
  * Extendable Custom Types Interface
723
733
  */
724
734
 
725
- const getHitElements = (board) => {
735
+ const getHitElements = (board, selection) => {
736
+ const realSelection = selection || board.selection;
726
737
  const selectedElements = [];
727
738
  depthFirstRecursion(board, node => {
728
739
  if (!PlaitBoard.isBoard(node) &&
729
- board.selection?.ranges.some(range => {
740
+ realSelection &&
741
+ realSelection.ranges.some(range => {
730
742
  return board.isHitSelection(node, range);
731
743
  })) {
732
744
  selectedElements.push(node);
@@ -807,7 +819,7 @@ class PlaitPluginElementComponent {
807
819
  }
808
820
  }
809
821
  else {
810
- if (PlaitElement.isRootElement(this.element) && this.element.children && this.element.children.length > 0) {
822
+ if (PlaitElement.isRootElement(this.element) && this.element.children) {
811
823
  this.g = createG();
812
824
  this.rootG = createG();
813
825
  this.rootG.append(this.g);
@@ -850,9 +862,9 @@ class PlaitPluginElementComponent {
850
862
  (this.rootG || this.g).remove();
851
863
  }
852
864
  }
853
- PlaitPluginElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitPluginElementComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
854
- PlaitPluginElementComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: PlaitPluginElementComponent, inputs: { context: "context" }, ngImport: i0 });
855
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitPluginElementComponent, decorators: [{
865
+ PlaitPluginElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitPluginElementComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
866
+ PlaitPluginElementComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: PlaitPluginElementComponent, inputs: { context: "context" }, ngImport: i0 });
867
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitPluginElementComponent, decorators: [{
856
868
  type: Directive
857
869
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { context: [{
858
870
  type: Input
@@ -1554,6 +1566,20 @@ const Transforms = {
1554
1566
  ...NodeTransforms
1555
1567
  };
1556
1568
 
1569
+ const PathRef = {
1570
+ transform(ref, op) {
1571
+ const { current } = ref;
1572
+ if (current == null) {
1573
+ return;
1574
+ }
1575
+ const path = Path.transform(current, op);
1576
+ ref.current = path;
1577
+ if (path == null) {
1578
+ ref.unref();
1579
+ }
1580
+ }
1581
+ };
1582
+
1557
1583
  function createBoard(children, options) {
1558
1584
  const board = {
1559
1585
  viewport: {
@@ -1567,14 +1593,17 @@ function createBoard(children, options) {
1567
1593
  undos: []
1568
1594
  },
1569
1595
  selection: null,
1570
- pointer: PlaitPointerType.selection,
1571
1596
  options: options || {
1572
1597
  readonly: false,
1573
1598
  hideScrollbar: false
1574
1599
  },
1600
+ pointer: options?.readonly ? PlaitPointerType.hand : PlaitPointerType.selection,
1575
1601
  undo: () => { },
1576
1602
  redo: () => { },
1577
1603
  apply: (operation) => {
1604
+ for (const ref of board.pathRefs()) {
1605
+ PathRef.transform(ref, operation);
1606
+ }
1578
1607
  board.operations.push(operation);
1579
1608
  Transforms.transform(board, operation);
1580
1609
  if (!FLUSHING.get(board)) {
@@ -1586,6 +1615,31 @@ function createBoard(children, options) {
1586
1615
  });
1587
1616
  }
1588
1617
  },
1618
+ pathRef: (path, options) => {
1619
+ const affinity = options?.affinity || 'forward';
1620
+ const ref = {
1621
+ current: path,
1622
+ affinity,
1623
+ unref() {
1624
+ const { current } = ref;
1625
+ const pathRefs = board.pathRefs();
1626
+ pathRefs.delete(ref);
1627
+ ref.current = null;
1628
+ return current;
1629
+ }
1630
+ };
1631
+ const refs = board.pathRefs();
1632
+ refs.add(ref);
1633
+ return ref;
1634
+ },
1635
+ pathRefs: () => {
1636
+ let refs = PATH_REFS.get(board);
1637
+ if (!refs) {
1638
+ refs = new Set();
1639
+ PATH_REFS.set(board, refs);
1640
+ }
1641
+ return refs;
1642
+ },
1589
1643
  onChange: () => { },
1590
1644
  mousedown: (event) => { },
1591
1645
  mousemove: (event) => { },
@@ -1714,13 +1768,7 @@ function withHandPointer(board) {
1714
1768
  y: 0
1715
1769
  };
1716
1770
  board.mousedown = (event) => {
1717
- if (board.options.readonly) {
1718
- updatePointerType(board, PlaitPointerType.hand);
1719
- }
1720
- else if (!board.selection) {
1721
- updatePointerType(board, PlaitPointerType.selection);
1722
- }
1723
- if (board.pointer === PlaitPointerType.hand && board.selection) {
1771
+ if (board.pointer === PlaitPointerType.hand) {
1724
1772
  isMoving = true;
1725
1773
  PlaitBoard.getBoardNativeElement(board).classList.add('viewport-moving');
1726
1774
  plaitBoardMove.x = event.x;
@@ -1749,8 +1797,8 @@ function withHandPointer(board) {
1749
1797
  globalMouseup(event);
1750
1798
  };
1751
1799
  board.keydown = (event) => {
1752
- if (board.selection && event.code === 'Space') {
1753
- if (board.pointer !== PlaitPointerType.hand) {
1800
+ if (event.code === 'Space') {
1801
+ if (!PlaitBoard.isPointer(board, PlaitPointerType.hand)) {
1754
1802
  updatePointerType(board, PlaitPointerType.hand);
1755
1803
  }
1756
1804
  event.preventDefault();
@@ -1758,7 +1806,7 @@ function withHandPointer(board) {
1758
1806
  keydown(event);
1759
1807
  };
1760
1808
  board.keyup = (event) => {
1761
- if (board.selection && !board.options.readonly && event.code === 'Space') {
1809
+ if (!board.options.readonly && event.code === 'Space') {
1762
1810
  updatePointerType(board, PlaitPointerType.selection);
1763
1811
  }
1764
1812
  keyup(event);
@@ -1776,22 +1824,24 @@ function withSelection(board) {
1776
1824
  let selectionOuterG;
1777
1825
  let previousSelectedElements;
1778
1826
  board.mousedown = (event) => {
1779
- if (event.button === 0) {
1780
- start = transformPoint(board, toPoint(event.x, event.y, PlaitBoard.getHost(board)));
1827
+ if (event.button === 2) {
1828
+ mousedown(event);
1829
+ return;
1781
1830
  }
1782
- if (start) {
1783
- const ranges = [{ anchor: start, focus: start }];
1784
- const selectedElements = getSelectedElements(board);
1785
- if (isIntersectionElements(board, selectedElements, ranges)) {
1786
- start = null;
1787
- mousedown(event);
1788
- return;
1789
- }
1790
- Transforms.setSelection(board, { ranges: ranges });
1791
- if (board.pointer === PlaitPointerType.hand || getHitElements(board).length) {
1792
- start = null;
1793
- }
1831
+ const point = transformPoint(board, toPoint(event.x, event.y, PlaitBoard.getHost(board)));
1832
+ const ranges = [{ anchor: point, focus: point }];
1833
+ const selectedElements = getSelectedElements(board);
1834
+ if (isIntersectionElements(board, selectedElements, ranges)) {
1835
+ mousedown(event);
1836
+ return;
1837
+ }
1838
+ const range = { anchor: point, focus: point };
1839
+ if (PlaitBoard.isPointer(board, PlaitPointerType.selection) &&
1840
+ PlaitBoard.isFocus(board) &&
1841
+ getHitElements(board, { ranges: [range] }).length === 0) {
1842
+ start = point;
1794
1843
  }
1844
+ Transforms.setSelection(board, { ranges: ranges });
1795
1845
  mousedown(event);
1796
1846
  };
1797
1847
  board.globalMousemove = (event) => {
@@ -2097,9 +2147,9 @@ class PlaitElementComponent {
2097
2147
  this.board.destroyElement(this.getContext());
2098
2148
  }
2099
2149
  }
2100
- PlaitElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitElementComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
2101
- PlaitElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: PlaitElementComponent, selector: "plait-element", inputs: { index: "index", element: "element", parent: "parent", board: "board", effect: "effect", parentG: "parentG" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitElementComponent, decorators: [{
2150
+ PlaitElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitElementComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
2151
+ PlaitElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: PlaitElementComponent, selector: "plait-element", inputs: { index: "index", element: "element", parent: "parent", board: "board", effect: "effect", parentG: "parentG" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitElementComponent, decorators: [{
2103
2153
  type: Component,
2104
2154
  args: [{
2105
2155
  selector: 'plait-element',
@@ -2135,8 +2185,8 @@ class PlaitChildrenElement {
2135
2185
  }
2136
2186
  }
2137
2187
  }
2138
- PlaitChildrenElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitChildrenElement, deps: [], target: i0.ɵɵFactoryTarget.Component });
2139
- PlaitChildrenElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: PlaitChildrenElement, selector: "plait-children", inputs: { board: "board", parent: "parent", effect: "effect", parentG: "parentG" }, ngImport: i0, template: `
2188
+ PlaitChildrenElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitChildrenElement, deps: [], target: i0.ɵɵFactoryTarget.Component });
2189
+ PlaitChildrenElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: PlaitChildrenElement, selector: "plait-children", inputs: { board: "board", parent: "parent", effect: "effect", parentG: "parentG" }, ngImport: i0, template: `
2140
2190
  <plait-element
2141
2191
  *ngFor="let item of parent.children; let index = index; trackBy: trackBy"
2142
2192
  [index]="index"
@@ -2147,7 +2197,7 @@ PlaitChildrenElement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
2147
2197
  [parentG]="parentG"
2148
2198
  ></plait-element>
2149
2199
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PlaitElementComponent, selector: "plait-element", inputs: ["index", "element", "parent", "board", "effect", "parentG"] }] });
2150
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitChildrenElement, decorators: [{
2200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitChildrenElement, decorators: [{
2151
2201
  type: Component,
2152
2202
  args: [{
2153
2203
  selector: 'plait-children',
@@ -2208,9 +2258,9 @@ class PlaitToolbarComponent {
2208
2258
  this.resetZoomHandel.emit();
2209
2259
  }
2210
2260
  }
2211
- PlaitToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2212
- PlaitToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: PlaitToolbarComponent, selector: "plait-toolbar", inputs: { board: "board" }, outputs: { adaptHandle: "adaptHandle", zoomInHandle: "zoomInHandle", zoomOutHandle: "zoomOutHandle", resetZoomHandel: "resetZoomHandel" }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<div class=\"zoom-toolbar island plait-board-attached\">\n <a class=\"toolbar-item plait-action-icon\" [ngClass]=\"{ 'icon-active': isHand }\" (click)=\"activeHand()\">\n <ng-template [ngTemplateOutlet]=\"dragMoveTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"adapt()\">\n <ng-template [ngTemplateOutlet]=\"adaptTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomOut()\">\n <ng-template [ngTemplateOutlet]=\"zoomOutTemplate\"></ng-template>\n </a>\n <div class=\"toolbar-item zoom-value\" (mousedown)=\"resetZoom()\">{{ zoom }}%</div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomIn()\">\n <ng-template [ngTemplateOutlet]=\"zoomInTemplate\"></ng-template>\n </a>\n</div>\n\n<ng-template #dragMoveTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M8.44583468,0.500225887 C9.07406934,0.510185679 9.54739531,0.839591366 9.86192311,1.34305279 C9.89696656,1.39914649 9.92878401,1.45492964 9.9576026,1.50991157 L9.9576026,1.50991157 L10.0210033,1.64201027 L10.061978,1.62350755 C10.1972891,1.56834247 10.3444107,1.53218464 10.5027907,1.51755353 L10.5027907,1.51755353 L10.6649031,1.51019133 C11.4883708,1.51019133 12.0208782,1.99343346 12.3023042,2.66393278 C12.3903714,2.87392911 12.4344191,3.10047818 12.4339446,3.3257952 L12.4339446,3.3257952 L12.4360033,3.80501027 L12.5160535,3.78341501 C12.6124478,3.76124046 12.7138812,3.74739854 12.820201,3.74250274 L12.820201,3.74250274 L12.9833264,3.74194533 C13.6121166,3.7657478 14.0645887,4.0801724 14.3087062,4.56112689 C14.4521117,4.8436609 14.4987984,5.11349437 14.4999262,5.33449618 L14.4999262,5.33449618 L14.3922653,12.049414 C14.3784752,12.909177 14.0717787,13.7360948 13.5212406,14.3825228 C13.4055676,14.5183496 13.2843697,14.643961 13.1582361,14.7596335 C12.4634771,15.3967716 11.755103,15.6538706 11.1897396,15.7000055 L11.1897396,15.7000055 L7.4723083,15.6798158 C7.14276373,15.634268 6.81580098,15.5154267 6.49455235,15.3472501 C6.25643701,15.2225944 6.06881706,15.0975452 5.88705731,14.9494308 L5.88705731,14.9494308 L2.55198782,11.500873 C2.39559475,11.3769079 2.17626793,11.1748532 1.9548636,10.9139403 C1.57867502,10.4706225 1.33501976,10.0139923 1.30330257,9.52833025 C1.28093191,9.18578476 1.37200912,8.85641102 1.5826788,8.56872564 C1.82538833,8.23725279 2.12881965,8.02107162 2.47470569,7.92957033 C2.95807982,7.80169771 3.42705723,7.92468989 3.86509644,8.18731167 C4.04431391,8.29475961 4.1816109,8.40304483 4.26225571,8.47866867 L4.26225571,8.47866867 L4.61400328,8.79701027 L4.57247249,3.59275349 L4.57628524,3.46204923 C4.5897691,3.23444442 4.64087578,2.95701848 4.75937106,2.66961597 C5.01017272,2.06131302 5.49670227,1.64692543 6.21363856,1.60818786 C6.44223508,1.59583681 6.65042099,1.62176802 6.83696985,1.68057551 L6.83696985,1.68057551 L6.86400328,1.69001027 C6.88501862,1.63593052 6.90764242,1.58175442 6.9331867,1.52672633 L6.9331867,1.52672633 L7.01883595,1.35955614 C7.31549194,0.832047939 7.79476072,0.48993549 8.44583468,0.500225887 Z M8.42684173,1.70001476 C8.26825412,1.69756905 8.16339456,1.77242008 8.06478367,1.94776814 C8.03967773,1.99241107 8.01831703,2.03811495 8.00083464,2.07855067 L8.00083464,2.07855067 L7.94879157,2.2035905 L7.94354455,2.20731401 L7.943,3.161 L7.97170661,3.16123746 L7.97170661,7.60991883 L6.77170661,7.60991883 L6.771,3.338 L6.74362358,3.33880359 C6.74284189,3.29064626 6.73014163,3.20282206 6.7002616,3.11094408 L6.66446012,3.01903385 C6.58982025,2.85766739 6.49843292,2.79455071 6.27838133,2.80644008 C6.07001018,2.81769881 5.95642108,2.91444507 5.86877664,3.12702089 C5.79792279,3.29887224 5.77228127,3.48655908 5.77246879,3.58977183 L5.77246879,3.58977183 L5.83613619,11.5252021 L3.41863956,9.33477657 L3.31637296,9.25979571 L3.24805011,9.21651224 C3.06096922,9.10434987 2.89279975,9.06024641 2.78159879,9.0896637 C2.71007735,9.10858411 2.63607367,9.1613084 2.55086305,9.27768211 C2.51020424,9.33320478 2.49638061,9.38319687 2.50075171,9.4501283 C2.51206889,9.62341997 2.64503022,9.87260054 2.86983366,10.1375191 C3.03268834,10.3294345 3.19762053,10.4813781 3.35554956,10.6131022 L3.35554956,10.6131022 L6.68454317,14.0569073 C6.71106575,14.0773808 6.74806086,14.1037158 6.79369091,14.1335929 L6.79369091,14.1335929 L6.95464838,14.2315311 L7.05111031,14.2841211 C7.25978123,14.3933622 7.46253523,14.4670573 7.55685495,14.4854708 L7.55685495,14.4854708 L11.1407985,14.5022108 C11.1503576,14.5013899 11.1627905,14.4997539 11.1779002,14.4971772 L11.1779002,14.4971772 L11.2991076,14.4694224 C11.3491682,14.4557375 11.4083624,14.437284 11.4751158,14.4130563 C11.769383,14.3062543 12.066676,14.1324596 12.3471758,13.8752234 C12.4371203,13.7927386 12.5240597,13.7026333 12.607654,13.6044743 C12.9760464,13.1719172 13.183059,12.6137678 13.1924195,12.030173 L13.1924195,12.030173 L13.3000132,5.32832551 C13.2997939,5.29016685 13.2826117,5.19085946 13.2386527,5.10425262 C13.1843838,4.99733326 13.1129774,4.94771265 12.9379578,4.94108739 C12.6814739,4.93138871 12.534132,5.11189595 12.4756792,5.39480062 L12.4768718,7.52734922 L11.2768718,7.52734922 L11.276,5.688 L11.2462883,5.6883208 L11.2339541,3.32771285 C11.2341,3.2560396 11.2209054,3.18817621 11.1957482,3.12818892 C11.0820579,2.85732094 10.9199288,2.71019133 10.6649031,2.71019133 C10.456829,2.71019133 10.3197487,2.87378067 10.2524297,3.11264939 L10.2530225,7.512783 L9.05302254,7.512783 L9.053,3.288 L9.01554331,3.28724203 L8.98800328,2.29901027 L8.9629175,2.22263368 C8.94515567,2.17417174 8.92167756,2.11937748 8.8924232,2.06330056 L8.8924232,2.06330056 L8.84420197,1.9788544 C8.72758855,1.79219249 8.59915015,1.70280728 8.42684173,1.70001476 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #adaptTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit canvas</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit-canvas\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M14.9971494,10.4 L14.9971494,13.4020516 C14.9971494,14.2366152 14.3581879,14.9219414 13.542782,14.9955129 L13.3971494,15.0020516 L10.4,15.0020516 L10.4,13.8020516 L13.3971494,13.8020516 C13.590449,13.8020516 13.7517243,13.6649388 13.7890228,13.4826656 L13.7971494,13.4020516 L13.7971494,10.4 L14.9971494,10.4 Z M2.2,10.4 L2.2,13.3971494 C2.2,13.590449 2.3371128,13.7517243 2.51938605,13.7890228 L2.6,13.7971494 L5.60205161,13.7971494 L5.60205161,14.9971494 L2.6,14.9971494 C1.76543638,14.9971494 1.08011021,14.3581879 1.00653868,13.542782 L1,13.3971494 L1,10.4 L2.2,10.4 Z M10.5024511,4.9 C11.3861067,4.9 12.1024511,5.6163444 12.1024511,6.5 L12.1024511,6.5 L12.1024511,9.5 C12.1024511,10.3836556 11.3861067,11.1 10.5024511,11.1 L10.5024511,11.1 L5.50245112,11.1 C4.61879552,11.1 3.90245112,10.3836556 3.90245112,9.5 L3.90245112,9.5 L3.90245112,6.5 C3.90245112,5.6163444 4.61879552,4.9 5.50245112,4.9 L5.50245112,4.9 Z M10.5024511,6.1 L5.50245112,6.1 C5.28153722,6.1 5.10245112,6.2790861 5.10245112,6.5 L5.10245112,6.5 L5.10245112,9.5 C5.10245112,9.7209139 5.28153722,9.9 5.50245112,9.9 L5.50245112,9.9 L10.5024511,9.9 C10.723365,9.9 10.9024511,9.7209139 10.9024511,9.5 L10.9024511,9.5 L10.9024511,6.5 C10.9024511,6.2790861 10.723365,6.1 10.5024511,6.1 L10.5024511,6.1 Z M5.59714938,1 L5.59714938,2.2 L2.6,2.2 C2.40670034,2.2 2.24542508,2.3371128 2.20812658,2.51938605 L2.2,2.6 L2.2,5.60205161 L1,5.60205161 L1,2.6 C1,1.76543638 1.63896152,1.08011021 2.45436739,1.00653868 L2.6,1 L5.59714938,1 Z M13.3971494,1 L13.542782,1.00653868 C14.3581879,1.08011021 14.9971494,1.76543638 14.9971494,2.6 L14.9971494,2.6 L14.9971494,5.60205161 L13.7971494,5.60205161 L13.7971494,2.6 L13.7890228,2.51938605 C13.7517243,2.3371128 13.590449,2.2 13.3971494,2.2 L13.3971494,2.2 L10.4,2.2 L10.4,1 L13.3971494,1 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n<ng-template #zoomOutTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-out</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-out\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,2.73225886e-13 C10.6331505,2.73225886e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.58522109e-14,10.6331505 4.58522109e-14,6.85 C4.58522109e-14,3.06684946 3.06684946,2.73225886e-13 6.85,2.73225886e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M4.6,6.2 L9.12944565,6.2 C9.4608165,6.2 9.72944565,6.46862915 9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L4.6,7.4 C4.26862915,7.4 4,7.13137085 4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L9.12944565,6.2 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #zoomInTemplate\n ><svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-in</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-in\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,-1.81188398e-13 C10.6331505,-1.81188398e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.61852778e-14,10.6331505 4.61852778e-14,6.85 C4.61852778e-14,3.06684946 3.06684946,-1.81188398e-13 6.85,-1.81188398e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M6.86472282,3.93527718 C7.16295659,3.93527718 7.41036958,4.15286679 7.45686984,4.43795406 L7.46472282,4.53527718 L7.464,6.19927718 L9.12944565,6.2 C9.42767941,6.2 9.6750924,6.41758961 9.72159266,6.70267688 L9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L7.464,7.39927718 L7.46472282,9.06472282 C7.46472282,9.36295659 7.24713321,9.61036958 6.96204594,9.65686984 L6.86472282,9.66472282 C6.56648906,9.66472282 6.31907607,9.44713321 6.27257581,9.16204594 L6.26472282,9.06472282 L6.264,7.39927718 L4.6,7.4 C4.30176624,7.4 4.05435325,7.18241039 4.00785299,6.89732312 L4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L6.264,6.19927718 L6.26472282,4.53527718 C6.26472282,4.2701805 6.43664548,4.0452385 6.67507642,3.96586557 L6.76739971,3.94313016 L6.86472282,3.93527718 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitToolbarComponent, decorators: [{
2261
+ PlaitToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2262
+ PlaitToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: PlaitToolbarComponent, selector: "plait-toolbar", inputs: { board: "board" }, outputs: { adaptHandle: "adaptHandle", zoomInHandle: "zoomInHandle", zoomOutHandle: "zoomOutHandle", resetZoomHandel: "resetZoomHandel" }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<div class=\"zoom-toolbar island plait-board-attached\">\n <a class=\"toolbar-item plait-action-icon\" [ngClass]=\"{ 'icon-active': isHand }\" (click)=\"activeHand()\">\n <ng-template [ngTemplateOutlet]=\"dragMoveTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"adapt()\">\n <ng-template [ngTemplateOutlet]=\"adaptTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomOut()\">\n <ng-template [ngTemplateOutlet]=\"zoomOutTemplate\"></ng-template>\n </a>\n <div class=\"toolbar-item zoom-value\" (mousedown)=\"resetZoom()\">{{ zoom }}%</div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomIn()\">\n <ng-template [ngTemplateOutlet]=\"zoomInTemplate\"></ng-template>\n </a>\n</div>\n\n<ng-template #dragMoveTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M8.44583468,0.500225887 C9.07406934,0.510185679 9.54739531,0.839591366 9.86192311,1.34305279 C9.89696656,1.39914649 9.92878401,1.45492964 9.9576026,1.50991157 L9.9576026,1.50991157 L10.0210033,1.64201027 L10.061978,1.62350755 C10.1972891,1.56834247 10.3444107,1.53218464 10.5027907,1.51755353 L10.5027907,1.51755353 L10.6649031,1.51019133 C11.4883708,1.51019133 12.0208782,1.99343346 12.3023042,2.66393278 C12.3903714,2.87392911 12.4344191,3.10047818 12.4339446,3.3257952 L12.4339446,3.3257952 L12.4360033,3.80501027 L12.5160535,3.78341501 C12.6124478,3.76124046 12.7138812,3.74739854 12.820201,3.74250274 L12.820201,3.74250274 L12.9833264,3.74194533 C13.6121166,3.7657478 14.0645887,4.0801724 14.3087062,4.56112689 C14.4521117,4.8436609 14.4987984,5.11349437 14.4999262,5.33449618 L14.4999262,5.33449618 L14.3922653,12.049414 C14.3784752,12.909177 14.0717787,13.7360948 13.5212406,14.3825228 C13.4055676,14.5183496 13.2843697,14.643961 13.1582361,14.7596335 C12.4634771,15.3967716 11.755103,15.6538706 11.1897396,15.7000055 L11.1897396,15.7000055 L7.4723083,15.6798158 C7.14276373,15.634268 6.81580098,15.5154267 6.49455235,15.3472501 C6.25643701,15.2225944 6.06881706,15.0975452 5.88705731,14.9494308 L5.88705731,14.9494308 L2.55198782,11.500873 C2.39559475,11.3769079 2.17626793,11.1748532 1.9548636,10.9139403 C1.57867502,10.4706225 1.33501976,10.0139923 1.30330257,9.52833025 C1.28093191,9.18578476 1.37200912,8.85641102 1.5826788,8.56872564 C1.82538833,8.23725279 2.12881965,8.02107162 2.47470569,7.92957033 C2.95807982,7.80169771 3.42705723,7.92468989 3.86509644,8.18731167 C4.04431391,8.29475961 4.1816109,8.40304483 4.26225571,8.47866867 L4.26225571,8.47866867 L4.61400328,8.79701027 L4.57247249,3.59275349 L4.57628524,3.46204923 C4.5897691,3.23444442 4.64087578,2.95701848 4.75937106,2.66961597 C5.01017272,2.06131302 5.49670227,1.64692543 6.21363856,1.60818786 C6.44223508,1.59583681 6.65042099,1.62176802 6.83696985,1.68057551 L6.83696985,1.68057551 L6.86400328,1.69001027 C6.88501862,1.63593052 6.90764242,1.58175442 6.9331867,1.52672633 L6.9331867,1.52672633 L7.01883595,1.35955614 C7.31549194,0.832047939 7.79476072,0.48993549 8.44583468,0.500225887 Z M8.42684173,1.70001476 C8.26825412,1.69756905 8.16339456,1.77242008 8.06478367,1.94776814 C8.03967773,1.99241107 8.01831703,2.03811495 8.00083464,2.07855067 L8.00083464,2.07855067 L7.94879157,2.2035905 L7.94354455,2.20731401 L7.943,3.161 L7.97170661,3.16123746 L7.97170661,7.60991883 L6.77170661,7.60991883 L6.771,3.338 L6.74362358,3.33880359 C6.74284189,3.29064626 6.73014163,3.20282206 6.7002616,3.11094408 L6.66446012,3.01903385 C6.58982025,2.85766739 6.49843292,2.79455071 6.27838133,2.80644008 C6.07001018,2.81769881 5.95642108,2.91444507 5.86877664,3.12702089 C5.79792279,3.29887224 5.77228127,3.48655908 5.77246879,3.58977183 L5.77246879,3.58977183 L5.83613619,11.5252021 L3.41863956,9.33477657 L3.31637296,9.25979571 L3.24805011,9.21651224 C3.06096922,9.10434987 2.89279975,9.06024641 2.78159879,9.0896637 C2.71007735,9.10858411 2.63607367,9.1613084 2.55086305,9.27768211 C2.51020424,9.33320478 2.49638061,9.38319687 2.50075171,9.4501283 C2.51206889,9.62341997 2.64503022,9.87260054 2.86983366,10.1375191 C3.03268834,10.3294345 3.19762053,10.4813781 3.35554956,10.6131022 L3.35554956,10.6131022 L6.68454317,14.0569073 C6.71106575,14.0773808 6.74806086,14.1037158 6.79369091,14.1335929 L6.79369091,14.1335929 L6.95464838,14.2315311 L7.05111031,14.2841211 C7.25978123,14.3933622 7.46253523,14.4670573 7.55685495,14.4854708 L7.55685495,14.4854708 L11.1407985,14.5022108 C11.1503576,14.5013899 11.1627905,14.4997539 11.1779002,14.4971772 L11.1779002,14.4971772 L11.2991076,14.4694224 C11.3491682,14.4557375 11.4083624,14.437284 11.4751158,14.4130563 C11.769383,14.3062543 12.066676,14.1324596 12.3471758,13.8752234 C12.4371203,13.7927386 12.5240597,13.7026333 12.607654,13.6044743 C12.9760464,13.1719172 13.183059,12.6137678 13.1924195,12.030173 L13.1924195,12.030173 L13.3000132,5.32832551 C13.2997939,5.29016685 13.2826117,5.19085946 13.2386527,5.10425262 C13.1843838,4.99733326 13.1129774,4.94771265 12.9379578,4.94108739 C12.6814739,4.93138871 12.534132,5.11189595 12.4756792,5.39480062 L12.4768718,7.52734922 L11.2768718,7.52734922 L11.276,5.688 L11.2462883,5.6883208 L11.2339541,3.32771285 C11.2341,3.2560396 11.2209054,3.18817621 11.1957482,3.12818892 C11.0820579,2.85732094 10.9199288,2.71019133 10.6649031,2.71019133 C10.456829,2.71019133 10.3197487,2.87378067 10.2524297,3.11264939 L10.2530225,7.512783 L9.05302254,7.512783 L9.053,3.288 L9.01554331,3.28724203 L8.98800328,2.29901027 L8.9629175,2.22263368 C8.94515567,2.17417174 8.92167756,2.11937748 8.8924232,2.06330056 L8.8924232,2.06330056 L8.84420197,1.9788544 C8.72758855,1.79219249 8.59915015,1.70280728 8.42684173,1.70001476 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #adaptTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit canvas</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit-canvas\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M14.9971494,10.4 L14.9971494,13.4020516 C14.9971494,14.2366152 14.3581879,14.9219414 13.542782,14.9955129 L13.3971494,15.0020516 L10.4,15.0020516 L10.4,13.8020516 L13.3971494,13.8020516 C13.590449,13.8020516 13.7517243,13.6649388 13.7890228,13.4826656 L13.7971494,13.4020516 L13.7971494,10.4 L14.9971494,10.4 Z M2.2,10.4 L2.2,13.3971494 C2.2,13.590449 2.3371128,13.7517243 2.51938605,13.7890228 L2.6,13.7971494 L5.60205161,13.7971494 L5.60205161,14.9971494 L2.6,14.9971494 C1.76543638,14.9971494 1.08011021,14.3581879 1.00653868,13.542782 L1,13.3971494 L1,10.4 L2.2,10.4 Z M10.5024511,4.9 C11.3861067,4.9 12.1024511,5.6163444 12.1024511,6.5 L12.1024511,6.5 L12.1024511,9.5 C12.1024511,10.3836556 11.3861067,11.1 10.5024511,11.1 L10.5024511,11.1 L5.50245112,11.1 C4.61879552,11.1 3.90245112,10.3836556 3.90245112,9.5 L3.90245112,9.5 L3.90245112,6.5 C3.90245112,5.6163444 4.61879552,4.9 5.50245112,4.9 L5.50245112,4.9 Z M10.5024511,6.1 L5.50245112,6.1 C5.28153722,6.1 5.10245112,6.2790861 5.10245112,6.5 L5.10245112,6.5 L5.10245112,9.5 C5.10245112,9.7209139 5.28153722,9.9 5.50245112,9.9 L5.50245112,9.9 L10.5024511,9.9 C10.723365,9.9 10.9024511,9.7209139 10.9024511,9.5 L10.9024511,9.5 L10.9024511,6.5 C10.9024511,6.2790861 10.723365,6.1 10.5024511,6.1 L10.5024511,6.1 Z M5.59714938,1 L5.59714938,2.2 L2.6,2.2 C2.40670034,2.2 2.24542508,2.3371128 2.20812658,2.51938605 L2.2,2.6 L2.2,5.60205161 L1,5.60205161 L1,2.6 C1,1.76543638 1.63896152,1.08011021 2.45436739,1.00653868 L2.6,1 L5.59714938,1 Z M13.3971494,1 L13.542782,1.00653868 C14.3581879,1.08011021 14.9971494,1.76543638 14.9971494,2.6 L14.9971494,2.6 L14.9971494,5.60205161 L13.7971494,5.60205161 L13.7971494,2.6 L13.7890228,2.51938605 C13.7517243,2.3371128 13.590449,2.2 13.3971494,2.2 L13.3971494,2.2 L10.4,2.2 L10.4,1 L13.3971494,1 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n<ng-template #zoomOutTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-out</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-out\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,2.73225886e-13 C10.6331505,2.73225886e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.58522109e-14,10.6331505 4.58522109e-14,6.85 C4.58522109e-14,3.06684946 3.06684946,2.73225886e-13 6.85,2.73225886e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M4.6,6.2 L9.12944565,6.2 C9.4608165,6.2 9.72944565,6.46862915 9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L4.6,7.4 C4.26862915,7.4 4,7.13137085 4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L9.12944565,6.2 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #zoomInTemplate\n ><svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-in</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-in\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,-1.81188398e-13 C10.6331505,-1.81188398e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.61852778e-14,10.6331505 4.61852778e-14,6.85 C4.61852778e-14,3.06684946 3.06684946,-1.81188398e-13 6.85,-1.81188398e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M6.86472282,3.93527718 C7.16295659,3.93527718 7.41036958,4.15286679 7.45686984,4.43795406 L7.46472282,4.53527718 L7.464,6.19927718 L9.12944565,6.2 C9.42767941,6.2 9.6750924,6.41758961 9.72159266,6.70267688 L9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L7.464,7.39927718 L7.46472282,9.06472282 C7.46472282,9.36295659 7.24713321,9.61036958 6.96204594,9.65686984 L6.86472282,9.66472282 C6.56648906,9.66472282 6.31907607,9.44713321 6.27257581,9.16204594 L6.26472282,9.06472282 L6.264,7.39927718 L4.6,7.4 C4.30176624,7.4 4.05435325,7.18241039 4.00785299,6.89732312 L4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L6.264,6.19927718 L6.26472282,4.53527718 C6.26472282,4.2701805 6.43664548,4.0452385 6.67507642,3.96586557 L6.76739971,3.94313016 L6.86472282,3.93527718 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitToolbarComponent, decorators: [{
2214
2264
  type: Component,
2215
2265
  args: [{ selector: 'plait-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"zoom-toolbar island plait-board-attached\">\n <a class=\"toolbar-item plait-action-icon\" [ngClass]=\"{ 'icon-active': isHand }\" (click)=\"activeHand()\">\n <ng-template [ngTemplateOutlet]=\"dragMoveTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"adapt()\">\n <ng-template [ngTemplateOutlet]=\"adaptTemplate\"></ng-template>\n </a>\n <div class=\"divider\"></div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomOut()\">\n <ng-template [ngTemplateOutlet]=\"zoomOutTemplate\"></ng-template>\n </a>\n <div class=\"toolbar-item zoom-value\" (mousedown)=\"resetZoom()\">{{ zoom }}%</div>\n <a class=\"toolbar-item plait-action-icon\" (mousedown)=\"zoomIn()\">\n <ng-template [ngTemplateOutlet]=\"zoomInTemplate\"></ng-template>\n </a>\n</div>\n\n<ng-template #dragMoveTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/hand\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M8.44583468,0.500225887 C9.07406934,0.510185679 9.54739531,0.839591366 9.86192311,1.34305279 C9.89696656,1.39914649 9.92878401,1.45492964 9.9576026,1.50991157 L9.9576026,1.50991157 L10.0210033,1.64201027 L10.061978,1.62350755 C10.1972891,1.56834247 10.3444107,1.53218464 10.5027907,1.51755353 L10.5027907,1.51755353 L10.6649031,1.51019133 C11.4883708,1.51019133 12.0208782,1.99343346 12.3023042,2.66393278 C12.3903714,2.87392911 12.4344191,3.10047818 12.4339446,3.3257952 L12.4339446,3.3257952 L12.4360033,3.80501027 L12.5160535,3.78341501 C12.6124478,3.76124046 12.7138812,3.74739854 12.820201,3.74250274 L12.820201,3.74250274 L12.9833264,3.74194533 C13.6121166,3.7657478 14.0645887,4.0801724 14.3087062,4.56112689 C14.4521117,4.8436609 14.4987984,5.11349437 14.4999262,5.33449618 L14.4999262,5.33449618 L14.3922653,12.049414 C14.3784752,12.909177 14.0717787,13.7360948 13.5212406,14.3825228 C13.4055676,14.5183496 13.2843697,14.643961 13.1582361,14.7596335 C12.4634771,15.3967716 11.755103,15.6538706 11.1897396,15.7000055 L11.1897396,15.7000055 L7.4723083,15.6798158 C7.14276373,15.634268 6.81580098,15.5154267 6.49455235,15.3472501 C6.25643701,15.2225944 6.06881706,15.0975452 5.88705731,14.9494308 L5.88705731,14.9494308 L2.55198782,11.500873 C2.39559475,11.3769079 2.17626793,11.1748532 1.9548636,10.9139403 C1.57867502,10.4706225 1.33501976,10.0139923 1.30330257,9.52833025 C1.28093191,9.18578476 1.37200912,8.85641102 1.5826788,8.56872564 C1.82538833,8.23725279 2.12881965,8.02107162 2.47470569,7.92957033 C2.95807982,7.80169771 3.42705723,7.92468989 3.86509644,8.18731167 C4.04431391,8.29475961 4.1816109,8.40304483 4.26225571,8.47866867 L4.26225571,8.47866867 L4.61400328,8.79701027 L4.57247249,3.59275349 L4.57628524,3.46204923 C4.5897691,3.23444442 4.64087578,2.95701848 4.75937106,2.66961597 C5.01017272,2.06131302 5.49670227,1.64692543 6.21363856,1.60818786 C6.44223508,1.59583681 6.65042099,1.62176802 6.83696985,1.68057551 L6.83696985,1.68057551 L6.86400328,1.69001027 C6.88501862,1.63593052 6.90764242,1.58175442 6.9331867,1.52672633 L6.9331867,1.52672633 L7.01883595,1.35955614 C7.31549194,0.832047939 7.79476072,0.48993549 8.44583468,0.500225887 Z M8.42684173,1.70001476 C8.26825412,1.69756905 8.16339456,1.77242008 8.06478367,1.94776814 C8.03967773,1.99241107 8.01831703,2.03811495 8.00083464,2.07855067 L8.00083464,2.07855067 L7.94879157,2.2035905 L7.94354455,2.20731401 L7.943,3.161 L7.97170661,3.16123746 L7.97170661,7.60991883 L6.77170661,7.60991883 L6.771,3.338 L6.74362358,3.33880359 C6.74284189,3.29064626 6.73014163,3.20282206 6.7002616,3.11094408 L6.66446012,3.01903385 C6.58982025,2.85766739 6.49843292,2.79455071 6.27838133,2.80644008 C6.07001018,2.81769881 5.95642108,2.91444507 5.86877664,3.12702089 C5.79792279,3.29887224 5.77228127,3.48655908 5.77246879,3.58977183 L5.77246879,3.58977183 L5.83613619,11.5252021 L3.41863956,9.33477657 L3.31637296,9.25979571 L3.24805011,9.21651224 C3.06096922,9.10434987 2.89279975,9.06024641 2.78159879,9.0896637 C2.71007735,9.10858411 2.63607367,9.1613084 2.55086305,9.27768211 C2.51020424,9.33320478 2.49638061,9.38319687 2.50075171,9.4501283 C2.51206889,9.62341997 2.64503022,9.87260054 2.86983366,10.1375191 C3.03268834,10.3294345 3.19762053,10.4813781 3.35554956,10.6131022 L3.35554956,10.6131022 L6.68454317,14.0569073 C6.71106575,14.0773808 6.74806086,14.1037158 6.79369091,14.1335929 L6.79369091,14.1335929 L6.95464838,14.2315311 L7.05111031,14.2841211 C7.25978123,14.3933622 7.46253523,14.4670573 7.55685495,14.4854708 L7.55685495,14.4854708 L11.1407985,14.5022108 C11.1503576,14.5013899 11.1627905,14.4997539 11.1779002,14.4971772 L11.1779002,14.4971772 L11.2991076,14.4694224 C11.3491682,14.4557375 11.4083624,14.437284 11.4751158,14.4130563 C11.769383,14.3062543 12.066676,14.1324596 12.3471758,13.8752234 C12.4371203,13.7927386 12.5240597,13.7026333 12.607654,13.6044743 C12.9760464,13.1719172 13.183059,12.6137678 13.1924195,12.030173 L13.1924195,12.030173 L13.3000132,5.32832551 C13.2997939,5.29016685 13.2826117,5.19085946 13.2386527,5.10425262 C13.1843838,4.99733326 13.1129774,4.94771265 12.9379578,4.94108739 C12.6814739,4.93138871 12.534132,5.11189595 12.4756792,5.39480062 L12.4768718,7.52734922 L11.2768718,7.52734922 L11.276,5.688 L11.2462883,5.6883208 L11.2339541,3.32771285 C11.2341,3.2560396 11.2209054,3.18817621 11.1957482,3.12818892 C11.0820579,2.85732094 10.9199288,2.71019133 10.6649031,2.71019133 C10.456829,2.71019133 10.3197487,2.87378067 10.2524297,3.11264939 L10.2530225,7.512783 L9.05302254,7.512783 L9.053,3.288 L9.01554331,3.28724203 L8.98800328,2.29901027 L8.9629175,2.22263368 C8.94515567,2.17417174 8.92167756,2.11937748 8.8924232,2.06330056 L8.8924232,2.06330056 L8.84420197,1.9788544 C8.72758855,1.79219249 8.59915015,1.70280728 8.42684173,1.70001476 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #adaptTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit canvas</title>\n <g id=\"1.Base\u57FA\u7840/1.icon\u56FE\u6807/2.normal/Fit-canvas\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M14.9971494,10.4 L14.9971494,13.4020516 C14.9971494,14.2366152 14.3581879,14.9219414 13.542782,14.9955129 L13.3971494,15.0020516 L10.4,15.0020516 L10.4,13.8020516 L13.3971494,13.8020516 C13.590449,13.8020516 13.7517243,13.6649388 13.7890228,13.4826656 L13.7971494,13.4020516 L13.7971494,10.4 L14.9971494,10.4 Z M2.2,10.4 L2.2,13.3971494 C2.2,13.590449 2.3371128,13.7517243 2.51938605,13.7890228 L2.6,13.7971494 L5.60205161,13.7971494 L5.60205161,14.9971494 L2.6,14.9971494 C1.76543638,14.9971494 1.08011021,14.3581879 1.00653868,13.542782 L1,13.3971494 L1,10.4 L2.2,10.4 Z M10.5024511,4.9 C11.3861067,4.9 12.1024511,5.6163444 12.1024511,6.5 L12.1024511,6.5 L12.1024511,9.5 C12.1024511,10.3836556 11.3861067,11.1 10.5024511,11.1 L10.5024511,11.1 L5.50245112,11.1 C4.61879552,11.1 3.90245112,10.3836556 3.90245112,9.5 L3.90245112,9.5 L3.90245112,6.5 C3.90245112,5.6163444 4.61879552,4.9 5.50245112,4.9 L5.50245112,4.9 Z M10.5024511,6.1 L5.50245112,6.1 C5.28153722,6.1 5.10245112,6.2790861 5.10245112,6.5 L5.10245112,6.5 L5.10245112,9.5 C5.10245112,9.7209139 5.28153722,9.9 5.50245112,9.9 L5.50245112,9.9 L10.5024511,9.9 C10.723365,9.9 10.9024511,9.7209139 10.9024511,9.5 L10.9024511,9.5 L10.9024511,6.5 C10.9024511,6.2790861 10.723365,6.1 10.5024511,6.1 L10.5024511,6.1 Z M5.59714938,1 L5.59714938,2.2 L2.6,2.2 C2.40670034,2.2 2.24542508,2.3371128 2.20812658,2.51938605 L2.2,2.6 L2.2,5.60205161 L1,5.60205161 L1,2.6 C1,1.76543638 1.63896152,1.08011021 2.45436739,1.00653868 L2.6,1 L5.59714938,1 Z M13.3971494,1 L13.542782,1.00653868 C14.3581879,1.08011021 14.9971494,1.76543638 14.9971494,2.6 L14.9971494,2.6 L14.9971494,5.60205161 L13.7971494,5.60205161 L13.7971494,2.6 L13.7890228,2.51938605 C13.7517243,2.3371128 13.590449,2.2 13.3971494,2.2 L13.3971494,2.2 L10.4,2.2 L10.4,1 L13.3971494,1 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n<ng-template #zoomOutTemplate>\n <svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-out</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-out\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,2.73225886e-13 C10.6331505,2.73225886e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.58522109e-14,10.6331505 4.58522109e-14,6.85 C4.58522109e-14,3.06684946 3.06684946,2.73225886e-13 6.85,2.73225886e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M4.6,6.2 L9.12944565,6.2 C9.4608165,6.2 9.72944565,6.46862915 9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L4.6,7.4 C4.26862915,7.4 4,7.13137085 4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L9.12944565,6.2 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n\n<ng-template #zoomInTemplate\n ><svg\n width=\"16px\"\n height=\"16px\"\n viewBox=\"0 0 16 16\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n >\n <title>action/zoom-in</title>\n <desc>Created with Sketch.</desc>\n <g id=\"action/zoom-in\" stroke=\"none\" stroke-width=\"1\" fill-rule=\"evenodd\">\n <path\n d=\"M6.85,-1.81188398e-13 C10.6331505,-1.81188398e-13 13.7,3.06684946 13.7,6.85 C13.7,8.54194045 13.0865836,10.0906098 12.0700142,11.2857448 L15.4201976,14.5717081 C15.6567367,14.8037768 15.6603607,15.1836585 15.4282919,15.4201976 C15.1962232,15.6567367 14.8163415,15.6603607 14.5798024,15.4282919 L14.5798024,15.4282919 L11.2163456,12.128262 C10.0309427,13.1099691 8.50937591,13.7 6.85,13.7 C3.06684946,13.7 4.61852778e-14,10.6331505 4.61852778e-14,6.85 C4.61852778e-14,3.06684946 3.06684946,-1.81188398e-13 6.85,-1.81188398e-13 Z M6.85,1.2 C3.72959116,1.2 1.2,3.72959116 1.2,6.85 C1.2,9.97040884 3.72959116,12.5 6.85,12.5 C8.31753357,12.5 9.65438791,11.9404957 10.6588859,11.0231643 C10.6855412,10.9625408 10.7245275,10.9050898 10.7743982,10.8542584 C10.8288931,10.7987137 10.8915387,10.7560124 10.9585649,10.7261903 C11.9144009,9.71595758 12.5,8.35136579 12.5,6.85 C12.5,3.72959116 9.97040884,1.2 6.85,1.2 Z M6.86472282,3.93527718 C7.16295659,3.93527718 7.41036958,4.15286679 7.45686984,4.43795406 L7.46472282,4.53527718 L7.464,6.19927718 L9.12944565,6.2 C9.42767941,6.2 9.6750924,6.41758961 9.72159266,6.70267688 L9.72944565,6.8 C9.72944565,7.09823376 9.51185604,7.34564675 9.22676876,7.39214701 L9.12944565,7.4 L7.464,7.39927718 L7.46472282,9.06472282 C7.46472282,9.36295659 7.24713321,9.61036958 6.96204594,9.65686984 L6.86472282,9.66472282 C6.56648906,9.66472282 6.31907607,9.44713321 6.27257581,9.16204594 L6.26472282,9.06472282 L6.264,7.39927718 L4.6,7.4 C4.30176624,7.4 4.05435325,7.18241039 4.00785299,6.89732312 L4,6.8 C4,6.50176624 4.21758961,6.25435325 4.50267688,6.20785299 L4.6,6.2 L6.264,6.19927718 L6.26472282,4.53527718 C6.26472282,4.2701805 6.43664548,4.0452385 6.67507642,3.96586557 L6.76739971,3.94313016 L6.86472282,3.93527718 Z\"\n id=\"\u5F62\u72B6\u7ED3\u5408\"\n fill-rule=\"nonzero\"\n ></path>\n </g>\n </svg>\n</ng-template>\n" }]
2216
2266
  }], propDecorators: { hostClass: [{
@@ -2234,7 +2284,7 @@ class PlaitBoardComponent {
2234
2284
  return this.svg.nativeElement;
2235
2285
  }
2236
2286
  get hostClass() {
2237
- return `plait-board-container ${this.board.pointer}`;
2287
+ return `plait-board-container pointer-${this.board.pointer}`;
2238
2288
  }
2239
2289
  get readonly() {
2240
2290
  return this.board.options.readonly;
@@ -2245,8 +2295,9 @@ class PlaitBoardComponent {
2245
2295
  get nativeElement() {
2246
2296
  return this.elementRef.nativeElement;
2247
2297
  }
2248
- constructor(cdr, elementRef, ngZone) {
2298
+ constructor(cdr, viewContainerRef, elementRef, ngZone) {
2249
2299
  this.cdr = cdr;
2300
+ this.viewContainerRef = viewContainerRef;
2250
2301
  this.elementRef = elementRef;
2251
2302
  this.ngZone = ngZone;
2252
2303
  this.hasInitialized = false;
@@ -2350,7 +2401,7 @@ class PlaitBoardComponent {
2350
2401
  this.board.globalMouseup(event);
2351
2402
  });
2352
2403
  fromEvent(this.host, 'dblclick')
2353
- .pipe(takeUntil(this.destroy$))
2404
+ .pipe(takeUntil(this.destroy$), filter(() => this.isFocused && !PlaitBoard.hasBeenTextEditing(this.board)))
2354
2405
  .subscribe((event) => {
2355
2406
  this.board.dblclick(event);
2356
2407
  });
@@ -2381,7 +2432,7 @@ class PlaitBoardComponent {
2381
2432
  fromEvent(document, 'paste')
2382
2433
  .pipe(takeUntil(this.destroy$), filter(() => this.isFocused && !PlaitBoard.isReadonly(this.board) && !PlaitBoard.hasBeenTextEditing(this.board)))
2383
2434
  .subscribe((clipboardEvent) => {
2384
- const mousePoint = BOARD_TO_MOVING_POINT.get(this.board);
2435
+ const mousePoint = PlaitBoard.getMovingPoint(this.board);
2385
2436
  const rect = this.nativeElement.getBoundingClientRect();
2386
2437
  if (mousePoint && distanceBetweenPointAndRectangle(mousePoint[0], mousePoint[1], rect) === 0) {
2387
2438
  const targetPoint = transformPoint(this.board, toPoint(mousePoint[0], mousePoint[1], this.host));
@@ -2461,8 +2512,8 @@ class PlaitBoardComponent {
2461
2512
  this.cdr.markForCheck();
2462
2513
  }
2463
2514
  }
2464
- PlaitBoardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitBoardComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2465
- PlaitBoardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: PlaitBoardComponent, selector: "plait-board", inputs: { plaitValue: "plaitValue", plaitViewport: "plaitViewport", plaitPlugins: "plaitPlugins", plaitOptions: "plaitOptions" }, outputs: { plaitChange: "plaitChange", plaitBoardInitialized: "plaitBoardInitialized" }, host: { properties: { "class": "this.hostClass", "class.readonly": "this.readonly", "class.focused": "this.isFocused" } }, queries: [{ propertyName: "toolbarTemplateRef", first: true, predicate: ["plaitToolbar"], descendants: true }], viewQueries: [{ propertyName: "svg", first: true, predicate: ["svg"], descendants: true, static: true }, { propertyName: "viewportContainer", first: true, predicate: ["viewportContainer"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
2515
+ PlaitBoardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitBoardComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2516
+ PlaitBoardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: PlaitBoardComponent, selector: "plait-board", inputs: { plaitValue: "plaitValue", plaitViewport: "plaitViewport", plaitPlugins: "plaitPlugins", plaitOptions: "plaitOptions" }, outputs: { plaitChange: "plaitChange", plaitBoardInitialized: "plaitBoardInitialized" }, host: { properties: { "class": "this.hostClass", "class.readonly": "this.readonly", "class.focused": "this.isFocused" } }, queries: [{ propertyName: "toolbarTemplateRef", first: true, predicate: ["plaitToolbar"], descendants: true }], viewQueries: [{ propertyName: "svg", first: true, predicate: ["svg"], descendants: true, static: true }, { propertyName: "viewportContainer", first: true, predicate: ["viewportContainer"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: `
2466
2517
  <div class="viewport-container" #viewportContainer>
2467
2518
  <svg #svg width="100%" height="100%" style="position: relative;"><g class="element-host"></g></svg>
2468
2519
  <plait-children [board]="board" [effect]="effect"></plait-children>
@@ -2477,7 +2528,7 @@ PlaitBoardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
2477
2528
  ></plait-toolbar>
2478
2529
  <ng-content></ng-content>
2479
2530
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PlaitChildrenElement, selector: "plait-children", inputs: ["board", "parent", "effect", "parentG"] }, { kind: "component", type: PlaitToolbarComponent, selector: "plait-toolbar", inputs: ["board"], outputs: ["adaptHandle", "zoomInHandle", "zoomOutHandle", "resetZoomHandel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitBoardComponent, decorators: [{
2531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitBoardComponent, decorators: [{
2481
2532
  type: Component,
2482
2533
  args: [{
2483
2534
  selector: 'plait-board',
@@ -2498,7 +2549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
2498
2549
  `,
2499
2550
  changeDetection: ChangeDetectionStrategy.OnPush
2500
2551
  }]
2501
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { plaitValue: [{
2552
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { plaitValue: [{
2502
2553
  type: Input
2503
2554
  }], plaitViewport: [{
2504
2555
  type: Input
@@ -2533,10 +2584,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
2533
2584
  const COMPONENTS = [PlaitBoardComponent, PlaitChildrenElement, PlaitElementComponent, PlaitToolbarComponent];
2534
2585
  class PlaitModule {
2535
2586
  }
2536
- PlaitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2537
- PlaitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: PlaitModule, declarations: [PlaitBoardComponent, PlaitChildrenElement, PlaitElementComponent, PlaitToolbarComponent], imports: [CommonModule], exports: [PlaitBoardComponent, PlaitChildrenElement, PlaitElementComponent, PlaitToolbarComponent] });
2538
- PlaitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitModule, imports: [CommonModule] });
2539
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: PlaitModule, decorators: [{
2587
+ PlaitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2588
+ PlaitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.2", ngImport: i0, type: PlaitModule, declarations: [PlaitBoardComponent, PlaitChildrenElement, PlaitElementComponent, PlaitToolbarComponent], imports: [CommonModule], exports: [PlaitBoardComponent, PlaitChildrenElement, PlaitElementComponent, PlaitToolbarComponent] });
2589
+ PlaitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitModule, imports: [CommonModule] });
2590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: PlaitModule, decorators: [{
2540
2591
  type: NgModule,
2541
2592
  args: [{
2542
2593
  declarations: [...COMPONENTS],
@@ -2545,6 +2596,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
2545
2596
  }]
2546
2597
  }] });
2547
2598
 
2599
+ /**
2600
+ * 1.create board instance
2601
+ * 2.build fake node weak map
2602
+ */
2603
+ const createTestingBoard = (plugins, children, options = { readonly: false, hideScrollbar: true }) => {
2604
+ let board = createBoard(children, options);
2605
+ plugins.forEach(plugin => {
2606
+ board = plugin(board);
2607
+ });
2608
+ return board;
2609
+ };
2610
+
2611
+ const fakeNodeWeakMap = (object) => {
2612
+ const children = object.children || [];
2613
+ children.forEach((value, index) => {
2614
+ NODE_TO_PARENT.set(value, object);
2615
+ NODE_TO_INDEX.set(value, index);
2616
+ fakeNodeWeakMap(value);
2617
+ });
2618
+ };
2619
+ const clearNodeWeakMap = (object) => {
2620
+ const children = object.children || [];
2621
+ children.forEach(value => {
2622
+ NODE_TO_PARENT.delete(value);
2623
+ NODE_TO_INDEX.delete(value);
2624
+ clearNodeWeakMap(value);
2625
+ });
2626
+ };
2627
+
2548
2628
  /*
2549
2629
  * Public API Surface of plait
2550
2630
  */
@@ -2553,5 +2633,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
2553
2633
  * Generated bundle index. Do not edit.
2554
2634
  */
2555
2635
 
2556
- export { 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_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, CLIP_BOARD_FORMAT_KEY, ELEMENT_TO_COMPONENT, FLUSHING, IS_APPLE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_SAFARI, IS_TEXT_EDITABLE, MAX_RADIUS, MERGING, NODE_TO_INDEX, NODE_TO_PARENT, NS, Path, PlaitBoard, PlaitBoardComponent, PlaitChildrenElement, PlaitElement, PlaitElementComponent, PlaitHistoryBoard, PlaitModule, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPointerType, PlaitToolbarComponent, Point, RectangleClient, SAVING, SCROLL_BAR_WIDTH, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, Selection, Transforms, Viewport, addMovingElements, addSelectedElement, arrowPoints, cacheMovingElements, cacheSelectedElements, changeZoom, clampZoomLevel, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createForeignObject, createG, createSVG, createSelectionOuterG, createText, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, drawAbstractRoundRectangle, drawArrow, drawCircle, drawLine, drawRoundRectangle, fitViewport, getBoardRectangle, getElementHostBBox, getHitElements, getMovingElements, getRectangleByElements, getSelectedElements, getTemporaryElements, getViewBox, getViewportContainerRect, getViewportOrigination, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnContextChanged, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isDOMElement, isDOMNode, isFromScrolling, isFromViewportChange, isInPlaitBoard, isIntersectionElements, isNullOrUndefined, isSelectedElement, isSelectionMoving, isSetViewportOperation, normalizePoint, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setIsFromScrolling, setIsFromViewportChange, setSVGViewBox, setSelectionMoving, setViewport, shouldClear, shouldMerge, shouldSave, throttleRAF, toPoint, transformPoint, transformPoints, updateForeignObject, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withMoving, withSelection };
2636
+ export { 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_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, CLIP_BOARD_FORMAT_KEY, ELEMENT_TO_COMPONENT, FLUSHING, IS_APPLE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_SAFARI, IS_TEXT_EDITABLE, MAX_RADIUS, MERGING, NODE_TO_INDEX, NODE_TO_PARENT, NS, PATH_REFS, Path, PlaitBoard, PlaitBoardComponent, PlaitChildrenElement, PlaitElement, PlaitElementComponent, PlaitHistoryBoard, PlaitModule, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPointerType, PlaitToolbarComponent, Point, RectangleClient, SAVING, SCROLL_BAR_WIDTH, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, Selection, Transforms, Viewport, addMovingElements, addSelectedElement, arrowPoints, cacheMovingElements, cacheSelectedElements, changeZoom, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createForeignObject, createG, createSVG, createSelectionOuterG, createTestingBoard, createText, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, drawAbstractRoundRectangle, drawArrow, drawCircle, drawLine, drawRoundRectangle, fakeNodeWeakMap, fitViewport, getBoardRectangle, getElementHostBBox, getHitElements, getMovingElements, getRectangleByElements, getSelectedElements, getTemporaryElements, getViewBox, getViewportContainerRect, getViewportOrigination, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnContextChanged, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isDOMElement, isDOMNode, isFromScrolling, isFromViewportChange, isInPlaitBoard, isIntersectionElements, isNullOrUndefined, isSelectedElement, isSelectionMoving, isSetViewportOperation, normalizePoint, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setIsFromScrolling, setIsFromViewportChange, setSVGViewBox, setSelectionMoving, setViewport, shouldClear, shouldMerge, shouldSave, throttleRAF, toPoint, transformPoint, transformPoints, updateForeignObject, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withMoving, withSelection };
2557
2637
  //# sourceMappingURL=plait-core.mjs.map