@editframe/react 0.23.8-beta.0 → 0.25.0-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.
- package/dist/components/TimeDisplay.d.ts +8 -0
- package/dist/components/TimeDisplay.js +10 -7
- package/dist/components/TimeDisplay.js.map +1 -0
- package/dist/elements/Audio.d.ts +8 -2
- package/dist/elements/Audio.js +10 -7
- package/dist/elements/Audio.js.map +1 -0
- package/dist/elements/Captions.d.ts +12 -6
- package/dist/elements/Captions.js +23 -24
- package/dist/elements/Captions.js.map +1 -0
- package/dist/elements/Image.d.ts +8 -2
- package/dist/elements/Image.js +10 -7
- package/dist/elements/Image.js.map +1 -0
- package/dist/elements/Surface.d.ts +8 -2
- package/dist/elements/Surface.js +12 -9
- package/dist/elements/Surface.js.map +1 -0
- package/dist/elements/ThumbnailStrip.d.ts +8 -2
- package/dist/elements/ThumbnailStrip.js +12 -9
- package/dist/elements/ThumbnailStrip.js.map +1 -0
- package/dist/elements/Timegroup.d.ts +8 -2
- package/dist/elements/Timegroup.js +10 -7
- package/dist/elements/Timegroup.js.map +1 -0
- package/dist/elements/Video.d.ts +8 -2
- package/dist/elements/Video.js +10 -7
- package/dist/elements/Video.js.map +1 -0
- package/dist/elements/Waveform.d.ts +8 -2
- package/dist/elements/Waveform.js +10 -7
- package/dist/elements/Waveform.js.map +1 -0
- package/dist/gui/Configuration.d.ts +8 -2
- package/dist/gui/Configuration.js +10 -7
- package/dist/gui/Configuration.js.map +1 -0
- package/dist/gui/Controls.d.ts +8 -2
- package/dist/gui/Controls.js +10 -7
- package/dist/gui/Controls.js.map +1 -0
- package/dist/gui/EFDial.d.ts +9 -3
- package/dist/gui/EFDial.js +11 -10
- package/dist/gui/EFDial.js.map +1 -0
- package/dist/gui/EFResizableBox.d.ts +9 -3
- package/dist/gui/EFResizableBox.js +11 -10
- package/dist/gui/EFResizableBox.js.map +1 -0
- package/dist/gui/Filmstrip.d.ts +8 -2
- package/dist/gui/Filmstrip.js +10 -7
- package/dist/gui/Filmstrip.js.map +1 -0
- package/dist/gui/FitScale.d.ts +8 -2
- package/dist/gui/FitScale.js +10 -7
- package/dist/gui/FitScale.js.map +1 -0
- package/dist/gui/FocusOverlay.d.ts +8 -2
- package/dist/gui/FocusOverlay.js +10 -7
- package/dist/gui/FocusOverlay.js.map +1 -0
- package/dist/gui/Pause.d.ts +8 -2
- package/dist/gui/Pause.js +10 -7
- package/dist/gui/Pause.js.map +1 -0
- package/dist/gui/Play.d.ts +8 -2
- package/dist/gui/Play.js +10 -7
- package/dist/gui/Play.js.map +1 -0
- package/dist/gui/Preview.d.ts +8 -2
- package/dist/gui/Preview.js +10 -7
- package/dist/gui/Preview.js.map +1 -0
- package/dist/gui/Scrubber.d.ts +8 -2
- package/dist/gui/Scrubber.js +10 -7
- package/dist/gui/Scrubber.js.map +1 -0
- package/dist/gui/ToggleLoop.d.ts +8 -2
- package/dist/gui/ToggleLoop.js +10 -7
- package/dist/gui/ToggleLoop.js.map +1 -0
- package/dist/gui/TogglePlay.d.ts +8 -2
- package/dist/gui/TogglePlay.js +10 -7
- package/dist/gui/TogglePlay.js.map +1 -0
- package/dist/gui/Workbench.d.ts +8 -2
- package/dist/gui/Workbench.js +10 -7
- package/dist/gui/Workbench.js.map +1 -0
- package/dist/hooks/create-element.d.ts +9 -18
- package/dist/hooks/create-element.js +72 -94
- package/dist/hooks/create-element.js.map +1 -0
- package/dist/hooks/useTimingInfo.d.ts +12 -6
- package/dist/hooks/useTimingInfo.js +63 -33
- package/dist/hooks/useTimingInfo.js.map +1 -0
- package/dist/index.d.ts +25 -24
- package/dist/index.js +2 -30
- package/package.json +11 -19
- package/src/hooks/useTimingInfo.browsertest.tsx +371 -0
- package/src/hooks/useTimingInfo.ts +56 -1
- package/tsdown.config.ts +36 -0
- package/types.json +1 -1
package/dist/gui/FitScale.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFFitScale } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/FitScale.d.ts
|
|
5
|
+
declare const FitScale: ReactWebComponent<EFFitScale, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FitScale };
|
|
8
|
+
//# sourceMappingURL=FitScale.d.ts.map
|
package/dist/gui/FitScale.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFFitScale } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/FitScale.ts
|
|
4
6
|
const FitScale = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-fit-scale",
|
|
8
|
+
elementClass: EFFitScale,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { FitScale };
|
|
14
|
+
//# sourceMappingURL=FitScale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FitScale.js","names":["EFFitScaleElement"],"sources":["../../src/gui/FitScale.ts"],"sourcesContent":["import { EFFitScale as EFFitScaleElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const FitScale = createComponent({\n tagName: \"ef-fit-scale\",\n elementClass: EFFitScaleElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,WAAW,gBAAgB;CACtC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFFocusOverlay } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/FocusOverlay.d.ts
|
|
5
|
+
declare const FocusOverlay: ReactWebComponent<EFFocusOverlay, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FocusOverlay };
|
|
8
|
+
//# sourceMappingURL=FocusOverlay.d.ts.map
|
package/dist/gui/FocusOverlay.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFFocusOverlay } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/FocusOverlay.ts
|
|
4
6
|
const FocusOverlay = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-focus-overlay",
|
|
8
|
+
elementClass: EFFocusOverlay,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { FocusOverlay };
|
|
14
|
+
//# sourceMappingURL=FocusOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusOverlay.js","names":["EFFocusOverlayElement"],"sources":["../../src/gui/FocusOverlay.ts"],"sourcesContent":["import { EFFocusOverlay as EFFocusOverlayElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const FocusOverlay = createComponent({\n tagName: \"ef-focus-overlay\",\n elementClass: EFFocusOverlayElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,eAAe,gBAAgB;CAC1C,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/Pause.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFPause } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/Pause.d.ts
|
|
5
|
+
declare const Pause: ReactWebComponent<EFPause, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Pause };
|
|
8
|
+
//# sourceMappingURL=Pause.d.ts.map
|
package/dist/gui/Pause.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFPause } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/Pause.ts
|
|
4
6
|
const Pause = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-pause",
|
|
8
|
+
elementClass: EFPause,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Pause };
|
|
14
|
+
//# sourceMappingURL=Pause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pause.js","names":["EFPauseElement"],"sources":["../../src/gui/Pause.ts"],"sourcesContent":["import { EFPause as EFPauseElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const Pause = createComponent({\n tagName: \"ef-pause\",\n elementClass: EFPauseElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,QAAQ,gBAAgB;CACnC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/Play.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFPlay } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/Play.d.ts
|
|
5
|
+
declare const Play: ReactWebComponent<EFPlay, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Play };
|
|
8
|
+
//# sourceMappingURL=Play.d.ts.map
|
package/dist/gui/Play.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFPlay } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/Play.ts
|
|
4
6
|
const Play = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-play",
|
|
8
|
+
elementClass: EFPlay,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Play };
|
|
14
|
+
//# sourceMappingURL=Play.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Play.js","names":["EFPlayElement"],"sources":["../../src/gui/Play.ts"],"sourcesContent":["import { EFPlay as EFPlayElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const Play = createComponent({\n tagName: \"ef-play\",\n elementClass: EFPlayElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,OAAO,gBAAgB;CAClC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/Preview.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFPreview } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/Preview.d.ts
|
|
5
|
+
declare const Preview: ReactWebComponent<EFPreview, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Preview };
|
|
8
|
+
//# sourceMappingURL=Preview.d.ts.map
|
package/dist/gui/Preview.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFPreview } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/Preview.ts
|
|
4
6
|
const Preview = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-preview",
|
|
8
|
+
elementClass: EFPreview,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Preview };
|
|
14
|
+
//# sourceMappingURL=Preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Preview.js","names":["EFPreviewElement"],"sources":["../../src/gui/Preview.ts"],"sourcesContent":["import { EFPreview as EFPreviewElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const Preview = createComponent({\n tagName: \"ef-preview\",\n elementClass: EFPreviewElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,UAAU,gBAAgB;CACrC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/Scrubber.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFScrubber } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/Scrubber.d.ts
|
|
5
|
+
declare const Scrubber: ReactWebComponent<EFScrubber, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Scrubber };
|
|
8
|
+
//# sourceMappingURL=Scrubber.d.ts.map
|
package/dist/gui/Scrubber.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFScrubber } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/Scrubber.ts
|
|
4
6
|
const Scrubber = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-scrubber",
|
|
8
|
+
elementClass: EFScrubber,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Scrubber };
|
|
14
|
+
//# sourceMappingURL=Scrubber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scrubber.js","names":["EFScrubberElement"],"sources":["../../src/gui/Scrubber.ts"],"sourcesContent":["import { EFScrubber as EFScrubberElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const Scrubber = createComponent({\n tagName: \"ef-scrubber\",\n elementClass: EFScrubberElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,WAAW,gBAAgB;CACtC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/ToggleLoop.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFToggleLoop } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/ToggleLoop.d.ts
|
|
5
|
+
declare const ToggleLoop: ReactWebComponent<EFToggleLoop, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { ToggleLoop };
|
|
8
|
+
//# sourceMappingURL=ToggleLoop.d.ts.map
|
package/dist/gui/ToggleLoop.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFToggleLoop } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/ToggleLoop.ts
|
|
4
6
|
const ToggleLoop = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-toggle-loop",
|
|
8
|
+
elementClass: EFToggleLoop,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ToggleLoop };
|
|
14
|
+
//# sourceMappingURL=ToggleLoop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleLoop.js","names":["EFToggleLoopElement"],"sources":["../../src/gui/ToggleLoop.ts"],"sourcesContent":["import { EFToggleLoop as EFToggleLoopElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const ToggleLoop = createComponent({\n tagName: \"ef-toggle-loop\",\n elementClass: EFToggleLoopElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,aAAa,gBAAgB;CACxC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/TogglePlay.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFTogglePlay } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/TogglePlay.d.ts
|
|
5
|
+
declare const TogglePlay: ReactWebComponent<EFTogglePlay, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { TogglePlay };
|
|
8
|
+
//# sourceMappingURL=TogglePlay.d.ts.map
|
package/dist/gui/TogglePlay.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFTogglePlay } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/TogglePlay.ts
|
|
4
6
|
const TogglePlay = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-toggle-play",
|
|
8
|
+
elementClass: EFTogglePlay,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TogglePlay };
|
|
14
|
+
//# sourceMappingURL=TogglePlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TogglePlay.js","names":["EFTogglePlayElement"],"sources":["../../src/gui/TogglePlay.ts"],"sourcesContent":["import { EFTogglePlay as EFTogglePlayElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const TogglePlay = createComponent({\n tagName: \"ef-toggle-play\",\n elementClass: EFTogglePlayElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,aAAa,gBAAgB;CACxC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
package/dist/gui/Workbench.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReactWebComponent } from "../hooks/create-element.js";
|
|
2
|
+
import { EFWorkbench } from "@editframe/elements";
|
|
3
|
+
|
|
4
|
+
//#region src/gui/Workbench.d.ts
|
|
5
|
+
declare const Workbench: ReactWebComponent<EFWorkbench, {}>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Workbench };
|
|
8
|
+
//# sourceMappingURL=Workbench.d.ts.map
|
package/dist/gui/Workbench.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { createComponent } from "../hooks/create-element.js";
|
|
1
2
|
import { EFWorkbench } from "@editframe/elements";
|
|
2
3
|
import React from "react";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/gui/Workbench.ts
|
|
4
6
|
const Workbench = createComponent({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
tagName: "ef-workbench",
|
|
8
|
+
elementClass: EFWorkbench,
|
|
9
|
+
react: React
|
|
8
10
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Workbench };
|
|
14
|
+
//# sourceMappingURL=Workbench.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workbench.js","names":["EFWorkbenchElement"],"sources":["../../src/gui/Workbench.ts"],"sourcesContent":["import { EFWorkbench as EFWorkbenchElement } from \"@editframe/elements\";\nimport React from \"react\";\nimport { createComponent } from \"../hooks/create-element\";\n\nexport const Workbench = createComponent({\n tagName: \"ef-workbench\",\n elementClass: EFWorkbenchElement,\n react: React,\n});\n"],"mappings":";;;;;AAIA,MAAa,YAAY,gBAAgB;CACvC,SAAS;CACT,cAAcA;CACd,OAAO;CACR,CAAC"}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/create-element.d.ts
|
|
4
|
+
|
|
6
5
|
type EventNames = Record<string, string>;
|
|
7
|
-
type EventListeners<E extends EventNames> = {
|
|
8
|
-
[K in keyof E]?: (e: Event) => void;
|
|
9
|
-
};
|
|
6
|
+
type EventListeners<E extends EventNames> = { [K in keyof E]?: (e: Event) => void };
|
|
10
7
|
type ElementProps<I> = Partial<Omit<I, keyof HTMLElement>>;
|
|
11
8
|
type ComponentProps<I, E extends EventNames = {}> = Omit<React.HTMLAttributes<I>, keyof E | keyof ElementProps<I>> & EventListeners<E> & ElementProps<I>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
elementClass: Constructor<I>;
|
|
17
|
-
events?: E;
|
|
18
|
-
displayName?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare function createComponent<I extends HTMLElement, E extends EventNames = {}>({ react: React, tagName, elementClass, events, displayName, }: Options<I, E>): ReactWebComponent<I, E>;
|
|
21
|
-
export {};
|
|
9
|
+
type ReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = React.ForwardRefExoticComponent<ComponentProps<I, E> & React.RefAttributes<I>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ReactWebComponent };
|
|
12
|
+
//# sourceMappingURL=create-element.d.ts.map
|
|
@@ -1,103 +1,81 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/create-element.ts
|
|
2
4
|
let isomorphicEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
3
|
-
const reservedReactProperties =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const reservedReactProperties = new Set([
|
|
6
|
+
"children",
|
|
7
|
+
"localName",
|
|
8
|
+
"ref",
|
|
9
|
+
"style",
|
|
10
|
+
"className"
|
|
9
11
|
]);
|
|
10
12
|
const listenedEvents = /* @__PURE__ */ new WeakMap();
|
|
11
13
|
function addOrUpdateEventListener(node, event, listener) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
events.delete(event);
|
|
28
|
-
node.removeEventListener(event, handler);
|
|
29
|
-
}
|
|
14
|
+
let events = listenedEvents.get(node);
|
|
15
|
+
if (!events) {
|
|
16
|
+
events = /* @__PURE__ */ new Map();
|
|
17
|
+
listenedEvents.set(node, events);
|
|
18
|
+
}
|
|
19
|
+
let handler = events.get(event);
|
|
20
|
+
if (listener) if (!handler) {
|
|
21
|
+
handler = { handleEvent: listener };
|
|
22
|
+
events.set(event, handler);
|
|
23
|
+
node.addEventListener(event, handler);
|
|
24
|
+
} else handler.handleEvent = listener;
|
|
25
|
+
else if (handler) {
|
|
26
|
+
events.delete(event);
|
|
27
|
+
node.removeEventListener(event, handler);
|
|
28
|
+
}
|
|
30
29
|
}
|
|
31
30
|
function setProperty(node, name, value, old, events) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if ((value === void 0 || value === null) && name in HTMLElement.prototype) {
|
|
40
|
-
node.removeAttribute(name);
|
|
41
|
-
}
|
|
31
|
+
const event = events?.[name];
|
|
32
|
+
if (event) {
|
|
33
|
+
if (value !== old) addOrUpdateEventListener(node, event, value);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
node[name] = value;
|
|
37
|
+
if ((value === void 0 || value === null) && name in HTMLElement.prototype) node.removeAttribute(name);
|
|
42
38
|
}
|
|
43
|
-
function createComponent({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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;
|
|
39
|
+
function createComponent({ react: React$1, tagName, elementClass, events, displayName }) {
|
|
40
|
+
const eventProps = new Set(Object.keys(events ?? {}));
|
|
41
|
+
const ReactComponent = React$1.forwardRef((props, ref) => {
|
|
42
|
+
const elementRef = React$1.useRef(null);
|
|
43
|
+
const prevPropsRef = React$1.useRef(/* @__PURE__ */ new Map());
|
|
44
|
+
const reactProps = { suppressHydrationWarning: true };
|
|
45
|
+
const elementProps = {};
|
|
46
|
+
for (const [k, v] of Object.entries(props)) {
|
|
47
|
+
if (reservedReactProperties.has(k)) {
|
|
48
|
+
reactProps[k === "className" ? "class" : k] = v;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (eventProps.has(k) || k in elementClass.prototype) elementProps[k] = v;
|
|
52
|
+
reactProps[k] = v;
|
|
53
|
+
}
|
|
54
|
+
isomorphicEffect(() => {
|
|
55
|
+
if (!elementRef.current) return;
|
|
56
|
+
const newProps = /* @__PURE__ */ new Map();
|
|
57
|
+
for (const key in elementProps) {
|
|
58
|
+
setProperty(elementRef.current, key, props[key], prevPropsRef.current.get(key), events);
|
|
59
|
+
prevPropsRef.current.delete(key);
|
|
60
|
+
newProps.set(key, props[key]);
|
|
61
|
+
}
|
|
62
|
+
for (const [key, value] of prevPropsRef.current) setProperty(elementRef.current, key, void 0, value, events);
|
|
63
|
+
prevPropsRef.current = newProps;
|
|
64
|
+
elementRef.current.removeAttribute("defer-hydration");
|
|
65
|
+
}, [props]);
|
|
66
|
+
return React$1.createElement(tagName, {
|
|
67
|
+
...reactProps,
|
|
68
|
+
ref: (node) => {
|
|
69
|
+
elementRef.current = node;
|
|
70
|
+
if (typeof ref === "function") ref(node);
|
|
71
|
+
else if (ref) ref.current = node;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
ReactComponent.displayName = displayName ?? elementClass.name;
|
|
76
|
+
return ReactComponent;
|
|
100
77
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { createComponent };
|
|
81
|
+
//# sourceMappingURL=create-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element.js","names":["React","reactProps: Record<string, unknown>","elementProps: Record<string, unknown>"],"sources":["../../src/hooks/create-element.ts"],"sourcesContent":["import React from \"react\";\n\nlet isomorphicEffect =\n typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\n\nexport function setIsomorphicEffect(\n effect: typeof React.useLayoutEffect | typeof React.useEffect,\n) {\n isomorphicEffect = effect;\n}\n\nconst reservedReactProperties = new Set([\n \"children\",\n \"localName\",\n \"ref\",\n \"style\",\n \"className\",\n]);\nconst listenedEvents = new WeakMap<Element, Map<string, EventListenerObject>>();\n\ntype Constructor<T> = { new (): T };\ntype EventNames = Record<string, string>;\n\ntype EventListeners<E extends EventNames> = {\n [K in keyof E]?: (e: Event) => void;\n};\n\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>>;\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\nexport type ReactWebComponent<\n I extends HTMLElement,\n E extends EventNames = {},\n> = React.ForwardRefExoticComponent<\n ComponentProps<I, E> & React.RefAttributes<I>\n>;\n\nexport interface Options<I extends HTMLElement, E extends EventNames = {}> {\n react: typeof React;\n tagName: string;\n elementClass: Constructor<I>;\n events?: E;\n displayName?: string;\n}\n\nfunction addOrUpdateEventListener(\n node: Element,\n event: string,\n listener?: (e?: Event) => void,\n) {\n let events = listenedEvents.get(node);\n if (!events) {\n events = new Map();\n listenedEvents.set(node, events);\n }\n let handler = events.get(event);\n\n if (listener) {\n if (!handler) {\n handler = { handleEvent: listener };\n events.set(event, handler);\n node.addEventListener(event, handler);\n } else {\n handler.handleEvent = listener;\n }\n } else if (handler) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n}\n\nfunction setProperty<E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: EventNames,\n) {\n const event = events?.[name];\n if (event) {\n if (value !== old)\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n return;\n }\n node[name as keyof E] = value as E[keyof E];\n if (\n (value === undefined || value === null) &&\n name in HTMLElement.prototype\n ) {\n node.removeAttribute(name);\n }\n}\n\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = {},\n>({\n react: React,\n tagName,\n elementClass,\n events,\n displayName,\n}: Options<I, E>): ReactWebComponent<I, E> {\n const eventProps = new Set(Object.keys(events ?? {}));\n\n const ReactComponent = React.forwardRef<I, ComponentProps<I, E>>(\n (props, ref) => {\n const elementRef = React.useRef<I | null>(null);\n const prevPropsRef = React.useRef(new Map<string, unknown>());\n\n const reactProps: Record<string, unknown> = {\n suppressHydrationWarning: true,\n };\n const elementProps: Record<string, unknown> = {};\n\n for (const [k, v] of Object.entries(props)) {\n if (reservedReactProperties.has(k)) {\n reactProps[k === \"className\" ? \"class\" : k] = v;\n continue;\n }\n if (eventProps.has(k) || k in elementClass.prototype)\n elementProps[k] = v;\n reactProps[k] = v;\n }\n\n isomorphicEffect(() => {\n if (!elementRef.current) return;\n const newProps = new Map<string, unknown>();\n for (const key in elementProps) {\n setProperty(\n elementRef.current,\n key,\n props[key as keyof typeof props],\n prevPropsRef.current.get(key),\n events,\n );\n prevPropsRef.current.delete(key);\n newProps.set(key, props[key as keyof typeof props]);\n }\n for (const [key, value] of prevPropsRef.current) {\n setProperty(elementRef.current, key, undefined, value, events);\n }\n prevPropsRef.current = newProps;\n\n // Remove defer-hydration if present\n elementRef.current.removeAttribute(\"defer-hydration\");\n }, [props]);\n\n return React.createElement(tagName, {\n ...reactProps,\n ref: (node: I) => {\n elementRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n });\n },\n );\n\n ReactComponent.displayName = displayName ?? elementClass.name;\n return ReactComponent as ReactWebComponent<I, E>;\n}\n"],"mappings":";;;AAEA,IAAI,mBACF,OAAO,WAAW,cAAc,MAAM,kBAAkB,MAAM;AAQhE,MAAM,0BAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACD,CAAC;AACF,MAAM,iCAAiB,IAAI,SAAoD;AAgC/E,SAAS,yBACP,MACA,OACA,UACA;CACA,IAAI,SAAS,eAAe,IAAI,KAAK;AACrC,KAAI,CAAC,QAAQ;AACX,2BAAS,IAAI,KAAK;AAClB,iBAAe,IAAI,MAAM,OAAO;;CAElC,IAAI,UAAU,OAAO,IAAI,MAAM;AAE/B,KAAI,SACF,KAAI,CAAC,SAAS;AACZ,YAAU,EAAE,aAAa,UAAU;AACnC,SAAO,IAAI,OAAO,QAAQ;AAC1B,OAAK,iBAAiB,OAAO,QAAQ;OAErC,SAAQ,cAAc;UAEf,SAAS;AAClB,SAAO,OAAO,MAAM;AACpB,OAAK,oBAAoB,OAAO,QAAQ;;;AAI5C,SAAS,YACP,MACA,MACA,OACA,KACA,QACA;CACA,MAAM,QAAQ,SAAS;AACvB,KAAI,OAAO;AACT,MAAI,UAAU,IACZ,0BAAyB,MAAM,OAAO,MAA6B;AACrE;;AAEF,MAAK,QAAmB;AACxB,MACG,UAAU,UAAa,UAAU,SAClC,QAAQ,YAAY,UAEpB,MAAK,gBAAgB,KAAK;;AAI9B,SAAgB,gBAGd,EACA,OAAOA,SACP,SACA,cACA,QACA,eACyC;CACzC,MAAM,aAAa,IAAI,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC,CAAC;CAErD,MAAM,iBAAiBA,QAAM,YAC1B,OAAO,QAAQ;EACd,MAAM,aAAaA,QAAM,OAAiB,KAAK;EAC/C,MAAM,eAAeA,QAAM,uBAAO,IAAI,KAAsB,CAAC;EAE7D,MAAMC,aAAsC,EAC1C,0BAA0B,MAC3B;EACD,MAAMC,eAAwC,EAAE;AAEhD,OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,EAAE;AAC1C,OAAI,wBAAwB,IAAI,EAAE,EAAE;AAClC,eAAW,MAAM,cAAc,UAAU,KAAK;AAC9C;;AAEF,OAAI,WAAW,IAAI,EAAE,IAAI,KAAK,aAAa,UACzC,cAAa,KAAK;AACpB,cAAW,KAAK;;AAGlB,yBAAuB;AACrB,OAAI,CAAC,WAAW,QAAS;GACzB,MAAM,2BAAW,IAAI,KAAsB;AAC3C,QAAK,MAAM,OAAO,cAAc;AAC9B,gBACE,WAAW,SACX,KACA,MAAM,MACN,aAAa,QAAQ,IAAI,IAAI,EAC7B,OACD;AACD,iBAAa,QAAQ,OAAO,IAAI;AAChC,aAAS,IAAI,KAAK,MAAM,KAA2B;;AAErD,QAAK,MAAM,CAAC,KAAK,UAAU,aAAa,QACtC,aAAY,WAAW,SAAS,KAAK,QAAW,OAAO,OAAO;AAEhE,gBAAa,UAAU;AAGvB,cAAW,QAAQ,gBAAgB,kBAAkB;KACpD,CAAC,MAAM,CAAC;AAEX,SAAOF,QAAM,cAAc,SAAS;GAClC,GAAG;GACH,MAAM,SAAY;AAChB,eAAW,UAAU;AACrB,QAAI,OAAO,QAAQ,WAAY,KAAI,KAAK;aAC/B,IAAK,KAAI,UAAU;;GAE/B,CAAC;GAEL;AAED,gBAAe,cAAc,eAAe,aAAa;AACzD,QAAO"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { EFTimegroup } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { EFTimegroup } from "@editframe/elements";
|
|
2
|
+
import * as react0 from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/hooks/useTimingInfo.d.ts
|
|
5
|
+
declare const useTimingInfo: (timegroupRef?: React.RefObject<EFTimegroup>) => {
|
|
6
|
+
ref: react0.RefObject<EFTimegroup>;
|
|
7
|
+
ownCurrentTimeMs: number;
|
|
8
|
+
durationMs: number;
|
|
9
|
+
percentComplete: number;
|
|
7
10
|
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useTimingInfo };
|
|
13
|
+
//# sourceMappingURL=useTimingInfo.d.ts.map
|