@democraft/remotion 0.1.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/LICENSE +21 -0
- package/README.md +12 -0
- package/dist/chunk-6AAAFZRJ.js +265 -0
- package/dist/chunk-RINGSQ6X.js +28 -0
- package/dist/chunk-SER75PIJ.js +47 -0
- package/dist/chunk-TWKRXLNL.js +684 -0
- package/dist/client.d.ts +116 -0
- package/dist/client.js +40 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.js +34 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +58 -0
- package/dist/media-CILzIgah.d.ts +146 -0
- package/dist/server.d.ts +77 -0
- package/dist/server.js +21 -0
- package/package.json +65 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { V as VisualComponent, c as CaptionProps, a as CalloutProps, i as VisualRegistry } from './media-CILzIgah.js';
|
|
2
|
+
export { C as Callout, b as Caption, d as CaptureDimensions, e as CreateProductDemoVideoPropsOptions, D as DEFAULT_DEMO_MEDIA_MODE, f as DemoMediaMode, G as GenericVisualComponent, g as GlassCallout, K as KineticCaption, O as OverlayLayer, P as ProductDemoVideo, h as ProductDemoVideoProps, S as StageLayout, j as createProductDemoVideoProps, k as defaultProductDemoProps, l as defaultVisualRegistry, s as stageLayout } from './media-CILzIgah.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import '@democraft/schema';
|
|
5
|
+
|
|
6
|
+
declare const compositionId = "Democraft";
|
|
7
|
+
|
|
8
|
+
type VisualDefinition<TProps> = {
|
|
9
|
+
readonly component: unknown;
|
|
10
|
+
readonly __visualProps?: (props: TProps) => TProps;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A single visual registration — maps a renderer ID to a React component.
|
|
14
|
+
*
|
|
15
|
+
* Used with {@link defineVisualRegistry} to build a custom registry that
|
|
16
|
+
* extends (or replaces) the built-in defaults.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* { kind: "caption", id: "local.my-caption", component: MyCaption }
|
|
21
|
+
* { kind: "callout", id: "remocn.pulse-callout", component: PulseCallout }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
type VisualEntry = {
|
|
25
|
+
kind: "caption";
|
|
26
|
+
id: string;
|
|
27
|
+
component: VisualComponent<CaptionProps>;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "callout";
|
|
30
|
+
id: string;
|
|
31
|
+
component: VisualComponent<CalloutProps>;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "visual";
|
|
34
|
+
id: string;
|
|
35
|
+
component: React.ComponentType<never>;
|
|
36
|
+
};
|
|
37
|
+
/** Declare any React/Remotion component while preserving its exact props. */
|
|
38
|
+
declare function defineVisual<TProps>(component: React.ComponentType<TProps>): VisualDefinition<TProps>;
|
|
39
|
+
/**
|
|
40
|
+
* Build a custom visual registry by extending the built-in defaults.
|
|
41
|
+
*
|
|
42
|
+
* Pass any number of {@link VisualEntry} objects. Each entry adds (or
|
|
43
|
+
* overrides) a renderer ID in the registry. The result is a complete
|
|
44
|
+
* `VisualRegistry` you can pass to `<ProductDemoVideo registry={...} />` from
|
|
45
|
+
* a user-authored entry point.
|
|
46
|
+
*
|
|
47
|
+
* IDs follow the `<namespace>.<component>` convention:
|
|
48
|
+
* - `motion.*` — framework defaults (override with caution).
|
|
49
|
+
* - `remocn.*` — remocn (Remotion + shadcn) components.
|
|
50
|
+
* - `local.*` — your own project components.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* import { defineVisualRegistry } from "@democraft/remotion";
|
|
55
|
+
* import { MyCaption } from "./my-caption";
|
|
56
|
+
*
|
|
57
|
+
* const registry = defineVisualRegistry(
|
|
58
|
+
* { kind: "caption", id: "local.my-caption", component: MyCaption },
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* The returned registry includes all built-in renderers (`motion.*`,
|
|
63
|
+
* `remocn.*`) plus your additions. Entries with the same ID as a built-in
|
|
64
|
+
* renderer override the default.
|
|
65
|
+
*/
|
|
66
|
+
declare function defineVisualRegistry(...entries: VisualEntry[]): VisualRegistry;
|
|
67
|
+
declare function visualRegistryFromDefinitions(definitions?: Record<string, {
|
|
68
|
+
readonly component: unknown;
|
|
69
|
+
}>): VisualRegistry;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A Democraft adapter bundles optional extensions to the rendering pipeline.
|
|
73
|
+
*
|
|
74
|
+
* Today the only field is `visualRegistry`, which adds or overrides renderer
|
|
75
|
+
* IDs (the strings authors pass as `renderer` on caption/callout steps). Future
|
|
76
|
+
* fields may include theme presets, cursor styles, browser frames, etc.
|
|
77
|
+
*
|
|
78
|
+
* The type lives in `@democraft/core` (as `DemocraftAdapter`) to avoid a
|
|
79
|
+
* circular dependency, but is re-exported here for convenience.
|
|
80
|
+
*/
|
|
81
|
+
type DemocraftAdapter = {
|
|
82
|
+
name: string;
|
|
83
|
+
visualRegistry?: VisualRegistry;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Create the remocn adapter — the recommended adapter for Democraft.
|
|
87
|
+
*
|
|
88
|
+
* Remocn ("Remotion + shadcn") is the primary source of cinematic components
|
|
89
|
+
* for overlays. The adapter ships with built-in renderers (`motion.*` defaults
|
|
90
|
+
* + `remocn.*` components). Pass a custom registry to add or replace
|
|
91
|
+
* renderers.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* import { remocnAdapter, defineVisualRegistry } from "@democraft/remotion";
|
|
96
|
+
* import { MyCaption } from "./my-caption";
|
|
97
|
+
*
|
|
98
|
+
* export default defineConfig({
|
|
99
|
+
* adapters: [
|
|
100
|
+
* remocnAdapter({
|
|
101
|
+
* registry: defineVisualRegistry(
|
|
102
|
+
* { kind: "caption", id: "local.my-caption", component: MyCaption },
|
|
103
|
+
* ),
|
|
104
|
+
* }),
|
|
105
|
+
* ],
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* The adapter's registry is consumed by a user-authored entry point (see the
|
|
110
|
+
* "Custom entry" guide) to wire the components into `<ProductDemoVideo>`.
|
|
111
|
+
*/
|
|
112
|
+
declare function remocnAdapter(options?: {
|
|
113
|
+
registry?: VisualRegistry;
|
|
114
|
+
}): DemocraftAdapter;
|
|
115
|
+
|
|
116
|
+
export { CalloutProps, CaptionProps, type DemocraftAdapter, VisualComponent, type VisualEntry, VisualRegistry, compositionId, defineVisual, defineVisualRegistry, remocnAdapter, visualRegistryFromDefinitions };
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineVisual,
|
|
3
|
+
defineVisualRegistry,
|
|
4
|
+
remocnAdapter,
|
|
5
|
+
visualRegistryFromDefinitions
|
|
6
|
+
} from "./chunk-SER75PIJ.js";
|
|
7
|
+
import {
|
|
8
|
+
Callout,
|
|
9
|
+
Caption,
|
|
10
|
+
GlassCallout,
|
|
11
|
+
KineticCaption,
|
|
12
|
+
OverlayLayer,
|
|
13
|
+
ProductDemoVideo,
|
|
14
|
+
defaultProductDemoProps,
|
|
15
|
+
defaultVisualRegistry,
|
|
16
|
+
stageLayout
|
|
17
|
+
} from "./chunk-TWKRXLNL.js";
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_DEMO_MEDIA_MODE,
|
|
20
|
+
compositionId,
|
|
21
|
+
createProductDemoVideoProps
|
|
22
|
+
} from "./chunk-RINGSQ6X.js";
|
|
23
|
+
export {
|
|
24
|
+
Callout,
|
|
25
|
+
Caption,
|
|
26
|
+
DEFAULT_DEMO_MEDIA_MODE,
|
|
27
|
+
GlassCallout,
|
|
28
|
+
KineticCaption,
|
|
29
|
+
OverlayLayer,
|
|
30
|
+
ProductDemoVideo,
|
|
31
|
+
compositionId,
|
|
32
|
+
createProductDemoVideoProps,
|
|
33
|
+
defaultProductDemoProps,
|
|
34
|
+
defaultVisualRegistry,
|
|
35
|
+
defineVisual,
|
|
36
|
+
defineVisualRegistry,
|
|
37
|
+
remocnAdapter,
|
|
38
|
+
stageLayout,
|
|
39
|
+
visualRegistryFromDefinitions
|
|
40
|
+
};
|
package/dist/entry.d.ts
ADDED
package/dist/entry.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProductDemoVideo,
|
|
3
|
+
defaultProductDemoProps
|
|
4
|
+
} from "./chunk-TWKRXLNL.js";
|
|
5
|
+
import {
|
|
6
|
+
compositionId
|
|
7
|
+
} from "./chunk-RINGSQ6X.js";
|
|
8
|
+
|
|
9
|
+
// src/entry.ts
|
|
10
|
+
import React from "react";
|
|
11
|
+
import { Composition, registerRoot } from "remotion";
|
|
12
|
+
function Root() {
|
|
13
|
+
return React.createElement(Composition, {
|
|
14
|
+
id: compositionId,
|
|
15
|
+
component: ProductDemoVideo,
|
|
16
|
+
width: 1920,
|
|
17
|
+
height: 1080,
|
|
18
|
+
fps: 60,
|
|
19
|
+
durationInFrames: 1,
|
|
20
|
+
defaultProps: defaultProductDemoProps,
|
|
21
|
+
calculateMetadata: ({ props }) => ({
|
|
22
|
+
...metadataFromProps(props)
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function metadataFromProps(props) {
|
|
27
|
+
return {
|
|
28
|
+
durationInFrames: props.timeline.durationInFrames,
|
|
29
|
+
fps: props.timeline.fps,
|
|
30
|
+
width: props.width,
|
|
31
|
+
height: props.height
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
registerRoot(Root);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CreateRenderArtifactOptions, RenderArtifact, RenderDemoVideoOptions, cancelRenderArtifact, completeRenderArtifact, createDemoEntrySource, createRenderArtifact, failRenderArtifact, materializeDemoEntry, renderDemoVideo, renderSlug } from './server.js';
|
|
2
|
+
export { DemocraftAdapter, VisualEntry, compositionId, defineVisual, defineVisualRegistry, remocnAdapter, visualRegistryFromDefinitions } from './client.js';
|
|
3
|
+
export { C as Callout, a as CalloutProps, b as Caption, c as CaptionProps, d as CaptureDimensions, e as CreateProductDemoVideoPropsOptions, D as DEFAULT_DEMO_MEDIA_MODE, f as DemoMediaMode, G as GenericVisualComponent, g as GlassCallout, K as KineticCaption, O as OverlayLayer, P as ProductDemoVideo, h as ProductDemoVideoProps, S as StageLayout, V as VisualComponent, i as VisualRegistry, j as createProductDemoVideoProps, k as defaultProductDemoProps, l as defaultVisualRegistry, s as stageLayout } from './media-CILzIgah.js';
|
|
4
|
+
export { RenderArtifactMetadata, RenderArtifactStatus } from '@democraft/schema';
|
|
5
|
+
import '@remotion/renderer';
|
|
6
|
+
import 'react';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineVisual,
|
|
3
|
+
defineVisualRegistry,
|
|
4
|
+
remocnAdapter,
|
|
5
|
+
visualRegistryFromDefinitions
|
|
6
|
+
} from "./chunk-SER75PIJ.js";
|
|
7
|
+
import {
|
|
8
|
+
Callout,
|
|
9
|
+
Caption,
|
|
10
|
+
GlassCallout,
|
|
11
|
+
KineticCaption,
|
|
12
|
+
OverlayLayer,
|
|
13
|
+
ProductDemoVideo,
|
|
14
|
+
defaultProductDemoProps,
|
|
15
|
+
defaultVisualRegistry,
|
|
16
|
+
stageLayout
|
|
17
|
+
} from "./chunk-TWKRXLNL.js";
|
|
18
|
+
import {
|
|
19
|
+
cancelRenderArtifact,
|
|
20
|
+
completeRenderArtifact,
|
|
21
|
+
createDemoEntrySource,
|
|
22
|
+
createRenderArtifact,
|
|
23
|
+
failRenderArtifact,
|
|
24
|
+
materializeDemoEntry,
|
|
25
|
+
renderDemoVideo,
|
|
26
|
+
renderSlug
|
|
27
|
+
} from "./chunk-6AAAFZRJ.js";
|
|
28
|
+
import {
|
|
29
|
+
DEFAULT_DEMO_MEDIA_MODE,
|
|
30
|
+
compositionId,
|
|
31
|
+
createProductDemoVideoProps
|
|
32
|
+
} from "./chunk-RINGSQ6X.js";
|
|
33
|
+
export {
|
|
34
|
+
Callout,
|
|
35
|
+
Caption,
|
|
36
|
+
DEFAULT_DEMO_MEDIA_MODE,
|
|
37
|
+
GlassCallout,
|
|
38
|
+
KineticCaption,
|
|
39
|
+
OverlayLayer,
|
|
40
|
+
ProductDemoVideo,
|
|
41
|
+
cancelRenderArtifact,
|
|
42
|
+
completeRenderArtifact,
|
|
43
|
+
compositionId,
|
|
44
|
+
createDemoEntrySource,
|
|
45
|
+
createProductDemoVideoProps,
|
|
46
|
+
createRenderArtifact,
|
|
47
|
+
defaultProductDemoProps,
|
|
48
|
+
defaultVisualRegistry,
|
|
49
|
+
defineVisual,
|
|
50
|
+
defineVisualRegistry,
|
|
51
|
+
failRenderArtifact,
|
|
52
|
+
materializeDemoEntry,
|
|
53
|
+
remocnAdapter,
|
|
54
|
+
renderDemoVideo,
|
|
55
|
+
renderSlug,
|
|
56
|
+
stageLayout,
|
|
57
|
+
visualRegistryFromDefinitions
|
|
58
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverlayTrack, BoundingBox, RenderTimeline, RecordedDemoManifest } from '@democraft/schema';
|
|
3
|
+
|
|
4
|
+
type StageLayout = {
|
|
5
|
+
scale: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The viewport dimensions used during Playwright capture. The stage layout
|
|
11
|
+
* maps the captured screenshot (at these CSS dimensions) into the render
|
|
12
|
+
* frame. Defaults to 1920×1080 to match the Remotion composition; older
|
|
13
|
+
* captures that used 1440×900 pass their own dimensions via the manifest's
|
|
14
|
+
* `capture` field.
|
|
15
|
+
*
|
|
16
|
+
* `deviceScaleFactor` records the pixel density the screenshot was captured
|
|
17
|
+
* at (Playwright `deviceScaleFactor`, default 2). The native PNG resolution is
|
|
18
|
+
* `width × height × deviceScaleFactor`. The renderer renders the `<Img>` at
|
|
19
|
+
* native resolution (with a compensating scale) so camera zoom amplifies a
|
|
20
|
+
* full-resolution bitmap instead of an already-downscaled one — preventing
|
|
21
|
+
* pixelation on focus shots. Defaults to 1 when absent (legacy captures).
|
|
22
|
+
*/
|
|
23
|
+
type CaptureDimensions = {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
deviceScaleFactor?: number;
|
|
27
|
+
};
|
|
28
|
+
declare function stageLayout(width: number, height: number, capture?: CaptureDimensions): StageLayout;
|
|
29
|
+
|
|
30
|
+
type CameraState = {
|
|
31
|
+
scale: number;
|
|
32
|
+
focusX: number;
|
|
33
|
+
focusY: number;
|
|
34
|
+
translateX: number;
|
|
35
|
+
translateY: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type VisualComponent<T> = React.FC<T>;
|
|
39
|
+
type GenericVisualComponent = React.ComponentType<Record<string, unknown>>;
|
|
40
|
+
type CaptionProps = {
|
|
41
|
+
overlay: Extract<OverlayTrack, {
|
|
42
|
+
kind: "caption";
|
|
43
|
+
}>;
|
|
44
|
+
opacity: number;
|
|
45
|
+
};
|
|
46
|
+
type CalloutProps = {
|
|
47
|
+
overlay: Extract<OverlayTrack, {
|
|
48
|
+
kind: "callout";
|
|
49
|
+
}>;
|
|
50
|
+
opacity: number;
|
|
51
|
+
box: BoundingBox;
|
|
52
|
+
};
|
|
53
|
+
type VisualRegistry = {
|
|
54
|
+
captions: Record<string, VisualComponent<CaptionProps>>;
|
|
55
|
+
callouts: Record<string, VisualComponent<CalloutProps>>;
|
|
56
|
+
visuals: Record<string, GenericVisualComponent>;
|
|
57
|
+
};
|
|
58
|
+
declare function OverlayLayer({ camera, frame, registry, stage, timeline, }: {
|
|
59
|
+
camera: CameraState;
|
|
60
|
+
frame: number;
|
|
61
|
+
registry: VisualRegistry;
|
|
62
|
+
stage: StageLayout;
|
|
63
|
+
timeline: RenderTimeline;
|
|
64
|
+
}): React.FunctionComponentElement<React.FragmentProps>;
|
|
65
|
+
declare function Caption({ opacity, overlay }: CaptionProps): React.DetailedReactHTMLElement<{
|
|
66
|
+
style: {
|
|
67
|
+
position: "absolute";
|
|
68
|
+
left: string;
|
|
69
|
+
bottom: number;
|
|
70
|
+
transform: "translateX(-50%)";
|
|
71
|
+
maxWidth: number;
|
|
72
|
+
padding: string;
|
|
73
|
+
borderRadius: number;
|
|
74
|
+
backgroundColor: "rgba(10,14,20,.84)";
|
|
75
|
+
color: "white";
|
|
76
|
+
font: "500 34px Inter, system-ui, sans-serif";
|
|
77
|
+
opacity: number;
|
|
78
|
+
};
|
|
79
|
+
}, HTMLElement>;
|
|
80
|
+
declare function KineticCaption({ opacity, overlay }: CaptionProps): React.DetailedReactHTMLElement<{
|
|
81
|
+
style: {
|
|
82
|
+
position: "absolute";
|
|
83
|
+
left: string;
|
|
84
|
+
bottom: number;
|
|
85
|
+
transform: `translateX(-50%) scale(${number})`;
|
|
86
|
+
width: number;
|
|
87
|
+
maxWidth: number;
|
|
88
|
+
height: number;
|
|
89
|
+
padding: string;
|
|
90
|
+
borderRadius: number;
|
|
91
|
+
backgroundColor: "rgba(10,14,20,.72)";
|
|
92
|
+
color: "white";
|
|
93
|
+
font: "800 38px Inter, system-ui, sans-serif";
|
|
94
|
+
letterSpacing: number;
|
|
95
|
+
opacity: number;
|
|
96
|
+
textShadow: "0 18px 50px rgba(0,0,0,.42)";
|
|
97
|
+
};
|
|
98
|
+
}, HTMLElement>;
|
|
99
|
+
declare function Callout({ box, opacity, overlay }: CalloutProps): React.DetailedReactHTMLElement<{
|
|
100
|
+
style: React.CSSProperties;
|
|
101
|
+
}, HTMLElement>;
|
|
102
|
+
declare function GlassCallout({ box, opacity, overlay, }: CalloutProps): React.ReactElement;
|
|
103
|
+
/**
|
|
104
|
+
* The built-in visual registry. Maps renderer IDs (the strings authors pass as
|
|
105
|
+
* `renderer` on caption/callout steps) to React components.
|
|
106
|
+
*
|
|
107
|
+
* Convention: `<namespace>.<component>`
|
|
108
|
+
* - `motion.*` — the framework's default styling (used when `renderer` is
|
|
109
|
+
* omitted).
|
|
110
|
+
* - `remocn.*` — components backed by remocn (Remotion + shadcn) building
|
|
111
|
+
* blocks.
|
|
112
|
+
*
|
|
113
|
+
* A user-authored entry point can extend or replace this via
|
|
114
|
+
* `defineVisualRegistry()`.
|
|
115
|
+
*/
|
|
116
|
+
declare const defaultVisualRegistry: VisualRegistry;
|
|
117
|
+
|
|
118
|
+
type ProductDemoVideoProps = {
|
|
119
|
+
manifest: RecordedDemoManifest;
|
|
120
|
+
recordingSrc?: string;
|
|
121
|
+
timeline: RenderTimeline;
|
|
122
|
+
screenshotSrcByStepId: Record<string, string>;
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
/**
|
|
126
|
+
* Override the visual registry (renderer ID → component map). When omitted,
|
|
127
|
+
* uses `defaultVisualRegistry` (the built-in `motion.*` + `remocn.*`
|
|
128
|
+
* components). Pass a custom registry from a user-authored entry point to
|
|
129
|
+
* add or replace renderers without editing the library.
|
|
130
|
+
*/
|
|
131
|
+
registry?: VisualRegistry;
|
|
132
|
+
};
|
|
133
|
+
declare const defaultProductDemoProps: ProductDemoVideoProps;
|
|
134
|
+
declare function ProductDemoVideo(props: ProductDemoVideoProps): React.FunctionComponentElement<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
135
|
+
|
|
136
|
+
type DemoMediaMode = "screenshots" | "recording";
|
|
137
|
+
declare const DEFAULT_DEMO_MEDIA_MODE: DemoMediaMode;
|
|
138
|
+
type CreateProductDemoVideoPropsOptions = Omit<ProductDemoVideoProps, "recordingSrc" | "width" | "height"> & {
|
|
139
|
+
mediaMode?: DemoMediaMode;
|
|
140
|
+
recordingSrc?: string;
|
|
141
|
+
width?: number;
|
|
142
|
+
height?: number;
|
|
143
|
+
};
|
|
144
|
+
declare function createProductDemoVideoProps(options: CreateProductDemoVideoPropsOptions): ProductDemoVideoProps;
|
|
145
|
+
|
|
146
|
+
export { Callout as C, DEFAULT_DEMO_MEDIA_MODE as D, type GenericVisualComponent as G, KineticCaption as K, OverlayLayer as O, ProductDemoVideo as P, type StageLayout as S, type VisualComponent as V, type CalloutProps as a, Caption as b, type CaptionProps as c, type CaptureDimensions as d, type CreateProductDemoVideoPropsOptions as e, type DemoMediaMode as f, GlassCallout as g, type ProductDemoVideoProps as h, type VisualRegistry as i, createProductDemoVideoProps as j, defaultProductDemoProps as k, defaultVisualRegistry as l, stageLayout as s };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { RenderMediaOnProgress, CancelSignal, FrameRange } from '@remotion/renderer';
|
|
2
|
+
import { RenderArtifactMetadata, RecordedDemoManifest, RenderTimeline } from '@democraft/schema';
|
|
3
|
+
export { RenderArtifactMetadata, RenderArtifactStatus } from '@democraft/schema';
|
|
4
|
+
import { f as DemoMediaMode } from './media-CILzIgah.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
/** Build the browser entry that wires visual definitions from a demo module. */
|
|
8
|
+
declare function createDemoEntrySource(demoPath: string): string;
|
|
9
|
+
/** Materialize a deterministic generated entry beside the demo module. */
|
|
10
|
+
declare function materializeDemoEntry(demoPath: string): Promise<string>;
|
|
11
|
+
|
|
12
|
+
type RenderArtifact = {
|
|
13
|
+
directory: string;
|
|
14
|
+
metadataPath: string;
|
|
15
|
+
outputFile: string;
|
|
16
|
+
temporaryOutputFile: string;
|
|
17
|
+
metadata: RenderArtifactMetadata;
|
|
18
|
+
};
|
|
19
|
+
type CreateRenderArtifactOptions = {
|
|
20
|
+
rootDirectory: string;
|
|
21
|
+
demoId: string;
|
|
22
|
+
definitionHash?: string;
|
|
23
|
+
captureHash?: string;
|
|
24
|
+
captureEnvironmentHash?: string;
|
|
25
|
+
render: RenderArtifactMetadata["render"];
|
|
26
|
+
source?: RenderArtifactMetadata["source"];
|
|
27
|
+
};
|
|
28
|
+
type ArtifactDependencies = {
|
|
29
|
+
now: () => Date;
|
|
30
|
+
shortId: () => string;
|
|
31
|
+
};
|
|
32
|
+
declare function createRenderArtifact(options: CreateRenderArtifactOptions, dependencies?: ArtifactDependencies): Promise<RenderArtifact>;
|
|
33
|
+
declare function completeRenderArtifact(artifact: RenderArtifact, now?: Date): Promise<void>;
|
|
34
|
+
declare function failRenderArtifact(artifact: RenderArtifact, error: unknown, now?: Date): Promise<void>;
|
|
35
|
+
declare function cancelRenderArtifact(artifact: RenderArtifact, now?: Date): Promise<void>;
|
|
36
|
+
declare function renderSlug(value: string): string;
|
|
37
|
+
|
|
38
|
+
type RenderDemoVideoOptions = {
|
|
39
|
+
manifest: RecordedDemoManifest;
|
|
40
|
+
timeline: RenderTimeline;
|
|
41
|
+
screenshotSrcByStepId: Record<string, string>;
|
|
42
|
+
recordingFile?: string;
|
|
43
|
+
mediaMode?: DemoMediaMode;
|
|
44
|
+
outputFile: string;
|
|
45
|
+
width?: number;
|
|
46
|
+
height?: number;
|
|
47
|
+
scale?: number;
|
|
48
|
+
crf?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Optional path to the bundled entry.js (the file that calls registerRoot).
|
|
51
|
+
* Defaults to dist/entry.js next to this module. Pass explicitly when
|
|
52
|
+
* calling from inside a webpack bundle (e.g. Next.js dev server) where
|
|
53
|
+
* import.meta.url is rewritten and the default resolution gives the
|
|
54
|
+
* wrong path.
|
|
55
|
+
*/
|
|
56
|
+
entryPath?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Live render progress. Receives Remotion's RenderMediaProgress
|
|
59
|
+
* ({ progress, renderedFrames, encodedFrames, stitchStage,
|
|
60
|
+
* renderEstimatedTime, … }). Forwarded verbatim to renderMedia.
|
|
61
|
+
*/
|
|
62
|
+
onProgress?: RenderMediaOnProgress;
|
|
63
|
+
/**
|
|
64
|
+
* Cancellation handle from makeCancelSignal(). When the paired cancel()
|
|
65
|
+
* is invoked, renderMedia rejects with a cancel error.
|
|
66
|
+
*/
|
|
67
|
+
cancelSignal?: CancelSignal;
|
|
68
|
+
/**
|
|
69
|
+
* Sub-range of frames to render ([startFrame, endFrame], inclusive). When
|
|
70
|
+
* omitted the whole composition renders. Used by the studio's in/out
|
|
71
|
+
* markers. See docs/architecture/studio-roadmap.md "Render range".
|
|
72
|
+
*/
|
|
73
|
+
frameRange?: FrameRange;
|
|
74
|
+
};
|
|
75
|
+
declare function renderDemoVideo(options: RenderDemoVideoOptions): Promise<void>;
|
|
76
|
+
|
|
77
|
+
export { type CreateRenderArtifactOptions, type RenderArtifact, type RenderDemoVideoOptions, cancelRenderArtifact, completeRenderArtifact, createDemoEntrySource, createRenderArtifact, failRenderArtifact, materializeDemoEntry, renderDemoVideo, renderSlug };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cancelRenderArtifact,
|
|
3
|
+
completeRenderArtifact,
|
|
4
|
+
createDemoEntrySource,
|
|
5
|
+
createRenderArtifact,
|
|
6
|
+
failRenderArtifact,
|
|
7
|
+
materializeDemoEntry,
|
|
8
|
+
renderDemoVideo,
|
|
9
|
+
renderSlug
|
|
10
|
+
} from "./chunk-6AAAFZRJ.js";
|
|
11
|
+
import "./chunk-RINGSQ6X.js";
|
|
12
|
+
export {
|
|
13
|
+
cancelRenderArtifact,
|
|
14
|
+
completeRenderArtifact,
|
|
15
|
+
createDemoEntrySource,
|
|
16
|
+
createRenderArtifact,
|
|
17
|
+
failRenderArtifact,
|
|
18
|
+
materializeDemoEntry,
|
|
19
|
+
renderDemoVideo,
|
|
20
|
+
renderSlug
|
|
21
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@democraft/remotion",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "Remotion composition and video renderer for Democraft.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/felipersas/democraft.git",
|
|
9
|
+
"directory": "packages/remotion"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/felipersas/democraft#readme",
|
|
12
|
+
"bugs": "https://github.com/felipersas/democraft/issues",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"registry": "https://registry.npmjs.org/"
|
|
25
|
+
},
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./client": {
|
|
33
|
+
"types": "./dist/client.d.ts",
|
|
34
|
+
"import": "./dist/client.js",
|
|
35
|
+
"default": "./dist/client.js"
|
|
36
|
+
},
|
|
37
|
+
"./server": {
|
|
38
|
+
"types": "./dist/server.d.ts",
|
|
39
|
+
"import": "./dist/server.js",
|
|
40
|
+
"default": "./dist/server.js"
|
|
41
|
+
},
|
|
42
|
+
"./entry": {
|
|
43
|
+
"types": "./dist/entry.d.ts",
|
|
44
|
+
"import": "./dist/entry.js",
|
|
45
|
+
"default": "./dist/entry.js"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@remotion/bundler": "4.0.487",
|
|
51
|
+
"@remotion/renderer": "4.0.487",
|
|
52
|
+
"react": "^19.2.3",
|
|
53
|
+
"react-dom": "^19.2.3",
|
|
54
|
+
"remotion": "4.0.487",
|
|
55
|
+
"@democraft/schema": "0.1.0-beta.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/react": "^19.2.7"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsup src/index.ts src/entry.ts src/client.ts src/server.ts --format esm --dts --clean",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"test": "vitest run"
|
|
64
|
+
}
|
|
65
|
+
}
|