@design.estate/dees-wcctools 1.0.96 → 1.0.98
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/dist_bundle/bundle.js +66 -47
- package/dist_bundle/bundle.js.map +3 -3
- package/dist_ts_web/elements/wcc-properties.js +75 -47
- package/dist_watch/bundle.js +692 -48
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +1 -1
- package/readme.hints.md +13 -5
- package/readme.plan.md +37 -1
- package/ts_web/elements/wcc-properties.ts +54 -29
package/dist_bundle/bundle.js
CHANGED
|
@@ -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
|
-
|
|
43345
|
-
|
|
43346
|
-
|
|
43344
|
+
try {
|
|
43345
|
+
for (const child of Array.from(container.children)) {
|
|
43346
|
+
if (child instanceof elementClass) {
|
|
43347
|
+
return child;
|
|
43348
|
+
}
|
|
43347
43349
|
}
|
|
43348
|
-
|
|
43349
|
-
|
|
43350
|
-
|
|
43351
|
-
|
|
43352
|
-
|
|
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
|
-
|
|
43355
|
-
|
|
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 = [];
|
|
@@ -43401,7 +43406,7 @@ var WccProperties = class extends DeesElement {
|
|
|
43401
43406
|
}
|
|
43402
43407
|
console.log(anonItem.elementProperties);
|
|
43403
43408
|
const wccFrame = await this.dashboardRef.wccFrame;
|
|
43404
|
-
await new Promise((resolve2) => setTimeout(resolve2,
|
|
43409
|
+
await new Promise((resolve2) => setTimeout(resolve2, 200));
|
|
43405
43410
|
const viewport = await wccFrame.getViewportElement();
|
|
43406
43411
|
let firstFoundInstantiatedElement = await this.findElementRecursively(
|
|
43407
43412
|
viewport,
|
|
@@ -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
|
-
|
|
43414
|
-
|
|
43415
|
-
|
|
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,61 +43441,65 @@ var WccProperties = class extends DeesElement {
|
|
|
43431
43441
|
if (key2 === "goBright" || key2 === "domtools") {
|
|
43432
43442
|
continue;
|
|
43433
43443
|
}
|
|
43434
|
-
|
|
43435
|
-
|
|
43436
|
-
|
|
43437
|
-
|
|
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
|
-
|
|
43442
|
-
|
|
43443
|
-
|
|
43452
|
+
switch (propertyTypeString) {
|
|
43453
|
+
case "Boolean":
|
|
43454
|
+
return x`<input
|
|
43444
43455
|
type="checkbox"
|
|
43445
43456
|
?checked=${firstFoundInstantiatedElement[key2]}
|
|
43446
43457
|
@input="${(eventArg) => {
|
|
43447
|
-
|
|
43448
|
-
|
|
43458
|
+
firstFoundInstantiatedElement[key2] = eventArg.target.checked;
|
|
43459
|
+
}}"
|
|
43449
43460
|
/>`;
|
|
43450
|
-
|
|
43451
|
-
|
|
43461
|
+
case "String":
|
|
43462
|
+
return x`<input
|
|
43452
43463
|
type="text"
|
|
43453
|
-
value=${firstFoundInstantiatedElement[key2]}
|
|
43464
|
+
.value=${firstFoundInstantiatedElement[key2] || ""}
|
|
43454
43465
|
@input="${(eventArg) => {
|
|
43455
|
-
|
|
43456
|
-
|
|
43466
|
+
firstFoundInstantiatedElement[key2] = eventArg.target.value;
|
|
43467
|
+
}}"
|
|
43457
43468
|
/>`;
|
|
43458
|
-
|
|
43459
|
-
|
|
43469
|
+
case "Number":
|
|
43470
|
+
return x`<input
|
|
43460
43471
|
type="number"
|
|
43461
|
-
value=${firstFoundInstantiatedElement[key2]}
|
|
43472
|
+
.value=${firstFoundInstantiatedElement[key2] ?? ""}
|
|
43462
43473
|
@input="${(eventArg) => {
|
|
43463
|
-
|
|
43464
|
-
|
|
43474
|
+
firstFoundInstantiatedElement[key2] = parseFloat(eventArg.target.value) || 0;
|
|
43475
|
+
}}"
|
|
43465
43476
|
/>`;
|
|
43466
|
-
|
|
43467
|
-
|
|
43468
|
-
|
|
43477
|
+
case "Enum":
|
|
43478
|
+
const enumValues = getEnumValues(property);
|
|
43479
|
+
return x`<select
|
|
43480
|
+
.value=${firstFoundInstantiatedElement[key2] || ""}
|
|
43469
43481
|
@change="${(eventArg) => {
|
|
43470
|
-
|
|
43471
|
-
|
|
43482
|
+
firstFoundInstantiatedElement[key2] = eventArg.target.value;
|
|
43483
|
+
}}"
|
|
43472
43484
|
>
|
|
43473
43485
|
${enumValues.map((valueArg) => {
|
|
43474
|
-
|
|
43486
|
+
return x`
|
|
43475
43487
|
<option
|
|
43476
|
-
|
|
43477
|
-
name="${valueArg}"
|
|
43488
|
+
value="${valueArg}"
|
|
43478
43489
|
>
|
|
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
|
-
|
|
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) {
|