@design.estate/dees-wcctools 1.0.95 → 1.0.97

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.
@@ -43341,24 +43341,29 @@ var WccProperties = class extends DeesElement {
43341
43341
  }
43342
43342
  async findElementRecursively(container, elementClass, maxDepth = 5) {
43343
43343
  if (maxDepth <= 0) return null;
43344
- for (const child of Array.from(container.children)) {
43345
- if (child instanceof elementClass) {
43346
- return child;
43344
+ try {
43345
+ for (const child of Array.from(container.children)) {
43346
+ if (child instanceof elementClass) {
43347
+ return child;
43348
+ }
43347
43349
  }
43348
- }
43349
- for (const child of Array.from(container.children)) {
43350
- if (child.shadowRoot) {
43351
- const found2 = await this.findElementRecursively(child.shadowRoot, elementClass, maxDepth - 1);
43352
- if (found2) return found2;
43350
+ for (const child of Array.from(container.children)) {
43351
+ const found = await this.findElementRecursively(child, elementClass, maxDepth - 1);
43352
+ if (found) return found;
43353
+ if (child.shadowRoot) {
43354
+ const shadowFound = await this.findElementRecursively(child.shadowRoot, elementClass, maxDepth - 1);
43355
+ if (shadowFound) return shadowFound;
43356
+ }
43353
43357
  }
43354
- const found = await this.findElementRecursively(child, elementClass, maxDepth - 1);
43355
- if (found) return found;
43358
+ } catch (error) {
43359
+ console.error("Error in findElementRecursively:", error);
43356
43360
  }
43357
43361
  return null;
43358
43362
  }
43359
43363
  async createProperties() {
43360
43364
  console.log("creating properties for:");
43361
43365
  console.log(this.selectedItem);
43366
+ this.warning = null;
43362
43367
  const isEnumeration = (propertyArg) => {
43363
43368
  const keys2 = Object.keys(propertyArg.type);
43364
43369
  const values = [];
@@ -43410,14 +43415,19 @@ var WccProperties = class extends DeesElement {
43410
43415
  let retries = 0;
43411
43416
  while (!firstFoundInstantiatedElement && retries < 5) {
43412
43417
  await new Promise((resolve2) => setTimeout(resolve2, 200));
43413
- firstFoundInstantiatedElement = await this.findElementRecursively(
43414
- viewport,
43415
- this.selectedItem
43416
- );
43418
+ try {
43419
+ firstFoundInstantiatedElement = await this.findElementRecursively(
43420
+ viewport,
43421
+ this.selectedItem
43422
+ );
43423
+ } catch (error) {
43424
+ console.error("Error during element search retry:", error);
43425
+ }
43417
43426
  retries++;
43418
43427
  }
43419
43428
  if (!firstFoundInstantiatedElement) {
43420
43429
  this.warning = `no first instantiated element found for >>${anonItem.name}<< after ${retries} retries`;
43430
+ this.propertyContent = [];
43421
43431
  return;
43422
43432
  }
43423
43433
  const classProperties = anonItem.elementProperties;
@@ -43431,47 +43441,48 @@ var WccProperties = class extends DeesElement {
43431
43441
  if (key2 === "goBright" || key2 === "domtools") {
43432
43442
  continue;
43433
43443
  }
43434
- const property = classProperties.get(key2);
43435
- const propertyTypeString = await determinePropertyType(property);
43436
- propertyArray.push(
43437
- x`
43444
+ try {
43445
+ const property = classProperties.get(key2);
43446
+ const propertyTypeString = await determinePropertyType(property);
43447
+ propertyArray.push(
43448
+ x`
43438
43449
  <div class="property">
43439
43450
  ${key2} / ${propertyTypeString}<br />
43440
43451
  ${(() => {
43441
- switch (propertyTypeString) {
43442
- case "Boolean":
43443
- return x`<input
43452
+ switch (propertyTypeString) {
43453
+ case "Boolean":
43454
+ return x`<input
43444
43455
  type="checkbox"
43445
43456
  ?checked=${firstFoundInstantiatedElement[key2]}
43446
43457
  @input="${(eventArg) => {
43447
- firstFoundInstantiatedElement[key2] = eventArg.target.checked;
43448
- }}"
43458
+ firstFoundInstantiatedElement[key2] = eventArg.target.checked;
43459
+ }}"
43449
43460
  />`;
43450
- case "String":
43451
- return x`<input
43461
+ case "String":
43462
+ return x`<input
43452
43463
  type="text"
43453
43464
  value=${firstFoundInstantiatedElement[key2]}
43454
43465
  @input="${(eventArg) => {
43455
- firstFoundInstantiatedElement[key2] = eventArg.target.value;
43456
- }}"
43466
+ firstFoundInstantiatedElement[key2] = eventArg.target.value;
43467
+ }}"
43457
43468
  />`;
43458
- case "Number":
43459
- return x`<input
43469
+ case "Number":
43470
+ return x`<input
43460
43471
  type="number"
43461
43472
  value=${firstFoundInstantiatedElement[key2]}
43462
43473
  @input="${(eventArg) => {
43463
- firstFoundInstantiatedElement[key2] = eventArg.target.value;
43464
- }}"
43474
+ firstFoundInstantiatedElement[key2] = eventArg.target.value;
43475
+ }}"
43465
43476
  />`;
43466
- case "Enum":
43467
- const enumValues = getEnumValues(property);
43468
- return x`<select
43477
+ case "Enum":
43478
+ const enumValues = getEnumValues(property);
43479
+ return x`<select
43469
43480
  @change="${(eventArg) => {
43470
- firstFoundInstantiatedElement[key2] = eventArg.target.value;
43471
- }}"
43481
+ firstFoundInstantiatedElement[key2] = eventArg.target.value;
43482
+ }}"
43472
43483
  >
43473
43484
  ${enumValues.map((valueArg) => {
43474
- return x`
43485
+ return x`
43475
43486
  <option
43476
43487
  ?selected=${valueArg === firstFoundInstantiatedElement[key2] ? true : false}
43477
43488
  name="${valueArg}"
@@ -43479,13 +43490,16 @@ var WccProperties = class extends DeesElement {
43479
43490
  ${valueArg}
43480
43491
  </option>
43481
43492
  `;
43482
- })}
43493
+ })}
43483
43494
  </select>`;
43484
- }
43485
- })()}
43495
+ }
43496
+ })()}
43486
43497
  </div>
43487
43498
  `
43488
- );
43499
+ );
43500
+ } catch (error) {
43501
+ console.error(`Error processing property ${key2}:`, error);
43502
+ }
43489
43503
  }
43490
43504
  this.propertyContent = propertyArray;
43491
43505
  } else {
@@ -43505,7 +43519,12 @@ var WccProperties = class extends DeesElement {
43505
43519
  this.dashboardRef.buildUrl();
43506
43520
  }
43507
43521
  async scheduleUpdate() {
43508
- await this.createProperties();
43522
+ try {
43523
+ await this.createProperties();
43524
+ } catch (error) {
43525
+ console.error("Error creating properties:", error);
43526
+ this.propertyContent = [];
43527
+ }
43509
43528
  super.scheduleUpdate();
43510
43529
  }
43511
43530
  selectViewport(viewport) {