@node-projects/web-component-designer 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { NodeType } from '../item/NodeType.js';
1
2
  export function inDesigner(element) {
2
3
  let node = element.getRootNode();
3
4
  if (node?.host?.localName == "node-projects-designer-canvas")
@@ -136,6 +137,8 @@ export function calculateOuterRect(designItems, designerCanvas) {
136
137
  let max = { x: Number.MIN_VALUE, y: Number.MIN_VALUE };
137
138
  let elementRect;
138
139
  for (let s of designItems) {
140
+ if (s.nodeType == NodeType.TextNode || s.nodeType == NodeType.Comment)
141
+ continue;
139
142
  elementRect = {
140
143
  x: designerCanvas.getNormalizedElementCoordinates(s.element).x,
141
144
  y: designerCanvas.getNormalizedElementCoordinates(s.element).y,
@@ -1,6 +1,7 @@
1
1
  import { IDesignItem } from "../../item/IDesignItem.js";
2
+ import { IRefactorService } from "./IRefactorService.js";
2
3
  import { IRefactoring } from "./IRefactoring.js";
3
- export declare class BindingsRefactorService {
4
+ export declare class BindingsRefactorService implements IRefactorService {
4
5
  getRefactorings(designItems: IDesignItem[]): IRefactoring[];
5
6
  refactor(refactoring: IRefactoring, oldValue: string, newValue: string): void;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  import { IDesignItem } from "../../item/IDesignItem.js";
2
+ import { IRefactorService } from "./IRefactorService.js";
2
3
  import { IRefactoring } from "./IRefactoring.js";
3
- export declare class TextRefactorService {
4
+ export declare class TextRefactorService implements IRefactorService {
4
5
  getRefactorings(designItems: IDesignItem[]): IRefactoring[];
5
6
  refactor(refactoring: IRefactoring, oldValue: string, newValue: string): void;
6
7
  }
@@ -486,7 +486,16 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
486
486
  }
487
487
  /* --- end IUiCommandHandler --- */
488
488
  handleSelectAll() {
489
- this.instanceServiceContainer.selectionService.setSelectedElements(Array.from(this.rootDesignItem.children()));
489
+ const selection = Array.from(this.rootDesignItem.children());
490
+ const primary = this.instanceServiceContainer.selectionService.primarySelection;
491
+ if (primary) {
492
+ const idx = selection.indexOf(primary);
493
+ if (idx >= 0) {
494
+ selection.splice(idx, 1);
495
+ selection.unshift(primary);
496
+ }
497
+ }
498
+ this.instanceServiceContainer.selectionService.setSelectedElements(selection);
490
499
  }
491
500
  async handleCopyCommand() {
492
501
  this._currentPasteOffset = this.pasteOffset;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "A UI designer for Polymer apps",
3
3
  "name": "@node-projects/web-component-designer",
4
- "version": "0.1.30",
4
+ "version": "0.1.31",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",