@design.estate/dees-wcctools 1.0.91 โ 1.0.93
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_ts_demotools/demotools.d.ts +1 -1
- package/dist_ts_demotools/demotools.js +4 -5
- package/package.json +2 -2
- package/readme.hints.md +15 -7
- package/readme.md +327 -60
- package/readme.plan.md +23 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeesElement, type TemplateResult } from '@design.estate/dees-element';
|
|
2
2
|
export declare class DeesDemoWrapper extends DeesElement {
|
|
3
|
-
runAfterRender: (
|
|
3
|
+
runAfterRender: (children: HTMLCollection) => void | Promise<void>;
|
|
4
4
|
static styles: import("@design.estate/dees-element").CSSResult[];
|
|
5
5
|
render(): TemplateResult;
|
|
6
6
|
firstUpdated(): Promise<void>;
|
|
@@ -25,13 +25,12 @@ let DeesDemoWrapper = class DeesDemoWrapper extends DeesElement {
|
|
|
25
25
|
await this.updateComplete;
|
|
26
26
|
// Wait a bit for slotted content to render
|
|
27
27
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
28
|
-
//
|
|
28
|
+
// Get all slotted elements
|
|
29
29
|
const slottedElements = this.children;
|
|
30
30
|
if (slottedElements.length > 0 && this.runAfterRender) {
|
|
31
|
-
|
|
32
|
-
// Call the runAfterRender function with the element
|
|
31
|
+
// Call the runAfterRender function with all slotted elements
|
|
33
32
|
try {
|
|
34
|
-
await this.runAfterRender(
|
|
33
|
+
await this.runAfterRender(slottedElements);
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
36
|
console.error('Error in runAfterRender:', error);
|
|
@@ -47,4 +46,4 @@ DeesDemoWrapper = __decorate([
|
|
|
47
46
|
customElement('dees-demowrapper')
|
|
48
47
|
], DeesDemoWrapper);
|
|
49
48
|
export { DeesDemoWrapper };
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVtb3Rvb2xzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfZGVtb3Rvb2xzL2RlbW90b29scy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLGFBQWEsRUFBRSxJQUFJLEVBQUUsR0FBRyxFQUFFLFFBQVEsRUFBdUIsTUFBTSw2QkFBNkIsQ0FBQztBQUc1RyxJQUFNLGVBQWUsR0FBckIsTUFBTSxlQUFnQixTQUFRLFdBQVc7YUFJaEMsV0FBTSxHQUFHO1FBQ3JCLEdBQUcsQ0FBQTs7OztLQUlGO0tBQ0YsQUFObUIsQ0FNbEI7SUFFSyxNQUFNO1FBQ1gsT0FBTyxJQUFJLENBQUE7O0tBRVYsQ0FBQztJQUNKLENBQUM7SUFFTSxLQUFLLENBQUMsWUFBWTtRQUN2QixNQUFNLElBQUksQ0FBQyxjQUFjLENBQUM7UUFFMUIsMkNBQTJDO1FBQzNDLE1BQU0sSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsT0FBTyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFFdEQsMkJBQTJCO1FBQzNCLE1BQU0sZUFBZSxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUM7UUFDdEMsSUFBSSxlQUFlLENBQUMsTUFBTSxHQUFHLENBQUMsSUFBSSxJQUFJLENBQUMsY0FBYyxFQUFFLENBQUM7WUFDdEQsNkRBQTZEO1lBQzdELElBQUksQ0FBQztnQkFDSCxNQUFNLElBQUksQ0FBQyxjQUFjLENBQUMsZUFBZSxDQUFDLENBQUM7WUFDN0MsQ0FBQztZQUFDLE9BQU8sS0FBSyxFQUFFLENBQUM7Z0JBQ2YsT0FBTyxDQUFDLEtBQUssQ0FBQywwQkFBMEIsRUFBRSxLQUFLLENBQUMsQ0FBQztZQUNuRCxDQUFDO1FBQ0gsQ0FBQztJQUNILENBQUM7O0FBaENNO0lBRE4sUUFBUSxDQUFDLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxDQUFDOzt1REFDMkM7QUFGL0QsZUFBZTtJQUQzQixhQUFhLENBQUMsa0JBQWtCLENBQUM7R0FDckIsZUFBZSxDQW1DM0IifQ==
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-wcctools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.93",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist_ts_web/index.js",
|
|
8
|
-
"./
|
|
8
|
+
"./demotools": "./dist_ts_demotools"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"scripts": {
|
package/readme.hints.md
CHANGED
|
@@ -30,22 +30,30 @@ A utility component for wrapping demo elements with post-render functionality.
|
|
|
30
30
|
|
|
31
31
|
**Usage:**
|
|
32
32
|
```typescript
|
|
33
|
-
import
|
|
33
|
+
import * as demoTools from '@design.estate/dees-wcctools/demotools';
|
|
34
34
|
|
|
35
35
|
// In your demo function:
|
|
36
36
|
demo: () => html`
|
|
37
|
-
<dees-demowrapper .runAfterRender=${(
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
<dees-demowrapper .runAfterRender=${(children: HTMLCollection) => {
|
|
38
|
+
// Access all slotted elements
|
|
39
|
+
const firstElement = children[0] as HTMLElement;
|
|
40
|
+
firstElement.setAttribute('data-demo', 'true');
|
|
41
|
+
console.log('All slotted elements:', children);
|
|
42
|
+
|
|
43
|
+
// Work with multiple elements
|
|
44
|
+
Array.from(children).forEach(child => {
|
|
45
|
+
console.log('Element rendered:', child);
|
|
46
|
+
});
|
|
41
47
|
}}>
|
|
42
48
|
<my-custom-element></my-custom-element>
|
|
49
|
+
<div>Additional content</div>
|
|
43
50
|
</dees-demowrapper>
|
|
44
51
|
`
|
|
45
52
|
```
|
|
46
53
|
|
|
47
54
|
**Features:**
|
|
48
55
|
- Wraps demo elements without affecting layout (uses `display: contents`)
|
|
49
|
-
- Provides access to
|
|
56
|
+
- Provides access to ALL slotted elements via HTMLCollection after mounting
|
|
50
57
|
- Supports async operations in runAfterRender callback
|
|
51
|
-
- Automatically handles timing to ensure
|
|
58
|
+
- Automatically handles timing to ensure elements are fully rendered
|
|
59
|
+
- Can handle multiple slotted elements, not just the first one
|
package/readme.md
CHANGED
|
@@ -1,101 +1,368 @@
|
|
|
1
1
|
# @design.estate/dees-wcctools
|
|
2
|
-
|
|
2
|
+
Web Component Development Tools - A powerful framework for building, testing, and documenting web components
|
|
3
3
|
|
|
4
|
-
##
|
|
5
|
-
|
|
4
|
+
## Overview
|
|
5
|
+
`@design.estate/dees-wcctools` provides a comprehensive development environment for web components, featuring:
|
|
6
|
+
- ๐จ Interactive component catalogue with live preview
|
|
7
|
+
- ๐ง Real-time property editing
|
|
8
|
+
- ๐ Theme switching (light/dark modes)
|
|
9
|
+
- ๐ฑ Responsive viewport testing
|
|
10
|
+
- ๐งช Advanced demo tools for component testing
|
|
11
|
+
- ๐ Zero-config setup with TypeScript and Lit support
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
6
14
|
|
|
7
15
|
```bash
|
|
8
|
-
|
|
16
|
+
# Using npm
|
|
17
|
+
npm install @design.estate/dees-wcctools --save-dev
|
|
18
|
+
|
|
19
|
+
# Using pnpm (recommended)
|
|
20
|
+
pnpm add -D @design.estate/dees-wcctools
|
|
9
21
|
```
|
|
10
22
|
|
|
11
|
-
##
|
|
12
|
-
The `@design.estate/dees-wcctools` package provides a set of tools for creating element catalogues using Web Components. It leverages LitElement for creating custom elements and provides a structured way to showcase and test these elements in various environments and themes.
|
|
23
|
+
## Quick Start
|
|
13
24
|
|
|
14
|
-
###
|
|
15
|
-
First, ensure that your project is set up to use TypeScript and ESM syntax. This guide assumes you have a basic understanding of TypeScript and modern JavaScript development practices.
|
|
25
|
+
### 1. Create Your Component
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
```typescript
|
|
28
|
+
import { DeesElement, customElement, html, css, property } from '@design.estate/dees-element';
|
|
29
|
+
|
|
30
|
+
@customElement('my-button')
|
|
31
|
+
export class MyButton extends DeesElement {
|
|
32
|
+
// Define a demo for the catalogue
|
|
33
|
+
public static demo = () => html`
|
|
34
|
+
<my-button .label=${'Click me!'} .variant=${'primary'}></my-button>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
@property({ type: String })
|
|
38
|
+
public label: string = 'Button';
|
|
39
|
+
|
|
40
|
+
@property({ type: String })
|
|
41
|
+
public variant: 'primary' | 'secondary' = 'primary';
|
|
42
|
+
|
|
43
|
+
public static styles = [
|
|
44
|
+
css`
|
|
45
|
+
:host {
|
|
46
|
+
display: inline-block;
|
|
47
|
+
}
|
|
48
|
+
button {
|
|
49
|
+
padding: 8px 16px;
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
border: none;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
transition: all 0.3s;
|
|
55
|
+
}
|
|
56
|
+
button.primary {
|
|
57
|
+
background: #007bff;
|
|
58
|
+
color: white;
|
|
59
|
+
}
|
|
60
|
+
button.secondary {
|
|
61
|
+
background: #6c757d;
|
|
62
|
+
color: white;
|
|
63
|
+
}
|
|
64
|
+
button:hover {
|
|
65
|
+
opacity: 0.9;
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
public render() {
|
|
71
|
+
return html`
|
|
72
|
+
<button class="${this.variant}">
|
|
73
|
+
${this.label}
|
|
74
|
+
</button>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Set Up Your Catalogue
|
|
18
81
|
|
|
19
82
|
```typescript
|
|
83
|
+
// catalogue.ts
|
|
20
84
|
import { setupWccTools } from '@design.estate/dees-wcctools';
|
|
85
|
+
import { html } from 'lit';
|
|
86
|
+
|
|
87
|
+
// Import your components
|
|
88
|
+
import './components/my-button.js';
|
|
89
|
+
import './components/my-card.js';
|
|
90
|
+
|
|
91
|
+
// Define elements for the catalogue
|
|
92
|
+
const elements = {
|
|
93
|
+
'my-button': MyButton,
|
|
94
|
+
'my-card': MyCard,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Optionally define pages
|
|
98
|
+
const pages = {
|
|
99
|
+
'home': () => html`
|
|
100
|
+
<div style="padding: 20px;">
|
|
101
|
+
<h1>Welcome to My Component Library</h1>
|
|
102
|
+
<p>Browse components using the sidebar.</p>
|
|
103
|
+
</div>
|
|
104
|
+
`,
|
|
105
|
+
'getting-started': () => html`
|
|
106
|
+
<div style="padding: 20px;">
|
|
107
|
+
<h2>Getting Started</h2>
|
|
108
|
+
<p>Installation and usage instructions...</p>
|
|
109
|
+
</div>
|
|
110
|
+
`,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// Initialize the catalogue
|
|
114
|
+
setupWccTools(elements, pages);
|
|
21
115
|
```
|
|
22
116
|
|
|
23
|
-
###
|
|
24
|
-
|
|
117
|
+
### 3. Create an HTML Entry Point
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<!DOCTYPE html>
|
|
121
|
+
<html>
|
|
122
|
+
<head>
|
|
123
|
+
<title>Component Catalogue</title>
|
|
124
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
125
|
+
</head>
|
|
126
|
+
<body style="margin: 0; padding: 0;">
|
|
127
|
+
<script type="module" src="./catalogue.js"></script>
|
|
128
|
+
</body>
|
|
129
|
+
</html>
|
|
130
|
+
```
|
|
25
131
|
|
|
26
|
-
|
|
27
|
-
import { LitElement, html, customElement } from 'lit';
|
|
132
|
+
## Features
|
|
28
133
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
134
|
+
### ๐ฏ Live Property Editing
|
|
135
|
+
The properties panel automatically detects and allows editing of:
|
|
136
|
+
- **String** properties with text inputs
|
|
137
|
+
- **Number** properties with number inputs
|
|
138
|
+
- **Boolean** properties with checkboxes
|
|
139
|
+
- **Enum** properties with select dropdowns
|
|
140
|
+
- **Object** and **Array** properties (read-only display)
|
|
141
|
+
|
|
142
|
+
### ๐ฑ Viewport Testing
|
|
143
|
+
Test your components across different screen sizes:
|
|
144
|
+
- **Phone** (320px width)
|
|
145
|
+
- **Phablet** (600px width)
|
|
146
|
+
- **Tablet** (768px width)
|
|
147
|
+
- **Desktop** (full width)
|
|
148
|
+
|
|
149
|
+
### ๐ Theme Support
|
|
150
|
+
Components automatically adapt to light/dark themes using the `goBright` property:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
public render() {
|
|
154
|
+
return html`
|
|
155
|
+
<div class="${this.goBright ? 'light-theme' : 'dark-theme'}">
|
|
156
|
+
<!-- Your component content -->
|
|
157
|
+
</div>
|
|
158
|
+
`;
|
|
34
159
|
}
|
|
35
160
|
```
|
|
36
161
|
|
|
37
|
-
|
|
38
|
-
|
|
162
|
+
Or use CSS custom properties:
|
|
163
|
+
```typescript
|
|
164
|
+
import { cssManager } from '@design.estate/dees-element';
|
|
165
|
+
|
|
166
|
+
public static styles = [
|
|
167
|
+
css`
|
|
168
|
+
:host {
|
|
169
|
+
color: ${cssManager.bdTheme('#000', '#fff')};
|
|
170
|
+
background: ${cssManager.bdTheme('#fff', '#000')};
|
|
171
|
+
}
|
|
172
|
+
`
|
|
173
|
+
];
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### ๐งช Advanced Demo Tools
|
|
39
177
|
|
|
40
|
-
|
|
178
|
+
The demo tools provide enhanced testing capabilities:
|
|
41
179
|
|
|
42
180
|
```typescript
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
181
|
+
import * as demoTools from '@design.estate/dees-wcctools/demotools';
|
|
182
|
+
|
|
183
|
+
@customElement('my-component')
|
|
184
|
+
export class MyComponent extends DeesElement {
|
|
185
|
+
public static demo = () => html`
|
|
186
|
+
<dees-demowrapper .runAfterRender=${async (children: HTMLCollection) => {
|
|
187
|
+
// Access all slotted elements
|
|
188
|
+
console.log('Slotted elements:', children.length);
|
|
189
|
+
|
|
190
|
+
// Access specific element (e.g., first child)
|
|
191
|
+
const myComponent = children[0] as MyComponent;
|
|
192
|
+
console.log('Component mounted:', myComponent);
|
|
193
|
+
|
|
194
|
+
// Simulate user interactions
|
|
195
|
+
myComponent.value = 'Test value';
|
|
196
|
+
await myComponent.updateComplete;
|
|
197
|
+
|
|
198
|
+
// Trigger methods
|
|
199
|
+
myComponent.handleClick();
|
|
200
|
+
|
|
201
|
+
// Work with multiple elements if present
|
|
202
|
+
Array.from(children).forEach((child, index) => {
|
|
203
|
+
console.log(`Child ${index}:`, child.tagName);
|
|
204
|
+
});
|
|
205
|
+
}}>
|
|
206
|
+
<my-component></my-component>
|
|
207
|
+
<div>Additional content</div>
|
|
208
|
+
</dees-demowrapper>
|
|
209
|
+
`;
|
|
56
210
|
}
|
|
57
211
|
```
|
|
58
212
|
|
|
59
|
-
|
|
213
|
+
### ๐ญ Container Queries Support
|
|
214
|
+
|
|
215
|
+
Components can respond to their container size:
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
public static styles = [
|
|
219
|
+
css`
|
|
220
|
+
@container wccToolsViewport (min-width: 768px) {
|
|
221
|
+
:host {
|
|
222
|
+
flex-direction: row;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@container wccToolsViewport (max-width: 767px) {
|
|
227
|
+
:host {
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`
|
|
232
|
+
];
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Component Guidelines
|
|
60
236
|
|
|
237
|
+
### Required for Catalogue Display
|
|
238
|
+
1. Components must expose a static `demo` property returning a Lit template
|
|
239
|
+
2. Use `@property()` decorators for properties you want to be editable
|
|
240
|
+
3. Export component classes for proper detection
|
|
241
|
+
|
|
242
|
+
### Best Practices
|
|
61
243
|
```typescript
|
|
62
|
-
|
|
244
|
+
@customElement('best-practice-component')
|
|
245
|
+
export class BestPracticeComponent extends DeesElement {
|
|
246
|
+
// โ
Static demo property
|
|
247
|
+
public static demo = () => html`
|
|
248
|
+
<best-practice-component
|
|
249
|
+
.complexProp=${{ key: 'value' }}
|
|
250
|
+
simpleAttribute="test"
|
|
251
|
+
></best-practice-component>
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
// โ
Typed properties with defaults
|
|
255
|
+
@property({ type: String })
|
|
256
|
+
public title: string = 'Default Title';
|
|
257
|
+
|
|
258
|
+
// โ
Complex property without attribute
|
|
259
|
+
@property({ attribute: false })
|
|
260
|
+
public complexProp: { key: string } = { key: 'default' };
|
|
261
|
+
|
|
262
|
+
// โ
Enum with proper typing
|
|
263
|
+
@property({ type: String })
|
|
264
|
+
public variant: 'small' | 'medium' | 'large' = 'medium';
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## URL Routing
|
|
269
|
+
|
|
270
|
+
The catalogue uses URL routing for deep linking:
|
|
63
271
|
```
|
|
272
|
+
/wcctools-route/:type/:name/:viewport/:theme
|
|
64
273
|
|
|
65
|
-
|
|
66
|
-
|
|
274
|
+
Example:
|
|
275
|
+
/wcctools-route/element/my-button/desktop/dark
|
|
276
|
+
/wcctools-route/page/home/tablet/bright
|
|
277
|
+
```
|
|
67
278
|
|
|
68
|
-
|
|
69
|
-
- `pages`: An optional object where keys are page identifiers and values are functions returning Lit HTML templates.
|
|
279
|
+
## Development Workflow
|
|
70
280
|
|
|
71
|
-
###
|
|
72
|
-
|
|
281
|
+
### Build and Watch
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"scripts": {
|
|
285
|
+
"build": "tsbuild tsfolders --allowimplicitany && tsbundle element",
|
|
286
|
+
"watch": "tswatch element",
|
|
287
|
+
"serve": "http-server ./dist"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Project Structure
|
|
293
|
+
```
|
|
294
|
+
my-components/
|
|
295
|
+
โโโ src/
|
|
296
|
+
โ โโโ components/
|
|
297
|
+
โ โ โโโ my-button.ts
|
|
298
|
+
โ โ โโโ my-card.ts
|
|
299
|
+
โ โโโ catalogue.ts
|
|
300
|
+
โโโ dist/
|
|
301
|
+
โโโ index.html
|
|
302
|
+
โโโ package.json
|
|
303
|
+
```
|
|
73
304
|
|
|
74
|
-
|
|
75
|
-
The dashboard also provides options for testing your elements in different environments (e.g., desktop, tablet) and themes (light or dark). This helps ensure that your elements are versatile and adaptable to varying conditions.
|
|
305
|
+
## Advanced Features
|
|
76
306
|
|
|
77
|
-
###
|
|
78
|
-
|
|
307
|
+
### Custom Property Handlers
|
|
308
|
+
For complex property types, implement custom logic in your demo:
|
|
79
309
|
|
|
80
|
-
|
|
81
|
-
|
|
310
|
+
```typescript
|
|
311
|
+
public static demo = () => html`
|
|
312
|
+
<dees-demowrapper .runAfterRender=${(children) => {
|
|
313
|
+
// Set up complex property handling for all children
|
|
314
|
+
Array.from(children).forEach(child => {
|
|
315
|
+
child.addEventListener('property-change', (e) => {
|
|
316
|
+
console.log('Property changed:', e.detail);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
}}>
|
|
320
|
+
<my-component></my-component>
|
|
321
|
+
</dees-demowrapper>
|
|
322
|
+
`;
|
|
323
|
+
```
|
|
82
324
|
|
|
325
|
+
### Responsive Testing Helpers
|
|
83
326
|
```typescript
|
|
84
|
-
import
|
|
327
|
+
import * as domtools from '@design.estate/dees-domtools';
|
|
85
328
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
329
|
+
public static styles = [
|
|
330
|
+
// Media query helpers
|
|
331
|
+
domtools.breakpoints.cssForPhone(css`
|
|
332
|
+
:host { font-size: 14px; }
|
|
333
|
+
`),
|
|
90
334
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
335
|
+
domtools.breakpoints.cssForTablet(css`
|
|
336
|
+
:host { font-size: 16px; }
|
|
337
|
+
`),
|
|
338
|
+
|
|
339
|
+
domtools.breakpoints.cssForDesktop(css`
|
|
340
|
+
:host { font-size: 18px; }
|
|
341
|
+
`)
|
|
342
|
+
];
|
|
95
343
|
```
|
|
96
344
|
|
|
97
|
-
|
|
98
|
-
|
|
345
|
+
## API Reference
|
|
346
|
+
|
|
347
|
+
### setupWccTools(elements, pages?)
|
|
348
|
+
Initialize the WCC Tools dashboard.
|
|
349
|
+
|
|
350
|
+
- `elements`: Object mapping element names to element classes
|
|
351
|
+
- `pages`: Optional object mapping page names to template functions
|
|
352
|
+
|
|
353
|
+
### DeesDemoWrapper
|
|
354
|
+
Component for wrapping demos with post-render logic.
|
|
355
|
+
|
|
356
|
+
- `runAfterRender`: Function called after the wrapped elements render
|
|
357
|
+
- Receives the complete HTMLCollection of all slotted elements
|
|
358
|
+
- Supports async operations
|
|
359
|
+
- Access individual elements via array index or Array.from()
|
|
360
|
+
|
|
361
|
+
## Browser Support
|
|
362
|
+
- Chrome/Edge (latest)
|
|
363
|
+
- Firefox (latest)
|
|
364
|
+
- Safari (latest)
|
|
365
|
+
- Mobile browsers with Web Components support
|
|
99
366
|
|
|
100
367
|
## License and Legal Information
|
|
101
368
|
|
|
@@ -114,4 +381,4 @@ Registered at District court Bremen HRB 35230 HB, Germany
|
|
|
114
381
|
|
|
115
382
|
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
116
383
|
|
|
117
|
-
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
384
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
package/readme.plan.md
CHANGED
|
@@ -34,8 +34,29 @@ The properties panel has timing issues detecting rendered elements because:
|
|
|
34
34
|
## Created DeesDemoWrapper Component
|
|
35
35
|
- Location: ts_demotools/demotools.ts
|
|
36
36
|
- Allows wrapping demo elements with post-render functionality
|
|
37
|
-
- Provides runAfterRender callback that receives
|
|
37
|
+
- Provides runAfterRender callback that receives ALL slotted elements as HTMLCollection
|
|
38
38
|
- Uses display: contents to not affect layout
|
|
39
39
|
- Handles timing automatically with 50ms delay after firstUpdated
|
|
40
40
|
- Supports both sync and async callbacks
|
|
41
|
-
- Exports available at @design.estate/dees-wcctools/
|
|
41
|
+
- Exports available at @design.estate/dees-wcctools/demotools (lowercase)
|
|
42
|
+
|
|
43
|
+
# Documentation Update (COMPLETED)
|
|
44
|
+
|
|
45
|
+
## Updated readme.md with:
|
|
46
|
+
- Comprehensive overview with feature highlights
|
|
47
|
+
- Quick start guide with code examples
|
|
48
|
+
- Detailed feature documentation
|
|
49
|
+
- Advanced demo tools usage
|
|
50
|
+
- Best practices and guidelines
|
|
51
|
+
- API reference
|
|
52
|
+
- Browser support information
|
|
53
|
+
- Complete examples for all major features
|
|
54
|
+
|
|
55
|
+
# Enhanced DemoWrapper (COMPLETED)
|
|
56
|
+
|
|
57
|
+
## Modified runAfterRender callback:
|
|
58
|
+
- Now receives HTMLCollection of ALL slotted elements instead of just the first one
|
|
59
|
+
- Allows access to complete slotted DOM structure
|
|
60
|
+
- Updated documentation with correct import path (lowercase 'demotools')
|
|
61
|
+
- Examples show how to work with multiple slotted elements
|
|
62
|
+
- Maintains backward compatibility by accessing elements via index
|