@plait/core 0.51.3 → 0.51.4

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 (61) hide show
  1. package/board/board.component.d.ts +1 -1
  2. package/esm2022/board/board.component.mjs +5 -5
  3. package/esm2022/core/children/children.component.mjs +5 -5
  4. package/esm2022/core/element/context-change.mjs +1 -1
  5. package/esm2022/core/element/element.component.mjs +5 -5
  6. package/esm2022/core/element/plugin-element.mjs +5 -5
  7. package/esm2022/core/island/island-base.component.mjs +9 -9
  8. package/esm2022/interfaces/board.mjs +1 -1
  9. package/esm2022/interfaces/element.mjs +1 -1
  10. package/esm2022/interfaces/node.mjs +1 -1
  11. package/esm2022/interfaces/operation.mjs +1 -1
  12. package/esm2022/interfaces/path-ref.mjs +1 -1
  13. package/esm2022/interfaces/path.mjs +1 -1
  14. package/esm2022/interfaces/rectangle-client.mjs +1 -1
  15. package/esm2022/interfaces/selection.mjs +1 -1
  16. package/esm2022/plugins/create-board.mjs +1 -1
  17. package/esm2022/plugins/with-board.mjs +1 -1
  18. package/esm2022/plugins/with-group.mjs +1 -1
  19. package/esm2022/plugins/with-hand.mjs +1 -1
  20. package/esm2022/plugins/with-history.mjs +1 -1
  21. package/esm2022/plugins/with-hotkey.mjs +1 -1
  22. package/esm2022/plugins/with-moving.mjs +1 -1
  23. package/esm2022/plugins/with-selection.mjs +1 -1
  24. package/esm2022/plugins/with-viewport.mjs +1 -1
  25. package/esm2022/services/image-context.service.mjs +3 -3
  26. package/esm2022/testing/fake-events/event-objects.mjs +4 -4
  27. package/esm2022/transforms/board.mjs +1 -1
  28. package/esm2022/transforms/general.mjs +1 -1
  29. package/esm2022/transforms/node.mjs +1 -1
  30. package/esm2022/transforms/selection.mjs +1 -1
  31. package/esm2022/utils/angle.mjs +36 -0
  32. package/esm2022/utils/board.mjs +1 -1
  33. package/esm2022/utils/clipboard/clipboard.mjs +1 -1
  34. package/esm2022/utils/clipboard/common.mjs +1 -1
  35. package/esm2022/utils/clipboard/data-transfer.mjs +1 -1
  36. package/esm2022/utils/clipboard/navigator-clipboard.mjs +1 -1
  37. package/esm2022/utils/common.mjs +1 -1
  38. package/esm2022/utils/dom/common.mjs +1 -1
  39. package/esm2022/utils/dom/foreign.mjs +1 -1
  40. package/esm2022/utils/drawing/line.mjs +1 -1
  41. package/esm2022/utils/drawing/rectangle.mjs +1 -1
  42. package/esm2022/utils/element.mjs +17 -5
  43. package/esm2022/utils/group.mjs +1 -1
  44. package/esm2022/utils/history.mjs +1 -1
  45. package/esm2022/utils/hotkeys.mjs +1 -1
  46. package/esm2022/utils/id-creator.mjs +1 -1
  47. package/esm2022/utils/index.mjs +2 -1
  48. package/esm2022/utils/math.mjs +11 -1
  49. package/esm2022/utils/reaction-manager.mjs +1 -1
  50. package/esm2022/utils/selected-element.mjs +1 -1
  51. package/esm2022/utils/selection.mjs +6 -2
  52. package/esm2022/utils/to-image.mjs +1 -1
  53. package/esm2022/utils/touch.mjs +1 -1
  54. package/esm2022/utils/tree.mjs +1 -1
  55. package/esm2022/utils/viewport.mjs +1 -1
  56. package/fesm2022/plait-core.mjs +94 -35
  57. package/fesm2022/plait-core.mjs.map +1 -1
  58. package/package.json +1 -1
  59. package/utils/angle.d.ts +5 -0
  60. package/utils/index.d.ts +1 -0
  61. package/utils/math.d.ts +8 -0
@@ -674,12 +674,12 @@ class PlaitPluginElementComponent {
674
674
  removeSelectedElement(this.board, this.element);
675
675
  (this.rootG || this.g).remove();
676
676
  }
677
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitPluginElementComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
678
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.8", type: PlaitPluginElementComponent, inputs: { context: "context" }, ngImport: i0 }); }
677
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitPluginElementComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
678
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: PlaitPluginElementComponent, inputs: { context: "context" }, ngImport: i0 }); }
679
679
  }
680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitPluginElementComponent, decorators: [{
680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitPluginElementComponent, decorators: [{
681
681
  type: Directive
682
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { context: [{
682
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { context: [{
683
683
  type: Input
684
684
  }] } });
685
685
  const ELEMENT_TO_COMPONENT = new WeakMap();
@@ -952,6 +952,16 @@ function toDomPrecision(v) {
952
952
  function toFixed(v) {
953
953
  return +v.toFixed(2);
954
954
  }
955
+ /**
956
+ * Whether two numbers numbers a and b are approximately equal.
957
+ *
958
+ * @param a - The first point.
959
+ * @param b - The second point.
960
+ * @public
961
+ */
962
+ function approximately(a, b, precision = 0.000001) {
963
+ return Math.abs(a - b) <= precision;
964
+ }
955
965
 
956
966
  function isInPlaitBoard(board, x, y) {
957
967
  const plaitBoardElement = PlaitBoard.getBoardContainer(board);
@@ -2688,6 +2698,10 @@ function createSelectionRectangleG(board) {
2688
2698
  });
2689
2699
  selectionRectangleG.classList.add(SELECTION_RECTANGLE_CLASS_NAME);
2690
2700
  PlaitBoard.getElementActiveHost(board).append(selectionRectangleG);
2701
+ const angle = getSelectionAngle(elements);
2702
+ if (angle) {
2703
+ setAngleForG(selectionRectangleG, RectangleClient.getCenterPoint(rectangle), angle);
2704
+ }
2691
2705
  return selectionRectangleG;
2692
2706
  }
2693
2707
  return null;
@@ -2892,6 +2906,40 @@ const removeGroup = (board) => {
2892
2906
  }
2893
2907
  };
2894
2908
 
2909
+ const rotatePoints = (points, centerPoint, angle) => {
2910
+ if (!angle) {
2911
+ angle = 0;
2912
+ }
2913
+ return points.map(point => {
2914
+ return rotate(point[0], point[1], centerPoint[0], centerPoint[1], angle);
2915
+ });
2916
+ };
2917
+ const getSelectionAngle = (elements) => {
2918
+ let angle = elements[0].angle || 0;
2919
+ elements.forEach(item => {
2920
+ if (item.angle !== angle && !approximately((item.angle % (Math.PI / 2)) - (angle % (Math.PI / 2)), 0)) {
2921
+ angle = 0;
2922
+ }
2923
+ });
2924
+ return angle;
2925
+ };
2926
+ const hasSameAngle = (elements) => {
2927
+ return !!getSelectionAngle(elements);
2928
+ };
2929
+ const getRotatedBoundingRectangle = (rectanglesCornerPoints, angle) => {
2930
+ let rectanglesFromOrigin = [];
2931
+ for (let i = 0; i < rectanglesCornerPoints.length; i++) {
2932
+ const cornerPoints = rectanglesCornerPoints[i];
2933
+ const invertCornerPointsFromOrigin = rotatePoints(cornerPoints, [0, 0], -angle);
2934
+ rectanglesFromOrigin.push(RectangleClient.getRectangleByPoints(invertCornerPointsFromOrigin));
2935
+ }
2936
+ const selectionRectangleFromOrigin = RectangleClient.getBoundingRectangle(rectanglesFromOrigin);
2937
+ const selectionCornerPoints = RectangleClient.getCornerPoints(selectionRectangleFromOrigin);
2938
+ const cornerPointsFromOrigin = rotatePoints(selectionCornerPoints, [0, 0], angle);
2939
+ const centerPoint = RectangleClient.getCenterPoint(RectangleClient.getRectangleByPoints(cornerPointsFromOrigin));
2940
+ return RectangleClient.getRectangleByPoints(rotatePoints(cornerPointsFromOrigin, centerPoint, -angle));
2941
+ };
2942
+
2895
2943
  const PlaitElement = {
2896
2944
  isRootElement(value) {
2897
2945
  const parent = NODE_TO_PARENT.get(value);
@@ -3081,11 +3129,13 @@ var Direction;
3081
3129
  })(Direction || (Direction = {}));
3082
3130
 
3083
3131
  function getRectangleByElements(board, elements, recursion) {
3084
- const rectangles = [];
3132
+ const rectanglesCornerPoints = [];
3085
3133
  const callback = (node) => {
3086
3134
  const nodeRectangle = board.getRectangle(node);
3087
3135
  if (nodeRectangle) {
3088
- rectangles.push(nodeRectangle);
3136
+ const cornerPoints = RectangleClient.getCornerPoints(nodeRectangle);
3137
+ const rotatedCornerPoints = rotatePoints(cornerPoints, RectangleClient.getCenterPoint(nodeRectangle), node.angle || 0);
3138
+ rectanglesCornerPoints.push(rotatedCornerPoints);
3089
3139
  }
3090
3140
  else {
3091
3141
  console.error(`can not get rectangle of element:`, node);
@@ -3099,8 +3149,17 @@ function getRectangleByElements(board, elements, recursion) {
3099
3149
  callback(element);
3100
3150
  }
3101
3151
  });
3102
- if (rectangles.length > 0) {
3103
- return RectangleClient.getBoundingRectangle(rectangles);
3152
+ if (rectanglesCornerPoints.length > 0) {
3153
+ if (hasSameAngle(elements)) {
3154
+ const angle = getSelectionAngle(elements);
3155
+ return getRotatedBoundingRectangle(rectanglesCornerPoints, angle);
3156
+ }
3157
+ else {
3158
+ const flatCornerPoints = rectanglesCornerPoints.reduce((acc, val) => {
3159
+ return acc.concat(val);
3160
+ }, []);
3161
+ return RectangleClient.getRectangleByPoints(flatCornerPoints);
3162
+ }
3104
3163
  }
3105
3164
  else {
3106
3165
  return {
@@ -4377,17 +4436,17 @@ class PlaitIslandBaseComponent {
4377
4436
  markForCheck() {
4378
4437
  this.cdr.markForCheck();
4379
4438
  }
4380
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitIslandBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4381
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.8", type: PlaitIslandBaseComponent, host: { classAttribute: "plait-island-container" }, ngImport: i0 }); }
4439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitIslandBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4440
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: PlaitIslandBaseComponent, host: { classAttribute: "plait-island-container" }, ngImport: i0 }); }
4382
4441
  }
4383
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitIslandBaseComponent, decorators: [{
4442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitIslandBaseComponent, decorators: [{
4384
4443
  type: Directive,
4385
4444
  args: [{
4386
4445
  host: {
4387
4446
  class: 'plait-island-container'
4388
4447
  }
4389
4448
  }]
4390
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
4449
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
4391
4450
  class PlaitIslandPopoverBaseComponent {
4392
4451
  constructor(cdr) {
4393
4452
  this.cdr = cdr;
@@ -4413,17 +4472,17 @@ class PlaitIslandPopoverBaseComponent {
4413
4472
  this.subscription?.unsubscribe();
4414
4473
  this.islandOnDestroy();
4415
4474
  }
4416
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitIslandPopoverBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4417
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.8", type: PlaitIslandPopoverBaseComponent, inputs: { board: "board" }, host: { classAttribute: "plait-island-popover-container" }, ngImport: i0 }); }
4475
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitIslandPopoverBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4476
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: PlaitIslandPopoverBaseComponent, inputs: { board: "board" }, host: { classAttribute: "plait-island-popover-container" }, ngImport: i0 }); }
4418
4477
  }
4419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitIslandPopoverBaseComponent, decorators: [{
4478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitIslandPopoverBaseComponent, decorators: [{
4420
4479
  type: Directive,
4421
4480
  args: [{
4422
4481
  host: {
4423
4482
  class: 'plait-island-popover-container'
4424
4483
  }
4425
4484
  }]
4426
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { board: [{
4485
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { board: [{
4427
4486
  type: Input
4428
4487
  }] } });
4429
4488
  const hasOnBoardChange = (value) => {
@@ -4511,10 +4570,10 @@ class PlaitContextService {
4511
4570
  removeUploadingFile(fileEntry) {
4512
4571
  this.uploadingFiles = this.uploadingFiles.filter(file => file.url !== fileEntry.url);
4513
4572
  }
4514
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4515
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitContextService }); }
4573
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4574
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitContextService }); }
4516
4575
  }
4517
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitContextService, decorators: [{
4576
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitContextService, decorators: [{
4518
4577
  type: Injectable
4519
4578
  }] });
4520
4579
 
@@ -4591,10 +4650,10 @@ class PlaitElementComponent {
4591
4650
  ngOnDestroy() {
4592
4651
  this.board.destroyElement(this.getContext());
4593
4652
  }
4594
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitElementComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
4595
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: PlaitElementComponent, isStandalone: true, 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 }); }
4653
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitElementComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
4654
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: PlaitElementComponent, isStandalone: true, 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 }); }
4596
4655
  }
4597
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitElementComponent, decorators: [{
4656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitElementComponent, decorators: [{
4598
4657
  type: Component,
4599
4658
  args: [{
4600
4659
  selector: 'plait-element',
@@ -4602,7 +4661,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImpor
4602
4661
  changeDetection: ChangeDetectionStrategy.OnPush,
4603
4662
  standalone: true
4604
4663
  }]
4605
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ViewContainerRef }]; }, propDecorators: { index: [{
4664
+ }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ViewContainerRef }], propDecorators: { index: [{
4606
4665
  type: Input
4607
4666
  }], element: [{
4608
4667
  type: Input
@@ -4630,8 +4689,8 @@ class PlaitChildrenElementComponent {
4630
4689
  this.parentG = PlaitBoard.getElementHost(this.board);
4631
4690
  }
4632
4691
  }
4633
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitChildrenElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4634
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: PlaitChildrenElementComponent, isStandalone: true, selector: "plait-children", inputs: { board: "board", parent: "parent", effect: "effect", parentG: "parentG" }, ngImport: i0, template: `
4692
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitChildrenElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4693
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: PlaitChildrenElementComponent, isStandalone: true, selector: "plait-children", inputs: { board: "board", parent: "parent", effect: "effect", parentG: "parentG" }, ngImport: i0, template: `
4635
4694
  <plait-element
4636
4695
  *ngFor="let item of parent.children; let index = index; trackBy: trackBy"
4637
4696
  [index]="index"
@@ -4643,7 +4702,7 @@ class PlaitChildrenElementComponent {
4643
4702
  ></plait-element>
4644
4703
  `, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PlaitElementComponent, selector: "plait-element", inputs: ["index", "element", "parent", "board", "effect", "parentG"] }] }); }
4645
4704
  }
4646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitChildrenElementComponent, decorators: [{
4705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitChildrenElementComponent, decorators: [{
4647
4706
  type: Component,
4648
4707
  args: [{
4649
4708
  selector: 'plait-children',
@@ -4661,7 +4720,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImpor
4661
4720
  standalone: true,
4662
4721
  imports: [NgFor, PlaitElementComponent]
4663
4722
  }]
4664
- }], ctorParameters: function () { return []; }, propDecorators: { board: [{
4723
+ }], ctorParameters: () => [], propDecorators: { board: [{
4665
4724
  type: Input
4666
4725
  }], parent: [{
4667
4726
  type: Input
@@ -5033,8 +5092,8 @@ class PlaitBoardComponent {
5033
5092
  this.updateIslands();
5034
5093
  });
5035
5094
  }
5036
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitBoardComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
5037
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.8", type: PlaitBoardComponent, isStandalone: true, selector: "plait-board", inputs: { plaitValue: "plaitValue", plaitViewport: "plaitViewport", plaitPlugins: "plaitPlugins", plaitOptions: "plaitOptions", plaitTheme: "plaitTheme" }, outputs: { plaitChange: "plaitChange", plaitBoardInitialized: "plaitBoardInitialized" }, host: { properties: { "class": "this.hostClass", "class.readonly": "this.readonly", "class.focused": "this.isFocused", "class.disabled-scroll": "this.disabledScrollOnNonFocus" } }, providers: [PlaitContextService], queries: [{ propertyName: "islands", predicate: PlaitIslandBaseComponent, 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: `
5095
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitBoardComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
5096
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: PlaitBoardComponent, isStandalone: true, selector: "plait-board", inputs: { plaitValue: "plaitValue", plaitViewport: "plaitViewport", plaitPlugins: "plaitPlugins", plaitOptions: "plaitOptions", plaitTheme: "plaitTheme" }, outputs: { plaitChange: "plaitChange", plaitBoardInitialized: "plaitBoardInitialized" }, host: { properties: { "class": "this.hostClass", "class.readonly": "this.readonly", "class.focused": "this.isFocused", "class.disabled-scroll": "this.disabledScrollOnNonFocus" } }, providers: [PlaitContextService], queries: [{ propertyName: "islands", predicate: PlaitIslandBaseComponent, 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: `
5038
5097
  <div class="viewport-container" #viewportContainer>
5039
5098
  <svg #svg width="100%" height="100%" style="position: relative;" class="board-host-svg">
5040
5099
  <g class="element-host"></g>
@@ -5046,7 +5105,7 @@ class PlaitBoardComponent {
5046
5105
  <ng-content></ng-content>
5047
5106
  `, isInline: true, dependencies: [{ kind: "component", type: PlaitChildrenElementComponent, selector: "plait-children", inputs: ["board", "parent", "effect", "parentG"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5048
5107
  }
5049
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImport: i0, type: PlaitBoardComponent, decorators: [{
5108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: PlaitBoardComponent, decorators: [{
5050
5109
  type: Component,
5051
5110
  args: [{
5052
5111
  selector: 'plait-board',
@@ -5066,7 +5125,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.8", ngImpor
5066
5125
  standalone: true,
5067
5126
  imports: [PlaitChildrenElementComponent]
5068
5127
  }]
5069
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { plaitValue: [{
5128
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { plaitValue: [{
5070
5129
  type: Input
5071
5130
  }], plaitViewport: [{
5072
5131
  type: Input
@@ -5155,7 +5214,7 @@ function createMouseEvent(type, clientX = 0, clientY = 0, offsetX = 1, offsetY =
5155
5214
  const event = new MouseEvent(type, {
5156
5215
  bubbles: true,
5157
5216
  cancelable: true,
5158
- composed: true,
5217
+ composed: true, // Required for shadow DOM events.
5159
5218
  view: window,
5160
5219
  detail: 0,
5161
5220
  relatedTarget: null,
@@ -5194,7 +5253,7 @@ function createPointerEvent(type, clientX = 0, clientY = 0, offsetX, offsetY, op
5194
5253
  const event = new PointerEvent(type, {
5195
5254
  bubbles: true,
5196
5255
  cancelable: true,
5197
- composed: true,
5256
+ composed: true, // Required for shadow DOM events.
5198
5257
  view: window,
5199
5258
  clientX,
5200
5259
  clientY,
@@ -5234,7 +5293,7 @@ function createKeyboardEvent(type, keyCode = 0, key = '', modifiers = {}) {
5234
5293
  return new KeyboardEvent(type, {
5235
5294
  bubbles: true,
5236
5295
  cancelable: true,
5237
- composed: true,
5296
+ composed: true, // Required for shadow DOM events.
5238
5297
  view: window,
5239
5298
  keyCode: keyCode,
5240
5299
  key: key,
@@ -5271,5 +5330,5 @@ function createModModifierKeys() {
5271
5330
  * Generated bundle index. Do not edit.
5272
5331
  */
5273
5332
 
5274
- export { A, ACTIVE_MOVING_CLASS_NAME, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, BOARD_TO_AFTER_CHANGE, BOARD_TO_COMPONENT, BOARD_TO_ELEMENT_HOST, BOARD_TO_HOST, BOARD_TO_IS_SELECTION_MOVING, BOARD_TO_MOVING_ELEMENT, BOARD_TO_MOVING_POINT, BOARD_TO_MOVING_POINT_IN_BOARD, BOARD_TO_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_COMPONENT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FLUSHING, FOUR, G, H, HIT_DISTANCE_BUFFER, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_MAC, IS_SAFARI, IS_TEXT_EDITABLE, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MERGING, META, MUTE, N, NINE, NODE_TO_INDEX, NODE_TO_PARENT, NS, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PATH_REFS, PAUSE, PERIOD, PLUS_SIGN, POINTER_BUTTON, PRESS_AND_MOVE_BUFFER, PRINT_SCREEN, Path, PlaitBoard, PlaitBoardComponent, PlaitChildrenElementComponent, PlaitContextService, PlaitElement, PlaitElementComponent, PlaitGroupElement, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RIGHT_ARROW, RectangleClient, ResizeCursorClass, RetroThemeColor, RgbaToHEX, S, SAVING, SCROLL_BAR_WIDTH, SCROLL_LOCK, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, WritableClipboardType, X, Y, Z, ZERO, addClipboardContext, addGroup, addSelectedElement, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, calcNewViewBox, canAddGroup, canRemoveGroup, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createClipboardContext, createFakeEvent, createForeignObject, createG, createGroup, createGroupRectangleG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createSelectionRectangleG, createTestingBoard, createText, createTouchEvent, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downloadImage, drawArrow, drawBezierPath, drawCircle, drawLine, drawLinearPath, drawRectangle, drawRoundRectangle, fakeNodeWeakMap, findElements, getBoardRectangle, getClipboardData, getClipboardFromHtml, getDataTransferClipboard, getDataTransferClipboardText, getElementById, getElementHostBBox, getElementsInGroup, getElementsInGroupByElement, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMovingElements, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByElements, getRectangleByGroup, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getTargetElements, getTemporaryElements, getTemporaryRef, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hasSelectedElementsInSameGroup, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isContextmenu, isDOMElement, isDOMNode, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, nonGroupInHighestSelectedElements, normalizePoint, preventTouchMove, removeGroup, removeMovingElements, removeSelectedElement, rotate, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, stripHtml, temporaryDisableSelection, throttleRAF, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withMoving, withOptions, withSelection };
5333
+ export { A, ACTIVE_MOVING_CLASS_NAME, ACTIVE_STROKE_WIDTH, ALT, APOSTROPHE, ATTACHED_ELEMENT_CLASS_NAME, AT_SIGN, B, BACKSLASH, BACKSPACE, BOARD_TO_AFTER_CHANGE, BOARD_TO_COMPONENT, BOARD_TO_ELEMENT_HOST, BOARD_TO_HOST, BOARD_TO_IS_SELECTION_MOVING, BOARD_TO_MOVING_ELEMENT, BOARD_TO_MOVING_POINT, BOARD_TO_MOVING_POINT_IN_BOARD, BOARD_TO_ON_CHANGE, BOARD_TO_ROUGH_SVG, BOARD_TO_SELECTED_ELEMENT, BOARD_TO_TEMPORARY_ELEMENTS, BOARD_TO_TOUCH_REF, BOARD_TO_VIEWPORT_ORIGINATION, BoardTransforms, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, ColorfulThemeColor, CoreTransforms, CursorClass, D, DASH, DELETE, DOWN_ARROW, DarkThemeColor, DefaultThemeColor, Direction, E, EIGHT, ELEMENT_TO_COMPONENT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FLUSHING, FOUR, G, H, HIT_DISTANCE_BUFFER, HOME, HOST_CLASS_NAME, I, INSERT, IS_APPLE, IS_BOARD_CACHE, IS_CHROME, IS_CHROME_LEGACY, IS_DRAGGING, IS_EDGE_LEGACY, IS_FIREFOX, IS_IOS, IS_MAC, IS_SAFARI, IS_TEXT_EDITABLE, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, MAX_RADIUS, MERGING, META, MUTE, N, NINE, NODE_TO_INDEX, NODE_TO_PARENT, NS, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PATH_REFS, PAUSE, PERIOD, PLUS_SIGN, POINTER_BUTTON, PRESS_AND_MOVE_BUFFER, PRINT_SCREEN, Path, PlaitBoard, PlaitBoardComponent, PlaitChildrenElementComponent, PlaitContextService, PlaitElement, PlaitElementComponent, PlaitGroupElement, PlaitHistoryBoard, PlaitIslandBaseComponent, PlaitIslandPopoverBaseComponent, PlaitNode, PlaitOperation, PlaitPluginElementComponent, PlaitPluginKey, PlaitPointerType, Point, Q, QUESTION_MARK, R, RIGHT_ARROW, RectangleClient, ResizeCursorClass, RetroThemeColor, RgbaToHEX, S, SAVING, SCROLL_BAR_WIDTH, SCROLL_LOCK, SELECTION_BORDER_COLOR, SELECTION_FILL_COLOR, SELECTION_RECTANGLE_CLASS_NAME, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SPACE, Selection, SoftThemeColor, StarryThemeColor, T, TAB, THREE, TILDE, TWO, ThemeColorMode, ThemeColors, Transforms, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, Viewport, W, WritableClipboardType, X, Y, Z, ZERO, addClipboardContext, addGroup, addSelectedElement, approximately, arrowPoints, buildPlaitHtml, cacheMovingElements, cacheSelectedElements, calcNewViewBox, canAddGroup, canRemoveGroup, catmullRomFitting, clampZoomLevel, clearNodeWeakMap, clearSelectedElement, clearSelectionMoving, clearViewportOrigination, createClipboardContext, createFakeEvent, createForeignObject, createG, createGroup, createGroupRectangleG, createKeyboardEvent, createMask, createModModifierKeys, createMouseEvent, createPath, createPointerEvent, createRect, createSVG, createSelectionRectangleG, createTestingBoard, createText, createTouchEvent, debounce, deleteTemporaryElements, depthFirstRecursion, distanceBetweenPointAndPoint, distanceBetweenPointAndRectangle, distanceBetweenPointAndSegment, distanceBetweenPointAndSegments, downloadImage, drawArrow, drawBezierPath, drawCircle, drawLine, drawLinearPath, drawRectangle, drawRoundRectangle, fakeNodeWeakMap, findElements, getBoardRectangle, getClipboardData, getClipboardFromHtml, getDataTransferClipboard, getDataTransferClipboardText, getElementById, getElementHostBBox, getElementsInGroup, getElementsInGroupByElement, getEllipseTangentSlope, getGroupByElement, getHighestGroup, getHighestSelectedElements, getHighestSelectedGroup, getHighestSelectedGroups, getHitElementByPoint, getHitElementsBySelection, getHitSelectedElements, getIsRecursionFunc, getMovingElements, getNearestPointBetweenPointAndSegment, getNearestPointBetweenPointAndSegments, getProbablySupportsClipboardRead, getProbablySupportsClipboardWrite, getProbablySupportsClipboardWriteText, getRealScrollBarWidth, getRectangleByElements, getRectangleByGroup, getRotatedBoundingRectangle, getSelectedElements, getSelectedGroups, getSelectedIsolatedElements, getSelectionAngle, getTargetElements, getTemporaryElements, getTemporaryRef, getVectorFromPointAndSlope, getViewBox, getViewBoxCenterPoint, getViewportContainerRect, getViewportOrigination, handleTouchTarget, hasBeforeContextChange, hasInputOrTextareaTarget, hasOnBoardChange, hasOnContextChanged, hasSameAngle, hasSelectedElementsInSameGroup, hotkeys, idCreator, initializeViewBox, initializeViewportContainer, initializeViewportOffset, inverse, isContextmenu, isDOMElement, isDOMNode, isDragging, isFromScrolling, isFromViewportChange, isHandleSelection, isInPlaitBoard, isLineHitLine, isMainPointer, isMovingElements, isNullOrUndefined, isPointInEllipse, isPointInPolygon, isPointInRoundRectangle, isPolylineHitRectangle, isPreventTouchMove, isSecondaryPointer, isSelectedAllElementsInGroup, isSelectedElement, isSelectedElementOrGroup, isSelectionMoving, isSetSelectionOperation, isSetViewportOperation, nonGroupInHighestSelectedElements, normalizePoint, preventTouchMove, removeGroup, removeMovingElements, removeSelectedElement, rotate, rotatePoints, scrollToRectangle, setAngleForG, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setDragging, setIsFromScrolling, setIsFromViewportChange, setPathStrokeLinecap, setSVGViewBox, setSelectionMoving, setStrokeLinecap, shouldClear, shouldMerge, shouldSave, stripHtml, temporaryDisableSelection, throttleRAF, toDomPrecision, toFixed, toHostPoint, toHostPointFromViewBoxPoint, toImage, toScreenPointFromHostPoint, toViewBoxPoint, toViewBoxPoints, updateForeignObject, updateForeignObjectWidth, updatePoints, updateViewportByScrolling, updateViewportContainerScroll, updateViewportOffset, updateViewportOrigination, withArrowMoving, withMoving, withOptions, withSelection };
5275
5334
  //# sourceMappingURL=plait-core.mjs.map