@editframe/elements 0.20.4-beta.0 → 0.23.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.
- package/dist/DelayedLoadingState.js +0 -27
- package/dist/EF_FRAMEGEN.d.ts +5 -3
- package/dist/EF_FRAMEGEN.js +49 -11
- package/dist/_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js +7 -0
- package/dist/attachContextRoot.d.ts +1 -0
- package/dist/attachContextRoot.js +9 -0
- package/dist/elements/ContextProxiesController.d.ts +1 -2
- package/dist/elements/EFAudio.js +5 -9
- package/dist/elements/EFCaptions.d.ts +1 -3
- package/dist/elements/EFCaptions.js +112 -129
- package/dist/elements/EFImage.js +6 -7
- package/dist/elements/EFMedia/AssetIdMediaEngine.js +2 -5
- package/dist/elements/EFMedia/AssetMediaEngine.js +36 -33
- package/dist/elements/EFMedia/BaseMediaEngine.js +57 -73
- package/dist/elements/EFMedia/BufferedSeekingInput.d.ts +1 -1
- package/dist/elements/EFMedia/BufferedSeekingInput.js +134 -78
- package/dist/elements/EFMedia/JitMediaEngine.js +9 -19
- package/dist/elements/EFMedia/audioTasks/makeAudioBufferTask.js +7 -13
- package/dist/elements/EFMedia/audioTasks/makeAudioFrequencyAnalysisTask.js +2 -3
- package/dist/elements/EFMedia/audioTasks/makeAudioInitSegmentFetchTask.js +1 -1
- package/dist/elements/EFMedia/audioTasks/makeAudioInputTask.js +6 -5
- package/dist/elements/EFMedia/audioTasks/makeAudioSeekTask.js +1 -3
- package/dist/elements/EFMedia/audioTasks/makeAudioSegmentFetchTask.js +1 -1
- package/dist/elements/EFMedia/audioTasks/makeAudioSegmentIdTask.js +1 -1
- package/dist/elements/EFMedia/audioTasks/makeAudioTimeDomainAnalysisTask.js +1 -1
- package/dist/elements/EFMedia/shared/AudioSpanUtils.js +9 -25
- package/dist/elements/EFMedia/shared/BufferUtils.js +2 -17
- package/dist/elements/EFMedia/shared/GlobalInputCache.js +0 -24
- package/dist/elements/EFMedia/shared/PrecisionUtils.js +0 -21
- package/dist/elements/EFMedia/shared/ThumbnailExtractor.js +0 -17
- package/dist/elements/EFMedia/tasks/makeMediaEngineTask.js +1 -10
- package/dist/elements/EFMedia/videoTasks/MainVideoInputCache.d.ts +29 -0
- package/dist/elements/EFMedia/videoTasks/MainVideoInputCache.js +32 -0
- package/dist/elements/EFMedia/videoTasks/ScrubInputCache.js +1 -15
- package/dist/elements/EFMedia/videoTasks/makeScrubVideoBufferTask.js +1 -7
- package/dist/elements/EFMedia/videoTasks/makeScrubVideoInputTask.js +8 -5
- package/dist/elements/EFMedia/videoTasks/makeScrubVideoSeekTask.js +12 -13
- package/dist/elements/EFMedia/videoTasks/makeScrubVideoSegmentIdTask.js +1 -1
- package/dist/elements/EFMedia/videoTasks/makeUnifiedVideoSeekTask.js +134 -70
- package/dist/elements/EFMedia/videoTasks/makeVideoBufferTask.js +11 -18
- package/dist/elements/EFMedia.d.ts +19 -0
- package/dist/elements/EFMedia.js +44 -25
- package/dist/elements/EFSourceMixin.js +5 -7
- package/dist/elements/EFSurface.js +6 -9
- package/dist/elements/EFTemporal.browsertest.d.ts +11 -0
- package/dist/elements/EFTemporal.d.ts +10 -0
- package/dist/elements/EFTemporal.js +100 -41
- package/dist/elements/EFThumbnailStrip.js +23 -73
- package/dist/elements/EFTimegroup.browsertest.d.ts +3 -3
- package/dist/elements/EFTimegroup.d.ts +35 -14
- package/dist/elements/EFTimegroup.js +138 -181
- package/dist/elements/EFVideo.d.ts +16 -2
- package/dist/elements/EFVideo.js +156 -108
- package/dist/elements/EFWaveform.js +23 -40
- package/dist/elements/SampleBuffer.js +3 -7
- package/dist/elements/TargetController.js +5 -5
- package/dist/elements/durationConverter.js +4 -4
- package/dist/elements/renderTemporalAudio.d.ts +10 -0
- package/dist/elements/renderTemporalAudio.js +35 -0
- package/dist/elements/updateAnimations.js +19 -43
- package/dist/gui/ContextMixin.d.ts +5 -5
- package/dist/gui/ContextMixin.js +167 -162
- package/dist/gui/Controllable.browsertest.d.ts +0 -0
- package/dist/gui/Controllable.d.ts +15 -0
- package/dist/gui/Controllable.js +9 -0
- package/dist/gui/EFConfiguration.js +7 -7
- package/dist/gui/EFControls.browsertest.d.ts +11 -0
- package/dist/gui/EFControls.d.ts +18 -4
- package/dist/gui/EFControls.js +70 -28
- package/dist/gui/EFDial.browsertest.d.ts +0 -0
- package/dist/gui/EFDial.d.ts +18 -0
- package/dist/gui/EFDial.js +141 -0
- package/dist/gui/EFFilmstrip.browsertest.d.ts +11 -0
- package/dist/gui/EFFilmstrip.d.ts +12 -2
- package/dist/gui/EFFilmstrip.js +214 -129
- package/dist/gui/EFFitScale.js +5 -8
- package/dist/gui/EFFocusOverlay.js +4 -4
- package/dist/gui/EFPause.browsertest.d.ts +0 -0
- package/dist/gui/EFPause.d.ts +23 -0
- package/dist/gui/EFPause.js +59 -0
- package/dist/gui/EFPlay.browsertest.d.ts +0 -0
- package/dist/gui/EFPlay.d.ts +23 -0
- package/dist/gui/EFPlay.js +59 -0
- package/dist/gui/EFPreview.d.ts +4 -0
- package/dist/gui/EFPreview.js +18 -9
- package/dist/gui/EFResizableBox.browsertest.d.ts +0 -0
- package/dist/gui/EFResizableBox.d.ts +34 -0
- package/dist/gui/EFResizableBox.js +547 -0
- package/dist/gui/EFScrubber.d.ts +9 -3
- package/dist/gui/EFScrubber.js +13 -13
- package/dist/gui/EFTimeDisplay.d.ts +7 -1
- package/dist/gui/EFTimeDisplay.js +8 -8
- package/dist/gui/EFToggleLoop.d.ts +9 -3
- package/dist/gui/EFToggleLoop.js +7 -5
- package/dist/gui/EFTogglePlay.d.ts +12 -4
- package/dist/gui/EFTogglePlay.js +26 -21
- package/dist/gui/EFWorkbench.js +5 -5
- package/dist/gui/PlaybackController.d.ts +67 -0
- package/dist/gui/PlaybackController.js +310 -0
- package/dist/gui/TWMixin.js +1 -1
- package/dist/gui/TWMixin2.js +1 -1
- package/dist/gui/TargetOrContextMixin.d.ts +10 -0
- package/dist/gui/TargetOrContextMixin.js +98 -0
- package/dist/gui/efContext.d.ts +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -1
- package/dist/otel/BridgeSpanExporter.d.ts +13 -0
- package/dist/otel/BridgeSpanExporter.js +87 -0
- package/dist/otel/setupBrowserTracing.d.ts +12 -0
- package/dist/otel/setupBrowserTracing.js +32 -0
- package/dist/otel/tracingHelpers.d.ts +34 -0
- package/dist/otel/tracingHelpers.js +112 -0
- package/dist/style.css +1 -1
- package/dist/transcoding/cache/RequestDeduplicator.js +0 -21
- package/dist/transcoding/cache/URLTokenDeduplicator.js +1 -21
- package/dist/transcoding/utils/UrlGenerator.js +2 -19
- package/dist/utils/LRUCache.js +6 -53
- package/package.json +13 -5
- package/src/elements/ContextProxiesController.ts +10 -10
- package/src/elements/EFAudio.ts +1 -0
- package/src/elements/EFCaptions.browsertest.ts +128 -56
- package/src/elements/EFCaptions.ts +60 -34
- package/src/elements/EFImage.browsertest.ts +1 -2
- package/src/elements/EFMedia/AssetMediaEngine.ts +65 -37
- package/src/elements/EFMedia/BaseMediaEngine.ts +110 -52
- package/src/elements/EFMedia/BufferedSeekingInput.ts +218 -101
- package/src/elements/EFMedia/JitMediaEngine.browsertest.ts +3 -0
- package/src/elements/EFMedia/audioTasks/makeAudioInputTask.ts +7 -3
- package/src/elements/EFMedia/audioTasks/makeAudioSeekTask.chunkboundary.regression.browsertest.ts +1 -1
- package/src/elements/EFMedia/videoTasks/MainVideoInputCache.ts +76 -0
- package/src/elements/EFMedia/videoTasks/makeScrubVideoInputTask.ts +16 -10
- package/src/elements/EFMedia/videoTasks/makeScrubVideoSeekTask.ts +7 -1
- package/src/elements/EFMedia/videoTasks/makeUnifiedVideoSeekTask.ts +222 -116
- package/src/elements/EFMedia.browsertest.ts +8 -15
- package/src/elements/EFMedia.ts +54 -8
- package/src/elements/EFSurface.browsertest.ts +2 -6
- package/src/elements/EFSurface.ts +1 -0
- package/src/elements/EFTemporal.browsertest.ts +58 -1
- package/src/elements/EFTemporal.ts +140 -4
- package/src/elements/EFThumbnailStrip.browsertest.ts +2 -8
- package/src/elements/EFThumbnailStrip.ts +1 -0
- package/src/elements/EFTimegroup.browsertest.ts +16 -15
- package/src/elements/EFTimegroup.ts +281 -275
- package/src/elements/EFVideo.browsertest.ts +162 -74
- package/src/elements/EFVideo.ts +229 -101
- package/src/elements/FetchContext.browsertest.ts +7 -2
- package/src/elements/TargetController.browsertest.ts +1 -0
- package/src/elements/TargetController.ts +1 -0
- package/src/elements/renderTemporalAudio.ts +108 -0
- package/src/elements/updateAnimations.browsertest.ts +181 -6
- package/src/elements/updateAnimations.ts +6 -6
- package/src/gui/ContextMixin.browsertest.ts +274 -27
- package/src/gui/ContextMixin.ts +230 -175
- package/src/gui/Controllable.browsertest.ts +258 -0
- package/src/gui/Controllable.ts +41 -0
- package/src/gui/EFControls.browsertest.ts +294 -80
- package/src/gui/EFControls.ts +139 -28
- package/src/gui/EFDial.browsertest.ts +84 -0
- package/src/gui/EFDial.ts +172 -0
- package/src/gui/EFFilmstrip.browsertest.ts +712 -0
- package/src/gui/EFFilmstrip.ts +213 -23
- package/src/gui/EFPause.browsertest.ts +202 -0
- package/src/gui/EFPause.ts +73 -0
- package/src/gui/EFPlay.browsertest.ts +202 -0
- package/src/gui/EFPlay.ts +73 -0
- package/src/gui/EFPreview.ts +20 -5
- package/src/gui/EFResizableBox.browsertest.ts +79 -0
- package/src/gui/EFResizableBox.ts +898 -0
- package/src/gui/EFScrubber.ts +7 -5
- package/src/gui/EFTimeDisplay.browsertest.ts +19 -19
- package/src/gui/EFTimeDisplay.ts +3 -1
- package/src/gui/EFToggleLoop.ts +6 -5
- package/src/gui/EFTogglePlay.ts +30 -23
- package/src/gui/PlaybackController.ts +522 -0
- package/src/gui/TWMixin.css +3 -0
- package/src/gui/TargetOrContextMixin.ts +185 -0
- package/src/gui/efContext.ts +2 -2
- package/src/otel/BridgeSpanExporter.ts +150 -0
- package/src/otel/setupBrowserTracing.ts +73 -0
- package/src/otel/tracingHelpers.ts +251 -0
- package/test/cache-integration-verification.browsertest.ts +1 -1
- package/types.json +1 -1
- package/dist/elements/ContextProxiesController.js +0 -69
package/dist/gui/EFFilmstrip.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { loopContext, playingContext } from "./playingContext.js";
|
|
2
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js";
|
|
3
|
+
import { isEFTemporal } from "../elements/EFTemporal.js";
|
|
1
4
|
import { focusContext } from "./focusContext.js";
|
|
2
5
|
import { focusedElementContext } from "./focusedElementContext.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
6
|
+
import { targetTemporalContext } from "./ContextMixin.js";
|
|
7
|
+
import { TWMixin } from "./TWMixin2.js";
|
|
8
|
+
import { TargetController } from "../elements/TargetController.js";
|
|
5
9
|
import { TimegroupController } from "../elements/TimegroupController.js";
|
|
6
10
|
import { EFTimegroup } from "../elements/EFTimegroup.js";
|
|
7
11
|
import { EFImage } from "../elements/EFImage.js";
|
|
8
|
-
import { TWMixin } from "./TWMixin2.js";
|
|
9
12
|
import { EFAudio } from "../elements/EFAudio.js";
|
|
10
13
|
import { EFVideo } from "../elements/EFVideo.js";
|
|
11
14
|
import { EFCaptions, EFCaptionsActiveWord } from "../elements/EFCaptions.js";
|
|
@@ -14,7 +17,6 @@ import { msToTimeCode } from "../msToTimeCode.js";
|
|
|
14
17
|
import { consume } from "@lit/context";
|
|
15
18
|
import { LitElement, css, html, nothing } from "lit";
|
|
16
19
|
import { customElement, eventOptions, property, state } from "lit/decorators.js";
|
|
17
|
-
import _decorate from "@oxc-project/runtime/helpers/decorate";
|
|
18
20
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
19
21
|
import { styleMap } from "lit/directives/style-map.js";
|
|
20
22
|
var ElementFilmstripController = class {
|
|
@@ -33,7 +35,7 @@ var ElementFilmstripController = class {
|
|
|
33
35
|
this.filmstrip.requestUpdate();
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
|
-
|
|
38
|
+
var CommonEffectKeys = new Set([
|
|
37
39
|
"offset",
|
|
38
40
|
"easing",
|
|
39
41
|
"composite",
|
|
@@ -92,21 +94,19 @@ var FilmstripItem = class extends TWMixin(LitElement) {
|
|
|
92
94
|
</div>`;
|
|
93
95
|
}
|
|
94
96
|
renderChildren() {
|
|
95
|
-
return renderFilmstripChildren(Array.from(this.element.children), this.pixelsPerMs);
|
|
97
|
+
return renderFilmstripChildren(Array.from(this.element.children), this.pixelsPerMs, this.hideSelectors, this.showSelectors);
|
|
96
98
|
}
|
|
97
99
|
contents() {
|
|
98
100
|
return html``;
|
|
99
101
|
}
|
|
100
102
|
animations() {
|
|
101
|
-
|
|
102
|
-
return animations.map((animation) => {
|
|
103
|
+
return this.element.getAnimations().map((animation) => {
|
|
103
104
|
const effect = animation.effect;
|
|
104
105
|
if (!(effect instanceof KeyframeEffect)) return nothing;
|
|
105
106
|
const start = effect.getTiming().delay ?? 0;
|
|
106
107
|
const duration = effect.getTiming().duration;
|
|
107
108
|
if (duration === null) return nothing;
|
|
108
|
-
const
|
|
109
|
-
const firstKeyframe = keyframes[0];
|
|
109
|
+
const firstKeyframe = effect.getKeyframes()[0];
|
|
110
110
|
if (!firstKeyframe) return nothing;
|
|
111
111
|
const properties = new Set(Object.keys(firstKeyframe));
|
|
112
112
|
for (const key of CommonEffectKeys) properties.delete(key);
|
|
@@ -136,35 +136,42 @@ var FilmstripItem = class extends TWMixin(LitElement) {
|
|
|
136
136
|
super.update(changedProperties);
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
__decorate([consume({
|
|
140
140
|
context: focusContext,
|
|
141
141
|
subscribe: true
|
|
142
142
|
})], FilmstripItem.prototype, "focusContext", void 0);
|
|
143
|
-
|
|
143
|
+
__decorate([consume({
|
|
144
144
|
context: focusedElementContext,
|
|
145
145
|
subscribe: true
|
|
146
146
|
})], FilmstripItem.prototype, "focusedElement", void 0);
|
|
147
|
-
|
|
147
|
+
__decorate([property({
|
|
148
148
|
type: Object,
|
|
149
149
|
attribute: false
|
|
150
150
|
})], FilmstripItem.prototype, "element", void 0);
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
__decorate([property({ type: Number })], FilmstripItem.prototype, "pixelsPerMs", void 0);
|
|
152
|
+
__decorate([property({
|
|
153
|
+
type: Array,
|
|
154
|
+
attribute: false
|
|
155
|
+
})], FilmstripItem.prototype, "hideSelectors", void 0);
|
|
156
|
+
__decorate([property({
|
|
157
|
+
type: Array,
|
|
158
|
+
attribute: false
|
|
159
|
+
})], FilmstripItem.prototype, "showSelectors", void 0);
|
|
160
|
+
var EFAudioFilmstrip = class EFAudioFilmstrip$1 extends FilmstripItem {
|
|
153
161
|
contents() {
|
|
154
162
|
return html``;
|
|
155
163
|
}
|
|
156
164
|
};
|
|
157
|
-
EFAudioFilmstrip =
|
|
158
|
-
|
|
165
|
+
EFAudioFilmstrip = __decorate([customElement("ef-audio-filmstrip")], EFAudioFilmstrip);
|
|
166
|
+
var EFVideoFilmstrip = class EFVideoFilmstrip$1 extends FilmstripItem {
|
|
159
167
|
contents() {
|
|
160
168
|
return html` 📼 `;
|
|
161
169
|
}
|
|
162
170
|
};
|
|
163
|
-
EFVideoFilmstrip =
|
|
164
|
-
|
|
171
|
+
EFVideoFilmstrip = __decorate([customElement("ef-video-filmstrip")], EFVideoFilmstrip);
|
|
172
|
+
var EFCaptionsFilmstrip = class EFCaptionsFilmstrip$1 extends FilmstripItem {
|
|
165
173
|
render() {
|
|
166
|
-
const
|
|
167
|
-
const captionsData = captions.unifiedCaptionsDataTask.value;
|
|
174
|
+
const captionsData = this.element.unifiedCaptionsDataTask.value;
|
|
168
175
|
return html`<div style=${styleMap(this.gutterStyles)}>
|
|
169
176
|
<div
|
|
170
177
|
class="bg-slate-300 relative"
|
|
@@ -190,11 +197,8 @@ let EFCaptionsFilmstrip = class EFCaptionsFilmstrip$1 extends FilmstripItem {
|
|
|
190
197
|
renderCaptionsData(captionsData) {
|
|
191
198
|
if (!captionsData) return html``;
|
|
192
199
|
const captions = this.element;
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const captionsLocalTimeMs = currentTimeMs - captions.startTimeMs;
|
|
196
|
-
const captionsLocalTimeSec = captionsLocalTimeMs / 1e3;
|
|
197
|
-
const segmentElements = captionsData.segments.map((segment) => {
|
|
200
|
+
const captionsLocalTimeSec = ((captions.rootTimegroup?.currentTimeMs || 0) - captions.startTimeMs) / 1e3;
|
|
201
|
+
return html`${captionsData.segments.map((segment) => {
|
|
198
202
|
const isActive = captionsLocalTimeSec >= segment.start && captionsLocalTimeSec < segment.end;
|
|
199
203
|
return html`<div
|
|
200
204
|
class="absolute border border-slate-600 text-xs overflow-hidden flex items-center ${isActive ? "bg-green-200 border-green-500 font-bold z-[5]" : "bg-slate-100"}"
|
|
@@ -208,15 +212,14 @@ let EFCaptionsFilmstrip = class EFCaptionsFilmstrip$1 extends FilmstripItem {
|
|
|
208
212
|
>
|
|
209
213
|
<span class="px-0.5 text-[8px] ${isActive ? "font-bold" : ""}">${segment.text}</span>
|
|
210
214
|
</div>`;
|
|
211
|
-
})
|
|
212
|
-
return html`${segmentElements}`;
|
|
215
|
+
})}`;
|
|
213
216
|
}
|
|
214
217
|
renderChildren() {
|
|
215
|
-
return
|
|
218
|
+
return renderFilmstripChildren(Array.from(this.element.children), this.pixelsPerMs, this.hideSelectors, this.showSelectors);
|
|
216
219
|
}
|
|
217
220
|
};
|
|
218
|
-
EFCaptionsFilmstrip =
|
|
219
|
-
|
|
221
|
+
EFCaptionsFilmstrip = __decorate([customElement("ef-captions-filmstrip")], EFCaptionsFilmstrip);
|
|
222
|
+
var EFCaptionsActiveWordFilmstrip = class EFCaptionsActiveWordFilmstrip$1 extends FilmstripItem {
|
|
220
223
|
get captionsTrackStyles() {
|
|
221
224
|
const parentCaptions = this.element.closest("ef-captions");
|
|
222
225
|
return {
|
|
@@ -233,10 +236,7 @@ let EFCaptionsActiveWordFilmstrip = class EFCaptionsActiveWordFilmstrip$1 extend
|
|
|
233
236
|
🗣️ Active Word
|
|
234
237
|
</div>
|
|
235
238
|
</div>`;
|
|
236
|
-
const
|
|
237
|
-
const currentTimeMs = rootTimegroup?.currentTimeMs || 0;
|
|
238
|
-
const captionsLocalTimeMs = currentTimeMs - parentCaptions.startTimeMs;
|
|
239
|
-
const captionsLocalTimeSec = captionsLocalTimeMs / 1e3;
|
|
239
|
+
const captionsLocalTimeSec = ((parentCaptions.rootTimegroup?.currentTimeMs || 0) - parentCaptions.startTimeMs) / 1e3;
|
|
240
240
|
return html`<div style=${styleMap(this.captionsTrackStyles)}>
|
|
241
241
|
<div class="bg-slate-300 relative border border-slate-500 h-[1.1rem] mb-[1px] w-full">
|
|
242
242
|
${captionsData.word_segments.map((word) => {
|
|
@@ -258,8 +258,8 @@ let EFCaptionsActiveWordFilmstrip = class EFCaptionsActiveWordFilmstrip$1 extend
|
|
|
258
258
|
</div>`;
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
EFCaptionsActiveWordFilmstrip =
|
|
262
|
-
|
|
261
|
+
EFCaptionsActiveWordFilmstrip = __decorate([customElement("ef-captions-active-word-filmstrip")], EFCaptionsActiveWordFilmstrip);
|
|
262
|
+
var EFCaptionsSegmentFilmstrip = class EFCaptionsSegmentFilmstrip$1 extends FilmstripItem {
|
|
263
263
|
get captionsTrackStyles() {
|
|
264
264
|
const parentCaptions = this.element.closest("ef-captions");
|
|
265
265
|
return {
|
|
@@ -276,10 +276,7 @@ let EFCaptionsSegmentFilmstrip = class EFCaptionsSegmentFilmstrip$1 extends Film
|
|
|
276
276
|
📄 Segment
|
|
277
277
|
</div>
|
|
278
278
|
</div>`;
|
|
279
|
-
const
|
|
280
|
-
const currentTimeMs = rootTimegroup?.currentTimeMs || 0;
|
|
281
|
-
const captionsLocalTimeMs = currentTimeMs - parentCaptions.startTimeMs;
|
|
282
|
-
const captionsLocalTimeSec = captionsLocalTimeMs / 1e3;
|
|
279
|
+
const captionsLocalTimeSec = ((parentCaptions.rootTimegroup?.currentTimeMs || 0) - parentCaptions.startTimeMs) / 1e3;
|
|
283
280
|
return html`<div style=${styleMap(this.captionsTrackStyles)}>
|
|
284
281
|
<div class="bg-slate-300 relative border border-slate-500 h-[1.1rem] mb-[1px] w-full">
|
|
285
282
|
${captionsData.segments.map((segment) => {
|
|
@@ -301,8 +298,8 @@ let EFCaptionsSegmentFilmstrip = class EFCaptionsSegmentFilmstrip$1 extends Film
|
|
|
301
298
|
</div>`;
|
|
302
299
|
}
|
|
303
300
|
};
|
|
304
|
-
EFCaptionsSegmentFilmstrip =
|
|
305
|
-
|
|
301
|
+
EFCaptionsSegmentFilmstrip = __decorate([customElement("ef-captions-segment-filmstrip")], EFCaptionsSegmentFilmstrip);
|
|
302
|
+
var EFCaptionsBeforeWordFilmstrip = class EFCaptionsBeforeWordFilmstrip$1 extends FilmstripItem {
|
|
306
303
|
get captionsTrackStyles() {
|
|
307
304
|
const parentCaptions = this.element.closest("ef-captions");
|
|
308
305
|
return {
|
|
@@ -319,16 +316,12 @@ let EFCaptionsBeforeWordFilmstrip = class EFCaptionsBeforeWordFilmstrip$1 extend
|
|
|
319
316
|
⬅️ Before
|
|
320
317
|
</div>
|
|
321
318
|
</div>`;
|
|
322
|
-
const
|
|
323
|
-
const currentTimeMs = rootTimegroup?.currentTimeMs || 0;
|
|
324
|
-
const captionsLocalTimeMs = currentTimeMs - parentCaptions.startTimeMs;
|
|
325
|
-
const captionsLocalTimeSec = captionsLocalTimeMs / 1e3;
|
|
319
|
+
const captionsLocalTimeSec = ((parentCaptions.rootTimegroup?.currentTimeMs || 0) - parentCaptions.startTimeMs) / 1e3;
|
|
326
320
|
return html`<div style=${styleMap(this.captionsTrackStyles)}>
|
|
327
321
|
<div class="bg-slate-300 relative border border-slate-500 h-[1.1rem] mb-[1px] w-full">
|
|
328
322
|
${captionsData.word_segments.map((word) => {
|
|
329
|
-
const isCurrentlyActive = captionsLocalTimeSec >= word.start && captionsLocalTimeSec < word.end;
|
|
330
323
|
return html`<div
|
|
331
|
-
class="absolute border text-xs overflow-visible flex items-center ${
|
|
324
|
+
class="absolute border text-xs overflow-visible flex items-center ${captionsLocalTimeSec >= word.start && captionsLocalTimeSec < word.end ? "bg-yellow-200 border-yellow-500 font-bold z-[5]" : "bg-purple-50 border-purple-200"}"
|
|
332
325
|
style=${styleMap({
|
|
333
326
|
left: `${this.pixelsPerMs * word.start * 1e3}px`,
|
|
334
327
|
width: `${this.pixelsPerMs * (word.end - word.start) * 1e3}px`,
|
|
@@ -344,8 +337,8 @@ let EFCaptionsBeforeWordFilmstrip = class EFCaptionsBeforeWordFilmstrip$1 extend
|
|
|
344
337
|
</div>`;
|
|
345
338
|
}
|
|
346
339
|
};
|
|
347
|
-
EFCaptionsBeforeWordFilmstrip =
|
|
348
|
-
|
|
340
|
+
EFCaptionsBeforeWordFilmstrip = __decorate([customElement("ef-captions-before-word-filmstrip")], EFCaptionsBeforeWordFilmstrip);
|
|
341
|
+
var EFCaptionsAfterWordFilmstrip = class EFCaptionsAfterWordFilmstrip$1 extends FilmstripItem {
|
|
349
342
|
get captionsTrackStyles() {
|
|
350
343
|
const parentCaptions = this.element.closest("ef-captions");
|
|
351
344
|
return {
|
|
@@ -362,16 +355,12 @@ let EFCaptionsAfterWordFilmstrip = class EFCaptionsAfterWordFilmstrip$1 extends
|
|
|
362
355
|
➡️ After
|
|
363
356
|
</div>
|
|
364
357
|
</div>`;
|
|
365
|
-
const
|
|
366
|
-
const currentTimeMs = rootTimegroup?.currentTimeMs || 0;
|
|
367
|
-
const captionsLocalTimeMs = currentTimeMs - parentCaptions.startTimeMs;
|
|
368
|
-
const captionsLocalTimeSec = captionsLocalTimeMs / 1e3;
|
|
358
|
+
const captionsLocalTimeSec = ((parentCaptions.rootTimegroup?.currentTimeMs || 0) - parentCaptions.startTimeMs) / 1e3;
|
|
369
359
|
return html`<div style=${styleMap(this.captionsTrackStyles)}>
|
|
370
360
|
<div class="bg-slate-300 relative border border-slate-500 h-[1.1rem] mb-[1px] w-full">
|
|
371
361
|
${captionsData.word_segments.map((word) => {
|
|
372
|
-
const isCurrentlyActive = captionsLocalTimeSec >= word.start && captionsLocalTimeSec < word.end;
|
|
373
362
|
return html`<div
|
|
374
|
-
class="absolute border text-xs overflow-visible flex items-center ${
|
|
363
|
+
class="absolute border text-xs overflow-visible flex items-center ${captionsLocalTimeSec >= word.start && captionsLocalTimeSec < word.end ? "bg-yellow-200 border-yellow-500 font-bold z-[5]" : "bg-purple-50 border-purple-200"}"
|
|
375
364
|
style=${styleMap({
|
|
376
365
|
left: `${this.pixelsPerMs * word.start * 1e3}px`,
|
|
377
366
|
width: `${this.pixelsPerMs * (word.end - word.start) * 1e3}px`,
|
|
@@ -387,8 +376,8 @@ let EFCaptionsAfterWordFilmstrip = class EFCaptionsAfterWordFilmstrip$1 extends
|
|
|
387
376
|
</div>`;
|
|
388
377
|
}
|
|
389
378
|
};
|
|
390
|
-
EFCaptionsAfterWordFilmstrip =
|
|
391
|
-
|
|
379
|
+
EFCaptionsAfterWordFilmstrip = __decorate([customElement("ef-captions-after-word-filmstrip")], EFCaptionsAfterWordFilmstrip);
|
|
380
|
+
var EFWaveformFilmstrip = class EFWaveformFilmstrip$1 extends FilmstripItem {
|
|
392
381
|
contents() {
|
|
393
382
|
return html` 🌊 `;
|
|
394
383
|
}
|
|
@@ -396,33 +385,33 @@ let EFWaveformFilmstrip = class EFWaveformFilmstrip$1 extends FilmstripItem {
|
|
|
396
385
|
return nothing;
|
|
397
386
|
}
|
|
398
387
|
};
|
|
399
|
-
EFWaveformFilmstrip =
|
|
400
|
-
|
|
388
|
+
EFWaveformFilmstrip = __decorate([customElement("ef-waveform-filmstrip")], EFWaveformFilmstrip);
|
|
389
|
+
var EFImageFilmstrip = class EFImageFilmstrip$1 extends FilmstripItem {
|
|
401
390
|
contents() {
|
|
402
391
|
return html` 🖼️ `;
|
|
403
392
|
}
|
|
404
393
|
};
|
|
405
|
-
EFImageFilmstrip =
|
|
406
|
-
|
|
394
|
+
EFImageFilmstrip = __decorate([customElement("ef-image-filmstrip")], EFImageFilmstrip);
|
|
395
|
+
var EFTimegroupFilmstrip = class EFTimegroupFilmstrip$1 extends FilmstripItem {
|
|
407
396
|
contents() {
|
|
408
397
|
return html`
|
|
409
398
|
<span>TIME GROUP</span>
|
|
410
|
-
${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs)}
|
|
399
|
+
${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs, this.hideSelectors, this.showSelectors)}
|
|
411
400
|
</div>
|
|
412
401
|
`;
|
|
413
402
|
}
|
|
414
403
|
};
|
|
415
|
-
EFTimegroupFilmstrip =
|
|
416
|
-
|
|
404
|
+
EFTimegroupFilmstrip = __decorate([customElement("ef-timegroup-filmstrip")], EFTimegroupFilmstrip);
|
|
405
|
+
var EFHTMLFilmstrip = class EFHTMLFilmstrip$1 extends FilmstripItem {
|
|
417
406
|
contents() {
|
|
418
407
|
return html`
|
|
419
408
|
<span>${this.element.tagName}</span>
|
|
420
|
-
${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs)}
|
|
409
|
+
${renderFilmstripChildren(Array.from(this.element.children || []), this.pixelsPerMs, this.hideSelectors, this.showSelectors)}
|
|
421
410
|
`;
|
|
422
411
|
}
|
|
423
412
|
};
|
|
424
|
-
EFHTMLFilmstrip =
|
|
425
|
-
|
|
413
|
+
EFHTMLFilmstrip = __decorate([customElement("ef-html-filmstrip")], EFHTMLFilmstrip);
|
|
414
|
+
var EFHierarchyItem = class EFHierarchyItem$1 extends TWMixin(LitElement) {
|
|
426
415
|
constructor(..._args2) {
|
|
427
416
|
super(..._args2);
|
|
428
417
|
this.element = new EFTimegroup();
|
|
@@ -461,20 +450,28 @@ let EFHierarchyItem = class EFHierarchyItem$1 extends TWMixin(LitElement) {
|
|
|
461
450
|
</div>`;
|
|
462
451
|
}
|
|
463
452
|
renderChildren() {
|
|
464
|
-
return renderHierarchyChildren(Array.from(this.element.children));
|
|
453
|
+
return renderHierarchyChildren(Array.from(this.element.children), this.hideSelectors, this.showSelectors);
|
|
465
454
|
}
|
|
466
455
|
};
|
|
467
|
-
|
|
456
|
+
__decorate([property({
|
|
468
457
|
type: Object,
|
|
469
458
|
attribute: false
|
|
470
459
|
})], EFHierarchyItem.prototype, "element", void 0);
|
|
471
|
-
|
|
472
|
-
|
|
460
|
+
__decorate([consume({ context: focusContext })], EFHierarchyItem.prototype, "focusContext", void 0);
|
|
461
|
+
__decorate([consume({
|
|
473
462
|
context: focusedElementContext,
|
|
474
463
|
subscribe: true
|
|
475
464
|
})], EFHierarchyItem.prototype, "focusedElement", void 0);
|
|
476
|
-
|
|
477
|
-
|
|
465
|
+
__decorate([property({
|
|
466
|
+
type: Array,
|
|
467
|
+
attribute: false
|
|
468
|
+
})], EFHierarchyItem.prototype, "hideSelectors", void 0);
|
|
469
|
+
__decorate([property({
|
|
470
|
+
type: Array,
|
|
471
|
+
attribute: false
|
|
472
|
+
})], EFHierarchyItem.prototype, "showSelectors", void 0);
|
|
473
|
+
EFHierarchyItem = __decorate([customElement("ef-hierarchy-item")], EFHierarchyItem);
|
|
474
|
+
var EFTimegroupHierarchyItem = class EFTimegroupHierarchyItem$1 extends EFHierarchyItem {
|
|
478
475
|
get icon() {
|
|
479
476
|
return "🕒";
|
|
480
477
|
}
|
|
@@ -482,8 +479,8 @@ let EFTimegroupHierarchyItem = class EFTimegroupHierarchyItem$1 extends EFHierar
|
|
|
482
479
|
return this.element.mode ?? "(no mode)";
|
|
483
480
|
}
|
|
484
481
|
};
|
|
485
|
-
EFTimegroupHierarchyItem =
|
|
486
|
-
|
|
482
|
+
EFTimegroupHierarchyItem = __decorate([customElement("ef-timegroup-hierarchy-item")], EFTimegroupHierarchyItem);
|
|
483
|
+
var EFAudioHierarchyItem = class EFAudioHierarchyItem$1 extends EFHierarchyItem {
|
|
487
484
|
get icon() {
|
|
488
485
|
return "🔊";
|
|
489
486
|
}
|
|
@@ -491,8 +488,8 @@ let EFAudioHierarchyItem = class EFAudioHierarchyItem$1 extends EFHierarchyItem
|
|
|
491
488
|
return this.element.src ?? "(no src)";
|
|
492
489
|
}
|
|
493
490
|
};
|
|
494
|
-
EFAudioHierarchyItem =
|
|
495
|
-
|
|
491
|
+
EFAudioHierarchyItem = __decorate([customElement("ef-audio-hierarchy-item")], EFAudioHierarchyItem);
|
|
492
|
+
var EFVideoHierarchyItem = class EFVideoHierarchyItem$1 extends EFHierarchyItem {
|
|
496
493
|
get icon() {
|
|
497
494
|
return "📼";
|
|
498
495
|
}
|
|
@@ -500,20 +497,20 @@ let EFVideoHierarchyItem = class EFVideoHierarchyItem$1 extends EFHierarchyItem
|
|
|
500
497
|
return this.element.src ?? "(no src)";
|
|
501
498
|
}
|
|
502
499
|
};
|
|
503
|
-
EFVideoHierarchyItem =
|
|
504
|
-
|
|
500
|
+
EFVideoHierarchyItem = __decorate([customElement("ef-video-hierarchy-item")], EFVideoHierarchyItem);
|
|
501
|
+
var EFCaptionsHierarchyItem = class EFCaptionsHierarchyItem$1 extends EFHierarchyItem {
|
|
505
502
|
get icon() {
|
|
506
503
|
return "📝 Captions";
|
|
507
504
|
}
|
|
508
505
|
};
|
|
509
|
-
EFCaptionsHierarchyItem =
|
|
510
|
-
|
|
506
|
+
EFCaptionsHierarchyItem = __decorate([customElement("ef-captions-hierarchy-item")], EFCaptionsHierarchyItem);
|
|
507
|
+
var EFCaptionsActiveWordHierarchyItem = class EFCaptionsActiveWordHierarchyItem$1 extends EFHierarchyItem {
|
|
511
508
|
get icon() {
|
|
512
509
|
return "🗣️ Active Word";
|
|
513
510
|
}
|
|
514
511
|
};
|
|
515
|
-
EFCaptionsActiveWordHierarchyItem =
|
|
516
|
-
|
|
512
|
+
EFCaptionsActiveWordHierarchyItem = __decorate([customElement("ef-captions-active-word-hierarchy-item")], EFCaptionsActiveWordHierarchyItem);
|
|
513
|
+
var EFWaveformHierarchyItem = class EFWaveformHierarchyItem$1 extends EFHierarchyItem {
|
|
517
514
|
get icon() {
|
|
518
515
|
return "🌊";
|
|
519
516
|
}
|
|
@@ -521,8 +518,8 @@ let EFWaveformHierarchyItem = class EFWaveformHierarchyItem$1 extends EFHierarch
|
|
|
521
518
|
return nothing;
|
|
522
519
|
}
|
|
523
520
|
};
|
|
524
|
-
EFWaveformHierarchyItem =
|
|
525
|
-
|
|
521
|
+
EFWaveformHierarchyItem = __decorate([customElement("ef-waveform-hierarchy-item")], EFWaveformHierarchyItem);
|
|
522
|
+
var EFImageHierarchyItem = class EFImageHierarchyItem$1 extends EFHierarchyItem {
|
|
526
523
|
get icon() {
|
|
527
524
|
return "🖼️";
|
|
528
525
|
}
|
|
@@ -530,96 +527,154 @@ let EFImageHierarchyItem = class EFImageHierarchyItem$1 extends EFHierarchyItem
|
|
|
530
527
|
return this.element.src ?? "(no src)";
|
|
531
528
|
}
|
|
532
529
|
};
|
|
533
|
-
EFImageHierarchyItem =
|
|
534
|
-
|
|
530
|
+
EFImageHierarchyItem = __decorate([customElement("ef-image-hierarchy-item")], EFImageHierarchyItem);
|
|
531
|
+
var EFHTMLHierarchyItem = class EFHTMLHierarchyItem$1 extends EFHierarchyItem {
|
|
535
532
|
get icon() {
|
|
536
533
|
return html`<code>${`<${this.element.tagName.toLowerCase()}>`}</code>`;
|
|
537
534
|
}
|
|
538
535
|
};
|
|
539
|
-
EFHTMLHierarchyItem =
|
|
540
|
-
|
|
536
|
+
EFHTMLHierarchyItem = __decorate([customElement("ef-html-hierarchy-item")], EFHTMLHierarchyItem);
|
|
537
|
+
var shouldRenderElement = (element, hideSelectors, showSelectors) => {
|
|
538
|
+
if (element instanceof HTMLElement && element.dataset?.efHidden) return false;
|
|
539
|
+
if (showSelectors && showSelectors.length > 0) return showSelectors.some((selector) => {
|
|
540
|
+
try {
|
|
541
|
+
return element.matches(selector);
|
|
542
|
+
} catch {
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
if (hideSelectors && hideSelectors.length > 0) return !hideSelectors.some((selector) => {
|
|
547
|
+
try {
|
|
548
|
+
return element.matches(selector);
|
|
549
|
+
} catch {
|
|
550
|
+
return false;
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
return true;
|
|
554
|
+
};
|
|
555
|
+
var renderHierarchyChildren = (children, hideSelectors, showSelectors, skipRootFiltering = false) => {
|
|
541
556
|
return children.map((child) => {
|
|
542
|
-
if (
|
|
557
|
+
if (!skipRootFiltering && !shouldRenderElement(child, hideSelectors, showSelectors)) return nothing;
|
|
543
558
|
if (child instanceof EFTimegroup) return html`<ef-timegroup-hierarchy-item
|
|
544
559
|
.element=${child}
|
|
560
|
+
.hideSelectors=${hideSelectors}
|
|
561
|
+
.showSelectors=${showSelectors}
|
|
545
562
|
></ef-timegroup-hierarchy-item>`;
|
|
546
563
|
if (child instanceof EFImage) return html`<ef-image-hierarchy-item
|
|
547
564
|
.element=${child}
|
|
565
|
+
.hideSelectors=${hideSelectors}
|
|
566
|
+
.showSelectors=${showSelectors}
|
|
548
567
|
></ef-image-hierarchy-item>`;
|
|
549
568
|
if (child instanceof EFAudio) return html`<ef-audio-hierarchy-item
|
|
550
569
|
.element=${child}
|
|
570
|
+
.hideSelectors=${hideSelectors}
|
|
571
|
+
.showSelectors=${showSelectors}
|
|
551
572
|
></ef-audio-hierarchy-item>`;
|
|
552
573
|
if (child instanceof EFVideo) return html`<ef-video-hierarchy-item
|
|
553
574
|
.element=${child}
|
|
575
|
+
.hideSelectors=${hideSelectors}
|
|
576
|
+
.showSelectors=${showSelectors}
|
|
554
577
|
></ef-video-hierarchy-item>`;
|
|
555
578
|
if (child instanceof EFCaptions) return html`<ef-captions-hierarchy-item
|
|
556
579
|
.element=${child}
|
|
580
|
+
.hideSelectors=${hideSelectors}
|
|
581
|
+
.showSelectors=${showSelectors}
|
|
557
582
|
></ef-captions-hierarchy-item>`;
|
|
558
583
|
if (child instanceof EFCaptionsActiveWord) return html`<ef-captions-active-word-hierarchy-item
|
|
559
584
|
.element=${child}
|
|
585
|
+
.hideSelectors=${hideSelectors}
|
|
586
|
+
.showSelectors=${showSelectors}
|
|
560
587
|
></ef-captions-active-word-hierarchy-item>`;
|
|
561
588
|
if (child instanceof EFWaveform) return html`<ef-waveform-hierarchy-item
|
|
562
589
|
.element=${child}
|
|
590
|
+
.hideSelectors=${hideSelectors}
|
|
591
|
+
.showSelectors=${showSelectors}
|
|
563
592
|
></ef-waveform-hierarchy-item>`;
|
|
564
593
|
return html`<ef-html-hierarchy-item
|
|
565
594
|
.element=${child}
|
|
595
|
+
.hideSelectors=${hideSelectors}
|
|
596
|
+
.showSelectors=${showSelectors}
|
|
566
597
|
></ef-html-hierarchy-item>`;
|
|
567
598
|
});
|
|
568
599
|
};
|
|
569
|
-
|
|
600
|
+
var renderFilmstripChildren = (children, pixelsPerMs, hideSelectors, showSelectors, skipRootFiltering = false) => {
|
|
570
601
|
return children.map((child) => {
|
|
571
|
-
if (
|
|
602
|
+
if (!skipRootFiltering && !shouldRenderElement(child, hideSelectors, showSelectors)) return nothing;
|
|
572
603
|
if (child instanceof EFTimegroup) return html`<ef-timegroup-filmstrip
|
|
573
604
|
.element=${child}
|
|
574
605
|
.pixelsPerMs=${pixelsPerMs}
|
|
606
|
+
.hideSelectors=${hideSelectors}
|
|
607
|
+
.showSelectors=${showSelectors}
|
|
575
608
|
>
|
|
576
609
|
</ef-timegroup-filmstrip>`;
|
|
577
610
|
if (child instanceof EFImage) return html`<ef-image-filmstrip
|
|
578
611
|
.element=${child}
|
|
579
612
|
.pixelsPerMs=${pixelsPerMs}
|
|
613
|
+
.hideSelectors=${hideSelectors}
|
|
614
|
+
.showSelectors=${showSelectors}
|
|
580
615
|
></ef-image-filmstrip>`;
|
|
581
616
|
if (child instanceof EFAudio) return html`<ef-audio-filmstrip
|
|
582
617
|
.element=${child}
|
|
583
618
|
.pixelsPerMs=${pixelsPerMs}
|
|
619
|
+
.hideSelectors=${hideSelectors}
|
|
620
|
+
.showSelectors=${showSelectors}
|
|
584
621
|
></ef-audio-filmstrip>`;
|
|
585
622
|
if (child instanceof EFVideo) return html`<ef-video-filmstrip
|
|
586
623
|
.element=${child}
|
|
587
624
|
.pixelsPerMs=${pixelsPerMs}
|
|
625
|
+
.hideSelectors=${hideSelectors}
|
|
626
|
+
.showSelectors=${showSelectors}
|
|
588
627
|
></ef-video-filmstrip>`;
|
|
589
628
|
if (child instanceof EFCaptions) return html`<ef-captions-filmstrip
|
|
590
629
|
.element=${child}
|
|
591
630
|
.pixelsPerMs=${pixelsPerMs}
|
|
631
|
+
.hideSelectors=${hideSelectors}
|
|
632
|
+
.showSelectors=${showSelectors}
|
|
592
633
|
></ef-captions-filmstrip>`;
|
|
593
634
|
if (child instanceof EFCaptionsActiveWord) return html`<ef-captions-active-word-filmstrip
|
|
594
635
|
.element=${child}
|
|
595
636
|
.pixelsPerMs=${pixelsPerMs}
|
|
637
|
+
.hideSelectors=${hideSelectors}
|
|
638
|
+
.showSelectors=${showSelectors}
|
|
596
639
|
></ef-captions-active-word-filmstrip>`;
|
|
597
640
|
if (child.tagName === "EF-CAPTIONS-SEGMENT") return html`<ef-captions-segment-filmstrip
|
|
598
641
|
.element=${child}
|
|
599
642
|
.pixelsPerMs=${pixelsPerMs}
|
|
643
|
+
.hideSelectors=${hideSelectors}
|
|
644
|
+
.showSelectors=${showSelectors}
|
|
600
645
|
></ef-captions-segment-filmstrip>`;
|
|
601
646
|
if (child.tagName === "EF-CAPTIONS-BEFORE-ACTIVE-WORD") return html`<ef-captions-before-word-filmstrip
|
|
602
647
|
.element=${child}
|
|
603
648
|
.pixelsPerMs=${pixelsPerMs}
|
|
649
|
+
.hideSelectors=${hideSelectors}
|
|
650
|
+
.showSelectors=${showSelectors}
|
|
604
651
|
></ef-captions-before-word-filmstrip>`;
|
|
605
652
|
if (child.tagName === "EF-CAPTIONS-AFTER-ACTIVE-WORD") return html`<ef-captions-after-word-filmstrip
|
|
606
653
|
.element=${child}
|
|
607
654
|
.pixelsPerMs=${pixelsPerMs}
|
|
655
|
+
.hideSelectors=${hideSelectors}
|
|
656
|
+
.showSelectors=${showSelectors}
|
|
608
657
|
></ef-captions-after-word-filmstrip>`;
|
|
609
658
|
if (child instanceof EFWaveform) return html`<ef-waveform-filmstrip
|
|
610
659
|
.element=${child}
|
|
611
660
|
.pixelsPerMs=${pixelsPerMs}
|
|
661
|
+
.hideSelectors=${hideSelectors}
|
|
662
|
+
.showSelectors=${showSelectors}
|
|
612
663
|
></ef-waveform-filmstrip>`;
|
|
613
664
|
return html`<ef-html-filmstrip
|
|
614
665
|
.element=${child}
|
|
615
666
|
.pixelsPerMs=${pixelsPerMs}
|
|
667
|
+
.hideSelectors=${hideSelectors}
|
|
668
|
+
.showSelectors=${showSelectors}
|
|
616
669
|
></ef-html-filmstrip>`;
|
|
617
670
|
});
|
|
618
671
|
};
|
|
619
|
-
|
|
672
|
+
var EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
620
673
|
constructor(..._args3) {
|
|
621
674
|
super(..._args3);
|
|
622
675
|
this.pixelsPerMs = .04;
|
|
676
|
+
this.hide = "";
|
|
677
|
+
this.show = "";
|
|
623
678
|
this.scrubbing = false;
|
|
624
679
|
this.timelineScrolltop = 0;
|
|
625
680
|
this.currentTimeMs = 0;
|
|
@@ -630,6 +685,8 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
630
685
|
this.gutterRef = createRef();
|
|
631
686
|
this.hierarchyRef = createRef();
|
|
632
687
|
this.playheadRef = createRef();
|
|
688
|
+
this.target = "";
|
|
689
|
+
this.targetElement = null;
|
|
633
690
|
}
|
|
634
691
|
static {
|
|
635
692
|
this.styles = [css`
|
|
@@ -641,11 +698,20 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
641
698
|
}
|
|
642
699
|
`];
|
|
643
700
|
}
|
|
701
|
+
get hideSelectors() {
|
|
702
|
+
if (!this.hide) return void 0;
|
|
703
|
+
return this.hide.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
704
|
+
}
|
|
705
|
+
get showSelectors() {
|
|
706
|
+
if (!this.show) return void 0;
|
|
707
|
+
return this.show.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
708
|
+
}
|
|
644
709
|
connectedCallback() {
|
|
645
710
|
super.connectedCallback();
|
|
646
711
|
this.#bindToTargetTimegroup();
|
|
647
712
|
window.addEventListener("keypress", this.#handleKeyPress);
|
|
648
713
|
this.resizeObserver.observe(this);
|
|
714
|
+
if (this.target) this.#targetController = new TargetController(this);
|
|
649
715
|
}
|
|
650
716
|
disconnectedCallback() {
|
|
651
717
|
super.disconnectedCallback();
|
|
@@ -653,13 +719,13 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
653
719
|
this.resizeObserver.disconnect();
|
|
654
720
|
}
|
|
655
721
|
updatePixelsPerMs() {
|
|
656
|
-
const target = this.
|
|
722
|
+
const target = this.targetTemporal;
|
|
657
723
|
const gutter = this.gutterRef.value;
|
|
658
724
|
if (target && gutter && gutter.clientWidth > 0) this.pixelsPerMs = gutter.clientWidth / (target.durationMs || 1);
|
|
659
725
|
}
|
|
660
726
|
#bindToTargetTimegroup() {
|
|
661
727
|
if (this.timegroupController) this.timegroupController.remove();
|
|
662
|
-
const target = this.
|
|
728
|
+
const target = this.targetTemporal;
|
|
663
729
|
if (target) {
|
|
664
730
|
this.timegroupController = new TimegroupController(target, this);
|
|
665
731
|
this.currentTimeMs = target.currentTimeMs;
|
|
@@ -668,9 +734,7 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
668
734
|
#handleKeyPress = (event) => {
|
|
669
735
|
if (event.key === " ") {
|
|
670
736
|
const [target] = event.composedPath();
|
|
671
|
-
|
|
672
|
-
const closestInteractive = target?.closest(interactiveSelector);
|
|
673
|
-
if (closestInteractive) return;
|
|
737
|
+
if (target?.closest("input, textarea, button, select, a, [contenteditable]")) return;
|
|
674
738
|
event.preventDefault();
|
|
675
739
|
if (this.#contextElement) this.#contextElement.playing = !this.#contextElement.playing;
|
|
676
740
|
}
|
|
@@ -706,14 +770,13 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
706
770
|
const gutter = this.shadowRoot?.querySelector("#gutter");
|
|
707
771
|
if (!gutter) return;
|
|
708
772
|
const rect = gutter.getBoundingClientRect();
|
|
709
|
-
if (this.
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
this.targetTimegroup.currentTimeMs = scrubTimeMs;
|
|
773
|
+
if (this.targetTemporal) {
|
|
774
|
+
const scrubTimeMs = (e.pageX - rect.left + gutter.scrollLeft) / this.pixelsPerMs;
|
|
775
|
+
this.targetTemporal.currentTimeMs = scrubTimeMs;
|
|
713
776
|
}
|
|
714
777
|
}
|
|
715
778
|
scrollScrub(e) {
|
|
716
|
-
if (this.
|
|
779
|
+
if (this.targetTemporal && this.gutter && !this.playing) {
|
|
717
780
|
if (e.deltaX !== 0) e.preventDefault();
|
|
718
781
|
if (this.gutterRef.value && this.gutterRef.value.scrollLeft === 0 && e.deltaX < 0) {
|
|
719
782
|
this.gutter.scrollBy(0, e.deltaY);
|
|
@@ -725,7 +788,7 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
725
788
|
}
|
|
726
789
|
if (this) {
|
|
727
790
|
this.gutter.scrollBy(e.deltaX, e.deltaY);
|
|
728
|
-
this.
|
|
791
|
+
this.targetTemporal.currentTimeMs += e.deltaX / this.pixelsPerMs;
|
|
729
792
|
}
|
|
730
793
|
}
|
|
731
794
|
}
|
|
@@ -733,7 +796,7 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
733
796
|
return this.gutterRef.value;
|
|
734
797
|
}
|
|
735
798
|
render() {
|
|
736
|
-
const target = this.
|
|
799
|
+
const target = this.targetTemporal;
|
|
737
800
|
return html` <div
|
|
738
801
|
class="grid h-full bg-slate-100"
|
|
739
802
|
style=${styleMap({
|
|
@@ -772,7 +835,7 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
772
835
|
${ref(this.hierarchyRef)}
|
|
773
836
|
@scroll=${this.syncHierarchyScroll}
|
|
774
837
|
>
|
|
775
|
-
${renderHierarchyChildren(target ? [target] : [])}
|
|
838
|
+
${renderHierarchyChildren(target ? [target] : [], this.hideSelectors, this.showSelectors, true)}
|
|
776
839
|
</div>
|
|
777
840
|
<div
|
|
778
841
|
class="flex h-full w-full cursor-crosshair overflow-auto bg-slate-200 pt-[8px]"
|
|
@@ -796,52 +859,74 @@ let EFFilmstrip = class EFFilmstrip$1 extends TWMixin(LitElement) {
|
|
|
796
859
|
${ref(this.playheadRef)}
|
|
797
860
|
></div>
|
|
798
861
|
|
|
799
|
-
${renderFilmstripChildren(target ? [target] : [], this.pixelsPerMs)}
|
|
862
|
+
${renderFilmstripChildren(target ? [target] : [], this.pixelsPerMs, this.hideSelectors, this.showSelectors, true)}
|
|
800
863
|
</div>
|
|
801
864
|
</div>
|
|
802
865
|
</div>`;
|
|
803
866
|
}
|
|
804
867
|
updated(changes) {
|
|
805
|
-
if (!this.
|
|
868
|
+
if (!this.targetTemporal) return;
|
|
806
869
|
if (changes.has("currentTimeMs")) {
|
|
807
|
-
if (this.
|
|
870
|
+
if (this.targetTemporal.currentTimeMs !== this.currentTimeMs) this.targetTemporal.currentTimeMs = this.currentTimeMs;
|
|
808
871
|
}
|
|
809
872
|
}
|
|
810
873
|
get #contextElement() {
|
|
811
874
|
return this.closest("ef-workbench, ef-preview");
|
|
812
875
|
}
|
|
876
|
+
#targetController;
|
|
877
|
+
#lastTargetTemporal;
|
|
878
|
+
get targetTemporal() {
|
|
879
|
+
const fromTarget = this.targetElement && isEFTemporal(this.targetElement) ? this.targetElement : null;
|
|
880
|
+
const fromContext = this._contextProvidedTemporal;
|
|
881
|
+
if (fromTarget && fromContext && fromTarget !== fromContext) console.warn("EFFilmstrip: Both target attribute and parent context found. Using target attribute.", {
|
|
882
|
+
target: this.target,
|
|
883
|
+
fromTarget,
|
|
884
|
+
fromContext
|
|
885
|
+
});
|
|
886
|
+
return fromTarget ?? fromContext ?? null;
|
|
887
|
+
}
|
|
813
888
|
willUpdate(changedProperties) {
|
|
814
|
-
if (changedProperties.has("
|
|
889
|
+
if (changedProperties.has("target")) {
|
|
890
|
+
if (this.target && !this.#targetController) this.#targetController = new TargetController(this);
|
|
891
|
+
}
|
|
892
|
+
const currentTargetTemporal = this.targetTemporal;
|
|
893
|
+
if (this.#lastTargetTemporal !== currentTargetTemporal) {
|
|
894
|
+
this.#bindToTargetTimegroup();
|
|
895
|
+
this.#lastTargetTemporal = currentTargetTemporal;
|
|
896
|
+
}
|
|
815
897
|
if (this.autoScale) this.updatePixelsPerMs();
|
|
816
898
|
super.willUpdate(changedProperties);
|
|
817
899
|
}
|
|
818
900
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
901
|
+
__decorate([property({ type: Number })], EFFilmstrip.prototype, "pixelsPerMs", void 0);
|
|
902
|
+
__decorate([property({ type: String })], EFFilmstrip.prototype, "hide", void 0);
|
|
903
|
+
__decorate([property({ type: String })], EFFilmstrip.prototype, "show", void 0);
|
|
904
|
+
__decorate([state()], EFFilmstrip.prototype, "scrubbing", void 0);
|
|
905
|
+
__decorate([state()], EFFilmstrip.prototype, "timelineScrolltop", void 0);
|
|
906
|
+
__decorate([consume({
|
|
823
907
|
context: playingContext,
|
|
824
908
|
subscribe: true
|
|
825
909
|
}), state()], EFFilmstrip.prototype, "playing", void 0);
|
|
826
|
-
|
|
910
|
+
__decorate([consume({
|
|
827
911
|
context: loopContext,
|
|
828
912
|
subscribe: true
|
|
829
913
|
}), state()], EFFilmstrip.prototype, "loop", void 0);
|
|
830
|
-
|
|
831
|
-
|
|
914
|
+
__decorate([state()], EFFilmstrip.prototype, "currentTimeMs", void 0);
|
|
915
|
+
__decorate([property({
|
|
832
916
|
type: Boolean,
|
|
833
917
|
reflect: true,
|
|
834
918
|
attribute: "auto-scale"
|
|
835
919
|
})], EFFilmstrip.prototype, "autoScale", void 0);
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
920
|
+
__decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "syncGutterScroll", null);
|
|
921
|
+
__decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "syncHierarchyScroll", null);
|
|
922
|
+
__decorate([eventOptions({ capture: false })], EFFilmstrip.prototype, "scrub", null);
|
|
923
|
+
__decorate([eventOptions({ capture: false })], EFFilmstrip.prototype, "startScrub", null);
|
|
924
|
+
__decorate([eventOptions({ passive: false })], EFFilmstrip.prototype, "scrollScrub", null);
|
|
925
|
+
__decorate([property({ type: String })], EFFilmstrip.prototype, "target", void 0);
|
|
926
|
+
__decorate([state()], EFFilmstrip.prototype, "targetElement", void 0);
|
|
927
|
+
__decorate([consume({
|
|
928
|
+
context: targetTemporalContext,
|
|
844
929
|
subscribe: true
|
|
845
|
-
}), state()], EFFilmstrip.prototype, "
|
|
846
|
-
EFFilmstrip =
|
|
930
|
+
}), state()], EFFilmstrip.prototype, "_contextProvidedTemporal", void 0);
|
|
931
|
+
EFFilmstrip = __decorate([customElement("ef-filmstrip")], EFFilmstrip);
|
|
847
932
|
export { EFFilmstrip };
|