ugcinc 3.84.5 → 3.85.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/index.d.ts +2 -1
- package/dist/index.js +6 -1
- package/dist/media.d.ts +10 -1
- package/dist/media.js +11 -0
- package/dist/render/Root.d.ts +12 -0
- package/dist/render/Root.js +508 -0
- package/dist/render/components/CaptionOverlay.d.ts +21 -0
- package/dist/render/components/CaptionOverlay.js +210 -0
- package/dist/render/components/ImageElement.d.ts +26 -0
- package/dist/render/components/ImageElement.js +88 -0
- package/dist/render/components/TextElement.d.ts +30 -0
- package/dist/render/components/TextElement.js +390 -0
- package/dist/render/components/VideoElement.d.ts +30 -0
- package/dist/render/components/VideoElement.js +108 -0
- package/dist/render/components/index.d.ts +7 -0
- package/dist/render/components/index.js +14 -0
- package/dist/render/compositions/AutoCaptionComposition.d.ts +42 -0
- package/dist/render/compositions/AutoCaptionComposition.js +29 -0
- package/dist/render/compositions/DmComposition/BaseDmComposition.d.ts +112 -0
- package/dist/render/compositions/DmComposition/BaseDmComposition.js +212 -0
- package/dist/render/compositions/DmComposition/DebugOverlay.d.ts +20 -0
- package/dist/render/compositions/DmComposition/DebugOverlay.js +258 -0
- package/dist/render/compositions/DmComposition/index.d.ts +6 -0
- package/dist/render/compositions/DmComposition/index.js +10 -0
- package/dist/render/compositions/IMessageDmComposition/convertPropsToElements.d.ts +27 -0
- package/dist/render/compositions/IMessageDmComposition/convertPropsToElements.js +629 -0
- package/dist/render/compositions/IMessageDmComposition/index.d.ts +20 -0
- package/dist/render/compositions/IMessageDmComposition/index.js +485 -0
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +756 -0
- package/dist/render/compositions/IMessageDmComposition/types.js +225 -0
- package/dist/render/compositions/ImageEditorComposition.d.ts +74 -0
- package/dist/render/compositions/ImageEditorComposition.js +351 -0
- package/dist/render/compositions/InstagramDmComposition/convertPropsToElements.d.ts +60 -0
- package/dist/render/compositions/InstagramDmComposition/convertPropsToElements.js +1318 -0
- package/dist/render/compositions/InstagramDmComposition/convertPublicToProps.d.ts +30 -0
- package/dist/render/compositions/InstagramDmComposition/convertPublicToProps.js +131 -0
- package/dist/render/compositions/InstagramDmComposition/index.d.ts +16 -0
- package/dist/render/compositions/InstagramDmComposition/index.js +374 -0
- package/dist/render/compositions/InstagramDmComposition/theme.d.ts +42 -0
- package/dist/render/compositions/InstagramDmComposition/theme.js +55 -0
- package/dist/render/compositions/InstagramDmComposition/types.d.ts +215 -0
- package/dist/render/compositions/InstagramDmComposition/types.js +7 -0
- package/dist/render/compositions/ScreenshotAnimation.d.ts +14 -0
- package/dist/render/compositions/ScreenshotAnimation.js +268 -0
- package/dist/render/compositions/VideoEditorComposition.d.ts +45 -0
- package/dist/render/compositions/VideoEditorComposition.js +307 -0
- package/dist/render/compositions/index.d.ts +12 -0
- package/dist/render/compositions/index.js +43 -0
- package/dist/render/compositions/messaging/components/MediaBubble.d.ts +22 -0
- package/dist/render/compositions/messaging/components/MediaBubble.js +25 -0
- package/dist/render/compositions/messaging/components/MessageBubble.d.ts +35 -0
- package/dist/render/compositions/messaging/components/MessageBubble.js +34 -0
- package/dist/render/compositions/messaging/components/ProfilePic.d.ts +23 -0
- package/dist/render/compositions/messaging/components/ProfilePic.js +37 -0
- package/dist/render/compositions/messaging/components/Reaction.d.ts +23 -0
- package/dist/render/compositions/messaging/components/Reaction.js +19 -0
- package/dist/render/compositions/messaging/components/TypingIndicator.d.ts +25 -0
- package/dist/render/compositions/messaging/components/TypingIndicator.js +66 -0
- package/dist/render/compositions/messaging/index.d.ts +14 -0
- package/dist/render/compositions/messaging/index.js +43 -0
- package/dist/render/compositions/messaging/types.d.ts +148 -0
- package/dist/render/compositions/messaging/types.js +21 -0
- package/dist/render/compositions/messaging/utils/bubbleRadius.d.ts +45 -0
- package/dist/render/compositions/messaging/utils/bubbleRadius.js +84 -0
- package/dist/render/compositions/messaging/utils/groupMessages.d.ts +41 -0
- package/dist/render/compositions/messaging/utils/groupMessages.js +110 -0
- package/dist/render/data/phone-top-nav.d.ts +1 -0
- package/dist/render/data/phone-top-nav.js +4 -0
- package/dist/render/data/screenshot.d.ts +164 -0
- package/dist/render/data/screenshot.js +63 -0
- package/dist/render/hooks/index.d.ts +54 -0
- package/dist/render/hooks/index.js +132 -0
- package/dist/render/index.d.ts +12 -0
- package/dist/render/index.js +36 -0
- package/dist/render/types/base.d.ts +148 -0
- package/dist/render/types/base.js +5 -0
- package/dist/render/types/caption.d.ts +105 -0
- package/dist/render/types/caption.js +8 -0
- package/dist/render/types/crop.d.ts +60 -0
- package/dist/render/types/crop.js +8 -0
- package/dist/render/types/deduplication.d.ts +284 -0
- package/dist/render/types/deduplication.js +240 -0
- package/dist/render/types/editor.d.ts +97 -0
- package/dist/render/types/editor.js +10 -0
- package/dist/render/types/element.d.ts +139 -0
- package/dist/render/types/element.js +19 -0
- package/dist/render/types/index.d.ts +20 -0
- package/dist/render/types/index.js +24 -0
- package/dist/render/types/instagram-dm-public.d.ts +60 -0
- package/dist/render/types/instagram-dm-public.js +8 -0
- package/dist/render/types/position.d.ts +59 -0
- package/dist/render/types/position.js +5 -0
- package/dist/render/types/screenshot.d.ts +57 -0
- package/dist/render/types/screenshot.js +34 -0
- package/dist/render/types/segment.d.ts +163 -0
- package/dist/render/types/segment.js +8 -0
- package/dist/render/types/video.d.ts +192 -0
- package/dist/render/types/video.js +14 -0
- package/dist/render/utils/captionPresets.d.ts +38 -0
- package/dist/render/utils/captionPresets.js +168 -0
- package/dist/render/utils/cropBounds.d.ts +20 -0
- package/dist/render/utils/cropBounds.js +166 -0
- package/dist/render/utils/defaults.d.ts +74 -0
- package/dist/render/utils/defaults.js +91 -0
- package/dist/render/utils/emoji.d.ts +40 -0
- package/dist/render/utils/emoji.js +105 -0
- package/dist/render/utils/fit.d.ts +35 -0
- package/dist/render/utils/fit.js +63 -0
- package/dist/render/utils/fonts.d.ts +55 -0
- package/dist/render/utils/fonts.js +191 -0
- package/dist/render/utils/index.d.ts +14 -0
- package/dist/render/utils/index.js +73 -0
- package/dist/render/utils/positionResolver.d.ts +64 -0
- package/dist/render/utils/positionResolver.js +508 -0
- package/dist/render/utils/text.d.ts +50 -0
- package/dist/render/utils/text.js +177 -0
- package/dist/render/utils/timeline.d.ts +62 -0
- package/dist/render/utils/timeline.js +172 -0
- package/dist/render.d.ts +1 -1
- package/dist/types.d.ts +145 -17
- package/dist/types.js +58 -0
- package/package.json +20 -6
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { StatsClient } from './stats';
|
|
|
11
11
|
export { OrganizationClient } from './org';
|
|
12
12
|
export { RenderClient } from './render';
|
|
13
13
|
export { AutomationsClient, getAllNodes, getNodeByType, getOutputSchema } from './automations';
|
|
14
|
+
export { NodeTypes, isAsyncExecutor, isEditModel, isImageToVideoModel } from './types';
|
|
14
15
|
export type { PropertySchema } from './automations';
|
|
15
16
|
export { portId, isValidPortId, portIdToTitle, normalizeToPortId, PortIdSchema } from './port-id';
|
|
16
17
|
export type { PortId } from './port-id';
|
|
@@ -18,4 +19,4 @@ export { MediaClient } from './media';
|
|
|
18
19
|
export { CommentsClient } from './comments';
|
|
19
20
|
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitInstagramDmRenderJobParams, SubmitIMessageDmRenderJobParams, IgDmMessage, ImDmMessage, RenderVideoEditorConfig, } from './render';
|
|
20
21
|
export type { ClientConfig, } from './base';
|
|
21
|
-
export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStatus, PostStat, ApiKey, EditorConfig, VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, TimeMode, SegmentTimelinePosition, ImageEditorNodeConfig, ImageEditorElement, ImageEditorNodeInput, ImageEditorNodeOutput, DimensionPresetKey, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, ResolvedPorts, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, ExecutorNode, ExecutionEdge, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, NodeOutputValues, OutputInput, OutputNodeConfig, ObjectSchemaFieldLevel3, ObjectSchemaFieldLevel2, ObjectSchemaField, ManualTriggerOutput, ManualTriggerNodeConfig, TriggerIterationMode, IterationExhaustionBehavior, CollectionSelectionMode, TriggerCollectionConfig, DayOfWeek, RecurrenceMediaOutput, RecurrenceMediaConfig, RecurrenceNodeConfig, AccountNodeConfig, MediaNodeEnabledType, RecurrenceMediaEnabledType, MediaNodeOutput, MediaNodeConfig, PostSchedulingMode, PostSchedulingConfig, AutoPostMode, AutoPostInputType, AutoPostInput, AutoPostNodeConfig, SaveToMediaInput, SaveToMediaNodeConfig, DeduplicateNodeConfig, ForEachOutputProperty, ForEachInputPort, ForEachNodeConfig, RandomValueType, RandomInputPort, RandomNodeMode, RandomNodeConfig, IfLogicOperator, IfBooleanInput, IfPassthroughInput, IfNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, RandomRouteObjectField, RandomRouteNodeConfig, BranchDefinition, BranchValueConfig, BranchPassthroughInput, BranchNodeConfig, VideoImportPlatform, VideoImportQuality, VideoImportNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, AutoCaptionNodeConfig, ScreenshotAnimationNodeConfig, CreateDmMessage, CreateDmNodeConfig, DestructureSelection, DestructureNodeConfig, VideoGenerationNodeConfig, ArrayType, PortType, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, MediaUse, GetMediaParams, CreateSocialAudioParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, Comment, CommentStatus, CreateCommentParams, CreateCommentResponse, GetCommentsParams, ValidationErrorType, ValidationError, ExportedNode, ExportedConnection, ExportedTemplate, AutomationExport, ExportedExecutor, ExportedEdge, ExportedRun, AutomationRunExport, } from './types';
|
|
22
|
+
export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStatus, PostStat, ApiKey, EditorConfig, VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, TimeMode, SegmentTimelinePosition, ImageEditorNodeConfig, ImageEditorElement, ImageEditorNodeInput, ImageEditorNodeOutput, VideoEditorNodeInput, DimensionPresetKey, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, ResolvedPort, ResolvedPorts, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, ExecutorNode, ExecutionEdge, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, NodeOutputValues, OutputInput, OutputNodeConfig, ObjectSchemaFieldLevel3, ObjectSchemaFieldLevel2, ObjectSchemaField, ManualTriggerOutput, ManualTriggerNodeConfig, TriggerIterationMode, IterationExhaustionBehavior, CollectionSelectionMode, TriggerCollectionConfig, DayOfWeek, RecurrenceMediaOutput, RecurrenceMediaConfig, RecurrenceNodeConfig, AccountNodeConfig, MediaNodeEnabledType, RecurrenceMediaEnabledType, MediaNodeOutput, MediaNodeConfig, PostSchedulingMode, PostSchedulingConfig, AutoPostMode, AutoPostInputType, AutoPostInput, AutoPostNodeConfig, SaveToMediaInput, SaveToMediaNodeConfig, DeduplicateNodeConfig, ForEachOutputProperty, ForEachInputPort, ForEachNodeConfig, RandomValueType, RandomInputPort, RandomNodeMode, RandomNodeConfig, IfLogicOperator, IfBooleanInput, IfPassthroughInput, IfNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, RandomRouteObjectField, RandomRouteNodeConfig, BranchDefinition, BranchValueConfig, BranchPassthroughInput, BranchNodeConfig, VideoImportPlatform, VideoImportQuality, VideoImportNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, AutoCaptionNodeConfig, ScreenshotAnimationNodeConfig, CreateDmMessage, CreateDmNodeConfig, DestructureSelection, DestructureNodeConfig, ImageGenerationTextModel, ImageGenerationEditModel, ImageGenerationModel, ImageGenerationNodeConfig, CustomModelParamType, CustomModelInputParam, CustomModelNodeConfig, VideoGenerationTextToVideoModel, VideoGenerationImageToVideoModel, VideoGenerationModel, VideoGenerationNodeConfig, ArrayType, PortType, LLMOutputField, LLMApiKeys, LLMNodeConfig, UserMedia, SocialAudio, Media, MediaUse, GetMediaParams, CreateSocialAudioParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, Comment, CommentStatus, CreateCommentParams, CreateCommentResponse, GetCommentsParams, ValidationErrorType, ValidationError, ExportedNode, ExportedConnection, ExportedTemplate, AutomationExport, ExportedExecutor, ExportedEdge, ExportedRun, AutomationRunExport, AccountData, FlowControlOutput, NodeType, ExecutorContext, NodeExecutor, ExecutorAsyncJobStatus, AsyncNodeExecutor, } from './types';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Official TypeScript/JavaScript client for the UGC Inc API
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.CommentsClient = exports.MediaClient = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
|
|
8
|
+
exports.CommentsClient = exports.MediaClient = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.isImageToVideoModel = exports.isEditModel = exports.isAsyncExecutor = exports.NodeTypes = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
|
|
9
9
|
var client_1 = require("./client");
|
|
10
10
|
Object.defineProperty(exports, "UGCClient", { enumerable: true, get: function () { return client_1.UGCClient; } });
|
|
11
11
|
var accounts_1 = require("./accounts");
|
|
@@ -25,6 +25,11 @@ Object.defineProperty(exports, "AutomationsClient", { enumerable: true, get: fun
|
|
|
25
25
|
Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function () { return automations_1.getAllNodes; } });
|
|
26
26
|
Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return automations_1.getNodeByType; } });
|
|
27
27
|
Object.defineProperty(exports, "getOutputSchema", { enumerable: true, get: function () { return automations_1.getOutputSchema; } });
|
|
28
|
+
var types_1 = require("./types");
|
|
29
|
+
Object.defineProperty(exports, "NodeTypes", { enumerable: true, get: function () { return types_1.NodeTypes; } });
|
|
30
|
+
Object.defineProperty(exports, "isAsyncExecutor", { enumerable: true, get: function () { return types_1.isAsyncExecutor; } });
|
|
31
|
+
Object.defineProperty(exports, "isEditModel", { enumerable: true, get: function () { return types_1.isEditModel; } });
|
|
32
|
+
Object.defineProperty(exports, "isImageToVideoModel", { enumerable: true, get: function () { return types_1.isImageToVideoModel; } });
|
|
28
33
|
var port_id_1 = require("./port-id");
|
|
29
34
|
Object.defineProperty(exports, "portId", { enumerable: true, get: function () { return port_id_1.portId; } });
|
|
30
35
|
Object.defineProperty(exports, "isValidPortId", { enumerable: true, get: function () { return port_id_1.isValidPortId; } });
|
package/dist/media.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { Media, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, UpdateMediaTagsParams, UpdateMediaTagsResponse, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, CreateSocialAudioParams, GetUploadTokenParams, UploadTokenResponse, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, ApiResponse } from './types';
|
|
2
|
+
import type { Media, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, UpdateMediaTagsParams, UpdateMediaTagsResponse, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, CreateSocialAudioParams, GetUploadTokenParams, UploadTokenResponse, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing media files
|
|
5
5
|
*/
|
|
@@ -59,4 +59,13 @@ export declare class MediaClient extends BaseClient {
|
|
|
59
59
|
* @param params.name - Use case identifier (e.g., "klipy")
|
|
60
60
|
*/
|
|
61
61
|
getMediaUse(params: GetMediaUseParams): Promise<ApiResponse<GetMediaUseResponse>>;
|
|
62
|
+
/**
|
|
63
|
+
* Filter source IDs by usage status
|
|
64
|
+
* Returns which source IDs are available (not used) vs already used
|
|
65
|
+
* When orgId is set on the client, filters by that org only
|
|
66
|
+
* When orgId is not set, checks globally across all orgs
|
|
67
|
+
* @param params.source_ids - Array of source IDs to check
|
|
68
|
+
* @param params.name - Use case identifier (e.g., "profile_picture")
|
|
69
|
+
*/
|
|
70
|
+
filter(params: FilterMediaParams): Promise<ApiResponse<FilterMediaResponse>>;
|
|
62
71
|
}
|
package/dist/media.js
CHANGED
|
@@ -81,5 +81,16 @@ class MediaClient extends base_1.BaseClient {
|
|
|
81
81
|
async getMediaUse(params) {
|
|
82
82
|
return this.post('/media/use', params);
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Filter source IDs by usage status
|
|
86
|
+
* Returns which source IDs are available (not used) vs already used
|
|
87
|
+
* When orgId is set on the client, filters by that org only
|
|
88
|
+
* When orgId is not set, checks globally across all orgs
|
|
89
|
+
* @param params.source_ids - Array of source IDs to check
|
|
90
|
+
* @param params.name - Use case identifier (e.g., "profile_picture")
|
|
91
|
+
*/
|
|
92
|
+
async filter(params) {
|
|
93
|
+
return this.post('/media/filter', params);
|
|
94
|
+
}
|
|
84
95
|
}
|
|
85
96
|
exports.MediaClient = MediaClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render Root Component
|
|
3
|
+
*
|
|
4
|
+
* This file registers all available compositions with the renderer.
|
|
5
|
+
* It serves as the entry point for the renderer bundler.
|
|
6
|
+
*
|
|
7
|
+
* Uses calculateMetadata for ImageEditorComposition to determine
|
|
8
|
+
* dynamic crop dimensions in the browser environment (with DOM access).
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare const RenderRoot: React.FC;
|
|
12
|
+
export default RenderRoot;
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenderRoot = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const ImageEditorComposition_1 = require("./compositions/ImageEditorComposition");
|
|
8
|
+
const VideoEditorComposition_1 = require("./compositions/VideoEditorComposition");
|
|
9
|
+
const AutoCaptionComposition_1 = require("./compositions/AutoCaptionComposition");
|
|
10
|
+
const ScreenshotAnimation_1 = require("./compositions/ScreenshotAnimation");
|
|
11
|
+
const InstagramDmComposition_1 = require("./compositions/InstagramDmComposition");
|
|
12
|
+
const IMessageDmComposition_1 = require("./compositions/IMessageDmComposition");
|
|
13
|
+
const types_1 = require("./compositions/IMessageDmComposition/types");
|
|
14
|
+
const positionResolver_1 = require("./utils/positionResolver");
|
|
15
|
+
const cropBounds_1 = require("./utils/cropBounds");
|
|
16
|
+
const fonts_1 = require("./utils/fonts");
|
|
17
|
+
// Default props for registration (actual props passed at render time)
|
|
18
|
+
const defaultImageProps = {
|
|
19
|
+
config: {
|
|
20
|
+
width: 1080,
|
|
21
|
+
height: 1920,
|
|
22
|
+
fps: 1,
|
|
23
|
+
channels: [],
|
|
24
|
+
},
|
|
25
|
+
sources: {},
|
|
26
|
+
scale: 1,
|
|
27
|
+
};
|
|
28
|
+
const defaultVideoProps = {
|
|
29
|
+
config: {
|
|
30
|
+
width: 1080,
|
|
31
|
+
height: 1920,
|
|
32
|
+
fps: 30,
|
|
33
|
+
channels: [],
|
|
34
|
+
},
|
|
35
|
+
sources: {},
|
|
36
|
+
scale: 1,
|
|
37
|
+
};
|
|
38
|
+
const defaultAutoCaptionProps = {
|
|
39
|
+
videoUrl: '',
|
|
40
|
+
width: 1080,
|
|
41
|
+
height: 1920,
|
|
42
|
+
durationMs: 1000,
|
|
43
|
+
captions: [],
|
|
44
|
+
style: {
|
|
45
|
+
fontName: 'Montserrat',
|
|
46
|
+
fontSize: 80,
|
|
47
|
+
fontWeight: 'black',
|
|
48
|
+
fontColor: '#FFFFFF',
|
|
49
|
+
highlightColor: '#FFFF00',
|
|
50
|
+
strokeColor: '#000000',
|
|
51
|
+
strokeWidth: 3,
|
|
52
|
+
position: 'bottom',
|
|
53
|
+
yOffset: 100,
|
|
54
|
+
maxWidth: 90,
|
|
55
|
+
enableAnimation: true,
|
|
56
|
+
wordsPerPage: 3,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
const defaultScreenshotAnimationProps = {
|
|
60
|
+
imageUrl: 'https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3163-RY0CFNrbnSnqZpaJzi9VdslzfYLLKf.png',
|
|
61
|
+
width: 1206,
|
|
62
|
+
height: 2622,
|
|
63
|
+
pauseDurationMs: 1000,
|
|
64
|
+
flashDurationMs: 255,
|
|
65
|
+
holdDurationMs: 500,
|
|
66
|
+
borderRadius: 35,
|
|
67
|
+
borderColor: 'rgba(254, 255, 255, 1)',
|
|
68
|
+
backgroundColor: '#000000',
|
|
69
|
+
};
|
|
70
|
+
const screenshotAnimationSchema = zod_1.z.object({
|
|
71
|
+
imageUrl: zod_1.z.string().describe('URL of the image being screenshotted'),
|
|
72
|
+
width: zod_1.z.number().optional().default(1206).describe('Canvas width (px)'),
|
|
73
|
+
height: zod_1.z.number().optional().default(2622).describe('Canvas height (px)'),
|
|
74
|
+
pauseDurationMs: zod_1.z.number().optional().default(1000).describe('Pause before flash (ms)'),
|
|
75
|
+
flashDurationMs: zod_1.z.number().optional().default(255).describe('Flash phase duration (ms)'),
|
|
76
|
+
holdDurationMs: zod_1.z.number().optional().default(500).describe('Hold at end after animation (ms)'),
|
|
77
|
+
borderRadius: zod_1.z.number().optional().default(35).describe('Border corner radius (px)'),
|
|
78
|
+
borderColor: zod_1.z.string().optional().default('rgba(254, 255, 255, 1)').describe('Border color'),
|
|
79
|
+
backgroundColor: zod_1.z.string().optional().default('#000000').describe('Background color'),
|
|
80
|
+
});
|
|
81
|
+
// Gradient color schema
|
|
82
|
+
const gradientColorSchema = zod_1.z.object({
|
|
83
|
+
type: zod_1.z.enum(['solid', 'linear']).describe('Color type'),
|
|
84
|
+
colors: zod_1.z.array(zod_1.z.string()).describe('Color values'),
|
|
85
|
+
angle: zod_1.z.number().optional().describe('Gradient angle in degrees'),
|
|
86
|
+
});
|
|
87
|
+
// Message reaction schema
|
|
88
|
+
const messageReactionSchema = zod_1.z.object({
|
|
89
|
+
emoji: zod_1.z.string().describe('Reaction emoji'),
|
|
90
|
+
fromUser: zod_1.z.boolean().describe('Is reaction from user'),
|
|
91
|
+
});
|
|
92
|
+
// Base message schema
|
|
93
|
+
const baseMessageSchema = zod_1.z.object({
|
|
94
|
+
id: zod_1.z.string().describe('Message ID'),
|
|
95
|
+
sender: zod_1.z.enum(['user', 'recipient']).describe('Message sender'),
|
|
96
|
+
reaction: messageReactionSchema.optional().describe('Message reaction'),
|
|
97
|
+
});
|
|
98
|
+
// Text message schema
|
|
99
|
+
const textMessageSchema = baseMessageSchema.extend({
|
|
100
|
+
type: zod_1.z.literal('text'),
|
|
101
|
+
text: zod_1.z.string().describe('Message text'),
|
|
102
|
+
});
|
|
103
|
+
// Image message schema
|
|
104
|
+
const imageMessageSchema = baseMessageSchema.extend({
|
|
105
|
+
type: zod_1.z.literal('image'),
|
|
106
|
+
imageInputId: zod_1.z.string().describe('Image input ID'),
|
|
107
|
+
});
|
|
108
|
+
// Story reply message schema
|
|
109
|
+
const storyReplyMessageSchema = baseMessageSchema.extend({
|
|
110
|
+
type: zod_1.z.literal('story-reply'),
|
|
111
|
+
storyLabel: zod_1.z.string().describe('Story reply label'),
|
|
112
|
+
imageInputId: zod_1.z.string().describe('Story image input ID'),
|
|
113
|
+
replyText: zod_1.z.string().optional().describe('Reply text'),
|
|
114
|
+
});
|
|
115
|
+
// Combined message schema
|
|
116
|
+
const igMessageSchema = zod_1.z.discriminatedUnion('type', [
|
|
117
|
+
textMessageSchema,
|
|
118
|
+
imageMessageSchema,
|
|
119
|
+
storyReplyMessageSchema,
|
|
120
|
+
]);
|
|
121
|
+
// User profile schema
|
|
122
|
+
const igUserProfileSchema = zod_1.z.object({
|
|
123
|
+
username: zod_1.z.string().describe('Username'),
|
|
124
|
+
displayName: zod_1.z.string().optional().describe('Display name'),
|
|
125
|
+
avatarInputId: zod_1.z.string().describe('Avatar image input ID'),
|
|
126
|
+
verified: zod_1.z.boolean().optional().describe('Is verified'),
|
|
127
|
+
isActive: zod_1.z.boolean().optional().describe('Is active now'),
|
|
128
|
+
});
|
|
129
|
+
// Status bar schema
|
|
130
|
+
const igStatusBarSchema = zod_1.z.object({
|
|
131
|
+
time: zod_1.z.string().describe('Status bar time'),
|
|
132
|
+
showCellular: zod_1.z.boolean().optional().default(true).describe('Show cellular icon'),
|
|
133
|
+
showWifi: zod_1.z.boolean().optional().default(true).describe('Show WiFi icon'),
|
|
134
|
+
showBattery: zod_1.z.boolean().optional().default(true).describe('Show battery icon'),
|
|
135
|
+
batteryLevel: zod_1.z.number().gte(0).lte(100).optional().default(100).describe('Battery level 0-100'),
|
|
136
|
+
isCharging: zod_1.z.boolean().optional().default(false).describe('Is charging'),
|
|
137
|
+
});
|
|
138
|
+
// Header config schema
|
|
139
|
+
const igHeaderConfigSchema = zod_1.z.object({
|
|
140
|
+
height: zod_1.z.number().default(160).describe('Header height (px)'),
|
|
141
|
+
showBackButton: zod_1.z.boolean().default(true).describe('Show back button'),
|
|
142
|
+
showVideoCallButton: zod_1.z.boolean().default(true).describe('Show video call button'),
|
|
143
|
+
showCallButton: zod_1.z.boolean().default(true).describe('Show call button'),
|
|
144
|
+
showInfoButton: zod_1.z.boolean().default(true).describe('Show info button'),
|
|
145
|
+
});
|
|
146
|
+
// Footer config schema
|
|
147
|
+
const igFooterConfigSchema = zod_1.z.object({
|
|
148
|
+
height: zod_1.z.number().default(130).describe('Footer height (px)'),
|
|
149
|
+
showCamera: zod_1.z.boolean().default(true).describe('Show camera button'),
|
|
150
|
+
showGallery: zod_1.z.boolean().default(true).describe('Show gallery button'),
|
|
151
|
+
showMic: zod_1.z.boolean().default(true).describe('Show mic button'),
|
|
152
|
+
showSticker: zod_1.z.boolean().default(true).describe('Show sticker button'),
|
|
153
|
+
placeholderText: zod_1.z.string().default('Message...').describe('Input placeholder'),
|
|
154
|
+
inputText: zod_1.z.string().optional().describe('Text in input field'),
|
|
155
|
+
});
|
|
156
|
+
// Message style schema
|
|
157
|
+
const igMessageStyleSchema = zod_1.z.object({
|
|
158
|
+
// Text styling
|
|
159
|
+
fontSize: zod_1.z.number().default(42).describe('Font size (px)'),
|
|
160
|
+
fontWeight: zod_1.z.enum(['normal', 'bold']).default('normal').describe('Font weight'),
|
|
161
|
+
lineHeight: zod_1.z.number().default(1.35).describe('Line height multiplier'),
|
|
162
|
+
letterSpacing: zod_1.z.number().default(0).describe('Letter spacing (px)'),
|
|
163
|
+
// Bubble colors
|
|
164
|
+
userBubbleColor: gradientColorSchema.default({ type: 'solid', colors: ['#3797F0'] }).describe('User bubble color'),
|
|
165
|
+
recipientBubbleColor: gradientColorSchema.default({ type: 'solid', colors: ['#262626'] }).describe('Recipient bubble color'),
|
|
166
|
+
userTextColor: zod_1.z.string().default('#FFFFFF').describe('User text color'),
|
|
167
|
+
recipientTextColor: zod_1.z.string().default('#FFFFFF').describe('Recipient text color'),
|
|
168
|
+
// Bubble sizing
|
|
169
|
+
bubbleMaxWidth: zod_1.z.number().default(70).describe('Max bubble width (%)'),
|
|
170
|
+
bubblePaddingH: zod_1.z.number().default(20).describe('Bubble horizontal padding (px)'),
|
|
171
|
+
bubblePaddingV: zod_1.z.number().default(14).describe('Bubble vertical padding (px)'),
|
|
172
|
+
// Corner radii
|
|
173
|
+
bubbleRadiusOuter: zod_1.z.number().default(28).describe('Outer corner radius (px)'),
|
|
174
|
+
bubbleRadiusInner: zod_1.z.number().default(6).describe('Inner corner radius (px)'),
|
|
175
|
+
// Spacing
|
|
176
|
+
messageGapInGroup: zod_1.z.number().default(3).describe('Gap between messages in group (px)'),
|
|
177
|
+
messageGapBetweenGroups: zod_1.z.number().default(16).describe('Gap between groups (px)'),
|
|
178
|
+
sideMargin: zod_1.z.number().default(24).describe('Side margin (px)'),
|
|
179
|
+
// Media
|
|
180
|
+
mediaMaxWidth: zod_1.z.number().default(340).describe('Media max width (px)'),
|
|
181
|
+
mediaMaxHeight: zod_1.z.number().default(450).describe('Media max height (px)'),
|
|
182
|
+
mediaBorderRadius: zod_1.z.number().default(26).describe('Media border radius (px)'),
|
|
183
|
+
// Story reply
|
|
184
|
+
storyReplyLabelColor: zod_1.z.string().default('#A8A8A8').describe('Story label color'),
|
|
185
|
+
storyReplyLabelSize: zod_1.z.number().default(30).describe('Story label font size (px)'),
|
|
186
|
+
storyImageSize: zod_1.z.number().default(140).describe('Story image size (px)'),
|
|
187
|
+
storyImageRadius: zod_1.z.number().default(12).describe('Story image radius (px)'),
|
|
188
|
+
// Reactions
|
|
189
|
+
reactionSize: zod_1.z.number().default(32).describe('Reaction emoji size (px)'),
|
|
190
|
+
reactionBubbleColor: zod_1.z.string().default('#363636').describe('Reaction bubble color'),
|
|
191
|
+
reactionBorderRadius: zod_1.z.number().default(16).describe('Reaction border radius (px)'),
|
|
192
|
+
reactionOffsetY: zod_1.z.number().default(-10).describe('Reaction Y offset (px)'),
|
|
193
|
+
// Typing indicator
|
|
194
|
+
typingDotSize: zod_1.z.number().default(12).describe('Typing dot size (px)'),
|
|
195
|
+
typingDotColor: zod_1.z.string().default('#A8A8A8').describe('Typing dot color'),
|
|
196
|
+
typingDotSpacing: zod_1.z.number().default(6).describe('Typing dot spacing (px)'),
|
|
197
|
+
typingBubblePaddingH: zod_1.z.number().default(24).describe('Typing bubble H padding (px)'),
|
|
198
|
+
typingBubblePaddingV: zod_1.z.number().default(20).describe('Typing bubble V padding (px)'),
|
|
199
|
+
// Profile picture
|
|
200
|
+
profilePicSize: zod_1.z.number().default(44).describe('Profile pic size (px)'),
|
|
201
|
+
profilePicGap: zod_1.z.number().default(12).describe('Profile pic gap (px)'),
|
|
202
|
+
});
|
|
203
|
+
// Read receipt schema
|
|
204
|
+
const readReceiptSchema = zod_1.z.object({
|
|
205
|
+
state: zod_1.z.enum(['none', 'sent', 'delivered', 'seen']).describe('Receipt state'),
|
|
206
|
+
showAvatar: zod_1.z.boolean().optional().describe('Show avatar for seen'),
|
|
207
|
+
timestamp: zod_1.z.string().optional().describe('Timestamp text'),
|
|
208
|
+
});
|
|
209
|
+
// Main Instagram DM composition schema (simplified - composition stripped down)
|
|
210
|
+
const instagramDmSchema = zod_1.z.object({
|
|
211
|
+
// Debug overlay
|
|
212
|
+
showDebugOverlay: zod_1.z.boolean().optional().default(true).describe('Show debug overlay with mouse coordinates'),
|
|
213
|
+
// Reference overlay
|
|
214
|
+
referenceImageUrl: zod_1.z.string().optional().default('https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3153-TiJrpzJKKvsTsjmP9zIX5LpoT8s2hF.png').describe('Reference screenshot URL'),
|
|
215
|
+
showReferenceImage: zod_1.z.boolean().optional().default(true).describe('Show/hide reference image'),
|
|
216
|
+
referenceOpacity: zod_1.z.number().min(0).max(100).optional().default(50).describe('Reference overlay opacity (0-100)'),
|
|
217
|
+
// Canvas
|
|
218
|
+
width: zod_1.z.number().optional().default(1206).describe('Canvas width (px)'),
|
|
219
|
+
height: zod_1.z.number().optional().default(2622).describe('Canvas height (px)'),
|
|
220
|
+
durationInFrames: zod_1.z.number().optional().default(90).describe('Duration in frames'),
|
|
221
|
+
fps: zod_1.z.number().optional().default(30).describe('Frames per second'),
|
|
222
|
+
// Theme
|
|
223
|
+
theme: zod_1.z.enum(['light', 'dark']).describe('Color theme'),
|
|
224
|
+
// Footer position/style
|
|
225
|
+
footerTop: zod_1.z.number().optional().default(2363).describe('Footer top Y position'),
|
|
226
|
+
footerBottom: zod_1.z.number().optional().default(2496).describe('Footer bottom Y position'),
|
|
227
|
+
footerLeft: zod_1.z.number().optional().default(24).describe('Footer left X position'),
|
|
228
|
+
footerRight: zod_1.z.number().optional().default(1181).describe('Footer right X position'),
|
|
229
|
+
footerBgColor: zod_1.z.string().optional().default('#0a0a0a').describe('Footer background color'),
|
|
230
|
+
// Camera button position/style
|
|
231
|
+
cameraBtnTop: zod_1.z.number().optional().default(2379).describe('Camera button top Y'),
|
|
232
|
+
cameraBtnBottom: zod_1.z.number().optional().default(2481).describe('Camera button bottom Y'),
|
|
233
|
+
cameraBtnLeft: zod_1.z.number().optional().default(39).describe('Camera button left X'),
|
|
234
|
+
cameraBtnRight: zod_1.z.number().optional().default(141).describe('Camera button right X'),
|
|
235
|
+
cameraBtnBgColor: zod_1.z.string().optional().default('#5354fc').describe('Camera button background color'),
|
|
236
|
+
// Camera icon position
|
|
237
|
+
cameraIconTop: zod_1.z.number().optional().default(2400).describe('Camera icon top Y'),
|
|
238
|
+
cameraIconBottom: zod_1.z.number().optional().default(2455).describe('Camera icon bottom Y'),
|
|
239
|
+
cameraIconLeft: zod_1.z.number().optional().default(61).describe('Camera icon left X'),
|
|
240
|
+
cameraIconRight: zod_1.z.number().optional().default(119).describe('Camera icon right X'),
|
|
241
|
+
// Circle plus icon position (rightmost)
|
|
242
|
+
circlePlusIconTop: zod_1.z.number().optional().default(2395).describe('Circle plus icon top Y'),
|
|
243
|
+
circlePlusIconBottom: zod_1.z.number().optional().default(2465).describe('Circle plus icon bottom Y'),
|
|
244
|
+
circlePlusIconLeft: zod_1.z.number().optional().default(1051).describe('Circle plus icon left X'),
|
|
245
|
+
circlePlusIconRight: zod_1.z.number().optional().default(1121).describe('Circle plus icon right X'),
|
|
246
|
+
// Smile sticker icon position
|
|
247
|
+
smileStickerIconTop: zod_1.z.number().optional().default(2397).describe('Smile sticker icon top Y'),
|
|
248
|
+
smileStickerIconBottom: zod_1.z.number().optional().default(2463).describe('Smile sticker icon bottom Y'),
|
|
249
|
+
smileStickerIconLeft: zod_1.z.number().optional().default(933).describe('Smile sticker icon left X'),
|
|
250
|
+
smileStickerIconRight: zod_1.z.number().optional().default(999).describe('Smile sticker icon right X'),
|
|
251
|
+
// Camera roll icon position
|
|
252
|
+
cameraRollIconTop: zod_1.z.number().optional().default(2397).describe('Camera roll icon top Y'),
|
|
253
|
+
cameraRollIconBottom: zod_1.z.number().optional().default(2463).describe('Camera roll icon bottom Y'),
|
|
254
|
+
cameraRollIconLeft: zod_1.z.number().optional().default(813).describe('Camera roll icon left X'),
|
|
255
|
+
cameraRollIconRight: zod_1.z.number().optional().default(879).describe('Camera roll icon right X'),
|
|
256
|
+
// Microphone icon position (leftmost of right group)
|
|
257
|
+
microphoneIconTop: zod_1.z.number().optional().default(2397).describe('Microphone icon top Y'),
|
|
258
|
+
microphoneIconBottom: zod_1.z.number().optional().default(2463).describe('Microphone icon bottom Y'),
|
|
259
|
+
microphoneIconLeft: zod_1.z.number().optional().default(706).describe('Microphone icon left X'),
|
|
260
|
+
microphoneIconRight: zod_1.z.number().optional().default(758).describe('Microphone icon right X'),
|
|
261
|
+
// Message text
|
|
262
|
+
messageTextTop: zod_1.z.number().optional().default(2412).describe('Message text top Y'),
|
|
263
|
+
messageTextBottom: zod_1.z.number().optional().default(2445).describe('Message text bottom Y'),
|
|
264
|
+
messageTextLeft: zod_1.z.number().optional().default(169).describe('Message text left X'),
|
|
265
|
+
messageTextRight: zod_1.z.number().optional().default(650).describe('Message text right X'),
|
|
266
|
+
messageTextFontSize: zod_1.z.number().optional().default(48).describe('Message text font size'),
|
|
267
|
+
messageTextLetterSpacing: zod_1.z.number().optional().default(1.7).describe('Letter spacing'),
|
|
268
|
+
messageTextColor: zod_1.z.string().optional().default('#a0a8b3').describe('Message text color'),
|
|
269
|
+
messageText: zod_1.z.string().optional().default('Message...').describe('Message placeholder text'),
|
|
270
|
+
// Home indicator (bottom bar)
|
|
271
|
+
homeIndicatorTop: zod_1.z.number().optional().default(2583).describe('Home indicator top Y'),
|
|
272
|
+
homeIndicatorBottom: zod_1.z.number().optional().default(2597).describe('Home indicator bottom Y'),
|
|
273
|
+
homeIndicatorLeft: zod_1.z.number().optional().default(387).describe('Home indicator left X'),
|
|
274
|
+
homeIndicatorRight: zod_1.z.number().optional().default(818).describe('Home indicator right X'),
|
|
275
|
+
homeIndicatorColor: zod_1.z.string().optional().default('#ffffff').describe('Home indicator color'),
|
|
276
|
+
// Messages
|
|
277
|
+
messages: zod_1.z.array(zod_1.z.object({
|
|
278
|
+
id: zod_1.z.string().describe('Message ID'),
|
|
279
|
+
sender: zod_1.z.enum(['user', 'recipient']).describe('Message sender'),
|
|
280
|
+
text: zod_1.z.string().describe('Message text'),
|
|
281
|
+
groupWithPrevious: zod_1.z.boolean().optional().describe('Group with previous message (6px gap)'),
|
|
282
|
+
})).optional().default([]).describe('Array of messages'),
|
|
283
|
+
// Message area bounds
|
|
284
|
+
messageAreaTop: zod_1.z.number().optional().default(353).describe('Message area top Y (cutoff)'),
|
|
285
|
+
messageAreaBottom: zod_1.z.number().optional().default(2340).describe('Message area bottom Y (start)'),
|
|
286
|
+
// Message colors
|
|
287
|
+
recipientBubbleColor: zod_1.z.string().optional().default('#25282d').describe('Recipient bubble color'),
|
|
288
|
+
senderGradientTop: zod_1.z.string().optional().default('#b932d6').describe('Sender gradient top color'),
|
|
289
|
+
senderGradientMiddle: zod_1.z.string().optional().default('#7d38f6').describe('Sender gradient middle color'),
|
|
290
|
+
senderGradientBottom: zod_1.z.string().optional().default('#5751f9').describe('Sender gradient bottom color'),
|
|
291
|
+
bubbleTextColor: zod_1.z.string().optional().default('#f9f9f9').describe('Bubble text color'),
|
|
292
|
+
// Message typography
|
|
293
|
+
messageFontSize: zod_1.z.number().optional().default(51).describe('Message font size'),
|
|
294
|
+
messageLineHeight: zod_1.z.number().optional().default(60).describe('Message line height'),
|
|
295
|
+
messageLetterSpacing: zod_1.z.number().step(0.1).optional().default(0.8).describe('Message letter spacing'),
|
|
296
|
+
// Message padding
|
|
297
|
+
messagePaddingTop: zod_1.z.number().optional().default(27).describe('Message padding top'),
|
|
298
|
+
messagePaddingBottom: zod_1.z.number().optional().default(33).describe('Message padding bottom'),
|
|
299
|
+
sentMessagePaddingLeft: zod_1.z.number().optional().default(31).describe('Left padding for sent messages'),
|
|
300
|
+
sentMessagePaddingRight: zod_1.z.number().optional().default(38).describe('Right padding for sent messages'),
|
|
301
|
+
receivedMessagePaddingLeft: zod_1.z.number().optional().default(37).describe('Left padding for received messages'),
|
|
302
|
+
receivedMessagePaddingRight: zod_1.z.number().optional().default(28).describe('Right padding for received messages'),
|
|
303
|
+
multiLineSentMessagePaddingRight: zod_1.z.number().optional().default(51).describe('Right padding for multi-line sender messages'),
|
|
304
|
+
multiLineSentMessagePaddingLeft: zod_1.z.number().optional().default(31).describe('Left padding for multi-line sender messages'),
|
|
305
|
+
multiLineRecMessagePaddingRight: zod_1.z.number().optional().default(48).describe('Right padding for multi-line recipient messages'),
|
|
306
|
+
// Bubble corner radii
|
|
307
|
+
bubbleRadiusNormal: zod_1.z.number().optional().default(57).describe('Normal bubble corner radius'),
|
|
308
|
+
bubbleRadiusGrouped: zod_1.z.number().optional().default(12).describe('Grouped bubble corner radius'),
|
|
309
|
+
// Message spacing
|
|
310
|
+
messageGapInGroup: zod_1.z.number().optional().default(6).describe('Gap between messages in group'),
|
|
311
|
+
messageGapSameUser: zod_1.z.number().optional().default(36).describe('Gap between messages from same user'),
|
|
312
|
+
messageGapDifferentUser: zod_1.z.number().optional().default(36).describe('Gap between messages from different users'),
|
|
313
|
+
// Bubble positioning
|
|
314
|
+
recipientBubbleLeft: zod_1.z.number().optional().default(168).describe('Recipient bubble left X'),
|
|
315
|
+
senderBubbleRight: zod_1.z.number().optional().default(1182).describe('Sender bubble right X'),
|
|
316
|
+
bubbleMaxWidth: zod_1.z.number().optional().default(866).describe('Max bubble width'),
|
|
317
|
+
// Profile picture
|
|
318
|
+
profilePicUrl: zod_1.z.string().optional().default('').describe('Recipient profile picture URL'),
|
|
319
|
+
profilePicSize: zod_1.z.number().optional().default(83).describe('Profile picture size'),
|
|
320
|
+
profilePicGap: zod_1.z.number().optional().default(37).describe('Gap between profile pic and bubble'),
|
|
321
|
+
// Header - Back arrow
|
|
322
|
+
backArrowTop: zod_1.z.number().optional().default(240).describe('Back arrow top Y'),
|
|
323
|
+
backArrowBottom: zod_1.z.number().optional().default(300).describe('Back arrow bottom Y'),
|
|
324
|
+
backArrowLeft: zod_1.z.number().optional().default(78).describe('Back arrow left X'),
|
|
325
|
+
backArrowRight: zod_1.z.number().optional().default(111).describe('Back arrow right X'),
|
|
326
|
+
// Header - User profile picture
|
|
327
|
+
userPfpUrl: zod_1.z.string().optional().default('https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/884a81ce74fa88e229f6be5f76f29385-3P4rjQqfbLidxtZ7OmvgaDQNMSSIGi.jpg').describe('User profile picture URL'),
|
|
328
|
+
userPfpTop: zod_1.z.number().optional().default(220).describe('User pfp top Y'),
|
|
329
|
+
userPfpBottom: zod_1.z.number().optional().default(320).describe('User pfp bottom Y'),
|
|
330
|
+
userPfpLeft: zod_1.z.number().optional().default(179).describe('User pfp left X'),
|
|
331
|
+
userPfpRight: zod_1.z.number().optional().default(277).describe('User pfp right X'),
|
|
332
|
+
// Header - User story ring
|
|
333
|
+
userHasStory: zod_1.z.boolean().optional().default(false).describe('Show story ring around user pfp'),
|
|
334
|
+
userStoryRingColor: zod_1.z.string().optional().default('#5e656d').describe('Story ring color'),
|
|
335
|
+
userStoryRingTop: zod_1.z.number().optional().default(210).describe('Story ring outer top Y'),
|
|
336
|
+
userStoryRingBottom: zod_1.z.number().optional().default(330).describe('Story ring outer bottom Y'),
|
|
337
|
+
userStoryRingLeft: zod_1.z.number().optional().default(168).describe('Story ring outer left X'),
|
|
338
|
+
userStoryRingRight: zod_1.z.number().optional().default(288).describe('Story ring outer right X'),
|
|
339
|
+
userStoryRingWidth: zod_1.z.number().optional().default(6).describe('Story ring width'),
|
|
340
|
+
// Header - No notifications icon
|
|
341
|
+
noNotisTop: zod_1.z.number().optional().default(77).describe('No notifications top Y'),
|
|
342
|
+
noNotisBottom: zod_1.z.number().optional().default(120).describe('No notifications bottom Y'),
|
|
343
|
+
noNotisLeft: zod_1.z.number().optional().default(272).describe('No notifications left X'),
|
|
344
|
+
noNotisRight: zod_1.z.number().optional().default(312).describe('No notifications right X'),
|
|
345
|
+
// Header - Smile plus icon
|
|
346
|
+
smilePlusTop: zod_1.z.number().optional().default(234).describe('Smile plus top Y'),
|
|
347
|
+
smilePlusBottom: zod_1.z.number().optional().default(306).describe('Smile plus bottom Y'),
|
|
348
|
+
smilePlusLeft: zod_1.z.number().optional().default(663).describe('Smile plus left X'),
|
|
349
|
+
smilePlusRight: zod_1.z.number().optional().default(735).describe('Smile plus right X'),
|
|
350
|
+
// Header - Phone icon
|
|
351
|
+
phoneIconTop: zod_1.z.number().optional().default(237).describe('Phone icon top Y'),
|
|
352
|
+
phoneIconBottom: zod_1.z.number().optional().default(303).describe('Phone icon bottom Y'),
|
|
353
|
+
phoneIconLeft: zod_1.z.number().optional().default(807).describe('Phone icon left X'),
|
|
354
|
+
phoneIconRight: zod_1.z.number().optional().default(873).describe('Phone icon right X'),
|
|
355
|
+
// Header - Video icon
|
|
356
|
+
videoIconTop: zod_1.z.number().optional().default(240).describe('Video icon top Y'),
|
|
357
|
+
videoIconBottom: zod_1.z.number().optional().default(300).describe('Video icon bottom Y'),
|
|
358
|
+
videoIconLeft: zod_1.z.number().optional().default(948).describe('Video icon left X'),
|
|
359
|
+
videoIconRight: zod_1.z.number().optional().default(1020).describe('Video icon right X'),
|
|
360
|
+
// Header - Flag icon
|
|
361
|
+
flagTop: zod_1.z.number().optional().default(237).describe('Flag icon top Y'),
|
|
362
|
+
flagBottom: zod_1.z.number().optional().default(303).describe('Flag icon bottom Y'),
|
|
363
|
+
flagLeft: zod_1.z.number().optional().default(1098).describe('Flag icon left X'),
|
|
364
|
+
flagRight: zod_1.z.number().optional().default(1153).describe('Flag icon right X'),
|
|
365
|
+
// Status bar - Cell signal (0-4)
|
|
366
|
+
cellLevel: zod_1.z.number().min(0).max(4).optional().default(4).describe('Cell signal level (0-4)'),
|
|
367
|
+
cell1Top: zod_1.z.number().optional().default(102).describe('Cell bar 1 top Y'),
|
|
368
|
+
cell1Bottom: zod_1.z.number().optional().default(116).describe('Cell bar 1 bottom Y'),
|
|
369
|
+
cell1Left: zod_1.z.number().optional().default(865).describe('Cell bar 1 left X'),
|
|
370
|
+
cell1Right: zod_1.z.number().optional().default(875).describe('Cell bar 1 right X'),
|
|
371
|
+
cell2Top: zod_1.z.number().optional().default(95).describe('Cell bar 2 top Y'),
|
|
372
|
+
cell2Bottom: zod_1.z.number().optional().default(116).describe('Cell bar 2 bottom Y'),
|
|
373
|
+
cell2Left: zod_1.z.number().optional().default(881).describe('Cell bar 2 left X'),
|
|
374
|
+
cell2Right: zod_1.z.number().optional().default(891).describe('Cell bar 2 right X'),
|
|
375
|
+
cell3Top: zod_1.z.number().optional().default(87).describe('Cell bar 3 top Y'),
|
|
376
|
+
cell3Bottom: zod_1.z.number().optional().default(116).describe('Cell bar 3 bottom Y'),
|
|
377
|
+
cell3Left: zod_1.z.number().optional().default(897).describe('Cell bar 3 left X'),
|
|
378
|
+
cell3Right: zod_1.z.number().optional().default(907).describe('Cell bar 3 right X'),
|
|
379
|
+
cell4Top: zod_1.z.number().optional().default(79).describe('Cell bar 4 top Y'),
|
|
380
|
+
cell4Bottom: zod_1.z.number().optional().default(116).describe('Cell bar 4 bottom Y'),
|
|
381
|
+
cell4Left: zod_1.z.number().optional().default(913).describe('Cell bar 4 left X'),
|
|
382
|
+
cell4Right: zod_1.z.number().optional().default(923).describe('Cell bar 4 right X'),
|
|
383
|
+
// Status bar - WiFi icon
|
|
384
|
+
wifiTop: zod_1.z.number().optional().default(79).describe('WiFi icon top Y'),
|
|
385
|
+
wifiBottom: zod_1.z.number().optional().default(116).describe('WiFi icon bottom Y'),
|
|
386
|
+
wifiLeft: zod_1.z.number().optional().default(945).describe('WiFi icon left X'),
|
|
387
|
+
wifiRight: zod_1.z.number().optional().default(996).describe('WiFi icon right X'),
|
|
388
|
+
// Status bar - Battery icon
|
|
389
|
+
batteryTop: zod_1.z.number().optional().default(78).describe('Battery icon top Y'),
|
|
390
|
+
batteryBottom: zod_1.z.number().optional().default(117).describe('Battery icon bottom Y'),
|
|
391
|
+
batteryLeft: zod_1.z.number().optional().default(1018).describe('Battery icon left X'),
|
|
392
|
+
batteryRight: zod_1.z.number().optional().default(1100).describe('Battery icon right X'),
|
|
393
|
+
// Status bar - Time display
|
|
394
|
+
time: zod_1.z.string().optional().default('9:41').describe('Time string to display'),
|
|
395
|
+
timeRight: zod_1.z.number().optional().default(262).describe('Time text right X (right-aligned)'),
|
|
396
|
+
timeBottom: zod_1.z.number().optional().default(125).describe('Time text bottom Y'),
|
|
397
|
+
timeFontSize: zod_1.z.number().optional().default(52).describe('Time font size'),
|
|
398
|
+
timeLetterSpacing: zod_1.z.number().optional().default(1.6).describe('Time letter spacing'),
|
|
399
|
+
// Header - Sender username (shown in two places)
|
|
400
|
+
senderUsername: zod_1.z.string().optional().default('cheatmate_io').describe('Sender username'),
|
|
401
|
+
usernameLeft: zod_1.z.number().optional().default(306).describe('Username left X'),
|
|
402
|
+
username1Bottom: zod_1.z.number().optional().default(271).describe('Username 1 bottom Y (bold)'),
|
|
403
|
+
username1FontSize: zod_1.z.number().optional().default(51).describe('Username 1 font size'),
|
|
404
|
+
username1LetterSpacing: zod_1.z.number().optional().default(-0.2).describe('Username 1 letter spacing'),
|
|
405
|
+
username2Bottom: zod_1.z.number().optional().default(322).describe('Username 2 bottom Y'),
|
|
406
|
+
username2FontSize: zod_1.z.number().optional().default(41).describe('Username 2 font size'),
|
|
407
|
+
username2LetterSpacing: zod_1.z.number().optional().default(-0.4).describe('Username 2 letter spacing'),
|
|
408
|
+
// Header - Username right arrow icon
|
|
409
|
+
usernameArrowTop: zod_1.z.number().optional().default(231).describe('Username arrow top Y'),
|
|
410
|
+
usernameArrowBottom: zod_1.z.number().optional().default(260).describe('Username arrow bottom Y'),
|
|
411
|
+
usernameArrowLeft: zod_1.z.number().optional().default(619).describe('Username arrow left X'),
|
|
412
|
+
usernameArrowRight: zod_1.z.number().optional().default(636).describe('Username arrow right X'),
|
|
413
|
+
// Story reply (sender) - image
|
|
414
|
+
storyReplyImageWidth: zod_1.z.number().optional().default(263).describe('Story reply image width'),
|
|
415
|
+
storyReplyImageHeight: zod_1.z.number().optional().default(467).describe('Story reply image height'),
|
|
416
|
+
storyReplyImageRight: zod_1.z.number().optional().default(1133).describe('Story reply image right X'),
|
|
417
|
+
storyReplyImageGap: zod_1.z.number().optional().default(24).describe('Gap between story image and message'),
|
|
418
|
+
storyReplyImageBorderRadius: zod_1.z.number().optional().default(44).describe('Story reply image corner radius'),
|
|
419
|
+
// Story reply (sender) - side bar
|
|
420
|
+
storyReplyBarLeft: zod_1.z.number().optional().default(1170).describe('Story reply bar left X'),
|
|
421
|
+
storyReplyBarRight: zod_1.z.number().optional().default(1181).describe('Story reply bar right X'),
|
|
422
|
+
// Story reply (sender) - "You replied to their story" text
|
|
423
|
+
storyReplyTextLeft: zod_1.z.number().optional().default(728).describe('Story reply text left X'),
|
|
424
|
+
storyReplyTextGap: zod_1.z.number().optional().default(22).describe('Gap between text and story image'),
|
|
425
|
+
storyReplyTextFontSize: zod_1.z.number().optional().default(36).describe('Story reply text font size'),
|
|
426
|
+
storyReplyTextLetterSpacing: zod_1.z.number().optional().default(2.25).describe('Story reply text letter spacing'),
|
|
427
|
+
// Divider line
|
|
428
|
+
dividerLineY: zod_1.z.number().optional().default(353).describe('Divider line Y position'),
|
|
429
|
+
dividerLineColor: zod_1.z.string().optional().default('#25282d').describe('Divider line color'),
|
|
430
|
+
});
|
|
431
|
+
// Cast components to work around renderer's strict typing
|
|
432
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
433
|
+
const ImageComp = ImageEditorComposition_1.ImageEditorComposition;
|
|
434
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
435
|
+
const VideoComp = VideoEditorComposition_1.VideoEditorComposition;
|
|
436
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
437
|
+
const AutoCaptionComp = AutoCaptionComposition_1.AutoCaptionComposition;
|
|
438
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
439
|
+
const ScreenshotAnimationComp = ScreenshotAnimation_1.ScreenshotAnimation;
|
|
440
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
441
|
+
const InstagramDmComp = InstagramDmComposition_1.InstagramDmComposition;
|
|
442
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
443
|
+
const IMessageDmComp = IMessageDmComposition_1.IMessageDmComposition;
|
|
444
|
+
/**
|
|
445
|
+
* calculateMetadata for ImageEditorComposition
|
|
446
|
+
*
|
|
447
|
+
* This runs in the browser environment BEFORE the composition renders.
|
|
448
|
+
* It calculates the correct output dimensions based on dynamic cropping,
|
|
449
|
+
* using real DOM measurement for accurate text dimensions.
|
|
450
|
+
*/
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
452
|
+
const calculateImageMetadata = async ({ props }) => {
|
|
453
|
+
console.log('[calculateMetadata] Starting metadata calculation...');
|
|
454
|
+
// Get canvas dimensions from props (new element-based format)
|
|
455
|
+
const canvasWidth = props.width ?? props.config?.width ?? 1080;
|
|
456
|
+
const canvasHeight = props.height ?? props.config?.height ?? 1920;
|
|
457
|
+
// Default return if no dynamic crop
|
|
458
|
+
const defaultResult = {
|
|
459
|
+
width: canvasWidth,
|
|
460
|
+
height: canvasHeight,
|
|
461
|
+
fps: 30,
|
|
462
|
+
durationInFrames: 1,
|
|
463
|
+
};
|
|
464
|
+
// Check if we're using element-based format with dynamic crop
|
|
465
|
+
if (!props.elements || !props.dynamicCrop) {
|
|
466
|
+
console.log('[calculateMetadata] No elements or dynamicCrop, using default dimensions:', canvasWidth, 'x', canvasHeight);
|
|
467
|
+
return defaultResult;
|
|
468
|
+
}
|
|
469
|
+
// Check if dynamic crop is actually enabled
|
|
470
|
+
if (!(0, cropBounds_1.isDynamicCropEnabled)(props.dynamicCrop)) {
|
|
471
|
+
console.log('[calculateMetadata] Dynamic crop not enabled, using default dimensions:', canvasWidth, 'x', canvasHeight);
|
|
472
|
+
return defaultResult;
|
|
473
|
+
}
|
|
474
|
+
console.log('[calculateMetadata] Dynamic crop enabled, loading fonts for accurate measurement...');
|
|
475
|
+
// CRITICAL: Load fonts BEFORE measuring text
|
|
476
|
+
// This ensures text measurements match the actual rendered output
|
|
477
|
+
try {
|
|
478
|
+
await (0, fonts_1.preloadFonts)();
|
|
479
|
+
console.log('[calculateMetadata] Fonts loaded successfully');
|
|
480
|
+
}
|
|
481
|
+
catch (err) {
|
|
482
|
+
console.error('[calculateMetadata] Font loading failed:', err);
|
|
483
|
+
// Continue anyway - fallback fonts will be used
|
|
484
|
+
}
|
|
485
|
+
// Give fonts a moment to fully register after loading
|
|
486
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
487
|
+
console.log('[calculateMetadata] Resolving element positions with DOM measurement...');
|
|
488
|
+
// Resolve element positions with real DOM measurement
|
|
489
|
+
// This uses calculateAutoWidthDimensions which measures text in the browser
|
|
490
|
+
const { elements: resolvedElements } = (0, positionResolver_1.resolveElementPositions)(props.elements, props.textValues ?? {});
|
|
491
|
+
console.log('[calculateMetadata] Element positions resolved');
|
|
492
|
+
// Calculate crop bounds with real DOM measurement
|
|
493
|
+
const cropBounds = (0, cropBounds_1.calculateCropBounds)(resolvedElements, props.dynamicCrop, canvasWidth, canvasHeight, props.textValues);
|
|
494
|
+
const outputWidth = Math.round(cropBounds.width);
|
|
495
|
+
const outputHeight = Math.round(cropBounds.height);
|
|
496
|
+
console.log(`[calculateMetadata] Crop bounds calculated: ${canvasWidth}x${canvasHeight} -> ${outputWidth}x${outputHeight} (offset: ${cropBounds.x}, ${cropBounds.y})`);
|
|
497
|
+
return {
|
|
498
|
+
width: outputWidth,
|
|
499
|
+
height: outputHeight,
|
|
500
|
+
fps: 30,
|
|
501
|
+
durationInFrames: 1,
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
const RenderRoot = () => {
|
|
505
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ImageEditorComposition", component: ImageComp, calculateMetadata: calculateImageMetadata, durationInFrames: 1, fps: 30, width: 1080, height: 1920, defaultProps: defaultImageProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "VideoEditorComposition", component: VideoComp, durationInFrames: 150, fps: 30, width: 1080, height: 1920, defaultProps: defaultVideoProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "AutoCaptionComposition", component: AutoCaptionComp, durationInFrames: 300, fps: 30, width: 1080, height: 1920, defaultProps: defaultAutoCaptionProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "ScreenshotAnimationComposition", component: ScreenshotAnimationComp, schema: screenshotAnimationSchema, durationInFrames: 180, fps: 59, width: 1206, height: 2622, defaultProps: defaultScreenshotAnimationProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "InstagramDmComposition", component: InstagramDmComp, schema: instagramDmSchema, durationInFrames: 90, fps: 30, width: 1206, height: 2622, defaultProps: InstagramDmComposition_1.defaultInstagramDmProps }), (0, jsx_runtime_1.jsx)(remotion_1.Composition, { id: "IMessageDmComposition", component: IMessageDmComp, schema: types_1.iMessageDmPropsSchema, durationInFrames: 90, fps: 30, width: 1206, height: 2622, defaultProps: IMessageDmComposition_1.defaultIMessageDmProps })] }));
|
|
506
|
+
};
|
|
507
|
+
exports.RenderRoot = RenderRoot;
|
|
508
|
+
exports.default = exports.RenderRoot;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CaptionOverlay Component
|
|
3
|
+
*
|
|
4
|
+
* Renders TikTok-style animated captions over video content.
|
|
5
|
+
* Features:
|
|
6
|
+
* - Word-by-word highlighting based on current playback time
|
|
7
|
+
* - Proper text wrapping within configurable maxWidth bounds
|
|
8
|
+
* - Vertical positioning (top/center/bottom) with offset
|
|
9
|
+
* - Optional background with opacity and border radius
|
|
10
|
+
* - Optional bounce animation on active word
|
|
11
|
+
*
|
|
12
|
+
* This component is designed for use in both:
|
|
13
|
+
* - Remotion compositions (server-side rendering)
|
|
14
|
+
* - Client-side preview (with previewTimeMs override)
|
|
15
|
+
*/
|
|
16
|
+
import type { CaptionOverlayProps } from '../types/caption';
|
|
17
|
+
/**
|
|
18
|
+
* CaptionOverlay renders animated captions synchronized with video playback
|
|
19
|
+
*/
|
|
20
|
+
export declare function CaptionOverlay({ captions, style, previewTimeMs }: CaptionOverlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export default CaptionOverlay;
|