@editframe/react 0.21.0-beta.0 → 0.23.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/components/TimeDisplay.js +7 -5
  2. package/dist/elements/Audio.d.ts +1 -1
  3. package/dist/elements/Audio.js +7 -5
  4. package/dist/elements/Captions.d.ts +5 -5
  5. package/dist/elements/Captions.js +24 -18
  6. package/dist/elements/Image.d.ts +1 -1
  7. package/dist/elements/Image.js +7 -5
  8. package/dist/elements/Surface.d.ts +1 -1
  9. package/dist/elements/Surface.js +9 -7
  10. package/dist/elements/ThumbnailStrip.d.ts +1 -1
  11. package/dist/elements/ThumbnailStrip.js +9 -7
  12. package/dist/elements/Timegroup.d.ts +1 -1
  13. package/dist/elements/Timegroup.js +7 -5
  14. package/dist/elements/Video.d.ts +1 -1
  15. package/dist/elements/Video.js +7 -5
  16. package/dist/elements/Waveform.d.ts +1 -1
  17. package/dist/elements/Waveform.js +7 -5
  18. package/dist/gui/Configuration.d.ts +1 -1
  19. package/dist/gui/Configuration.js +7 -5
  20. package/dist/gui/Controls.d.ts +1 -1
  21. package/dist/gui/Controls.js +7 -5
  22. package/dist/gui/EFDial.d.ts +4 -0
  23. package/dist/gui/EFDial.js +14 -0
  24. package/dist/gui/EFResizableBox.d.ts +4 -0
  25. package/dist/gui/EFResizableBox.js +14 -0
  26. package/dist/gui/Filmstrip.d.ts +1 -1
  27. package/dist/gui/Filmstrip.js +7 -5
  28. package/dist/gui/FitScale.d.ts +1 -1
  29. package/dist/gui/FitScale.js +7 -5
  30. package/dist/gui/FocusOverlay.d.ts +1 -1
  31. package/dist/gui/FocusOverlay.js +7 -5
  32. package/dist/gui/Pause.d.ts +2 -0
  33. package/dist/gui/Pause.js +11 -0
  34. package/dist/gui/Play.d.ts +2 -0
  35. package/dist/gui/Play.js +11 -0
  36. package/dist/gui/Preview.d.ts +1 -1
  37. package/dist/gui/Preview.js +7 -5
  38. package/dist/gui/Scrubber.d.ts +1 -1
  39. package/dist/gui/Scrubber.js +7 -5
  40. package/dist/gui/ToggleLoop.d.ts +1 -1
  41. package/dist/gui/ToggleLoop.js +7 -5
  42. package/dist/gui/TogglePlay.d.ts +1 -1
  43. package/dist/gui/TogglePlay.js +7 -5
  44. package/dist/gui/Workbench.d.ts +1 -1
  45. package/dist/gui/Workbench.js +7 -5
  46. package/dist/hooks/create-element.d.ts +21 -0
  47. package/dist/hooks/create-element.js +103 -0
  48. package/dist/hooks/useTimingInfo.js +33 -32
  49. package/dist/index.d.ts +4 -0
  50. package/dist/index.js +34 -1
  51. package/package.json +6 -5
  52. package/src/components/TimeDisplay.tsx +1 -1
  53. package/src/elements/Audio.ts +1 -1
  54. package/src/elements/Captions.ts +1 -1
  55. package/src/elements/Image.ts +1 -1
  56. package/src/elements/Surface.ts +1 -1
  57. package/src/elements/ThumbnailStrip.ts +1 -1
  58. package/src/elements/Timegroup.ts +1 -1
  59. package/src/elements/Video.ts +1 -1
  60. package/src/elements/Waveform.ts +1 -1
  61. package/src/gui/Configuration.ts +1 -1
  62. package/src/gui/Controls.browsertest.tsx +112 -0
  63. package/src/gui/Controls.ts +1 -1
  64. package/src/gui/EFDial.ts +12 -0
  65. package/src/gui/EFResizableBox.ts +12 -0
  66. package/src/gui/Filmstrip.ts +1 -1
  67. package/src/gui/FitScale.ts +1 -1
  68. package/src/gui/FocusOverlay.ts +1 -1
  69. package/src/gui/Pause.ts +9 -0
  70. package/src/gui/Play.ts +9 -0
  71. package/src/gui/Preview.ts +1 -1
  72. package/src/gui/Scrubber.ts +1 -1
  73. package/src/gui/ToggleLoop.ts +1 -1
  74. package/src/gui/TogglePlay.ts +1 -1
  75. package/src/gui/Workbench.ts +1 -1
  76. package/src/hooks/create-element.ts +167 -0
  77. package/types.json +1 -1
  78. package/dist/create-component.d.ts +0 -88
@@ -0,0 +1,103 @@
1
+ import React from "react";
2
+ let isomorphicEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
3
+ const reservedReactProperties = /* @__PURE__ */ new Set([
4
+ "children",
5
+ "localName",
6
+ "ref",
7
+ "style",
8
+ "className"
9
+ ]);
10
+ const listenedEvents = /* @__PURE__ */ new WeakMap();
11
+ function addOrUpdateEventListener(node, event, listener) {
12
+ let events = listenedEvents.get(node);
13
+ if (!events) {
14
+ events = /* @__PURE__ */ new Map();
15
+ listenedEvents.set(node, events);
16
+ }
17
+ let handler = events.get(event);
18
+ if (listener) {
19
+ if (!handler) {
20
+ handler = { handleEvent: listener };
21
+ events.set(event, handler);
22
+ node.addEventListener(event, handler);
23
+ } else {
24
+ handler.handleEvent = listener;
25
+ }
26
+ } else if (handler) {
27
+ events.delete(event);
28
+ node.removeEventListener(event, handler);
29
+ }
30
+ }
31
+ function setProperty(node, name, value, old, events) {
32
+ const event = events?.[name];
33
+ if (event) {
34
+ if (value !== old)
35
+ addOrUpdateEventListener(node, event, value);
36
+ return;
37
+ }
38
+ node[name] = value;
39
+ if ((value === void 0 || value === null) && name in HTMLElement.prototype) {
40
+ node.removeAttribute(name);
41
+ }
42
+ }
43
+ function createComponent({
44
+ react: React2,
45
+ tagName,
46
+ elementClass,
47
+ events,
48
+ displayName
49
+ }) {
50
+ const eventProps = new Set(Object.keys(events ?? {}));
51
+ const ReactComponent = React2.forwardRef(
52
+ (props, ref) => {
53
+ const elementRef = React2.useRef(null);
54
+ const prevPropsRef = React2.useRef(/* @__PURE__ */ new Map());
55
+ const reactProps = {
56
+ suppressHydrationWarning: true
57
+ };
58
+ const elementProps = {};
59
+ for (const [k, v] of Object.entries(props)) {
60
+ if (reservedReactProperties.has(k)) {
61
+ reactProps[k === "className" ? "class" : k] = v;
62
+ continue;
63
+ }
64
+ if (eventProps.has(k) || k in elementClass.prototype)
65
+ elementProps[k] = v;
66
+ reactProps[k] = v;
67
+ }
68
+ isomorphicEffect(() => {
69
+ if (!elementRef.current) return;
70
+ const newProps = /* @__PURE__ */ new Map();
71
+ for (const key in elementProps) {
72
+ setProperty(
73
+ elementRef.current,
74
+ key,
75
+ props[key],
76
+ prevPropsRef.current.get(key),
77
+ events
78
+ );
79
+ prevPropsRef.current.delete(key);
80
+ newProps.set(key, props[key]);
81
+ }
82
+ for (const [key, value] of prevPropsRef.current) {
83
+ setProperty(elementRef.current, key, void 0, value, events);
84
+ }
85
+ prevPropsRef.current = newProps;
86
+ elementRef.current.removeAttribute("defer-hydration");
87
+ }, [props]);
88
+ return React2.createElement(tagName, {
89
+ ...reactProps,
90
+ ref: (node) => {
91
+ elementRef.current = node;
92
+ if (typeof ref === "function") ref(node);
93
+ else if (ref) ref.current = node;
94
+ }
95
+ });
96
+ }
97
+ );
98
+ ReactComponent.displayName = displayName ?? elementClass.name;
99
+ return ReactComponent;
100
+ }
101
+ export {
102
+ createComponent
103
+ };
@@ -1,34 +1,35 @@
1
- import { useEffect, useRef, useState } from "react";
2
- var CurrentTimeController = class {
3
- constructor(host, setCurrentTime) {
4
- this.host = host;
5
- this.setCurrentTime = setCurrentTime;
6
- this.host.addController(this);
7
- }
8
- hostDisconnected() {
9
- this.host.removeController(this);
10
- }
11
- hostUpdated() {
12
- this.setCurrentTime({
13
- ownCurrentTimeMs: this.host.ownCurrentTimeMs,
14
- durationMs: this.host.durationMs,
15
- percentComplete: this.host.ownCurrentTimeMs / this.host.durationMs
16
- });
17
- }
18
- };
1
+ import { useRef, useState, useEffect } from "react";
2
+ class CurrentTimeController {
3
+ constructor(host, setCurrentTime) {
4
+ this.host = host;
5
+ this.setCurrentTime = setCurrentTime;
6
+ this.host.addController(this);
7
+ }
8
+ hostDisconnected() {
9
+ this.host.removeController(this);
10
+ }
11
+ hostUpdated() {
12
+ this.setCurrentTime({
13
+ ownCurrentTimeMs: this.host.ownCurrentTimeMs,
14
+ durationMs: this.host.durationMs,
15
+ percentComplete: this.host.ownCurrentTimeMs / this.host.durationMs
16
+ });
17
+ }
18
+ }
19
19
  const useTimingInfo = (timegroupRef = useRef(null)) => {
20
- const [timeInfo, setTimeInfo] = useState({
21
- ownCurrentTimeMs: 0,
22
- durationMs: 0,
23
- percentComplete: 0
24
- });
25
- useEffect(() => {
26
- if (!timegroupRef.current) throw new Error("Timegroup ref not set");
27
- new CurrentTimeController(timegroupRef.current, setTimeInfo);
28
- }, [timegroupRef.current]);
29
- return {
30
- ...timeInfo,
31
- ref: timegroupRef
32
- };
20
+ const [timeInfo, setTimeInfo] = useState({
21
+ ownCurrentTimeMs: 0,
22
+ durationMs: 0,
23
+ percentComplete: 0
24
+ });
25
+ useEffect(() => {
26
+ if (!timegroupRef.current) {
27
+ throw new Error("Timegroup ref not set");
28
+ }
29
+ new CurrentTimeController(timegroupRef.current, setTimeInfo);
30
+ }, [timegroupRef.current]);
31
+ return { ...timeInfo, ref: timegroupRef };
32
+ };
33
+ export {
34
+ useTimingInfo
33
35
  };
34
- export { useTimingInfo };
package/dist/index.d.ts CHANGED
@@ -9,9 +9,13 @@ export { Video } from './elements/Video.js';
9
9
  export { Waveform } from './elements/Waveform.js';
10
10
  export { Configuration } from './gui/Configuration.js';
11
11
  export { Controls } from './gui/Controls.js';
12
+ export { Dial } from './gui/EFDial.js';
13
+ export { ResizableBox } from './gui/EFResizableBox.js';
12
14
  export { Filmstrip } from './gui/Filmstrip.js';
13
15
  export { FitScale } from './gui/FitScale.js';
14
16
  export { FocusOverlay } from './gui/FocusOverlay.js';
17
+ export { Pause } from './gui/Pause.js';
18
+ export { Play } from './gui/Play.js';
15
19
  export { Preview } from './gui/Preview.js';
16
20
  export { Scrubber } from './gui/Scrubber.js';
17
21
  export { ToggleLoop } from './gui/ToggleLoop.js';
package/dist/index.js CHANGED
@@ -9,13 +9,46 @@ import { Video } from "./elements/Video.js";
9
9
  import { Waveform } from "./elements/Waveform.js";
10
10
  import { Configuration } from "./gui/Configuration.js";
11
11
  import { Controls } from "./gui/Controls.js";
12
+ import { Dial } from "./gui/EFDial.js";
13
+ import { ResizableBox } from "./gui/EFResizableBox.js";
12
14
  import { Filmstrip } from "./gui/Filmstrip.js";
13
15
  import { FitScale } from "./gui/FitScale.js";
14
16
  import { FocusOverlay } from "./gui/FocusOverlay.js";
17
+ import { Pause } from "./gui/Pause.js";
18
+ import { Play } from "./gui/Play.js";
15
19
  import { Preview } from "./gui/Preview.js";
16
20
  import { Scrubber } from "./gui/Scrubber.js";
17
21
  import { ToggleLoop } from "./gui/ToggleLoop.js";
18
22
  import { TogglePlay } from "./gui/TogglePlay.js";
19
23
  import { Workbench } from "./gui/Workbench.js";
20
24
  import { useTimingInfo } from "./hooks/useTimingInfo.js";
21
- export { Audio, Captions, CaptionsActiveWord, CaptionsAfterActiveWord, CaptionsBeforeActiveWord, CaptionsSegment, Configuration, Controls, Filmstrip, FitScale, FocusOverlay, Image, Preview, Scrubber, Surface, ThumbnailStrip, TimeDisplay, Timegroup, ToggleLoop, TogglePlay, Video, Waveform, Workbench, useTimingInfo };
25
+ export {
26
+ Audio,
27
+ Captions,
28
+ CaptionsActiveWord,
29
+ CaptionsAfterActiveWord,
30
+ CaptionsBeforeActiveWord,
31
+ CaptionsSegment,
32
+ Configuration,
33
+ Controls,
34
+ Dial,
35
+ Filmstrip,
36
+ FitScale,
37
+ FocusOverlay,
38
+ Image,
39
+ Pause,
40
+ Play,
41
+ Preview,
42
+ ResizableBox,
43
+ Scrubber,
44
+ Surface,
45
+ ThumbnailStrip,
46
+ TimeDisplay,
47
+ Timegroup,
48
+ ToggleLoop,
49
+ TogglePlay,
50
+ Video,
51
+ Waveform,
52
+ Workbench,
53
+ useTimingInfo
54
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/react",
3
- "version": "0.21.0-beta.0",
3
+ "version": "0.23.6-beta.0",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -25,10 +25,10 @@
25
25
  "author": "",
26
26
  "license": "UNLICENSED",
27
27
  "dependencies": {
28
- "@editframe/elements": "0.21.0-beta.0",
29
- "@lit/react": "^1.0.5",
28
+ "@editframe/elements": "0.23.6-beta.0",
29
+ "@lit/react": "^1.0.8",
30
30
  "debug": "^4.3.5",
31
- "lit": "^3.2.1",
31
+ "lit": "^3.3.1",
32
32
  "react": "^18.3.0",
33
33
  "react-dom": "^18.3.0"
34
34
  },
@@ -39,6 +39,7 @@
39
39
  "rollup-plugin-tsconfig-paths": "^1.5.2",
40
40
  "typescript": "^5.5.4",
41
41
  "vite-plugin-dts": "^4.5.4",
42
- "vite-tsconfig-paths": "^4.3.2"
42
+ "vite-tsconfig-paths": "^4.3.2",
43
+ "vitest": "^1.6.0"
43
44
  }
44
45
  }
@@ -1,6 +1,6 @@
1
1
  import { EFTimeDisplay } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const TimeDisplay = createComponent({
6
6
  tagName: "ef-time-display",
@@ -1,6 +1,6 @@
1
1
  import { EFAudio as EFAudioElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Audio = createComponent({
6
6
  tagName: "ef-audio",
@@ -5,8 +5,8 @@ import {
5
5
  EFCaptions as EFCaptionsElement,
6
6
  EFCaptionsSegment as EFCaptionsSegmentElement,
7
7
  } from "@editframe/elements";
8
- import { createComponent } from "@lit/react";
9
8
  import React from "react";
9
+ import { createComponent } from "../hooks/create-element";
10
10
 
11
11
  export const Captions = createComponent({
12
12
  tagName: "ef-captions",
@@ -1,6 +1,6 @@
1
1
  import { EFImage as EFImageElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Image = createComponent({
6
6
  tagName: "ef-image",
@@ -1,6 +1,6 @@
1
1
  import { EFSurface as EFSurfaceElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Surface = createComponent({
6
6
  tagName: "ef-surface",
@@ -1,6 +1,6 @@
1
1
  import { EFThumbnailStrip as EFThumbnailStripElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const ThumbnailStrip = createComponent({
6
6
  tagName: "ef-thumbnail-strip",
@@ -1,6 +1,6 @@
1
1
  import { EFTimegroup as EFTimegroupElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Timegroup = createComponent({
6
6
  tagName: "ef-timegroup",
@@ -1,6 +1,6 @@
1
1
  import { EFVideo as EFVideoElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Video = createComponent({
6
6
  tagName: "ef-video",
@@ -1,6 +1,6 @@
1
1
  import { EFWaveform as EFWaveformElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Waveform = createComponent({
6
6
  tagName: "ef-waveform",
@@ -1,6 +1,6 @@
1
1
  import { EFConfiguration } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Configuration = createComponent({
6
6
  tagName: "ef-configuration",
@@ -0,0 +1,112 @@
1
+ import React from "react";
2
+ import { createRoot, hydrateRoot, type Root } from "react-dom/client";
3
+ import { renderToString } from "react-dom/server";
4
+ import { test as baseTest, describe, vi } from "vitest";
5
+ import { Timegroup } from "../elements/Timegroup";
6
+ import { setIsomorphicEffect } from "../hooks/create-element";
7
+ import { Configuration } from "./Configuration";
8
+ import { Controls } from "./Controls";
9
+ import { Preview } from "./Preview";
10
+ import { TogglePlay } from "./TogglePlay";
11
+
12
+ const test = baseTest.extend<{
13
+ root: Root;
14
+ markup: JSX.Element;
15
+ stringMarkup: string;
16
+ hydratedContainer: HTMLElement;
17
+ renderedContainer: HTMLElement;
18
+ }>({
19
+ // biome-ignore lint/correctness/noEmptyPattern: Required by Vitest fixture syntax
20
+ markup: async ({}, use) => {
21
+ const markup = (
22
+ <>
23
+ <Configuration>
24
+ {/* biome-ignore lint/correctness/useUniqueElementIds: OK for test fixture with single instance */}
25
+ <Preview id="test-preview">
26
+ <Timegroup mode="fixed" duration="10s" />
27
+ </Preview>
28
+ <Controls target="test-preview">
29
+ <TogglePlay />
30
+ </Controls>
31
+ </Configuration>
32
+ </>
33
+ );
34
+ await use(markup);
35
+ },
36
+ stringMarkup: async ({ markup }, use) => {
37
+ setIsomorphicEffect(React.useEffect);
38
+ const stringMarkup = renderToString(markup);
39
+ setIsomorphicEffect(React.useLayoutEffect);
40
+ await use(stringMarkup);
41
+ },
42
+ hydratedContainer: async ({ stringMarkup, markup }, use) => {
43
+ const container = document.createElement("div");
44
+ document.body.appendChild(container);
45
+ container.innerHTML = stringMarkup;
46
+ hydrateRoot(container, markup);
47
+ await use(container);
48
+ container.remove();
49
+ },
50
+ // biome-ignore lint/correctness/noEmptyPattern: Required by Vitest fixture syntax
51
+ renderedContainer: async ({}, use) => {
52
+ const container = document.createElement("div");
53
+ document.body.appendChild(container);
54
+ await use(container);
55
+ container.remove();
56
+ },
57
+ root: async ({ renderedContainer, markup }, use) => {
58
+ const root = createRoot(renderedContainer);
59
+ root.render(markup);
60
+ await use(root);
61
+ root.unmount();
62
+ },
63
+ });
64
+
65
+ describe("Controls", () => {
66
+ describe("renderedContainer", () => {
67
+ test.skip("works", async ({ renderedContainer, expect }) => {
68
+ await vi.waitUntil(
69
+ () => {
70
+ return renderedContainer.innerHTML.includes("ef-controls");
71
+ },
72
+ { timeout: 5000 },
73
+ );
74
+ const controls =
75
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
76
+ renderedContainer.getElementsByTagName("ef-controls")[0]!;
77
+ const preview =
78
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
79
+ renderedContainer.getElementsByTagName("ef-preview")[0]!;
80
+ const togglePlay =
81
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
82
+ renderedContainer.getElementsByTagName("ef-toggle-play")[0]!;
83
+
84
+ expect(controls.targetElement).toBe(preview);
85
+ expect(togglePlay.efContext).toBe(preview);
86
+ }, 5000);
87
+ });
88
+
89
+ describe("hydratedContainer", () => {
90
+ test("proxies contexts following hydration", async ({
91
+ hydratedContainer,
92
+ expect,
93
+ }) => {
94
+ await vi.waitUntil(
95
+ () => hydratedContainer.innerHTML.includes("ef-controls"),
96
+ { timeout: 5000 },
97
+ );
98
+ const controls =
99
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
100
+ hydratedContainer.getElementsByTagName("ef-controls")[0]!;
101
+ const preview =
102
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
103
+ hydratedContainer.getElementsByTagName("ef-preview")[0]!;
104
+ const togglePlay =
105
+ // biome-ignore lint/style/noNonNullAssertion: Safe in tests where elements are guaranteed to exist
106
+ hydratedContainer.getElementsByTagName("ef-toggle-play")[0]!;
107
+
108
+ expect(controls.targetElement).toBe(preview);
109
+ expect(togglePlay.efContext).toBe(preview);
110
+ }, 5000);
111
+ });
112
+ });
@@ -1,6 +1,6 @@
1
1
  import { EFControls as EFControlsElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Controls = createComponent({
6
6
  tagName: "ef-controls",
@@ -0,0 +1,12 @@
1
+ import { EFDial as EFDialElement } from "@editframe/elements";
2
+ import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
+
5
+ export const Dial = createComponent({
6
+ tagName: "ef-dial",
7
+ elementClass: EFDialElement,
8
+ react: React,
9
+ events: {
10
+ onChange: "change",
11
+ },
12
+ });
@@ -0,0 +1,12 @@
1
+ import { EFResizableBox as EFResizableBoxElement } from "@editframe/elements";
2
+ import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
+
5
+ export const ResizableBox = createComponent({
6
+ tagName: "ef-resizable-box",
7
+ elementClass: EFResizableBoxElement,
8
+ react: React,
9
+ events: {
10
+ onBoundsChange: "bounds-change",
11
+ },
12
+ });
@@ -1,6 +1,6 @@
1
1
  import { EFFilmstrip as EFFilmstripElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Filmstrip = createComponent({
6
6
  tagName: "ef-filmstrip",
@@ -1,6 +1,6 @@
1
1
  import { EFFitScale as EFFitScaleElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const FitScale = createComponent({
6
6
  tagName: "ef-fit-scale",
@@ -1,6 +1,6 @@
1
1
  import { EFFocusOverlay as EFFocusOverlayElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const FocusOverlay = createComponent({
6
6
  tagName: "ef-focus-overlay",
@@ -0,0 +1,9 @@
1
+ import { EFPause as EFPauseElement } from "@editframe/elements";
2
+ import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
+
5
+ export const Pause = createComponent({
6
+ tagName: "ef-pause",
7
+ elementClass: EFPauseElement,
8
+ react: React,
9
+ });
@@ -0,0 +1,9 @@
1
+ import { EFPlay as EFPlayElement } from "@editframe/elements";
2
+ import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
+
5
+ export const Play = createComponent({
6
+ tagName: "ef-play",
7
+ elementClass: EFPlayElement,
8
+ react: React,
9
+ });
@@ -1,6 +1,6 @@
1
1
  import { EFPreview as EFPreviewElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Preview = createComponent({
6
6
  tagName: "ef-preview",
@@ -1,6 +1,6 @@
1
1
  import { EFScrubber as EFScrubberElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Scrubber = createComponent({
6
6
  tagName: "ef-scrubber",
@@ -1,6 +1,6 @@
1
1
  import { EFToggleLoop as EFToggleLoopElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const ToggleLoop = createComponent({
6
6
  tagName: "ef-toggle-loop",
@@ -1,6 +1,6 @@
1
1
  import { EFTogglePlay as EFTogglePlayElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const TogglePlay = createComponent({
6
6
  tagName: "ef-toggle-play",
@@ -1,6 +1,6 @@
1
1
  import { EFWorkbench as EFWorkbenchElement } from "@editframe/elements";
2
- import { createComponent } from "@lit/react";
3
2
  import React from "react";
3
+ import { createComponent } from "../hooks/create-element";
4
4
 
5
5
  export const Workbench = createComponent({
6
6
  tagName: "ef-workbench",