@node-projects/web-component-designer 0.1.99 → 0.1.101

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.
@@ -14,12 +14,14 @@ export class CanvasExtension extends AbstractExtension {
14
14
  const top = Number.parseFloat(computedStyle.marginTop.replace('px', ''));
15
15
  const right = Number.parseFloat(computedStyle.marginRight.replace('px', ''));
16
16
  const bottom = Number.parseFloat(computedStyle.marginBottom.replace('px', ''));
17
- if (this._valuesHaveChanges(left, top, right, bottom, itemRect.x, itemRect.y, itemRect.width, itemRect.height)) {
18
- this._removeAllOverlays();
19
- this._drawRect(itemRect.x - left, itemRect.y - top, left + itemRect.width + right, top, 'svg-margin');
20
- this._drawRect(itemRect.x - left, itemRect.y, left, itemRect.height, 'svg-margin');
21
- this._drawRect(itemRect.x + itemRect.width, itemRect.y, right, itemRect.height, 'svg-margin');
22
- this._drawRect(itemRect.x - left, itemRect.y + itemRect.height, left + itemRect.width + right, bottom, 'svg-margin');
17
+ if (!isNaN(left) && !isNaN(top) && !isNaN(right) && !isNaN(bottom)) {
18
+ if (this._valuesHaveChanges(left, top, right, bottom, itemRect.x, itemRect.y, itemRect.width, itemRect.height)) {
19
+ this._removeAllOverlays();
20
+ this._drawRect(itemRect.x - left, itemRect.y - top, left + itemRect.width + right, top, 'svg-margin');
21
+ this._drawRect(itemRect.x - left, itemRect.y, left, itemRect.height, 'svg-margin');
22
+ this._drawRect(itemRect.x + itemRect.width, itemRect.y, right, itemRect.height, 'svg-margin');
23
+ this._drawRect(itemRect.x - left, itemRect.y + itemRect.height, left + itemRect.width + right, bottom, 'svg-margin');
24
+ }
23
25
  }
24
26
  }
25
27
  }
@@ -8,7 +8,7 @@ export class PanTool {
8
8
  designerCanvas.captureActiveTool(this);
9
9
  break;
10
10
  case EventNames.PointerMove:
11
- if (event.buttons == 1) {
11
+ if (event.buttons == 1 || event.buttons == 4) {
12
12
  designerCanvas.canvasOffset = { x: designerCanvas.canvasOffset.x + +event.movementX / designerCanvas.zoomFactor, y: designerCanvas.canvasOffset.y + event.movementY / designerCanvas.zoomFactor };
13
13
  }
14
14
  break;
@@ -122,4 +122,4 @@ export class PropertyGrid extends BaseCustomWebComponentLazyAppend {
122
122
  });
123
123
  }
124
124
  }
125
- customElements.define('node-projects-property-grid', PropertyGrid);
125
+ customElements.define('node-projects-web-component-designer-property-grid', PropertyGrid);
@@ -53,7 +53,7 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
53
53
  <div title="textContent" id="contentRect" style="width: 7px; height: 7px; border: 1px solid white;"></div>
54
54
  <span class="desc">Content:</span><input type="text" id="content">
55
55
  </div>
56
- <node-projects-property-grid id="pg"></node-projects-property-grid>`;
56
+ <node-projects-web-component-designer-property-grid id="pg"></node-projects-web-component-designer-property-grid>`;
57
57
  _type;
58
58
  _id;
59
59
  _content;
@@ -167,4 +167,4 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
167
167
  });
168
168
  }
169
169
  }
170
- customElements.define('node-projects-property-grid-with-header', PropertyGridWithHeader);
170
+ customElements.define('node-projects-web-component-designer-property-grid-with-header', PropertyGridWithHeader);
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "description": "A UI designer for Polymer apps",
3
- "name": "@node-projects/web-component-designer",
4
- "version": "0.1.99",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "author": "jochen.kuehner@gmx.de",
8
- "license": "MIT",
9
- "scripts": {
10
- "tsc": "tsc",
11
- "build": "tsc",
12
- "prepublishOnly": "npm run build"
13
- },
14
- "dependencies": {
15
- "@node-projects/base-custom-webcomponent": ">=0.23.0"
16
- },
17
- "devDependencies": {
18
- "mdn-data": "^2.4.2"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/node-projects/web-component-designer.git"
23
- }
24
- }
1
+ {
2
+ "description": "A UI designer for Polymer apps",
3
+ "name": "@node-projects/web-component-designer",
4
+ "version": "0.1.101",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "author": "jochen.kuehner@gmx.de",
8
+ "license": "MIT",
9
+ "scripts": {
10
+ "tsc": "tsc",
11
+ "build": "tsc",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "dependencies": {
15
+ "@node-projects/base-custom-webcomponent": ">=0.23.0"
16
+ },
17
+ "devDependencies": {
18
+ "mdn-data": "^2.4.2"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/node-projects/web-component-designer.git"
23
+ }
24
+ }