egaki 0.7.2 → 0.9.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/CHANGELOG.md +52 -0
- package/dist/cli/bpm-detect.d.ts +7 -0
- package/dist/cli/bpm-detect.d.ts.map +1 -0
- package/dist/cli/bpm-detect.js +123 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +115 -0
- package/dist/cli/loudness-detect.d.ts +13 -0
- package/dist/cli/loudness-detect.d.ts.map +1 -0
- package/dist/cli/loudness-detect.js +96 -0
- package/dist/vite/angled-screen-shader.d.ts +45 -0
- package/dist/vite/angled-screen-shader.d.ts.map +1 -0
- package/dist/vite/angled-screen-shader.js +573 -0
- package/dist/vite/angled-screen.d.ts +12 -3
- package/dist/vite/angled-screen.d.ts.map +1 -1
- package/dist/vite/angled-screen.js +12 -3
- package/dist/vite/code-block.d.ts.map +1 -1
- package/dist/vite/code-block.js +26 -5
- package/dist/vite/layout-editor.js +1 -1
- package/dist/vite/mdx-video.d.ts +4 -2
- package/dist/vite/mdx-video.d.ts.map +1 -1
- package/dist/vite/mdx-video.js +4 -2
- package/dist/vite/mdx-video.test.js +1 -79
- package/dist/vite/player-page.d.ts.map +1 -1
- package/dist/vite/player-page.js +6 -94
- package/dist/vite/render-client.d.ts +27 -0
- package/dist/vite/render-client.d.ts.map +1 -1
- package/dist/vite/render-client.js +47 -51
- package/dist/vite/sdk.d.ts.map +1 -1
- package/dist/vite/sdk.js +4 -3
- package/dist/vite/shader-renderer.d.ts +4 -0
- package/dist/vite/shader-renderer.d.ts.map +1 -1
- package/dist/vite/shader-renderer.js +3 -3
- package/dist/vite/store-hooks.d.ts +2 -0
- package/dist/vite/store-hooks.d.ts.map +1 -1
- package/dist/vite/store-hooks.js +8 -0
- package/dist/vite/store.d.ts +5 -0
- package/dist/vite/store.d.ts.map +1 -1
- package/dist/vite/store.js +5 -0
- package/dist/vite/tweakpane-hook.d.ts +12 -3
- package/dist/vite/tweakpane-hook.d.ts.map +1 -1
- package/dist/vite/tweakpane-hook.js +128 -20
- package/dist/vite/vite-plugin.d.ts +0 -6
- package/dist/vite/vite-plugin.d.ts.map +1 -1
- package/dist/vite/vite-plugin.js +1 -92
- package/package.json +9 -6
- package/skills/egaki/SKILL.md +26 -224
- package/src/cli/bpm-detect.ts +165 -0
- package/src/cli/cli.ts +149 -0
- package/src/cli/loudness-detect.ts +129 -0
- package/src/vite/angled-screen-shader.tsx +706 -0
- package/src/vite/angled-screen.tsx +13 -4
- package/src/vite/code-block.tsx +28 -6
- package/src/vite/layout-editor.tsx +1 -1
- package/src/vite/mdx-video.test.tsx +1 -94
- package/src/vite/mdx-video.tsx +4 -1
- package/src/vite/player-page.tsx +28 -117
- package/src/vite/render-client.ts +52 -51
- package/src/vite/sdk.ts +4 -3
- package/src/vite/shader-renderer.tsx +3 -3
- package/src/vite/store-hooks.ts +11 -0
- package/src/vite/store.ts +10 -0
- package/src/vite/tweakpane-hook.tsx +173 -28
- package/src/vite/vite-plugin.ts +1 -91
package/dist/vite/code-block.js
CHANGED
|
@@ -31,8 +31,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
31
31
|
* - Supabase frame: https://github.com/raycast/ray-so/blob/main/app/(navigation)/(code)/components/frames/SupabaseFrame.tsx
|
|
32
32
|
* - Cloudflare frame: https://github.com/raycast/ray-so/blob/main/app/(navigation)/(code)/components/frames/CloudflareFrame.tsx
|
|
33
33
|
*/
|
|
34
|
-
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
35
|
-
import { interpolate, spring, useCurrentFrame, useVideoConfig } from 'remotion';
|
|
34
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
|
35
|
+
import { interpolate, spring, useCurrentFrame, useDelayRender, useVideoConfig } from 'remotion';
|
|
36
36
|
import { useTweakpane } from "./tweakpane-hook.js";
|
|
37
37
|
// ---------------------------------------------------------------------------
|
|
38
38
|
// Nesting guard
|
|
@@ -328,11 +328,28 @@ function detectLanguage(title, language) {
|
|
|
328
328
|
// ---------------------------------------------------------------------------
|
|
329
329
|
function useHighlightedHtml(code, lang, highlightLines) {
|
|
330
330
|
const [html, setHtml] = useState('');
|
|
331
|
-
|
|
331
|
+
const { delayRender, continueRender } = useDelayRender();
|
|
332
|
+
// delayRender registered during the first render (useState initializer) and
|
|
333
|
+
// continued only AFTER the highlighted html has been committed to the DOM
|
|
334
|
+
// (layout effect below). Continuing from inside the shiki .then() is too
|
|
335
|
+
// early: React batches the setHtml update, so the renderer could capture the
|
|
336
|
+
// frame between continueRender and the commit, producing an empty block in
|
|
337
|
+
// screenshots/filmstrips/exports.
|
|
338
|
+
const [handle] = useState(() => delayRender('shiki highlight'));
|
|
339
|
+
useLayoutEffect(() => {
|
|
340
|
+
if (html)
|
|
341
|
+
continueRender(handle);
|
|
342
|
+
}, [html, handle, continueRender]);
|
|
343
|
+
// Unmount safety: never leave a dangling handle.
|
|
344
|
+
useLayoutEffect(() => {
|
|
345
|
+
return () => continueRender(handle);
|
|
346
|
+
}, [handle, continueRender]);
|
|
347
|
+
useLayoutEffect(() => {
|
|
332
348
|
let cancelled = false;
|
|
333
349
|
void getHighlighter().then((h) => {
|
|
334
|
-
if (cancelled)
|
|
350
|
+
if (cancelled) {
|
|
335
351
|
return;
|
|
352
|
+
}
|
|
336
353
|
// Load language on demand if not already loaded
|
|
337
354
|
const loaded = h.getLoadedLanguages();
|
|
338
355
|
const langToUse = loaded.includes(lang) ? lang : 'tsx';
|
|
@@ -353,8 +370,12 @@ function useHighlightedHtml(code, lang, highlightLines) {
|
|
|
353
370
|
});
|
|
354
371
|
if (!cancelled)
|
|
355
372
|
setHtml(result);
|
|
373
|
+
}).catch(() => {
|
|
374
|
+
continueRender(handle);
|
|
356
375
|
});
|
|
357
|
-
return () => {
|
|
376
|
+
return () => {
|
|
377
|
+
cancelled = true;
|
|
378
|
+
};
|
|
358
379
|
}, [code, lang, highlightLines.join(',')]);
|
|
359
380
|
return html;
|
|
360
381
|
}
|
|
@@ -583,5 +583,5 @@ export function LayoutEditor({ playerContainerRef, playerRef, editing, onEditing
|
|
|
583
583
|
setSelectedEl(null);
|
|
584
584
|
onReset();
|
|
585
585
|
}, [onReset]);
|
|
586
|
-
return (_jsxs("div", { "data-layout-editor-toolbar": true, className: 'flex items-center gap-1.5 text-[13px]', children: [_jsx(ToolbarButton, { onClick: () => onEditingChange(!editing), active: editing, title: editing ? 'Exit editing mode' : 'Edit layout — click to select, drag to move, corners to scale, double-click text to edit', children: editing ? '
|
|
586
|
+
return (_jsxs("div", { "data-layout-editor-toolbar": true, className: 'flex items-center gap-1.5 text-[13px]', children: [_jsx(ToolbarButton, { onClick: () => onEditingChange(!editing), active: editing, title: editing ? 'Exit editing mode' : 'Edit layout — click to select, drag to move, corners to scale, double-click text to edit', children: editing ? 'Editing' : 'Edit' }), editing && changesCount > 0 && (_jsxs(_Fragment, { children: [_jsx(ToolbarButton, { onClick: handleCopy, title: 'Copy changes for an AI agent', children: copied ? 'Copied!' : `Copy ${changesCount} change${changesCount > 1 ? 's' : ''}` }), _jsx(ToolbarButton, { onClick: handleReset, title: 'Revert all changes', children: "Reset" })] })), editing && !selectedEl && (_jsx("span", { className: 'text-zinc-600 italic', children: "Click an element" }))] }));
|
|
587
587
|
}
|
package/dist/vite/mdx-video.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ import type { SafeMdxError } from 'safe-mdx';
|
|
|
14
14
|
import type { EagerModules } from 'safe-mdx/parse';
|
|
15
15
|
import { splitIntoSections, calculateTotalDuration, resolveAutoDurations, type MdxSection, type SplitResult, type VideoFrontmatter } from './mdx-parse.ts';
|
|
16
16
|
import { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep } from './components.tsx';
|
|
17
|
-
import {
|
|
17
|
+
import { BasicAngledScreen } from './angled-screen.tsx';
|
|
18
|
+
import { AngledScreen } from './angled-screen-shader.tsx';
|
|
18
19
|
import { CodeBlock, CODE_THEMES } from './code-block.tsx';
|
|
19
20
|
import { BandsShader } from './bands-shader.tsx';
|
|
20
21
|
import { WaveGradientShader } from './wave-gradient-shader.tsx';
|
|
@@ -286,7 +287,7 @@ export { LayoutContainerContext, LayoutTransition, LayoutTransitionProvider, Lay
|
|
|
286
287
|
import { LayoutTransition } from './layout-transition.tsx';
|
|
287
288
|
import { Img, Audio, Video } from './media-components.tsx';
|
|
288
289
|
export { ExportContext, useIsExporting, Img, Audio, Video } from './media-components.tsx';
|
|
289
|
-
export { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep, AngledScreen, CodeBlock, CODE_THEMES, BandsShader, WaveGradientShader, LiquidGradientShader, DispersionRingsShader, };
|
|
290
|
+
export { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep, AngledScreen, BasicAngledScreen, CodeBlock, CODE_THEMES, BandsShader, WaveGradientShader, LiquidGradientShader, DispersionRingsShader, };
|
|
290
291
|
/** Built-in JSX names available in MDX without user imports. Shared by
|
|
291
292
|
* client rendering (mdx-client.tsx) and <Server> slot rendering (app.tsx).
|
|
292
293
|
* Add new presentation components here once — not in app.tsx / mdx-client. */
|
|
@@ -303,6 +304,7 @@ export declare const MDX_BUILTIN_COMPONENTS: {
|
|
|
303
304
|
readonly Background: typeof Background;
|
|
304
305
|
readonly LayoutTransition: typeof LayoutTransition;
|
|
305
306
|
readonly AngledScreen: typeof AngledScreen;
|
|
307
|
+
readonly BasicAngledScreen: typeof BasicAngledScreen;
|
|
306
308
|
readonly BandsShader: import("react").FC<import("./bands-shader.tsx").BandsShaderProps>;
|
|
307
309
|
readonly WaveGradientShader: import("react").FC<import("./wave-gradient-shader.tsx").WaveGradientShaderProps>;
|
|
308
310
|
readonly LiquidGradientShader: import("react").FC<import("./liquid-gradient-shader.tsx").LiquidGradientShaderProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-video.d.ts","sourceRoot":"","sources":["../../src/vite/mdx-video.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mdx-video.d.ts","sourceRoot":"","sources":["../../src/vite/mdx-video.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;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AAO1D,OAAO,EAAiC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAIzF,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,GACtB,CAAA;AAED;;+EAE+E;AAC/E;;;4DAG4D;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,yBAAyB,CAAA;AAChC,iBAAS,cAAc,CAAC,MAAM,EAAE,mBAAmB,QAAiB;AACpE,iBAAS,cAAc,CAAC,MAAM,EAAE,mBAAmB,QAAiB;AACpE,iBAAS,eAAe,CAAC,MAAM,EAAE,oBAAoB,QAAiB;AAEtE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BzB,CAAA"}
|
package/dist/vite/mdx-video.js
CHANGED
|
@@ -14,7 +14,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { createContext, useContext, useId, useInsertionEffect, useLayoutEffect } from 'react';
|
|
15
15
|
import { splitIntoSections, calculateTotalDuration, resolveAutoDurations, } from "./mdx-parse.js";
|
|
16
16
|
import { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep, } from "./components.js";
|
|
17
|
-
import {
|
|
17
|
+
import { BasicAngledScreen } from "./angled-screen.js";
|
|
18
|
+
import { AngledScreen } from "./angled-screen-shader.js";
|
|
18
19
|
import { CodeBlock, CODE_THEMES } from "./code-block.js";
|
|
19
20
|
import { BandsShader } from "./bands-shader.js";
|
|
20
21
|
import { WaveGradientShader } from "./wave-gradient-shader.js";
|
|
@@ -564,7 +565,7 @@ import { ExportContext, useIsExporting, Img, Audio, Video } from "./media-compon
|
|
|
564
565
|
export { ExportContext, useIsExporting, Img, Audio, Video } from "./media-components.js";
|
|
565
566
|
// Visual components and animations are re-exported so they're available
|
|
566
567
|
// as named imports from this client module for MDX usage.
|
|
567
|
-
export { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep, AngledScreen, CodeBlock, CODE_THEMES, BandsShader, WaveGradientShader, LiquidGradientShader, DispersionRingsShader, };
|
|
568
|
+
export { BlurReveal, MaskedSlideReveal, StaggeredFadeUp, ShimmerSweep, AngledScreen, BasicAngledScreen, CodeBlock, CODE_THEMES, BandsShader, WaveGradientShader, LiquidGradientShader, DispersionRingsShader, };
|
|
568
569
|
function GeneratedImage(_props) { return null; }
|
|
569
570
|
function GeneratedVideo(_props) { return null; }
|
|
570
571
|
function GeneratedSpeech(_props) { return null; }
|
|
@@ -573,6 +574,7 @@ export const MDX_BUILTIN_COMPONENTS = {
|
|
|
573
574
|
Background,
|
|
574
575
|
LayoutTransition,
|
|
575
576
|
AngledScreen,
|
|
577
|
+
BasicAngledScreen,
|
|
576
578
|
BandsShader,
|
|
577
579
|
WaveGradientShader,
|
|
578
580
|
LiquidGradientShader,
|
|
@@ -13,7 +13,6 @@ import { SafeMdxRenderer } from 'safe-mdx';
|
|
|
13
13
|
import { mdxParse, extractImports, resolveModulePath } from 'safe-mdx/parse';
|
|
14
14
|
import { MdastToJsx } from 'safe-mdx';
|
|
15
15
|
import { splitIntoSections, calculateTotalDuration, resolveAutoDurations, parseFrontmatter, aspectRatioFromDimensions, buildMdxScope } from "./mdx-parse.js";
|
|
16
|
-
import { findChangedSectionIndex } from "./vite-plugin.js";
|
|
17
16
|
import { computeEffectiveDuration } from "./media-duration-store.js";
|
|
18
17
|
import { findServerNodes, blankServerContents, collectServerImportSources, wrapGenerateNodes, collectServerFileImportNames } from "./server-mdx.js";
|
|
19
18
|
import { stableJsonKey, hashKey, promptPrefix } from "./server-components.js";
|
|
@@ -26,6 +25,7 @@ describe('MDX_BUILTIN_COMPONENTS', () => {
|
|
|
26
25
|
"Audio",
|
|
27
26
|
"Background",
|
|
28
27
|
"BandsShader",
|
|
28
|
+
"BasicAngledScreen",
|
|
29
29
|
"Blur",
|
|
30
30
|
"BlurReveal",
|
|
31
31
|
"CodeBlock",
|
|
@@ -1734,84 +1734,6 @@ describe('computeEffectiveDuration with startInFrames', () => {
|
|
|
1734
1734
|
expect(computeEffectiveDuration({ fps: 30, startInFrames: 30 })).toBeNull();
|
|
1735
1735
|
});
|
|
1736
1736
|
});
|
|
1737
|
-
describe('findChangedSectionIndex', () => {
|
|
1738
|
-
const base = [
|
|
1739
|
-
'---',
|
|
1740
|
-
'fps: 30',
|
|
1741
|
-
'bpm: 120',
|
|
1742
|
-
'---',
|
|
1743
|
-
'',
|
|
1744
|
-
'# Intro duration=3s',
|
|
1745
|
-
'',
|
|
1746
|
-
'Hello world',
|
|
1747
|
-
'',
|
|
1748
|
-
'# Middle duration=2s',
|
|
1749
|
-
'',
|
|
1750
|
-
'Some content here',
|
|
1751
|
-
'',
|
|
1752
|
-
'# Outro duration=1s',
|
|
1753
|
-
'',
|
|
1754
|
-
'Goodbye',
|
|
1755
|
-
].join('\n');
|
|
1756
|
-
test('identical content returns null', () => {
|
|
1757
|
-
expect(findChangedSectionIndex(base, base)).toBe(null);
|
|
1758
|
-
});
|
|
1759
|
-
test('editing first section returns 0', () => {
|
|
1760
|
-
const edited = base.replace('Hello world', 'Hello EDITED');
|
|
1761
|
-
expect(findChangedSectionIndex(base, edited)).toBe(0);
|
|
1762
|
-
});
|
|
1763
|
-
test('editing second section returns 1', () => {
|
|
1764
|
-
const edited = base.replace('Some content here', 'New content');
|
|
1765
|
-
expect(findChangedSectionIndex(base, edited)).toBe(1);
|
|
1766
|
-
});
|
|
1767
|
-
test('editing last section returns 2', () => {
|
|
1768
|
-
const edited = base.replace('Goodbye', 'See ya');
|
|
1769
|
-
expect(findChangedSectionIndex(base, edited)).toBe(2);
|
|
1770
|
-
});
|
|
1771
|
-
test('adding a new section returns its index', () => {
|
|
1772
|
-
const added = base + '\n\n# Bonus duration=1s\n\nExtra stuff';
|
|
1773
|
-
expect(findChangedSectionIndex(base, added)).toBe(3);
|
|
1774
|
-
});
|
|
1775
|
-
test('deleting last section returns null (skip deletions)', () => {
|
|
1776
|
-
const deleted = base.replace('\n# Outro duration=1s\n\nGoodbye', '');
|
|
1777
|
-
expect(findChangedSectionIndex(base, deleted)).toBe(null);
|
|
1778
|
-
});
|
|
1779
|
-
test('deleting middle section returns null (skip deletions)', () => {
|
|
1780
|
-
const deleted = base.replace('\n# Middle duration=2s\n\nSome content here\n', '\n');
|
|
1781
|
-
expect(findChangedSectionIndex(base, deleted)).toBe(null);
|
|
1782
|
-
});
|
|
1783
|
-
test('editing heading text returns that section index', () => {
|
|
1784
|
-
const edited = base.replace('# Middle duration=2s', '# Middle Renamed duration=2s');
|
|
1785
|
-
expect(findChangedSectionIndex(base, edited)).toBe(1);
|
|
1786
|
-
});
|
|
1787
|
-
test('preamble-only change returns null', () => {
|
|
1788
|
-
const withPreamble = '<Audio src="/bg.mp3" />\n\n' + base.split('\n').slice(4).join('\n');
|
|
1789
|
-
const oldPreamble = '---\nfps: 30\nbpm: 120\n---\n\n' + withPreamble;
|
|
1790
|
-
const newPreamble = oldPreamble.replace('/bg.mp3', '/new-bg.mp3');
|
|
1791
|
-
expect(findChangedSectionIndex(oldPreamble, newPreamble)).toBe(null);
|
|
1792
|
-
});
|
|
1793
|
-
test('frontmatter-only change returns null', () => {
|
|
1794
|
-
const edited = base.replace('fps: 30', 'fps: 60');
|
|
1795
|
-
expect(findChangedSectionIndex(base, edited)).toBe(null);
|
|
1796
|
-
});
|
|
1797
|
-
test('editing heading duration returns that section index', () => {
|
|
1798
|
-
const edited = base.replace('duration=3s', 'duration=4s');
|
|
1799
|
-
expect(findChangedSectionIndex(base, edited)).toBe(0);
|
|
1800
|
-
});
|
|
1801
|
-
test('editing heading transition returns that section index', () => {
|
|
1802
|
-
const old = '# Intro duration=3s transition=10\n\nHello';
|
|
1803
|
-
const edited = '# Intro duration=3s transition=20\n\nHello';
|
|
1804
|
-
expect(findChangedSectionIndex(old, edited)).toBe(0);
|
|
1805
|
-
});
|
|
1806
|
-
test('broken MDX returns null (does not throw)', () => {
|
|
1807
|
-
const valid = '# Intro duration=3s\n\nHello world';
|
|
1808
|
-
const broken = '# Intro duration=3s\n\n<Component';
|
|
1809
|
-
expect(findChangedSectionIndex(valid, broken)).toBe(null);
|
|
1810
|
-
});
|
|
1811
|
-
test('both sources broken returns null', () => {
|
|
1812
|
-
expect(findChangedSectionIndex('<Foo', '<Bar')).toBe(null);
|
|
1813
|
-
});
|
|
1814
|
-
});
|
|
1815
1737
|
// ---------------------------------------------------------------------------
|
|
1816
1738
|
// Parse error recovery
|
|
1817
1739
|
// ---------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player-page.d.ts","sourceRoot":"","sources":["../../src/vite/player-page.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,EAAyG,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AA2BpJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"player-page.d.ts","sourceRoot":"","sources":["../../src/vite/player-page.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,EAAyG,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AA2BpJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAkNtD,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,EAAE,SAAS,CAAA;CACf;AAyJD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,SAAS,EACT,sBAA8B,EAC9B,WAAW,EACX,gBAAqB,EACrB,YAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,YAAY,EAAE,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB;6DACyD;IACzD,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,WAAW,EAAE,gBAAgB,CAAA;IAC7B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,qBAykBA"}
|
package/dist/vite/player-page.js
CHANGED
|
@@ -17,26 +17,13 @@ import { AbsoluteFill, Freeze, Sequence, Series, useCurrentFrame, useDelayRender
|
|
|
17
17
|
import { renderInBrowser } from "./render-client.js";
|
|
18
18
|
import { createSpiceflowFetch } from 'spiceflow/client';
|
|
19
19
|
import { egakiStore } from "./store.js";
|
|
20
|
-
import { useGenerationStatus, useGenerationErrors } from "./store-hooks.js";
|
|
20
|
+
import { useGenerationStatus, useGenerationErrors, useSidebarOpen } from "./store-hooks.js";
|
|
21
21
|
import { egakiSDK } from "./sdk.js";
|
|
22
22
|
import { LayoutEditor } from "./layout-editor.js";
|
|
23
23
|
import { TweakpaneRoot, SIDEBAR_WIDTH } from "./tweakpane-hook.js";
|
|
24
24
|
import { Fill, LayoutAnimationLayer, LayoutGhost, LayoutTransitionProvider, MotionTimingSync, ServerSlotsContext, } from "./mdx-video.js";
|
|
25
25
|
import { SectionIndexContext } from "./media-duration-store.js";
|
|
26
26
|
// ---------------------------------------------------------------------------
|
|
27
|
-
// HMR scene-changed: store pending seek at module scope so it survives
|
|
28
|
-
// component remounts caused by rsc:update (spiceflow payload swap).
|
|
29
|
-
// The vite plugin sends egaki:scene-changed with { sectionIndex } when
|
|
30
|
-
// the user edits a specific section of the entry MDX.
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
let pendingSceneSeek = null;
|
|
33
|
-
/** Cancels the auto-pause listener from a previous scene-seek, so a new
|
|
34
|
-
* HMR during playback doesn't leave stale listeners that pause the wrong scene. */
|
|
35
|
-
let cancelPreviousAutoPlay = null;
|
|
36
|
-
/** Monotonic counter to invalidate stale requestAnimationFrame callbacks
|
|
37
|
-
* when rapid successive HMR edits arrive before the first rAF fires. */
|
|
38
|
-
let sceneSeekVersion = 0;
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
27
|
// Generation progress client — fetches /api/generation-progress on page
|
|
41
28
|
// load and on every rsc:update using the typed Spiceflow fetch client.
|
|
42
29
|
// The route is an async generator that yields progress events as SSE;
|
|
@@ -107,9 +94,6 @@ function connectToProgress() {
|
|
|
107
94
|
if (typeof window !== 'undefined')
|
|
108
95
|
connectToProgress();
|
|
109
96
|
if (import.meta.hot) {
|
|
110
|
-
import.meta.hot.on('egaki:scene-changed', (data) => {
|
|
111
|
-
pendingSceneSeek = data;
|
|
112
|
-
});
|
|
113
97
|
// Reconnect on rsc:update — new generations may have started from
|
|
114
98
|
// MDX edits that trigger server-side rendering of <Server> blocks.
|
|
115
99
|
import.meta.hot.on('rsc:update', () => {
|
|
@@ -291,79 +275,6 @@ export function PlayerPage({ sections, totalDuration, preamble, entryPath, hasUn
|
|
|
291
275
|
playerContainerRef,
|
|
292
276
|
});
|
|
293
277
|
}, [Component, totalDuration, sections, fps, width, height, scale]);
|
|
294
|
-
// Consume pending scene seek after the RSC refetch delivers new sections.
|
|
295
|
-
// The module-level pendingSceneSeek is set by import.meta.hot.on before
|
|
296
|
-
// React re-renders; this effect fires after the commit with fresh data.
|
|
297
|
-
// Seeks to the changed section's start frame, plays it, and pauses at
|
|
298
|
-
// the section's end so the user sees exactly the content they edited.
|
|
299
|
-
useEffect(() => {
|
|
300
|
-
if (pendingSceneSeek == null)
|
|
301
|
-
return;
|
|
302
|
-
// Ignore scene changes from a different entry MDX file.
|
|
303
|
-
if (pendingSceneSeek.file !== entryPath) {
|
|
304
|
-
pendingSceneSeek = null;
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
const idx = pendingSceneSeek.sectionIndex;
|
|
308
|
-
pendingSceneSeek = null;
|
|
309
|
-
// Wait one frame for the Remotion Player to initialize after remount.
|
|
310
|
-
// Version token ensures stale rAF callbacks from rapid edits are ignored.
|
|
311
|
-
const version = ++sceneSeekVersion;
|
|
312
|
-
requestAnimationFrame(() => {
|
|
313
|
-
if (version !== sceneSeekVersion)
|
|
314
|
-
return;
|
|
315
|
-
const player = playerRef.current;
|
|
316
|
-
if (!player || idx < 0 || idx >= sections.length)
|
|
317
|
-
return;
|
|
318
|
-
// Compute section boundaries from current sections
|
|
319
|
-
let startFrame = 0;
|
|
320
|
-
for (let i = 0; i < idx; i++) {
|
|
321
|
-
startFrame += sections[i].durationInFrames;
|
|
322
|
-
}
|
|
323
|
-
const endFrame = startFrame + sections[idx].durationInFrames - 1;
|
|
324
|
-
player.seekTo(startFrame);
|
|
325
|
-
// Cancel any auto-pause from a previous HMR scene-seek so stale
|
|
326
|
-
// listeners don't pause playback in the wrong section.
|
|
327
|
-
cancelPreviousAutoPlay?.();
|
|
328
|
-
cancelPreviousAutoPlay = null;
|
|
329
|
-
// Only auto-play if currently paused (after rsc:update remount
|
|
330
|
-
// the player always starts paused at frame 0)
|
|
331
|
-
if (!player.isPlaying()) {
|
|
332
|
-
player.play();
|
|
333
|
-
// Pause at section end so only the edited section plays.
|
|
334
|
-
// If the user manually seeks (clicks timeline, arrow keys, etc.)
|
|
335
|
-
// cancel the auto-pause so we don't randomly stop playback later.
|
|
336
|
-
let cancelled = false;
|
|
337
|
-
const cleanup = () => {
|
|
338
|
-
if (cancelled)
|
|
339
|
-
return;
|
|
340
|
-
cancelled = true;
|
|
341
|
-
cancelPreviousAutoPlay = null;
|
|
342
|
-
player.removeEventListener('frameupdate', onFrame);
|
|
343
|
-
player.removeEventListener('seeked', onSeek);
|
|
344
|
-
};
|
|
345
|
-
cancelPreviousAutoPlay = cleanup;
|
|
346
|
-
const onFrame = () => {
|
|
347
|
-
if (cancelled)
|
|
348
|
-
return;
|
|
349
|
-
if (player.getCurrentFrame() >= endFrame) {
|
|
350
|
-
player.pause();
|
|
351
|
-
cleanup();
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
const onSeek = (e) => {
|
|
355
|
-
// User seeked away — cancel auto-pause. Ignore seeks within
|
|
356
|
-
// the target section range (could be our own seekTo settling).
|
|
357
|
-
const frame = e?.detail?.frame ?? player.getCurrentFrame();
|
|
358
|
-
if (frame < startFrame || frame > endFrame) {
|
|
359
|
-
cleanup();
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
player.addEventListener('frameupdate', onFrame);
|
|
363
|
-
player.addEventListener('seeked', onSeek);
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
}, [sections]);
|
|
367
278
|
// Defer Player mount to client only. Remotion's Player and all composition
|
|
368
279
|
// components (Series, AbsoluteFill, Audio, Video) use React context provided
|
|
369
280
|
// by Player at runtime. During SSR there's no Remotion context, so hooks like
|
|
@@ -373,6 +284,7 @@ export function PlayerPage({ sections, totalDuration, preamble, entryPath, hasUn
|
|
|
373
284
|
const mounted = useSyncExternalStore(subscribeNoop, getClientMounted, getServerMounted);
|
|
374
285
|
const generationStatus = useGenerationStatus();
|
|
375
286
|
const generationErrors = useGenerationErrors();
|
|
287
|
+
const sidebarOpen = useSidebarOpen();
|
|
376
288
|
const [editing, setEditing] = useState(false);
|
|
377
289
|
const [resetKey, setResetKey] = useState(0);
|
|
378
290
|
const [rendering, setRendering] = useState(false);
|
|
@@ -702,9 +614,9 @@ export function PlayerPage({ sections, totalDuration, preamble, entryPath, hasUn
|
|
|
702
614
|
margin: 0,
|
|
703
615
|
lineHeight: 1.5,
|
|
704
616
|
}, children: error.stack || error.message })] }) })) }, resetKey)) : (_jsx("div", { className: 'aspect-video bg-[#050505]' })) }) }), _jsx(TweakpaneRoot, { playerRef: playerRef, fps: fps, sections: sections, entryPath: entryPath }), _jsxs("div", { className: 'fixed bottom-6 flex items-center gap-1.5 rounded-full bg-[#1c1c1c] border border-white/10 px-2 py-1.5 shadow-2xl', style: {
|
|
705
|
-
left: `calc((100% - ${SIDEBAR_WIDTH}px - 0.75rem) / 2)
|
|
617
|
+
left: sidebarOpen ? `calc((100% - ${SIDEBAR_WIDTH}px - 0.75rem) / 2)` : '50%',
|
|
706
618
|
transform: 'translateX(-50%)',
|
|
707
|
-
}, children: [availableEntries.length > 1 && (_jsxs(_Fragment, { children: [_jsx("select", { value: currentRoute, onChange: (e) => {
|
|
619
|
+
}, children: [_jsx("button", { onClick: goToPrevScene, disabled: !hasPrevScene, className: 'flex items-center justify-center rounded-full w-7 h-7 text-zinc-400 hover:text-zinc-200 hover:bg-white/5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default disabled:hover:bg-transparent disabled:hover:text-zinc-400', title: 'Previous scene (\u2193)', children: _jsx(ChevronDownIcon, {}) }), _jsx(ToolbarSeparator, {}), availableEntries.length > 1 && (_jsxs(_Fragment, { children: [_jsx("select", { value: currentRoute, onChange: (e) => {
|
|
708
620
|
const route = e.target.value;
|
|
709
621
|
const base = import.meta.env.BASE_URL ?? '/';
|
|
710
622
|
window.location.href = `${base}${route}`;
|
|
@@ -714,7 +626,7 @@ export function PlayerPage({ sections, totalDuration, preamble, entryPath, hasUn
|
|
|
714
626
|
const next = PLAYBACK_RATES[(idx + 1) % PLAYBACK_RATES.length];
|
|
715
627
|
return next;
|
|
716
628
|
});
|
|
717
|
-
}, className: 'flex items-center rounded-full px-2.5 py-1.5 text-[13px] font-medium tabular-nums text-zinc-400 hover:text-zinc-200 hover:bg-white/5 transition-colors cursor-pointer min-w-[3rem] justify-center', title: 'Playback speed (click to cycle)', children: playbackRate === 1 ? '1x' : `${playbackRate}x` }), _jsx(ToolbarSeparator, {}),
|
|
629
|
+
}, className: 'flex items-center rounded-full px-2.5 py-1.5 text-[13px] font-medium tabular-nums text-zinc-400 hover:text-zinc-200 hover:bg-white/5 transition-colors cursor-pointer min-w-[3rem] justify-center', title: 'Playback speed (click to cycle)', children: playbackRate === 1 ? '1x' : `${playbackRate}x` }), _jsx(ToolbarSeparator, {}), _jsx(LayoutEditor, { playerContainerRef: playerContainerRef, playerRef: playerRef, editing: editing, onEditingChange: setEditing, onReset: () => setResetKey((k) => k + 1), sections: sections, fps: fps, entryPath: entryPath }), generationStatus && (_jsxs(_Fragment, { children: [_jsx(ToolbarSeparator, {}), _jsxs("div", { className: 'flex items-center gap-1.5 px-2.5 py-1.5 text-[13px] font-medium text-amber-400/90', children: [_jsx(SpinnerIcon, {}), _jsx("span", { children: formatGenerationStatus(generationStatus) })] })] })), generationErrors.length > 0 && (_jsxs(_Fragment, { children: [_jsx(ToolbarSeparator, {}), _jsxs("div", { className: 'flex items-center gap-1.5 px-2.5 py-1.5 text-[13px] font-medium text-red-400/90', children: [_jsx("span", { style: { fontSize: 14, lineHeight: 1 }, children: "\u2715" }), _jsx("span", { children: generationErrors.length === 1
|
|
718
630
|
? `${generationErrors[0].namespace} failed: ${generationErrors[0].error.slice(0, 60)}`
|
|
719
|
-
: `${generationErrors.length} generations failed` })] })] }))] })] }));
|
|
631
|
+
: `${generationErrors.length} generations failed` })] })] })), _jsx(ToolbarSeparator, {}), _jsx("button", { onClick: goToNextScene, disabled: !hasNextScene, className: 'flex items-center justify-center rounded-full w-7 h-7 text-zinc-400 hover:text-zinc-200 hover:bg-white/5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default disabled:hover:bg-transparent disabled:hover:text-zinc-400', title: 'Next scene (\u2191)', children: _jsx(ChevronUpIcon, {}) })] })] }));
|
|
720
632
|
}
|
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
* via @remotion/web-renderer's renderMediaOnWeb().
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
|
+
/**
|
|
8
|
+
* Wrap a composition for web-renderer entry points (export, screenshot,
|
|
9
|
+
* filmstrip). The scaffold wrapper is visibility:hidden and Chromium creates
|
|
10
|
+
* no paint records for hidden subtrees, which breaks captureElementImage()
|
|
11
|
+
* inside nested <HtmlInCanvas> (AngledScreen): onInit/onPaint silently never
|
|
12
|
+
* run and exports come out flat. visibility is overridable by descendants,
|
|
13
|
+
* so a visibility:visible div at the composition root restores paint records
|
|
14
|
+
* for the whole tree while deeper visibility:hidden ancestors (e.g.
|
|
15
|
+
* LayoutTransition's inactive instances) keep hiding their subtrees
|
|
16
|
+
* relative to this root.
|
|
17
|
+
*
|
|
18
|
+
* Tradeoff (accepted): the scaffold sits at z-index:-9999, painting above
|
|
19
|
+
* the page's root background but below all in-flow content — so the
|
|
20
|
+
* rendering composition can peek through wherever the page shows only the
|
|
21
|
+
* body background. Hiding it differently is not possible:
|
|
22
|
+
* - opacity:0 / filter:opacity(0) bake into captureElementImage pixels
|
|
23
|
+
* (verified: capture succeeds but frames come out fully transparent)
|
|
24
|
+
* - translate/clip-path/resize on the scaffold break the drawElementImage
|
|
25
|
+
* paint pipeline (black frames — learned June 2026, commit e501ca5)
|
|
26
|
+
* - visibility:hidden kills paint records entirely (the original bug)
|
|
27
|
+
* An opaque page background or full-viewport player UI fully occludes it.
|
|
28
|
+
*
|
|
29
|
+
* TODO: re-evaluate whether this wrapper is still needed once remotion
|
|
30
|
+
* fixes the HtmlInCanvas delayRender scoping / hidden-scaffold capture bug:
|
|
31
|
+
* https://github.com/remotion-dev/remotion/issues/9367
|
|
32
|
+
*/
|
|
33
|
+
export declare function wrapForWebRenderer(component: React.FC): React.FC;
|
|
7
34
|
export declare function renderInBrowser(options: {
|
|
8
35
|
component: React.FC;
|
|
9
36
|
durationInFrames: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-client.d.ts","sourceRoot":"","sources":["../../src/vite/render-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"render-client.d.ts","sourceRoot":"","sources":["../../src/vite/render-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAQhE;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,SAAS,EAAE,KAAK,CAAC,EAAE,CAAA;IACnB,gBAAgB,EAAE,MAAM,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,gBA4BA"}
|
|
@@ -7,61 +7,57 @@ import { renderMediaOnWeb } from '@remotion/web-renderer';
|
|
|
7
7
|
import { ExportContext } from "./mdx-video.js";
|
|
8
8
|
import React from 'react';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Wrap a composition for web-renderer entry points (export, screenshot,
|
|
11
|
+
* filmstrip). The scaffold wrapper is visibility:hidden and Chromium creates
|
|
12
|
+
* no paint records for hidden subtrees, which breaks captureElementImage()
|
|
13
|
+
* inside nested <HtmlInCanvas> (AngledScreen): onInit/onPaint silently never
|
|
14
|
+
* run and exports come out flat. visibility is overridable by descendants,
|
|
15
|
+
* so a visibility:visible div at the composition root restores paint records
|
|
16
|
+
* for the whole tree while deeper visibility:hidden ancestors (e.g.
|
|
17
|
+
* LayoutTransition's inactive instances) keep hiding their subtrees
|
|
18
|
+
* relative to this root.
|
|
14
19
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
+
* Tradeoff (accepted): the scaffold sits at z-index:-9999, painting above
|
|
21
|
+
* the page's root background but below all in-flow content — so the
|
|
22
|
+
* rendering composition can peek through wherever the page shows only the
|
|
23
|
+
* body background. Hiding it differently is not possible:
|
|
24
|
+
* - opacity:0 / filter:opacity(0) bake into captureElementImage pixels
|
|
25
|
+
* (verified: capture succeeds but frames come out fully transparent)
|
|
26
|
+
* - translate/clip-path/resize on the scaffold break the drawElementImage
|
|
27
|
+
* paint pipeline (black frames — learned June 2026, commit e501ca5)
|
|
28
|
+
* - visibility:hidden kills paint records entirely (the original bug)
|
|
29
|
+
* An opaque page background or full-viewport player UI fully occludes it.
|
|
20
30
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
31
|
+
* TODO: re-evaluate whether this wrapper is still needed once remotion
|
|
32
|
+
* fixes the HtmlInCanvas delayRender scoping / hidden-scaffold capture bug:
|
|
33
|
+
* https://github.com/remotion-dev/remotion/issues/9367
|
|
24
34
|
*/
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
'position:fixed',
|
|
29
|
-
'inset:0',
|
|
30
|
-
'z-index:-9998',
|
|
31
|
-
'background:#050505',
|
|
32
|
-
'pointer-events:none',
|
|
33
|
-
].join(';');
|
|
34
|
-
document.body.appendChild(cover);
|
|
35
|
-
return () => cover.remove();
|
|
35
|
+
export function wrapForWebRenderer(component) {
|
|
36
|
+
const Wrapped = () => React.createElement('div', { style: { visibility: 'visible', position: 'relative', width: '100%', height: '100%' } }, React.createElement(component));
|
|
37
|
+
return Wrapped;
|
|
36
38
|
}
|
|
37
39
|
export async function renderInBrowser(options) {
|
|
38
|
-
const removeCover = injectScaffoldCover();
|
|
39
40
|
const ExportWrapped = () => React.createElement(ExportContext.Provider, { value: true }, React.createElement(options.component));
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onProgress
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return getBlob();
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
removeCover();
|
|
66
|
-
}
|
|
41
|
+
const { getBlob } = await renderMediaOnWeb({
|
|
42
|
+
composition: {
|
|
43
|
+
component: wrapForWebRenderer(ExportWrapped),
|
|
44
|
+
durationInFrames: options.durationInFrames,
|
|
45
|
+
fps: options.fps ?? 30,
|
|
46
|
+
width: options.width ?? 1920,
|
|
47
|
+
height: options.height ?? 1080,
|
|
48
|
+
id: 'MdxVideo',
|
|
49
|
+
calculateMetadata: null,
|
|
50
|
+
},
|
|
51
|
+
inputProps: {},
|
|
52
|
+
container: 'mp4',
|
|
53
|
+
videoCodec: 'h264',
|
|
54
|
+
videoBitrate: 'high',
|
|
55
|
+
allowHtmlInCanvas: true,
|
|
56
|
+
scale: options.scale,
|
|
57
|
+
signal: options.signal,
|
|
58
|
+
onProgress: ({ progress }) => {
|
|
59
|
+
options.onProgress?.(progress);
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return getBlob();
|
|
67
63
|
}
|
package/dist/vite/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/vite/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/vite/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA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|
*/
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { renderStillOnWeb, renderMediaOnWeb } from '@remotion/web-renderer';
|
|
15
|
+
import { wrapForWebRenderer } from "./render-client.js";
|
|
15
16
|
import { ExportContext } from "./mdx-video.js";
|
|
16
17
|
// ---------------------------------------------------------------------------
|
|
17
18
|
// Helper: blob → data URL
|
|
@@ -192,7 +193,7 @@ class EgakiSDK {
|
|
|
192
193
|
const format = options.format ?? 'png';
|
|
193
194
|
const still = await renderStillOnWeb({
|
|
194
195
|
composition: {
|
|
195
|
-
component: c.component,
|
|
196
|
+
component: wrapForWebRenderer(c.component),
|
|
196
197
|
durationInFrames: c.totalDuration,
|
|
197
198
|
fps: c.fps,
|
|
198
199
|
width: c.width,
|
|
@@ -278,7 +279,7 @@ class EgakiSDK {
|
|
|
278
279
|
for (let i = 0; i < framesToCapture.length; i++) {
|
|
279
280
|
const still = await renderStillOnWeb({
|
|
280
281
|
composition: {
|
|
281
|
-
component: c.component,
|
|
282
|
+
component: wrapForWebRenderer(c.component),
|
|
282
283
|
durationInFrames: c.totalDuration,
|
|
283
284
|
fps: c.fps,
|
|
284
285
|
width: c.width,
|
|
@@ -315,7 +316,7 @@ class EgakiSDK {
|
|
|
315
316
|
const c = this.getConfig();
|
|
316
317
|
const { getBlob } = await renderMediaOnWeb({
|
|
317
318
|
composition: {
|
|
318
|
-
component: this.wrapForExport(c.component),
|
|
319
|
+
component: wrapForWebRenderer(this.wrapForExport(c.component)),
|
|
319
320
|
durationInFrames: c.totalDuration,
|
|
320
321
|
fps: c.fps,
|
|
321
322
|
width: c.width,
|