@editframe/elements 0.11.0-beta.8 → 0.11.0-beta.9

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.
@@ -1,11 +1,11 @@
1
1
  import { EFAudio } from './EFAudio.ts';
2
- import { LitElement } from 'lit';
3
- import { EFVideo } from './EFVideo.ts';
4
2
  import { Task } from '@lit/task';
3
+ import { LitElement } from 'lit';
5
4
  import { Ref } from 'lit/directives/ref.js';
5
+ import { EFVideo } from './EFVideo.ts';
6
6
  declare const EFWaveform_base: (new (...args: any[]) => import('./EFTemporal.ts').TemporalMixinInterface) & typeof LitElement;
7
7
  export declare class EFWaveform extends EFWaveform_base {
8
- static styles: never[];
8
+ static styles: import('lit').CSSResult[];
9
9
  svgRef: Ref<SVGElement>;
10
10
  createRenderRoot(): this;
11
11
  render(): import('lit-html').TemplateResult<1>;
@@ -2,10 +2,10 @@ import { Task } from "@lit/task";
2
2
  import { html, css, LitElement } from "lit";
3
3
  import { property, customElement } from "lit/decorators.js";
4
4
  import { createRef, ref } from "lit/directives/ref.js";
5
- import { FetchMixin } from "./FetchMixin.js";
6
- import { EFSourceMixin } from "./EFSourceMixin.js";
7
5
  import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
8
6
  import { EF_RENDERING } from "../EF_RENDERING.js";
7
+ import { EFSourceMixin } from "./EFSourceMixin.js";
8
+ import { FetchMixin } from "./FetchMixin.js";
9
9
  var __defProp = Object.defineProperty;
10
10
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
11
  var __typeError = (msg) => {
@@ -90,11 +90,7 @@ EFImage.styles = [
90
90
  display: block;
91
91
  }
92
92
  canvas {
93
- display: block;
94
- width: 100%;
95
- height: 100%;
96
- object-fit: fill;
97
- object-position: center;
93
+ all: inherit
98
94
  }
99
95
  `
100
96
  ];
@@ -1,9 +1,9 @@
1
- import { css, html } from "lit";
2
1
  import { Task } from "@lit/task";
3
- import { createRef, ref } from "lit/directives/ref.js";
2
+ import { css, html } from "lit";
4
3
  import { customElement } from "lit/decorators.js";
5
- import { EFMedia } from "./EFMedia.js";
4
+ import { createRef, ref } from "lit/directives/ref.js";
6
5
  import { TWMixin } from "../gui/TWMixin.js";
6
+ import { EFMedia } from "./EFMedia.js";
7
7
  var __defProp = Object.defineProperty;
8
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
9
  var __typeError = (msg) => {
@@ -100,6 +100,9 @@ EFVideo.styles = [
100
100
  :host {
101
101
  display: block;
102
102
  }
103
+ canvas {
104
+ all: inherit;
105
+ }
103
106
  `
104
107
  ];
105
108
  EFVideo = __decorateClass([
@@ -1,14 +1,14 @@
1
1
  import { EFAudio } from "./EFAudio.js";
2
- import { html, LitElement } from "lit";
3
- import { property, customElement } from "lit/decorators.js";
4
- import { EFVideo } from "./EFVideo.js";
5
- import { EFTemporal } from "./EFTemporal.js";
6
- import { CrossUpdateController } from "./CrossUpdateController.js";
7
- import { TWMixin } from "../gui/TWMixin.js";
8
2
  import { Task } from "@lit/task";
9
3
  import * as d3 from "d3";
4
+ import { html, css, LitElement } from "lit";
5
+ import { property, customElement } from "lit/decorators.js";
10
6
  import { createRef, ref } from "lit/directives/ref.js";
11
7
  import { EF_INTERACTIVE } from "../EF_INTERACTIVE.js";
8
+ import { TWMixin } from "../gui/TWMixin.js";
9
+ import { CrossUpdateController } from "./CrossUpdateController.js";
10
+ import { EFTemporal } from "./EFTemporal.js";
11
+ import { EFVideo } from "./EFVideo.js";
12
12
  var __defProp = Object.defineProperty;
13
13
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
14
  var __decorateClass = (decorators, target, key, kind) => {
@@ -38,7 +38,7 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
38
38
  return this;
39
39
  }
40
40
  render() {
41
- return html` <svg ${ref(this.svgRef)} class="h-full w-full" store></svg> `;
41
+ return html` <svg ${ref(this.svgRef)} store></svg> `;
42
42
  }
43
43
  set target(value) {
44
44
  this.targetSelector = value;
@@ -205,7 +205,13 @@ let EFWaveform = class extends EFTemporal(TWMixin(LitElement)) {
205
205
  throw new Error("Invalid target, must be an EFAudio or EFVideo element");
206
206
  }
207
207
  };
208
- EFWaveform.styles = [];
208
+ EFWaveform.styles = [
209
+ css`
210
+ svg {
211
+ all: inherit;
212
+ }
213
+ `
214
+ ];
209
215
  __decorateClass([
210
216
  property({
211
217
  type: String,
@@ -74,16 +74,29 @@ class FilmstripItem extends TWMixin(LitElement) {
74
74
  return this.element && this.focusContext?.focusedElement === this.element;
75
75
  }
76
76
  get gutterStyles() {
77
+ if (this.element.sourceInMs || this.element.sourceOutMs) {
78
+ return {
79
+ position: "relative",
80
+ left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs - this.element.sourceInMs)}px`,
81
+ width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs + this.element.sourceOutMs + this.element.sourceInMs)}px`
82
+ };
83
+ }
77
84
  return {
78
85
  position: "relative",
79
- left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs - this.element.sourceInMs)}px`,
80
- width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs + this.element.sourceOutMs + this.element.sourceInMs)}px`
86
+ left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs)}px`,
87
+ width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs)}px`
81
88
  };
82
89
  }
83
90
  get trimPortionStyles() {
91
+ if (this.element.sourceInMs || this.element.sourceOutMs) {
92
+ return {
93
+ width: `${this.pixelsPerMs * this.element.durationMs}px`,
94
+ left: `${this.pixelsPerMs * (this.element.trimStartMs + this.element.sourceInMs)}px`
95
+ };
96
+ }
84
97
  return {
85
98
  width: `${this.pixelsPerMs * this.element.durationMs}px`,
86
- left: `${this.pixelsPerMs * (this.element.trimStartMs + this.element.sourceInMs)}px`
99
+ left: `${this.pixelsPerMs * this.element.trimStartMs}px`
87
100
  };
88
101
  }
89
102
  render() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.11.0-beta.8",
3
+ "version": "0.11.0-beta.9",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -20,7 +20,7 @@
20
20
  "author": "",
21
21
  "license": "UNLICENSED",
22
22
  "dependencies": {
23
- "@editframe/assets": "0.11.0-beta.8",
23
+ "@editframe/assets": "0.11.0-beta.9",
24
24
  "@lit/context": "^1.1.2",
25
25
  "@lit/task": "^1.0.1",
26
26
  "d3": "^7.9.0",
@@ -1,11 +1,11 @@
1
1
  import { Task } from "@lit/task";
2
- import { LitElement, html, css } from "lit";
2
+ import { LitElement, css, html } from "lit";
3
3
  import { customElement, property } from "lit/decorators.js";
4
4
  import { createRef, ref } from "lit/directives/ref.js";
5
- import { FetchMixin } from "./FetchMixin.ts";
6
- import { EFSourceMixin } from "./EFSourceMixin.ts";
7
5
  import { EF_INTERACTIVE } from "../EF_INTERACTIVE.ts";
8
6
  import { EF_RENDERING } from "../EF_RENDERING.ts";
7
+ import { EFSourceMixin } from "./EFSourceMixin.ts";
8
+ import { FetchMixin } from "./FetchMixin.ts";
9
9
 
10
10
  @customElement("ef-image")
11
11
  export class EFImage extends EFSourceMixin(FetchMixin(LitElement), {
@@ -17,11 +17,7 @@ export class EFImage extends EFSourceMixin(FetchMixin(LitElement), {
17
17
  display: block;
18
18
  }
19
19
  canvas {
20
- display: block;
21
- width: 100%;
22
- height: 100%;
23
- object-fit: fill;
24
- object-position: center;
20
+ all: inherit
25
21
  }
26
22
  `,
27
23
  ];
@@ -1,10 +1,10 @@
1
- import { html, css } from "lit";
2
1
  import { Task } from "@lit/task";
3
- import { createRef, ref } from "lit/directives/ref.js";
2
+ import { css, html } from "lit";
4
3
  import { customElement } from "lit/decorators.js";
4
+ import { createRef, ref } from "lit/directives/ref.js";
5
5
 
6
- import { EFMedia } from "./EFMedia.ts";
7
6
  import { TWMixin } from "../gui/TWMixin.ts";
7
+ import { EFMedia } from "./EFMedia.ts";
8
8
 
9
9
  @customElement("ef-video")
10
10
  export class EFVideo extends TWMixin(EFMedia) {
@@ -13,10 +13,12 @@ export class EFVideo extends TWMixin(EFMedia) {
13
13
  :host {
14
14
  display: block;
15
15
  }
16
+ canvas {
17
+ all: inherit;
18
+ }
16
19
  `,
17
20
  ];
18
21
  canvasRef = createRef<HTMLCanvasElement>();
19
-
20
22
  render() {
21
23
  return html` <canvas
22
24
  class="h-full w-full object-fill"
@@ -1,27 +1,32 @@
1
1
  import { EFAudio } from "./EFAudio.ts";
2
2
 
3
- import { LitElement, html } from "lit";
4
- import { customElement, property } from "lit/decorators.js";
5
- import { EFVideo } from "./EFVideo.ts";
6
- import { EFTemporal } from "./EFTemporal.ts";
7
- import { CrossUpdateController } from "./CrossUpdateController.ts";
8
- import { TWMixin } from "../gui/TWMixin.ts";
9
3
  import { Task } from "@lit/task";
10
4
  import * as d3 from "d3";
5
+ import { LitElement, css, html } from "lit";
6
+ import { customElement, property } from "lit/decorators.js";
11
7
  import { type Ref, createRef, ref } from "lit/directives/ref.js";
12
8
  import { EF_INTERACTIVE } from "../EF_INTERACTIVE.ts";
9
+ import { TWMixin } from "../gui/TWMixin.ts";
10
+ import { CrossUpdateController } from "./CrossUpdateController.ts";
11
+ import { EFTemporal } from "./EFTemporal.ts";
12
+ import { EFVideo } from "./EFVideo.ts";
13
13
 
14
14
  @customElement("ef-waveform")
15
15
  export class EFWaveform extends EFTemporal(TWMixin(LitElement)) {
16
- static styles = [];
16
+ static styles = [
17
+ css`
18
+ svg {
19
+ all: inherit;
20
+ }
21
+ `,
22
+ ];
17
23
  svgRef: Ref<SVGElement> = createRef();
18
24
  createRenderRoot() {
19
25
  return this;
20
26
  }
21
27
  render() {
22
- return html` <svg ${ref(this.svgRef)} class="h-full w-full" store></svg> `;
28
+ return html` <svg ${ref(this.svgRef)} store></svg> `;
23
29
  }
24
-
25
30
  @property({
26
31
  type: String,
27
32
  attribute: "mode",
@@ -87,17 +87,30 @@ class FilmstripItem extends TWMixin(LitElement) {
87
87
  pixelsPerMs = 0.04;
88
88
 
89
89
  get gutterStyles() {
90
+ if (this.element.sourceInMs || this.element.sourceOutMs) {
91
+ return {
92
+ position: "relative",
93
+ left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs - this.element.sourceInMs)}px`,
94
+ width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs + this.element.sourceOutMs + this.element.sourceInMs)}px`,
95
+ };
96
+ }
90
97
  return {
91
98
  position: "relative",
92
- left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs - this.element.sourceInMs)}px`,
93
- width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs + this.element.sourceOutMs + this.element.sourceInMs)}px`,
99
+ left: `${this.pixelsPerMs * (this.element.startTimeWithinParentMs - this.element.trimStartMs)}px`,
100
+ width: `${this.pixelsPerMs * (this.element.durationMs + this.element.trimStartMs + this.element.trimEndMs)}px`,
94
101
  };
95
102
  }
96
103
 
97
104
  get trimPortionStyles() {
105
+ if (this.element.sourceInMs || this.element.sourceOutMs) {
106
+ return {
107
+ width: `${this.pixelsPerMs * this.element.durationMs}px`,
108
+ left: `${this.pixelsPerMs * (this.element.trimStartMs + this.element.sourceInMs)}px`,
109
+ };
110
+ }
98
111
  return {
99
112
  width: `${this.pixelsPerMs * this.element.durationMs}px`,
100
- left: `${this.pixelsPerMs * (this.element.trimStartMs + this.element.sourceInMs)}px`,
113
+ left: `${this.pixelsPerMs * this.element.trimStartMs}px`,
101
114
  };
102
115
  }
103
116