@operato/property-panel 9.2.22 → 9.2.25

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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/property-panel",
3
3
  "description": "Webcomponent property-panel following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "9.2.22",
5
+ "version": "9.2.25",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -63,9 +63,9 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@material/web": "^2.0.0",
66
- "@operato/attachment": "^9.2.22",
66
+ "@operato/attachment": "^9.2.25",
67
67
  "@operato/i18n": "^9.2.12",
68
- "@operato/input": "^9.2.12",
68
+ "@operato/input": "^9.2.25",
69
69
  "@operato/styles": "^9.2.12",
70
70
  "@operato/utils": "^9.2.12",
71
71
  "lit": "^3.1.2"
@@ -103,5 +103,5 @@
103
103
  "prettier --write"
104
104
  ]
105
105
  },
106
- "gitHead": "8c81a1ba726cc7e2305c4fedfba35e1f14f8526c"
106
+ "gitHead": "f88ec1fba64baa66694c72275b3ef8482d2a3968"
107
107
  }
@@ -94,7 +94,10 @@ export class PropertyShapes extends AbstractProperty {
94
94
  <label> <md-icon>height</md-icon><ox-i18n msgid="label.height">height</ox-i18n> </label>
95
95
  <input type="number" value-key="bounds.height" .value=${String(height)} />
96
96
 
97
- ${this.selected.length && this.selected[0].isRootModel()
97
+ ${this.selected.length &&
98
+ this.selected[0] &&
99
+ typeof this.selected[0].isRootModel === 'function' &&
100
+ this.selected[0].isRootModel()
98
101
  ? html``
99
102
  : html`
100
103
  <label class="rotate">
@@ -263,7 +266,10 @@ export class PropertyShapes extends AbstractProperty {
263
266
  </fieldset>
264
267
  `
265
268
  : html``}
266
- ${this.selected.length && this.selected[0].isRootModel()
269
+ ${this.selected.length &&
270
+ this.selected[0] &&
271
+ typeof this.selected[0].isRootModel === 'function' &&
272
+ this.selected[0].isRootModel()
267
273
  ? html`
268
274
  <fieldset class="icon-label">
269
275
  <legend>
@@ -334,33 +340,44 @@ export class PropertyShapes extends AbstractProperty {
334
340
 
335
341
  _hasTextProperty(selected: Component[]) {
336
342
  for (let i = 0; i < selected.length; i++) {
337
- if (!selected[i].hasTextProperty) return false
343
+ if (!selected[i] || !selected[i].hasTextProperty) return false
338
344
  }
339
345
 
340
346
  return true
341
347
  }
342
348
 
343
349
  _hasProperties(selected: Component[]) {
344
- if (!selected || selected.length == 0 || (selected[0] && selected[0].isLayer && selected[0].isLayer())) return false
350
+ if (
351
+ !selected ||
352
+ selected.length == 0 ||
353
+ (selected[0] && typeof selected[0].isLayer === 'function' && selected[0].isLayer())
354
+ )
355
+ return false
345
356
 
346
357
  return true
347
358
  }
348
359
 
349
360
  _isIdentifiable(selected: Component[]) {
350
- if (!selected || selected.length == 0 || selected.length > 1 || (selected[0].isLayer && selected[0].isLayer()))
361
+ if (
362
+ !selected ||
363
+ selected.length == 0 ||
364
+ selected.length > 1 ||
365
+ !selected[0] ||
366
+ (typeof selected[0].isLayer === 'function' && selected[0].isLayer())
367
+ )
351
368
  return false
352
369
 
353
370
  return true
354
371
  }
355
372
 
356
373
  _isClassIdentifiable(selected: Component[]) {
357
- if (!selected || (selected[0] && selected[0].isLayer())) return false
374
+ if (!selected || (selected[0] && typeof selected[0].isLayer === 'function' && selected[0].isLayer())) return false
358
375
 
359
376
  return true
360
377
  }
361
378
 
362
379
  _isLine(selected: Component[]) {
363
- if (!selected || !(selected[0] && selected[0].isLine())) return false
380
+ if (!selected || !(selected[0] && typeof selected[0].isLine === 'function' && selected[0].isLine())) return false
364
381
 
365
382
  return true
366
383
  }
@@ -372,7 +389,9 @@ export class PropertyShapes extends AbstractProperty {
372
389
  }
373
390
 
374
391
  _isPositionable(selected: Component[]) {
375
- const s = selected?.[0]
376
- return !!(s && typeof s.isPositionable === 'function' && s.isPositionable())
392
+ if (!selected || !(selected[0] && typeof selected[0].isPositionable === 'function' && selected[0].isPositionable()))
393
+ return false
394
+
395
+ return true
377
396
  }
378
397
  }