@editframe/elements 0.40.4 → 0.40.5

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.
@@ -17,7 +17,7 @@ function EFSourceMixin(superClass, options) {
17
17
  } });
18
18
  }
19
19
  get apiHost() {
20
- return this.closest("ef-configuration")?.apiHost ?? this.closest("ef-workbench")?.apiHost ?? this.closest("ef-preview")?.apiHost ?? window.location.origin;
20
+ return this.closest("ef-configuration")?.apiHost || this.closest("ef-workbench")?.apiHost || this.closest("ef-preview")?.apiHost || window.location.origin;
21
21
  }
22
22
  #md5Value = void 0;
23
23
  #md5Promise = null;
@@ -1 +1 @@
1
- {"version":3,"file":"EFSourceMixin.js","names":["#md5Value","#md5LastSrc","#md5Promise","#doLoadMd5"],"sources":["../../src/elements/EFSourceMixin.ts"],"sourcesContent":["import type { LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\nexport declare class EFSourceMixinInterface {\n apiHost?: string;\n productionSrc(): string;\n src: string;\n}\n\ninterface EFSourceMixinOptions {\n assetType: string;\n}\ntype Constructor<T = {}> = new (...args: any[]) => T;\nexport function EFSourceMixin<T extends Constructor<LitElement>>(\n superClass: T,\n options: EFSourceMixinOptions,\n) {\n class EFSourceElement extends superClass {\n get apiHost() {\n return (\n (this.closest(\"ef-configuration\") as any)?.apiHost ??\n (this.closest(\"ef-workbench\") as any)?.apiHost ??\n (this.closest(\"ef-preview\") as any)?.apiHost ??\n window.location.origin\n );\n }\n\n @property({ type: String, reflect: true })\n src = \"\";\n\n #md5Value: string | undefined = undefined;\n #md5Promise: Promise<string | undefined> | null = null;\n #md5LastSrc: string | null = null;\n\n productionSrc() {\n if (!this.#md5Value) {\n throw new Error(\n `MD5 sum not available for ${this}. Cannot generate production URL`,\n );\n }\n\n if (!this.apiHost) {\n throw new Error(\n `apiHost not available for ${this}. Cannot generate production URL`,\n );\n }\n\n return `${this.apiHost}/api/v1/${options.assetType}/${this.#md5Value}`;\n }\n\n /**\n * Load MD5 sum for the current source\n */\n async loadMd5Sum(signal?: AbortSignal): Promise<string | undefined> {\n if (this.#md5LastSrc === this.src && this.#md5Value) {\n return this.#md5Value;\n }\n\n if (this.#md5Promise && this.#md5LastSrc === this.src) {\n return this.#md5Promise;\n }\n\n this.#md5LastSrc = this.src;\n this.#md5Promise = this.#doLoadMd5(this.src, signal);\n\n try {\n this.#md5Value = await this.#md5Promise;\n return this.#md5Value;\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw error;\n }\n console.error(\"EFSourceMixin md5Sum error\", error);\n return undefined;\n } finally {\n this.#md5Promise = null;\n }\n }\n\n async #doLoadMd5(\n src: string,\n signal?: AbortSignal,\n ): Promise<string | undefined> {\n // Normalize the path: remove leading slash and any double slashes\n let normalizedSrc = src.startsWith(\"/\") ? src.slice(1) : src;\n normalizedSrc = normalizedSrc.replace(/^\\/+/, \"\");\n const md5Path = `/api/v1/files/md5?src=${encodeURIComponent(normalizedSrc)}`;\n const response = await fetch(md5Path, { signal });\n if (!response.ok) {\n return undefined;\n }\n const data = await response.json();\n return data.md5 ?? undefined;\n }\n\n /** @internal Exposes md5 state for md5SumLoader proxy without private field access in handler */\n _getMd5Value(): string | undefined {\n return this.#md5Value;\n }\n\n /** @internal Exposes md5 promise state for md5SumLoader proxy */\n _getMd5Promise(): Promise<string | undefined> | null {\n return this.#md5Promise;\n }\n\n /**\n * Compatibility wrapper for code expecting md5SumLoader.value\n */\n md5SumLoader = new Proxy(\n {\n run: () => this.loadMd5Sum(),\n host: this,\n } as unknown as {\n run: () => Promise<string | undefined>;\n host: {\n _getMd5Value: () => string | undefined;\n _getMd5Promise: () => Promise<string | undefined> | null;\n };\n value: string | undefined;\n taskComplete: Promise<string | undefined>;\n },\n {\n get(target, prop) {\n if (prop === \"value\") {\n return target.host._getMd5Value();\n }\n if (prop === \"taskComplete\") {\n const p = target.host._getMd5Promise();\n return p || Promise.resolve(target.host._getMd5Value());\n }\n return (target as any)[prop];\n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,OAAMC,UACJ,KACA,QAC6B;GAE7B,IAAI,gBAAgB,IAAI,WAAW,IAAI,GAAG,IAAI,MAAM,EAAE,GAAG;AACzD,mBAAgB,cAAc,QAAQ,QAAQ,GAAG;GACjD,MAAM,UAAU,yBAAyB,mBAAmB,cAAc;GAC1E,MAAM,WAAW,MAAM,MAAM,SAAS,EAAE,QAAQ,CAAC;AACjD,OAAI,CAAC,SAAS,GACZ;AAGF,WADa,MAAM,SAAS,MAAM,EACtB,OAAO;;;EAIrB,eAAmC;AACjC,UAAO,MAAKH;;;EAId,iBAAqD;AACnD,UAAO,MAAKE;;;aA3Eb,SAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,CAAC;AA6G5C,QAAO"}
1
+ {"version":3,"file":"EFSourceMixin.js","names":["#md5Value","#md5LastSrc","#md5Promise","#doLoadMd5"],"sources":["../../src/elements/EFSourceMixin.ts"],"sourcesContent":["import type { LitElement } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\n\nexport declare class EFSourceMixinInterface {\n apiHost?: string;\n productionSrc(): string;\n src: string;\n}\n\ninterface EFSourceMixinOptions {\n assetType: string;\n}\ntype Constructor<T = {}> = new (...args: any[]) => T;\nexport function EFSourceMixin<T extends Constructor<LitElement>>(\n superClass: T,\n options: EFSourceMixinOptions,\n) {\n class EFSourceElement extends superClass {\n get apiHost() {\n return (\n (this.closest(\"ef-configuration\") as any)?.apiHost ||\n (this.closest(\"ef-workbench\") as any)?.apiHost ||\n (this.closest(\"ef-preview\") as any)?.apiHost ||\n window.location.origin\n );\n }\n\n @property({ type: String, reflect: true })\n src = \"\";\n\n #md5Value: string | undefined = undefined;\n #md5Promise: Promise<string | undefined> | null = null;\n #md5LastSrc: string | null = null;\n\n productionSrc() {\n if (!this.#md5Value) {\n throw new Error(\n `MD5 sum not available for ${this}. Cannot generate production URL`,\n );\n }\n\n if (!this.apiHost) {\n throw new Error(\n `apiHost not available for ${this}. Cannot generate production URL`,\n );\n }\n\n return `${this.apiHost}/api/v1/${options.assetType}/${this.#md5Value}`;\n }\n\n /**\n * Load MD5 sum for the current source\n */\n async loadMd5Sum(signal?: AbortSignal): Promise<string | undefined> {\n if (this.#md5LastSrc === this.src && this.#md5Value) {\n return this.#md5Value;\n }\n\n if (this.#md5Promise && this.#md5LastSrc === this.src) {\n return this.#md5Promise;\n }\n\n this.#md5LastSrc = this.src;\n this.#md5Promise = this.#doLoadMd5(this.src, signal);\n\n try {\n this.#md5Value = await this.#md5Promise;\n return this.#md5Value;\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw error;\n }\n console.error(\"EFSourceMixin md5Sum error\", error);\n return undefined;\n } finally {\n this.#md5Promise = null;\n }\n }\n\n async #doLoadMd5(\n src: string,\n signal?: AbortSignal,\n ): Promise<string | undefined> {\n // Normalize the path: remove leading slash and any double slashes\n let normalizedSrc = src.startsWith(\"/\") ? src.slice(1) : src;\n normalizedSrc = normalizedSrc.replace(/^\\/+/, \"\");\n const md5Path = `/api/v1/files/md5?src=${encodeURIComponent(normalizedSrc)}`;\n const response = await fetch(md5Path, { signal });\n if (!response.ok) {\n return undefined;\n }\n const data = await response.json();\n return data.md5 ?? undefined;\n }\n\n /** @internal Exposes md5 state for md5SumLoader proxy without private field access in handler */\n _getMd5Value(): string | undefined {\n return this.#md5Value;\n }\n\n /** @internal Exposes md5 promise state for md5SumLoader proxy */\n _getMd5Promise(): Promise<string | undefined> | null {\n return this.#md5Promise;\n }\n\n /**\n * Compatibility wrapper for code expecting md5SumLoader.value\n */\n md5SumLoader = new Proxy(\n {\n run: () => this.loadMd5Sum(),\n host: this,\n } as unknown as {\n run: () => Promise<string | undefined>;\n host: {\n _getMd5Value: () => string | undefined;\n _getMd5Promise: () => Promise<string | undefined> | null;\n };\n value: string | undefined;\n taskComplete: Promise<string | undefined>;\n },\n {\n get(target, prop) {\n if (prop === \"value\") {\n return target.host._getMd5Value();\n }\n if (prop === \"taskComplete\") {\n const p = target.host._getMd5Promise();\n return p || Promise.resolve(target.host._getMd5Value());\n }\n return (target as any)[prop];\n },\n },\n );\n }\n\n return EFSourceElement as Constructor<EFSourceMixinInterface> & T;\n}\n"],"mappings":";;;;AAaA,SAAgB,cACd,YACA,SACA;CACA,MAAM,wBAAwB,WAAW;;;cAWjC;uBAgFS,IAAI,MACjB;IACE,WAAW,KAAK,YAAY;IAC5B,MAAM;IACP,EASD,EACE,IAAI,QAAQ,MAAM;AAChB,QAAI,SAAS,QACX,QAAO,OAAO,KAAK,cAAc;AAEnC,QAAI,SAAS,eAEX,QADU,OAAO,KAAK,gBAAgB,IAC1B,QAAQ,QAAQ,OAAO,KAAK,cAAc,CAAC;AAEzD,WAAQ,OAAe;MAE1B,CACF;;EAnHD,IAAI,UAAU;AACZ,UACG,KAAK,QAAQ,mBAAmB,EAAU,WAC1C,KAAK,QAAQ,eAAe,EAAU,WACtC,KAAK,QAAQ,aAAa,EAAU,WACrC,OAAO,SAAS;;EAOpB,YAAgC;EAChC,cAAkD;EAClD,cAA6B;EAE7B,gBAAgB;AACd,OAAI,CAAC,MAAKA,SACR,OAAM,IAAI,MACR,6BAA6B,KAAK,kCACnC;AAGH,OAAI,CAAC,KAAK,QACR,OAAM,IAAI,MACR,6BAA6B,KAAK,kCACnC;AAGH,UAAO,GAAG,KAAK,QAAQ,UAAU,QAAQ,UAAU,GAAG,MAAKA;;;;;EAM7D,MAAM,WAAW,QAAmD;AAClE,OAAI,MAAKC,eAAgB,KAAK,OAAO,MAAKD,SACxC,QAAO,MAAKA;AAGd,OAAI,MAAKE,cAAe,MAAKD,eAAgB,KAAK,IAChD,QAAO,MAAKC;AAGd,SAAKD,aAAc,KAAK;AACxB,SAAKC,aAAc,MAAKC,UAAW,KAAK,KAAK,OAAO;AAEpD,OAAI;AACF,UAAKH,WAAY,MAAM,MAAKE;AAC5B,WAAO,MAAKF;YACL,OAAO;AACd,QAAI,iBAAiB,gBAAgB,MAAM,SAAS,aAClD,OAAM;AAER,YAAQ,MAAM,8BAA8B,MAAM;AAClD;aACQ;AACR,UAAKE,aAAc;;;EAIvB,OAAMC,UACJ,KACA,QAC6B;GAE7B,IAAI,gBAAgB,IAAI,WAAW,IAAI,GAAG,IAAI,MAAM,EAAE,GAAG;AACzD,mBAAgB,cAAc,QAAQ,QAAQ,GAAG;GACjD,MAAM,UAAU,yBAAyB,mBAAmB,cAAc;GAC1E,MAAM,WAAW,MAAM,MAAM,SAAS,EAAE,QAAQ,CAAC;AACjD,OAAI,CAAC,SAAS,GACZ;AAGF,WADa,MAAM,SAAS,MAAM,EACtB,OAAO;;;EAIrB,eAAmC;AACjC,UAAO,MAAKH;;;EAId,iBAAqD;AACnD,UAAO,MAAKE;;;aA3Eb,SAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,CAAC;AA6G5C,QAAO"}
@@ -1,6 +1,6 @@
1
- import * as lit32 from "lit";
1
+ import * as lit33 from "lit";
2
2
  import { LitElement } from "lit";
3
- import * as lit_html30 from "lit-html";
3
+ import * as lit_html31 from "lit-html";
4
4
 
5
5
  //#region src/gui/EFOverlayItem.d.ts
6
6
  /**
@@ -23,7 +23,7 @@ interface OverlayItemPosition {
23
23
  * ensures transforms are applied before positions are read.
24
24
  */
25
25
  declare class EFOverlayItem extends LitElement {
26
- static styles: lit32.CSSResult[];
26
+ static styles: lit33.CSSResult[];
27
27
  elementId?: string;
28
28
  target?: HTMLElement | string;
29
29
  private currentPosition;
@@ -36,7 +36,7 @@ declare class EFOverlayItem extends LitElement {
36
36
  updatePosition(): void;
37
37
  connectedCallback(): void;
38
38
  disconnectedCallback(): void;
39
- render(): lit_html30.TemplateResult<1>;
39
+ render(): lit_html31.TemplateResult<1>;
40
40
  }
41
41
  declare global {
42
42
  interface HTMLElementTagNameMap {
@@ -1,8 +1,8 @@
1
1
  import { PanZoomTransform } from "../elements/EFPanZoom.js";
2
2
  import { EFOverlayItem } from "./EFOverlayItem.js";
3
- import * as lit31 from "lit";
3
+ import * as lit32 from "lit";
4
4
  import { LitElement } from "lit";
5
- import * as lit_html29 from "lit-html";
5
+ import * as lit_html30 from "lit-html";
6
6
 
7
7
  //#region src/gui/EFOverlayLayer.d.ts
8
8
 
@@ -26,7 +26,7 @@ import * as lit_html29 from "lit-html";
26
26
  * 2. EFOverlayItem can use this rect for coordinate calculations
27
27
  */
28
28
  declare class EFOverlayLayer extends LitElement {
29
- static styles: lit31.CSSResult[];
29
+ static styles: lit32.CSSResult[];
30
30
  panZoomTransformFromContext?: PanZoomTransform;
31
31
  /**
32
32
  * Pan/zoom transform as fallback for when context or sibling PanZoom is not available.
@@ -58,7 +58,7 @@ declare class EFOverlayLayer extends LitElement {
58
58
  connectedCallback(): void;
59
59
  disconnectedCallback(): void;
60
60
  updated(): void;
61
- render(): lit_html29.TemplateResult<1>;
61
+ render(): lit_html30.TemplateResult<1>;
62
62
  }
63
63
  declare global {
64
64
  interface HTMLElementTagNameMap {
@@ -1,7 +1,7 @@
1
1
  import { TimelineState } from "./timeline/timelineStateContext.js";
2
- import * as lit33 from "lit";
2
+ import * as lit34 from "lit";
3
3
  import { LitElement } from "lit";
4
- import * as lit_html31 from "lit-html";
4
+ import * as lit_html32 from "lit-html";
5
5
 
6
6
  //#region src/gui/EFTimelineRuler.d.ts
7
7
  /**
@@ -25,7 +25,7 @@ declare function calculatePixelsPerFrame(frameIntervalMs: number, pixelsPerMs: n
25
25
  */
26
26
  declare function shouldShowFrameMarkers(pixelsPerFrame: number, minSpacing?: number): boolean;
27
27
  declare class EFTimelineRuler extends LitElement {
28
- static styles: lit33.CSSResult[];
28
+ static styles: lit34.CSSResult[];
29
29
  durationMs: number;
30
30
  contextDurationMs: number;
31
31
  timelineState?: TimelineState;
@@ -59,7 +59,7 @@ declare class EFTimelineRuler extends LitElement {
59
59
  private calculateLabelInterval;
60
60
  private getVisibleLabels;
61
61
  private renderCanvas;
62
- render(): lit_html31.TemplateResult<1>;
62
+ render(): lit_html32.TemplateResult<1>;
63
63
  }
64
64
  declare global {
65
65
  interface HTMLElementTagNameMap {
@@ -4,7 +4,7 @@ import { TimelineState } from "./timelineStateContext.js";
4
4
  import "./tracks/preloadTracks.js";
5
5
  import "./EFTimelineRow.js";
6
6
  import "../EFTimelineRuler.js";
7
- import * as lit34 from "lit";
7
+ import * as lit35 from "lit";
8
8
  import { LitElement, PropertyValues, TemplateResult } from "lit";
9
9
 
10
10
  //#region src/gui/timeline/EFTimeline.d.ts
@@ -17,7 +17,7 @@ declare const EFTimeline_base: typeof LitElement;
17
17
  */
18
18
  declare class EFTimeline extends EFTimeline_base {
19
19
  #private;
20
- static styles: lit34.CSSResult[];
20
+ static styles: lit35.CSSResult[];
21
21
  /**
22
22
  * Target element ID or "selection" to derive from canvas selection.
23
23
  *
@@ -1,7 +1,7 @@
1
1
  import { TimelineEditingContext } from "./timelineEditingContext.js";
2
- import * as lit35 from "lit";
2
+ import * as lit31 from "lit";
3
3
  import { LitElement } from "lit";
4
- import * as lit_html32 from "lit-html";
4
+ import * as lit_html29 from "lit-html";
5
5
 
6
6
  //#region src/gui/timeline/TrimHandles.d.ts
7
7
  interface TrimValue {
@@ -16,7 +16,7 @@ interface TrimChangeDetail {
16
16
  declare const EFTrimHandles_base: typeof LitElement;
17
17
  declare class EFTrimHandles extends EFTrimHandles_base {
18
18
  #private;
19
- static styles: lit35.CSSResult[];
19
+ static styles: lit31.CSSResult[];
20
20
  mode: "standalone" | "track";
21
21
  elementId: string;
22
22
  pixelsPerMs: number | null;
@@ -38,7 +38,7 @@ declare class EFTrimHandles extends EFTrimHandles_base {
38
38
  private handleRegionPointerDown;
39
39
  private handlePointerMove;
40
40
  private handlePointerUp;
41
- render(): lit_html32.TemplateResult<1>;
41
+ render(): lit_html29.TemplateResult<1>;
42
42
  }
43
43
  declare global {
44
44
  interface HTMLElementTagNameMap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.40.4",
3
+ "version": "0.40.5",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "license": "UNLICENSED",
19
19
  "dependencies": {
20
20
  "@bramus/style-observer": "^1.3.0",
21
- "@editframe/assets": "0.40.4",
21
+ "@editframe/assets": "0.40.5",
22
22
  "@lit/context": "^1.1.6",
23
23
  "@opentelemetry/api": "^1.9.0",
24
24
  "@opentelemetry/context-zone": "^1.26.0",