@appstorys/react-web 1.1.1 → 1.1.3
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 +151 -26
- package/dist/index.d.ts +151 -26
- package/dist/index.js +33 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface WidgetProps {
|
|
5
|
+
position?: string;
|
|
6
|
+
leftPadding?: number;
|
|
7
|
+
rightPadding?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Web widget component mirroring RN Widgets.tsx implementation
|
|
11
|
+
* - Accepts optional position, leftPadding, rightPadding props
|
|
12
|
+
* - Fetches single campaign via useCampaigns hook
|
|
13
|
+
* - Renders carousel with auto-advance (full) or manual scroll (half)
|
|
14
|
+
* - Supports static images and Lottie animations
|
|
15
|
+
* - Portals into host element if position target found
|
|
16
|
+
*/
|
|
17
|
+
declare const Widget: React__default.FC<WidgetProps>;
|
|
2
18
|
|
|
3
19
|
type CampaignType = 'BAN' | 'FLT' | 'PIP' | 'SUR' | 'CSAT' | 'WID' | 'MOD' | 'BTS' | 'SCRT' | 'STR' | 'TLTP' | 'TTP';
|
|
4
20
|
interface CrossButtonConfig {
|
|
@@ -41,7 +57,11 @@ interface BaseCampaign {
|
|
|
41
57
|
trigger_event?: TriggerEvent;
|
|
42
58
|
position?: string;
|
|
43
59
|
screen?: string;
|
|
60
|
+
priority?: number;
|
|
44
61
|
details: any;
|
|
62
|
+
isTesting?: boolean;
|
|
63
|
+
testUsers?: string[];
|
|
64
|
+
display_trigger?: boolean;
|
|
45
65
|
}
|
|
46
66
|
interface CampaignBanner extends BaseCampaign {
|
|
47
67
|
campaign_type: 'BAN';
|
|
@@ -92,8 +112,13 @@ interface AppStorysStore {
|
|
|
92
112
|
variantMappings: Record<string, string>;
|
|
93
113
|
personalizationData: Record<string, string>;
|
|
94
114
|
screenCaptureEnabled?: boolean;
|
|
115
|
+
/** @deprecated use `usersUrl` */
|
|
95
116
|
baseUrl?: string;
|
|
117
|
+
usersUrl?: string;
|
|
96
118
|
trackingUrl?: string;
|
|
119
|
+
campaignsUrl?: string;
|
|
120
|
+
mediaUrl?: string;
|
|
121
|
+
backendUrl?: string;
|
|
97
122
|
}
|
|
98
123
|
interface StorySlideCtaContainer {
|
|
99
124
|
alignment?: string;
|
|
@@ -156,6 +181,7 @@ interface StoryGroupStyling {
|
|
|
156
181
|
size?: number;
|
|
157
182
|
};
|
|
158
183
|
ringWidth?: number;
|
|
184
|
+
ringAndImageSpace?: number;
|
|
159
185
|
share?: {
|
|
160
186
|
color?: {
|
|
161
187
|
cross?: string;
|
|
@@ -253,6 +279,7 @@ interface TooltipStyling {
|
|
|
253
279
|
right?: number;
|
|
254
280
|
top?: number;
|
|
255
281
|
};
|
|
282
|
+
width?: number;
|
|
256
283
|
/** When both width and height are set, the tooltip is treated as an
|
|
257
284
|
* image tooltip: the container is sized to this exact (viewport-clamped)
|
|
258
285
|
* box and the image is cropped to fill it edge-to-edge, matching RN's
|
|
@@ -458,6 +485,12 @@ interface SurveyCampaignDetails {
|
|
|
458
485
|
imageStyle?: {
|
|
459
486
|
height?: number;
|
|
460
487
|
width?: number;
|
|
488
|
+
margin?: {
|
|
489
|
+
bottom?: number;
|
|
490
|
+
left?: number;
|
|
491
|
+
right?: number;
|
|
492
|
+
top?: number;
|
|
493
|
+
};
|
|
461
494
|
};
|
|
462
495
|
subtitle?: {
|
|
463
496
|
textStyle?: SurveyTextStyle;
|
|
@@ -569,7 +602,35 @@ interface CsatCampaignDetails {
|
|
|
569
602
|
};
|
|
570
603
|
};
|
|
571
604
|
rating?: {
|
|
572
|
-
|
|
605
|
+
/** Horizontal alignment of the rating row: 'left' | 'center' | 'right' */
|
|
606
|
+
alignment?: string;
|
|
607
|
+
/** Corner radius applied to all rating item containers */
|
|
608
|
+
cornerRadius?: {
|
|
609
|
+
topLeft?: number;
|
|
610
|
+
topRight?: number;
|
|
611
|
+
bottomLeft?: number;
|
|
612
|
+
bottomRight?: number;
|
|
613
|
+
};
|
|
614
|
+
/** Arbitrary display-text label (reserved, not yet rendered) */
|
|
615
|
+
displayText?: string;
|
|
616
|
+
/** Emoji options — backend sends object form { selected, unselected, values } */
|
|
617
|
+
emoji?: string[] | string | null | {
|
|
618
|
+
selected?: {
|
|
619
|
+
stylingContainer?: {
|
|
620
|
+
border?: string;
|
|
621
|
+
borderWidth?: number;
|
|
622
|
+
fill?: string;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
unselected?: {
|
|
626
|
+
stylingContainer?: {
|
|
627
|
+
border?: string;
|
|
628
|
+
borderWidth?: number;
|
|
629
|
+
fill?: string;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
values?: string[];
|
|
633
|
+
};
|
|
573
634
|
highRatingSubtitle?: string;
|
|
574
635
|
highRatingTitle?: string;
|
|
575
636
|
lowRatingSubtitle?: string;
|
|
@@ -577,8 +638,43 @@ interface CsatCampaignDetails {
|
|
|
577
638
|
number?: number | {
|
|
578
639
|
min?: number;
|
|
579
640
|
max?: number;
|
|
641
|
+
high?: {
|
|
642
|
+
stylingContainer?: {
|
|
643
|
+
fill?: string;
|
|
644
|
+
background?: string;
|
|
645
|
+
border?: string;
|
|
646
|
+
borderWidth?: number;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
low?: {
|
|
650
|
+
stylingContainer?: {
|
|
651
|
+
fill?: string;
|
|
652
|
+
background?: string;
|
|
653
|
+
border?: string;
|
|
654
|
+
borderWidth?: number;
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
unselected?: {
|
|
658
|
+
stylingContainer?: {
|
|
659
|
+
fill?: string;
|
|
660
|
+
background?: string;
|
|
661
|
+
border?: string;
|
|
662
|
+
borderWidth?: number;
|
|
663
|
+
};
|
|
664
|
+
stylingNumber?: {
|
|
665
|
+
text?: string;
|
|
666
|
+
textSize?: number;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
/** Text styling applied to the number label when the button is selected */
|
|
670
|
+
stylingNumber?: {
|
|
671
|
+
text?: string;
|
|
672
|
+
textSize?: number;
|
|
673
|
+
};
|
|
580
674
|
} | null;
|
|
581
675
|
ratingType?: string;
|
|
676
|
+
/** Gap (px) between rating items for star and emoji types */
|
|
677
|
+
spacing?: number;
|
|
582
678
|
star?: {
|
|
583
679
|
high?: {
|
|
584
680
|
stylingContainer?: {
|
|
@@ -625,6 +721,8 @@ interface CsatCampaignDetails {
|
|
|
625
721
|
};
|
|
626
722
|
imageStyle?: {
|
|
627
723
|
height?: number;
|
|
724
|
+
/** Margin around the thank-you image */
|
|
725
|
+
margin?: CsatSpacing;
|
|
628
726
|
width?: number;
|
|
629
727
|
};
|
|
630
728
|
subtitle?: {
|
|
@@ -760,16 +858,26 @@ interface InitializationOptions {
|
|
|
760
858
|
appId: string;
|
|
761
859
|
accountId: string;
|
|
762
860
|
userId?: string;
|
|
861
|
+
/** @deprecated use `usersUrl` */
|
|
763
862
|
baseUrl?: string;
|
|
863
|
+
/** Override the users host (default https://users.appstorys.co). */
|
|
864
|
+
usersUrl?: string;
|
|
865
|
+
/** Override the tracking host (default https://tracking.appstorys.co). */
|
|
764
866
|
trackingUrl?: string;
|
|
867
|
+
/** Override the campaigns CDN host. */
|
|
868
|
+
campaignsUrl?: string;
|
|
869
|
+
/** Override the media bucket host. */
|
|
870
|
+
mediaUrl?: string;
|
|
871
|
+
/** Override the backend/appinfo host (default https://backend.appstorys.co). */
|
|
872
|
+
backendUrl?: string;
|
|
765
873
|
navigateToScreen?: (screen: string) => void;
|
|
766
874
|
}
|
|
767
875
|
|
|
768
|
-
declare const Banner:
|
|
876
|
+
declare const Banner: React__default.FC;
|
|
769
877
|
|
|
770
|
-
declare const Pip:
|
|
878
|
+
declare const Pip: React__default.FC;
|
|
771
879
|
|
|
772
|
-
declare const Floater:
|
|
880
|
+
declare const Floater: React__default.FC;
|
|
773
881
|
|
|
774
882
|
declare function personalizeText(text: string): string;
|
|
775
883
|
|
|
@@ -779,29 +887,17 @@ declare global {
|
|
|
779
887
|
}
|
|
780
888
|
}
|
|
781
889
|
|
|
782
|
-
declare const Story:
|
|
890
|
+
declare const Story: React__default.FC;
|
|
783
891
|
|
|
784
|
-
|
|
785
|
-
position?: string;
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* Simple web widget component mirroring RN Widgets.tsx implementation
|
|
789
|
-
* - Accepts optional position prop
|
|
790
|
-
* - Fetches single campaign via useCampaigns hook
|
|
791
|
-
* - Renders carousel with auto-advance (full) or manual scroll (half)
|
|
792
|
-
* - Portals into host element if position target found
|
|
793
|
-
*/
|
|
794
|
-
declare const Widget: React.FC<WidgetProps>;
|
|
892
|
+
declare const Tooltip: React__default.FC;
|
|
795
893
|
|
|
796
|
-
declare const
|
|
894
|
+
declare const BottomSheet: React__default.FC;
|
|
797
895
|
|
|
798
|
-
declare const
|
|
896
|
+
declare const Csat: React__default.FC;
|
|
799
897
|
|
|
800
|
-
declare const
|
|
898
|
+
declare const Survey: React__default.FC;
|
|
801
899
|
|
|
802
|
-
declare const
|
|
803
|
-
|
|
804
|
-
declare const Modal: React.FC;
|
|
900
|
+
declare const Modal: React__default.FC;
|
|
805
901
|
|
|
806
902
|
interface TrackableProps {
|
|
807
903
|
/**
|
|
@@ -811,7 +907,7 @@ interface TrackableProps {
|
|
|
811
907
|
* its own root DOM node.
|
|
812
908
|
*/
|
|
813
909
|
id: string;
|
|
814
|
-
children:
|
|
910
|
+
children: React__default.ReactNode;
|
|
815
911
|
}
|
|
816
912
|
/**
|
|
817
913
|
* Wraps any child (native element or custom component) in a zero-layout-impact
|
|
@@ -823,7 +919,7 @@ interface TrackableProps {
|
|
|
823
919
|
* <SomeThirdPartyButton>Checkout</SomeThirdPartyButton>
|
|
824
920
|
* </Trackable>
|
|
825
921
|
*/
|
|
826
|
-
declare const Trackable:
|
|
922
|
+
declare const Trackable: React__default.FC<TrackableProps>;
|
|
827
923
|
|
|
828
924
|
interface VariantDetails {
|
|
829
925
|
id?: string;
|
|
@@ -842,6 +938,33 @@ declare function selectVariantByWeight(variants: VariantsMap, campaignId?: strin
|
|
|
842
938
|
declare function resolveCampaignVariant<T extends Campaign>(campaign: T): T;
|
|
843
939
|
declare function getCampaignVariantId(campaign: Campaign): string | undefined;
|
|
844
940
|
|
|
941
|
+
declare const DEFAULT_OVERLAY_PRIORITIES: Record<string, number>;
|
|
942
|
+
declare const BASE_OVERLAY_Z_INDEX = 10000;
|
|
943
|
+
interface ResolvedPriority {
|
|
944
|
+
priority: number;
|
|
945
|
+
hasExplicitPriority: boolean;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Parses the campaign priority. Backend sends 1-indexed priority (starting from 1).
|
|
949
|
+
* If no valid positive priority is specified in JSON, falls back to the default overlay rank.
|
|
950
|
+
*/
|
|
951
|
+
declare function parseCampaignPriority(campaign: any): ResolvedPriority;
|
|
952
|
+
/**
|
|
953
|
+
* Compares two campaigns for priority order.
|
|
954
|
+
* - Explicit priorities take precedence on ties.
|
|
955
|
+
* - Lower priority number (1, 2, 3...) indicates higher priority ranking.
|
|
956
|
+
*/
|
|
957
|
+
declare function compareCampaignPriority(a: any, b: any): number;
|
|
958
|
+
/**
|
|
959
|
+
* Stably sorts an array of campaigns by priority (highest priority first).
|
|
960
|
+
*/
|
|
961
|
+
declare function sortCampaignsByPriority<T extends Campaign>(campaigns: T[]): T[];
|
|
962
|
+
/**
|
|
963
|
+
* Computes the dynamic z-index for an overlay campaign.
|
|
964
|
+
* Stacking order matches priority ranks (Rank 1 at back, Rank 10 at top front).
|
|
965
|
+
*/
|
|
966
|
+
declare function getCampaignZIndex(campaign?: any, fallbackType?: CampaignType | string, baseZIndex?: number): number;
|
|
967
|
+
|
|
845
968
|
declare class AppStorys {
|
|
846
969
|
private state;
|
|
847
970
|
private navigateToScreen?;
|
|
@@ -867,8 +990,10 @@ declare class AppStorys {
|
|
|
867
990
|
set visibility(isVisible: boolean);
|
|
868
991
|
private ensureInitialized;
|
|
869
992
|
personalizeText(text: string): string;
|
|
993
|
+
Widget: React.FC<WidgetProps>;
|
|
994
|
+
Widgets: React.FC<WidgetProps>;
|
|
870
995
|
}
|
|
871
996
|
|
|
872
997
|
declare const instance: AppStorys;
|
|
873
998
|
|
|
874
|
-
export { instance as AppStorys, type AppStorysStore, type Attributes, Banner, type BaseCampaign, BottomSheet, type BottomSheetElement, type Campaign, type CampaignBanner, type CampaignBottomSheet, type CampaignCsat, type CampaignModal, type CampaignStory, type CampaignSurvey, type CampaignTooltip, type CampaignType, type CampaignWidget, type CrossButtonConfig, Csat, type CsatCampaignDetails, type CsatSpacing, type CsatTextStyle, Floater, type InitializationOptions, Modal, type ModalCampaignDetails, type ModalContent, type ModalCtaRedirection, type ModalCtaStyle, type ModalItem, type ModalItemStyling, type ModalMediaType, type ModalTextStyle, Pip, SdkState, Story, type StoryGroupStyling, type StorySlide, type StorySlideCta, type StorySlideCtaBorderRadius, type StorySlideCtaContainer, type StorySlideCtaText, type StorySlideStyling, Survey, type SurveyCampaignDetails, type SurveyOptionColors, type SurveyOptionStyle, type SurveySlide, type SurveySlideLogicRule, type SurveyTextStyle, type SurveyThankYouButtonConfig, Tooltip, type TooltipItem, type TooltipStyling, Trackable, type TrackableProps, type TriggerEvent, type TriggerEventConfig, type TriggerEventObject, type VariantDetails, type VariantsMap, Widget, type WidgetImage, getCampaignVariantId, getVariantId, hasVariants, personalizeText, resolveCampaignVariant, selectVariantByWeight };
|
|
999
|
+
export { instance as AppStorys, type AppStorysStore, type Attributes, BASE_OVERLAY_Z_INDEX, Banner, type BaseCampaign, BottomSheet, type BottomSheetElement, type Campaign, type CampaignBanner, type CampaignBottomSheet, type CampaignCsat, type CampaignModal, type CampaignStory, type CampaignSurvey, type CampaignTooltip, type CampaignType, type CampaignWidget, type CrossButtonConfig, Csat, type CsatCampaignDetails, type CsatSpacing, type CsatTextStyle, DEFAULT_OVERLAY_PRIORITIES, Floater, type InitializationOptions, Modal, type ModalCampaignDetails, type ModalContent, type ModalCtaRedirection, type ModalCtaStyle, type ModalItem, type ModalItemStyling, type ModalMediaType, type ModalTextStyle, Pip, type ResolvedPriority, SdkState, Story, type StoryGroupStyling, type StorySlide, type StorySlideCta, type StorySlideCtaBorderRadius, type StorySlideCtaContainer, type StorySlideCtaText, type StorySlideStyling, Survey, type SurveyCampaignDetails, type SurveyOptionColors, type SurveyOptionStyle, type SurveySlide, type SurveySlideLogicRule, type SurveyTextStyle, type SurveyThankYouButtonConfig, Tooltip, type TooltipItem, type TooltipStyling, Trackable, type TrackableProps, type TriggerEvent, type TriggerEventConfig, type TriggerEventObject, type VariantDetails, type VariantsMap, Widget, type WidgetImage, type WidgetProps, Widget as Widgets, compareCampaignPriority, getCampaignVariantId, getCampaignZIndex, getVariantId, hasVariants, parseCampaignPriority, personalizeText, resolveCampaignVariant, selectVariantByWeight, sortCampaignsByPriority };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface WidgetProps {
|
|
5
|
+
position?: string;
|
|
6
|
+
leftPadding?: number;
|
|
7
|
+
rightPadding?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Web widget component mirroring RN Widgets.tsx implementation
|
|
11
|
+
* - Accepts optional position, leftPadding, rightPadding props
|
|
12
|
+
* - Fetches single campaign via useCampaigns hook
|
|
13
|
+
* - Renders carousel with auto-advance (full) or manual scroll (half)
|
|
14
|
+
* - Supports static images and Lottie animations
|
|
15
|
+
* - Portals into host element if position target found
|
|
16
|
+
*/
|
|
17
|
+
declare const Widget: React__default.FC<WidgetProps>;
|
|
2
18
|
|
|
3
19
|
type CampaignType = 'BAN' | 'FLT' | 'PIP' | 'SUR' | 'CSAT' | 'WID' | 'MOD' | 'BTS' | 'SCRT' | 'STR' | 'TLTP' | 'TTP';
|
|
4
20
|
interface CrossButtonConfig {
|
|
@@ -41,7 +57,11 @@ interface BaseCampaign {
|
|
|
41
57
|
trigger_event?: TriggerEvent;
|
|
42
58
|
position?: string;
|
|
43
59
|
screen?: string;
|
|
60
|
+
priority?: number;
|
|
44
61
|
details: any;
|
|
62
|
+
isTesting?: boolean;
|
|
63
|
+
testUsers?: string[];
|
|
64
|
+
display_trigger?: boolean;
|
|
45
65
|
}
|
|
46
66
|
interface CampaignBanner extends BaseCampaign {
|
|
47
67
|
campaign_type: 'BAN';
|
|
@@ -92,8 +112,13 @@ interface AppStorysStore {
|
|
|
92
112
|
variantMappings: Record<string, string>;
|
|
93
113
|
personalizationData: Record<string, string>;
|
|
94
114
|
screenCaptureEnabled?: boolean;
|
|
115
|
+
/** @deprecated use `usersUrl` */
|
|
95
116
|
baseUrl?: string;
|
|
117
|
+
usersUrl?: string;
|
|
96
118
|
trackingUrl?: string;
|
|
119
|
+
campaignsUrl?: string;
|
|
120
|
+
mediaUrl?: string;
|
|
121
|
+
backendUrl?: string;
|
|
97
122
|
}
|
|
98
123
|
interface StorySlideCtaContainer {
|
|
99
124
|
alignment?: string;
|
|
@@ -156,6 +181,7 @@ interface StoryGroupStyling {
|
|
|
156
181
|
size?: number;
|
|
157
182
|
};
|
|
158
183
|
ringWidth?: number;
|
|
184
|
+
ringAndImageSpace?: number;
|
|
159
185
|
share?: {
|
|
160
186
|
color?: {
|
|
161
187
|
cross?: string;
|
|
@@ -253,6 +279,7 @@ interface TooltipStyling {
|
|
|
253
279
|
right?: number;
|
|
254
280
|
top?: number;
|
|
255
281
|
};
|
|
282
|
+
width?: number;
|
|
256
283
|
/** When both width and height are set, the tooltip is treated as an
|
|
257
284
|
* image tooltip: the container is sized to this exact (viewport-clamped)
|
|
258
285
|
* box and the image is cropped to fill it edge-to-edge, matching RN's
|
|
@@ -458,6 +485,12 @@ interface SurveyCampaignDetails {
|
|
|
458
485
|
imageStyle?: {
|
|
459
486
|
height?: number;
|
|
460
487
|
width?: number;
|
|
488
|
+
margin?: {
|
|
489
|
+
bottom?: number;
|
|
490
|
+
left?: number;
|
|
491
|
+
right?: number;
|
|
492
|
+
top?: number;
|
|
493
|
+
};
|
|
461
494
|
};
|
|
462
495
|
subtitle?: {
|
|
463
496
|
textStyle?: SurveyTextStyle;
|
|
@@ -569,7 +602,35 @@ interface CsatCampaignDetails {
|
|
|
569
602
|
};
|
|
570
603
|
};
|
|
571
604
|
rating?: {
|
|
572
|
-
|
|
605
|
+
/** Horizontal alignment of the rating row: 'left' | 'center' | 'right' */
|
|
606
|
+
alignment?: string;
|
|
607
|
+
/** Corner radius applied to all rating item containers */
|
|
608
|
+
cornerRadius?: {
|
|
609
|
+
topLeft?: number;
|
|
610
|
+
topRight?: number;
|
|
611
|
+
bottomLeft?: number;
|
|
612
|
+
bottomRight?: number;
|
|
613
|
+
};
|
|
614
|
+
/** Arbitrary display-text label (reserved, not yet rendered) */
|
|
615
|
+
displayText?: string;
|
|
616
|
+
/** Emoji options — backend sends object form { selected, unselected, values } */
|
|
617
|
+
emoji?: string[] | string | null | {
|
|
618
|
+
selected?: {
|
|
619
|
+
stylingContainer?: {
|
|
620
|
+
border?: string;
|
|
621
|
+
borderWidth?: number;
|
|
622
|
+
fill?: string;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
unselected?: {
|
|
626
|
+
stylingContainer?: {
|
|
627
|
+
border?: string;
|
|
628
|
+
borderWidth?: number;
|
|
629
|
+
fill?: string;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
values?: string[];
|
|
633
|
+
};
|
|
573
634
|
highRatingSubtitle?: string;
|
|
574
635
|
highRatingTitle?: string;
|
|
575
636
|
lowRatingSubtitle?: string;
|
|
@@ -577,8 +638,43 @@ interface CsatCampaignDetails {
|
|
|
577
638
|
number?: number | {
|
|
578
639
|
min?: number;
|
|
579
640
|
max?: number;
|
|
641
|
+
high?: {
|
|
642
|
+
stylingContainer?: {
|
|
643
|
+
fill?: string;
|
|
644
|
+
background?: string;
|
|
645
|
+
border?: string;
|
|
646
|
+
borderWidth?: number;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
low?: {
|
|
650
|
+
stylingContainer?: {
|
|
651
|
+
fill?: string;
|
|
652
|
+
background?: string;
|
|
653
|
+
border?: string;
|
|
654
|
+
borderWidth?: number;
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
unselected?: {
|
|
658
|
+
stylingContainer?: {
|
|
659
|
+
fill?: string;
|
|
660
|
+
background?: string;
|
|
661
|
+
border?: string;
|
|
662
|
+
borderWidth?: number;
|
|
663
|
+
};
|
|
664
|
+
stylingNumber?: {
|
|
665
|
+
text?: string;
|
|
666
|
+
textSize?: number;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
/** Text styling applied to the number label when the button is selected */
|
|
670
|
+
stylingNumber?: {
|
|
671
|
+
text?: string;
|
|
672
|
+
textSize?: number;
|
|
673
|
+
};
|
|
580
674
|
} | null;
|
|
581
675
|
ratingType?: string;
|
|
676
|
+
/** Gap (px) between rating items for star and emoji types */
|
|
677
|
+
spacing?: number;
|
|
582
678
|
star?: {
|
|
583
679
|
high?: {
|
|
584
680
|
stylingContainer?: {
|
|
@@ -625,6 +721,8 @@ interface CsatCampaignDetails {
|
|
|
625
721
|
};
|
|
626
722
|
imageStyle?: {
|
|
627
723
|
height?: number;
|
|
724
|
+
/** Margin around the thank-you image */
|
|
725
|
+
margin?: CsatSpacing;
|
|
628
726
|
width?: number;
|
|
629
727
|
};
|
|
630
728
|
subtitle?: {
|
|
@@ -760,16 +858,26 @@ interface InitializationOptions {
|
|
|
760
858
|
appId: string;
|
|
761
859
|
accountId: string;
|
|
762
860
|
userId?: string;
|
|
861
|
+
/** @deprecated use `usersUrl` */
|
|
763
862
|
baseUrl?: string;
|
|
863
|
+
/** Override the users host (default https://users.appstorys.co). */
|
|
864
|
+
usersUrl?: string;
|
|
865
|
+
/** Override the tracking host (default https://tracking.appstorys.co). */
|
|
764
866
|
trackingUrl?: string;
|
|
867
|
+
/** Override the campaigns CDN host. */
|
|
868
|
+
campaignsUrl?: string;
|
|
869
|
+
/** Override the media bucket host. */
|
|
870
|
+
mediaUrl?: string;
|
|
871
|
+
/** Override the backend/appinfo host (default https://backend.appstorys.co). */
|
|
872
|
+
backendUrl?: string;
|
|
765
873
|
navigateToScreen?: (screen: string) => void;
|
|
766
874
|
}
|
|
767
875
|
|
|
768
|
-
declare const Banner:
|
|
876
|
+
declare const Banner: React__default.FC;
|
|
769
877
|
|
|
770
|
-
declare const Pip:
|
|
878
|
+
declare const Pip: React__default.FC;
|
|
771
879
|
|
|
772
|
-
declare const Floater:
|
|
880
|
+
declare const Floater: React__default.FC;
|
|
773
881
|
|
|
774
882
|
declare function personalizeText(text: string): string;
|
|
775
883
|
|
|
@@ -779,29 +887,17 @@ declare global {
|
|
|
779
887
|
}
|
|
780
888
|
}
|
|
781
889
|
|
|
782
|
-
declare const Story:
|
|
890
|
+
declare const Story: React__default.FC;
|
|
783
891
|
|
|
784
|
-
|
|
785
|
-
position?: string;
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* Simple web widget component mirroring RN Widgets.tsx implementation
|
|
789
|
-
* - Accepts optional position prop
|
|
790
|
-
* - Fetches single campaign via useCampaigns hook
|
|
791
|
-
* - Renders carousel with auto-advance (full) or manual scroll (half)
|
|
792
|
-
* - Portals into host element if position target found
|
|
793
|
-
*/
|
|
794
|
-
declare const Widget: React.FC<WidgetProps>;
|
|
892
|
+
declare const Tooltip: React__default.FC;
|
|
795
893
|
|
|
796
|
-
declare const
|
|
894
|
+
declare const BottomSheet: React__default.FC;
|
|
797
895
|
|
|
798
|
-
declare const
|
|
896
|
+
declare const Csat: React__default.FC;
|
|
799
897
|
|
|
800
|
-
declare const
|
|
898
|
+
declare const Survey: React__default.FC;
|
|
801
899
|
|
|
802
|
-
declare const
|
|
803
|
-
|
|
804
|
-
declare const Modal: React.FC;
|
|
900
|
+
declare const Modal: React__default.FC;
|
|
805
901
|
|
|
806
902
|
interface TrackableProps {
|
|
807
903
|
/**
|
|
@@ -811,7 +907,7 @@ interface TrackableProps {
|
|
|
811
907
|
* its own root DOM node.
|
|
812
908
|
*/
|
|
813
909
|
id: string;
|
|
814
|
-
children:
|
|
910
|
+
children: React__default.ReactNode;
|
|
815
911
|
}
|
|
816
912
|
/**
|
|
817
913
|
* Wraps any child (native element or custom component) in a zero-layout-impact
|
|
@@ -823,7 +919,7 @@ interface TrackableProps {
|
|
|
823
919
|
* <SomeThirdPartyButton>Checkout</SomeThirdPartyButton>
|
|
824
920
|
* </Trackable>
|
|
825
921
|
*/
|
|
826
|
-
declare const Trackable:
|
|
922
|
+
declare const Trackable: React__default.FC<TrackableProps>;
|
|
827
923
|
|
|
828
924
|
interface VariantDetails {
|
|
829
925
|
id?: string;
|
|
@@ -842,6 +938,33 @@ declare function selectVariantByWeight(variants: VariantsMap, campaignId?: strin
|
|
|
842
938
|
declare function resolveCampaignVariant<T extends Campaign>(campaign: T): T;
|
|
843
939
|
declare function getCampaignVariantId(campaign: Campaign): string | undefined;
|
|
844
940
|
|
|
941
|
+
declare const DEFAULT_OVERLAY_PRIORITIES: Record<string, number>;
|
|
942
|
+
declare const BASE_OVERLAY_Z_INDEX = 10000;
|
|
943
|
+
interface ResolvedPriority {
|
|
944
|
+
priority: number;
|
|
945
|
+
hasExplicitPriority: boolean;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Parses the campaign priority. Backend sends 1-indexed priority (starting from 1).
|
|
949
|
+
* If no valid positive priority is specified in JSON, falls back to the default overlay rank.
|
|
950
|
+
*/
|
|
951
|
+
declare function parseCampaignPriority(campaign: any): ResolvedPriority;
|
|
952
|
+
/**
|
|
953
|
+
* Compares two campaigns for priority order.
|
|
954
|
+
* - Explicit priorities take precedence on ties.
|
|
955
|
+
* - Lower priority number (1, 2, 3...) indicates higher priority ranking.
|
|
956
|
+
*/
|
|
957
|
+
declare function compareCampaignPriority(a: any, b: any): number;
|
|
958
|
+
/**
|
|
959
|
+
* Stably sorts an array of campaigns by priority (highest priority first).
|
|
960
|
+
*/
|
|
961
|
+
declare function sortCampaignsByPriority<T extends Campaign>(campaigns: T[]): T[];
|
|
962
|
+
/**
|
|
963
|
+
* Computes the dynamic z-index for an overlay campaign.
|
|
964
|
+
* Stacking order matches priority ranks (Rank 1 at back, Rank 10 at top front).
|
|
965
|
+
*/
|
|
966
|
+
declare function getCampaignZIndex(campaign?: any, fallbackType?: CampaignType | string, baseZIndex?: number): number;
|
|
967
|
+
|
|
845
968
|
declare class AppStorys {
|
|
846
969
|
private state;
|
|
847
970
|
private navigateToScreen?;
|
|
@@ -867,8 +990,10 @@ declare class AppStorys {
|
|
|
867
990
|
set visibility(isVisible: boolean);
|
|
868
991
|
private ensureInitialized;
|
|
869
992
|
personalizeText(text: string): string;
|
|
993
|
+
Widget: React.FC<WidgetProps>;
|
|
994
|
+
Widgets: React.FC<WidgetProps>;
|
|
870
995
|
}
|
|
871
996
|
|
|
872
997
|
declare const instance: AppStorys;
|
|
873
998
|
|
|
874
|
-
export { instance as AppStorys, type AppStorysStore, type Attributes, Banner, type BaseCampaign, BottomSheet, type BottomSheetElement, type Campaign, type CampaignBanner, type CampaignBottomSheet, type CampaignCsat, type CampaignModal, type CampaignStory, type CampaignSurvey, type CampaignTooltip, type CampaignType, type CampaignWidget, type CrossButtonConfig, Csat, type CsatCampaignDetails, type CsatSpacing, type CsatTextStyle, Floater, type InitializationOptions, Modal, type ModalCampaignDetails, type ModalContent, type ModalCtaRedirection, type ModalCtaStyle, type ModalItem, type ModalItemStyling, type ModalMediaType, type ModalTextStyle, Pip, SdkState, Story, type StoryGroupStyling, type StorySlide, type StorySlideCta, type StorySlideCtaBorderRadius, type StorySlideCtaContainer, type StorySlideCtaText, type StorySlideStyling, Survey, type SurveyCampaignDetails, type SurveyOptionColors, type SurveyOptionStyle, type SurveySlide, type SurveySlideLogicRule, type SurveyTextStyle, type SurveyThankYouButtonConfig, Tooltip, type TooltipItem, type TooltipStyling, Trackable, type TrackableProps, type TriggerEvent, type TriggerEventConfig, type TriggerEventObject, type VariantDetails, type VariantsMap, Widget, type WidgetImage, getCampaignVariantId, getVariantId, hasVariants, personalizeText, resolveCampaignVariant, selectVariantByWeight };
|
|
999
|
+
export { instance as AppStorys, type AppStorysStore, type Attributes, BASE_OVERLAY_Z_INDEX, Banner, type BaseCampaign, BottomSheet, type BottomSheetElement, type Campaign, type CampaignBanner, type CampaignBottomSheet, type CampaignCsat, type CampaignModal, type CampaignStory, type CampaignSurvey, type CampaignTooltip, type CampaignType, type CampaignWidget, type CrossButtonConfig, Csat, type CsatCampaignDetails, type CsatSpacing, type CsatTextStyle, DEFAULT_OVERLAY_PRIORITIES, Floater, type InitializationOptions, Modal, type ModalCampaignDetails, type ModalContent, type ModalCtaRedirection, type ModalCtaStyle, type ModalItem, type ModalItemStyling, type ModalMediaType, type ModalTextStyle, Pip, type ResolvedPriority, SdkState, Story, type StoryGroupStyling, type StorySlide, type StorySlideCta, type StorySlideCtaBorderRadius, type StorySlideCtaContainer, type StorySlideCtaText, type StorySlideStyling, Survey, type SurveyCampaignDetails, type SurveyOptionColors, type SurveyOptionStyle, type SurveySlide, type SurveySlideLogicRule, type SurveyTextStyle, type SurveyThankYouButtonConfig, Tooltip, type TooltipItem, type TooltipStyling, Trackable, type TrackableProps, type TriggerEvent, type TriggerEventConfig, type TriggerEventObject, type VariantDetails, type VariantsMap, Widget, type WidgetImage, type WidgetProps, Widget as Widgets, compareCampaignPriority, getCampaignVariantId, getCampaignZIndex, getVariantId, hasVariants, parseCampaignPriority, personalizeText, resolveCampaignVariant, selectVariantByWeight, sortCampaignsByPriority };
|