ugcinc-render 1.8.77 → 1.8.79

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.
@@ -444,6 +444,8 @@ interface VideoEditorBaseSegment {
444
444
  endTrimInputRef?: string;
445
445
  /** UI-only: helper for timing mode display - stripped before rendering */
446
446
  timeMode?: TimeMode;
447
+ /** UI-only: whether this segment's input is optional (default: false = required) */
448
+ optional?: boolean;
447
449
  /** Parent segment ID for overlays */
448
450
  parentId?: string;
449
451
  /** Relative start (0-1) within parent for overlays */
@@ -444,6 +444,8 @@ interface VideoEditorBaseSegment {
444
444
  endTrimInputRef?: string;
445
445
  /** UI-only: helper for timing mode display - stripped before rendering */
446
446
  timeMode?: TimeMode;
447
+ /** UI-only: whether this segment's input is optional (default: false = required) */
448
+ optional?: boolean;
447
449
  /** Parent segment ID for overlays */
448
450
  parentId?: string;
449
451
  /** Relative start (0-1) within parent for overlays */
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SegmentType, T as TimeValue, R as RelativePositionConfigX, a as RelativePositionConfigY, F as FitMode, B as BorderRadiusConfig, b as TextStyleProperties, D as DynamicCropConfig, I as ImageEditorElement, A as AutoCaptionCompositionProps, c as ScreenshotAnimationProps, d as FontWeight, C as CaptionOverlayProps, P as PositionResolutionResult } from './index-Be_MW5c-.mjs';
2
- export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, M as CropAxisConfig, L as CropBoundary, N as CropBounds, aI as DEFAULT_CAPTION_STYLE, q as DIMENSION_PRESETS, p as DimensionPreset, o as DimensionPresetKey, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, e as FontType, k as HorizontalAnchor, l as HorizontalSelfAnchor, H as Hyphenation, ac as IMAGE_DEFAULTS, n as ImageEditorNodeConfig, at as PositionResolutionError, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, K as SegmentTimelinePosition, ab as TEXT_DEFAULTS, f as TextAlignment, g as TextDirection, i as TextOverflow, h as TextWrap, r as TimeMode, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, V as VerticalAlignment, j as VerticalAnchor, m as VerticalSelfAnchor, v as VideoEditorAudioSegment, s as VideoEditorBaseSegment, G as VideoEditorChannel, w as VideoEditorImageSegment, y as VideoEditorImageSequenceSegment, J as VideoEditorNodeConfig, E as VideoEditorSegment, x as VideoEditorTextSegment, u as VideoEditorVideoSegment, z as VideoEditorVideoSequenceSegment, t as VideoEditorVisualSegment, W as WordBreak, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from './index-Be_MW5c-.mjs';
1
+ import { S as SegmentType, T as TimeValue, R as RelativePositionConfigX, a as RelativePositionConfigY, F as FitMode, B as BorderRadiusConfig, b as TextStyleProperties, D as DynamicCropConfig, I as ImageEditorElement, A as AutoCaptionCompositionProps, c as ScreenshotAnimationProps, d as FontWeight, C as CaptionOverlayProps, P as PositionResolutionResult } from './index-DO1B0LJo.mjs';
2
+ export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, M as CropAxisConfig, L as CropBoundary, N as CropBounds, aI as DEFAULT_CAPTION_STYLE, q as DIMENSION_PRESETS, p as DimensionPreset, o as DimensionPresetKey, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, e as FontType, k as HorizontalAnchor, l as HorizontalSelfAnchor, H as Hyphenation, ac as IMAGE_DEFAULTS, n as ImageEditorNodeConfig, at as PositionResolutionError, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, K as SegmentTimelinePosition, ab as TEXT_DEFAULTS, f as TextAlignment, g as TextDirection, i as TextOverflow, h as TextWrap, r as TimeMode, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, V as VerticalAlignment, j as VerticalAnchor, m as VerticalSelfAnchor, v as VideoEditorAudioSegment, s as VideoEditorBaseSegment, G as VideoEditorChannel, w as VideoEditorImageSegment, y as VideoEditorImageSequenceSegment, J as VideoEditorNodeConfig, E as VideoEditorSegment, x as VideoEditorTextSegment, u as VideoEditorVideoSegment, z as VideoEditorVideoSequenceSegment, t as VideoEditorVisualSegment, W as WordBreak, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from './index-DO1B0LJo.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React from 'react';
5
5
 
@@ -669,6 +669,8 @@ interface InstagramDmCompositionProps {
669
669
  showDebugOverlay?: boolean;
670
670
  /** URL of a reference screenshot to overlay on top */
671
671
  referenceImageUrl?: string;
672
+ /** Show/hide the reference image (default: true) */
673
+ showReferenceImage?: boolean;
672
674
  /** Opacity of the reference overlay (0-100, default: 50) */
673
675
  referenceOpacity?: number;
674
676
  /** Canvas width in pixels (default: 1206) */
@@ -687,7 +689,7 @@ interface InstagramDmCompositionProps {
687
689
  * Default composition props for registration
688
690
  */
689
691
  declare const defaultInstagramDmProps: InstagramDmCompositionProps;
690
- declare function InstagramDmComposition({ showDebugOverlay, referenceImageUrl, referenceOpacity, width, height, theme, }: InstagramDmCompositionProps): react_jsx_runtime.JSX.Element;
692
+ declare function InstagramDmComposition({ showDebugOverlay, referenceImageUrl, showReferenceImage, referenceOpacity, width, height, theme, }: InstagramDmCompositionProps): react_jsx_runtime.JSX.Element;
691
693
 
692
694
  /**
693
695
  * Platform-agnostic messaging types
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SegmentType, T as TimeValue, R as RelativePositionConfigX, a as RelativePositionConfigY, F as FitMode, B as BorderRadiusConfig, b as TextStyleProperties, D as DynamicCropConfig, I as ImageEditorElement, A as AutoCaptionCompositionProps, c as ScreenshotAnimationProps, d as FontWeight, C as CaptionOverlayProps, P as PositionResolutionResult } from './index-Be_MW5c-.js';
2
- export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, M as CropAxisConfig, L as CropBoundary, N as CropBounds, aI as DEFAULT_CAPTION_STYLE, q as DIMENSION_PRESETS, p as DimensionPreset, o as DimensionPresetKey, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, e as FontType, k as HorizontalAnchor, l as HorizontalSelfAnchor, H as Hyphenation, ac as IMAGE_DEFAULTS, n as ImageEditorNodeConfig, at as PositionResolutionError, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, K as SegmentTimelinePosition, ab as TEXT_DEFAULTS, f as TextAlignment, g as TextDirection, i as TextOverflow, h as TextWrap, r as TimeMode, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, V as VerticalAlignment, j as VerticalAnchor, m as VerticalSelfAnchor, v as VideoEditorAudioSegment, s as VideoEditorBaseSegment, G as VideoEditorChannel, w as VideoEditorImageSegment, y as VideoEditorImageSequenceSegment, J as VideoEditorNodeConfig, E as VideoEditorSegment, x as VideoEditorTextSegment, u as VideoEditorVideoSegment, z as VideoEditorVideoSequenceSegment, t as VideoEditorVisualSegment, W as WordBreak, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from './index-Be_MW5c-.js';
1
+ import { S as SegmentType, T as TimeValue, R as RelativePositionConfigX, a as RelativePositionConfigY, F as FitMode, B as BorderRadiusConfig, b as TextStyleProperties, D as DynamicCropConfig, I as ImageEditorElement, A as AutoCaptionCompositionProps, c as ScreenshotAnimationProps, d as FontWeight, C as CaptionOverlayProps, P as PositionResolutionResult } from './index-DO1B0LJo.js';
2
+ export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, M as CropAxisConfig, L as CropBoundary, N as CropBounds, aI as DEFAULT_CAPTION_STYLE, q as DIMENSION_PRESETS, p as DimensionPreset, o as DimensionPresetKey, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, e as FontType, k as HorizontalAnchor, l as HorizontalSelfAnchor, H as Hyphenation, ac as IMAGE_DEFAULTS, n as ImageEditorNodeConfig, at as PositionResolutionError, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, K as SegmentTimelinePosition, ab as TEXT_DEFAULTS, f as TextAlignment, g as TextDirection, i as TextOverflow, h as TextWrap, r as TimeMode, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, V as VerticalAlignment, j as VerticalAnchor, m as VerticalSelfAnchor, v as VideoEditorAudioSegment, s as VideoEditorBaseSegment, G as VideoEditorChannel, w as VideoEditorImageSegment, y as VideoEditorImageSequenceSegment, J as VideoEditorNodeConfig, E as VideoEditorSegment, x as VideoEditorTextSegment, u as VideoEditorVideoSegment, z as VideoEditorVideoSequenceSegment, t as VideoEditorVisualSegment, W as WordBreak, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from './index-DO1B0LJo.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React from 'react';
5
5
 
@@ -669,6 +669,8 @@ interface InstagramDmCompositionProps {
669
669
  showDebugOverlay?: boolean;
670
670
  /** URL of a reference screenshot to overlay on top */
671
671
  referenceImageUrl?: string;
672
+ /** Show/hide the reference image (default: true) */
673
+ showReferenceImage?: boolean;
672
674
  /** Opacity of the reference overlay (0-100, default: 50) */
673
675
  referenceOpacity?: number;
674
676
  /** Canvas width in pixels (default: 1206) */
@@ -687,7 +689,7 @@ interface InstagramDmCompositionProps {
687
689
  * Default composition props for registration
688
690
  */
689
691
  declare const defaultInstagramDmProps: InstagramDmCompositionProps;
690
- declare function InstagramDmComposition({ showDebugOverlay, referenceImageUrl, referenceOpacity, width, height, theme, }: InstagramDmCompositionProps): react_jsx_runtime.JSX.Element;
692
+ declare function InstagramDmComposition({ showDebugOverlay, referenceImageUrl, showReferenceImage, referenceOpacity, width, height, theme, }: InstagramDmCompositionProps): react_jsx_runtime.JSX.Element;
691
693
 
692
694
  /**
693
695
  * Platform-agnostic messaging types
package/dist/index.js CHANGED
@@ -2890,6 +2890,8 @@ function DebugOverlay({
2890
2890
  const [mousePos, setMousePos] = (0, import_react7.useState)(null);
2891
2891
  const [crosshairPos, setCrosshairPos] = (0, import_react7.useState)(null);
2892
2892
  const [viewportPos, setViewportPos] = (0, import_react7.useState)(null);
2893
+ const [pinnedPos, setPinnedPos] = (0, import_react7.useState)(null);
2894
+ const [pinnedCrosshairPos, setPinnedCrosshairPos] = (0, import_react7.useState)(null);
2893
2895
  const [isDragging, setIsDragging] = (0, import_react7.useState)(false);
2894
2896
  const lastDragPos = (0, import_react7.useRef)(null);
2895
2897
  const zoomScale = zoom / 100;
@@ -2906,6 +2908,22 @@ function DebugOverlay({
2906
2908
  pixelHeightPercent: pixelHeight / height * 100
2907
2909
  });
2908
2910
  }, [mousePos, zoomScale, scrollX, scrollY, width, height]);
2911
+ (0, import_react7.useEffect)(() => {
2912
+ if (pinnedPos === null) {
2913
+ setPinnedCrosshairPos(null);
2914
+ return;
2915
+ }
2916
+ const snappedScreenX = (pinnedPos.x + 0.5) * zoomScale - scrollX;
2917
+ const snappedScreenY = (pinnedPos.y + 0.5) * zoomScale - scrollY;
2918
+ const pixelWidth = zoomScale;
2919
+ const pixelHeight = zoomScale;
2920
+ setPinnedCrosshairPos({
2921
+ xPercent: snappedScreenX / width * 100,
2922
+ yPercent: snappedScreenY / height * 100,
2923
+ pixelWidthPercent: pixelWidth / width * 100,
2924
+ pixelHeightPercent: pixelHeight / height * 100
2925
+ });
2926
+ }, [pinnedPos, zoomScale, scrollX, scrollY, width, height]);
2909
2927
  const handleMouseMove = (0, import_react7.useCallback)(
2910
2928
  (e) => {
2911
2929
  const rect = e.currentTarget.getBoundingClientRect();
@@ -2933,11 +2951,22 @@ function DebugOverlay({
2933
2951
  [width, height, zoomScale, scrollX, scrollY, isDragging, zoom, onZoomChange]
2934
2952
  );
2935
2953
  const handleMouseDown = (0, import_react7.useCallback)((e) => {
2936
- if (e.target.tagName === "BUTTON") return;
2954
+ const tagName = e.target.tagName;
2955
+ if (tagName === "BUTTON" || tagName === "INPUT" || tagName === "LABEL") return;
2937
2956
  e.preventDefault();
2957
+ if (e.ctrlKey || e.metaKey) {
2958
+ if (mousePos) {
2959
+ setPinnedPos({ x: mousePos.x, y: mousePos.y });
2960
+ }
2961
+ return;
2962
+ }
2963
+ if (pinnedPos) {
2964
+ setPinnedPos(null);
2965
+ return;
2966
+ }
2938
2967
  setIsDragging(true);
2939
2968
  lastDragPos.current = { x: e.clientX, y: e.clientY };
2940
- }, []);
2969
+ }, [mousePos, pinnedPos]);
2941
2970
  const handleMouseUp = (0, import_react7.useCallback)(() => {
2942
2971
  setIsDragging(false);
2943
2972
  lastDragPos.current = null;
@@ -2989,6 +3018,38 @@ function DebugOverlay({
2989
3018
  cursor: none !important;
2990
3019
  }
2991
3020
  ` }),
3021
+ pinnedCrosshairPos && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3022
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3023
+ "div",
3024
+ {
3025
+ style: {
3026
+ position: "absolute",
3027
+ top: 0,
3028
+ left: `${pinnedCrosshairPos.xPercent}%`,
3029
+ width: `${Math.max(pinnedCrosshairPos.pixelWidthPercent, 0.1)}%`,
3030
+ height: "100%",
3031
+ backgroundColor: "#00FFFF",
3032
+ pointerEvents: "none",
3033
+ transform: "translateX(-50%)"
3034
+ }
3035
+ }
3036
+ ),
3037
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3038
+ "div",
3039
+ {
3040
+ style: {
3041
+ position: "absolute",
3042
+ top: `${pinnedCrosshairPos.yPercent}%`,
3043
+ left: 0,
3044
+ width: "100%",
3045
+ height: `${Math.max(pinnedCrosshairPos.pixelHeightPercent, 0.1)}%`,
3046
+ backgroundColor: "#00FFFF",
3047
+ pointerEvents: "none",
3048
+ transform: "translateY(-50%)"
3049
+ }
3050
+ }
3051
+ )
3052
+ ] }),
2992
3053
  crosshairPos && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2993
3054
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2994
3055
  "div",
@@ -3047,6 +3108,17 @@ function DebugOverlay({
3047
3108
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3048
3109
  "Y: ",
3049
3110
  mousePos.y
3111
+ ] }),
3112
+ pinnedPos && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { marginTop: 12, paddingTop: 12, borderTop: "1px solid rgba(0, 255, 255, 0.5)" }, children: [
3113
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { color: "#00FFFF", fontSize: 20 }, children: "Pinned:" }),
3114
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { color: "#00FFFF" }, children: [
3115
+ "X: ",
3116
+ pinnedPos.x
3117
+ ] }),
3118
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { color: "#00FFFF" }, children: [
3119
+ "Y: ",
3120
+ pinnedPos.y
3121
+ ] })
3050
3122
  ] })
3051
3123
  ]
3052
3124
  }
@@ -3079,24 +3151,34 @@ function DebugOverlay({
3079
3151
  "%"
3080
3152
  ] }),
3081
3153
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { color: "#888", fontSize: 14, marginTop: 4, pointerEvents: "none" }, children: "Scroll to zoom, drag to pan" }),
3082
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3083
- "button",
3154
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3155
+ "label",
3084
3156
  {
3085
- onClick: onToggleReference,
3086
3157
  style: {
3158
+ display: "flex",
3159
+ alignItems: "center",
3160
+ gap: 8,
3087
3161
  marginTop: 12,
3088
- padding: "8px 16px",
3089
- fontSize: 16,
3090
- fontWeight: "bold",
3091
- fontFamily: "monospace",
3092
- backgroundColor: referenceVisible ? "#FF6B6B" : "#4CAF50",
3093
- color: "#FFFFFF",
3094
- border: "none",
3095
- borderRadius: 4,
3096
- cursor: "none",
3097
- width: "100%"
3162
+ cursor: "pointer",
3163
+ userSelect: "none"
3098
3164
  },
3099
- children: referenceVisible ? "Hide Reference" : "Show Reference"
3165
+ children: [
3166
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3167
+ "input",
3168
+ {
3169
+ type: "checkbox",
3170
+ checked: referenceVisible,
3171
+ onChange: onToggleReference,
3172
+ style: {
3173
+ width: 20,
3174
+ height: 20,
3175
+ cursor: "pointer",
3176
+ accentColor: "#4CAF50"
3177
+ }
3178
+ }
3179
+ ),
3180
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "#FFFFFF", fontSize: 16 }, children: "Show Reference" })
3181
+ ]
3100
3182
  }
3101
3183
  )
3102
3184
  ]
@@ -3183,6 +3265,7 @@ var import_jsx_runtime11 = require("react/jsx-runtime");
3183
3265
  var defaultInstagramDmProps = {
3184
3266
  showDebugOverlay: true,
3185
3267
  referenceImageUrl: "https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3171-DmKgZAYCYJpLxiZjJBYYCk4mynmjkv.png",
3268
+ showReferenceImage: true,
3186
3269
  referenceOpacity: 50,
3187
3270
  width: 1206,
3188
3271
  height: 2622,
@@ -3193,6 +3276,7 @@ var defaultInstagramDmProps = {
3193
3276
  function InstagramDmComposition({
3194
3277
  showDebugOverlay = false,
3195
3278
  referenceImageUrl,
3279
+ showReferenceImage = true,
3196
3280
  referenceOpacity = 50,
3197
3281
  width = 1206,
3198
3282
  height = 2622,
@@ -3270,7 +3354,7 @@ function InstagramDmComposition({
3270
3354
  },
3271
3355
  children: [
3272
3356
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IgMessageFooter, { theme }),
3273
- referenceImageUrl && (showDebugOverlay ? referenceVisible : clampedReferenceOpacity > 0) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3357
+ referenceImageUrl && (showDebugOverlay ? referenceVisible : showReferenceImage) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3274
3358
  "div",
3275
3359
  {
3276
3360
  style: {
package/dist/index.mjs CHANGED
@@ -1998,6 +1998,8 @@ function DebugOverlay({
1998
1998
  const [mousePos, setMousePos] = useState2(null);
1999
1999
  const [crosshairPos, setCrosshairPos] = useState2(null);
2000
2000
  const [viewportPos, setViewportPos] = useState2(null);
2001
+ const [pinnedPos, setPinnedPos] = useState2(null);
2002
+ const [pinnedCrosshairPos, setPinnedCrosshairPos] = useState2(null);
2001
2003
  const [isDragging, setIsDragging] = useState2(false);
2002
2004
  const lastDragPos = useRef(null);
2003
2005
  const zoomScale = zoom / 100;
@@ -2014,6 +2016,22 @@ function DebugOverlay({
2014
2016
  pixelHeightPercent: pixelHeight / height * 100
2015
2017
  });
2016
2018
  }, [mousePos, zoomScale, scrollX, scrollY, width, height]);
2019
+ useEffect2(() => {
2020
+ if (pinnedPos === null) {
2021
+ setPinnedCrosshairPos(null);
2022
+ return;
2023
+ }
2024
+ const snappedScreenX = (pinnedPos.x + 0.5) * zoomScale - scrollX;
2025
+ const snappedScreenY = (pinnedPos.y + 0.5) * zoomScale - scrollY;
2026
+ const pixelWidth = zoomScale;
2027
+ const pixelHeight = zoomScale;
2028
+ setPinnedCrosshairPos({
2029
+ xPercent: snappedScreenX / width * 100,
2030
+ yPercent: snappedScreenY / height * 100,
2031
+ pixelWidthPercent: pixelWidth / width * 100,
2032
+ pixelHeightPercent: pixelHeight / height * 100
2033
+ });
2034
+ }, [pinnedPos, zoomScale, scrollX, scrollY, width, height]);
2017
2035
  const handleMouseMove = useCallback(
2018
2036
  (e) => {
2019
2037
  const rect = e.currentTarget.getBoundingClientRect();
@@ -2041,11 +2059,22 @@ function DebugOverlay({
2041
2059
  [width, height, zoomScale, scrollX, scrollY, isDragging, zoom, onZoomChange]
2042
2060
  );
2043
2061
  const handleMouseDown = useCallback((e) => {
2044
- if (e.target.tagName === "BUTTON") return;
2062
+ const tagName = e.target.tagName;
2063
+ if (tagName === "BUTTON" || tagName === "INPUT" || tagName === "LABEL") return;
2045
2064
  e.preventDefault();
2065
+ if (e.ctrlKey || e.metaKey) {
2066
+ if (mousePos) {
2067
+ setPinnedPos({ x: mousePos.x, y: mousePos.y });
2068
+ }
2069
+ return;
2070
+ }
2071
+ if (pinnedPos) {
2072
+ setPinnedPos(null);
2073
+ return;
2074
+ }
2046
2075
  setIsDragging(true);
2047
2076
  lastDragPos.current = { x: e.clientX, y: e.clientY };
2048
- }, []);
2077
+ }, [mousePos, pinnedPos]);
2049
2078
  const handleMouseUp = useCallback(() => {
2050
2079
  setIsDragging(false);
2051
2080
  lastDragPos.current = null;
@@ -2097,6 +2126,38 @@ function DebugOverlay({
2097
2126
  cursor: none !important;
2098
2127
  }
2099
2128
  ` }),
2129
+ pinnedCrosshairPos && /* @__PURE__ */ jsxs7(Fragment, { children: [
2130
+ /* @__PURE__ */ jsx9(
2131
+ "div",
2132
+ {
2133
+ style: {
2134
+ position: "absolute",
2135
+ top: 0,
2136
+ left: `${pinnedCrosshairPos.xPercent}%`,
2137
+ width: `${Math.max(pinnedCrosshairPos.pixelWidthPercent, 0.1)}%`,
2138
+ height: "100%",
2139
+ backgroundColor: "#00FFFF",
2140
+ pointerEvents: "none",
2141
+ transform: "translateX(-50%)"
2142
+ }
2143
+ }
2144
+ ),
2145
+ /* @__PURE__ */ jsx9(
2146
+ "div",
2147
+ {
2148
+ style: {
2149
+ position: "absolute",
2150
+ top: `${pinnedCrosshairPos.yPercent}%`,
2151
+ left: 0,
2152
+ width: "100%",
2153
+ height: `${Math.max(pinnedCrosshairPos.pixelHeightPercent, 0.1)}%`,
2154
+ backgroundColor: "#00FFFF",
2155
+ pointerEvents: "none",
2156
+ transform: "translateY(-50%)"
2157
+ }
2158
+ }
2159
+ )
2160
+ ] }),
2100
2161
  crosshairPos && /* @__PURE__ */ jsxs7(Fragment, { children: [
2101
2162
  /* @__PURE__ */ jsx9(
2102
2163
  "div",
@@ -2155,6 +2216,17 @@ function DebugOverlay({
2155
2216
  /* @__PURE__ */ jsxs7("div", { children: [
2156
2217
  "Y: ",
2157
2218
  mousePos.y
2219
+ ] }),
2220
+ pinnedPos && /* @__PURE__ */ jsxs7("div", { style: { marginTop: 12, paddingTop: 12, borderTop: "1px solid rgba(0, 255, 255, 0.5)" }, children: [
2221
+ /* @__PURE__ */ jsx9("div", { style: { color: "#00FFFF", fontSize: 20 }, children: "Pinned:" }),
2222
+ /* @__PURE__ */ jsxs7("div", { style: { color: "#00FFFF" }, children: [
2223
+ "X: ",
2224
+ pinnedPos.x
2225
+ ] }),
2226
+ /* @__PURE__ */ jsxs7("div", { style: { color: "#00FFFF" }, children: [
2227
+ "Y: ",
2228
+ pinnedPos.y
2229
+ ] })
2158
2230
  ] })
2159
2231
  ]
2160
2232
  }
@@ -2187,24 +2259,34 @@ function DebugOverlay({
2187
2259
  "%"
2188
2260
  ] }),
2189
2261
  /* @__PURE__ */ jsx9("div", { style: { color: "#888", fontSize: 14, marginTop: 4, pointerEvents: "none" }, children: "Scroll to zoom, drag to pan" }),
2190
- /* @__PURE__ */ jsx9(
2191
- "button",
2262
+ /* @__PURE__ */ jsxs7(
2263
+ "label",
2192
2264
  {
2193
- onClick: onToggleReference,
2194
2265
  style: {
2266
+ display: "flex",
2267
+ alignItems: "center",
2268
+ gap: 8,
2195
2269
  marginTop: 12,
2196
- padding: "8px 16px",
2197
- fontSize: 16,
2198
- fontWeight: "bold",
2199
- fontFamily: "monospace",
2200
- backgroundColor: referenceVisible ? "#FF6B6B" : "#4CAF50",
2201
- color: "#FFFFFF",
2202
- border: "none",
2203
- borderRadius: 4,
2204
- cursor: "none",
2205
- width: "100%"
2270
+ cursor: "pointer",
2271
+ userSelect: "none"
2206
2272
  },
2207
- children: referenceVisible ? "Hide Reference" : "Show Reference"
2273
+ children: [
2274
+ /* @__PURE__ */ jsx9(
2275
+ "input",
2276
+ {
2277
+ type: "checkbox",
2278
+ checked: referenceVisible,
2279
+ onChange: onToggleReference,
2280
+ style: {
2281
+ width: 20,
2282
+ height: 20,
2283
+ cursor: "pointer",
2284
+ accentColor: "#4CAF50"
2285
+ }
2286
+ }
2287
+ ),
2288
+ /* @__PURE__ */ jsx9("span", { style: { color: "#FFFFFF", fontSize: 16 }, children: "Show Reference" })
2289
+ ]
2208
2290
  }
2209
2291
  )
2210
2292
  ]
@@ -2291,6 +2373,7 @@ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2291
2373
  var defaultInstagramDmProps = {
2292
2374
  showDebugOverlay: true,
2293
2375
  referenceImageUrl: "https://n14dcpakf8w1fekl.public.blob.vercel-storage.com/media/8ff1462b-13d7-4abe-9325-0a6ad19004f0/IMG_3171-DmKgZAYCYJpLxiZjJBYYCk4mynmjkv.png",
2376
+ showReferenceImage: true,
2294
2377
  referenceOpacity: 50,
2295
2378
  width: 1206,
2296
2379
  height: 2622,
@@ -2301,6 +2384,7 @@ var defaultInstagramDmProps = {
2301
2384
  function InstagramDmComposition({
2302
2385
  showDebugOverlay = false,
2303
2386
  referenceImageUrl,
2387
+ showReferenceImage = true,
2304
2388
  referenceOpacity = 50,
2305
2389
  width = 1206,
2306
2390
  height = 2622,
@@ -2378,7 +2462,7 @@ function InstagramDmComposition({
2378
2462
  },
2379
2463
  children: [
2380
2464
  /* @__PURE__ */ jsx11(IgMessageFooter, { theme }),
2381
- referenceImageUrl && (showDebugOverlay ? referenceVisible : clampedReferenceOpacity > 0) && /* @__PURE__ */ jsx11(
2465
+ referenceImageUrl && (showDebugOverlay ? referenceVisible : showReferenceImage) && /* @__PURE__ */ jsx11(
2382
2466
  "div",
2383
2467
  {
2384
2468
  style: {
@@ -1 +1 @@
1
- export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, aI as DEFAULT_CAPTION_STYLE, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, ac as IMAGE_DEFAULTS, at as PositionResolutionError, P as PositionResolutionResult, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, c as ScreenshotAnimationProps, ab as TEXT_DEFAULTS, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from '../index-Be_MW5c-.mjs';
1
+ export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, aI as DEFAULT_CAPTION_STYLE, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, ac as IMAGE_DEFAULTS, at as PositionResolutionError, P as PositionResolutionResult, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, c as ScreenshotAnimationProps, ab as TEXT_DEFAULTS, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from '../index-DO1B0LJo.mjs';
@@ -1 +1 @@
1
- export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, aI as DEFAULT_CAPTION_STYLE, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, ac as IMAGE_DEFAULTS, at as PositionResolutionError, P as PositionResolutionResult, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, c as ScreenshotAnimationProps, ab as TEXT_DEFAULTS, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from '../index-Be_MW5c-.js';
1
+ export { a2 as APPLE_EMOJI_FONT, aH as CAPTION_PRESETS, Y as CaptionFontWeight, Q as CaptionPage, X as CaptionPosition, U as CaptionPreset, Z as CaptionStyle, O as CaptionWord, aI as DEFAULT_CAPTION_STYLE, a1 as FONT_FAMILIES, a5 as FONT_URLS, aa as FitDimensions, ac as IMAGE_DEFAULTS, at as PositionResolutionError, P as PositionResolutionResult, $ as SCREENSHOT_ANIMATION_DEFAULTS, _ as ScreenshotAnimationConfig, c as ScreenshotAnimationProps, ab as TEXT_DEFAULTS, ad as VIDEO_DEFAULTS, ae as VISUAL_DEFAULTS, ag as applyImageDefaults, af as applyTextDefaults, ah as applyVideoDefaults, a7 as areFontsLoaded, a4 as buildFontString, ao as calculateAutoWidthDimensions, au as calculateCropBounds, aB as calculateEstimatedDuration, a9 as calculateFitDimensions, aj as calculateLineWidth, a0 as calculateScreenshotAnimationDuration, aC as calculateTimelineContentEnd, ap as canSetAsReference, a8 as debugFontStatus, aw as defaultOffset, aD as formatTime, aG as generateOverlayId, aF as generateSegmentId, ax as getBaseSegments, ak as getBorderRadii, aK as getCaptionPresetNames, aq as getDependentElements, a3 as getFontFamily, ay as getOverlays, ar as getReferenceElementX, as as getReferenceElementY, az as getSegmentTimelinePosition, am as hexToRgba, av as isDynamicCropEnabled, aA as isSegmentVisibleAtTime, aL as isValidCaptionPreset, al as parseHexColor, aE as parseTime, a6 as preloadFonts, aJ as resolveCaptionStyle, an as resolveElementPositions, ai as wrapText } from '../index-DO1B0LJo.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.8.77",
3
+ "version": "1.8.79",
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",