@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.
- package/dist_bundle/bundle.js +61 -42
- package/dist_bundle/bundle.js.map +3 -3
- package/dist_ts_web/elements/wcc-properties.js +69 -41
- package/dist_watch/bundle.js +687 -43
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +2 -2
- package/readme.hints.md +8 -2
- package/readme.plan.md +25 -1
- package/ts_web/elements/wcc-properties.ts +47 -22
package/dist_watch/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 = [];
|
|
@@ -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,47 +43441,48 @@ 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
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
43472
|
value=${firstFoundInstantiatedElement[key2]}
|
|
43462
43473
|
@input="${(eventArg) => {
|
|
43463
|
-
|
|
43464
|
-
|
|
43474
|
+
firstFoundInstantiatedElement[key2] = eventArg.target.value;
|
|
43475
|
+
}}"
|
|
43465
43476
|
/>`;
|
|
43466
|
-
|
|
43467
|
-
|
|
43468
|
-
|
|
43477
|
+
case "Enum":
|
|
43478
|
+
const enumValues = getEnumValues(property);
|
|
43479
|
+
return x`<select
|
|
43469
43480
|
@change="${(eventArg) => {
|
|
43470
|
-
|
|
43471
|
-
|
|
43481
|
+
firstFoundInstantiatedElement[key2] = eventArg.target.value;
|
|
43482
|
+
}}"
|
|
43472
43483
|
>
|
|
43473
43484
|
${enumValues.map((valueArg) => {
|
|
43474
|
-
|
|
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
|
-
|
|
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) {
|
|
@@ -43724,7 +43743,12 @@ var setupWccTools = (elementsArg, pagesArg) => {
|
|
|
43724
43743
|
// test/elements/index.ts
|
|
43725
43744
|
var elements_exports = {};
|
|
43726
43745
|
__export(elements_exports, {
|
|
43727
|
-
|
|
43746
|
+
TestComplexTypes: () => TestComplexTypes,
|
|
43747
|
+
TestDemoelement: () => TestDemoelement,
|
|
43748
|
+
TestEdgeCases: () => TestEdgeCases,
|
|
43749
|
+
TestNested: () => TestNested,
|
|
43750
|
+
TestNoProps: () => TestNoProps,
|
|
43751
|
+
TestWithWrapper: () => TestWithWrapper
|
|
43728
43752
|
});
|
|
43729
43753
|
|
|
43730
43754
|
// test/elements/test-demoelement.ts
|
|
@@ -43833,6 +43857,626 @@ TestDemoelement = __decorateClass([
|
|
|
43833
43857
|
t4("test-demoelement")
|
|
43834
43858
|
], TestDemoelement);
|
|
43835
43859
|
|
|
43860
|
+
// test/elements/test-noprops.ts
|
|
43861
|
+
var TestNoProps = class extends DeesElement {
|
|
43862
|
+
render() {
|
|
43863
|
+
return x`
|
|
43864
|
+
<div class="message">
|
|
43865
|
+
This element has no @property decorators.
|
|
43866
|
+
Properties panel should handle this gracefully.
|
|
43867
|
+
</div>
|
|
43868
|
+
`;
|
|
43869
|
+
}
|
|
43870
|
+
};
|
|
43871
|
+
TestNoProps.demo = () => x`<test-noprops></test-noprops>`;
|
|
43872
|
+
TestNoProps.styles = [
|
|
43873
|
+
i`
|
|
43874
|
+
:host {
|
|
43875
|
+
display: block;
|
|
43876
|
+
padding: 20px;
|
|
43877
|
+
background: #f0f0f0;
|
|
43878
|
+
border: 2px solid #ccc;
|
|
43879
|
+
border-radius: 8px;
|
|
43880
|
+
}
|
|
43881
|
+
.message {
|
|
43882
|
+
font-family: monospace;
|
|
43883
|
+
color: #666;
|
|
43884
|
+
}
|
|
43885
|
+
`
|
|
43886
|
+
];
|
|
43887
|
+
TestNoProps = __decorateClass([
|
|
43888
|
+
t4("test-noprops")
|
|
43889
|
+
], TestNoProps);
|
|
43890
|
+
|
|
43891
|
+
// test/elements/test-complextypes.ts
|
|
43892
|
+
var TestComplexTypes = class extends DeesElement {
|
|
43893
|
+
constructor() {
|
|
43894
|
+
super(...arguments);
|
|
43895
|
+
this.stringArray = ["apple", "banana", "cherry"];
|
|
43896
|
+
this.numberArray = [1, 2, 3, 4, 5];
|
|
43897
|
+
this.complexData = {
|
|
43898
|
+
name: "Default Name",
|
|
43899
|
+
age: 0,
|
|
43900
|
+
tags: [],
|
|
43901
|
+
metadata: {
|
|
43902
|
+
created: /* @__PURE__ */ new Date(),
|
|
43903
|
+
modified: /* @__PURE__ */ new Date(),
|
|
43904
|
+
author: "Unknown"
|
|
43905
|
+
}
|
|
43906
|
+
};
|
|
43907
|
+
this.simpleObject = {
|
|
43908
|
+
key1: "value1",
|
|
43909
|
+
key2: "value2",
|
|
43910
|
+
key3: 123
|
|
43911
|
+
};
|
|
43912
|
+
this.functionProperty = () => {
|
|
43913
|
+
console.log("This is a function property");
|
|
43914
|
+
};
|
|
43915
|
+
this.dateProperty = /* @__PURE__ */ new Date();
|
|
43916
|
+
}
|
|
43917
|
+
render() {
|
|
43918
|
+
return x`
|
|
43919
|
+
<div class="section">
|
|
43920
|
+
<span class="label">String Array:</span>
|
|
43921
|
+
<span class="value">${this.stringArray.join(", ")}</span>
|
|
43922
|
+
</div>
|
|
43923
|
+
|
|
43924
|
+
<div class="section">
|
|
43925
|
+
<span class="label">Number Array:</span>
|
|
43926
|
+
<span class="value">${this.numberArray.join(", ")}</span>
|
|
43927
|
+
</div>
|
|
43928
|
+
|
|
43929
|
+
<div class="section">
|
|
43930
|
+
<span class="label">Complex Data:</span>
|
|
43931
|
+
<pre>${JSON.stringify(this.complexData, null, 2)}</pre>
|
|
43932
|
+
</div>
|
|
43933
|
+
|
|
43934
|
+
<div class="section">
|
|
43935
|
+
<span class="label">Simple Object:</span>
|
|
43936
|
+
<pre>${JSON.stringify(this.simpleObject, null, 2)}</pre>
|
|
43937
|
+
</div>
|
|
43938
|
+
|
|
43939
|
+
<div class="section">
|
|
43940
|
+
<span class="label">Date Property:</span>
|
|
43941
|
+
<span class="value">${this.dateProperty.toLocaleString()}</span>
|
|
43942
|
+
</div>
|
|
43943
|
+
|
|
43944
|
+
<div class="section">
|
|
43945
|
+
<span class="label">Function Property:</span>
|
|
43946
|
+
<span class="value">${typeof this.functionProperty}</span>
|
|
43947
|
+
</div>
|
|
43948
|
+
`;
|
|
43949
|
+
}
|
|
43950
|
+
};
|
|
43951
|
+
TestComplexTypes.demo = () => x`
|
|
43952
|
+
<test-complextypes
|
|
43953
|
+
.complexData=${{
|
|
43954
|
+
name: "Test User",
|
|
43955
|
+
age: 25,
|
|
43956
|
+
tags: ["developer", "designer"],
|
|
43957
|
+
metadata: {
|
|
43958
|
+
created: /* @__PURE__ */ new Date(),
|
|
43959
|
+
modified: /* @__PURE__ */ new Date(),
|
|
43960
|
+
author: "System"
|
|
43961
|
+
}
|
|
43962
|
+
}}
|
|
43963
|
+
></test-complextypes>
|
|
43964
|
+
`;
|
|
43965
|
+
TestComplexTypes.styles = [
|
|
43966
|
+
i`
|
|
43967
|
+
:host {
|
|
43968
|
+
display: block;
|
|
43969
|
+
padding: 20px;
|
|
43970
|
+
background: #f5f5f5;
|
|
43971
|
+
border: 2px solid #ddd;
|
|
43972
|
+
border-radius: 8px;
|
|
43973
|
+
font-family: monospace;
|
|
43974
|
+
}
|
|
43975
|
+
.section {
|
|
43976
|
+
margin: 10px 0;
|
|
43977
|
+
padding: 10px;
|
|
43978
|
+
background: white;
|
|
43979
|
+
border-radius: 4px;
|
|
43980
|
+
}
|
|
43981
|
+
.label {
|
|
43982
|
+
font-weight: bold;
|
|
43983
|
+
color: #333;
|
|
43984
|
+
}
|
|
43985
|
+
.value {
|
|
43986
|
+
color: #666;
|
|
43987
|
+
margin-left: 10px;
|
|
43988
|
+
}
|
|
43989
|
+
pre {
|
|
43990
|
+
background: #f0f0f0;
|
|
43991
|
+
padding: 8px;
|
|
43992
|
+
border-radius: 4px;
|
|
43993
|
+
overflow-x: auto;
|
|
43994
|
+
}
|
|
43995
|
+
`
|
|
43996
|
+
];
|
|
43997
|
+
__decorateClass([
|
|
43998
|
+
n4({ type: Array })
|
|
43999
|
+
], TestComplexTypes.prototype, "stringArray", 2);
|
|
44000
|
+
__decorateClass([
|
|
44001
|
+
n4({ type: Array })
|
|
44002
|
+
], TestComplexTypes.prototype, "numberArray", 2);
|
|
44003
|
+
__decorateClass([
|
|
44004
|
+
n4({ attribute: false })
|
|
44005
|
+
], TestComplexTypes.prototype, "complexData", 2);
|
|
44006
|
+
__decorateClass([
|
|
44007
|
+
n4({ type: Object })
|
|
44008
|
+
], TestComplexTypes.prototype, "simpleObject", 2);
|
|
44009
|
+
__decorateClass([
|
|
44010
|
+
n4({ attribute: false })
|
|
44011
|
+
], TestComplexTypes.prototype, "functionProperty", 2);
|
|
44012
|
+
__decorateClass([
|
|
44013
|
+
n4({ type: Date })
|
|
44014
|
+
], TestComplexTypes.prototype, "dateProperty", 2);
|
|
44015
|
+
TestComplexTypes = __decorateClass([
|
|
44016
|
+
t4("test-complextypes")
|
|
44017
|
+
], TestComplexTypes);
|
|
44018
|
+
|
|
44019
|
+
// ts_demotools/demotools.ts
|
|
44020
|
+
var DeesDemoWrapper = class extends DeesElement {
|
|
44021
|
+
render() {
|
|
44022
|
+
return x`
|
|
44023
|
+
<slot></slot>
|
|
44024
|
+
`;
|
|
44025
|
+
}
|
|
44026
|
+
async firstUpdated() {
|
|
44027
|
+
await this.updateComplete;
|
|
44028
|
+
await new Promise((resolve2) => setTimeout(resolve2, 50));
|
|
44029
|
+
if (this.children.length > 0 && this.runAfterRender) {
|
|
44030
|
+
try {
|
|
44031
|
+
await this.runAfterRender(this);
|
|
44032
|
+
} catch (error) {
|
|
44033
|
+
console.error("Error in runAfterRender:", error);
|
|
44034
|
+
}
|
|
44035
|
+
}
|
|
44036
|
+
}
|
|
44037
|
+
};
|
|
44038
|
+
DeesDemoWrapper.styles = [
|
|
44039
|
+
i`
|
|
44040
|
+
:host {
|
|
44041
|
+
display: contents;
|
|
44042
|
+
}
|
|
44043
|
+
`
|
|
44044
|
+
];
|
|
44045
|
+
__decorateClass([
|
|
44046
|
+
n4({ attribute: false })
|
|
44047
|
+
], DeesDemoWrapper.prototype, "runAfterRender", 2);
|
|
44048
|
+
DeesDemoWrapper = __decorateClass([
|
|
44049
|
+
t4("dees-demowrapper")
|
|
44050
|
+
], DeesDemoWrapper);
|
|
44051
|
+
|
|
44052
|
+
// test/elements/test-withwrapper.ts
|
|
44053
|
+
var TestWithWrapper = class extends DeesElement {
|
|
44054
|
+
constructor() {
|
|
44055
|
+
super(...arguments);
|
|
44056
|
+
this.dynamicValue = "Initial value";
|
|
44057
|
+
this.counter = 0;
|
|
44058
|
+
this.isActive = false;
|
|
44059
|
+
}
|
|
44060
|
+
render() {
|
|
44061
|
+
return x`
|
|
44062
|
+
<div class="wrapper-info">
|
|
44063
|
+
This element is wrapped with dees-demowrapper in its demo
|
|
44064
|
+
</div>
|
|
44065
|
+
|
|
44066
|
+
<div class="inner-content">
|
|
44067
|
+
<h3>Dynamic Value: ${this.dynamicValue}</h3>
|
|
44068
|
+
<p>Counter: ${this.counter}</p>
|
|
44069
|
+
<p>Active: ${this.isActive ? "Yes" : "No"}</p>
|
|
44070
|
+
|
|
44071
|
+
<button @click=${() => this.counter++}>Increment</button>
|
|
44072
|
+
<button @click=${() => this.isActive = !this.isActive}>Toggle Active</button>
|
|
44073
|
+
<button @click=${() => this.dynamicValue = "Clicked!"}>Change Value</button>
|
|
44074
|
+
</div>
|
|
44075
|
+
|
|
44076
|
+
<div class="status">
|
|
44077
|
+
Properties panel should detect this element inside the wrapper
|
|
44078
|
+
</div>
|
|
44079
|
+
`;
|
|
44080
|
+
}
|
|
44081
|
+
};
|
|
44082
|
+
TestWithWrapper.demo = () => x`
|
|
44083
|
+
<dees-demowrapper .runAfterRender=${async (wrapper) => {
|
|
44084
|
+
console.log("DemoWrapper: Found wrapper element", wrapper);
|
|
44085
|
+
const testElement = wrapper.querySelector("test-withwrapper");
|
|
44086
|
+
if (testElement) {
|
|
44087
|
+
console.log("DemoWrapper: Found test-withwrapper element");
|
|
44088
|
+
testElement.dynamicValue = "Set by demo wrapper!";
|
|
44089
|
+
testElement.counter = 100;
|
|
44090
|
+
const innerDiv = wrapper.querySelector(".inner-content");
|
|
44091
|
+
console.log("DemoWrapper: Found inner div:", innerDiv);
|
|
44092
|
+
const allButtons = wrapper.querySelectorAll("button");
|
|
44093
|
+
console.log(`DemoWrapper: Found ${allButtons.length} buttons`);
|
|
44094
|
+
}
|
|
44095
|
+
}}>
|
|
44096
|
+
<test-withwrapper></test-withwrapper>
|
|
44097
|
+
<div style="margin-top: 10px; padding: 10px; background: #e0e0e0;">
|
|
44098
|
+
This div is also inside the wrapper
|
|
44099
|
+
</div>
|
|
44100
|
+
</dees-demowrapper>
|
|
44101
|
+
`;
|
|
44102
|
+
TestWithWrapper.styles = [
|
|
44103
|
+
i`
|
|
44104
|
+
:host {
|
|
44105
|
+
display: block;
|
|
44106
|
+
padding: 20px;
|
|
44107
|
+
background: #e8f5e9;
|
|
44108
|
+
border: 2px solid #4caf50;
|
|
44109
|
+
border-radius: 8px;
|
|
44110
|
+
}
|
|
44111
|
+
.wrapper-info {
|
|
44112
|
+
background: #c8e6c9;
|
|
44113
|
+
padding: 10px;
|
|
44114
|
+
border-radius: 4px;
|
|
44115
|
+
margin-bottom: 10px;
|
|
44116
|
+
}
|
|
44117
|
+
.inner-content {
|
|
44118
|
+
background: white;
|
|
44119
|
+
padding: 15px;
|
|
44120
|
+
border-radius: 4px;
|
|
44121
|
+
margin: 10px 0;
|
|
44122
|
+
}
|
|
44123
|
+
button {
|
|
44124
|
+
background: #4caf50;
|
|
44125
|
+
color: white;
|
|
44126
|
+
border: none;
|
|
44127
|
+
padding: 8px 16px;
|
|
44128
|
+
border-radius: 4px;
|
|
44129
|
+
cursor: pointer;
|
|
44130
|
+
margin-right: 10px;
|
|
44131
|
+
}
|
|
44132
|
+
button:hover {
|
|
44133
|
+
background: #45a049;
|
|
44134
|
+
}
|
|
44135
|
+
.status {
|
|
44136
|
+
margin-top: 10px;
|
|
44137
|
+
font-family: monospace;
|
|
44138
|
+
}
|
|
44139
|
+
`
|
|
44140
|
+
];
|
|
44141
|
+
__decorateClass([
|
|
44142
|
+
n4({ type: String })
|
|
44143
|
+
], TestWithWrapper.prototype, "dynamicValue", 2);
|
|
44144
|
+
__decorateClass([
|
|
44145
|
+
n4({ type: Number })
|
|
44146
|
+
], TestWithWrapper.prototype, "counter", 2);
|
|
44147
|
+
__decorateClass([
|
|
44148
|
+
n4({ type: Boolean })
|
|
44149
|
+
], TestWithWrapper.prototype, "isActive", 2);
|
|
44150
|
+
TestWithWrapper = __decorateClass([
|
|
44151
|
+
t4("test-withwrapper")
|
|
44152
|
+
], TestWithWrapper);
|
|
44153
|
+
|
|
44154
|
+
// test/elements/test-edgecases.ts
|
|
44155
|
+
var TestEdgeCases = class extends DeesElement {
|
|
44156
|
+
constructor() {
|
|
44157
|
+
super(...arguments);
|
|
44158
|
+
this.nullableString = null;
|
|
44159
|
+
this.undefinedNumber = void 0;
|
|
44160
|
+
this.longString = "Lorem ipsum ".repeat(50);
|
|
44161
|
+
this.specialChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?`~";
|
|
44162
|
+
this.htmlString = '<script>alert("test")<\/script><b>Bold text</b>';
|
|
44163
|
+
this.infinityNumber = Infinity;
|
|
44164
|
+
this.nanNumber = NaN;
|
|
44165
|
+
this.veryLargeNumber = Number.MAX_SAFE_INTEGER;
|
|
44166
|
+
this.verySmallNumber = Number.MIN_SAFE_INTEGER;
|
|
44167
|
+
this.floatNumber = 3.14159265359;
|
|
44168
|
+
this.booleanString = "false";
|
|
44169
|
+
this.booleanNumber = 0;
|
|
44170
|
+
this.emptyString = "";
|
|
44171
|
+
this.emptyArray = [];
|
|
44172
|
+
this.emptyObject = {};
|
|
44173
|
+
this.circularRef = (() => {
|
|
44174
|
+
const obj = { name: "circular" };
|
|
44175
|
+
obj.self = obj;
|
|
44176
|
+
return obj;
|
|
44177
|
+
})();
|
|
44178
|
+
}
|
|
44179
|
+
formatValue(value2) {
|
|
44180
|
+
if (value2 === null) return "null";
|
|
44181
|
+
if (value2 === void 0) return "undefined";
|
|
44182
|
+
if (value2 === Infinity) return "Infinity";
|
|
44183
|
+
if (Number.isNaN(value2)) return "NaN";
|
|
44184
|
+
if (typeof value2 === "string" && value2.length > 50) {
|
|
44185
|
+
return value2.substring(0, 50) + "...";
|
|
44186
|
+
}
|
|
44187
|
+
if (typeof value2 === "object") {
|
|
44188
|
+
try {
|
|
44189
|
+
return JSON.stringify(value2);
|
|
44190
|
+
} catch (e8) {
|
|
44191
|
+
return "[Circular Reference]";
|
|
44192
|
+
}
|
|
44193
|
+
}
|
|
44194
|
+
return String(value2);
|
|
44195
|
+
}
|
|
44196
|
+
render() {
|
|
44197
|
+
return x`
|
|
44198
|
+
<div class="warning">
|
|
44199
|
+
⚠️ This element tests edge cases and problematic values
|
|
44200
|
+
</div>
|
|
44201
|
+
|
|
44202
|
+
<div class="property">
|
|
44203
|
+
<span class="label">Nullable String:</span>
|
|
44204
|
+
<span class="value special">${this.formatValue(this.nullableString)}</span>
|
|
44205
|
+
</div>
|
|
44206
|
+
|
|
44207
|
+
<div class="property">
|
|
44208
|
+
<span class="label">Undefined Number:</span>
|
|
44209
|
+
<span class="value special">${this.formatValue(this.undefinedNumber)}</span>
|
|
44210
|
+
</div>
|
|
44211
|
+
|
|
44212
|
+
<div class="property">
|
|
44213
|
+
<span class="label">Long String:</span>
|
|
44214
|
+
<span class="value">${this.formatValue(this.longString)}</span>
|
|
44215
|
+
</div>
|
|
44216
|
+
|
|
44217
|
+
<div class="property">
|
|
44218
|
+
<span class="label">Special Characters:</span>
|
|
44219
|
+
<span class="value">${this.specialChars}</span>
|
|
44220
|
+
</div>
|
|
44221
|
+
|
|
44222
|
+
<div class="property">
|
|
44223
|
+
<span class="label">HTML String (escaped):</span>
|
|
44224
|
+
<span class="value">${this.htmlString}</span>
|
|
44225
|
+
</div>
|
|
44226
|
+
|
|
44227
|
+
<div class="property">
|
|
44228
|
+
<span class="label">Infinity:</span>
|
|
44229
|
+
<span class="value special">${this.formatValue(this.infinityNumber)}</span>
|
|
44230
|
+
</div>
|
|
44231
|
+
|
|
44232
|
+
<div class="property">
|
|
44233
|
+
<span class="label">NaN:</span>
|
|
44234
|
+
<span class="value special">${this.formatValue(this.nanNumber)}</span>
|
|
44235
|
+
</div>
|
|
44236
|
+
|
|
44237
|
+
<div class="property">
|
|
44238
|
+
<span class="label">Very Large Number:</span>
|
|
44239
|
+
<span class="value">${this.veryLargeNumber}</span>
|
|
44240
|
+
</div>
|
|
44241
|
+
|
|
44242
|
+
<div class="property">
|
|
44243
|
+
<span class="label">Float Number:</span>
|
|
44244
|
+
<span class="value">${this.floatNumber}</span>
|
|
44245
|
+
</div>
|
|
44246
|
+
|
|
44247
|
+
<div class="property">
|
|
44248
|
+
<span class="label">Empty String:</span>
|
|
44249
|
+
<span class="value special">[empty]</span>
|
|
44250
|
+
</div>
|
|
44251
|
+
|
|
44252
|
+
<div class="property">
|
|
44253
|
+
<span class="label">Circular Reference:</span>
|
|
44254
|
+
<span class="value special">${this.formatValue(this.circularRef)}</span>
|
|
44255
|
+
</div>
|
|
44256
|
+
`;
|
|
44257
|
+
}
|
|
44258
|
+
};
|
|
44259
|
+
TestEdgeCases.demo = () => x`<test-edgecases></test-edgecases>`;
|
|
44260
|
+
TestEdgeCases.styles = [
|
|
44261
|
+
i`
|
|
44262
|
+
:host {
|
|
44263
|
+
display: block;
|
|
44264
|
+
padding: 20px;
|
|
44265
|
+
background: #fff3e0;
|
|
44266
|
+
border: 2px solid #ff9800;
|
|
44267
|
+
border-radius: 8px;
|
|
44268
|
+
font-family: monospace;
|
|
44269
|
+
font-size: 12px;
|
|
44270
|
+
}
|
|
44271
|
+
.warning {
|
|
44272
|
+
background: #ffe0b2;
|
|
44273
|
+
padding: 10px;
|
|
44274
|
+
border-radius: 4px;
|
|
44275
|
+
margin-bottom: 10px;
|
|
44276
|
+
color: #e65100;
|
|
44277
|
+
}
|
|
44278
|
+
.property {
|
|
44279
|
+
margin: 5px 0;
|
|
44280
|
+
padding: 5px;
|
|
44281
|
+
background: white;
|
|
44282
|
+
border-radius: 2px;
|
|
44283
|
+
word-break: break-all;
|
|
44284
|
+
}
|
|
44285
|
+
.label {
|
|
44286
|
+
font-weight: bold;
|
|
44287
|
+
color: #f57c00;
|
|
44288
|
+
}
|
|
44289
|
+
.value {
|
|
44290
|
+
color: #666;
|
|
44291
|
+
}
|
|
44292
|
+
.special {
|
|
44293
|
+
background: #ffccbc;
|
|
44294
|
+
padding: 2px 4px;
|
|
44295
|
+
border-radius: 2px;
|
|
44296
|
+
}
|
|
44297
|
+
`
|
|
44298
|
+
];
|
|
44299
|
+
__decorateClass([
|
|
44300
|
+
n4({ type: String })
|
|
44301
|
+
], TestEdgeCases.prototype, "nullableString", 2);
|
|
44302
|
+
__decorateClass([
|
|
44303
|
+
n4({ type: Number })
|
|
44304
|
+
], TestEdgeCases.prototype, "undefinedNumber", 2);
|
|
44305
|
+
__decorateClass([
|
|
44306
|
+
n4({ type: String })
|
|
44307
|
+
], TestEdgeCases.prototype, "longString", 2);
|
|
44308
|
+
__decorateClass([
|
|
44309
|
+
n4({ type: String })
|
|
44310
|
+
], TestEdgeCases.prototype, "specialChars", 2);
|
|
44311
|
+
__decorateClass([
|
|
44312
|
+
n4({ type: String })
|
|
44313
|
+
], TestEdgeCases.prototype, "htmlString", 2);
|
|
44314
|
+
__decorateClass([
|
|
44315
|
+
n4({ type: Number })
|
|
44316
|
+
], TestEdgeCases.prototype, "infinityNumber", 2);
|
|
44317
|
+
__decorateClass([
|
|
44318
|
+
n4({ type: Number })
|
|
44319
|
+
], TestEdgeCases.prototype, "nanNumber", 2);
|
|
44320
|
+
__decorateClass([
|
|
44321
|
+
n4({ type: Number })
|
|
44322
|
+
], TestEdgeCases.prototype, "veryLargeNumber", 2);
|
|
44323
|
+
__decorateClass([
|
|
44324
|
+
n4({ type: Number })
|
|
44325
|
+
], TestEdgeCases.prototype, "verySmallNumber", 2);
|
|
44326
|
+
__decorateClass([
|
|
44327
|
+
n4({ type: Number })
|
|
44328
|
+
], TestEdgeCases.prototype, "floatNumber", 2);
|
|
44329
|
+
__decorateClass([
|
|
44330
|
+
n4({ type: String })
|
|
44331
|
+
], TestEdgeCases.prototype, "booleanString", 2);
|
|
44332
|
+
__decorateClass([
|
|
44333
|
+
n4({ type: Number })
|
|
44334
|
+
], TestEdgeCases.prototype, "booleanNumber", 2);
|
|
44335
|
+
__decorateClass([
|
|
44336
|
+
n4({ type: String })
|
|
44337
|
+
], TestEdgeCases.prototype, "emptyString", 2);
|
|
44338
|
+
__decorateClass([
|
|
44339
|
+
n4({ type: Array })
|
|
44340
|
+
], TestEdgeCases.prototype, "emptyArray", 2);
|
|
44341
|
+
__decorateClass([
|
|
44342
|
+
n4({ type: Object })
|
|
44343
|
+
], TestEdgeCases.prototype, "emptyObject", 2);
|
|
44344
|
+
__decorateClass([
|
|
44345
|
+
n4({ attribute: false })
|
|
44346
|
+
], TestEdgeCases.prototype, "circularRef", 2);
|
|
44347
|
+
TestEdgeCases = __decorateClass([
|
|
44348
|
+
t4("test-edgecases")
|
|
44349
|
+
], TestEdgeCases);
|
|
44350
|
+
|
|
44351
|
+
// test/elements/test-nested.ts
|
|
44352
|
+
var TestNestedWrapper = class extends DeesElement {
|
|
44353
|
+
render() {
|
|
44354
|
+
return x`
|
|
44355
|
+
<div style="border: 1px dashed #ccc; padding: 10px; margin: 5px;">
|
|
44356
|
+
<slot></slot>
|
|
44357
|
+
</div>
|
|
44358
|
+
`;
|
|
44359
|
+
}
|
|
44360
|
+
};
|
|
44361
|
+
TestNestedWrapper = __decorateClass([
|
|
44362
|
+
t4("test-nested-wrapper")
|
|
44363
|
+
], TestNestedWrapper);
|
|
44364
|
+
var TestNestedTarget = class extends DeesElement {
|
|
44365
|
+
constructor() {
|
|
44366
|
+
super(...arguments);
|
|
44367
|
+
this.message = "I am deeply nested!";
|
|
44368
|
+
this.depth = 0;
|
|
44369
|
+
this.found = false;
|
|
44370
|
+
}
|
|
44371
|
+
render() {
|
|
44372
|
+
return x`
|
|
44373
|
+
<div class="info">
|
|
44374
|
+
<strong>Nested Target Element</strong><br>
|
|
44375
|
+
Message: ${this.message}<br>
|
|
44376
|
+
Depth: ${this.depth}<br>
|
|
44377
|
+
Found by properties panel: ${this.found ? "\u2705" : "\u274C"}
|
|
44378
|
+
</div>
|
|
44379
|
+
`;
|
|
44380
|
+
}
|
|
44381
|
+
};
|
|
44382
|
+
TestNestedTarget.styles = [
|
|
44383
|
+
i`
|
|
44384
|
+
:host {
|
|
44385
|
+
display: block;
|
|
44386
|
+
padding: 15px;
|
|
44387
|
+
background: #e1f5fe;
|
|
44388
|
+
border: 2px solid #0288d1;
|
|
44389
|
+
border-radius: 4px;
|
|
44390
|
+
margin: 5px;
|
|
44391
|
+
}
|
|
44392
|
+
.info {
|
|
44393
|
+
font-family: monospace;
|
|
44394
|
+
color: #01579b;
|
|
44395
|
+
}
|
|
44396
|
+
`
|
|
44397
|
+
];
|
|
44398
|
+
__decorateClass([
|
|
44399
|
+
n4({ type: String })
|
|
44400
|
+
], TestNestedTarget.prototype, "message", 2);
|
|
44401
|
+
__decorateClass([
|
|
44402
|
+
n4({ type: Number })
|
|
44403
|
+
], TestNestedTarget.prototype, "depth", 2);
|
|
44404
|
+
__decorateClass([
|
|
44405
|
+
n4({ type: Boolean })
|
|
44406
|
+
], TestNestedTarget.prototype, "found", 2);
|
|
44407
|
+
TestNestedTarget = __decorateClass([
|
|
44408
|
+
t4("test-nested-target")
|
|
44409
|
+
], TestNestedTarget);
|
|
44410
|
+
var TestNested = class extends DeesElement {
|
|
44411
|
+
constructor() {
|
|
44412
|
+
super(...arguments);
|
|
44413
|
+
this.testId = "nested-test";
|
|
44414
|
+
}
|
|
44415
|
+
render() {
|
|
44416
|
+
return x`
|
|
44417
|
+
<div class="explanation">
|
|
44418
|
+
<h3>Nested Structure Test</h3>
|
|
44419
|
+
<p>The actual element with properties is nested deep inside multiple layers:</p>
|
|
44420
|
+
</div>
|
|
44421
|
+
|
|
44422
|
+
<div class="structure">
|
|
44423
|
+
<test-nested-wrapper>
|
|
44424
|
+
<div style="padding: 10px; background: #ffe;">
|
|
44425
|
+
<test-nested-wrapper>
|
|
44426
|
+
<div style="padding: 10px; background: #efe;">
|
|
44427
|
+
<test-nested-wrapper>
|
|
44428
|
+
<div style="padding: 10px; background: #eef;">
|
|
44429
|
+
<!-- The target element is here, 3 levels deep -->
|
|
44430
|
+
<test-nested-target
|
|
44431
|
+
.message=${"Found me at depth 3!"}
|
|
44432
|
+
.depth=${3}
|
|
44433
|
+
></test-nested-target>
|
|
44434
|
+
</div>
|
|
44435
|
+
</test-nested-wrapper>
|
|
44436
|
+
</div>
|
|
44437
|
+
</test-nested-wrapper>
|
|
44438
|
+
</div>
|
|
44439
|
+
</test-nested-wrapper>
|
|
44440
|
+
</div>
|
|
44441
|
+
|
|
44442
|
+
<div style="margin-top: 10px; font-style: italic; color: #666;">
|
|
44443
|
+
Properties panel should find the test-nested-target element despite the deep nesting.
|
|
44444
|
+
</div>
|
|
44445
|
+
`;
|
|
44446
|
+
}
|
|
44447
|
+
};
|
|
44448
|
+
TestNested.demo = () => x`
|
|
44449
|
+
<test-nested></test-nested>
|
|
44450
|
+
`;
|
|
44451
|
+
TestNested.styles = [
|
|
44452
|
+
i`
|
|
44453
|
+
:host {
|
|
44454
|
+
display: block;
|
|
44455
|
+
padding: 20px;
|
|
44456
|
+
background: #f5f5f5;
|
|
44457
|
+
border: 2px solid #999;
|
|
44458
|
+
border-radius: 8px;
|
|
44459
|
+
}
|
|
44460
|
+
.explanation {
|
|
44461
|
+
background: #fff;
|
|
44462
|
+
padding: 10px;
|
|
44463
|
+
border-radius: 4px;
|
|
44464
|
+
margin-bottom: 10px;
|
|
44465
|
+
}
|
|
44466
|
+
.structure {
|
|
44467
|
+
background: #f0f0f0;
|
|
44468
|
+
padding: 10px;
|
|
44469
|
+
border-radius: 4px;
|
|
44470
|
+
}
|
|
44471
|
+
`
|
|
44472
|
+
];
|
|
44473
|
+
__decorateClass([
|
|
44474
|
+
n4({ type: String })
|
|
44475
|
+
], TestNested.prototype, "testId", 2);
|
|
44476
|
+
TestNested = __decorateClass([
|
|
44477
|
+
t4("test-nested")
|
|
44478
|
+
], TestNested);
|
|
44479
|
+
|
|
43836
44480
|
// test/pages/index.ts
|
|
43837
44481
|
var pages_exports = {};
|
|
43838
44482
|
__export(pages_exports, {
|