@design.estate/dees-wcctools 1.2.1 → 1.3.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 (35) hide show
  1. package/dist_bundle/bundle.js +1581 -198
  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 +10 -10
  7. package/dist_ts_web/elements/wcc-dashboard.js +317 -245
  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 +1063 -0
  16. package/dist_ts_web/elements/wcc-sidebar.d.ts +4 -4
  17. package/dist_ts_web/elements/wcc-sidebar.js +125 -71
  18. package/dist_ts_web/index.d.ts +3 -0
  19. package/dist_ts_web/index.js +5 -1
  20. package/dist_ts_web/services/recorder.service.d.ts +44 -0
  21. package/dist_ts_web/services/recorder.service.js +306 -0
  22. package/dist_watch/bundle.js +1939 -521
  23. package/dist_watch/bundle.js.map +4 -4
  24. package/package.json +8 -8
  25. package/readme.md +133 -141
  26. package/ts_web/00_commitinfo_data.ts +1 -1
  27. package/ts_web/elements/wcc-dashboard.ts +10 -10
  28. package/ts_web/elements/wcc-frame.ts +3 -3
  29. package/ts_web/elements/wcc-properties.ts +53 -9
  30. package/ts_web/elements/wcc-record-button.ts +108 -0
  31. package/ts_web/elements/wcc-recording-panel.ts +974 -0
  32. package/ts_web/elements/wcc-sidebar.ts +4 -4
  33. package/ts_web/index.ts +5 -0
  34. package/ts_web/readme.md +123 -0
  35. package/ts_web/services/recorder.service.ts +391 -0
@@ -0,0 +1,108 @@
1
+ import { DeesElement, customElement, html, css, property, type TemplateResult } from '@design.estate/dees-element';
2
+
3
+ @customElement('wcc-record-button')
4
+ export class WccRecordButton extends DeesElement {
5
+ @property({ type: String })
6
+ accessor state: 'idle' | 'recording' = 'idle';
7
+
8
+ @property({ type: Number })
9
+ accessor duration: number = 0;
10
+
11
+ public static styles = [
12
+ css`
13
+ :host {
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ background: transparent;
18
+ cursor: pointer;
19
+ transition: all 0.15s ease;
20
+ color: #666;
21
+ user-select: none;
22
+ }
23
+
24
+ :host(:hover) {
25
+ background: rgba(239, 68, 68, 0.05);
26
+ color: #f87171;
27
+ }
28
+
29
+ :host(.recording) {
30
+ background: rgba(239, 68, 68, 0.15);
31
+ color: #f87171;
32
+ }
33
+
34
+ .content {
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ gap: 0.25rem;
39
+ }
40
+
41
+ .rec-icon {
42
+ width: 12px;
43
+ height: 12px;
44
+ border-radius: 50%;
45
+ background: currentColor;
46
+ }
47
+
48
+ :host(.recording) .rec-icon {
49
+ animation: pulse-recording 1s ease-in-out infinite;
50
+ }
51
+
52
+ @keyframes pulse-recording {
53
+ 0%, 100% { opacity: 1; transform: scale(1); }
54
+ 50% { opacity: 0.5; transform: scale(0.9); }
55
+ }
56
+
57
+ .recording-timer {
58
+ font-family: 'Consolas', 'Monaco', monospace;
59
+ font-size: 0.7rem;
60
+ }
61
+ `
62
+ ];
63
+
64
+ private formatDuration(seconds: number): string {
65
+ const mins = Math.floor(seconds / 60);
66
+ const secs = seconds % 60;
67
+ return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
68
+ }
69
+
70
+ public render(): TemplateResult {
71
+ return html`
72
+ <div class="content">
73
+ <div class="rec-icon"></div>
74
+ ${this.state === 'recording' ? html`
75
+ <span class="recording-timer">${this.formatDuration(this.duration)}</span>
76
+ ` : null}
77
+ </div>
78
+ `;
79
+ }
80
+
81
+ async connectedCallback(): Promise<void> {
82
+ await super.connectedCallback();
83
+ this.addEventListener('click', this.handleClick);
84
+ }
85
+
86
+ async disconnectedCallback(): Promise<void> {
87
+ await super.disconnectedCallback();
88
+ this.removeEventListener('click', this.handleClick);
89
+ }
90
+
91
+ private handleClick = (): void => {
92
+ this.dispatchEvent(new CustomEvent('record-click', {
93
+ bubbles: true,
94
+ composed: true
95
+ }));
96
+ };
97
+
98
+ updated(changedProperties: Map<string, unknown>): void {
99
+ super.updated(changedProperties);
100
+ if (changedProperties.has('state')) {
101
+ if (this.state === 'recording') {
102
+ this.classList.add('recording');
103
+ } else {
104
+ this.classList.remove('recording');
105
+ }
106
+ }
107
+ }
108
+ }