ugcinc-render 1.8.133 → 1.8.135

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.mts CHANGED
@@ -672,6 +672,8 @@ interface IgMessage {
672
672
  text: string;
673
673
  /** If true, this message groups with the previous message (6px gap). If false, uses normal spacing. */
674
674
  groupWithPrevious?: boolean;
675
+ /** If set, this message is a reply to a story. The URL is the story image. */
676
+ storyReplyImageUrl?: string;
675
677
  }
676
678
  /** Instagram DM Composition props */
677
679
  interface InstagramDmCompositionProps {
@@ -846,6 +848,16 @@ interface InstagramDmCompositionProps {
846
848
  usernameArrowBottom?: number;
847
849
  usernameArrowLeft?: number;
848
850
  usernameArrowRight?: number;
851
+ storyReplyImageWidth?: number;
852
+ storyReplyImageHeight?: number;
853
+ storyReplyImageRight?: number;
854
+ storyReplyImageGap?: number;
855
+ storyReplyBarLeft?: number;
856
+ storyReplyBarRight?: number;
857
+ storyReplyTextLeft?: number;
858
+ storyReplyTextGap?: number;
859
+ storyReplyTextFontSize?: number;
860
+ storyReplyTextLetterSpacing?: number;
849
861
  }
850
862
 
851
863
  /**
package/dist/index.d.ts CHANGED
@@ -672,6 +672,8 @@ interface IgMessage {
672
672
  text: string;
673
673
  /** If true, this message groups with the previous message (6px gap). If false, uses normal spacing. */
674
674
  groupWithPrevious?: boolean;
675
+ /** If set, this message is a reply to a story. The URL is the story image. */
676
+ storyReplyImageUrl?: string;
675
677
  }
676
678
  /** Instagram DM Composition props */
677
679
  interface InstagramDmCompositionProps {
@@ -846,6 +848,16 @@ interface InstagramDmCompositionProps {
846
848
  usernameArrowBottom?: number;
847
849
  usernameArrowLeft?: number;
848
850
  usernameArrowRight?: number;
851
+ storyReplyImageWidth?: number;
852
+ storyReplyImageHeight?: number;
853
+ storyReplyImageRight?: number;
854
+ storyReplyImageGap?: number;
855
+ storyReplyBarLeft?: number;
856
+ storyReplyBarRight?: number;
857
+ storyReplyTextLeft?: number;
858
+ storyReplyTextGap?: number;
859
+ storyReplyTextFontSize?: number;
860
+ storyReplyTextLetterSpacing?: number;
849
861
  }
850
862
 
851
863
  /**
package/dist/index.js CHANGED
@@ -3488,18 +3488,30 @@ var HEADER_DEFAULTS = {
3488
3488
  timeLetterSpacing: 1.6,
3489
3489
  // Sender username
3490
3490
  senderUsername: "cheatmate_io",
3491
- usernameLeft: 308,
3492
- username1Bottom: 264,
3493
- username1FontSize: 52,
3494
- username1LetterSpacing: 0.8,
3495
- username2Bottom: 315,
3496
- username2FontSize: 48,
3497
- username2LetterSpacing: 0.8,
3491
+ usernameLeft: 306,
3492
+ username1Bottom: 271,
3493
+ username1FontSize: 51,
3494
+ username1LetterSpacing: -0.2,
3495
+ username2Bottom: 322,
3496
+ username2FontSize: 41,
3497
+ username2LetterSpacing: -0.4,
3498
3498
  // Username right arrow icon
3499
3499
  usernameArrowTop: 231,
3500
3500
  usernameArrowBottom: 260,
3501
3501
  usernameArrowLeft: 619,
3502
- usernameArrowRight: 635
3502
+ usernameArrowRight: 636
3503
+ };
3504
+ var STORY_REPLY_DEFAULTS = {
3505
+ storyReplyImageWidth: 263,
3506
+ storyReplyImageHeight: 467,
3507
+ storyReplyImageRight: 1170,
3508
+ storyReplyImageGap: 24,
3509
+ storyReplyBarLeft: 1170,
3510
+ storyReplyBarRight: 1181,
3511
+ storyReplyTextLeft: 729,
3512
+ storyReplyTextGap: 27,
3513
+ storyReplyTextFontSize: 40,
3514
+ storyReplyTextLetterSpacing: 0
3503
3515
  };
3504
3516
  function generateHeaderElements(props) {
3505
3517
  const elements = [];
@@ -3706,7 +3718,7 @@ function generateHeaderElements(props) {
3706
3718
  width: 400,
3707
3719
  height: username2Height,
3708
3720
  zIndex: 30,
3709
- text: truncatedUsername,
3721
+ text: senderUsername,
3710
3722
  font: "apple",
3711
3723
  fontSize: username2FontSize,
3712
3724
  fontWeight: "normal",
@@ -3969,6 +3981,10 @@ function calculateMessagePositions(props) {
3969
3981
  const recipientBubbleLeft = props.recipientBubbleLeft ?? MESSAGE_DEFAULTS.recipientBubbleLeft;
3970
3982
  const senderBubbleRight = props.senderBubbleRight ?? MESSAGE_DEFAULTS.senderBubbleRight;
3971
3983
  const bubbleMaxWidth = props.bubbleMaxWidth ?? MESSAGE_DEFAULTS.bubbleMaxWidth;
3984
+ const storyReplyImageHeight = props.storyReplyImageHeight ?? STORY_REPLY_DEFAULTS.storyReplyImageHeight;
3985
+ const storyReplyImageGap = props.storyReplyImageGap ?? STORY_REPLY_DEFAULTS.storyReplyImageGap;
3986
+ const storyReplyTextGap = props.storyReplyTextGap ?? STORY_REPLY_DEFAULTS.storyReplyTextGap;
3987
+ const storyReplyTextFontSize = props.storyReplyTextFontSize ?? STORY_REPLY_DEFAULTS.storyReplyTextFontSize;
3972
3988
  const calculatedMessages = [];
3973
3989
  let currentBottom = messageAreaBottom;
3974
3990
  for (let i = messages.length - 1; i >= 0; i--) {
@@ -4010,6 +4026,16 @@ function calculateMessagePositions(props) {
4010
4026
  } else {
4011
4027
  bubbleLeft = senderBubbleRight - bubbleWidth;
4012
4028
  }
4029
+ let storyReplyImageTop;
4030
+ let storyReplyImageBottom;
4031
+ let storyReplyTextTop;
4032
+ let storyReplyTextBottom;
4033
+ if (message.storyReplyImageUrl && message.sender === "user") {
4034
+ storyReplyImageBottom = bubbleTop - storyReplyImageGap;
4035
+ storyReplyImageTop = storyReplyImageBottom - storyReplyImageHeight;
4036
+ storyReplyTextBottom = storyReplyImageTop - storyReplyTextGap;
4037
+ storyReplyTextTop = storyReplyTextBottom - storyReplyTextFontSize;
4038
+ }
4013
4039
  calculatedMessages.unshift({
4014
4040
  message,
4015
4041
  top: bubbleTop,
@@ -4020,9 +4046,17 @@ function calculateMessagePositions(props) {
4020
4046
  lines,
4021
4047
  isFirstInGroup,
4022
4048
  isLastInGroup,
4023
- isSingleMessage
4049
+ isSingleMessage,
4050
+ storyReplyImageTop,
4051
+ storyReplyImageBottom,
4052
+ storyReplyTextTop,
4053
+ storyReplyTextBottom
4024
4054
  });
4025
- currentBottom = bubbleTop;
4055
+ if (message.storyReplyImageUrl && message.sender === "user" && storyReplyTextTop !== void 0) {
4056
+ currentBottom = storyReplyTextTop;
4057
+ } else {
4058
+ currentBottom = bubbleTop;
4059
+ }
4026
4060
  }
4027
4061
  return calculatedMessages;
4028
4062
  }
@@ -4172,6 +4206,81 @@ function generateMessageElements(props, calculatedMessages) {
4172
4206
  }
4173
4207
  return elements;
4174
4208
  }
4209
+ var STORY_REPLY_INPUT_ID_PREFIX = "story-reply-";
4210
+ function generateStoryReplyElements(props, calculatedMessages) {
4211
+ const elements = [];
4212
+ const storyReplyImageWidth = props.storyReplyImageWidth ?? STORY_REPLY_DEFAULTS.storyReplyImageWidth;
4213
+ const storyReplyImageRight = props.storyReplyImageRight ?? STORY_REPLY_DEFAULTS.storyReplyImageRight;
4214
+ const storyReplyBarLeft = props.storyReplyBarLeft ?? STORY_REPLY_DEFAULTS.storyReplyBarLeft;
4215
+ const storyReplyBarRight = props.storyReplyBarRight ?? STORY_REPLY_DEFAULTS.storyReplyBarRight;
4216
+ const storyReplyTextLeft = props.storyReplyTextLeft ?? STORY_REPLY_DEFAULTS.storyReplyTextLeft;
4217
+ const storyReplyTextFontSize = props.storyReplyTextFontSize ?? STORY_REPLY_DEFAULTS.storyReplyTextFontSize;
4218
+ const storyReplyTextLetterSpacing = props.storyReplyTextLetterSpacing ?? STORY_REPLY_DEFAULTS.storyReplyTextLetterSpacing;
4219
+ for (let i = 0; i < calculatedMessages.length; i++) {
4220
+ const cm = calculatedMessages[i];
4221
+ if (!cm.message.storyReplyImageUrl || cm.message.sender !== "user") {
4222
+ continue;
4223
+ }
4224
+ if (cm.storyReplyImageTop === void 0 || cm.storyReplyImageBottom === void 0) {
4225
+ continue;
4226
+ }
4227
+ const imageTop = cm.storyReplyImageTop;
4228
+ const imageBottom = cm.storyReplyImageBottom;
4229
+ const imageHeight = imageBottom - imageTop;
4230
+ const imageLeft = storyReplyImageRight - storyReplyImageWidth;
4231
+ elements.push({
4232
+ id: `story-reply-image-${cm.message.id}`,
4233
+ type: "image",
4234
+ x: imageLeft,
4235
+ y: imageTop,
4236
+ width: storyReplyImageWidth,
4237
+ height: imageHeight,
4238
+ zIndex: 3,
4239
+ inputId: `${STORY_REPLY_INPUT_ID_PREFIX}${cm.message.id}`,
4240
+ fit: "cover"
4241
+ });
4242
+ const barWidth = storyReplyBarRight - storyReplyBarLeft;
4243
+ elements.push({
4244
+ id: `story-reply-bar-${cm.message.id}`,
4245
+ type: "text",
4246
+ x: storyReplyBarLeft,
4247
+ y: imageTop,
4248
+ width: barWidth,
4249
+ height: imageHeight,
4250
+ zIndex: 3,
4251
+ text: "",
4252
+ backgroundColor: "#2e3339",
4253
+ backgroundOpacity: 100,
4254
+ backgroundBorderRadius: {
4255
+ topLeft: barWidth / 2,
4256
+ topRight: barWidth / 2,
4257
+ bottomLeft: barWidth / 2,
4258
+ bottomRight: barWidth / 2
4259
+ }
4260
+ });
4261
+ if (cm.storyReplyTextTop !== void 0 && cm.storyReplyTextBottom !== void 0) {
4262
+ const textHeight = cm.storyReplyTextBottom - cm.storyReplyTextTop;
4263
+ elements.push({
4264
+ id: `story-reply-text-${cm.message.id}`,
4265
+ type: "text",
4266
+ x: storyReplyTextLeft,
4267
+ y: cm.storyReplyTextTop,
4268
+ width: 500,
4269
+ height: textHeight,
4270
+ zIndex: 3,
4271
+ text: "You replied to their story",
4272
+ font: "apple",
4273
+ fontSize: storyReplyTextFontSize,
4274
+ fontWeight: "normal",
4275
+ color: "#a3aab2",
4276
+ letterSpacing: storyReplyTextLetterSpacing,
4277
+ textAlign: "left",
4278
+ verticalAlign: "middle"
4279
+ });
4280
+ }
4281
+ }
4282
+ return elements;
4283
+ }
4175
4284
  var PROFILE_PIC_INPUT_ID = "profile-pic";
4176
4285
  function generateProfilePicElements(props, calculatedMessages) {
4177
4286
  if (!props.profilePicUrl) {
@@ -4242,6 +4351,12 @@ function buildImageUrls(props) {
4242
4351
  if (props.userPfpUrl) {
4243
4352
  imageUrls[USER_PFP_INPUT_ID] = props.userPfpUrl;
4244
4353
  }
4354
+ const messages = props.messages ?? [];
4355
+ for (const message of messages) {
4356
+ if (message.storyReplyImageUrl) {
4357
+ imageUrls[`${STORY_REPLY_INPUT_ID_PREFIX}${message.id}`] = message.storyReplyImageUrl;
4358
+ }
4359
+ }
4245
4360
  return imageUrls;
4246
4361
  }
4247
4362
  function convertPropsToElements(props) {
@@ -4251,12 +4366,14 @@ function convertPropsToElements(props) {
4251
4366
  const footerIconElements = generateFooterIconElements(props);
4252
4367
  const messageElements = generateMessageElements(props, calculatedMessages);
4253
4368
  const profilePicElements = generateProfilePicElements(props, calculatedMessages);
4369
+ const storyReplyElements = generateStoryReplyElements(props, calculatedMessages);
4254
4370
  const elements = [
4255
4371
  ...headerElements,
4256
4372
  ...footerElements,
4257
4373
  ...footerIconElements,
4258
4374
  ...messageElements,
4259
- ...profilePicElements
4375
+ ...profilePicElements,
4376
+ ...storyReplyElements
4260
4377
  ].sort((a, b) => a.zIndex - b.zIndex);
4261
4378
  const imageUrls = buildImageUrls(props);
4262
4379
  return { elements, imageUrls };
@@ -4452,18 +4569,31 @@ var defaultInstagramDmProps = {
4452
4569
  timeLetterSpacing: 1.6,
4453
4570
  // Header - Sender username
4454
4571
  senderUsername: "cheatmate_io",
4455
- usernameLeft: 308,
4456
- username1Bottom: 264,
4457
- username1FontSize: 52,
4458
- username1LetterSpacing: 0.8,
4459
- username2Bottom: 315,
4460
- username2FontSize: 48,
4461
- username2LetterSpacing: 0.8,
4572
+ usernameLeft: 306,
4573
+ username1Bottom: 271,
4574
+ username1FontSize: 51,
4575
+ username1LetterSpacing: -0.2,
4576
+ username2Bottom: 322,
4577
+ username2FontSize: 41,
4578
+ username2LetterSpacing: -0.4,
4462
4579
  // Header - Username right arrow icon
4463
4580
  usernameArrowTop: 231,
4464
4581
  usernameArrowBottom: 260,
4465
4582
  usernameArrowLeft: 619,
4466
- usernameArrowRight: 635
4583
+ usernameArrowRight: 636,
4584
+ // Story reply (sender) - image
4585
+ storyReplyImageWidth: 263,
4586
+ storyReplyImageHeight: 467,
4587
+ storyReplyImageRight: 1170,
4588
+ storyReplyImageGap: 24,
4589
+ // Story reply (sender) - side bar
4590
+ storyReplyBarLeft: 1170,
4591
+ storyReplyBarRight: 1181,
4592
+ // Story reply (sender) - text
4593
+ storyReplyTextLeft: 729,
4594
+ storyReplyTextGap: 27,
4595
+ storyReplyTextFontSize: 40,
4596
+ storyReplyTextLetterSpacing: 0
4467
4597
  };
4468
4598
  function InstagramDmComposition(props) {
4469
4599
  const {
@@ -5840,18 +5970,31 @@ var instagramDmSchema = import_zod.z.object({
5840
5970
  timeLetterSpacing: import_zod.z.number().optional().default(1.6).describe("Time letter spacing"),
5841
5971
  // Header - Sender username (shown in two places)
5842
5972
  senderUsername: import_zod.z.string().optional().default("cheatmate_io").describe("Sender username"),
5843
- usernameLeft: import_zod.z.number().optional().default(308).describe("Username left X"),
5844
- username1Bottom: import_zod.z.number().optional().default(264).describe("Username 1 bottom Y (bold)"),
5845
- username1FontSize: import_zod.z.number().optional().default(52).describe("Username 1 font size"),
5846
- username1LetterSpacing: import_zod.z.number().optional().default(0.8).describe("Username 1 letter spacing"),
5847
- username2Bottom: import_zod.z.number().optional().default(315).describe("Username 2 bottom Y"),
5848
- username2FontSize: import_zod.z.number().optional().default(48).describe("Username 2 font size"),
5849
- username2LetterSpacing: import_zod.z.number().optional().default(0.8).describe("Username 2 letter spacing"),
5973
+ usernameLeft: import_zod.z.number().optional().default(306).describe("Username left X"),
5974
+ username1Bottom: import_zod.z.number().optional().default(271).describe("Username 1 bottom Y (bold)"),
5975
+ username1FontSize: import_zod.z.number().optional().default(51).describe("Username 1 font size"),
5976
+ username1LetterSpacing: import_zod.z.number().optional().default(-0.2).describe("Username 1 letter spacing"),
5977
+ username2Bottom: import_zod.z.number().optional().default(322).describe("Username 2 bottom Y"),
5978
+ username2FontSize: import_zod.z.number().optional().default(41).describe("Username 2 font size"),
5979
+ username2LetterSpacing: import_zod.z.number().optional().default(-0.4).describe("Username 2 letter spacing"),
5850
5980
  // Header - Username right arrow icon
5851
5981
  usernameArrowTop: import_zod.z.number().optional().default(231).describe("Username arrow top Y"),
5852
5982
  usernameArrowBottom: import_zod.z.number().optional().default(260).describe("Username arrow bottom Y"),
5853
5983
  usernameArrowLeft: import_zod.z.number().optional().default(619).describe("Username arrow left X"),
5854
- usernameArrowRight: import_zod.z.number().optional().default(635).describe("Username arrow right X")
5984
+ usernameArrowRight: import_zod.z.number().optional().default(636).describe("Username arrow right X"),
5985
+ // Story reply (sender) - image
5986
+ storyReplyImageWidth: import_zod.z.number().optional().default(263).describe("Story reply image width"),
5987
+ storyReplyImageHeight: import_zod.z.number().optional().default(467).describe("Story reply image height"),
5988
+ storyReplyImageRight: import_zod.z.number().optional().default(1170).describe("Story reply image right X"),
5989
+ storyReplyImageGap: import_zod.z.number().optional().default(24).describe("Gap between story image and message"),
5990
+ // Story reply (sender) - side bar
5991
+ storyReplyBarLeft: import_zod.z.number().optional().default(1170).describe("Story reply bar left X"),
5992
+ storyReplyBarRight: import_zod.z.number().optional().default(1181).describe("Story reply bar right X"),
5993
+ // Story reply (sender) - "You replied to their story" text
5994
+ storyReplyTextLeft: import_zod.z.number().optional().default(729).describe("Story reply text left X"),
5995
+ storyReplyTextGap: import_zod.z.number().optional().default(27).describe("Gap between text and story image"),
5996
+ storyReplyTextFontSize: import_zod.z.number().optional().default(40).describe("Story reply text font size"),
5997
+ storyReplyTextLetterSpacing: import_zod.z.number().optional().default(0).describe("Story reply text letter spacing")
5855
5998
  });
5856
5999
  var ImageComp = ImageEditorComposition;
5857
6000
  var VideoComp = VideoEditorComposition;
package/dist/index.mjs CHANGED
@@ -2557,18 +2557,30 @@ var HEADER_DEFAULTS = {
2557
2557
  timeLetterSpacing: 1.6,
2558
2558
  // Sender username
2559
2559
  senderUsername: "cheatmate_io",
2560
- usernameLeft: 308,
2561
- username1Bottom: 264,
2562
- username1FontSize: 52,
2563
- username1LetterSpacing: 0.8,
2564
- username2Bottom: 315,
2565
- username2FontSize: 48,
2566
- username2LetterSpacing: 0.8,
2560
+ usernameLeft: 306,
2561
+ username1Bottom: 271,
2562
+ username1FontSize: 51,
2563
+ username1LetterSpacing: -0.2,
2564
+ username2Bottom: 322,
2565
+ username2FontSize: 41,
2566
+ username2LetterSpacing: -0.4,
2567
2567
  // Username right arrow icon
2568
2568
  usernameArrowTop: 231,
2569
2569
  usernameArrowBottom: 260,
2570
2570
  usernameArrowLeft: 619,
2571
- usernameArrowRight: 635
2571
+ usernameArrowRight: 636
2572
+ };
2573
+ var STORY_REPLY_DEFAULTS = {
2574
+ storyReplyImageWidth: 263,
2575
+ storyReplyImageHeight: 467,
2576
+ storyReplyImageRight: 1170,
2577
+ storyReplyImageGap: 24,
2578
+ storyReplyBarLeft: 1170,
2579
+ storyReplyBarRight: 1181,
2580
+ storyReplyTextLeft: 729,
2581
+ storyReplyTextGap: 27,
2582
+ storyReplyTextFontSize: 40,
2583
+ storyReplyTextLetterSpacing: 0
2572
2584
  };
2573
2585
  function generateHeaderElements(props) {
2574
2586
  const elements = [];
@@ -2775,7 +2787,7 @@ function generateHeaderElements(props) {
2775
2787
  width: 400,
2776
2788
  height: username2Height,
2777
2789
  zIndex: 30,
2778
- text: truncatedUsername,
2790
+ text: senderUsername,
2779
2791
  font: "apple",
2780
2792
  fontSize: username2FontSize,
2781
2793
  fontWeight: "normal",
@@ -3038,6 +3050,10 @@ function calculateMessagePositions(props) {
3038
3050
  const recipientBubbleLeft = props.recipientBubbleLeft ?? MESSAGE_DEFAULTS.recipientBubbleLeft;
3039
3051
  const senderBubbleRight = props.senderBubbleRight ?? MESSAGE_DEFAULTS.senderBubbleRight;
3040
3052
  const bubbleMaxWidth = props.bubbleMaxWidth ?? MESSAGE_DEFAULTS.bubbleMaxWidth;
3053
+ const storyReplyImageHeight = props.storyReplyImageHeight ?? STORY_REPLY_DEFAULTS.storyReplyImageHeight;
3054
+ const storyReplyImageGap = props.storyReplyImageGap ?? STORY_REPLY_DEFAULTS.storyReplyImageGap;
3055
+ const storyReplyTextGap = props.storyReplyTextGap ?? STORY_REPLY_DEFAULTS.storyReplyTextGap;
3056
+ const storyReplyTextFontSize = props.storyReplyTextFontSize ?? STORY_REPLY_DEFAULTS.storyReplyTextFontSize;
3041
3057
  const calculatedMessages = [];
3042
3058
  let currentBottom = messageAreaBottom;
3043
3059
  for (let i = messages.length - 1; i >= 0; i--) {
@@ -3079,6 +3095,16 @@ function calculateMessagePositions(props) {
3079
3095
  } else {
3080
3096
  bubbleLeft = senderBubbleRight - bubbleWidth;
3081
3097
  }
3098
+ let storyReplyImageTop;
3099
+ let storyReplyImageBottom;
3100
+ let storyReplyTextTop;
3101
+ let storyReplyTextBottom;
3102
+ if (message.storyReplyImageUrl && message.sender === "user") {
3103
+ storyReplyImageBottom = bubbleTop - storyReplyImageGap;
3104
+ storyReplyImageTop = storyReplyImageBottom - storyReplyImageHeight;
3105
+ storyReplyTextBottom = storyReplyImageTop - storyReplyTextGap;
3106
+ storyReplyTextTop = storyReplyTextBottom - storyReplyTextFontSize;
3107
+ }
3082
3108
  calculatedMessages.unshift({
3083
3109
  message,
3084
3110
  top: bubbleTop,
@@ -3089,9 +3115,17 @@ function calculateMessagePositions(props) {
3089
3115
  lines,
3090
3116
  isFirstInGroup,
3091
3117
  isLastInGroup,
3092
- isSingleMessage
3118
+ isSingleMessage,
3119
+ storyReplyImageTop,
3120
+ storyReplyImageBottom,
3121
+ storyReplyTextTop,
3122
+ storyReplyTextBottom
3093
3123
  });
3094
- currentBottom = bubbleTop;
3124
+ if (message.storyReplyImageUrl && message.sender === "user" && storyReplyTextTop !== void 0) {
3125
+ currentBottom = storyReplyTextTop;
3126
+ } else {
3127
+ currentBottom = bubbleTop;
3128
+ }
3095
3129
  }
3096
3130
  return calculatedMessages;
3097
3131
  }
@@ -3241,6 +3275,81 @@ function generateMessageElements(props, calculatedMessages) {
3241
3275
  }
3242
3276
  return elements;
3243
3277
  }
3278
+ var STORY_REPLY_INPUT_ID_PREFIX = "story-reply-";
3279
+ function generateStoryReplyElements(props, calculatedMessages) {
3280
+ const elements = [];
3281
+ const storyReplyImageWidth = props.storyReplyImageWidth ?? STORY_REPLY_DEFAULTS.storyReplyImageWidth;
3282
+ const storyReplyImageRight = props.storyReplyImageRight ?? STORY_REPLY_DEFAULTS.storyReplyImageRight;
3283
+ const storyReplyBarLeft = props.storyReplyBarLeft ?? STORY_REPLY_DEFAULTS.storyReplyBarLeft;
3284
+ const storyReplyBarRight = props.storyReplyBarRight ?? STORY_REPLY_DEFAULTS.storyReplyBarRight;
3285
+ const storyReplyTextLeft = props.storyReplyTextLeft ?? STORY_REPLY_DEFAULTS.storyReplyTextLeft;
3286
+ const storyReplyTextFontSize = props.storyReplyTextFontSize ?? STORY_REPLY_DEFAULTS.storyReplyTextFontSize;
3287
+ const storyReplyTextLetterSpacing = props.storyReplyTextLetterSpacing ?? STORY_REPLY_DEFAULTS.storyReplyTextLetterSpacing;
3288
+ for (let i = 0; i < calculatedMessages.length; i++) {
3289
+ const cm = calculatedMessages[i];
3290
+ if (!cm.message.storyReplyImageUrl || cm.message.sender !== "user") {
3291
+ continue;
3292
+ }
3293
+ if (cm.storyReplyImageTop === void 0 || cm.storyReplyImageBottom === void 0) {
3294
+ continue;
3295
+ }
3296
+ const imageTop = cm.storyReplyImageTop;
3297
+ const imageBottom = cm.storyReplyImageBottom;
3298
+ const imageHeight = imageBottom - imageTop;
3299
+ const imageLeft = storyReplyImageRight - storyReplyImageWidth;
3300
+ elements.push({
3301
+ id: `story-reply-image-${cm.message.id}`,
3302
+ type: "image",
3303
+ x: imageLeft,
3304
+ y: imageTop,
3305
+ width: storyReplyImageWidth,
3306
+ height: imageHeight,
3307
+ zIndex: 3,
3308
+ inputId: `${STORY_REPLY_INPUT_ID_PREFIX}${cm.message.id}`,
3309
+ fit: "cover"
3310
+ });
3311
+ const barWidth = storyReplyBarRight - storyReplyBarLeft;
3312
+ elements.push({
3313
+ id: `story-reply-bar-${cm.message.id}`,
3314
+ type: "text",
3315
+ x: storyReplyBarLeft,
3316
+ y: imageTop,
3317
+ width: barWidth,
3318
+ height: imageHeight,
3319
+ zIndex: 3,
3320
+ text: "",
3321
+ backgroundColor: "#2e3339",
3322
+ backgroundOpacity: 100,
3323
+ backgroundBorderRadius: {
3324
+ topLeft: barWidth / 2,
3325
+ topRight: barWidth / 2,
3326
+ bottomLeft: barWidth / 2,
3327
+ bottomRight: barWidth / 2
3328
+ }
3329
+ });
3330
+ if (cm.storyReplyTextTop !== void 0 && cm.storyReplyTextBottom !== void 0) {
3331
+ const textHeight = cm.storyReplyTextBottom - cm.storyReplyTextTop;
3332
+ elements.push({
3333
+ id: `story-reply-text-${cm.message.id}`,
3334
+ type: "text",
3335
+ x: storyReplyTextLeft,
3336
+ y: cm.storyReplyTextTop,
3337
+ width: 500,
3338
+ height: textHeight,
3339
+ zIndex: 3,
3340
+ text: "You replied to their story",
3341
+ font: "apple",
3342
+ fontSize: storyReplyTextFontSize,
3343
+ fontWeight: "normal",
3344
+ color: "#a3aab2",
3345
+ letterSpacing: storyReplyTextLetterSpacing,
3346
+ textAlign: "left",
3347
+ verticalAlign: "middle"
3348
+ });
3349
+ }
3350
+ }
3351
+ return elements;
3352
+ }
3244
3353
  var PROFILE_PIC_INPUT_ID = "profile-pic";
3245
3354
  function generateProfilePicElements(props, calculatedMessages) {
3246
3355
  if (!props.profilePicUrl) {
@@ -3311,6 +3420,12 @@ function buildImageUrls(props) {
3311
3420
  if (props.userPfpUrl) {
3312
3421
  imageUrls[USER_PFP_INPUT_ID] = props.userPfpUrl;
3313
3422
  }
3423
+ const messages = props.messages ?? [];
3424
+ for (const message of messages) {
3425
+ if (message.storyReplyImageUrl) {
3426
+ imageUrls[`${STORY_REPLY_INPUT_ID_PREFIX}${message.id}`] = message.storyReplyImageUrl;
3427
+ }
3428
+ }
3314
3429
  return imageUrls;
3315
3430
  }
3316
3431
  function convertPropsToElements(props) {
@@ -3320,12 +3435,14 @@ function convertPropsToElements(props) {
3320
3435
  const footerIconElements = generateFooterIconElements(props);
3321
3436
  const messageElements = generateMessageElements(props, calculatedMessages);
3322
3437
  const profilePicElements = generateProfilePicElements(props, calculatedMessages);
3438
+ const storyReplyElements = generateStoryReplyElements(props, calculatedMessages);
3323
3439
  const elements = [
3324
3440
  ...headerElements,
3325
3441
  ...footerElements,
3326
3442
  ...footerIconElements,
3327
3443
  ...messageElements,
3328
- ...profilePicElements
3444
+ ...profilePicElements,
3445
+ ...storyReplyElements
3329
3446
  ].sort((a, b) => a.zIndex - b.zIndex);
3330
3447
  const imageUrls = buildImageUrls(props);
3331
3448
  return { elements, imageUrls };
@@ -3521,18 +3638,31 @@ var defaultInstagramDmProps = {
3521
3638
  timeLetterSpacing: 1.6,
3522
3639
  // Header - Sender username
3523
3640
  senderUsername: "cheatmate_io",
3524
- usernameLeft: 308,
3525
- username1Bottom: 264,
3526
- username1FontSize: 52,
3527
- username1LetterSpacing: 0.8,
3528
- username2Bottom: 315,
3529
- username2FontSize: 48,
3530
- username2LetterSpacing: 0.8,
3641
+ usernameLeft: 306,
3642
+ username1Bottom: 271,
3643
+ username1FontSize: 51,
3644
+ username1LetterSpacing: -0.2,
3645
+ username2Bottom: 322,
3646
+ username2FontSize: 41,
3647
+ username2LetterSpacing: -0.4,
3531
3648
  // Header - Username right arrow icon
3532
3649
  usernameArrowTop: 231,
3533
3650
  usernameArrowBottom: 260,
3534
3651
  usernameArrowLeft: 619,
3535
- usernameArrowRight: 635
3652
+ usernameArrowRight: 636,
3653
+ // Story reply (sender) - image
3654
+ storyReplyImageWidth: 263,
3655
+ storyReplyImageHeight: 467,
3656
+ storyReplyImageRight: 1170,
3657
+ storyReplyImageGap: 24,
3658
+ // Story reply (sender) - side bar
3659
+ storyReplyBarLeft: 1170,
3660
+ storyReplyBarRight: 1181,
3661
+ // Story reply (sender) - text
3662
+ storyReplyTextLeft: 729,
3663
+ storyReplyTextGap: 27,
3664
+ storyReplyTextFontSize: 40,
3665
+ storyReplyTextLetterSpacing: 0
3536
3666
  };
3537
3667
  function InstagramDmComposition(props) {
3538
3668
  const {
@@ -4626,18 +4756,31 @@ var instagramDmSchema = z.object({
4626
4756
  timeLetterSpacing: z.number().optional().default(1.6).describe("Time letter spacing"),
4627
4757
  // Header - Sender username (shown in two places)
4628
4758
  senderUsername: z.string().optional().default("cheatmate_io").describe("Sender username"),
4629
- usernameLeft: z.number().optional().default(308).describe("Username left X"),
4630
- username1Bottom: z.number().optional().default(264).describe("Username 1 bottom Y (bold)"),
4631
- username1FontSize: z.number().optional().default(52).describe("Username 1 font size"),
4632
- username1LetterSpacing: z.number().optional().default(0.8).describe("Username 1 letter spacing"),
4633
- username2Bottom: z.number().optional().default(315).describe("Username 2 bottom Y"),
4634
- username2FontSize: z.number().optional().default(48).describe("Username 2 font size"),
4635
- username2LetterSpacing: z.number().optional().default(0.8).describe("Username 2 letter spacing"),
4759
+ usernameLeft: z.number().optional().default(306).describe("Username left X"),
4760
+ username1Bottom: z.number().optional().default(271).describe("Username 1 bottom Y (bold)"),
4761
+ username1FontSize: z.number().optional().default(51).describe("Username 1 font size"),
4762
+ username1LetterSpacing: z.number().optional().default(-0.2).describe("Username 1 letter spacing"),
4763
+ username2Bottom: z.number().optional().default(322).describe("Username 2 bottom Y"),
4764
+ username2FontSize: z.number().optional().default(41).describe("Username 2 font size"),
4765
+ username2LetterSpacing: z.number().optional().default(-0.4).describe("Username 2 letter spacing"),
4636
4766
  // Header - Username right arrow icon
4637
4767
  usernameArrowTop: z.number().optional().default(231).describe("Username arrow top Y"),
4638
4768
  usernameArrowBottom: z.number().optional().default(260).describe("Username arrow bottom Y"),
4639
4769
  usernameArrowLeft: z.number().optional().default(619).describe("Username arrow left X"),
4640
- usernameArrowRight: z.number().optional().default(635).describe("Username arrow right X")
4770
+ usernameArrowRight: z.number().optional().default(636).describe("Username arrow right X"),
4771
+ // Story reply (sender) - image
4772
+ storyReplyImageWidth: z.number().optional().default(263).describe("Story reply image width"),
4773
+ storyReplyImageHeight: z.number().optional().default(467).describe("Story reply image height"),
4774
+ storyReplyImageRight: z.number().optional().default(1170).describe("Story reply image right X"),
4775
+ storyReplyImageGap: z.number().optional().default(24).describe("Gap between story image and message"),
4776
+ // Story reply (sender) - side bar
4777
+ storyReplyBarLeft: z.number().optional().default(1170).describe("Story reply bar left X"),
4778
+ storyReplyBarRight: z.number().optional().default(1181).describe("Story reply bar right X"),
4779
+ // Story reply (sender) - "You replied to their story" text
4780
+ storyReplyTextLeft: z.number().optional().default(729).describe("Story reply text left X"),
4781
+ storyReplyTextGap: z.number().optional().default(27).describe("Gap between text and story image"),
4782
+ storyReplyTextFontSize: z.number().optional().default(40).describe("Story reply text font size"),
4783
+ storyReplyTextLetterSpacing: z.number().optional().default(0).describe("Story reply text letter spacing")
4641
4784
  });
4642
4785
  var ImageComp = ImageEditorComposition;
4643
4786
  var VideoComp = VideoEditorComposition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.8.133",
3
+ "version": "1.8.135",
4
4
  "description": "Unified rendering package for UGC Inc - shared types, components, and compositions for pixel-perfect client/server rendering",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",