ugcinc 2.43.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.
- package/dist/types.d.ts +62 -6
- 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
|
-
*
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
/**
|
|
@@ -574,6 +626,10 @@ export interface TextSegment extends VisualSegmentProps {
|
|
|
574
626
|
strokeColor?: string;
|
|
575
627
|
/** Outline width in pixels (default: 0) */
|
|
576
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';
|
|
577
633
|
}
|
|
578
634
|
/**
|
|
579
635
|
* Editor segment - nested composition (editor within editor)
|