@editframe/elements 0.6.0-beta.18 → 0.6.0-beta.21

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.
@@ -499,9 +499,9 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
499
499
  __privateAdd(this, _playbackAnimationFrameRequest, null);
500
500
  __privateAdd(this, _AUDIO_PLAYBACK_SLICE_MS, 1e3);
501
501
  this.advancePlayhead = (tick) => {
502
- if (__privateGet(this, _lastTick) && tick && this.target) {
503
- this.target.currentTimeMs += tick - __privateGet(this, _lastTick);
504
- if (this.target.currentTimeMs >= this.target.durationMs) {
502
+ if (__privateGet(this, _lastTick) && tick && this.targetTimegroup) {
503
+ this.targetTimegroup.currentTimeMs += tick - __privateGet(this, _lastTick);
504
+ if (this.targetTimegroup.currentTimeMs >= this.targetTimegroup.durationMs) {
505
505
  this.playing = false;
506
506
  }
507
507
  }
@@ -516,7 +516,7 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
516
516
  }
517
517
  connectedCallback() {
518
518
  super.connectedCallback();
519
- const target = this.target;
519
+ const target = this.targetTimegroup;
520
520
  if (target) {
521
521
  this.timegroupController = new TimegroupController.TimegroupController(target, this);
522
522
  this.currentTimeMs = target.currentTimeMs;
@@ -551,9 +551,9 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
551
551
  return;
552
552
  }
553
553
  const rect = gutter.getBoundingClientRect();
554
- if (this.target) {
554
+ if (this.targetTimegroup) {
555
555
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
556
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
556
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
557
557
  }
558
558
  }
559
559
  startScrub(e) {
@@ -565,9 +565,9 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
565
565
  return;
566
566
  }
567
567
  const rect = gutter.getBoundingClientRect();
568
- if (this.target) {
568
+ if (this.targetTimegroup) {
569
569
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
570
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
570
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
571
571
  }
572
572
  });
573
573
  addEventListener(
@@ -579,7 +579,7 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
579
579
  );
580
580
  }
581
581
  scrollScrub(e) {
582
- if (this.target && this.gutter && !this.playing) {
582
+ if (this.targetTimegroup && this.gutter && !this.playing) {
583
583
  e.preventDefault();
584
584
  if (this.gutterRef.value && this.gutterRef.value.scrollLeft === 0 && e.deltaX < 0) {
585
585
  this.gutter.scrollBy(0, e.deltaY);
@@ -591,7 +591,7 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
591
591
  }
592
592
  if (this) {
593
593
  this.gutter.scrollBy(e.deltaX, e.deltaY);
594
- this.target.currentTimeMs += e.deltaX / this.pixelsPerMs;
594
+ this.targetTimegroup.currentTimeMs += e.deltaX / this.pixelsPerMs;
595
595
  }
596
596
  }
597
597
  }
@@ -599,7 +599,7 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
599
599
  return this.gutterRef.value;
600
600
  }
601
601
  render() {
602
- const target = this.target;
602
+ const target = this.targetTimegroup;
603
603
  return lit.html` <div
604
604
  class="grid h-full bg-slate-100"
605
605
  style=${styleMap_js.styleMap({
@@ -685,16 +685,16 @@ exports.EFFilmstrip = class EFFilmstrip extends TWMixin.TWMixin(lit.LitElement)
685
685
  super.update(changedProperties);
686
686
  }
687
687
  updated(changes) {
688
- if (!this.target) {
688
+ if (!this.targetTimegroup) {
689
689
  return;
690
690
  }
691
691
  if (changes.has("currentTimeMs")) {
692
- if (this.target.currentTimeMs !== this.currentTimeMs) {
693
- this.target.currentTimeMs = this.currentTimeMs;
692
+ if (this.targetTimegroup.currentTimeMs !== this.currentTimeMs) {
693
+ this.targetTimegroup.currentTimeMs = this.currentTimeMs;
694
694
  }
695
695
  }
696
696
  }
697
- get target() {
697
+ get targetTimegroup() {
698
698
  if (this.getAttribute("target")) {
699
699
  const target = document.querySelector(this.getAttribute("target") ?? "");
700
700
  if (target instanceof EFTimegroup.EFTimegroup) {
@@ -730,7 +730,7 @@ stopPlayback_fn = async function() {
730
730
  };
731
731
  startPlayback_fn = async function() {
732
732
  await __privateMethod(this, _EFFilmstrip_instances, stopPlayback_fn).call(this);
733
- const timegroup = this.target;
733
+ const timegroup = this.targetTimegroup;
734
734
  if (!timegroup) {
735
735
  return;
736
736
  }
@@ -789,7 +789,7 @@ __decorateClass([
789
789
  decorators_js.property({ type: Number })
790
790
  ], exports.EFFilmstrip.prototype, "currentTimeMs", 2);
791
791
  __decorateClass([
792
- decorators_js.property({ type: String, attribute: "target" })
792
+ decorators_js.property({ type: String, attribute: "target", reflect: true })
793
793
  ], exports.EFFilmstrip.prototype, "targetSelector", 2);
794
794
  __decorateClass([
795
795
  decorators_js.state()
@@ -1,5 +1,8 @@
1
1
  import { EFTimegroup } from '../elements/EFTimegroup';
2
2
  import { LitElement, nothing, TemplateResult, ReactiveController, PropertyValueMap } from 'lit';
3
+ import { EFImage } from '../elements/EFImage';
4
+ import { EFAudio } from '../elements/EFAudio';
5
+ import { EFVideo } from '../elements/EFVideo';
3
6
  import { TemporalMixinInterface } from '../elements/EFTemporal';
4
7
  import { TimegroupController } from '../elements/TimegroupController';
5
8
  import { FocusContext } from './EFWorkbench';
@@ -69,13 +72,13 @@ declare class EFTimegroupHierarchyItem extends EFHierarchyItem<EFTimegroup> {
69
72
  get icon(): string;
70
73
  displayLabel(): string | TemplateResult<1> | typeof nothing;
71
74
  }
72
- declare class EFAudioHierarchyItem extends EFHierarchyItem {
75
+ declare class EFAudioHierarchyItem extends EFHierarchyItem<EFAudio> {
73
76
  get icon(): string;
74
- displayLabel(): any;
77
+ displayLabel(): string;
75
78
  }
76
- declare class EFVideoHierarchyItem extends EFHierarchyItem {
79
+ declare class EFVideoHierarchyItem extends EFHierarchyItem<EFVideo> {
77
80
  get icon(): string;
78
- displayLabel(): any;
81
+ displayLabel(): string;
79
82
  }
80
83
  declare class EFCaptionsHierarchyItem extends EFHierarchyItem {
81
84
  get icon(): string;
@@ -87,9 +90,9 @@ declare class EFWaveformHierarchyItem extends EFHierarchyItem {
87
90
  get icon(): string;
88
91
  renderChildren(): typeof nothing;
89
92
  }
90
- declare class EFImageHierarchyItem extends EFHierarchyItem {
93
+ declare class EFImageHierarchyItem extends EFHierarchyItem<EFImage> {
91
94
  get icon(): string;
92
- displayLabel(): any;
95
+ displayLabel(): string;
93
96
  }
94
97
  declare class EFHTMLHierarchyItem extends EFHierarchyItem {
95
98
  get icon(): TemplateResult<1>;
@@ -119,7 +122,7 @@ export declare class EFFilmstrip extends EFFilmstrip_base {
119
122
  render(): TemplateResult<1>;
120
123
  update(changedProperties: Map<string | number | symbol, unknown>): void;
121
124
  updated(changes: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
122
- get target(): EFTimegroup | undefined;
125
+ get targetTimegroup(): EFTimegroup | undefined;
123
126
  }
124
127
  declare global {
125
128
  interface HTMLElementTagNameMap {
@@ -497,9 +497,9 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
497
497
  __privateAdd(this, _playbackAnimationFrameRequest, null);
498
498
  __privateAdd(this, _AUDIO_PLAYBACK_SLICE_MS, 1e3);
499
499
  this.advancePlayhead = (tick) => {
500
- if (__privateGet(this, _lastTick) && tick && this.target) {
501
- this.target.currentTimeMs += tick - __privateGet(this, _lastTick);
502
- if (this.target.currentTimeMs >= this.target.durationMs) {
500
+ if (__privateGet(this, _lastTick) && tick && this.targetTimegroup) {
501
+ this.targetTimegroup.currentTimeMs += tick - __privateGet(this, _lastTick);
502
+ if (this.targetTimegroup.currentTimeMs >= this.targetTimegroup.durationMs) {
503
503
  this.playing = false;
504
504
  }
505
505
  }
@@ -514,7 +514,7 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
514
514
  }
515
515
  connectedCallback() {
516
516
  super.connectedCallback();
517
- const target = this.target;
517
+ const target = this.targetTimegroup;
518
518
  if (target) {
519
519
  this.timegroupController = new TimegroupController(target, this);
520
520
  this.currentTimeMs = target.currentTimeMs;
@@ -549,9 +549,9 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
549
549
  return;
550
550
  }
551
551
  const rect = gutter.getBoundingClientRect();
552
- if (this.target) {
552
+ if (this.targetTimegroup) {
553
553
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
554
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
554
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
555
555
  }
556
556
  }
557
557
  startScrub(e) {
@@ -563,9 +563,9 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
563
563
  return;
564
564
  }
565
565
  const rect = gutter.getBoundingClientRect();
566
- if (this.target) {
566
+ if (this.targetTimegroup) {
567
567
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
568
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
568
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
569
569
  }
570
570
  });
571
571
  addEventListener(
@@ -577,7 +577,7 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
577
577
  );
578
578
  }
579
579
  scrollScrub(e) {
580
- if (this.target && this.gutter && !this.playing) {
580
+ if (this.targetTimegroup && this.gutter && !this.playing) {
581
581
  e.preventDefault();
582
582
  if (this.gutterRef.value && this.gutterRef.value.scrollLeft === 0 && e.deltaX < 0) {
583
583
  this.gutter.scrollBy(0, e.deltaY);
@@ -589,7 +589,7 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
589
589
  }
590
590
  if (this) {
591
591
  this.gutter.scrollBy(e.deltaX, e.deltaY);
592
- this.target.currentTimeMs += e.deltaX / this.pixelsPerMs;
592
+ this.targetTimegroup.currentTimeMs += e.deltaX / this.pixelsPerMs;
593
593
  }
594
594
  }
595
595
  }
@@ -597,7 +597,7 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
597
597
  return this.gutterRef.value;
598
598
  }
599
599
  render() {
600
- const target = this.target;
600
+ const target = this.targetTimegroup;
601
601
  return html` <div
602
602
  class="grid h-full bg-slate-100"
603
603
  style=${styleMap({
@@ -683,16 +683,16 @@ let EFFilmstrip = class extends TWMixin(LitElement) {
683
683
  super.update(changedProperties);
684
684
  }
685
685
  updated(changes) {
686
- if (!this.target) {
686
+ if (!this.targetTimegroup) {
687
687
  return;
688
688
  }
689
689
  if (changes.has("currentTimeMs")) {
690
- if (this.target.currentTimeMs !== this.currentTimeMs) {
691
- this.target.currentTimeMs = this.currentTimeMs;
690
+ if (this.targetTimegroup.currentTimeMs !== this.currentTimeMs) {
691
+ this.targetTimegroup.currentTimeMs = this.currentTimeMs;
692
692
  }
693
693
  }
694
694
  }
695
- get target() {
695
+ get targetTimegroup() {
696
696
  if (this.getAttribute("target")) {
697
697
  const target = document.querySelector(this.getAttribute("target") ?? "");
698
698
  if (target instanceof EFTimegroup) {
@@ -728,7 +728,7 @@ stopPlayback_fn = async function() {
728
728
  };
729
729
  startPlayback_fn = async function() {
730
730
  await __privateMethod(this, _EFFilmstrip_instances, stopPlayback_fn).call(this);
731
- const timegroup = this.target;
731
+ const timegroup = this.targetTimegroup;
732
732
  if (!timegroup) {
733
733
  return;
734
734
  }
@@ -787,7 +787,7 @@ __decorateClass([
787
787
  property({ type: Number })
788
788
  ], EFFilmstrip.prototype, "currentTimeMs", 2);
789
789
  __decorateClass([
790
- property({ type: String, attribute: "target" })
790
+ property({ type: String, attribute: "target", reflect: true })
791
791
  ], EFFilmstrip.prototype, "targetSelector", 2);
792
792
  __decorateClass([
793
793
  state()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.6.0-beta.18",
3
+ "version": "0.6.0-beta.21",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -19,7 +19,7 @@
19
19
  "author": "",
20
20
  "license": "UNLICENSED",
21
21
  "dependencies": {
22
- "@editframe/assets": "0.6.0-beta.18",
22
+ "@editframe/assets": "0.6.0-beta.21",
23
23
  "@lit/context": "^1.1.1",
24
24
  "@lit/task": "^1.0.0",
25
25
  "d3": "^7.9.0",
@@ -322,7 +322,7 @@ class EFTimegroupHierarchyItem extends EFHierarchyItem<EFTimegroup> {
322
322
  }
323
323
 
324
324
  @customElement("ef-audio-hierarchy-item")
325
- class EFAudioHierarchyItem extends EFHierarchyItem {
325
+ class EFAudioHierarchyItem extends EFHierarchyItem<EFAudio> {
326
326
  get icon() {
327
327
  return "🔊";
328
328
  }
@@ -333,7 +333,7 @@ class EFAudioHierarchyItem extends EFHierarchyItem {
333
333
  }
334
334
 
335
335
  @customElement("ef-video-hierarchy-item")
336
- class EFVideoHierarchyItem extends EFHierarchyItem {
336
+ class EFVideoHierarchyItem extends EFHierarchyItem<EFVideo> {
337
337
  get icon() {
338
338
  return "📼";
339
339
  }
@@ -369,7 +369,7 @@ class EFWaveformHierarchyItem extends EFHierarchyItem {
369
369
  }
370
370
 
371
371
  @customElement("ef-image-hierarchy-item")
372
- class EFImageHierarchyItem extends EFHierarchyItem {
372
+ class EFImageHierarchyItem extends EFHierarchyItem<EFImage> {
373
373
  get icon() {
374
374
  return "🖼️";
375
375
  }
@@ -488,7 +488,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
488
488
  @property({ type: Number })
489
489
  currentTimeMs = 0;
490
490
 
491
- @property({ type: String, attribute: "target" })
491
+ @property({ type: String, attribute: "target", reflect: true })
492
492
  targetSelector = "";
493
493
 
494
494
  @state()
@@ -504,7 +504,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
504
504
 
505
505
  connectedCallback(): void {
506
506
  super.connectedCallback();
507
- const target = this.target;
507
+ const target = this.targetTimegroup;
508
508
  if (target) {
509
509
  this.timegroupController = new TimegroupController(target, this);
510
510
  // Set the current time to the last saved time to avoid a cycle
@@ -583,7 +583,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
583
583
 
584
584
  async #startPlayback() {
585
585
  await this.#stopPlayback();
586
- const timegroup = this.target;
586
+ const timegroup = this.targetTimegroup;
587
587
  if (!timegroup) {
588
588
  return;
589
589
  }
@@ -642,9 +642,11 @@ export class EFFilmstrip extends TWMixin(LitElement) {
642
642
  }
643
643
 
644
644
  advancePlayhead = (tick?: DOMHighResTimeStamp) => {
645
- if (this.#lastTick && tick && this.target) {
646
- this.target.currentTimeMs += tick - this.#lastTick;
647
- if (this.target.currentTimeMs >= this.target.durationMs) {
645
+ if (this.#lastTick && tick && this.targetTimegroup) {
646
+ this.targetTimegroup.currentTimeMs += tick - this.#lastTick;
647
+ if (
648
+ this.targetTimegroup.currentTimeMs >= this.targetTimegroup.durationMs
649
+ ) {
648
650
  this.playing = false;
649
651
  }
650
652
  }
@@ -668,9 +670,9 @@ export class EFFilmstrip extends TWMixin(LitElement) {
668
670
  return;
669
671
  }
670
672
  const rect = gutter.getBoundingClientRect();
671
- if (this.target) {
673
+ if (this.targetTimegroup) {
672
674
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
673
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
675
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
674
676
  }
675
677
  }
676
678
 
@@ -686,9 +688,9 @@ export class EFFilmstrip extends TWMixin(LitElement) {
686
688
  return;
687
689
  }
688
690
  const rect = gutter.getBoundingClientRect();
689
- if (this.target) {
691
+ if (this.targetTimegroup) {
690
692
  const layerX = e.pageX - rect.left + gutter.scrollLeft;
691
- this.target.currentTimeMs = layerX / this.pixelsPerMs;
693
+ this.targetTimegroup.currentTimeMs = layerX / this.pixelsPerMs;
692
694
  }
693
695
  });
694
696
  addEventListener(
@@ -702,7 +704,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
702
704
 
703
705
  @eventOptions({ passive: false })
704
706
  scrollScrub(e: WheelEvent) {
705
- if (this.target && this.gutter && !this.playing) {
707
+ if (this.targetTimegroup && this.gutter && !this.playing) {
706
708
  e.preventDefault();
707
709
  // Avoid over-scrolling to the left
708
710
  if (
@@ -726,7 +728,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
726
728
 
727
729
  if (this) {
728
730
  this.gutter.scrollBy(e.deltaX, e.deltaY);
729
- this.target.currentTimeMs += e.deltaX / this.pixelsPerMs;
731
+ this.targetTimegroup.currentTimeMs += e.deltaX / this.pixelsPerMs;
730
732
  }
731
733
  }
732
734
  }
@@ -740,7 +742,7 @@ export class EFFilmstrip extends TWMixin(LitElement) {
740
742
  }
741
743
 
742
744
  render() {
743
- const target = this.target;
745
+ const target = this.targetTimegroup;
744
746
 
745
747
  return html` <div
746
748
  class="grid h-full bg-slate-100"
@@ -833,17 +835,17 @@ export class EFFilmstrip extends TWMixin(LitElement) {
833
835
  }
834
836
 
835
837
  updated(changes: PropertyValueMap<any> | Map<PropertyKey, unknown>) {
836
- if (!this.target) {
838
+ if (!this.targetTimegroup) {
837
839
  return;
838
840
  }
839
841
  if (changes.has("currentTimeMs")) {
840
- if (this.target.currentTimeMs !== this.currentTimeMs) {
841
- this.target.currentTimeMs = this.currentTimeMs;
842
+ if (this.targetTimegroup.currentTimeMs !== this.currentTimeMs) {
843
+ this.targetTimegroup.currentTimeMs = this.currentTimeMs;
842
844
  }
843
845
  }
844
846
  }
845
847
 
846
- get target() {
848
+ get targetTimegroup() {
847
849
  if (this.getAttribute("target")) {
848
850
  const target = document.querySelector(this.getAttribute("target") ?? "");
849
851
  if (target instanceof EFTimegroup) {