@editframe/elements 0.12.0-beta.15 → 0.12.0-beta.18
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/elements/EFAudio.d.ts +1 -1
- package/dist/elements/EFAudio.js +2 -2
- package/dist/elements/EFCaptions.d.ts +5 -5
- package/dist/elements/EFImage.d.ts +1 -1
- package/dist/elements/EFMedia.browsertest.d.ts +1 -1
- package/dist/elements/EFMedia.d.ts +1 -1
- package/dist/elements/EFSourceMixin.js +1 -1
- package/dist/elements/EFTemporal.browsertest.d.ts +1 -1
- package/dist/elements/EFTemporal.d.ts +4 -1
- package/dist/elements/EFTemporal.js +3 -0
- package/dist/elements/EFTimegroup.browsertest.d.ts +2 -2
- package/dist/elements/EFTimegroup.d.ts +3 -3
- package/dist/elements/EFVideo.d.ts +1 -1
- package/dist/elements/EFWaveform.d.ts +7 -4
- package/dist/elements/EFWaveform.js +48 -56
- package/dist/elements/TimegroupController.d.ts +2 -2
- package/dist/elements/util.d.ts +1 -1
- package/dist/gui/ContextMixin.browsertest.d.ts +1 -1
- package/dist/gui/ContextMixin.d.ts +1 -1
- package/dist/gui/EFFilmstrip.d.ts +7 -7
- package/dist/gui/EFPreview.d.ts +1 -1
- package/dist/gui/EFScrubber.d.ts +1 -1
- package/dist/gui/EFTimeDisplay.d.ts +1 -1
- package/dist/gui/EFToggleLoop.d.ts +1 -1
- package/dist/gui/EFToggleLoop.js +1 -1
- package/dist/gui/EFTogglePlay.d.ts +1 -1
- package/dist/gui/EFWorkbench.d.ts +1 -1
- package/dist/gui/efContext.d.ts +1 -1
- package/dist/index.d.ts +14 -14
- package/package.json +5 -4
- package/src/elements/EFAudio.ts +3 -3
- package/src/elements/EFCaptions.browsertest.ts +3 -3
- package/src/elements/EFCaptions.ts +9 -9
- package/src/elements/EFImage.browsertest.ts +2 -2
- package/src/elements/EFImage.ts +4 -4
- package/src/elements/EFMedia.browsertest.ts +6 -6
- package/src/elements/EFMedia.ts +6 -6
- package/src/elements/EFSourceMixin.ts +3 -3
- package/src/elements/EFTemporal.browsertest.ts +1 -1
- package/src/elements/EFTemporal.ts +9 -3
- package/src/elements/EFTimegroup.browsertest.ts +5 -5
- package/src/elements/EFTimegroup.ts +6 -6
- package/src/elements/EFVideo.ts +2 -2
- package/src/elements/EFWaveform.ts +82 -98
- package/src/elements/FetchMixin.ts +2 -2
- package/src/elements/TimegroupController.ts +2 -2
- package/src/elements/durationConverter.ts +1 -1
- package/src/elements/util.ts +1 -1
- package/src/gui/ContextMixin.browsertest.ts +3 -3
- package/src/gui/ContextMixin.ts +7 -7
- package/src/gui/EFFilmstrip.ts +15 -15
- package/src/gui/EFPreview.ts +2 -2
- package/src/gui/EFScrubber.ts +3 -3
- package/src/gui/EFTimeDisplay.ts +2 -2
- package/src/gui/EFToggleLoop.ts +4 -4
- package/src/gui/EFTogglePlay.ts +3 -3
- package/src/gui/EFWorkbench.ts +2 -2
- package/src/gui/efContext.ts +1 -1
package/dist/elements/EFAudio.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Task } from "@lit/task";
|
|
1
2
|
import { html } from "lit";
|
|
2
|
-
import { createRef, ref } from "lit/directives/ref.js";
|
|
3
3
|
import { property, customElement } from "lit/decorators.js";
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
4
5
|
import { EFMedia } from "./EFMedia.js";
|
|
5
|
-
import { Task } from "@lit/task";
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
8
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Task } from '@lit/task';
|
|
2
2
|
import { LitElement, PropertyValueMap } from 'lit';
|
|
3
|
-
import { EFAudio } from './EFAudio.
|
|
4
|
-
import { EFVideo } from './EFVideo.
|
|
5
|
-
declare const EFCaptionsActiveWord_base: (new (...args: any[]) => import('./EFTemporal.
|
|
3
|
+
import { EFAudio } from './EFAudio.js';
|
|
4
|
+
import { EFVideo } from './EFVideo.js';
|
|
5
|
+
declare const EFCaptionsActiveWord_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
6
6
|
export declare class EFCaptionsActiveWord extends EFCaptionsActiveWord_base {
|
|
7
7
|
static styles: import('lit').CSSResult[];
|
|
8
8
|
render(): import('lit-html').TemplateResult<1> | undefined;
|
|
@@ -13,7 +13,7 @@ export declare class EFCaptionsActiveWord extends EFCaptionsActiveWord_base {
|
|
|
13
13
|
get startTimeMs(): number;
|
|
14
14
|
get durationMs(): number;
|
|
15
15
|
}
|
|
16
|
-
declare const EFCaptionsSegment_base: (new (...args: any[]) => import('./EFTemporal.
|
|
16
|
+
declare const EFCaptionsSegment_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
17
17
|
export declare class EFCaptionsSegment extends EFCaptionsSegment_base {
|
|
18
18
|
static styles: import('lit').CSSResult[];
|
|
19
19
|
render(): import('lit-html').TemplateResult<1> | undefined;
|
|
@@ -44,7 +44,7 @@ export declare class EFCaptionsAfterActiveWord extends EFCaptionsSegment {
|
|
|
44
44
|
get startTimeMs(): number;
|
|
45
45
|
get durationMs(): number;
|
|
46
46
|
}
|
|
47
|
-
declare const EFCaptions_base: (new (...args: any[]) => import('./EFSourceMixin.
|
|
47
|
+
declare const EFCaptions_base: (new (...args: any[]) => import('./EFSourceMixin.js').EFSourceMixinInterface) & (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & (new (...args: any[]) => import('./FetchMixin.js').FetchMixinInterface) & typeof LitElement;
|
|
48
48
|
export declare class EFCaptions extends EFCaptions_base {
|
|
49
49
|
static styles: import('lit').CSSResult[];
|
|
50
50
|
displayMode: "word" | "segment" | "context";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Task } from '@lit/task';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
declare const EFImage_base: (new (...args: any[]) => import('./EFSourceMixin.
|
|
3
|
+
declare const EFImage_base: (new (...args: any[]) => import('./EFSourceMixin.js').EFSourceMixinInterface) & (new (...args: any[]) => import('./FetchMixin.js').FetchMixinInterface) & typeof LitElement;
|
|
4
4
|
export declare class EFImage extends EFImage_base {
|
|
5
5
|
#private;
|
|
6
6
|
static styles: import('lit').CSSResult[];
|
|
@@ -5,7 +5,7 @@ import { VideoAsset } from '../../../assets/src/EncodedAsset.ts';
|
|
|
5
5
|
import { MP4File } from '../../../assets/src/MP4File.ts';
|
|
6
6
|
import type * as MP4Box from "mp4box";
|
|
7
7
|
export declare const deepGetMediaElements: (element: Element, medias?: EFMedia[]) => EFMedia[];
|
|
8
|
-
declare const EFMedia_base: (new (...args: any[]) => import('./EFSourceMixin.
|
|
8
|
+
declare const EFMedia_base: (new (...args: any[]) => import('./EFSourceMixin.js').EFSourceMixinInterface) & (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & (new (...args: any[]) => import('./FetchMixin.js').FetchMixinInterface) & typeof LitElement;
|
|
9
9
|
export declare class EFMedia extends EFMedia_base {
|
|
10
10
|
#private;
|
|
11
11
|
static styles: import('lit').CSSResult[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { consume } from "@lit/context";
|
|
2
|
-
import { state } from "lit/decorators/state.js";
|
|
3
2
|
import { Task } from "@lit/task";
|
|
4
3
|
import { property } from "lit/decorators/property.js";
|
|
4
|
+
import { state } from "lit/decorators/state.js";
|
|
5
5
|
import { apiHostContext } from "../gui/apiHostContext.js";
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
declare const TestTemporal_base: (new (...args: any[]) => import('./EFTemporal.
|
|
2
|
+
declare const TestTemporal_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
3
3
|
declare class TestTemporal extends TestTemporal_base {
|
|
4
4
|
}
|
|
5
5
|
declare global {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, ReactiveController } from 'lit';
|
|
2
|
-
import { EFTimegroup } from './EFTimegroup.
|
|
2
|
+
import { EFTimegroup } from './EFTimegroup.js';
|
|
3
3
|
import { Task } from '@lit/task';
|
|
4
4
|
export declare const timegroupContext: {
|
|
5
5
|
__context__: EFTimegroup;
|
|
@@ -20,6 +20,9 @@ export declare class TemporalMixinInterface {
|
|
|
20
20
|
set sourceout(value: string);
|
|
21
21
|
get durationMs(): number;
|
|
22
22
|
get startTimeMs(): number;
|
|
23
|
+
/**
|
|
24
|
+
* The start time of the element within its parent timegroup.
|
|
25
|
+
*/
|
|
23
26
|
get startTimeWithinParentMs(): number;
|
|
24
27
|
get endTimeMs(): number;
|
|
25
28
|
get ownCurrentTimeMs(): number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
declare const TestContext_base: (new (...args: any[]) => import('../gui/ContextMixin.
|
|
2
|
+
declare const TestContext_base: (new (...args: any[]) => import('../gui/ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
3
|
declare class TestContext extends TestContext_base {
|
|
4
4
|
}
|
|
5
|
-
declare const TestTemporal_base: (new (...args: any[]) => import('./EFTemporal.
|
|
5
|
+
declare const TestTemporal_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
6
6
|
declare class TestTemporal extends TestTemporal_base {
|
|
7
7
|
get hasOwnDuration(): boolean;
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Task } from '@lit/task';
|
|
2
2
|
import { LitElement, PropertyValueMap } from 'lit';
|
|
3
3
|
export declare const shallowGetTimegroups: (element: Element, groups?: EFTimegroup[]) => EFTimegroup[];
|
|
4
|
-
declare const EFTimegroup_base: (new (...args: any[]) => import('./EFTemporal.
|
|
4
|
+
declare const EFTimegroup_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
5
5
|
export declare class EFTimegroup extends EFTimegroup_base {
|
|
6
6
|
#private;
|
|
7
7
|
static styles: import('lit').CSSResult;
|
|
@@ -28,9 +28,9 @@ export declare class EFTimegroup extends EFTimegroup_base {
|
|
|
28
28
|
buffer: import('mp4box').MP4ArrayBuffer;
|
|
29
29
|
mp4File: import('../../../assets/src/MP4File.ts').MP4File;
|
|
30
30
|
}[] | undefined)[]>;
|
|
31
|
-
get childTemporals(): import('./EFTemporal.
|
|
31
|
+
get childTemporals(): import('./EFTemporal.js').TemporalMixinInterface[];
|
|
32
32
|
protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
33
|
-
get contextProvider(): import('../gui/ContextMixin.
|
|
33
|
+
get contextProvider(): import('../gui/ContextMixin.js').ContextMixinInterface | null;
|
|
34
34
|
/**
|
|
35
35
|
* Returns true if the timegroup should be wrapped with a workbench.
|
|
36
36
|
*
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { EFAudio } from './EFAudio.
|
|
1
|
+
import { EFAudio } from './EFAudio.js';
|
|
2
2
|
import { Task } from '@lit/task';
|
|
3
3
|
import { LitElement, PropertyValueMap } from 'lit';
|
|
4
4
|
import { Ref } from 'lit/directives/ref.js';
|
|
5
|
-
import { EFVideo } from './EFVideo.
|
|
6
|
-
declare const EFWaveform_base: (new (...args: any[]) => import('./EFTemporal.
|
|
5
|
+
import { EFVideo } from './EFVideo.js';
|
|
6
|
+
declare const EFWaveform_base: (new (...args: any[]) => import('./EFTemporal.js').TemporalMixinInterface) & typeof LitElement;
|
|
7
7
|
export declare class EFWaveform extends EFWaveform_base {
|
|
8
8
|
static styles: import('lit').CSSResult[];
|
|
9
9
|
canvasRef: Ref<HTMLCanvasElement>;
|
|
10
10
|
private ctx;
|
|
11
|
+
private resizeObserver?;
|
|
12
|
+
private mutationObserver?;
|
|
11
13
|
createRenderRoot(): this;
|
|
12
14
|
render(): import('lit-html').TemplateResult<1>;
|
|
13
15
|
mode: "roundBars" | "bars" | "bricks" | "equalizer" | "curve" | "line" | "pixel" | "wave";
|
|
@@ -15,6 +17,8 @@ export declare class EFWaveform extends EFWaveform_base {
|
|
|
15
17
|
targetSelector: string;
|
|
16
18
|
set target(value: string);
|
|
17
19
|
connectedCallback(): void;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
private resizeCanvas;
|
|
18
22
|
protected initCanvas(): CanvasRenderingContext2D | null;
|
|
19
23
|
protected drawBars(ctx: CanvasRenderingContext2D, frequencyData: Uint8Array): void;
|
|
20
24
|
protected drawBricks(ctx: CanvasRenderingContext2D, frequencyData: Uint8Array): void;
|
|
@@ -24,7 +28,6 @@ export declare class EFWaveform extends EFWaveform_base {
|
|
|
24
28
|
protected drawCurve(ctx: CanvasRenderingContext2D, frequencyData: Uint8Array): void;
|
|
25
29
|
protected drawPixel(ctx: CanvasRenderingContext2D, frequencyData: Uint8Array): void;
|
|
26
30
|
protected drawWave(ctx: CanvasRenderingContext2D, frequencyData: Uint8Array): void;
|
|
27
|
-
private lastFrameTime;
|
|
28
31
|
frameTask: Task<readonly [import('@lit/task').TaskStatus], void>;
|
|
29
32
|
get durationMs(): number;
|
|
30
33
|
get targetElement(): EFAudio | EFVideo;
|
|
@@ -26,53 +26,39 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
26
26
|
this.mode = "bars";
|
|
27
27
|
this.color = "currentColor";
|
|
28
28
|
this.targetSelector = "";
|
|
29
|
-
this.lastFrameTime = 0;
|
|
30
29
|
this.frameTask = new Task(this, {
|
|
31
30
|
autoRun: EF_INTERACTIVE,
|
|
32
31
|
args: () => [this.targetElement.audioBufferTask.status],
|
|
33
32
|
task: async () => {
|
|
34
|
-
const currentTime = performance.now();
|
|
35
|
-
const timeSinceLastFrame = this.lastFrameTime ? currentTime - this.lastFrameTime : 0;
|
|
36
|
-
console.log(`Time since last frame: ${timeSinceLastFrame.toFixed(2)}ms`);
|
|
37
|
-
this.lastFrameTime = currentTime;
|
|
38
33
|
await this.targetElement.audioBufferTask.taskComplete;
|
|
39
34
|
this.ctx ||= this.initCanvas();
|
|
40
35
|
const ctx = this.ctx;
|
|
41
36
|
if (!ctx) return;
|
|
42
37
|
if (!this.targetElement.audioBufferTask.value) return;
|
|
43
38
|
if (this.targetElement.trimAdjustedOwnCurrentTimeMs > 0) {
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const smoothedData = new Uint8Array(dataLength);
|
|
68
|
-
for (let i = 0; i < smoothedData.length; i++) {
|
|
69
|
-
let sum = 0;
|
|
70
|
-
for (const frameData of multiFrameData) {
|
|
71
|
-
sum += frameData[i] ?? 0;
|
|
72
|
-
}
|
|
73
|
-
let avg = sum / FRAMES_TO_ANALYZE;
|
|
74
|
-
avg = (avg / 255) ** 1.2 * 255;
|
|
75
|
-
smoothedData[i] = Math.round(avg);
|
|
39
|
+
const FRAME_DURATION_MS = 48e3 / 1e3;
|
|
40
|
+
const FRAME_SMEAR_MS = FRAME_DURATION_MS * 1;
|
|
41
|
+
const FRAME_SMEAR_S = FRAME_SMEAR_MS / 1e3;
|
|
42
|
+
const audioContext = new OfflineAudioContext(2, 48e3 / 25, 48e3);
|
|
43
|
+
const audioBufferSource = audioContext.createBufferSource();
|
|
44
|
+
audioBufferSource.buffer = this.targetElement.audioBufferTask.value.buffer;
|
|
45
|
+
const analyser = audioContext.createAnalyser();
|
|
46
|
+
analyser.fftSize = 128 * 8;
|
|
47
|
+
audioBufferSource.connect(analyser);
|
|
48
|
+
const startTime = Math.max(
|
|
49
|
+
0,
|
|
50
|
+
(this.targetElement.trimAdjustedOwnCurrentTimeMs - this.targetElement.audioBufferTask.value.startOffsetMs) / 1e3
|
|
51
|
+
);
|
|
52
|
+
audioBufferSource.start(0, startTime, FRAME_SMEAR_S);
|
|
53
|
+
await audioContext.startRendering();
|
|
54
|
+
const frameData = new Uint8Array(analyser.frequencyBinCount);
|
|
55
|
+
analyser.getByteFrequencyData(frameData);
|
|
56
|
+
const smoothedData = frameData.slice(0, frameData.length / 2);
|
|
57
|
+
if (this.color === "currentColor") {
|
|
58
|
+
const computedStyle = getComputedStyle(this);
|
|
59
|
+
const currentColor = computedStyle.color;
|
|
60
|
+
ctx.strokeStyle = currentColor;
|
|
61
|
+
ctx.fillStyle = currentColor;
|
|
76
62
|
}
|
|
77
63
|
switch (this.mode) {
|
|
78
64
|
case "bars":
|
|
@@ -118,9 +104,31 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
118
104
|
if (this.targetElement) {
|
|
119
105
|
new CrossUpdateController(this.targetElement, this);
|
|
120
106
|
}
|
|
107
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
108
|
+
this.resizeCanvas();
|
|
109
|
+
});
|
|
110
|
+
this.resizeObserver.observe(this);
|
|
111
|
+
this.mutationObserver = new MutationObserver((mutationsList) => {
|
|
112
|
+
for (const mutation of mutationsList) {
|
|
113
|
+
if (mutation.type === "attributes") {
|
|
114
|
+
this.frameTask.run();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
this.mutationObserver.observe(this, { attributes: true });
|
|
119
|
+
}
|
|
120
|
+
disconnectedCallback() {
|
|
121
|
+
super.disconnectedCallback();
|
|
122
|
+
this.resizeObserver?.disconnect();
|
|
123
|
+
this.mutationObserver?.disconnect();
|
|
124
|
+
}
|
|
125
|
+
resizeCanvas() {
|
|
126
|
+
this.ctx = this.initCanvas();
|
|
127
|
+
if (this.ctx) {
|
|
128
|
+
this.frameTask.run();
|
|
129
|
+
}
|
|
121
130
|
}
|
|
122
131
|
initCanvas() {
|
|
123
|
-
console.count("initCanvas");
|
|
124
132
|
const canvas = this.canvasRef.value;
|
|
125
133
|
if (!canvas) return null;
|
|
126
134
|
const rect = this.getBoundingClientRect();
|
|
@@ -135,8 +143,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
135
143
|
return ctx;
|
|
136
144
|
}
|
|
137
145
|
drawBars(ctx, frequencyData) {
|
|
138
|
-
ctx.strokeStyle = this.color;
|
|
139
|
-
ctx.fillStyle = this.color;
|
|
140
146
|
const canvas = ctx.canvas;
|
|
141
147
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
142
148
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -151,8 +157,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
151
157
|
});
|
|
152
158
|
}
|
|
153
159
|
drawBricks(ctx, frequencyData) {
|
|
154
|
-
ctx.strokeStyle = this.color;
|
|
155
|
-
ctx.fillStyle = this.color;
|
|
156
160
|
const canvas = ctx.canvas;
|
|
157
161
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
158
162
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -176,8 +180,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
176
180
|
});
|
|
177
181
|
}
|
|
178
182
|
drawLine(ctx, frequencyData) {
|
|
179
|
-
ctx.strokeStyle = this.color;
|
|
180
|
-
ctx.fillStyle = this.color;
|
|
181
183
|
const canvas = ctx.canvas;
|
|
182
184
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
183
185
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -196,8 +198,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
196
198
|
ctx.stroke();
|
|
197
199
|
}
|
|
198
200
|
drawRoundBars(ctx, frequencyData) {
|
|
199
|
-
ctx.strokeStyle = this.color;
|
|
200
|
-
ctx.fillStyle = this.color;
|
|
201
201
|
const canvas = ctx.canvas;
|
|
202
202
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
203
203
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -216,8 +216,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
drawEqualizer(ctx, frequencyData) {
|
|
219
|
-
ctx.strokeStyle = this.color;
|
|
220
|
-
ctx.fillStyle = this.color;
|
|
221
219
|
const canvas = ctx.canvas;
|
|
222
220
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
223
221
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -237,8 +235,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
237
235
|
});
|
|
238
236
|
}
|
|
239
237
|
drawCurve(ctx, frequencyData) {
|
|
240
|
-
ctx.strokeStyle = this.color;
|
|
241
|
-
ctx.fillStyle = this.color;
|
|
242
238
|
const canvas = ctx.canvas;
|
|
243
239
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
244
240
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -257,8 +253,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
257
253
|
ctx.stroke();
|
|
258
254
|
}
|
|
259
255
|
drawPixel(ctx, frequencyData) {
|
|
260
|
-
ctx.strokeStyle = this.color;
|
|
261
|
-
ctx.fillStyle = this.color;
|
|
262
256
|
const canvas = ctx.canvas;
|
|
263
257
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
264
258
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -273,8 +267,6 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
273
267
|
});
|
|
274
268
|
}
|
|
275
269
|
drawWave(ctx, frequencyData) {
|
|
276
|
-
ctx.strokeStyle = this.color;
|
|
277
|
-
ctx.fillStyle = this.color;
|
|
278
270
|
const canvas = ctx.canvas;
|
|
279
271
|
const waveWidth = canvas.width / devicePixelRatio;
|
|
280
272
|
const waveHeight = canvas.height / devicePixelRatio;
|
|
@@ -285,7 +277,7 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
285
277
|
ctx.moveTo(0, baseline);
|
|
286
278
|
ctx.lineTo(waveWidth, baseline);
|
|
287
279
|
ctx.strokeStyle = this.color;
|
|
288
|
-
ctx.lineWidth =
|
|
280
|
+
ctx.lineWidth = 1;
|
|
289
281
|
ctx.stroke();
|
|
290
282
|
frequencyData.forEach((value, i) => {
|
|
291
283
|
const x = i * (waveWidth / frequencyData.length);
|
|
@@ -306,7 +298,7 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
|
|
|
306
298
|
}
|
|
307
299
|
updated(changedProperties) {
|
|
308
300
|
super.updated(changedProperties);
|
|
309
|
-
if (changedProperties.
|
|
301
|
+
if (changedProperties.size > 0) {
|
|
310
302
|
this.frameTask.run();
|
|
311
303
|
}
|
|
312
304
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EFTimegroup } from './EFTimegroup.
|
|
1
|
+
import { LitElement, ReactiveController } from 'lit';
|
|
2
|
+
import { EFTimegroup } from './EFTimegroup.js';
|
|
3
3
|
export declare class TimegroupController implements ReactiveController {
|
|
4
4
|
private host;
|
|
5
5
|
private child;
|
package/dist/elements/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
declare const TestContext_base: (new (...args: any[]) => import('./ContextMixin.
|
|
2
|
+
declare const TestContext_base: (new (...args: any[]) => import('./ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
3
|
declare class TestContext extends TestContext_base {
|
|
4
4
|
}
|
|
5
5
|
declare global {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { createRef } from 'lit/directives/ref.js';
|
|
3
|
-
import { EFTimegroup } from '../elements/EFTimegroup.
|
|
3
|
+
import { EFTimegroup } from '../elements/EFTimegroup.js';
|
|
4
4
|
export declare class ContextMixinInterface extends LitElement {
|
|
5
5
|
signingURL?: string;
|
|
6
6
|
apiHost?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LitElement, PropertyValueMap, ReactiveController, TemplateResult, nothing } from 'lit';
|
|
2
|
-
import { EFAudio } from '../elements/EFAudio.
|
|
3
|
-
import { EFImage } from '../elements/EFImage.
|
|
4
|
-
import { TemporalMixinInterface } from '../elements/EFTemporal.
|
|
5
|
-
import { EFTimegroup } from '../elements/EFTimegroup.
|
|
6
|
-
import { EFVideo } from '../elements/EFVideo.
|
|
7
|
-
import { TimegroupController } from '../elements/TimegroupController.
|
|
8
|
-
import { FocusContext } from './focusContext.
|
|
2
|
+
import { EFAudio } from '../elements/EFAudio.js';
|
|
3
|
+
import { EFImage } from '../elements/EFImage.js';
|
|
4
|
+
import { TemporalMixinInterface } from '../elements/EFTemporal.js';
|
|
5
|
+
import { EFTimegroup } from '../elements/EFTimegroup.js';
|
|
6
|
+
import { EFVideo } from '../elements/EFVideo.js';
|
|
7
|
+
import { TimegroupController } from '../elements/TimegroupController.js';
|
|
8
|
+
import { FocusContext } from './focusContext.js';
|
|
9
9
|
declare class ElementFilmstripController implements ReactiveController {
|
|
10
10
|
private host;
|
|
11
11
|
private filmstrip;
|
package/dist/gui/EFPreview.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
declare const EFPreview_base: (new (...args: any[]) => import('./ContextMixin.
|
|
2
|
+
declare const EFPreview_base: (new (...args: any[]) => import('./ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
3
|
export declare class EFPreview extends EFPreview_base {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
render(): import('lit-html').TemplateResult<1>;
|
package/dist/gui/EFScrubber.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { ContextMixinInterface } from './ContextMixin.
|
|
2
|
+
import { ContextMixinInterface } from './ContextMixin.js';
|
|
3
3
|
export declare class EFScrubber extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
context?: ContextMixinInterface | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { ContextMixinInterface } from './ContextMixin.
|
|
2
|
+
import { ContextMixinInterface } from './ContextMixin.js';
|
|
3
3
|
export declare class EFTimeDisplay extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
context?: ContextMixinInterface | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { ContextMixinInterface } from './ContextMixin.
|
|
2
|
+
import { ContextMixinInterface } from './ContextMixin.js';
|
|
3
3
|
export declare class EFToggleLoop extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
context?: ContextMixinInterface | null;
|
package/dist/gui/EFToggleLoop.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { consume } from "@lit/context";
|
|
1
2
|
import { css, LitElement, html } from "lit";
|
|
2
3
|
import { customElement } from "lit/decorators.js";
|
|
3
|
-
import { consume } from "@lit/context";
|
|
4
4
|
import { efContext } from "./efContext.js";
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { ContextMixinInterface } from './ContextMixin.
|
|
2
|
+
import { ContextMixinInterface } from './ContextMixin.js';
|
|
3
3
|
export declare class EFTogglePlay extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
context?: ContextMixinInterface | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, PropertyValueMap } from 'lit';
|
|
2
|
-
declare const EFWorkbench_base: (new (...args: any[]) => import('./ContextMixin.
|
|
2
|
+
declare const EFWorkbench_base: (new (...args: any[]) => import('./ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
3
|
export declare class EFWorkbench extends EFWorkbench_base {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
disconnectedCallback(): void;
|
package/dist/gui/efContext.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { EFTimegroup } from './elements/EFTimegroup.
|
|
2
|
-
export { EFImage } from './elements/EFImage.
|
|
3
|
-
export type { EFMedia } from './elements/EFMedia.
|
|
4
|
-
export { EFAudio } from './elements/EFAudio.
|
|
5
|
-
export { EFVideo } from './elements/EFVideo.
|
|
6
|
-
export { EFCaptions, EFCaptionsActiveWord, EFCaptionsSegment, EFCaptionsBeforeActiveWord, EFCaptionsAfterActiveWord, } from './elements/EFCaptions.
|
|
7
|
-
export { EFWaveform } from './elements/EFWaveform.
|
|
8
|
-
export { EFWorkbench } from './gui/EFWorkbench.
|
|
9
|
-
export { EFPreview } from './gui/EFPreview.
|
|
10
|
-
export { EFFilmstrip } from './gui/EFFilmstrip.
|
|
11
|
-
export { EFTogglePlay } from './gui/EFTogglePlay.
|
|
12
|
-
export { EFToggleLoop } from './gui/EFToggleLoop.
|
|
13
|
-
export { EFScrubber } from './gui/EFScrubber.
|
|
14
|
-
export { EFTimeDisplay } from './gui/EFTimeDisplay.
|
|
1
|
+
export { EFTimegroup } from './elements/EFTimegroup.js';
|
|
2
|
+
export { EFImage } from './elements/EFImage.js';
|
|
3
|
+
export type { EFMedia } from './elements/EFMedia.js';
|
|
4
|
+
export { EFAudio } from './elements/EFAudio.js';
|
|
5
|
+
export { EFVideo } from './elements/EFVideo.js';
|
|
6
|
+
export { EFCaptions, EFCaptionsActiveWord, EFCaptionsSegment, EFCaptionsBeforeActiveWord, EFCaptionsAfterActiveWord, } from './elements/EFCaptions.js';
|
|
7
|
+
export { EFWaveform } from './elements/EFWaveform.js';
|
|
8
|
+
export { EFWorkbench } from './gui/EFWorkbench.js';
|
|
9
|
+
export { EFPreview } from './gui/EFPreview.js';
|
|
10
|
+
export { EFFilmstrip } from './gui/EFFilmstrip.js';
|
|
11
|
+
export { EFTogglePlay } from './gui/EFTogglePlay.js';
|
|
12
|
+
export { EFToggleLoop } from './gui/EFToggleLoop.js';
|
|
13
|
+
export { EFScrubber } from './gui/EFScrubber.js';
|
|
14
|
+
export { EFTimeDisplay } from './gui/EFTimeDisplay.js';
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/elements",
|
|
3
|
-
"version": "0.12.0-beta.
|
|
3
|
+
"version": "0.12.0-beta.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"default": "./dist/
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"./styles.css": "./dist/style.css"
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false",
|
|
17
17
|
"build": "vite build",
|
|
18
|
-
"build:watch": "vite build --watch"
|
|
18
|
+
"build:watch": "vite build --watch",
|
|
19
|
+
"typedoc": "typedoc --json ../../docs/elements.json --plugin typedoc-plugin-zod --excludeExternals ./src"
|
|
19
20
|
},
|
|
20
21
|
"author": "",
|
|
21
22
|
"license": "UNLICENSED",
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@editframe/assets": "0.12.0-beta.
|
|
24
|
+
"@editframe/assets": "0.12.0-beta.18",
|
|
24
25
|
"@lit/context": "^1.1.2",
|
|
25
26
|
"@lit/task": "^1.0.1",
|
|
26
27
|
"d3": "^7.9.0",
|
package/src/elements/EFAudio.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { Task } from "@lit/task";
|
|
1
2
|
import { html } from "lit";
|
|
2
|
-
import { createRef, ref } from "lit/directives/ref.js";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
|
+
import { EFMedia } from "./EFMedia.js";
|
|
6
6
|
|
|
7
7
|
@customElement("ef-audio")
|
|
8
8
|
export class EFAudio extends EFMedia {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
2
|
-
import "../gui/EFPreview.
|
|
3
|
-
import "./EFCaptions.
|
|
4
|
-
import "./EFVideo.
|
|
2
|
+
import "../gui/EFPreview.js";
|
|
3
|
+
import "./EFCaptions.js";
|
|
4
|
+
import "./EFVideo.js";
|
|
5
5
|
import { v4 } from "uuid";
|
|
6
6
|
|
|
7
7
|
describe("EFCaptions", () => {
|