@design.estate/dees-wcctools 1.2.1 โ†’ 2.0.0

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.
Files changed (42) hide show
  1. package/dist_bundle/bundle.js +1764 -218
  2. package/dist_bundle/bundle.js.map +4 -4
  3. package/dist_ts_demotools/demotools.d.ts +1 -1
  4. package/dist_ts_demotools/demotools.js +86 -38
  5. package/dist_ts_web/00_commitinfo_data.js +1 -1
  6. package/dist_ts_web/elements/wcc-dashboard.d.ts +11 -10
  7. package/dist_ts_web/elements/wcc-dashboard.js +370 -246
  8. package/dist_ts_web/elements/wcc-frame.d.ts +3 -3
  9. package/dist_ts_web/elements/wcc-frame.js +108 -57
  10. package/dist_ts_web/elements/wcc-properties.d.ts +14 -8
  11. package/dist_ts_web/elements/wcc-properties.js +442 -323
  12. package/dist_ts_web/elements/wcc-record-button.d.ts +12 -0
  13. package/dist_ts_web/elements/wcc-record-button.js +165 -0
  14. package/dist_ts_web/elements/wcc-recording-panel.d.ts +42 -0
  15. package/dist_ts_web/elements/wcc-recording-panel.js +1067 -0
  16. package/dist_ts_web/elements/wcc-sidebar.d.ts +7 -5
  17. package/dist_ts_web/elements/wcc-sidebar.js +250 -81
  18. package/dist_ts_web/elements/wcctools.helpers.d.ts +13 -0
  19. package/dist_ts_web/elements/wcctools.helpers.js +26 -1
  20. package/dist_ts_web/index.d.ts +3 -0
  21. package/dist_ts_web/index.js +5 -1
  22. package/dist_ts_web/services/ffmpeg.service.d.ts +42 -0
  23. package/dist_ts_web/services/ffmpeg.service.js +276 -0
  24. package/dist_ts_web/services/mp4.service.d.ts +32 -0
  25. package/dist_ts_web/services/mp4.service.js +139 -0
  26. package/dist_ts_web/services/recorder.service.d.ts +44 -0
  27. package/dist_ts_web/services/recorder.service.js +307 -0
  28. package/dist_watch/bundle.js +2126 -541
  29. package/dist_watch/bundle.js.map +4 -4
  30. package/package.json +8 -8
  31. package/readme.md +133 -141
  32. package/ts_web/00_commitinfo_data.ts +1 -1
  33. package/ts_web/elements/wcc-dashboard.ts +86 -26
  34. package/ts_web/elements/wcc-frame.ts +3 -3
  35. package/ts_web/elements/wcc-properties.ts +53 -9
  36. package/ts_web/elements/wcc-record-button.ts +108 -0
  37. package/ts_web/elements/wcc-recording-panel.ts +978 -0
  38. package/ts_web/elements/wcc-sidebar.ts +133 -22
  39. package/ts_web/elements/wcctools.helpers.ts +31 -0
  40. package/ts_web/index.ts +5 -0
  41. package/ts_web/readme.md +123 -0
  42. package/ts_web/services/recorder.service.ts +393 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-wcctools",
3
- "version": "1.2.1",
3
+ "version": "2.0.0",
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": {
@@ -17,14 +17,14 @@
17
17
  "lit": "^3.3.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@api.global/typedserver": "^3.0.79",
21
- "@git.zone/tsbuild": "^2.7.1",
22
- "@git.zone/tsbundle": "^2.5.1",
23
- "@git.zone/tsrun": "^1.6.2",
24
- "@git.zone/tstest": "^2.7.0",
25
- "@git.zone/tswatch": "^2.2.1",
20
+ "@api.global/typedserver": "^7.11.1",
21
+ "@git.zone/tsbuild": "^3.1.2",
22
+ "@git.zone/tsbundle": "^2.6.3",
23
+ "@git.zone/tsrun": "^2.0.0",
24
+ "@git.zone/tstest": "^3.1.3",
25
+ "@git.zone/tswatch": "^2.3.11",
26
26
  "@push.rocks/projectinfo": "^5.0.2",
27
- "@types/node": "^22.18.6"
27
+ "@types/node": "^25.0.0"
28
28
  },
29
29
  "files": [
30
30
  "ts/**/*",
package/readme.md CHANGED
@@ -1,23 +1,31 @@
1
1
  # @design.estate/dees-wcctools
2
- Web Component Development Tools - A powerful framework for building, testing, and documenting web components
2
+
3
+ ๐Ÿ› ๏ธ **Web Component Development Tools** โ€” A powerful framework for building, testing, documenting, and recording web components
3
4
 
4
5
  ## Overview
6
+
5
7
  `@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
8
+
9
+ - ๐ŸŽจ **Interactive Component Catalogue** โ€” Live preview with sidebar navigation
10
+ - ๐Ÿ”ง **Real-time Property Editing** โ€” Modify component props on the fly with auto-detected editors
11
+ - ๐ŸŒ“ **Theme Switching** โ€” Test light/dark modes instantly
12
+ - ๐Ÿ“ฑ **Responsive Viewport Testing** โ€” Phone, phablet, tablet, and desktop views
13
+ - ๐ŸŽฌ **Screen Recording** โ€” Record component demos with audio support and video trimming
14
+ - ๐Ÿงช **Advanced Demo Tools** โ€” Post-render hooks for interactive testing
15
+ - ๐Ÿš€ **Zero-config Setup** โ€” TypeScript and Lit support out of the box
16
+
17
+ ## Issue Reporting and Security
18
+
19
+ For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
12
20
 
13
21
  ## Installation
14
22
 
15
23
  ```bash
16
- # Using npm
17
- npm install @design.estate/dees-wcctools --save-dev
18
-
19
24
  # Using pnpm (recommended)
20
25
  pnpm add -D @design.estate/dees-wcctools
26
+
27
+ # Using npm
28
+ npm install @design.estate/dees-wcctools --save-dev
21
29
  ```
22
30
 
23
31
  ## Quick Start
@@ -35,10 +43,10 @@ export class MyButton extends DeesElement {
35
43
  `;
36
44
 
37
45
  @property({ type: String })
38
- public label: string = 'Button';
46
+ accessor label: string = 'Button';
39
47
 
40
48
  @property({ type: String })
41
- public variant: 'primary' | 'secondary' = 'primary';
49
+ accessor variant: 'primary' | 'secondary' = 'primary';
42
50
 
43
51
  public static styles = [
44
52
  css`
@@ -85,8 +93,8 @@ import { setupWccTools } from '@design.estate/dees-wcctools';
85
93
  import { html } from 'lit';
86
94
 
87
95
  // Import your components
88
- import './components/my-button.js';
89
- import './components/my-card.js';
96
+ import { MyButton } from './components/my-button.js';
97
+ import { MyCard } from './components/my-card.js';
90
98
 
91
99
  // Define elements for the catalogue
92
100
  const elements = {
@@ -132,21 +140,28 @@ setupWccTools(elements, pages);
132
140
  ## Features
133
141
 
134
142
  ### ๐ŸŽฏ Live Property Editing
143
+
135
144
  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)
145
+
146
+ | Property Type | Editor |
147
+ |--------------|--------|
148
+ | **String** | Text input |
149
+ | **Number** | Number input |
150
+ | **Boolean** | Checkbox |
151
+ | **Enum** | Select dropdown |
152
+ | **Object/Array** | JSON editor modal |
141
153
 
142
154
  ### ๐Ÿ“ฑ Viewport Testing
155
+
143
156
  Test your components across different screen sizes:
144
- - **Phone** (320px width)
145
- - **Phablet** (600px width)
146
- - **Tablet** (768px width)
147
- - **Desktop** (full width)
157
+
158
+ - **Phone** โ€” 320px width
159
+ - **Phablet** โ€” 600px width
160
+ - **Tablet** โ€” 768px width
161
+ - **Desktop** โ€” Full width (native)
148
162
 
149
163
  ### ๐ŸŒ“ Theme Support
164
+
150
165
  Components automatically adapt to light/dark themes using the `goBright` property:
151
166
 
152
167
  ```typescript
@@ -159,7 +174,8 @@ public render() {
159
174
  }
160
175
  ```
161
176
 
162
- Or use CSS custom properties:
177
+ Or use CSS custom properties with the theme manager:
178
+
163
179
  ```typescript
164
180
  import { cssManager } from '@design.estate/dees-element';
165
181
 
@@ -173,39 +189,44 @@ public static styles = [
173
189
  ];
174
190
  ```
175
191
 
176
- ### ๐Ÿงช Advanced Demo Tools
192
+ ### ๐ŸŽฌ Screen Recording
193
+
194
+ Record component demos directly from the catalogue! The built-in recorder supports:
177
195
 
178
- The demo tools provide enhanced testing capabilities:
196
+ - **Viewport Recording** โ€” Record just the component viewport
197
+ - **Full Screen Recording** โ€” Capture the entire screen
198
+ - **Audio Support** โ€” Add microphone commentary with live level monitoring
199
+ - **Video Trimming** โ€” Trim start/end before export with visual timeline
200
+ - **WebM Export** โ€” High-quality video output
201
+
202
+ Click the red record button in the bottom toolbar to start.
203
+
204
+ ### ๐Ÿงช Demo Tools
205
+
206
+ The demotools module provides enhanced testing capabilities with `dees-demowrapper`:
179
207
 
180
208
  ```typescript
181
- import * as demoTools from '@design.estate/dees-wcctools/demotools';
209
+ import '@design.estate/dees-wcctools/demotools';
182
210
 
183
211
  @customElement('my-component')
184
212
  export class MyComponent extends DeesElement {
185
213
  public static demo = () => html`
186
214
  <dees-demowrapper .runAfterRender=${async (wrapper) => {
187
- // Use querySelector to find specific elements
188
- const myComponent = wrapper.querySelector('my-component') as MyComponent;
189
- console.log('Component found:', myComponent);
190
-
191
- // Access all children via wrapper.children
192
- console.log('Total children:', wrapper.children.length);
193
-
194
- // Use querySelectorAll for multiple elements
195
- const allDivs = wrapper.querySelectorAll('div');
196
- console.log('Found divs:', allDivs.length);
197
-
215
+ // Find elements using standard DOM APIs
216
+ const myComponent = wrapper.querySelector('my-component');
217
+
198
218
  // Simulate user interactions
199
219
  myComponent.value = 'Test value';
200
220
  await myComponent.updateComplete;
201
-
202
- // Work with all children
203
- Array.from(wrapper.children).forEach((child, index) => {
204
- console.log(`Child ${index}:`, child.tagName);
221
+
222
+ // Work with multiple elements
223
+ wrapper.querySelectorAll('.item').forEach((el, i) => {
224
+ console.log(`Item ${i}:`, el.textContent);
205
225
  });
206
226
  }}>
207
227
  <my-component></my-component>
208
- <div>Additional content</div>
228
+ <div class="item">Item 1</div>
229
+ <div class="item">Item 2</div>
209
230
  </dees-demowrapper>
210
231
  `;
211
232
  }
@@ -213,20 +234,18 @@ export class MyComponent extends DeesElement {
213
234
 
214
235
  ### โณ Async Demos
215
236
 
216
- If your catalogue needs additional setup before rendering, return a `Promise` from the `demo` function. The dashboard waits for the result before inserting it into the viewport:
237
+ Return a `Promise` from `demo` for async setup. The dashboard waits for resolution:
217
238
 
218
239
  ```typescript
219
240
  public static demo = async () => {
220
- await Promise.resolve(); // e.g. fetch data, load fixtures, or await wrappers
221
- return html`<my-component .value=${'Loaded asynchronously'}></my-component>`;
241
+ const data = await fetchSomeData();
242
+ return html`<my-component .data=${data}></my-component>`;
222
243
  };
223
244
  ```
224
245
 
225
- The same pattern works for page factories you pass into `setupWccTools`, enabling asynchronous data preparation across the entire demo surface.
246
+ ### ๐ŸŽญ Container Queries
226
247
 
227
- ### ๐ŸŽญ Container Queries Support
228
-
229
- Components can respond to their container size:
248
+ Components can respond to their container size using the `wccToolsViewport` container:
230
249
 
231
250
  ```typescript
232
251
  public static styles = [
@@ -236,7 +255,7 @@ public static styles = [
236
255
  flex-direction: row;
237
256
  }
238
257
  }
239
-
258
+
240
259
  @container wccToolsViewport (max-width: 767px) {
241
260
  :host {
242
261
  flex-direction: column;
@@ -249,61 +268,94 @@ public static styles = [
249
268
  ## Component Guidelines
250
269
 
251
270
  ### Required for Catalogue Display
271
+
252
272
  1. Components must expose a static `demo` property returning a Lit template
253
- 2. Use `@property()` decorators for properties you want to be editable
273
+ 2. Use `@property()` decorators with the `accessor` keyword for editable properties
254
274
  3. Export component classes for proper detection
255
275
 
256
276
  ### Best Practices
277
+
257
278
  ```typescript
258
279
  @customElement('best-practice-component')
259
280
  export class BestPracticeComponent extends DeesElement {
260
281
  // โœ… Static demo property
261
282
  public static demo = () => html`
262
- <best-practice-component
283
+ <best-practice-component
263
284
  .complexProp=${{ key: 'value' }}
264
285
  simpleAttribute="test"
265
286
  ></best-practice-component>
266
287
  `;
267
288
 
268
- // โœ… Typed properties with defaults
289
+ // โœ… Typed properties with defaults (TC39 decorators)
269
290
  @property({ type: String })
270
- public title: string = 'Default Title';
291
+ accessor title: string = 'Default Title';
271
292
 
272
293
  // โœ… Complex property without attribute
273
294
  @property({ attribute: false })
274
- public complexProp: { key: string } = { key: 'default' };
295
+ accessor complexProp: { key: string } = { key: 'default' };
275
296
 
276
297
  // โœ… Enum with proper typing
277
298
  @property({ type: String })
278
- public variant: 'small' | 'medium' | 'large' = 'medium';
299
+ accessor variant: 'small' | 'medium' | 'large' = 'medium';
279
300
  }
280
301
  ```
281
302
 
282
303
  ## URL Routing
283
304
 
284
305
  The catalogue uses URL routing for deep linking:
306
+
285
307
  ```
286
308
  /wcctools-route/:type/:name/:viewport/:theme
287
309
 
288
- Example:
310
+ Examples:
289
311
  /wcctools-route/element/my-button/desktop/dark
290
312
  /wcctools-route/page/home/tablet/bright
291
313
  ```
292
314
 
293
- ## Development Workflow
315
+ ## API Reference
294
316
 
295
- ### Build and Watch
296
- ```json
297
- {
298
- "scripts": {
299
- "build": "tsbuild tsfolders --allowimplicitany && tsbundle element",
300
- "watch": "tswatch element",
301
- "serve": "http-server ./dist"
302
- }
303
- }
317
+ ### `setupWccTools(elements, pages?)`
318
+
319
+ Initialize the WCC Tools dashboard.
320
+
321
+ | Parameter | Type | Description |
322
+ |-----------|------|-------------|
323
+ | `elements` | `Record<string, typeof LitElement>` | Map of element names to classes |
324
+ | `pages` | `Record<string, TTemplateFactory>` | Optional map of page names to template functions |
325
+
326
+ ### `DeesDemoWrapper`
327
+
328
+ Component for wrapping demos with post-render logic.
329
+
330
+ | Property | Type | Description |
331
+ |----------|------|-------------|
332
+ | `runAfterRender` | `(wrapper) => void \| Promise<void>` | Callback after wrapped elements render |
333
+
334
+ The wrapper provides full DOM API access:
335
+ - `wrapper.querySelector()` โ€” Find single element
336
+ - `wrapper.querySelectorAll()` โ€” Find multiple elements
337
+ - `wrapper.children` โ€” Access child elements directly
338
+
339
+ ### Recording Components (Advanced)
340
+
341
+ For custom recording integrations:
342
+
343
+ ```typescript
344
+ import { RecorderService } from '@design.estate/dees-wcctools';
345
+
346
+ const recorder = new RecorderService({
347
+ onDurationUpdate: (duration) => console.log(`${duration}s`),
348
+ onRecordingComplete: (blob) => console.log('Recording done!', blob),
349
+ onAudioLevelUpdate: (level) => console.log(`Audio: ${level}%`),
350
+ });
351
+
352
+ await recorder.startRecording({ mode: 'viewport' });
353
+ // ... later
354
+ recorder.stopRecording();
304
355
  ```
305
356
 
306
- ### Project Structure
357
+ ## Project Structure
358
+
307
359
  ```
308
360
  my-components/
309
361
  โ”œโ”€โ”€ src/
@@ -316,90 +368,30 @@ my-components/
316
368
  โ””โ”€โ”€ package.json
317
369
  ```
318
370
 
319
- ## Advanced Features
320
-
321
- ### Custom Property Handlers
322
- For complex property types, implement custom logic in your demo:
323
-
324
- ```typescript
325
- public static demo = () => html`
326
- <dees-demowrapper .runAfterRender=${(wrapper) => {
327
- // Use querySelector to target specific elements
328
- const component = wrapper.querySelector('my-component');
329
- if (component) {
330
- component.addEventListener('property-change', (e) => {
331
- console.log('Property changed:', e.detail);
332
- });
333
- }
334
-
335
- // Or handle all elements of a type
336
- wrapper.querySelectorAll('my-component').forEach(el => {
337
- el.addEventListener('click', () => console.log('Clicked!'));
338
- });
339
- }}>
340
- <my-component></my-component>
341
- </dees-demowrapper>
342
- `;
343
- ```
344
-
345
- ### Responsive Testing Helpers
346
- ```typescript
347
- import * as domtools from '@design.estate/dees-domtools';
348
-
349
- public static styles = [
350
- // Media query helpers
351
- domtools.breakpoints.cssForPhone(css`
352
- :host { font-size: 14px; }
353
- `),
354
-
355
- domtools.breakpoints.cssForTablet(css`
356
- :host { font-size: 16px; }
357
- `),
358
-
359
- domtools.breakpoints.cssForDesktop(css`
360
- :host { font-size: 18px; }
361
- `)
362
- ];
363
- ```
364
-
365
- ## API Reference
366
-
367
- ### setupWccTools(elements, pages?)
368
- Initialize the WCC Tools dashboard.
369
-
370
- - `elements`: Object mapping element names to element classes
371
- - `pages`: Optional object mapping page names to template functions
372
-
373
- ### DeesDemoWrapper
374
- Component for wrapping demos with post-render logic.
375
-
376
- - `runAfterRender`: Function called after the wrapped elements render
377
- - Receives the wrapper element itself, providing full DOM API access
378
- - Use `wrapper.querySelector()` and `wrapper.querySelectorAll()` for element selection
379
- - Access children via `wrapper.children` property
380
- - Supports async operations
381
-
382
371
  ## Browser Support
383
- - Chrome/Edge (latest)
384
- - Firefox (latest)
385
- - Safari (latest)
386
- - Mobile browsers with Web Components support
372
+
373
+ - โœ… Chrome/Edge (latest)
374
+ - โœ… Firefox (latest)
375
+ - โœ… Safari (latest)
376
+ - โœ… Mobile browsers with Web Components support
387
377
 
388
378
  ## License and Legal Information
389
379
 
390
- This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
380
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
391
381
 
392
382
  **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
393
383
 
394
384
  ### Trademarks
395
385
 
396
- This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
386
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
387
+
388
+ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
397
389
 
398
390
  ### Company Information
399
391
 
400
- Task Venture Capital GmbH
401
- Registered at District court Bremen HRB 35230 HB, Germany
392
+ Task Venture Capital GmbH
393
+ Registered at District Court Bremen HRB 35230 HB, Germany
402
394
 
403
- For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
395
+ For any legal inquiries or further information, please contact us via email at hello@task.vc.
404
396
 
405
397
  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.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-wcctools',
6
- version: '1.2.1',
6
+ version: '2.0.0',
7
7
  description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
8
8
  }