@editframe/elements 0.21.0-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/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 +72 -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 +162 -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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { TemporalMixinInterface } from '../elements/EFTemporal.js';
|
|
3
|
+
import { ContextMixinInterface } from './ContextMixin.js';
|
|
4
|
+
export declare class ControllableInterface extends LitElement {
|
|
5
|
+
playing: boolean;
|
|
6
|
+
loop: boolean;
|
|
7
|
+
currentTimeMs: number;
|
|
8
|
+
durationMs: number;
|
|
9
|
+
play(): void | Promise<void>;
|
|
10
|
+
pause(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function isControllable(value: any): value is ControllableInterface;
|
|
13
|
+
export type ControllableElement = ContextMixinInterface | (TemporalMixinInterface & {
|
|
14
|
+
playbackController: NonNullable<TemporalMixinInterface["playbackController"]>;
|
|
15
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isEFTemporal } from "../elements/EFTemporal.js";
|
|
2
|
+
import { isContextMixin } from "./ContextMixin.js";
|
|
3
|
+
function isControllable(value) {
|
|
4
|
+
if (!value || typeof value !== "object") return false;
|
|
5
|
+
if (isContextMixin(value)) return true;
|
|
6
|
+
if (isEFTemporal(value)) return value.playbackController !== void 0;
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
export { isControllable };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js";
|
|
2
2
|
import { createContext, provide } from "@lit/context";
|
|
3
3
|
import { LitElement, css, html } from "lit";
|
|
4
4
|
import { customElement, property } from "lit/decorators.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare const EFControlsTestContext_base: (new (...args: any[]) => import('./ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
|
+
declare class EFControlsTestContext extends EFControlsTestContext_base {
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"ef-controls-test-context": EFControlsTestContext;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {};
|
package/dist/gui/EFControls.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
1
|
+
import { LitElement, PropertyValueMap } from 'lit';
|
|
2
|
+
import { TemporalMixinInterface } from '../elements/EFTemporal.js';
|
|
3
|
+
import { ControllableInterface } from './Controllable.js';
|
|
4
|
+
import { FocusContext } from './focusContext.js';
|
|
5
|
+
export declare const testContext: {
|
|
6
|
+
__context__: string | null;
|
|
7
|
+
};
|
|
3
8
|
/**
|
|
4
9
|
* EFControls provides a way to control an ef-preview element that is not a direct ancestor.
|
|
5
10
|
* It bridges the contexts from a target preview element to its children controls.
|
|
@@ -21,6 +26,7 @@ import { ContextMixinInterface } from './ContextMixin.js';
|
|
|
21
26
|
export declare class EFControls extends LitElement {
|
|
22
27
|
#private;
|
|
23
28
|
static styles: import('lit').CSSResult;
|
|
29
|
+
createRenderRoot(): this;
|
|
24
30
|
/**
|
|
25
31
|
* The ID of the ef-preview element to control
|
|
26
32
|
*/
|
|
@@ -28,8 +34,16 @@ export declare class EFControls extends LitElement {
|
|
|
28
34
|
/**
|
|
29
35
|
* The target element (set by TargetController)
|
|
30
36
|
*/
|
|
31
|
-
targetElement:
|
|
32
|
-
|
|
37
|
+
targetElement: ControllableInterface | null;
|
|
38
|
+
playing: boolean;
|
|
39
|
+
loop: boolean;
|
|
40
|
+
currentTimeMs: number;
|
|
41
|
+
durationMs: number;
|
|
42
|
+
targetTemporal: TemporalMixinInterface | null;
|
|
43
|
+
focusedElement?: HTMLElement;
|
|
44
|
+
focusContext: FocusContext;
|
|
45
|
+
updated(changedProperties: PropertyValueMap<this>): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
33
47
|
}
|
|
34
48
|
declare global {
|
|
35
49
|
interface HTMLElementTagNameMap {
|
package/dist/gui/EFControls.js
CHANGED
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
import { currentTimeContext } from "./currentTimeContext.js";
|
|
2
2
|
import { durationContext } from "./durationContext.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { loopContext, playingContext } from "./playingContext.js";
|
|
4
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js";
|
|
5
5
|
import { efContext } from "./efContext.js";
|
|
6
|
-
import { fetchContext } from "./fetchContext.js";
|
|
7
6
|
import { focusContext } from "./focusContext.js";
|
|
8
7
|
import { focusedElementContext } from "./focusedElementContext.js";
|
|
9
|
-
import {
|
|
10
|
-
import { targetTimegroupContext } from "./ContextMixin.js";
|
|
8
|
+
import { targetTemporalContext } from "./ContextMixin.js";
|
|
11
9
|
import { TargetController } from "../elements/TargetController.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { attachContextRoot } from "../attachContextRoot.js";
|
|
11
|
+
import { createContext, provide } from "@lit/context";
|
|
12
|
+
import { LitElement, css } from "lit";
|
|
14
13
|
import { customElement, property, state } from "lit/decorators.js";
|
|
14
|
+
attachContextRoot();
|
|
15
|
+
var ContextRequestEvent = class extends Event {
|
|
16
|
+
constructor(context, contextTarget, callback, subscribe) {
|
|
17
|
+
super("context-request", {
|
|
18
|
+
bubbles: true,
|
|
19
|
+
composed: true
|
|
20
|
+
});
|
|
21
|
+
this.context = context;
|
|
22
|
+
this.contextTarget = contextTarget;
|
|
23
|
+
this.callback = callback;
|
|
24
|
+
this.subscribe = subscribe ?? false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var proxiedContexts = [
|
|
28
|
+
[(proxy, value) => proxy.playing = value, playingContext],
|
|
29
|
+
[(proxy, value) => proxy.loop = value, loopContext],
|
|
30
|
+
[(proxy, value) => proxy.currentTimeMs = value, currentTimeContext],
|
|
31
|
+
[(proxy, value) => proxy.durationMs = value, durationContext],
|
|
32
|
+
[(proxy, value) => proxy.targetTemporal = value, targetTemporalContext],
|
|
33
|
+
[(proxy, value) => proxy.focusedElement = value, focusedElementContext],
|
|
34
|
+
[(proxy, value) => proxy.focusContext.focusedElement = value, focusContext]
|
|
35
|
+
];
|
|
36
|
+
createContext("test");
|
|
15
37
|
var EFControls = class EFControls$1 extends LitElement {
|
|
16
38
|
constructor(..._args) {
|
|
17
39
|
super(..._args);
|
|
18
40
|
this.target = "";
|
|
19
41
|
this.targetElement = null;
|
|
42
|
+
this.playing = false;
|
|
43
|
+
this.loop = false;
|
|
44
|
+
this.currentTimeMs = 0;
|
|
45
|
+
this.durationMs = 0;
|
|
46
|
+
this.targetTemporal = null;
|
|
47
|
+
this.focusContext = this;
|
|
20
48
|
}
|
|
21
49
|
static {
|
|
22
50
|
this.styles = css`
|
|
@@ -25,27 +53,41 @@ var EFControls = class EFControls$1 extends LitElement {
|
|
|
25
53
|
}
|
|
26
54
|
`;
|
|
27
55
|
}
|
|
56
|
+
createRenderRoot() {
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
28
59
|
#targetController = new TargetController(this);
|
|
29
|
-
#
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
#proxyUnsubscribeMap = /* @__PURE__ */ new Map();
|
|
61
|
+
#unsubscribe() {
|
|
62
|
+
for (const unsubscribe of this.#proxyUnsubscribeMap.values()) unsubscribe();
|
|
63
|
+
this.#proxyUnsubscribeMap.clear();
|
|
64
|
+
}
|
|
65
|
+
updated(changedProperties) {
|
|
66
|
+
super.updated(changedProperties);
|
|
67
|
+
if (changedProperties.has("targetElement")) {
|
|
68
|
+
this.#unsubscribe();
|
|
69
|
+
if (this.targetElement) for (const [callback, context] of proxiedContexts) {
|
|
70
|
+
const event = new ContextRequestEvent(context, this, (value, unsubscribe) => {
|
|
71
|
+
callback(this, value);
|
|
72
|
+
this.#proxyUnsubscribeMap.set(context, unsubscribe);
|
|
73
|
+
}, true);
|
|
74
|
+
this.targetElement.dispatchEvent(event);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
this.#unsubscribe();
|
|
46
81
|
}
|
|
47
82
|
};
|
|
48
83
|
__decorate([property({ type: String })], EFControls.prototype, "target", void 0);
|
|
49
|
-
__decorate([state()], EFControls.prototype, "targetElement", void 0);
|
|
84
|
+
__decorate([provide({ context: efContext }), state()], EFControls.prototype, "targetElement", void 0);
|
|
85
|
+
__decorate([provide({ context: playingContext }), state()], EFControls.prototype, "playing", void 0);
|
|
86
|
+
__decorate([provide({ context: loopContext }), state()], EFControls.prototype, "loop", void 0);
|
|
87
|
+
__decorate([provide({ context: currentTimeContext }), state()], EFControls.prototype, "currentTimeMs", void 0);
|
|
88
|
+
__decorate([provide({ context: durationContext }), state()], EFControls.prototype, "durationMs", void 0);
|
|
89
|
+
__decorate([provide({ context: targetTemporalContext }), state()], EFControls.prototype, "targetTemporal", void 0);
|
|
90
|
+
__decorate([provide({ context: focusedElementContext }), state()], EFControls.prototype, "focusedElement", void 0);
|
|
91
|
+
__decorate([provide({ context: focusContext })], EFControls.prototype, "focusContext", void 0);
|
|
50
92
|
EFControls = __decorate([customElement("ef-controls")], EFControls);
|
|
51
93
|
export { EFControls };
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface DialChangeDetail {
|
|
3
|
+
value: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class EFDial extends LitElement {
|
|
6
|
+
set value(newValue: number);
|
|
7
|
+
get value(): number;
|
|
8
|
+
private _value;
|
|
9
|
+
private isDragging;
|
|
10
|
+
private dragStartAngle;
|
|
11
|
+
private dragStartValue;
|
|
12
|
+
static styles: import('lit').CSSResult;
|
|
13
|
+
private getAngleFromPoint;
|
|
14
|
+
private handlePointerDown;
|
|
15
|
+
private handlePointerMove;
|
|
16
|
+
private handlePointerUp;
|
|
17
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { __decorate } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js";
|
|
2
|
+
import { LitElement, css, html } from "lit";
|
|
3
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
4
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
5
|
+
var EFDial = class EFDial$1 extends LitElement {
|
|
6
|
+
constructor(..._args) {
|
|
7
|
+
super(..._args);
|
|
8
|
+
this._value = 0;
|
|
9
|
+
this.isDragging = false;
|
|
10
|
+
this.dragStartAngle = 0;
|
|
11
|
+
this.dragStartValue = 0;
|
|
12
|
+
}
|
|
13
|
+
set value(newValue) {
|
|
14
|
+
newValue = newValue % 360;
|
|
15
|
+
if (newValue < 0) newValue += 360;
|
|
16
|
+
newValue = Number.parseFloat(newValue.toPrecision(6));
|
|
17
|
+
const oldValue = this._value;
|
|
18
|
+
this._value = newValue;
|
|
19
|
+
this.requestUpdate("value", oldValue);
|
|
20
|
+
}
|
|
21
|
+
get value() {
|
|
22
|
+
return this._value;
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
this.styles = css`
|
|
26
|
+
:host {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
width: 200px; /* Default size, can be overridden by CSS */
|
|
29
|
+
height: 200px; /* Default size, can be overridden by CSS */
|
|
30
|
+
}
|
|
31
|
+
.dial-container {
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
background-color: #f3f4f6;
|
|
37
|
+
border: 2px solid #d1d5db;
|
|
38
|
+
}
|
|
39
|
+
.handle {
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: 16px;
|
|
42
|
+
height: 16px;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
border: 2px solid #3b82f6;
|
|
45
|
+
background-color: white;
|
|
46
|
+
cursor: grab;
|
|
47
|
+
}
|
|
48
|
+
.handle.dragging {
|
|
49
|
+
background-color: #3b82f6;
|
|
50
|
+
cursor: grabbing;
|
|
51
|
+
}
|
|
52
|
+
.center-text {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 50%;
|
|
55
|
+
left: 50%;
|
|
56
|
+
transform: translate(-50%, -50%);
|
|
57
|
+
background-color: white;
|
|
58
|
+
border: 1px solid #d1d5db;
|
|
59
|
+
padding: 2px 4px;
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
font-family: monospace;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
getAngleFromPoint(clientX, clientY, rect) {
|
|
67
|
+
const center = this.clientWidth / 2;
|
|
68
|
+
const x = clientX - rect.left - center;
|
|
69
|
+
const y = clientY - rect.top - center;
|
|
70
|
+
return Math.atan2(y, x);
|
|
71
|
+
}
|
|
72
|
+
handlePointerDown(e) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
this.isDragging = true;
|
|
75
|
+
const rect = this.getBoundingClientRect();
|
|
76
|
+
this.dragStartAngle = this.getAngleFromPoint(e.clientX, e.clientY, rect);
|
|
77
|
+
this.dragStartValue = this.value;
|
|
78
|
+
this.setPointerCapture(e.pointerId);
|
|
79
|
+
this.addEventListener("pointermove", this.handlePointerMove);
|
|
80
|
+
this.addEventListener("pointerup", this.handlePointerUp);
|
|
81
|
+
}
|
|
82
|
+
handlePointerMove(e) {
|
|
83
|
+
if (!this.isDragging) return;
|
|
84
|
+
const rect = this.getBoundingClientRect();
|
|
85
|
+
const angleDelta = this.getAngleFromPoint(e.clientX, e.clientY, rect) - this.dragStartAngle;
|
|
86
|
+
let newValue = this.dragStartValue + angleDelta * 180 / Math.PI;
|
|
87
|
+
if (e.shiftKey) newValue = Math.round(newValue / 15) * 15;
|
|
88
|
+
newValue = newValue % 360;
|
|
89
|
+
if (newValue < 0) newValue += 360;
|
|
90
|
+
newValue = Number.parseFloat(newValue.toPrecision(6));
|
|
91
|
+
this.value = newValue;
|
|
92
|
+
this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value } }));
|
|
93
|
+
}
|
|
94
|
+
handlePointerUp(e) {
|
|
95
|
+
this.isDragging = false;
|
|
96
|
+
this.releasePointerCapture(e.pointerId);
|
|
97
|
+
this.removeEventListener("pointermove", this.handlePointerMove);
|
|
98
|
+
this.removeEventListener("pointerup", this.handlePointerUp);
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
const center = this.clientWidth / 2;
|
|
102
|
+
const radius = center - 20;
|
|
103
|
+
const handleAngle = this.value * Math.PI / 180;
|
|
104
|
+
const handleX = center + Math.cos(handleAngle) * radius;
|
|
105
|
+
const handleY = center + Math.sin(handleAngle) * radius;
|
|
106
|
+
const handleStyles = {
|
|
107
|
+
left: `${handleX - 8}px`,
|
|
108
|
+
top: `${handleY - 8}px`
|
|
109
|
+
};
|
|
110
|
+
return html`
|
|
111
|
+
<div class="dial-container" @pointerdown=${this.handlePointerDown}>
|
|
112
|
+
<svg class="absolute inset-0 w-full h-full">
|
|
113
|
+
<circle
|
|
114
|
+
cx=${center}
|
|
115
|
+
cy=${center}
|
|
116
|
+
r=${radius}
|
|
117
|
+
fill="none"
|
|
118
|
+
stroke="#94a3b8"
|
|
119
|
+
stroke-width="2"
|
|
120
|
+
stroke-dasharray="4 4"
|
|
121
|
+
/>
|
|
122
|
+
${[
|
|
123
|
+
0,
|
|
124
|
+
90,
|
|
125
|
+
180,
|
|
126
|
+
270
|
|
127
|
+
].map((deg) => {
|
|
128
|
+
const angle = deg * Math.PI / 180;
|
|
129
|
+
return html`<line x1=${center + Math.cos(angle) * (radius - 8)} y1=${center + Math.sin(angle) * (radius - 8)} x2=${center + Math.cos(angle) * (radius + 8)} y2=${center + Math.sin(angle) * (radius + 8)} stroke="#64748b" stroke-width="2" />`;
|
|
130
|
+
})}
|
|
131
|
+
</svg>
|
|
132
|
+
<div class="handle ${this.isDragging ? "dragging" : ""}" style=${styleMap(handleStyles)}></div>
|
|
133
|
+
<div class="center-text">${this.value.toFixed(0)}°</div>
|
|
134
|
+
</div>
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
__decorate([property({ type: Number })], EFDial.prototype, "value", null);
|
|
139
|
+
__decorate([state()], EFDial.prototype, "isDragging", void 0);
|
|
140
|
+
EFDial = __decorate([customElement("ef-dial")], EFDial);
|
|
141
|
+
export { EFDial };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare const TestContextWrapper_base: (new (...args: any[]) => import('./ContextMixin.js').ContextMixinInterface) & typeof LitElement;
|
|
3
|
+
declare class TestContextWrapper extends TestContextWrapper_base {
|
|
4
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
"test-context-wrapper": TestContextWrapper;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -34,6 +34,8 @@ declare class FilmstripItem extends FilmstripItem_base {
|
|
|
34
34
|
};
|
|
35
35
|
render(): TemplateResult<1>;
|
|
36
36
|
renderChildren(): Array<TemplateResult<1> | typeof nothing> | typeof nothing;
|
|
37
|
+
hideSelectors?: string[];
|
|
38
|
+
showSelectors?: string[];
|
|
37
39
|
contents(): TemplateResult<1>;
|
|
38
40
|
animations(): (TemplateResult<1> | typeof nothing)[];
|
|
39
41
|
protected filmstripController?: ElementFilmstripController;
|
|
@@ -100,6 +102,8 @@ declare class EFHierarchyItem<ElementType extends HTMLElement = HTMLElement> ext
|
|
|
100
102
|
element: ElementType;
|
|
101
103
|
focusContext?: FocusContext;
|
|
102
104
|
focusedElement?: HTMLElement | null;
|
|
105
|
+
hideSelectors?: string[];
|
|
106
|
+
showSelectors?: string[];
|
|
103
107
|
get icon(): TemplateResult<1> | string;
|
|
104
108
|
get isFocused(): boolean;
|
|
105
109
|
displayLabel(): TemplateResult<1> | string | typeof nothing;
|
|
@@ -140,6 +144,10 @@ export declare class EFFilmstrip extends EFFilmstrip_base {
|
|
|
140
144
|
#private;
|
|
141
145
|
static styles: import('lit').CSSResult[];
|
|
142
146
|
pixelsPerMs: number;
|
|
147
|
+
hide: string;
|
|
148
|
+
show: string;
|
|
149
|
+
get hideSelectors(): string[] | undefined;
|
|
150
|
+
get showSelectors(): string[] | undefined;
|
|
143
151
|
scrubbing: boolean;
|
|
144
152
|
timelineScrolltop: number;
|
|
145
153
|
playing?: boolean;
|
|
@@ -163,8 +171,10 @@ export declare class EFFilmstrip extends EFFilmstrip_base {
|
|
|
163
171
|
get gutter(): HTMLDivElement | undefined;
|
|
164
172
|
render(): TemplateResult<1>;
|
|
165
173
|
updated(changes: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
166
|
-
target
|
|
167
|
-
|
|
174
|
+
target: string;
|
|
175
|
+
targetElement: Element | null;
|
|
176
|
+
private _contextProvidedTemporal?;
|
|
177
|
+
get targetTemporal(): TemporalMixinInterface | null;
|
|
168
178
|
protected willUpdate(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
169
179
|
}
|
|
170
180
|
declare global {
|