@editframe/elements 0.21.0-beta.0 → 0.23.7-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/EF_FRAMEGEN.js +2 -3
- 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 +2 -2
- package/dist/elements/EFCaptions.d.ts +1 -3
- package/dist/elements/EFCaptions.js +59 -51
- package/dist/elements/EFImage.js +2 -2
- package/dist/elements/EFMedia/AssetIdMediaEngine.js +1 -2
- package/dist/elements/EFMedia/AssetMediaEngine.js +1 -3
- package/dist/elements/EFMedia/BufferedSeekingInput.d.ts +1 -1
- package/dist/elements/EFMedia/BufferedSeekingInput.js +2 -4
- package/dist/elements/EFMedia/audioTasks/makeAudioBufferTask.js +4 -7
- package/dist/elements/EFMedia/audioTasks/makeAudioFrequencyAnalysisTask.js +1 -2
- package/dist/elements/EFMedia/shared/AudioSpanUtils.js +5 -9
- package/dist/elements/EFMedia/shared/BufferUtils.js +1 -3
- package/dist/elements/EFMedia/videoTasks/makeVideoBufferTask.js +4 -7
- package/dist/elements/EFMedia.d.ts +19 -0
- package/dist/elements/EFMedia.js +19 -2
- package/dist/elements/EFSourceMixin.js +1 -1
- package/dist/elements/EFSurface.js +1 -1
- package/dist/elements/EFTemporal.browsertest.d.ts +11 -0
- package/dist/elements/EFTemporal.d.ts +10 -0
- package/dist/elements/EFTemporal.js +82 -5
- package/dist/elements/EFThumbnailStrip.js +9 -16
- package/dist/elements/EFTimegroup.browsertest.d.ts +3 -3
- package/dist/elements/EFTimegroup.d.ts +35 -14
- package/dist/elements/EFTimegroup.js +73 -120
- package/dist/elements/EFVideo.d.ts +10 -0
- package/dist/elements/EFVideo.js +15 -2
- package/dist/elements/EFWaveform.js +10 -18
- package/dist/elements/SampleBuffer.js +1 -2
- package/dist/elements/TargetController.js +2 -2
- package/dist/elements/renderTemporalAudio.d.ts +10 -0
- package/dist/elements/renderTemporalAudio.js +35 -0
- package/dist/elements/updateAnimations.js +7 -10
- package/dist/gui/ContextMixin.d.ts +5 -5
- package/dist/gui/ContextMixin.js +151 -117
- 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 +1 -1
- package/dist/gui/EFControls.browsertest.d.ts +11 -0
- package/dist/gui/EFControls.d.ts +18 -4
- package/dist/gui/EFControls.js +67 -25
- 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 +140 -34
- package/dist/gui/EFFitScale.js +2 -4
- package/dist/gui/EFFocusOverlay.js +1 -1
- 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 +15 -6
- 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 +7 -7
- package/dist/gui/EFTimeDisplay.d.ts +7 -1
- package/dist/gui/EFTimeDisplay.js +5 -5
- package/dist/gui/EFToggleLoop.d.ts +9 -3
- package/dist/gui/EFToggleLoop.js +6 -4
- package/dist/gui/EFTogglePlay.d.ts +12 -4
- package/dist/gui/EFTogglePlay.js +24 -19
- package/dist/gui/EFWorkbench.js +1 -1
- 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/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 +4 -0
- package/dist/index.js +5 -1
- package/dist/otel/setupBrowserTracing.d.ts +1 -1
- package/dist/otel/setupBrowserTracing.js +6 -4
- package/dist/otel/tracingHelpers.js +1 -2
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/elements/ContextProxiesController.ts +10 -10
- package/src/elements/EFAudio.ts +1 -0
- package/src/elements/EFCaptions.browsertest.ts +128 -58
- package/src/elements/EFCaptions.ts +60 -34
- package/src/elements/EFImage.browsertest.ts +1 -2
- package/src/elements/EFMedia/JitMediaEngine.browsertest.ts +3 -0
- package/src/elements/EFMedia/audioTasks/makeAudioSeekTask.chunkboundary.regression.browsertest.ts +1 -1
- package/src/elements/EFMedia.browsertest.ts +8 -15
- package/src/elements/EFMedia.ts +38 -7
- 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 +6 -7
- package/src/elements/EFTimegroup.ts +163 -244
- package/src/elements/EFVideo.browsertest.ts +143 -47
- package/src/elements/EFVideo.ts +26 -0
- 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/setupBrowserTracing.ts +17 -12
- package/test/cache-integration-verification.browsertest.ts +1 -1
- package/types.json +1 -1
- package/dist/elements/ContextProxiesController.js +0 -49
- /package/dist/_virtual/{_@oxc-project_runtime@0.93.0 → _@oxc-project_runtime@0.94.0}/helpers/decorate.js +0 -0
package/src/gui/EFScrubber.ts
CHANGED
|
@@ -3,14 +3,15 @@ import { css, html, LitElement } from "lit";
|
|
|
3
3
|
import { customElement, state } from "lit/decorators.js";
|
|
4
4
|
|
|
5
5
|
import { ref } from "lit/directives/ref.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { ControllableInterface } from "./Controllable.js";
|
|
7
7
|
import { currentTimeContext } from "./currentTimeContext.js";
|
|
8
8
|
import { durationContext } from "./durationContext.js";
|
|
9
9
|
import { efContext } from "./efContext.js";
|
|
10
10
|
import { playingContext } from "./playingContext.js";
|
|
11
|
+
import { TargetOrContextMixin } from "./TargetOrContextMixin.js";
|
|
11
12
|
|
|
12
13
|
@customElement("ef-scrubber")
|
|
13
|
-
export class EFScrubber extends LitElement {
|
|
14
|
+
export class EFScrubber extends TargetOrContextMixin(LitElement, efContext) {
|
|
14
15
|
static styles = [
|
|
15
16
|
css`
|
|
16
17
|
:host {
|
|
@@ -58,9 +59,6 @@ export class EFScrubber extends LitElement {
|
|
|
58
59
|
`,
|
|
59
60
|
];
|
|
60
61
|
|
|
61
|
-
@consume({ context: efContext, subscribe: true })
|
|
62
|
-
context?: ContextMixinInterface | null;
|
|
63
|
-
|
|
64
62
|
@consume({ context: playingContext, subscribe: true })
|
|
65
63
|
playing = false;
|
|
66
64
|
|
|
@@ -70,6 +68,10 @@ export class EFScrubber extends LitElement {
|
|
|
70
68
|
@consume({ context: durationContext, subscribe: true })
|
|
71
69
|
durationMs = 0;
|
|
72
70
|
|
|
71
|
+
get context(): ControllableInterface | null {
|
|
72
|
+
return this.effectiveContext;
|
|
73
|
+
}
|
|
74
|
+
|
|
73
75
|
@state()
|
|
74
76
|
private scrubProgress = 0;
|
|
75
77
|
|
|
@@ -103,25 +103,24 @@ describe("EFTimeDisplay", () => {
|
|
|
103
103
|
test("formats time correctly with valid values", async () => {
|
|
104
104
|
const { timeDisplay } = renderTimeDisplay(
|
|
105
105
|
html`<ef-preview>
|
|
106
|
-
<ef-timegroup mode="fixed" duration="
|
|
106
|
+
<ef-timegroup mode="fixed" duration="3s"></ef-timegroup>
|
|
107
107
|
<ef-time-display></ef-time-display>
|
|
108
108
|
</ef-preview>`,
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
const context = timeDisplay.closest("ef-preview")!;
|
|
112
|
+
const timegroup = context.querySelector("ef-timegroup") as EFTimegroup;
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
mockTimegroup.setAttribute("mode", "fixed");
|
|
116
|
-
mockTimegroup.setAttribute("duration", "3s");
|
|
114
|
+
await timegroup.updateComplete;
|
|
115
|
+
await timegroup.seek(1500); // 1.5 seconds = 0:01
|
|
117
116
|
|
|
118
|
-
context
|
|
119
|
-
|
|
117
|
+
// Wait for context to update and propagate to time display
|
|
118
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
119
|
+
await context.updateComplete;
|
|
120
120
|
await timeDisplay.updateComplete;
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
);
|
|
122
|
+
const timeText = timeDisplay.shadowRoot?.textContent?.trim();
|
|
123
|
+
assert.equal(timeText, "0:01 / 0:03");
|
|
125
124
|
});
|
|
126
125
|
|
|
127
126
|
test("formats minutes correctly", async () => {
|
|
@@ -154,22 +153,23 @@ describe("EFTimeDisplay", () => {
|
|
|
154
153
|
);
|
|
155
154
|
|
|
156
155
|
const context = timeDisplay.closest("ef-preview")!;
|
|
156
|
+
const timegroup = context.querySelector("ef-timegroup") as EFTimegroup;
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
mockTimegroup.setAttribute("mode", "fixed");
|
|
160
|
-
mockTimegroup.setAttribute("duration", "10s");
|
|
161
|
-
|
|
162
|
-
context.targetTimegroup = mockTimegroup;
|
|
158
|
+
await timegroup.updateComplete;
|
|
163
159
|
|
|
164
160
|
// Initial time
|
|
165
|
-
|
|
161
|
+
await timegroup.seek(2000); // 2 seconds = 0:02
|
|
162
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
163
|
+
await context.updateComplete;
|
|
166
164
|
await timeDisplay.updateComplete;
|
|
167
165
|
|
|
168
166
|
let timeText = timeDisplay.shadowRoot?.textContent?.trim();
|
|
169
167
|
assert.equal(timeText, "0:02 / 0:10");
|
|
170
168
|
|
|
171
169
|
// Update time
|
|
172
|
-
|
|
170
|
+
await timegroup.seek(7000); // 7 seconds = 0:07
|
|
171
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
172
|
+
await context.updateComplete;
|
|
173
173
|
await timeDisplay.updateComplete;
|
|
174
174
|
|
|
175
175
|
timeText = timeDisplay.shadowRoot?.textContent?.trim();
|
|
@@ -185,9 +185,9 @@ describe("EFTimeDisplay", () => {
|
|
|
185
185
|
);
|
|
186
186
|
|
|
187
187
|
const context = timeDisplay.closest("ef-preview")!;
|
|
188
|
-
const timegroup = context.
|
|
188
|
+
const timegroup = context.targetTemporal!;
|
|
189
189
|
|
|
190
|
-
timegroup.setAttribute("duration", "0s");
|
|
190
|
+
(timegroup as unknown as Element).setAttribute("duration", "0s");
|
|
191
191
|
assert.equal(timegroup.durationMs, 0);
|
|
192
192
|
|
|
193
193
|
await timegroup.updateComplete;
|
package/src/gui/EFTimeDisplay.ts
CHANGED
|
@@ -3,9 +3,11 @@ import { css, html, LitElement } from "lit";
|
|
|
3
3
|
import { customElement } from "lit/decorators.js";
|
|
4
4
|
import { currentTimeContext } from "./currentTimeContext.js";
|
|
5
5
|
import { durationContext } from "./durationContext.js";
|
|
6
|
+
import { efContext } from "./efContext.js";
|
|
7
|
+
import { TargetOrContextMixin } from "./TargetOrContextMixin.js";
|
|
6
8
|
|
|
7
9
|
@customElement("ef-time-display")
|
|
8
|
-
export class EFTimeDisplay extends LitElement {
|
|
10
|
+
export class EFTimeDisplay extends TargetOrContextMixin(LitElement, efContext) {
|
|
9
11
|
static styles = css`
|
|
10
12
|
:host {
|
|
11
13
|
display: inline-block;
|
package/src/gui/EFToggleLoop.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { consume } from "@lit/context";
|
|
2
1
|
import { css, html, LitElement } from "lit";
|
|
3
2
|
import { customElement } from "lit/decorators.js";
|
|
4
3
|
|
|
5
|
-
import type {
|
|
4
|
+
import type { ControllableInterface } from "./Controllable.js";
|
|
6
5
|
import { efContext } from "./efContext.js";
|
|
6
|
+
import { TargetOrContextMixin } from "./TargetOrContextMixin.js";
|
|
7
7
|
|
|
8
8
|
@customElement("ef-toggle-loop")
|
|
9
|
-
export class EFToggleLoop extends LitElement {
|
|
9
|
+
export class EFToggleLoop extends TargetOrContextMixin(LitElement, efContext) {
|
|
10
10
|
static styles = [
|
|
11
11
|
css`
|
|
12
12
|
:host {}
|
|
13
13
|
`,
|
|
14
14
|
];
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
get context(): ControllableInterface | null {
|
|
17
|
+
return this.effectiveContext;
|
|
18
|
+
}
|
|
18
19
|
|
|
19
20
|
render() {
|
|
20
21
|
return html`
|
package/src/gui/EFTogglePlay.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { consume } from "@lit/context";
|
|
2
2
|
import { css, html, LitElement } from "lit";
|
|
3
|
-
import { customElement } from "lit/decorators.js";
|
|
4
|
-
|
|
5
|
-
import type {
|
|
3
|
+
import { customElement, state } from "lit/decorators.js";
|
|
4
|
+
import { attachContextRoot } from "../attachContextRoot.js";
|
|
5
|
+
import type { ControllableInterface } from "./Controllable.js";
|
|
6
6
|
import { efContext } from "./efContext.js";
|
|
7
7
|
import { playingContext } from "./playingContext.js";
|
|
8
|
+
import { TargetOrContextMixin } from "./TargetOrContextMixin.js";
|
|
9
|
+
|
|
10
|
+
attachContextRoot();
|
|
8
11
|
|
|
9
12
|
@customElement("ef-toggle-play")
|
|
10
|
-
export class EFTogglePlay extends LitElement {
|
|
13
|
+
export class EFTogglePlay extends TargetOrContextMixin(LitElement, efContext) {
|
|
11
14
|
static styles = [
|
|
12
15
|
css`
|
|
13
16
|
:host {}
|
|
@@ -17,25 +20,29 @@ export class EFTogglePlay extends LitElement {
|
|
|
17
20
|
`,
|
|
18
21
|
];
|
|
19
22
|
|
|
20
|
-
@consume({ context: efContext, subscribe: true })
|
|
21
|
-
context?: ContextMixinInterface | null;
|
|
22
|
-
|
|
23
23
|
@consume({ context: playingContext, subscribe: true })
|
|
24
|
+
@state()
|
|
24
25
|
playing = false;
|
|
25
26
|
|
|
27
|
+
get efContext(): ControllableInterface | null {
|
|
28
|
+
return this.effectiveContext;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Attach click listener to host
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
this.addEventListener("click", this.togglePlay);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Detach click listener from host
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
this.removeEventListener("click", this.togglePlay);
|
|
41
|
+
}
|
|
42
|
+
|
|
26
43
|
render() {
|
|
27
44
|
return html`
|
|
28
|
-
<div
|
|
29
|
-
@click=${() => {
|
|
30
|
-
if (this.context) {
|
|
31
|
-
if (this.playing) {
|
|
32
|
-
this.context.pause();
|
|
33
|
-
} else {
|
|
34
|
-
this.context.play();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
45
|
+
<div>
|
|
39
46
|
${
|
|
40
47
|
this.playing
|
|
41
48
|
? html`<slot name="pause"></slot>`
|
|
@@ -45,15 +52,15 @@ export class EFTogglePlay extends LitElement {
|
|
|
45
52
|
`;
|
|
46
53
|
}
|
|
47
54
|
|
|
48
|
-
togglePlay() {
|
|
49
|
-
if (this.
|
|
55
|
+
togglePlay = () => {
|
|
56
|
+
if (this.efContext) {
|
|
50
57
|
if (this.playing) {
|
|
51
|
-
this.
|
|
58
|
+
this.efContext.pause();
|
|
52
59
|
} else {
|
|
53
|
-
this.
|
|
60
|
+
this.efContext.play();
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
|
-
}
|
|
63
|
+
};
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
declare global {
|