ugcinc 2.43.0 → 2.47.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.
Files changed (2) hide show
  1. package/dist/types.d.ts +80 -6
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -350,11 +350,29 @@ export interface VideoEditorConfig extends BaseEditorConfig {
350
350
  segments: EditorSegment[];
351
351
  }>;
352
352
  }
353
+ export interface CropBoundary {
354
+ elementId?: string;
355
+ inputRef?: string;
356
+ }
357
+ export interface CropAxisConfig {
358
+ enabled: boolean;
359
+ mode: 'all-elements' | 'between-elements';
360
+ startBoundary?: CropBoundary;
361
+ endBoundary?: CropBoundary;
362
+ paddingStart?: number;
363
+ paddingEnd?: number;
364
+ minSize?: number;
365
+ }
366
+ export interface DynamicCropConfig {
367
+ vertical?: CropAxisConfig;
368
+ horizontal?: CropAxisConfig;
369
+ }
353
370
  export interface ImageEditorConfig extends BaseEditorConfig {
354
371
  channels: Array<{
355
372
  id: string;
356
373
  segments: StaticSegment[];
357
374
  }>;
375
+ dynamicCrop?: DynamicCropConfig;
358
376
  }
359
377
  export interface EditorConfig extends BaseEditorConfig {
360
378
  channels: Array<{
@@ -431,14 +449,56 @@ export interface BorderRadiusConfig {
431
449
  bottomLeft?: number;
432
450
  }
433
451
  /**
434
- * Position anchor for relative positioning
435
- * Specifies which edge of the reference element to anchor to
452
+ * Vertical anchor for Y positioning (parent element)
453
+ * Specifies which vertical edge of the reference element to anchor to
454
+ */
455
+ export type VerticalAnchor = 'top' | 'bottom';
456
+ /**
457
+ * Horizontal anchor for X positioning (parent element)
458
+ * Specifies which horizontal edge of the reference element to anchor to
436
459
  */
460
+ export type HorizontalAnchor = 'left' | 'right';
461
+ /**
462
+ * Self anchor for X positioning
463
+ * Specifies which horizontal edge of THIS element to use for positioning
464
+ */
465
+ export type HorizontalSelfAnchor = 'left' | 'center' | 'right';
466
+ /**
467
+ * Self anchor for Y positioning
468
+ * Specifies which vertical edge of THIS element to use for positioning
469
+ */
470
+ export type VerticalSelfAnchor = 'top' | 'middle' | 'bottom';
471
+ /** @deprecated Use VerticalAnchor or HorizontalAnchor instead */
437
472
  export type PositionAnchor = 'top' | 'bottom' | 'left' | 'right';
438
473
  /**
439
- * Relative position configuration
440
- * When set on a segment, its position is calculated relative to another segment
474
+ * Relative X position configuration
475
+ * When set, the segment's X position is calculated relative to another segment
441
476
  */
477
+ export interface RelativePositionConfigX {
478
+ /** ID of the segment to position relative to */
479
+ elementId: string;
480
+ /** Which horizontal edge of the reference segment to anchor to */
481
+ anchor: HorizontalAnchor;
482
+ /** Which horizontal edge of THIS segment to use (default: opposite of anchor) */
483
+ selfAnchor?: HorizontalSelfAnchor;
484
+ /** Offset in pixels from the anchor point */
485
+ offset: number;
486
+ }
487
+ /**
488
+ * Relative Y position configuration
489
+ * When set, the segment's Y position is calculated relative to another segment
490
+ */
491
+ export interface RelativePositionConfigY {
492
+ /** ID of the segment to position relative to */
493
+ elementId: string;
494
+ /** Which vertical edge of the reference segment to anchor to */
495
+ anchor: VerticalAnchor;
496
+ /** Which vertical edge of THIS segment to use (default: opposite of anchor) */
497
+ selfAnchor?: VerticalSelfAnchor;
498
+ /** Offset in pixels from the anchor point */
499
+ offset: number;
500
+ }
501
+ /** @deprecated Use RelativePositionConfigX and RelativePositionConfigY instead */
442
502
  export interface RelativePositionConfig {
443
503
  /** ID of the segment to position relative to */
444
504
  elementId: string;
@@ -468,14 +528,24 @@ export interface VisualSegmentProps extends BaseSegmentProps {
468
528
  /** Opacity percentage 0-100 (default: 100) */
469
529
  opacity?: number;
470
530
  /**
471
- * Relative positioning - when set, xOffset/yOffset are calculated from the reference segment
531
+ * Relative X positioning - when set, xOffset is calculated from the reference segment
532
+ *
533
+ * @example
534
+ * // Position this segment to the right of another segment
535
+ * relativePositionX: { elementId: 'message-1', anchor: 'right', offset: 10 }
536
+ */
537
+ relativePositionX?: RelativePositionConfigX;
538
+ /**
539
+ * Relative Y positioning - when set, yOffset is calculated from the reference segment
472
540
  * This is useful for stacking elements like text messages where the reference element's
473
541
  * height may vary based on text content.
474
542
  *
475
543
  * @example
476
544
  * // Position this segment below another segment with a 10px gap
477
- * relativePosition: { elementId: 'message-1', anchor: 'bottom', offset: 10 }
545
+ * relativePositionY: { elementId: 'message-1', anchor: 'bottom', offset: 10 }
478
546
  */
547
+ relativePositionY?: RelativePositionConfigY;
548
+ /** @deprecated Use relativePositionX and relativePositionY instead */
479
549
  relativePosition?: RelativePositionConfig;
480
550
  }
481
551
  /**
@@ -574,6 +644,10 @@ export interface TextSegment extends VisualSegmentProps {
574
644
  strokeColor?: string;
575
645
  /** Outline width in pixels (default: 0) */
576
646
  strokeWidth?: number;
647
+ /** When true, box shrinks to fit content (width becomes max width) */
648
+ autoWidth?: boolean;
649
+ /** Which side the box anchors to when autoWidth is true (default: 'left') */
650
+ boxAlign?: 'left' | 'center' | 'right';
577
651
  }
578
652
  /**
579
653
  * Editor segment - nested composition (editor within editor)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.43.0",
3
+ "version": "2.47.0",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",