@editframe/elements 0.8.0-beta.2 → 0.8.0-beta.4

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.
Files changed (44) hide show
  1. package/dist/elements/EFCaptions.d.ts +3 -2
  2. package/dist/elements/EFTemporal.d.ts +3 -0
  3. package/dist/elements/EFTimegroup.d.ts +1 -3
  4. package/dist/elements/durationConverter.d.ts +8 -0
  5. package/dist/elements/src/elements/EFCaptions.js +10 -7
  6. package/dist/elements/src/elements/EFMedia.js +6 -6
  7. package/dist/elements/src/elements/EFTemporal.js +51 -2
  8. package/dist/elements/src/elements/EFTimegroup.js +22 -39
  9. package/dist/elements/src/elements/EFWaveform.js +3 -3
  10. package/dist/elements/src/elements/parseTimeToMs.js +1 -0
  11. package/dist/elements/src/gui/ContextMixin.js +28 -18
  12. package/dist/elements/src/gui/EFFilmstrip.js +27 -25
  13. package/dist/elements/src/gui/EFToggleLoop.js +39 -0
  14. package/dist/elements/src/gui/EFTogglePlay.js +43 -0
  15. package/dist/elements/src/gui/EFWorkbench.js +4 -4
  16. package/dist/elements/src/gui/TWMixin.css.js +1 -1
  17. package/dist/elements/src/gui/efContext.js +7 -0
  18. package/dist/elements/src/gui/playingContext.js +2 -0
  19. package/dist/elements/src/index.js +4 -0
  20. package/dist/gui/ContextMixin.d.ts +8 -11
  21. package/dist/gui/EFFilmstrip.d.ts +7 -2
  22. package/dist/gui/EFPreview.d.ts +1 -15
  23. package/dist/gui/EFToggleLoop.d.ts +13 -0
  24. package/dist/gui/EFTogglePlay.d.ts +13 -0
  25. package/dist/gui/EFWorkbench.d.ts +1 -16
  26. package/dist/gui/efContext.d.ts +5 -0
  27. package/dist/gui/playingContext.d.ts +3 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/style.css +7 -5
  30. package/package.json +2 -2
  31. package/src/elements/EFCaptions.ts +14 -8
  32. package/src/elements/EFMedia.ts +9 -6
  33. package/src/elements/EFTemporal.ts +60 -2
  34. package/src/elements/EFTimegroup.ts +21 -41
  35. package/src/elements/EFWaveform.ts +3 -3
  36. package/src/elements/durationConverter.ts +20 -0
  37. package/src/elements/parseTimeToMs.ts +1 -0
  38. package/src/gui/ContextMixin.ts +42 -30
  39. package/src/gui/EFFilmstrip.ts +27 -28
  40. package/src/gui/EFToggleLoop.ts +34 -0
  41. package/src/gui/EFTogglePlay.ts +38 -0
  42. package/src/gui/EFWorkbench.ts +4 -4
  43. package/src/gui/efContext.ts +6 -0
  44. package/src/gui/playingContext.ts +2 -0
@@ -0,0 +1,43 @@
1
+ import { css, LitElement, html } from "lit";
2
+ import { customElement } from "lit/decorators.js";
3
+ import { consume } from "@lit/context";
4
+ import { efContext } from "./efContext.js";
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12
+ if (kind && result) __defProp(target, key, result);
13
+ return result;
14
+ };
15
+ let EFTogglePlay = class extends LitElement {
16
+ render() {
17
+ return html`
18
+ <slot @click=${() => {
19
+ if (this.context) {
20
+ if (this.context.playing) {
21
+ this.context.pause();
22
+ } else {
23
+ this.context.play();
24
+ }
25
+ }
26
+ }}></slot>
27
+ `;
28
+ }
29
+ };
30
+ EFTogglePlay.styles = [
31
+ css`
32
+ :host {}
33
+ `
34
+ ];
35
+ __decorateClass([
36
+ consume({ context: efContext })
37
+ ], EFTogglePlay.prototype, "context", 2);
38
+ EFTogglePlay = __decorateClass([
39
+ customElement("ef-toggle-play")
40
+ ], EFTogglePlay);
41
+ export {
42
+ EFTogglePlay
43
+ };
@@ -69,21 +69,21 @@ let EFWorkbench = class extends ContextMixin(TWMixin(LitElement)) {
69
69
  >
70
70
  <div
71
71
  ${ref(this.stageRef)}
72
- class="relative grid h-full w-full place-content-center place-items-center overflow-hidden"
72
+ class="relative grid h-full w-full justify-center overflow-hidden"
73
73
  @wheel=${this.handleStageWheel}
74
74
  >
75
75
  <slot
76
76
  ${ref(this.canvasRef)}
77
- class="inline-block"
78
77
  name="canvas"
78
+ class="inline-block"
79
79
  ></slot>
80
80
  <div
81
- class="border border-blue-500 bg-blue-200 bg-opacity-20"
81
+ class="border border-blue-500 bg-blue-200 bg-opacity-20 absolute"
82
82
  ${ref(this.focusOverlay)}
83
83
  ></div>
84
84
  </div>
85
85
 
86
- <slot class="overflow" name="timeline"></slot>
86
+ <slot class="overflow inline-block" name="timeline"></slot>
87
87
  </div>
88
88
  `;
89
89
  }
@@ -1,4 +1,4 @@
1
- const twStyle = "/*\n! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n.pointer-events-none {\n pointer-events: none;\n}\n.static {\n position: static;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.inset-0 {\n inset: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-10 {\n z-index: 10;\n}\n.z-20 {\n z-index: 20;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.mb-\\[1px\\] {\n margin-bottom: 1px;\n}\n.block {\n display: block;\n}\n.inline-block {\n display: inline-block;\n}\n.inline {\n display: inline;\n}\n.flex {\n display: flex;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-\\[1\\.1rem\\] {\n height: 1.1rem;\n}\n.h-\\[5px\\] {\n height: 5px;\n}\n.h-full {\n height: 100%;\n}\n.w-1 {\n width: 0.25rem;\n}\n.w-\\[2px\\] {\n width: 2px;\n}\n.w-full {\n width: 100%;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-crosshair {\n cursor: crosshair;\n}\n.resize {\n resize: both;\n}\n.place-content-center {\n place-content: center;\n}\n.place-items-center {\n place-items: center;\n}\n.items-center {\n align-items: center;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.border {\n border-width: 1px;\n}\n.border-r-2 {\n border-right-width: 2px;\n}\n.border-blue-500 {\n --tw-border-opacity: 1;\n border-color: rgb(59 130 246 / var(--tw-border-opacity));\n}\n.border-red-700 {\n --tw-border-opacity: 1;\n border-color: rgb(185 28 28 / var(--tw-border-opacity));\n}\n.border-slate-500 {\n --tw-border-opacity: 1;\n border-color: rgb(100 116 139 / var(--tw-border-opacity));\n}\n.border-b-slate-600 {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(71 85 105 / var(--tw-border-opacity));\n}\n.bg-blue-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(191 219 254 / var(--tw-bg-opacity));\n}\n.bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity));\n}\n.bg-slate-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity));\n}\n.bg-opacity-20 {\n --tw-bg-opacity: 0.2;\n}\n.object-fill {\n -o-object-fit: fill;\n object-fit: fill;\n}\n.p-\\[1px\\] {\n padding: 1px;\n}\n.pb-0 {\n padding-bottom: 0px;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pr-0 {\n padding-right: 0px;\n}\n.pr-1 {\n padding-right: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.opacity-50 {\n opacity: 0.5;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-slate-300 {\n --tw-shadow-color: #cbd5e1;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.shadow-slate-600 {\n --tw-shadow-color: #475569;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.hover\\:bg-blue-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(96 165 250 / var(--tw-bg-opacity));\n}\n.hover\\:bg-slate-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(148 163 184 / var(--tw-bg-opacity));\n}\n.peer:hover ~ .peer-hover\\:border-slate-400 {\n --tw-border-opacity: 1;\n border-color: rgb(148 163 184 / var(--tw-border-opacity));\n}\n.peer:hover ~ .peer-hover\\:bg-slate-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity));\n}\n.data-\\[focused\\]\\:bg-slate-400[data-focused] {\n --tw-bg-opacity: 1;\n background-color: rgb(148 163 184 / var(--tw-bg-opacity));\n}\n.peer[data-focused] ~ .peer-data-\\[focused\\]\\:border-slate-400 {\n --tw-border-opacity: 1;\n border-color: rgb(148 163 184 / var(--tw-border-opacity));\n}\n.peer[data-focused] ~ .peer-data-\\[focused\\]\\:bg-slate-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity));\n}\n";
1
+ const twStyle = "/*\n! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n5. Use the user's configured `sans` font-feature-settings by default.\n6. Use the user's configured `sans` font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n font-feature-settings: normal; /* 5 */\n font-variation-settings: normal; /* 6 */\n -webkit-tap-highlight-color: transparent; /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font-family by default.\n2. Use the user's configured `mono` font-feature-settings by default.\n3. Use the user's configured `mono` font-variation-settings by default.\n4. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-feature-settings: normal; /* 2 */\n font-variation-settings: normal; /* 3 */\n font-size: 1em; /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-feature-settings: inherit; /* 1 */\n font-variation-settings: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n letter-spacing: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n[hidden] {\n display: none;\n}\n\n*, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n.pointer-events-none {\n pointer-events: none;\n}\n.static {\n position: static;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.inset-0 {\n inset: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-10 {\n z-index: 10;\n}\n.z-20 {\n z-index: 20;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.mb-\\[1px\\] {\n margin-bottom: 1px;\n}\n.block {\n display: block;\n}\n.inline-block {\n display: inline-block;\n}\n.inline {\n display: inline;\n}\n.flex {\n display: flex;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-\\[1\\.1rem\\] {\n height: 1.1rem;\n}\n.h-\\[5px\\] {\n height: 5px;\n}\n.h-full {\n height: 100%;\n}\n.w-1 {\n width: 0.25rem;\n}\n.w-\\[2px\\] {\n width: 2px;\n}\n.w-full {\n width: 100%;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-crosshair {\n cursor: crosshair;\n}\n.resize {\n resize: both;\n}\n.place-content-center {\n place-content: center;\n}\n.place-items-center {\n place-items: center;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.border {\n border-width: 1px;\n}\n.border-r-2 {\n border-right-width: 2px;\n}\n.border-blue-500 {\n --tw-border-opacity: 1;\n border-color: rgb(59 130 246 / var(--tw-border-opacity));\n}\n.border-red-700 {\n --tw-border-opacity: 1;\n border-color: rgb(185 28 28 / var(--tw-border-opacity));\n}\n.border-slate-500 {\n --tw-border-opacity: 1;\n border-color: rgb(100 116 139 / var(--tw-border-opacity));\n}\n.border-b-slate-600 {\n --tw-border-opacity: 1;\n border-bottom-color: rgb(71 85 105 / var(--tw-border-opacity));\n}\n.bg-blue-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(191 219 254 / var(--tw-bg-opacity));\n}\n.bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity));\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity));\n}\n.bg-slate-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity));\n}\n.bg-slate-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity));\n}\n.bg-opacity-20 {\n --tw-bg-opacity: 0.2;\n}\n.object-fill {\n -o-object-fit: fill;\n object-fit: fill;\n}\n.p-\\[1px\\] {\n padding: 1px;\n}\n.pb-0 {\n padding-bottom: 0px;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pr-0 {\n padding-right: 0px;\n}\n.pr-1 {\n padding-right: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.opacity-50 {\n opacity: 0.5;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-slate-300 {\n --tw-shadow-color: #cbd5e1;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.shadow-slate-600 {\n --tw-shadow-color: #475569;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.hover\\:bg-slate-400:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(148 163 184 / var(--tw-bg-opacity));\n}\n.peer:hover ~ .peer-hover\\:border-slate-400 {\n --tw-border-opacity: 1;\n border-color: rgb(148 163 184 / var(--tw-border-opacity));\n}\n.peer:hover ~ .peer-hover\\:bg-slate-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity));\n}\n.data-\\[focused\\]\\:bg-slate-400[data-focused] {\n --tw-bg-opacity: 1;\n background-color: rgb(148 163 184 / var(--tw-bg-opacity));\n}\n.peer[data-focused] ~ .peer-data-\\[focused\\]\\:border-slate-400 {\n --tw-border-opacity: 1;\n border-color: rgb(148 163 184 / var(--tw-border-opacity));\n}\n.peer[data-focused] ~ .peer-data-\\[focused\\]\\:bg-slate-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(203 213 225 / var(--tw-bg-opacity));\n}\n";
2
2
  export {
3
3
  twStyle as default
4
4
  };
@@ -0,0 +1,7 @@
1
+ import { createContext } from "@lit/context";
2
+ const efContext = createContext(
3
+ Symbol("efContext")
4
+ );
5
+ export {
6
+ efContext
7
+ };
@@ -1,5 +1,7 @@
1
1
  import { createContext } from "@lit/context";
2
2
  const playingContext = createContext(Symbol("playingContext"));
3
+ const loopContext = createContext(Symbol("loopContext"));
3
4
  export {
5
+ loopContext,
4
6
  playingContext
5
7
  };
@@ -9,6 +9,8 @@ import { EFWaveform } from "./elements/EFWaveform.js";
9
9
  import { EFWorkbench } from "./gui/EFWorkbench.js";
10
10
  import { EFPreview } from "./gui/EFPreview.js";
11
11
  import { EFFilmstrip } from "./gui/EFFilmstrip.js";
12
+ import { EFTogglePlay } from "./gui/EFTogglePlay.js";
13
+ import { EFToggleLoop } from "./gui/EFToggleLoop.js";
12
14
  import "./EF_FRAMEGEN.js";
13
15
  if (typeof window !== "undefined") {
14
16
  window.EF_REGISTERED = true;
@@ -21,6 +23,8 @@ export {
21
23
  EFImage,
22
24
  EFPreview,
23
25
  EFTimegroup,
26
+ EFToggleLoop,
27
+ EFTogglePlay,
24
28
  EFVideo,
25
29
  EFWaveform,
26
30
  EFWorkbench
@@ -1,22 +1,19 @@
1
1
  import { LitElement } from 'lit';
2
- import { FocusContext } from './focusContext.ts';
3
2
  import { createRef } from 'lit/directives/ref.js';
4
3
  import { EFTimegroup } from '../elements/EFTimegroup.ts';
5
4
 
6
- declare class ContextMixinInterface {
7
- focusContext: FocusContext;
8
- focusedElement?: HTMLElement;
9
- fetch: typeof fetch;
5
+ export declare class ContextMixinInterface {
10
6
  signingURL?: string;
11
- apiToken?: string;
12
- apiHost: string;
13
- stageScale: number;
14
7
  rendering: boolean;
15
- stageRef: ReturnType<typeof createRef<HTMLDivElement>>;
16
- canvasRef: ReturnType<typeof createRef<HTMLElement>>;
17
8
  playing: boolean;
18
- targetTimegroup?: EFTimegroup;
9
+ loop: boolean;
19
10
  currentTimeMs: number;
11
+ focusedElement?: HTMLElement;
12
+ stageRef: ReturnType<typeof createRef<HTMLDivElement>>;
13
+ canvasRef: ReturnType<typeof createRef<HTMLElement>>;
14
+ targetTimegroup: EFTimegroup | null;
15
+ play(): void;
16
+ pause(): void;
20
17
  }
21
18
  type Constructor<T = {}> = new (...args: any[]) => T;
22
19
  export declare function ContextMixin<T extends Constructor<LitElement>>(superClass: T): Constructor<ContextMixinInterface> & T;
@@ -23,11 +23,15 @@ declare class FilmstripItem extends FilmstripItem_base {
23
23
  get isFocused(): boolean;
24
24
  element: TemporalMixinInterface & LitElement;
25
25
  pixelsPerMs: number;
26
- get styles(): {
26
+ get gutterStyles(): {
27
27
  position: string;
28
28
  left: string;
29
29
  width: string;
30
30
  };
31
+ get trimPortionStyles(): {
32
+ width: string;
33
+ left: string;
34
+ };
31
35
  render(): TemplateResult<1>;
32
36
  renderChildren(): Array<TemplateResult<1> | typeof nothing> | typeof nothing;
33
37
  contents(): TemplateResult<1>;
@@ -104,6 +108,7 @@ export declare class EFFilmstrip extends EFFilmstrip_base {
104
108
  scrubbing: boolean;
105
109
  timelineScrolltop: number;
106
110
  playing?: boolean;
111
+ loop?: boolean;
107
112
  timegroupController?: TimegroupController;
108
113
  currentTimeMs: number;
109
114
  connectedCallback(): void;
@@ -119,7 +124,7 @@ export declare class EFFilmstrip extends EFFilmstrip_base {
119
124
  get gutter(): HTMLDivElement | undefined;
120
125
  render(): TemplateResult<1>;
121
126
  updated(changes: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
122
- get targetTimegroup(): EFTimegroup | undefined;
127
+ get targetTimegroup(): EFTimegroup | null | undefined;
123
128
  }
124
129
  declare global {
125
130
  interface HTMLElementTagNameMap {
@@ -1,20 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
 
3
- declare const EFPreview_base: (new (...args: any[]) => {
4
- focusContext: import('./focusContext.ts').FocusContext;
5
- focusedElement?: HTMLElement;
6
- fetch: typeof fetch;
7
- signingURL?: string;
8
- apiToken?: string;
9
- apiHost: string;
10
- stageScale: number;
11
- rendering: boolean;
12
- stageRef: ReturnType<typeof import('lit-html/directives/ref.js').createRef>;
13
- canvasRef: ReturnType<typeof import('lit-html/directives/ref.js').createRef>;
14
- playing: boolean;
15
- targetTimegroup?: import('../index.ts').EFTimegroup;
16
- currentTimeMs: number;
17
- }) & typeof LitElement;
3
+ declare const EFPreview_base: (new (...args: any[]) => import('./ContextMixin.ts').ContextMixinInterface) & typeof LitElement;
18
4
  export declare class EFPreview extends EFPreview_base {
19
5
  static styles: import('lit').CSSResult[];
20
6
  render(): import('lit-html').TemplateResult<1>;
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ import { ContextMixinInterface } from './ContextMixin.ts';
3
+
4
+ export declare class EFToggleLoop extends LitElement {
5
+ static styles: import('lit').CSSResult[];
6
+ context?: ContextMixinInterface | null;
7
+ render(): import('lit-html').TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ "ef-toggle-loop": EFToggleLoop;
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+ import { ContextMixinInterface } from './ContextMixin.ts';
3
+
4
+ export declare class EFTogglePlay extends LitElement {
5
+ static styles: import('lit').CSSResult[];
6
+ context?: ContextMixinInterface | null;
7
+ render(): import('lit-html').TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ "ef-toggle-play": EFTogglePlay;
12
+ }
13
+ }
@@ -1,21 +1,6 @@
1
1
  import { LitElement, PropertyValueMap } from 'lit';
2
- import { createRef } from 'lit/directives/ref.js';
3
2
 
4
- declare const EFWorkbench_base: (new (...args: any[]) => {
5
- focusContext: import('./focusContext.ts').FocusContext;
6
- focusedElement?: HTMLElement;
7
- fetch: typeof fetch;
8
- signingURL?: string;
9
- apiToken?: string;
10
- apiHost: string;
11
- stageScale: number;
12
- rendering: boolean;
13
- stageRef: ReturnType<typeof createRef>;
14
- canvasRef: ReturnType<typeof createRef>;
15
- playing: boolean;
16
- targetTimegroup?: import('../elements/EFTimegroup.ts').EFTimegroup;
17
- currentTimeMs: number;
18
- }) & typeof LitElement;
3
+ declare const EFWorkbench_base: (new (...args: any[]) => import('./ContextMixin.ts').ContextMixinInterface) & typeof LitElement;
19
4
  export declare class EFWorkbench extends EFWorkbench_base {
20
5
  static styles: import('lit').CSSResult[];
21
6
  disconnectedCallback(): void;
@@ -0,0 +1,5 @@
1
+ import { ContextMixinInterface } from './ContextMixin.ts';
2
+
3
+ export declare const efContext: {
4
+ __context__: ContextMixinInterface | null;
5
+ };
@@ -1,3 +1,6 @@
1
1
  export declare const playingContext: {
2
2
  __context__: boolean;
3
3
  };
4
+ export declare const loopContext: {
5
+ __context__: boolean;
6
+ };
package/dist/index.d.ts CHANGED
@@ -9,3 +9,5 @@ export { EFWaveform } from './elements/EFWaveform.ts';
9
9
  export { EFWorkbench } from './gui/EFWorkbench.ts';
10
10
  export { EFPreview } from './gui/EFPreview.ts';
11
11
  export { EFFilmstrip } from './gui/EFFilmstrip.ts';
12
+ export { EFTogglePlay } from './gui/EFTogglePlay.ts';
13
+ export { EFToggleLoop } from './gui/EFToggleLoop.ts';
package/dist/style.css CHANGED
@@ -624,6 +624,9 @@ video {
624
624
  .items-center {
625
625
  align-items: center;
626
626
  }
627
+ .justify-center {
628
+ justify-content: center;
629
+ }
627
630
  .overflow-auto {
628
631
  overflow: auto;
629
632
  }
@@ -675,6 +678,10 @@ video {
675
678
  --tw-bg-opacity: 1;
676
679
  background-color: rgb(226 232 240 / var(--tw-bg-opacity));
677
680
  }
681
+ .bg-slate-300 {
682
+ --tw-bg-opacity: 1;
683
+ background-color: rgb(203 213 225 / var(--tw-bg-opacity));
684
+ }
678
685
  .bg-opacity-20 {
679
686
  --tw-bg-opacity: 0.2;
680
687
  }
@@ -764,11 +771,6 @@ body {
764
771
  -webkit-text-size-adjust: 100%;
765
772
  }
766
773
 
767
- .hover\:bg-blue-400:hover {
768
- --tw-bg-opacity: 1;
769
- background-color: rgb(96 165 250 / var(--tw-bg-opacity));
770
- }
771
-
772
774
  .hover\:bg-slate-400:hover {
773
775
  --tw-bg-opacity: 1;
774
776
  background-color: rgb(148 163 184 / var(--tw-bg-opacity));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/elements",
3
- "version": "0.8.0-beta.2",
3
+ "version": "0.8.0-beta.4",
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.8.0-beta.2",
23
+ "@editframe/assets": "0.8.0-beta.4",
24
24
  "@lit/context": "^1.1.2",
25
25
  "@lit/task": "^1.0.1",
26
26
  "d3": "^7.9.0",
@@ -75,8 +75,12 @@ export class EFCaptions extends EFSourceMixin(
75
75
  `,
76
76
  ];
77
77
 
78
- @property({ type: String, attribute: "target" })
79
- target = null;
78
+ @property({ type: String, attribute: "target", reflect: true })
79
+ targetSelector = "";
80
+
81
+ set target(value: string) {
82
+ this.targetSelector = value;
83
+ }
80
84
 
81
85
  @property({ attribute: "word-style" })
82
86
  wordStyle = "";
@@ -149,13 +153,15 @@ export class EFCaptions extends EFSourceMixin(
149
153
  let endMs = 0;
150
154
  for (const segment of caption.segments) {
151
155
  if (
152
- this.targetElement.ownCurrentTimeMs >= segment.start * 1000 &&
153
- this.targetElement.ownCurrentTimeMs <= segment.end * 1000
156
+ this.targetElement.trimAdjustedOwnCurrentTimeMs >=
157
+ segment.start * 1000 &&
158
+ this.targetElement.trimAdjustedOwnCurrentTimeMs <= segment.end * 1000
154
159
  ) {
155
160
  for (const word of segment.words) {
156
161
  if (
157
- this.targetElement.ownCurrentTimeMs >= word.start * 1000 &&
158
- this.targetElement.ownCurrentTimeMs <= word.end * 1000
162
+ this.targetElement.trimAdjustedOwnCurrentTimeMs >=
163
+ word.start * 1000 &&
164
+ this.targetElement.trimAdjustedOwnCurrentTimeMs <= word.end * 1000
159
165
  ) {
160
166
  words.push(word.text);
161
167
  startMs = word.start * 1000;
@@ -172,11 +178,11 @@ export class EFCaptions extends EFSourceMixin(
172
178
  }
173
179
 
174
180
  get targetElement() {
175
- const target = document.getElementById(this.getAttribute("target") ?? "");
181
+ const target = document.getElementById(this.targetSelector ?? "");
176
182
  if (target instanceof EFAudio || target instanceof EFVideo) {
177
183
  return target;
178
184
  }
179
- throw new Error("Invalid target, must be an EFAudio or EFVideo element");
185
+ throw new Error("Invalid target, must be an EFAudio or EFVideo element");
180
186
  }
181
187
  }
182
188
 
@@ -278,7 +278,7 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
278
278
  changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,
279
279
  ): void {
280
280
  if (changedProperties.has("ownCurrentTimeMs")) {
281
- this.executeSeek(this.ownCurrentTimeMs);
281
+ this.executeSeek(this.trimAdjustedOwnCurrentTimeMs);
282
282
  }
283
283
  }
284
284
 
@@ -299,7 +299,7 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
299
299
  if (durations.length === 0) {
300
300
  return 0;
301
301
  }
302
- return Math.max(...durations);
302
+ return Math.max(...durations) - this.trimStartMs - this.trimEndMs;
303
303
  }
304
304
 
305
305
  get startTimeMs() {
@@ -340,8 +340,8 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
340
340
 
341
341
  async fetchAudioSpanningTime(fromMs: number, toMs: number) {
342
342
  // Adjust range for track's own time
343
- fromMs -= this.startTimeMs;
344
- toMs -= this.startTimeMs;
343
+ fromMs -= this.startTimeMs - this.trimStartMs;
344
+ toMs -= this.startTimeMs - this.trimStartMs;
345
345
 
346
346
  await this.trackFragmentIndexLoader.taskComplete;
347
347
  const audioTrackId = this.defaultAudioTrackId;
@@ -408,10 +408,13 @@ export class EFMedia extends EFSourceMixin(EFTemporal(FetchMixin(LitElement)), {
408
408
 
409
409
  return {
410
410
  blob: audioBlob,
411
- startMs: (firstFragment.dts / audioTrackIndex.timescale) * 1000,
411
+ startMs:
412
+ (firstFragment.dts / audioTrackIndex.timescale) * 1000 -
413
+ this.trimStartMs,
412
414
  endMs:
413
415
  (lastFragment.dts / audioTrackIndex.timescale) * 1000 +
414
- (lastFragment.duration / audioTrackIndex.timescale) * 1000,
416
+ (lastFragment.duration / audioTrackIndex.timescale) * 1000 -
417
+ this.trimEndMs,
415
418
  };
416
419
  }
417
420
  }
@@ -13,11 +13,14 @@ export const timegroupContext = createContext<EFTimegroup>(
13
13
 
14
14
  export declare class TemporalMixinInterface {
15
15
  get hasOwnDuration(): boolean;
16
+ get trimStartMs(): number;
17
+ get trimEndMs(): number;
16
18
  get durationMs(): number;
17
19
  get startTimeMs(): number;
18
20
  get startTimeWithinParentMs(): number;
19
21
  get endTimeMs(): number;
20
22
  get ownCurrentTimeMs(): number;
23
+ get trimAdjustedOwnCurrentTimeMs(): number;
21
24
 
22
25
  set duration(value: string);
23
26
  get duration(): string;
@@ -153,6 +156,36 @@ export const EFTemporal = <T extends Constructor<LitElement>>(
153
156
  })
154
157
  private _durationMs?: number;
155
158
 
159
+ @property({
160
+ type: Number,
161
+ attribute: "trimstart",
162
+ converter: durationConverter,
163
+ })
164
+ private _trimStartMs = 0;
165
+ public get trimStartMs(): number {
166
+ return this._trimStartMs;
167
+ }
168
+
169
+ @property({
170
+ type: Number,
171
+ attribute: "trimend",
172
+ converter: durationConverter,
173
+ })
174
+ private _trimEndMs = 0;
175
+ public get trimEndMs(): number {
176
+ return this._trimEndMs;
177
+ }
178
+
179
+ @property({
180
+ type: Number,
181
+ attribute: "startoffset",
182
+ converter: durationConverter,
183
+ })
184
+ private _startOffsetMs = 0;
185
+ public get startOffsetMs(): number {
186
+ return this._startOffsetMs;
187
+ }
188
+
156
189
  @state()
157
190
  rootTimegroup?: EFTimegroup = this.getRootTimegroup();
158
191
 
@@ -220,9 +253,15 @@ export const EFTemporal = <T extends Constructor<LitElement>>(
220
253
  }
221
254
  startTimeMsCache.set(
222
255
  this,
223
- previous.startTimeMs + previous.durationMs,
256
+ previous.startTimeMs +
257
+ previous.durationMs -
258
+ parentTimegroup.overlapMs,
259
+ );
260
+ return (
261
+ previous.startTimeMs +
262
+ previous.durationMs -
263
+ parentTimegroup.overlapMs
224
264
  );
225
- return previous.startTimeMs + previous.durationMs;
226
265
  }
227
266
  case "contain":
228
267
  case "fixed":
@@ -250,6 +289,25 @@ export const EFTemporal = <T extends Constructor<LitElement>>(
250
289
  return 0;
251
290
  }
252
291
 
292
+ /**
293
+ * Used to calculate the internal currentTimeMs of the element. This is useful
294
+ * for mapping to internal media time codes for audio/video elements.
295
+ */
296
+ get trimAdjustedOwnCurrentTimeMs() {
297
+ if (this.rootTimegroup) {
298
+ return Math.min(
299
+ Math.max(
300
+ 0,
301
+ this.rootTimegroup.currentTimeMs -
302
+ this.startTimeMs +
303
+ this.trimStartMs,
304
+ ),
305
+ this.durationMs + Math.abs(this.startOffsetMs) + this.trimStartMs,
306
+ );
307
+ }
308
+ return 0;
309
+ }
310
+
253
311
  frameTask = new Task(this, {
254
312
  autoRun: EF_INTERACTIVE,
255
313
  args: () => [this.ownCurrentTimeMs] as const,