ugcinc 2.42.0 → 2.46.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 +65 -7
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -431,14 +431,56 @@ export interface BorderRadiusConfig {
431
431
  bottomLeft?: number;
432
432
  }
433
433
  /**
434
- * Position anchor for relative positioning
435
- * Specifies which edge of the reference element to anchor to
434
+ * Vertical anchor for Y positioning (parent element)
435
+ * Specifies which vertical edge of the reference element to anchor to
436
436
  */
437
+ export type VerticalAnchor = 'top' | 'bottom';
438
+ /**
439
+ * Horizontal anchor for X positioning (parent element)
440
+ * Specifies which horizontal edge of the reference element to anchor to
441
+ */
442
+ export type HorizontalAnchor = 'left' | 'right';
443
+ /**
444
+ * Self anchor for X positioning
445
+ * Specifies which horizontal edge of THIS element to use for positioning
446
+ */
447
+ export type HorizontalSelfAnchor = 'left' | 'center' | 'right';
448
+ /**
449
+ * Self anchor for Y positioning
450
+ * Specifies which vertical edge of THIS element to use for positioning
451
+ */
452
+ export type VerticalSelfAnchor = 'top' | 'middle' | 'bottom';
453
+ /** @deprecated Use VerticalAnchor or HorizontalAnchor instead */
437
454
  export type PositionAnchor = 'top' | 'bottom' | 'left' | 'right';
438
455
  /**
439
- * Relative position configuration
440
- * When set on a segment, its position is calculated relative to another segment
456
+ * Relative X position configuration
457
+ * When set, the segment's X position is calculated relative to another segment
458
+ */
459
+ export interface RelativePositionConfigX {
460
+ /** ID of the segment to position relative to */
461
+ elementId: string;
462
+ /** Which horizontal edge of the reference segment to anchor to */
463
+ anchor: HorizontalAnchor;
464
+ /** Which horizontal edge of THIS segment to use (default: opposite of anchor) */
465
+ selfAnchor?: HorizontalSelfAnchor;
466
+ /** Offset in pixels from the anchor point */
467
+ offset: number;
468
+ }
469
+ /**
470
+ * Relative Y position configuration
471
+ * When set, the segment's Y position is calculated relative to another segment
441
472
  */
473
+ export interface RelativePositionConfigY {
474
+ /** ID of the segment to position relative to */
475
+ elementId: string;
476
+ /** Which vertical edge of the reference segment to anchor to */
477
+ anchor: VerticalAnchor;
478
+ /** Which vertical edge of THIS segment to use (default: opposite of anchor) */
479
+ selfAnchor?: VerticalSelfAnchor;
480
+ /** Offset in pixels from the anchor point */
481
+ offset: number;
482
+ }
483
+ /** @deprecated Use RelativePositionConfigX and RelativePositionConfigY instead */
442
484
  export interface RelativePositionConfig {
443
485
  /** ID of the segment to position relative to */
444
486
  elementId: string;
@@ -468,14 +510,24 @@ export interface VisualSegmentProps extends BaseSegmentProps {
468
510
  /** Opacity percentage 0-100 (default: 100) */
469
511
  opacity?: number;
470
512
  /**
471
- * Relative positioning - when set, xOffset/yOffset are calculated from the reference segment
513
+ * Relative X positioning - when set, xOffset is calculated from the reference segment
514
+ *
515
+ * @example
516
+ * // Position this segment to the right of another segment
517
+ * relativePositionX: { elementId: 'message-1', anchor: 'right', offset: 10 }
518
+ */
519
+ relativePositionX?: RelativePositionConfigX;
520
+ /**
521
+ * Relative Y positioning - when set, yOffset is calculated from the reference segment
472
522
  * This is useful for stacking elements like text messages where the reference element's
473
523
  * height may vary based on text content.
474
524
  *
475
525
  * @example
476
526
  * // Position this segment below another segment with a 10px gap
477
- * relativePosition: { elementId: 'message-1', anchor: 'bottom', offset: 10 }
527
+ * relativePositionY: { elementId: 'message-1', anchor: 'bottom', offset: 10 }
478
528
  */
529
+ relativePositionY?: RelativePositionConfigY;
530
+ /** @deprecated Use relativePositionX and relativePositionY instead */
479
531
  relativePosition?: RelativePositionConfig;
480
532
  }
481
533
  /**
@@ -564,14 +616,20 @@ export interface TextSegment extends VisualSegmentProps {
564
616
  ellipsis?: string;
565
617
  /** Text color (default: '#FFFFFF') */
566
618
  color?: string;
567
- /** Background color with optional alpha (default: transparent) */
619
+ /** Background color in hex format #RRGGBB (default: transparent) */
568
620
  backgroundColor?: string;
621
+ /** Background opacity 0-100 (default: 100) */
622
+ backgroundOpacity?: number;
569
623
  /** Border radius for background box - individual corners (default: 0) */
570
624
  backgroundBorderRadius?: BorderRadiusConfig;
571
625
  /** Text outline color (default: none) */
572
626
  strokeColor?: string;
573
627
  /** Outline width in pixels (default: 0) */
574
628
  strokeWidth?: number;
629
+ /** When true, box shrinks to fit content (width becomes max width) */
630
+ autoWidth?: boolean;
631
+ /** Which side the box anchors to when autoWidth is true (default: 'left') */
632
+ boxAlign?: 'left' | 'center' | 'right';
575
633
  }
576
634
  /**
577
635
  * Editor segment - nested composition (editor within editor)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.42.0",
3
+ "version": "2.46.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",