@editframe/elements 0.16.7-beta.0 → 0.17.6-beta.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 (101) hide show
  1. package/README.md +30 -0
  2. package/dist/DecoderResetFrequency.test.d.ts +1 -0
  3. package/dist/DecoderResetRecovery.test.d.ts +1 -0
  4. package/dist/DelayedLoadingState.d.ts +48 -0
  5. package/dist/DelayedLoadingState.integration.test.d.ts +1 -0
  6. package/dist/DelayedLoadingState.js +113 -0
  7. package/dist/DelayedLoadingState.test.d.ts +1 -0
  8. package/dist/EF_FRAMEGEN.d.ts +10 -1
  9. package/dist/EF_FRAMEGEN.js +199 -179
  10. package/dist/EF_INTERACTIVE.js +2 -6
  11. package/dist/EF_RENDERING.js +1 -3
  12. package/dist/JitTranscodingClient.browsertest.d.ts +1 -0
  13. package/dist/JitTranscodingClient.d.ts +167 -0
  14. package/dist/JitTranscodingClient.js +373 -0
  15. package/dist/JitTranscodingClient.test.d.ts +1 -0
  16. package/dist/LoadingDebounce.test.d.ts +1 -0
  17. package/dist/LoadingIndicator.browsertest.d.ts +0 -0
  18. package/dist/ManualScrubTest.test.d.ts +1 -0
  19. package/dist/ScrubResolvedFlashing.test.d.ts +1 -0
  20. package/dist/ScrubTrackIntegration.test.d.ts +1 -0
  21. package/dist/ScrubTrackManager.d.ts +96 -0
  22. package/dist/ScrubTrackManager.js +216 -0
  23. package/dist/ScrubTrackManager.test.d.ts +1 -0
  24. package/dist/SegmentSwitchLoading.test.d.ts +1 -0
  25. package/dist/VideoSeekFlashing.browsertest.d.ts +0 -0
  26. package/dist/VideoStuckDiagnostic.test.d.ts +1 -0
  27. package/dist/elements/CrossUpdateController.js +13 -15
  28. package/dist/elements/EFAudio.browsertest.d.ts +0 -0
  29. package/dist/elements/EFAudio.d.ts +1 -1
  30. package/dist/elements/EFAudio.js +30 -43
  31. package/dist/elements/EFCaptions.js +337 -373
  32. package/dist/elements/EFImage.js +64 -90
  33. package/dist/elements/EFMedia.d.ts +98 -33
  34. package/dist/elements/EFMedia.js +1169 -678
  35. package/dist/elements/EFSourceMixin.js +31 -48
  36. package/dist/elements/EFTemporal.d.ts +1 -0
  37. package/dist/elements/EFTemporal.js +266 -360
  38. package/dist/elements/EFTimegroup.d.ts +3 -1
  39. package/dist/elements/EFTimegroup.js +262 -323
  40. package/dist/elements/EFVideo.browsertest.d.ts +0 -0
  41. package/dist/elements/EFVideo.d.ts +90 -2
  42. package/dist/elements/EFVideo.js +408 -111
  43. package/dist/elements/EFWaveform.js +375 -411
  44. package/dist/elements/FetchMixin.js +14 -24
  45. package/dist/elements/MediaController.d.ts +30 -0
  46. package/dist/elements/TargetController.js +130 -156
  47. package/dist/elements/TimegroupController.js +17 -19
  48. package/dist/elements/durationConverter.js +15 -4
  49. package/dist/elements/parseTimeToMs.js +4 -10
  50. package/dist/elements/printTaskStatus.d.ts +2 -0
  51. package/dist/elements/printTaskStatus.js +11 -0
  52. package/dist/elements/updateAnimations.js +39 -59
  53. package/dist/getRenderInfo.js +58 -67
  54. package/dist/gui/ContextMixin.js +203 -288
  55. package/dist/gui/EFConfiguration.js +27 -43
  56. package/dist/gui/EFFilmstrip.js +440 -620
  57. package/dist/gui/EFFitScale.js +112 -135
  58. package/dist/gui/EFFocusOverlay.js +45 -61
  59. package/dist/gui/EFPreview.js +30 -49
  60. package/dist/gui/EFScrubber.js +78 -99
  61. package/dist/gui/EFTimeDisplay.js +49 -70
  62. package/dist/gui/EFToggleLoop.js +17 -34
  63. package/dist/gui/EFTogglePlay.js +37 -58
  64. package/dist/gui/EFWorkbench.js +66 -88
  65. package/dist/gui/TWMixin.js +2 -48
  66. package/dist/gui/TWMixin2.js +31 -0
  67. package/dist/gui/efContext.js +2 -6
  68. package/dist/gui/fetchContext.js +1 -3
  69. package/dist/gui/focusContext.js +1 -3
  70. package/dist/gui/focusedElementContext.js +2 -6
  71. package/dist/gui/playingContext.js +1 -4
  72. package/dist/index.js +5 -30
  73. package/dist/msToTimeCode.js +11 -13
  74. package/dist/style.css +2 -1
  75. package/package.json +3 -3
  76. package/src/elements/EFAudio.browsertest.ts +569 -0
  77. package/src/elements/EFAudio.ts +4 -6
  78. package/src/elements/EFCaptions.browsertest.ts +0 -1
  79. package/src/elements/EFImage.browsertest.ts +0 -1
  80. package/src/elements/EFMedia.browsertest.ts +147 -115
  81. package/src/elements/EFMedia.ts +1339 -307
  82. package/src/elements/EFTemporal.browsertest.ts +0 -1
  83. package/src/elements/EFTemporal.ts +11 -0
  84. package/src/elements/EFTimegroup.ts +73 -10
  85. package/src/elements/EFVideo.browsertest.ts +680 -0
  86. package/src/elements/EFVideo.ts +729 -50
  87. package/src/elements/EFWaveform.ts +4 -4
  88. package/src/elements/MediaController.ts +108 -0
  89. package/src/elements/__screenshots__/EFMedia.browsertest.ts/EFMedia-JIT-audio-playback-audioBufferTask-should-work-in-JIT-mode-without-URL-errors-1.png +0 -0
  90. package/src/elements/printTaskStatus.ts +16 -0
  91. package/src/elements/updateAnimations.ts +6 -0
  92. package/src/gui/TWMixin.ts +10 -3
  93. package/test/EFVideo.frame-tasks.browsertest.ts +524 -0
  94. package/test/EFVideo.framegen.browsertest.ts +118 -0
  95. package/test/createJitTestClips.ts +293 -0
  96. package/test/useAssetMSW.ts +49 -0
  97. package/test/useMSW.ts +31 -0
  98. package/types.json +1 -1
  99. package/dist/gui/TWMixin.css.js +0 -4
  100. /package/dist/elements/{TargetController.test.d.ts → TargetController.browsertest.d.ts} +0 -0
  101. /package/src/elements/{TargetController.test.ts → TargetController.browsertest.ts} +0 -0
@@ -1,111 +1,84 @@
1
- import { consume } from "@lit/context";
2
- import { LitElement, css, html, nothing } from "lit";
3
- import { property, customElement, state, eventOptions } from "lit/decorators.js";
4
- import { createRef, ref } from "lit/directives/ref.js";
5
- import { styleMap } from "lit/directives/style-map.js";
6
- import { EFAudio } from "../elements/EFAudio.js";
7
- import { EFCaptions, EFCaptionsActiveWord } from "../elements/EFCaptions.js";
8
- import { EFImage } from "../elements/EFImage.js";
1
+ import { focusContext } from "./focusContext.js";
2
+ import { focusedElementContext } from "./focusedElementContext.js";
3
+ import { loopContext, playingContext } from "./playingContext.js";
4
+ import { targetTimegroupContext } from "./ContextMixin.js";
5
+ import { TimegroupController } from "../elements/TimegroupController.js";
9
6
  import { EFTimegroup } from "../elements/EFTimegroup.js";
7
+ import { EFImage } from "../elements/EFImage.js";
8
+ import { EFAudio } from "../elements/EFAudio.js";
9
+ import { TWMixin } from "./TWMixin2.js";
10
10
  import { EFVideo } from "../elements/EFVideo.js";
11
+ import { EFCaptions, EFCaptionsActiveWord } from "../elements/EFCaptions.js";
11
12
  import { EFWaveform } from "../elements/EFWaveform.js";
12
- import { TimegroupController } from "../elements/TimegroupController.js";
13
13
  import { msToTimeCode } from "../msToTimeCode.js";
14
- import { targetTimegroupContext } from "./ContextMixin.js";
15
- import { TWMixin } from "./TWMixin.js";
16
- import { focusContext } from "./focusContext.js";
17
- import { focusedElementContext } from "./focusedElementContext.js";
18
- import { playingContext, loopContext } from "./playingContext.js";
19
- var __defProp = Object.defineProperty;
20
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
21
- var __typeError = (msg) => {
22
- throw TypeError(msg);
23
- };
24
- var __decorateClass = (decorators, target, key, kind) => {
25
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
26
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
27
- if (decorator = decorators[i])
28
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
- if (kind && result) __defProp(target, key, result);
30
- return result;
14
+ import { consume } from "@lit/context";
15
+ import { LitElement, css, html, nothing } from "lit";
16
+ import { customElement, eventOptions, property, state } from "lit/decorators.js";
17
+ import _decorate from "@oxc-project/runtime/helpers/decorate";
18
+ import { createRef, ref } from "lit/directives/ref.js";
19
+ import { styleMap } from "lit/directives/style-map.js";
20
+ var ElementFilmstripController = class {
21
+ constructor(host, filmstrip) {
22
+ this.host = host;
23
+ this.filmstrip = filmstrip;
24
+ this.host.addController(this);
25
+ }
26
+ remove() {
27
+ this.host.removeController(this);
28
+ }
29
+ hostDisconnected() {
30
+ this.host.removeController(this);
31
+ }
32
+ hostUpdated() {
33
+ this.filmstrip.requestUpdate();
34
+ }
31
35
  };
32
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
33
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
34
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
35
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
36
- var _EFFilmstrip_instances, bindToTargetTimegroup_fn, _handleKeyPress, contextElement_get;
37
- class ElementFilmstripController {
38
- constructor(host, filmstrip) {
39
- this.host = host;
40
- this.filmstrip = filmstrip;
41
- this.host.addController(this);
42
- }
43
- remove() {
44
- this.host.removeController(this);
45
- }
46
- hostDisconnected() {
47
- this.host.removeController(this);
48
- }
49
- hostUpdated() {
50
- this.filmstrip.requestUpdate();
51
- }
52
- }
53
- const CommonEffectKeys = /* @__PURE__ */ new Set([
54
- "offset",
55
- "easing",
56
- "composite",
57
- "computedOffset"
36
+ const CommonEffectKeys = new Set([
37
+ "offset",
38
+ "easing",
39
+ "composite",
40
+ "computedOffset"
58
41
  ]);
59
- class FilmstripItem extends TWMixin(LitElement) {
60
- constructor() {
61
- super(...arguments);
62
- this.element = new EFTimegroup();
63
- this.pixelsPerMs = 0.04;
64
- }
65
- static {
66
- this.styles = [
67
- css`
42
+ var FilmstripItem = class extends TWMixin(LitElement) {
43
+ constructor(..._args) {
44
+ super(..._args);
45
+ this.element = new EFTimegroup();
46
+ this.pixelsPerMs = .04;
47
+ }
48
+ static {
49
+ this.styles = [css`
68
50
  :host {
69
51
  display: block;
70
52
  }
71
- `
72
- ];
73
- }
74
- get isFocused() {
75
- return this.element && this.focusContext?.focusedElement === this.element;
76
- }
77
- // Gutter styles represent the entire source media.
78
- // If there is no trim, then the gutter and trim portion are the same.
79
- get gutterStyles() {
80
- return {
81
- position: "relative",
82
- left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.sourceStartMs)}px`,
83
- width: `${this.pixelsPerMs * (this.element.intrinsicDurationMs ?? this.element.durationMs)}px`
84
- };
85
- }
86
- // Trim portion is the section of source that will be placed in the timeline
87
- // If there is no trim, then the gutter and trim portion are the same.
88
- get trimPortionStyles() {
89
- return {
90
- width: `${this.pixelsPerMs * this.element.durationMs}px`,
91
- left: `${this.pixelsPerMs * this.element.sourceStartMs}px`
92
- };
93
- }
94
- render() {
95
- return html`<div style=${styleMap(this.gutterStyles)}>
53
+ `];
54
+ }
55
+ get isFocused() {
56
+ return this.element && this.focusContext?.focusedElement === this.element;
57
+ }
58
+ get gutterStyles() {
59
+ return {
60
+ position: "relative",
61
+ left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.sourceStartMs)}px`,
62
+ width: `${this.pixelsPerMs * (this.element.intrinsicDurationMs ?? this.element.durationMs)}px`
63
+ };
64
+ }
65
+ get trimPortionStyles() {
66
+ return {
67
+ width: `${this.pixelsPerMs * this.element.durationMs}px`,
68
+ left: `${this.pixelsPerMs * this.element.sourceStartMs}px`
69
+ };
70
+ }
71
+ render() {
72
+ return html`<div style=${styleMap(this.gutterStyles)}>
96
73
  <div
97
74
  class="bg-slate-300"
98
75
  ?data-focused=${this.isFocused}
99
76
  @mouseenter=${() => {
100
- if (this.focusContext) {
101
- this.focusContext.focusedElement = this.element;
102
- }
103
- }}
77
+ if (this.focusContext) this.focusContext.focusedElement = this.element;
78
+ }}
104
79
  @mouseleave=${() => {
105
- if (this.focusContext) {
106
- this.focusContext.focusedElement = null;
107
- }
108
- }}
80
+ if (this.focusContext) this.focusContext.focusedElement = null;
81
+ }}
109
82
  >
110
83
  <div
111
84
  ?data-focused=${this.isFocused}
@@ -117,168 +90,133 @@ class FilmstripItem extends TWMixin(LitElement) {
117
90
  </div>
118
91
  ${this.renderChildren()}
119
92
  </div>`;
120
- }
121
- renderChildren() {
122
- return renderFilmstripChildren(
123
- Array.from(this.element.children),
124
- this.pixelsPerMs
125
- );
126
- }
127
- contents() {
128
- return html``;
129
- }
130
- animations() {
131
- const animations = this.element.getAnimations();
132
- return animations.map((animation) => {
133
- const effect = animation.effect;
134
- if (!(effect instanceof KeyframeEffect)) {
135
- return nothing;
136
- }
137
- const start = effect.getTiming().delay ?? 0;
138
- const duration = effect.getTiming().duration;
139
- if (duration === null) {
140
- return nothing;
141
- }
142
- const keyframes = effect.getKeyframes();
143
- const firstKeyframe = keyframes[0];
144
- if (!firstKeyframe) {
145
- return nothing;
146
- }
147
- const properties = new Set(Object.keys(firstKeyframe));
148
- for (const key of CommonEffectKeys) {
149
- properties.delete(key);
150
- }
151
- return html`<div
93
+ }
94
+ renderChildren() {
95
+ return renderFilmstripChildren(Array.from(this.element.children), this.pixelsPerMs);
96
+ }
97
+ contents() {
98
+ return html``;
99
+ }
100
+ animations() {
101
+ const animations = this.element.getAnimations();
102
+ return animations.map((animation) => {
103
+ const effect = animation.effect;
104
+ if (!(effect instanceof KeyframeEffect)) return nothing;
105
+ const start = effect.getTiming().delay ?? 0;
106
+ const duration = effect.getTiming().duration;
107
+ if (duration === null) return nothing;
108
+ const keyframes = effect.getKeyframes();
109
+ const firstKeyframe = keyframes[0];
110
+ if (!firstKeyframe) return nothing;
111
+ const properties = new Set(Object.keys(firstKeyframe));
112
+ for (const key of CommonEffectKeys) properties.delete(key);
113
+ return html`<div
152
114
  class="relative h-[5px] bg-blue-500 opacity-50"
153
115
  label="animation"
154
116
  style=${styleMap({
155
- left: `${this.pixelsPerMs * start}px`,
156
- width: `${this.pixelsPerMs * Number(duration)}px`
157
- })}
117
+ left: `${this.pixelsPerMs * start}px`,
118
+ width: `${this.pixelsPerMs * Number(duration)}px`
119
+ })}
158
120
  >
159
121
  <!-- <div class="text-nowrap">${Array.from(properties).join(" ")}</div> -->
160
122
  ${effect.getKeyframes().map((keyframe) => {
161
- return html`<div
123
+ return html`<div
162
124
  class="absolute top-0 h-full w-1 bg-red-500"
163
- style=${styleMap({
164
- left: `${this.pixelsPerMs * keyframe.computedOffset * Number(duration)}px`
165
- })}
125
+ style=${styleMap({ left: `${this.pixelsPerMs * keyframe.computedOffset * Number(duration)}px` })}
166
126
  ></div>`;
167
- })}
127
+ })}
168
128
  </div>`;
169
- });
170
- }
171
- update(changedProperties) {
172
- if (changedProperties.has("element") && this.element instanceof LitElement) {
173
- this.filmstripController?.remove();
174
- this.filmstripController = new ElementFilmstripController(
175
- this.element,
176
- this
177
- );
178
- }
179
- super.update(changedProperties);
180
- }
181
- }
182
- __decorateClass([
183
- consume({ context: focusContext, subscribe: true })
184
- ], FilmstripItem.prototype, "focusContext", 2);
185
- __decorateClass([
186
- consume({ context: focusedElementContext, subscribe: true })
187
- ], FilmstripItem.prototype, "focusedElement", 2);
188
- __decorateClass([
189
- property({ type: Object, attribute: false })
190
- ], FilmstripItem.prototype, "element", 2);
191
- __decorateClass([
192
- property({ type: Number })
193
- ], FilmstripItem.prototype, "pixelsPerMs", 2);
194
- let EFAudioFilmstrip = class extends FilmstripItem {
195
- contents() {
196
- return html``;
197
- }
129
+ });
130
+ }
131
+ update(changedProperties) {
132
+ if (changedProperties.has("element") && this.element instanceof LitElement) {
133
+ this.filmstripController?.remove();
134
+ this.filmstripController = new ElementFilmstripController(this.element, this);
135
+ }
136
+ super.update(changedProperties);
137
+ }
198
138
  };
199
- EFAudioFilmstrip = __decorateClass([
200
- customElement("ef-audio-filmstrip")
201
- ], EFAudioFilmstrip);
202
- let EFVideoFilmstrip = class extends FilmstripItem {
203
- contents() {
204
- return html` 📼 `;
205
- }
139
+ _decorate([consume({
140
+ context: focusContext,
141
+ subscribe: true
142
+ })], FilmstripItem.prototype, "focusContext", void 0);
143
+ _decorate([consume({
144
+ context: focusedElementContext,
145
+ subscribe: true
146
+ })], FilmstripItem.prototype, "focusedElement", void 0);
147
+ _decorate([property({
148
+ type: Object,
149
+ attribute: false
150
+ })], FilmstripItem.prototype, "element", void 0);
151
+ _decorate([property({ type: Number })], FilmstripItem.prototype, "pixelsPerMs", void 0);
152
+ let EFAudioFilmstrip = class EFAudioFilmstrip$1 extends FilmstripItem {
153
+ contents() {
154
+ return html``;
155
+ }
206
156
  };
207
- EFVideoFilmstrip = __decorateClass([
208
- customElement("ef-video-filmstrip")
209
- ], EFVideoFilmstrip);
210
- let EFCaptionsFilmstrip = class extends FilmstripItem {
211
- contents() {
212
- return html` 📝 `;
213
- }
157
+ EFAudioFilmstrip = _decorate([customElement("ef-audio-filmstrip")], EFAudioFilmstrip);
158
+ let EFVideoFilmstrip = class EFVideoFilmstrip$1 extends FilmstripItem {
159
+ contents() {
160
+ return html` 📼 `;
161
+ }
214
162
  };
215
- EFCaptionsFilmstrip = __decorateClass([
216
- customElement("ef-captions-filmstrip")
217
- ], EFCaptionsFilmstrip);
218
- let EFWaveformFilmstrip = class extends FilmstripItem {
219
- contents() {
220
- return html` 🌊 `;
221
- }
222
- renderChildren() {
223
- return nothing;
224
- }
163
+ EFVideoFilmstrip = _decorate([customElement("ef-video-filmstrip")], EFVideoFilmstrip);
164
+ let EFCaptionsFilmstrip = class EFCaptionsFilmstrip$1 extends FilmstripItem {
165
+ contents() {
166
+ return html` 📝 `;
167
+ }
225
168
  };
226
- EFWaveformFilmstrip = __decorateClass([
227
- customElement("ef-waveform-filmstrip")
228
- ], EFWaveformFilmstrip);
229
- let EFImageFilmstrip = class extends FilmstripItem {
230
- contents() {
231
- return html` 🖼️ `;
232
- }
169
+ EFCaptionsFilmstrip = _decorate([customElement("ef-captions-filmstrip")], EFCaptionsFilmstrip);
170
+ let EFWaveformFilmstrip = class EFWaveformFilmstrip$1 extends FilmstripItem {
171
+ contents() {
172
+ return html` 🌊 `;
173
+ }
174
+ renderChildren() {
175
+ return nothing;
176
+ }
233
177
  };
234
- EFImageFilmstrip = __decorateClass([
235
- customElement("ef-image-filmstrip")
236
- ], EFImageFilmstrip);
237
- let EFTimegroupFilmstrip = class extends FilmstripItem {
238
- contents() {
239
- return html`
178
+ EFWaveformFilmstrip = _decorate([customElement("ef-waveform-filmstrip")], EFWaveformFilmstrip);
179
+ let EFImageFilmstrip = class EFImageFilmstrip$1 extends FilmstripItem {
180
+ contents() {
181
+ return html` 🖼️ `;
182
+ }
183
+ };
184
+ EFImageFilmstrip = _decorate([customElement("ef-image-filmstrip")], EFImageFilmstrip);
185
+ let EFTimegroupFilmstrip = class EFTimegroupFilmstrip$1 extends FilmstripItem {
186
+ contents() {
187
+ return html`
240
188
  <span>TIME GROUP</span>
241
- ${renderFilmstripChildren(
242
- Array.from(this.element.children || []),
243
- this.pixelsPerMs
244
- )}
189
+ ${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs)}
245
190
  </div>
246
191
  `;
247
- }
192
+ }
248
193
  };
249
- EFTimegroupFilmstrip = __decorateClass([
250
- customElement("ef-timegroup-filmstrip")
251
- ], EFTimegroupFilmstrip);
252
- let EFHTMLFilmstrip = class extends FilmstripItem {
253
- contents() {
254
- return html`
194
+ EFTimegroupFilmstrip = _decorate([customElement("ef-timegroup-filmstrip")], EFTimegroupFilmstrip);
195
+ let EFHTMLFilmstrip = class EFHTMLFilmstrip$1 extends FilmstripItem {
196
+ contents() {
197
+ return html`
255
198
  <span>${this.element.tagName}</span>
256
- ${renderFilmstripChildren(
257
- Array.from(this.element.children || []),
258
- this.pixelsPerMs
259
- )}
199
+ ${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs)}
260
200
  `;
261
- }
201
+ }
262
202
  };
263
- EFHTMLFilmstrip = __decorateClass([
264
- customElement("ef-html-filmstrip")
265
- ], EFHTMLFilmstrip);
266
- let EFHierarchyItem = class extends TWMixin(LitElement) {
267
- constructor() {
268
- super(...arguments);
269
- this.element = new EFTimegroup();
270
- }
271
- get icon() {
272
- return "📼";
273
- }
274
- get isFocused() {
275
- return this.element && this.focusContext?.focusedElement === this.element;
276
- }
277
- displayLabel() {
278
- return nothing;
279
- }
280
- render() {
281
- return html`
203
+ EFHTMLFilmstrip = _decorate([customElement("ef-html-filmstrip")], EFHTMLFilmstrip);
204
+ let EFHierarchyItem = class EFHierarchyItem$1 extends TWMixin(LitElement) {
205
+ constructor(..._args2) {
206
+ super(..._args2);
207
+ this.element = new EFTimegroup();
208
+ }
209
+ get icon() {
210
+ return "📼";
211
+ }
212
+ get isFocused() {
213
+ return this.element && this.focusContext?.focusedElement === this.element;
214
+ }
215
+ displayLabel() {
216
+ return nothing;
217
+ }
218
+ render() {
219
+ return html`
282
220
  <div>
283
221
  <div
284
222
  class="peer
@@ -286,15 +224,11 @@ let EFHierarchyItem = class extends TWMixin(LitElement) {
286
224
  bg-slate-200 pl-2 text-xs font-mono hover:bg-slate-400 data-[focused]:bg-slate-400"
287
225
  ?data-focused=${this.isFocused}
288
226
  @mouseenter=${() => {
289
- if (this.focusContext) {
290
- this.focusContext.focusedElement = this.element;
291
- }
292
- }}
227
+ if (this.focusContext) this.focusContext.focusedElement = this.element;
228
+ }}
293
229
  @mouseleave=${() => {
294
- if (this.focusContext) {
295
- this.focusContext.focusedElement = null;
296
- }
297
- }}
230
+ if (this.focusContext) this.focusContext.focusedElement = null;
231
+ }}
298
232
  >
299
233
  ${this.icon} ${this.displayLabel()}
300
234
  </div>
@@ -304,328 +238,273 @@ let EFHierarchyItem = class extends TWMixin(LitElement) {
304
238
  ${this.renderChildren()}
305
239
  </div>
306
240
  </div>`;
307
- }
308
- renderChildren() {
309
- return renderHierarchyChildren(Array.from(this.element.children));
310
- }
241
+ }
242
+ renderChildren() {
243
+ return renderHierarchyChildren(Array.from(this.element.children));
244
+ }
311
245
  };
312
- __decorateClass([
313
- property({ type: Object, attribute: false })
314
- ], EFHierarchyItem.prototype, "element", 2);
315
- __decorateClass([
316
- consume({ context: focusContext })
317
- ], EFHierarchyItem.prototype, "focusContext", 2);
318
- __decorateClass([
319
- consume({ context: focusedElementContext, subscribe: true })
320
- ], EFHierarchyItem.prototype, "focusedElement", 2);
321
- EFHierarchyItem = __decorateClass([
322
- customElement("ef-hierarchy-item")
323
- ], EFHierarchyItem);
324
- let EFTimegroupHierarchyItem = class extends EFHierarchyItem {
325
- get icon() {
326
- return "🕒";
327
- }
328
- displayLabel() {
329
- return this.element.mode ?? "(no mode)";
330
- }
246
+ _decorate([property({
247
+ type: Object,
248
+ attribute: false
249
+ })], EFHierarchyItem.prototype, "element", void 0);
250
+ _decorate([consume({ context: focusContext })], EFHierarchyItem.prototype, "focusContext", void 0);
251
+ _decorate([consume({
252
+ context: focusedElementContext,
253
+ subscribe: true
254
+ })], EFHierarchyItem.prototype, "focusedElement", void 0);
255
+ EFHierarchyItem = _decorate([customElement("ef-hierarchy-item")], EFHierarchyItem);
256
+ let EFTimegroupHierarchyItem = class EFTimegroupHierarchyItem$1 extends EFHierarchyItem {
257
+ get icon() {
258
+ return "🕒";
259
+ }
260
+ displayLabel() {
261
+ return this.element.mode ?? "(no mode)";
262
+ }
331
263
  };
332
- EFTimegroupHierarchyItem = __decorateClass([
333
- customElement("ef-timegroup-hierarchy-item")
334
- ], EFTimegroupHierarchyItem);
335
- let EFAudioHierarchyItem = class extends EFHierarchyItem {
336
- get icon() {
337
- return "🔊";
338
- }
339
- displayLabel() {
340
- return this.element.src ?? "(no src)";
341
- }
264
+ EFTimegroupHierarchyItem = _decorate([customElement("ef-timegroup-hierarchy-item")], EFTimegroupHierarchyItem);
265
+ let EFAudioHierarchyItem = class EFAudioHierarchyItem$1 extends EFHierarchyItem {
266
+ get icon() {
267
+ return "🔊";
268
+ }
269
+ displayLabel() {
270
+ return this.element.src ?? "(no src)";
271
+ }
342
272
  };
343
- EFAudioHierarchyItem = __decorateClass([
344
- customElement("ef-audio-hierarchy-item")
345
- ], EFAudioHierarchyItem);
346
- let EFVideoHierarchyItem = class extends EFHierarchyItem {
347
- get icon() {
348
- return "📼";
349
- }
350
- displayLabel() {
351
- return this.element.src ?? "(no src)";
352
- }
273
+ EFAudioHierarchyItem = _decorate([customElement("ef-audio-hierarchy-item")], EFAudioHierarchyItem);
274
+ let EFVideoHierarchyItem = class EFVideoHierarchyItem$1 extends EFHierarchyItem {
275
+ get icon() {
276
+ return "📼";
277
+ }
278
+ displayLabel() {
279
+ return this.element.src ?? "(no src)";
280
+ }
353
281
  };
354
- EFVideoHierarchyItem = __decorateClass([
355
- customElement("ef-video-hierarchy-item")
356
- ], EFVideoHierarchyItem);
357
- let EFCaptionsHierarchyItem = class extends EFHierarchyItem {
358
- get icon() {
359
- return "📝 Captions";
360
- }
282
+ EFVideoHierarchyItem = _decorate([customElement("ef-video-hierarchy-item")], EFVideoHierarchyItem);
283
+ let EFCaptionsHierarchyItem = class EFCaptionsHierarchyItem$1 extends EFHierarchyItem {
284
+ get icon() {
285
+ return "📝 Captions";
286
+ }
361
287
  };
362
- EFCaptionsHierarchyItem = __decorateClass([
363
- customElement("ef-captions-hierarchy-item")
364
- ], EFCaptionsHierarchyItem);
365
- let EFCaptionsActiveWordHierarchyItem = class extends EFHierarchyItem {
366
- get icon() {
367
- return "🗣️ Active Word";
368
- }
288
+ EFCaptionsHierarchyItem = _decorate([customElement("ef-captions-hierarchy-item")], EFCaptionsHierarchyItem);
289
+ let EFCaptionsActiveWordHierarchyItem = class EFCaptionsActiveWordHierarchyItem$1 extends EFHierarchyItem {
290
+ get icon() {
291
+ return "🗣️ Active Word";
292
+ }
369
293
  };
370
- EFCaptionsActiveWordHierarchyItem = __decorateClass([
371
- customElement("ef-captions-active-word-hierarchy-item")
372
- ], EFCaptionsActiveWordHierarchyItem);
373
- let EFWaveformHierarchyItem = class extends EFHierarchyItem {
374
- get icon() {
375
- return "🌊";
376
- }
377
- renderChildren() {
378
- return nothing;
379
- }
294
+ EFCaptionsActiveWordHierarchyItem = _decorate([customElement("ef-captions-active-word-hierarchy-item")], EFCaptionsActiveWordHierarchyItem);
295
+ let EFWaveformHierarchyItem = class EFWaveformHierarchyItem$1 extends EFHierarchyItem {
296
+ get icon() {
297
+ return "🌊";
298
+ }
299
+ renderChildren() {
300
+ return nothing;
301
+ }
380
302
  };
381
- EFWaveformHierarchyItem = __decorateClass([
382
- customElement("ef-waveform-hierarchy-item")
383
- ], EFWaveformHierarchyItem);
384
- let EFImageHierarchyItem = class extends EFHierarchyItem {
385
- get icon() {
386
- return "🖼️";
387
- }
388
- displayLabel() {
389
- return this.element.src ?? "(no src)";
390
- }
303
+ EFWaveformHierarchyItem = _decorate([customElement("ef-waveform-hierarchy-item")], EFWaveformHierarchyItem);
304
+ let EFImageHierarchyItem = class EFImageHierarchyItem$1 extends EFHierarchyItem {
305
+ get icon() {
306
+ return "🖼️";
307
+ }
308
+ displayLabel() {
309
+ return this.element.src ?? "(no src)";
310
+ }
391
311
  };
392
- EFImageHierarchyItem = __decorateClass([
393
- customElement("ef-image-hierarchy-item")
394
- ], EFImageHierarchyItem);
395
- let EFHTMLHierarchyItem = class extends EFHierarchyItem {
396
- get icon() {
397
- return html`<code>${`<${this.element.tagName.toLowerCase()}>`}</code>`;
398
- }
312
+ EFImageHierarchyItem = _decorate([customElement("ef-image-hierarchy-item")], EFImageHierarchyItem);
313
+ let EFHTMLHierarchyItem = class EFHTMLHierarchyItem$1 extends EFHierarchyItem {
314
+ get icon() {
315
+ return html`<code>${`<${this.element.tagName.toLowerCase()}>`}</code>`;
316
+ }
399
317
  };
400
- EFHTMLHierarchyItem = __decorateClass([
401
- customElement("ef-html-hierarchy-item")
402
- ], EFHTMLHierarchyItem);
318
+ EFHTMLHierarchyItem = _decorate([customElement("ef-html-hierarchy-item")], EFHTMLHierarchyItem);
403
319
  const renderHierarchyChildren = (children) => {
404
- return children.map((child) => {
405
- if (child instanceof HTMLElement && child.dataset?.efHidden) {
406
- return nothing;
407
- }
408
- if (child instanceof EFTimegroup) {
409
- return html`<ef-timegroup-hierarchy-item
320
+ return children.map((child) => {
321
+ if (child instanceof HTMLElement && child.dataset?.efHidden) return nothing;
322
+ if (child instanceof EFTimegroup) return html`<ef-timegroup-hierarchy-item
410
323
  .element=${child}
411
324
  ></ef-timegroup-hierarchy-item>`;
412
- }
413
- if (child instanceof EFImage) {
414
- return html`<ef-image-hierarchy-item
325
+ if (child instanceof EFImage) return html`<ef-image-hierarchy-item
415
326
  .element=${child}
416
327
  ></ef-image-hierarchy-item>`;
417
- }
418
- if (child instanceof EFAudio) {
419
- return html`<ef-audio-hierarchy-item
328
+ if (child instanceof EFAudio) return html`<ef-audio-hierarchy-item
420
329
  .element=${child}
421
330
  ></ef-audio-hierarchy-item>`;
422
- }
423
- if (child instanceof EFVideo) {
424
- return html`<ef-video-hierarchy-item
331
+ if (child instanceof EFVideo) return html`<ef-video-hierarchy-item
425
332
  .element=${child}
426
333
  ></ef-video-hierarchy-item>`;
427
- }
428
- if (child instanceof EFCaptions) {
429
- return html`<ef-captions-hierarchy-item
334
+ if (child instanceof EFCaptions) return html`<ef-captions-hierarchy-item
430
335
  .element=${child}
431
336
  ></ef-captions-hierarchy-item>`;
432
- }
433
- if (child instanceof EFCaptionsActiveWord) {
434
- return html`<ef-captions-active-word-hierarchy-item
337
+ if (child instanceof EFCaptionsActiveWord) return html`<ef-captions-active-word-hierarchy-item
435
338
  .element=${child}
436
339
  ></ef-captions-active-word-hierarchy-item>`;
437
- }
438
- if (child instanceof EFWaveform) {
439
- return html`<ef-waveform-hierarchy-item
340
+ if (child instanceof EFWaveform) return html`<ef-waveform-hierarchy-item
440
341
  .element=${child}
441
342
  ></ef-waveform-hierarchy-item>`;
442
- }
443
- return html`<ef-html-hierarchy-item
343
+ return html`<ef-html-hierarchy-item
444
344
  .element=${child}
445
345
  ></ef-html-hierarchy-item>`;
446
- });
346
+ });
447
347
  };
448
348
  const renderFilmstripChildren = (children, pixelsPerMs) => {
449
- return children.map((child) => {
450
- if (child instanceof HTMLElement && child.dataset?.efHidden) {
451
- return nothing;
452
- }
453
- if (child instanceof EFTimegroup) {
454
- return html`<ef-timegroup-filmstrip
349
+ return children.map((child) => {
350
+ if (child instanceof HTMLElement && child.dataset?.efHidden) return nothing;
351
+ if (child instanceof EFTimegroup) return html`<ef-timegroup-filmstrip
455
352
  .element=${child}
456
353
  .pixelsPerMs=${pixelsPerMs}
457
354
  >
458
355
  </ef-timegroup-filmstrip>`;
459
- }
460
- if (child instanceof EFImage) {
461
- return html`<ef-image-filmstrip
356
+ if (child instanceof EFImage) return html`<ef-image-filmstrip
462
357
  .element=${child}
463
358
  .pixelsPerMs=${pixelsPerMs}
464
359
  ></ef-image-filmstrip>`;
465
- }
466
- if (child instanceof EFAudio) {
467
- return html`<ef-audio-filmstrip
360
+ if (child instanceof EFAudio) return html`<ef-audio-filmstrip
468
361
  .element=${child}
469
362
  .pixelsPerMs=${pixelsPerMs}
470
363
  ></ef-audio-filmstrip>`;
471
- }
472
- if (child instanceof EFVideo) {
473
- return html`<ef-video-filmstrip
364
+ if (child instanceof EFVideo) return html`<ef-video-filmstrip
474
365
  .element=${child}
475
366
  .pixelsPerMs=${pixelsPerMs}
476
367
  ></ef-video-filmstrip>`;
477
- }
478
- if (child instanceof EFCaptions) {
479
- return html`<ef-captions-filmstrip
368
+ if (child instanceof EFCaptions) return html`<ef-captions-filmstrip
480
369
  .element=${child}
481
370
  .pixelsPerMs=${pixelsPerMs}
482
371
  ></ef-captions-filmstrip>`;
483
- }
484
- if (child instanceof EFWaveform) {
485
- return html`<ef-waveform-filmstrip
372
+ if (child instanceof EFWaveform) return html`<ef-waveform-filmstrip
486
373
  .element=${child}
487
374
  .pixelsPerMs=${pixelsPerMs}
488
375
  ></ef-waveform-filmstrip>`;
489
- }
490
- return html`<ef-html-filmstrip
376
+ return html`<ef-html-filmstrip
491
377
  .element=${child}
492
378
  .pixelsPerMs=${pixelsPerMs}
493
379
  ></ef-html-filmstrip>`;
494
- });
380
+ });
495
381
  };
496
- let EFFilmstrip = class extends TWMixin(LitElement) {
497
- constructor() {
498
- super(...arguments);
499
- __privateAdd(this, _EFFilmstrip_instances);
500
- this.pixelsPerMs = 0.04;
501
- this.scrubbing = false;
502
- this.timelineScrolltop = 0;
503
- this.currentTimeMs = 0;
504
- this.autoScale = false;
505
- this.resizeObserver = new ResizeObserver(() => {
506
- if (this.autoScale) {
507
- this.updatePixelsPerMs();
508
- }
509
- });
510
- __privateAdd(this, _handleKeyPress, (event) => {
511
- if (event.key === " ") {
512
- const [target] = event.composedPath();
513
- const interactiveSelector = "input, textarea, button, select, a, [contenteditable]";
514
- const closestInteractive = target?.closest(
515
- interactiveSelector
516
- );
517
- if (closestInteractive) {
518
- return;
519
- }
520
- event.preventDefault();
521
- if (__privateGet(this, _EFFilmstrip_instances, contextElement_get)) {
522
- __privateGet(this, _EFFilmstrip_instances, contextElement_get).playing = !__privateGet(this, _EFFilmstrip_instances, contextElement_get).playing;
523
- }
524
- }
525
- });
526
- this.gutterRef = createRef();
527
- this.hierarchyRef = createRef();
528
- this.playheadRef = createRef();
529
- }
530
- connectedCallback() {
531
- super.connectedCallback();
532
- __privateMethod(this, _EFFilmstrip_instances, bindToTargetTimegroup_fn).call(this);
533
- window.addEventListener("keypress", __privateGet(this, _handleKeyPress));
534
- this.resizeObserver.observe(this);
535
- }
536
- disconnectedCallback() {
537
- super.disconnectedCallback();
538
- window.removeEventListener("keypress", __privateGet(this, _handleKeyPress));
539
- this.resizeObserver.disconnect();
540
- }
541
- updatePixelsPerMs() {
542
- const target = this.targetTimegroup;
543
- const gutter = this.gutterRef.value;
544
- if (target && gutter && gutter.clientWidth > 0) {
545
- this.pixelsPerMs = gutter.clientWidth / (target.durationMs || 1);
546
- }
547
- }
548
- syncGutterScroll() {
549
- if (this.gutter && this.hierarchyRef.value) {
550
- this.hierarchyRef.value.scrollTop = this.gutter.scrollTop;
551
- this.timelineScrolltop = this.gutter.scrollTop;
552
- }
553
- }
554
- syncHierarchyScroll() {
555
- if (this.gutter && this.hierarchyRef.value) {
556
- this.gutter.scrollTop = this.hierarchyRef.value.scrollTop;
557
- this.timelineScrolltop = this.hierarchyRef.value.scrollTop;
558
- }
559
- }
560
- scrub(e) {
561
- if (this.playing) {
562
- return;
563
- }
564
- if (!this.scrubbing) {
565
- return;
566
- }
567
- const gutter = this.shadowRoot?.querySelector("#gutter");
568
- if (!gutter) {
569
- return;
570
- }
571
- const rect = gutter.getBoundingClientRect();
572
- if (this.targetTimegroup) {
573
- const layerX = e.pageX - rect.left + gutter.scrollLeft;
574
- this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
575
- }
576
- }
577
- startScrub(e) {
578
- e.preventDefault();
579
- this.scrubbing = true;
580
- queueMicrotask(() => {
581
- const gutter = this.shadowRoot?.querySelector("#gutter");
582
- if (!gutter) {
583
- return;
584
- }
585
- const rect = gutter.getBoundingClientRect();
586
- if (this.targetTimegroup) {
587
- const layerX = e.pageX - rect.left + gutter.scrollLeft;
588
- this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
589
- }
590
- });
591
- addEventListener(
592
- "mouseup",
593
- () => {
594
- this.scrubbing = false;
595
- },
596
- { once: true }
597
- );
598
- }
599
- scrollScrub(e) {
600
- if (this.targetTimegroup && this.gutter && !this.playing) {
601
- if (e.deltaX !== 0) {
602
- e.preventDefault();
603
- }
604
- if (this.gutterRef.value && this.gutterRef.value.scrollLeft === 0 && e.deltaX < 0) {
605
- this.gutter.scrollBy(0, e.deltaY);
606
- return;
607
- }
608
- if (this.gutter.scrollWidth - this.gutter.scrollLeft === this.gutter.clientWidth && e.deltaX > 0) {
609
- this.gutter.scrollBy(0, e.deltaY);
610
- return;
611
- }
612
- if (this) {
613
- this.gutter.scrollBy(e.deltaX, e.deltaY);
614
- this.targetTimegroup.currentTimeMs += e.deltaX / this.pixelsPerMs;
382
+ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
383
+ constructor(..._args3) {
384
+ super(..._args3);
385
+ this.pixelsPerMs = .04;
386
+ this.scrubbing = false;
387
+ this.timelineScrolltop = 0;
388
+ this.currentTimeMs = 0;
389
+ this.autoScale = false;
390
+ this.resizeObserver = new ResizeObserver(() => {
391
+ if (this.autoScale) this.updatePixelsPerMs();
392
+ });
393
+ this.gutterRef = createRef();
394
+ this.hierarchyRef = createRef();
395
+ this.playheadRef = createRef();
396
+ }
397
+ static {
398
+ this.styles = [css`
399
+ :host {
400
+ display: block;
401
+ overflow: hidden;
402
+ width: 100%;
403
+ height: 100%;
615
404
  }
616
- }
617
- }
618
- get gutter() {
619
- return this.gutterRef.value;
620
- }
621
- render() {
622
- const target = this.targetTimegroup;
623
- return html` <div
405
+ `];
406
+ }
407
+ connectedCallback() {
408
+ super.connectedCallback();
409
+ this.#bindToTargetTimegroup();
410
+ window.addEventListener("keypress", this.#handleKeyPress);
411
+ this.resizeObserver.observe(this);
412
+ }
413
+ disconnectedCallback() {
414
+ super.disconnectedCallback();
415
+ window.removeEventListener("keypress", this.#handleKeyPress);
416
+ this.resizeObserver.disconnect();
417
+ }
418
+ updatePixelsPerMs() {
419
+ const target = this.targetTimegroup;
420
+ const gutter = this.gutterRef.value;
421
+ if (target && gutter && gutter.clientWidth > 0) this.pixelsPerMs = gutter.clientWidth / (target.durationMs || 1);
422
+ }
423
+ #bindToTargetTimegroup() {
424
+ if (this.timegroupController) this.timegroupController.remove();
425
+ const target = this.targetTimegroup;
426
+ if (target) {
427
+ this.timegroupController = new TimegroupController(target, this);
428
+ this.currentTimeMs = target.currentTimeMs;
429
+ }
430
+ }
431
+ #handleKeyPress = (event) => {
432
+ if (event.key === " ") {
433
+ const [target] = event.composedPath();
434
+ const interactiveSelector = "input, textarea, button, select, a, [contenteditable]";
435
+ const closestInteractive = target?.closest(interactiveSelector);
436
+ if (closestInteractive) return;
437
+ event.preventDefault();
438
+ if (this.#contextElement) this.#contextElement.playing = !this.#contextElement.playing;
439
+ }
440
+ };
441
+ syncGutterScroll() {
442
+ if (this.gutter && this.hierarchyRef.value) {
443
+ this.hierarchyRef.value.scrollTop = this.gutter.scrollTop;
444
+ this.timelineScrolltop = this.gutter.scrollTop;
445
+ }
446
+ }
447
+ syncHierarchyScroll() {
448
+ if (this.gutter && this.hierarchyRef.value) {
449
+ this.gutter.scrollTop = this.hierarchyRef.value.scrollTop;
450
+ this.timelineScrolltop = this.hierarchyRef.value.scrollTop;
451
+ }
452
+ }
453
+ scrub(e) {
454
+ if (this.playing) return;
455
+ if (!this.scrubbing) return;
456
+ const gutter = this.shadowRoot?.querySelector("#gutter");
457
+ if (!gutter) return;
458
+ const rect = gutter.getBoundingClientRect();
459
+ if (this.targetTimegroup) {
460
+ const layerX = e.pageX - rect.left + gutter.scrollLeft;
461
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
462
+ }
463
+ }
464
+ startScrub(e) {
465
+ e.preventDefault();
466
+ this.scrubbing = true;
467
+ queueMicrotask(() => {
468
+ const gutter = this.shadowRoot?.querySelector("#gutter");
469
+ if (!gutter) return;
470
+ const rect = gutter.getBoundingClientRect();
471
+ if (this.targetTimegroup) {
472
+ const layerX = e.pageX - rect.left + gutter.scrollLeft;
473
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
474
+ }
475
+ });
476
+ addEventListener("mouseup", () => {
477
+ this.scrubbing = false;
478
+ }, { once: true });
479
+ }
480
+ scrollScrub(e) {
481
+ if (this.targetTimegroup && this.gutter && !this.playing) {
482
+ if (e.deltaX !== 0) e.preventDefault();
483
+ if (this.gutterRef.value && this.gutterRef.value.scrollLeft === 0 && e.deltaX < 0) {
484
+ this.gutter.scrollBy(0, e.deltaY);
485
+ return;
486
+ }
487
+ if (this.gutter.scrollWidth - this.gutter.scrollLeft === this.gutter.clientWidth && e.deltaX > 0) {
488
+ this.gutter.scrollBy(0, e.deltaY);
489
+ return;
490
+ }
491
+ if (this) {
492
+ this.gutter.scrollBy(e.deltaX, e.deltaY);
493
+ this.targetTimegroup.currentTimeMs += e.deltaX / this.pixelsPerMs;
494
+ }
495
+ }
496
+ }
497
+ get gutter() {
498
+ return this.gutterRef.value;
499
+ }
500
+ render() {
501
+ const target = this.targetTimegroup;
502
+ return html` <div
624
503
  class="grid h-full bg-slate-100"
625
504
  style=${styleMap({
626
- gridTemplateColumns: "200px 1fr",
627
- gridTemplateRows: "1.5rem 1fr"
628
- })}
505
+ gridTemplateColumns: "200px 1fr",
506
+ gridTemplateRows: "1.5rem 1fr"
507
+ })}
629
508
  >
630
509
  <div
631
510
  class="z-20 col-span-2 border-b-slate-600 bg-slate-100 shadow shadow-slate-300"
@@ -637,9 +516,9 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
637
516
  max="0.1"
638
517
  step="0.001"
639
518
  @input=${(e) => {
640
- const target2 = e.target;
641
- this.pixelsPerMs = Number.parseFloat(target2.value);
642
- }}
519
+ const target$1 = e.target;
520
+ this.pixelsPerMs = Number.parseFloat(target$1.value);
521
+ }}
643
522
  />` : nothing}
644
523
  <code>${msToTimeCode(this.currentTimeMs, true)} </code> /
645
524
  <code>${msToTimeCode(target?.durationMs ?? 0, true)}</code>
@@ -676,9 +555,9 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
676
555
  <div
677
556
  class="border-red pointer-events-none absolute z-10 h-full w-[2px] border-r-2 border-red-700"
678
557
  style=${styleMap({
679
- left: `${this.pixelsPerMs * this.currentTimeMs}px`,
680
- top: `${this.timelineScrolltop}px`
681
- })}
558
+ left: `${this.pixelsPerMs * this.currentTimeMs}px`,
559
+ top: `${this.timelineScrolltop}px`
560
+ })}
682
561
  ${ref(this.playheadRef)}
683
562
  ></div>
684
563
 
@@ -686,107 +565,48 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
686
565
  </div>
687
566
  </div>
688
567
  </div>`;
689
- }
690
- updated(changes) {
691
- if (!this.targetTimegroup) {
692
- return;
693
- }
694
- if (changes.has("currentTimeMs")) {
695
- if (this.targetTimegroup.currentTimeMs !== this.currentTimeMs) {
696
- this.targetTimegroup.currentTimeMs = this.currentTimeMs;
697
- }
698
- }
699
- }
700
- willUpdate(changedProperties) {
701
- if (changedProperties.has("targetTimegroup")) {
702
- __privateMethod(this, _EFFilmstrip_instances, bindToTargetTimegroup_fn).call(this);
703
- }
704
- if (this.autoScale) {
705
- this.updatePixelsPerMs();
706
- }
707
- super.willUpdate(changedProperties);
708
- }
709
- };
710
- _EFFilmstrip_instances = /* @__PURE__ */ new WeakSet();
711
- bindToTargetTimegroup_fn = function() {
712
- if (this.timegroupController) {
713
- this.timegroupController.remove();
714
- }
715
- const target = this.targetTimegroup;
716
- if (target) {
717
- this.timegroupController = new TimegroupController(target, this);
718
- this.currentTimeMs = target.currentTimeMs;
719
- }
720
- };
721
- _handleKeyPress = /* @__PURE__ */ new WeakMap();
722
- contextElement_get = function() {
723
- return this.closest("ef-workbench, ef-preview");
724
- };
725
- EFFilmstrip.styles = [
726
- css`
727
- :host {
728
- display: block;
729
- overflow: hidden;
730
- width: 100%;
731
- height: 100%;
732
- }
733
- `
734
- ];
735
- __decorateClass([
736
- property({ type: Number })
737
- ], EFFilmstrip.prototype, "pixelsPerMs", 2);
738
- __decorateClass([
739
- state()
740
- ], EFFilmstrip.prototype, "scrubbing", 2);
741
- __decorateClass([
742
- state()
743
- ], EFFilmstrip.prototype, "timelineScrolltop", 2);
744
- __decorateClass([
745
- consume({ context: playingContext, subscribe: true }),
746
- state()
747
- ], EFFilmstrip.prototype, "playing", 2);
748
- __decorateClass([
749
- consume({ context: loopContext, subscribe: true }),
750
- state()
751
- ], EFFilmstrip.prototype, "loop", 2);
752
- __decorateClass([
753
- state()
754
- ], EFFilmstrip.prototype, "currentTimeMs", 2);
755
- __decorateClass([
756
- property({ type: Boolean, reflect: true, attribute: "auto-scale" })
757
- ], EFFilmstrip.prototype, "autoScale", 2);
758
- __decorateClass([
759
- eventOptions({ passive: false })
760
- ], EFFilmstrip.prototype, "syncGutterScroll", 1);
761
- __decorateClass([
762
- eventOptions({ passive: false })
763
- ], EFFilmstrip.prototype, "syncHierarchyScroll", 1);
764
- __decorateClass([
765
- eventOptions({ capture: false })
766
- ], EFFilmstrip.prototype, "scrub", 1);
767
- __decorateClass([
768
- eventOptions({ capture: false })
769
- ], EFFilmstrip.prototype, "startScrub", 1);
770
- __decorateClass([
771
- eventOptions({ passive: false })
772
- ], EFFilmstrip.prototype, "scrollScrub", 1);
773
- __decorateClass([
774
- property({ type: String })
775
- ], EFFilmstrip.prototype, "target", 2);
776
- __decorateClass([
777
- consume({ context: targetTimegroupContext, subscribe: true }),
778
- state()
779
- ], EFFilmstrip.prototype, "targetTimegroup", 2);
780
- EFFilmstrip = __decorateClass([
781
- customElement("ef-filmstrip")
782
- ], EFFilmstrip);
783
- export {
784
- EFAudioFilmstrip,
785
- EFCaptionsFilmstrip,
786
- EFFilmstrip,
787
- EFHTMLFilmstrip,
788
- EFImageFilmstrip,
789
- EFTimegroupFilmstrip,
790
- EFVideoFilmstrip,
791
- EFWaveformFilmstrip
568
+ }
569
+ updated(changes) {
570
+ if (!this.targetTimegroup) return;
571
+ if (changes.has("currentTimeMs")) {
572
+ if (this.targetTimegroup.currentTimeMs !== this.currentTimeMs) this.targetTimegroup.currentTimeMs = this.currentTimeMs;
573
+ }
574
+ }
575
+ get #contextElement() {
576
+ return this.closest("ef-workbench, ef-preview");
577
+ }
578
+ willUpdate(changedProperties) {
579
+ if (changedProperties.has("targetTimegroup")) this.#bindToTargetTimegroup();
580
+ if (this.autoScale) this.updatePixelsPerMs();
581
+ super.willUpdate(changedProperties);
582
+ }
792
583
  };
584
+ _decorate([property({ type: Number })], EFFilmstrip.prototype, "pixelsPerMs", void 0);
585
+ _decorate([state()], EFFilmstrip.prototype, "scrubbing", void 0);
586
+ _decorate([state()], EFFilmstrip.prototype, "timelineScrolltop", void 0);
587
+ _decorate([consume({
588
+ context: playingContext,
589
+ subscribe: true
590
+ }), state()], EFFilmstrip.prototype, "playing", void 0);
591
+ _decorate([consume({
592
+ context: loopContext,
593
+ subscribe: true
594
+ }), state()], EFFilmstrip.prototype, "loop", void 0);
595
+ _decorate([state()], EFFilmstrip.prototype, "currentTimeMs", void 0);
596
+ _decorate([property({
597
+ type: Boolean,
598
+ reflect: true,
599
+ attribute: "auto-scale"
600
+ })], EFFilmstrip.prototype, "autoScale", void 0);
601
+ _decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "syncGutterScroll", null);
602
+ _decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "syncHierarchyScroll", null);
603
+ _decorate([eventOptions({ capture: false })], EFFilmstrip.prototype, "scrub", null);
604
+ _decorate([eventOptions({ capture: false })], EFFilmstrip.prototype, "startScrub", null);
605
+ _decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "scrollScrub", null);
606
+ _decorate([property({ type: String })], EFFilmstrip.prototype, "target", void 0);
607
+ _decorate([consume({
608
+ context: targetTimegroupContext,
609
+ subscribe: true
610
+ }), state()], EFFilmstrip.prototype, "targetTimegroup", void 0);
611
+ EFFilmstrip = _decorate([customElement("ef-filmstrip")], EFFilmstrip);
612
+ export { EFFilmstrip };