ugcinc-render 1.3.11 → 1.3.13

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
@@ -276,8 +276,6 @@ interface ImageEditorElement {
276
276
  lineHeight?: number;
277
277
  /** Letter spacing in pixels */
278
278
  letterSpacing?: number;
279
- /** Enable font kerning for proper letter pair spacing (default: true) */
280
- kerning?: boolean;
281
279
  /** Horizontal text alignment */
282
280
  textAlign?: TextAlignment;
283
281
  /** Vertical text alignment within bounds */
@@ -322,6 +320,10 @@ interface ImageEditorNodeConfig {
322
320
  dimensionPreset: DimensionPresetKey;
323
321
  /** Elements to render */
324
322
  elements: ImageEditorElement[];
323
+ /** Background type: 'image' for image input, 'color' for solid color */
324
+ backgroundType?: 'image' | 'color';
325
+ /** Background color (hex) when backgroundType is 'color' */
326
+ backgroundColor?: string;
325
327
  /** How the background image fits the canvas */
326
328
  backgroundFit?: FitMode;
327
329
  /** Cached background image URL for consistent preview */
@@ -580,8 +582,6 @@ interface TextSegment extends VisualSegment {
580
582
  lineHeight?: number;
581
583
  /** Letter spacing in pixels (default: 0) */
582
584
  letterSpacing?: number;
583
- /** Enable font kerning for proper letter pair spacing (default: true) */
584
- kerning?: boolean;
585
585
  /** How text wraps to new lines (default: 'word') */
586
586
  textWrap?: TextWrap;
587
587
  /** How words break across lines (default: 'normal') */
@@ -744,6 +744,10 @@ interface ImageEditorCompositionProps {
744
744
  width?: number;
745
745
  /** Canvas height (required when using elements) */
746
746
  height?: number;
747
+ /** Background type: 'image' for image input, 'color' for solid color */
748
+ backgroundType?: 'image' | 'color';
749
+ /** Background color (hex) when backgroundType is 'color' */
750
+ backgroundColor?: string;
747
751
  /** Background fit mode (when using elements) */
748
752
  backgroundFit?: FitMode;
749
753
  /** Background image URL (when using elements) */
@@ -786,7 +790,7 @@ interface ImageEditorCompositionProps {
786
790
  * />
787
791
  * ```
788
792
  */
789
- declare function ImageEditorComposition({ config, sources, scale, elements, width, height, backgroundFit, backgroundUrl, imageUrls, textValues, }: ImageEditorCompositionProps): react_jsx_runtime.JSX.Element;
793
+ declare function ImageEditorComposition({ config, sources, scale, elements, width, height, backgroundType, backgroundColor, backgroundFit, backgroundUrl, imageUrls, textValues, }: ImageEditorCompositionProps): react_jsx_runtime.JSX.Element;
790
794
 
791
795
  interface VideoEditorCompositionProps {
792
796
  /** The editor configuration to render */
@@ -993,7 +997,6 @@ declare const TEXT_DEFAULTS: {
993
997
  backgroundOpacity: number;
994
998
  autoWidth: boolean;
995
999
  boxAlign: "left";
996
- kerning: boolean;
997
1000
  };
998
1001
  /**
999
1002
  * Default values for image segments
package/dist/index.d.ts CHANGED
@@ -276,8 +276,6 @@ interface ImageEditorElement {
276
276
  lineHeight?: number;
277
277
  /** Letter spacing in pixels */
278
278
  letterSpacing?: number;
279
- /** Enable font kerning for proper letter pair spacing (default: true) */
280
- kerning?: boolean;
281
279
  /** Horizontal text alignment */
282
280
  textAlign?: TextAlignment;
283
281
  /** Vertical text alignment within bounds */
@@ -322,6 +320,10 @@ interface ImageEditorNodeConfig {
322
320
  dimensionPreset: DimensionPresetKey;
323
321
  /** Elements to render */
324
322
  elements: ImageEditorElement[];
323
+ /** Background type: 'image' for image input, 'color' for solid color */
324
+ backgroundType?: 'image' | 'color';
325
+ /** Background color (hex) when backgroundType is 'color' */
326
+ backgroundColor?: string;
325
327
  /** How the background image fits the canvas */
326
328
  backgroundFit?: FitMode;
327
329
  /** Cached background image URL for consistent preview */
@@ -580,8 +582,6 @@ interface TextSegment extends VisualSegment {
580
582
  lineHeight?: number;
581
583
  /** Letter spacing in pixels (default: 0) */
582
584
  letterSpacing?: number;
583
- /** Enable font kerning for proper letter pair spacing (default: true) */
584
- kerning?: boolean;
585
585
  /** How text wraps to new lines (default: 'word') */
586
586
  textWrap?: TextWrap;
587
587
  /** How words break across lines (default: 'normal') */
@@ -744,6 +744,10 @@ interface ImageEditorCompositionProps {
744
744
  width?: number;
745
745
  /** Canvas height (required when using elements) */
746
746
  height?: number;
747
+ /** Background type: 'image' for image input, 'color' for solid color */
748
+ backgroundType?: 'image' | 'color';
749
+ /** Background color (hex) when backgroundType is 'color' */
750
+ backgroundColor?: string;
747
751
  /** Background fit mode (when using elements) */
748
752
  backgroundFit?: FitMode;
749
753
  /** Background image URL (when using elements) */
@@ -786,7 +790,7 @@ interface ImageEditorCompositionProps {
786
790
  * />
787
791
  * ```
788
792
  */
789
- declare function ImageEditorComposition({ config, sources, scale, elements, width, height, backgroundFit, backgroundUrl, imageUrls, textValues, }: ImageEditorCompositionProps): react_jsx_runtime.JSX.Element;
793
+ declare function ImageEditorComposition({ config, sources, scale, elements, width, height, backgroundType, backgroundColor, backgroundFit, backgroundUrl, imageUrls, textValues, }: ImageEditorCompositionProps): react_jsx_runtime.JSX.Element;
790
794
 
791
795
  interface VideoEditorCompositionProps {
792
796
  /** The editor configuration to render */
@@ -993,7 +997,6 @@ declare const TEXT_DEFAULTS: {
993
997
  backgroundOpacity: number;
994
998
  autoWidth: boolean;
995
999
  boxAlign: "left";
996
- kerning: boolean;
997
1000
  };
998
1001
  /**
999
1002
  * Default values for image segments
package/dist/index.js CHANGED
@@ -96,8 +96,7 @@ var TEXT_DEFAULTS = {
96
96
  strokeWidth: 0,
97
97
  backgroundOpacity: 100,
98
98
  autoWidth: false,
99
- boxAlign: "left",
100
- kerning: true
99
+ boxAlign: "left"
101
100
  };
102
101
  var IMAGE_DEFAULTS = {
103
102
  fit: "cover",
@@ -291,7 +290,6 @@ function TextElement({ segment, scale = 1 }) {
291
290
  const verticalAlign = segment.verticalAlign ?? TEXT_DEFAULTS.verticalAlign;
292
291
  const lineHeight = segment.lineHeight ?? TEXT_DEFAULTS.lineHeight;
293
292
  const letterSpacing = (segment.letterSpacing ?? TEXT_DEFAULTS.letterSpacing) * scale;
294
- const kerning = segment.kerning ?? TEXT_DEFAULTS.kerning;
295
293
  const strokeColor = segment.strokeColor;
296
294
  const strokeWidth = (segment.strokeWidth ?? TEXT_DEFAULTS.strokeWidth) * scale;
297
295
  const uniformPadding = (segment.padding ?? TEXT_DEFAULTS.padding) * scale;
@@ -356,12 +354,6 @@ function TextElement({ segment, scale = 1 }) {
356
354
  color,
357
355
  lineHeight,
358
356
  letterSpacing,
359
- // Font kerning for proper letter pair spacing (can be toggled)
360
- fontKerning: kerning ? "normal" : "none",
361
- // Enable OpenType font features for kerning
362
- fontFeatureSettings: kerning ? '"kern" 1' : '"kern" 0',
363
- // Text rendering optimization for better kerning
364
- textRendering: kerning ? "optimizeLegibility" : "auto",
365
357
  // textAlign works for multi-line text within the (possibly auto-width) box
366
358
  textAlign: alignment === "justify" ? "justify" : alignment,
367
359
  padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
@@ -398,7 +390,6 @@ function TextElement({ segment, scale = 1 }) {
398
390
  color,
399
391
  lineHeight,
400
392
  letterSpacing,
401
- kerning,
402
393
  alignment,
403
394
  paddingTop,
404
395
  paddingRight,
@@ -883,6 +874,8 @@ function ImageEditorComposition({
883
874
  elements,
884
875
  width,
885
876
  height,
877
+ backgroundType = "image",
878
+ backgroundColor,
886
879
  backgroundFit = "cover",
887
880
  backgroundUrl,
888
881
  imageUrls = {},
@@ -935,8 +928,9 @@ function ImageEditorComposition({
935
928
  }
936
929
  return void 0;
937
930
  };
938
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_remotion2.AbsoluteFill, { style: { backgroundColor: "#000000" }, children: [
939
- bgUrl && segmentsFromElements && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
931
+ const containerBgColor = backgroundType === "color" && backgroundColor ? backgroundColor : "#000000";
932
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_remotion2.AbsoluteFill, { style: { backgroundColor: containerBgColor }, children: [
933
+ backgroundType === "image" && bgUrl && segmentsFromElements && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
940
934
  import_remotion2.Img,
941
935
  {
942
936
  src: bgUrl,
package/dist/index.mjs CHANGED
@@ -35,8 +35,7 @@ var TEXT_DEFAULTS = {
35
35
  strokeWidth: 0,
36
36
  backgroundOpacity: 100,
37
37
  autoWidth: false,
38
- boxAlign: "left",
39
- kerning: true
38
+ boxAlign: "left"
40
39
  };
41
40
  var IMAGE_DEFAULTS = {
42
41
  fit: "cover",
@@ -230,7 +229,6 @@ function TextElement({ segment, scale = 1 }) {
230
229
  const verticalAlign = segment.verticalAlign ?? TEXT_DEFAULTS.verticalAlign;
231
230
  const lineHeight = segment.lineHeight ?? TEXT_DEFAULTS.lineHeight;
232
231
  const letterSpacing = (segment.letterSpacing ?? TEXT_DEFAULTS.letterSpacing) * scale;
233
- const kerning = segment.kerning ?? TEXT_DEFAULTS.kerning;
234
232
  const strokeColor = segment.strokeColor;
235
233
  const strokeWidth = (segment.strokeWidth ?? TEXT_DEFAULTS.strokeWidth) * scale;
236
234
  const uniformPadding = (segment.padding ?? TEXT_DEFAULTS.padding) * scale;
@@ -295,12 +293,6 @@ function TextElement({ segment, scale = 1 }) {
295
293
  color,
296
294
  lineHeight,
297
295
  letterSpacing,
298
- // Font kerning for proper letter pair spacing (can be toggled)
299
- fontKerning: kerning ? "normal" : "none",
300
- // Enable OpenType font features for kerning
301
- fontFeatureSettings: kerning ? '"kern" 1' : '"kern" 0',
302
- // Text rendering optimization for better kerning
303
- textRendering: kerning ? "optimizeLegibility" : "auto",
304
296
  // textAlign works for multi-line text within the (possibly auto-width) box
305
297
  textAlign: alignment === "justify" ? "justify" : alignment,
306
298
  padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
@@ -337,7 +329,6 @@ function TextElement({ segment, scale = 1 }) {
337
329
  color,
338
330
  lineHeight,
339
331
  letterSpacing,
340
- kerning,
341
332
  alignment,
342
333
  paddingTop,
343
334
  paddingRight,
@@ -822,6 +813,8 @@ function ImageEditorComposition({
822
813
  elements,
823
814
  width,
824
815
  height,
816
+ backgroundType = "image",
817
+ backgroundColor,
825
818
  backgroundFit = "cover",
826
819
  backgroundUrl,
827
820
  imageUrls = {},
@@ -874,8 +867,9 @@ function ImageEditorComposition({
874
867
  }
875
868
  return void 0;
876
869
  };
877
- return /* @__PURE__ */ jsxs(AbsoluteFill, { style: { backgroundColor: "#000000" }, children: [
878
- bgUrl && segmentsFromElements && /* @__PURE__ */ jsx3(
870
+ const containerBgColor = backgroundType === "color" && backgroundColor ? backgroundColor : "#000000";
871
+ return /* @__PURE__ */ jsxs(AbsoluteFill, { style: { backgroundColor: containerBgColor }, children: [
872
+ backgroundType === "image" && bgUrl && segmentsFromElements && /* @__PURE__ */ jsx3(
879
873
  Img2,
880
874
  {
881
875
  src: bgUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc-render",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
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",