@revturbine/sdk 0.2.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/headless.js +131 -0
- package/dist/headless.js.map +1 -0
- package/dist/index.js +131 -0
- package/dist/index.js.map +1 -0
- package/dist/types/server-node/client.d.ts +75 -0
- package/dist/types/server-node/client.d.ts.map +1 -0
- package/dist/types/server-node/index.d.ts +37 -0
- package/dist/types/server-node/index.d.ts.map +1 -0
- package/dist/types/server-node/local-server.d.ts +60 -0
- package/dist/types/server-node/local-server.d.ts.map +1 -0
- package/dist/types/server-node/types.d.ts +68 -0
- package/dist/types/server-node/types.d.ts.map +1 -0
- package/dist/types/web-sdk/adapters/api.d.ts +24 -0
- package/dist/types/web-sdk/adapters/api.d.ts.map +1 -0
- package/dist/types/web-sdk/analytics.d.ts +111 -0
- package/dist/types/web-sdk/analytics.d.ts.map +1 -0
- package/dist/types/web-sdk/api-client.d.ts +44 -0
- package/dist/types/web-sdk/api-client.d.ts.map +1 -0
- package/dist/types/web-sdk/browser-runtime.d.ts +62 -0
- package/dist/types/web-sdk/browser-runtime.d.ts.map +1 -0
- package/dist/types/web-sdk/controllers.d.ts +363 -0
- package/dist/types/web-sdk/controllers.d.ts.map +1 -0
- package/dist/types/web-sdk/customer-side.d.ts +1367 -0
- package/dist/types/web-sdk/customer-side.d.ts.map +1 -0
- package/dist/types/web-sdk/env.d.ts +5 -0
- package/dist/types/web-sdk/env.d.ts.map +1 -0
- package/dist/types/web-sdk/generated.d.ts +8 -0
- package/dist/types/web-sdk/generated.d.ts.map +1 -0
- package/dist/types/web-sdk/headless.d.ts +69 -0
- package/dist/types/web-sdk/headless.d.ts.map +1 -0
- package/dist/types/web-sdk/index.d.ts +51 -0
- package/dist/types/web-sdk/index.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/AccessGateSurfaceSlot.d.ts +88 -0
- package/dist/types/web-sdk/placements/AccessGateSurfaceSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/FixedSurfaceSlot.d.ts +56 -0
- package/dist/types/web-sdk/placements/FixedSurfaceSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/MessageSurfaceSlot.d.ts +87 -0
- package/dist/types/web-sdk/placements/MessageSurfaceSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/PlacementRenderer.d.ts +57 -0
- package/dist/types/web-sdk/placements/PlacementRenderer.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/SurfaceSlotComponent.d.ts +70 -0
- package/dist/types/web-sdk/placements/SurfaceSlotComponent.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/abstract/BannerFrame.d.ts +53 -0
- package/dist/types/web-sdk/placements/abstract/BannerFrame.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/abstract/InlineCardPlacement.d.ts +52 -0
- package/dist/types/web-sdk/placements/abstract/InlineCardPlacement.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/abstract/ModalFrame.d.ts +68 -0
- package/dist/types/web-sdk/placements/abstract/ModalFrame.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/abstract/QuotaMeterFrame.d.ts +76 -0
- package/dist/types/web-sdk/placements/abstract/QuotaMeterFrame.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/abstract/index.d.ts +9 -0
- package/dist/types/web-sdk/placements/abstract/index.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/builtin.d.ts +18 -0
- package/dist/types/web-sdk/placements/builtin.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/cta-resolvers.d.ts +67 -0
- package/dist/types/web-sdk/placements/cta-resolvers.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/index.d.ts +28 -0
- package/dist/types/web-sdk/placements/index.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/local-resolver.d.ts +8 -0
- package/dist/types/web-sdk/placements/local-resolver.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/payload-resolution.d.ts +8 -0
- package/dist/types/web-sdk/placements/payload-resolution.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/recommendation.d.ts +35 -0
- package/dist/types/web-sdk/placements/recommendation.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/registry.d.ts +84 -0
- package/dist/types/web-sdk/placements/registry.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/AgentConnectorSlot.d.ts +11 -0
- package/dist/types/web-sdk/placements/slots/AgentConnectorSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/BannerSlot.d.ts +35 -0
- package/dist/types/web-sdk/placements/slots/BannerSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/ButtonSlot.d.ts +23 -0
- package/dist/types/web-sdk/placements/slots/ButtonSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/ChannelPreviewSlots.d.ts +48 -0
- package/dist/types/web-sdk/placements/slots/ChannelPreviewSlots.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/CliSlot.d.ts +11 -0
- package/dist/types/web-sdk/placements/slots/CliSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/CreditBalanceSlot.d.ts +19 -0
- package/dist/types/web-sdk/placements/slots/CreditBalanceSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/FullPageSlot.d.ts +14 -0
- package/dist/types/web-sdk/placements/slots/FullPageSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/InPageSlot.d.ts +13 -0
- package/dist/types/web-sdk/placements/slots/InPageSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/InlineEmbedSlot.d.ts +16 -0
- package/dist/types/web-sdk/placements/slots/InlineEmbedSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/ModalSlot.d.ts +30 -0
- package/dist/types/web-sdk/placements/slots/ModalSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/QuotaMeterSlot.d.ts +19 -0
- package/dist/types/web-sdk/placements/slots/QuotaMeterSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/ToastSlot.d.ts +17 -0
- package/dist/types/web-sdk/placements/slots/ToastSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/TooltipSlot.d.ts +15 -0
- package/dist/types/web-sdk/placements/slots/TooltipSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/slots/index.d.ts +14 -0
- package/dist/types/web-sdk/placements/slots/index.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/surface-slot-constants.d.ts +13 -0
- package/dist/types/web-sdk/placements/surface-slot-constants.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/surface-template-defaults.d.ts +16 -0
- package/dist/types/web-sdk/placements/surface-template-defaults.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/token-derivation.d.ts +7 -0
- package/dist/types/web-sdk/placements/token-derivation.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/types.d.ts +226 -0
- package/dist/types/web-sdk/placements/types.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/usePlacementPersonalization.d.ts +20 -0
- package/dist/types/web-sdk/placements/usePlacementPersonalization.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/useSurfaceSlot.d.ts +60 -0
- package/dist/types/web-sdk/placements/useSurfaceSlot.d.ts.map +1 -0
- package/dist/types/web-sdk/providers/index.d.ts +3 -0
- package/dist/types/web-sdk/providers/index.d.ts.map +1 -0
- package/dist/types/web-sdk/providers/registry.d.ts +8 -0
- package/dist/types/web-sdk/providers/registry.d.ts.map +1 -0
- package/dist/types/web-sdk/providers/types.d.ts +8 -0
- package/dist/types/web-sdk/providers/types.d.ts.map +1 -0
- package/dist/types/web-sdk/react/Placement.d.ts +50 -0
- package/dist/types/web-sdk/react/Placement.d.ts.map +1 -0
- package/dist/types/web-sdk/react/PlacementDecisionInspector.d.ts +40 -0
- package/dist/types/web-sdk/react/PlacementDecisionInspector.d.ts.map +1 -0
- package/dist/types/web-sdk/react/RevTurbineProvider.d.ts +31 -0
- package/dist/types/web-sdk/react/RevTurbineProvider.d.ts.map +1 -0
- package/dist/types/web-sdk/react/SurfaceTypes.d.ts +19 -0
- package/dist/types/web-sdk/react/SurfaceTypes.d.ts.map +1 -0
- package/dist/types/web-sdk/react/UserProfile.d.ts +23 -0
- package/dist/types/web-sdk/react/UserProfile.d.ts.map +1 -0
- package/dist/types/web-sdk/react/index.d.ts +11 -0
- package/dist/types/web-sdk/react/index.d.ts.map +1 -0
- package/dist/types/web-sdk/react/useEntitlement.d.ts +53 -0
- package/dist/types/web-sdk/react/useEntitlement.d.ts.map +1 -0
- package/dist/types/web-sdk/react/usePlacement.d.ts +63 -0
- package/dist/types/web-sdk/react/usePlacement.d.ts.map +1 -0
- package/dist/types/web-sdk/react/useRevTurbine.d.ts +17 -0
- package/dist/types/web-sdk/react/useRevTurbine.d.ts.map +1 -0
- package/dist/types/web-sdk/react/useUsageSnapshot.d.ts +7 -0
- package/dist/types/web-sdk/react/useUsageSnapshot.d.ts.map +1 -0
- package/dist/types/web-sdk/segments.d.ts +9 -0
- package/dist/types/web-sdk/segments.d.ts.map +1 -0
- package/dist/types/web-sdk/storage.d.ts +38 -0
- package/dist/types/web-sdk/storage.d.ts.map +1 -0
- package/dist/types/web-sdk/theme/ThemeContext.d.ts +18 -0
- package/dist/types/web-sdk/theme/ThemeContext.d.ts.map +1 -0
- package/dist/types/web-sdk/theme/defaults.d.ts +13 -0
- package/dist/types/web-sdk/theme/defaults.d.ts.map +1 -0
- package/dist/types/web-sdk/theme/index.d.ts +6 -0
- package/dist/types/web-sdk/theme/index.d.ts.map +1 -0
- package/dist/types/web-sdk/theme/theme-loader.d.ts +26 -0
- package/dist/types/web-sdk/theme/theme-loader.d.ts.map +1 -0
- package/dist/types/web-sdk/theme/types.d.ts +121 -0
- package/dist/types/web-sdk/theme/types.d.ts.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlacementSlotProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link ButtonSlot}.
|
|
5
|
+
* Extends {@link PlacementSlotProps} with button styling options.
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonSlotProps = PlacementSlotProps & {
|
|
8
|
+
/** Visual style variant. Default `'primary'`. */
|
|
9
|
+
buttonStyle?: 'primary' | 'secondary' | 'accent';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Standalone CTA button placement.
|
|
13
|
+
*
|
|
14
|
+
* Renders a single styled button suitable for persistent nav CTAs
|
|
15
|
+
* or inline upgrade prompts.
|
|
16
|
+
*
|
|
17
|
+
* **Content fields used:** `cta_label`, `style`
|
|
18
|
+
*/
|
|
19
|
+
export declare function ButtonSlot({ content, onCtaClick, visible, className, style, }: ButtonSlotProps): React.JSX.Element | null;
|
|
20
|
+
export declare namespace ButtonSlot {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ButtonSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/ButtonSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IACjD,iDAAiD;IACjD,WAAW,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAClD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,eAAe,4BAmDjB;yBAzDe,UAAU"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlacementSlotProps } from '../types';
|
|
3
|
+
/** A CTA to render in a channel preview, tagged by role. */
|
|
4
|
+
export interface ChannelCta {
|
|
5
|
+
kind: 'primary' | 'secondary';
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The channel preview's CTAs in render order: the primary (`cta_label`) before
|
|
10
|
+
* the secondary (`secondary_cta_label`), honoring the first-CTA-is-primary
|
|
11
|
+
* convention (plan 76 AC-12). Absent labels are dropped, so this returns 0, 1,
|
|
12
|
+
* or 2 entries. Pure — the slots and tests both consume it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function orderedChannelCtas(content: {
|
|
15
|
+
cta_label?: string;
|
|
16
|
+
secondary_cta_label?: string;
|
|
17
|
+
}): ChannelCta[];
|
|
18
|
+
/**
|
|
19
|
+
* Static email preview: envelope card with a subject header and body, plus the
|
|
20
|
+
* CTA row.
|
|
21
|
+
*
|
|
22
|
+
* **Content fields used:** `subject`, `body`, `cta_label`, `secondary_cta_label`
|
|
23
|
+
*/
|
|
24
|
+
export declare function EmailPreviewSlot({ content, onCtaClick, onSecondaryCtaClick, visible, className, style, }: PlacementSlotProps): React.JSX.Element | null;
|
|
25
|
+
export declare namespace EmailPreviewSlot {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Static SMS preview: a chat bubble carrying the message body, plus the CTA
|
|
30
|
+
* row (rendered below the bubble).
|
|
31
|
+
*
|
|
32
|
+
* **Content fields used:** `body`, `message`, `cta_label`, `secondary_cta_label`
|
|
33
|
+
*/
|
|
34
|
+
export declare function SmsPreviewSlot({ content, onCtaClick, onSecondaryCtaClick, visible, className, style, }: PlacementSlotProps): React.JSX.Element | null;
|
|
35
|
+
export declare namespace SmsPreviewSlot {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Static push-notification preview: a notification card with a title and body,
|
|
40
|
+
* plus the CTA row.
|
|
41
|
+
*
|
|
42
|
+
* **Content fields used:** `header`/`title`, `body`, `cta_label`, `secondary_cta_label`
|
|
43
|
+
*/
|
|
44
|
+
export declare function PushPreviewSlot({ content, onCtaClick, onSecondaryCtaClick, visible, className, style, }: PlacementSlotProps): React.JSX.Element | null;
|
|
45
|
+
export declare namespace PushPreviewSlot {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=ChannelPreviewSlots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelPreviewSlots.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/ChannelPreviewSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA0BnD,4DAA4D;AAC5D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,UAAU,EAAE,CAOf;AAgFD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,4BAwCpB;yBA/Ce,gBAAgB;;;AAkDhC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,4BAwCpB;yBA/Ce,cAAc;;;AAkD9B;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,kBAAkB,4BAiCpB;yBAxCe,eAAe"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PlacementSlotProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link CliSlot}.
|
|
4
|
+
* Uses the standard {@link PlacementSlotProps} without extensions.
|
|
5
|
+
*/
|
|
6
|
+
export type CliSlotProps = PlacementSlotProps;
|
|
7
|
+
export declare function CliSlot({ content, onCtaClick, visible, className, style, }: CliSlotProps): import("react").JSX.Element | null;
|
|
8
|
+
export declare namespace CliSlot {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CliSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CliSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/CliSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAkC9C,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,YAAY,sCAgCd;yBAtCe,OAAO"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PlacementSlotProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link CreditBalanceSlot}.
|
|
4
|
+
* Extends {@link PlacementSlotProps} with balance display options.
|
|
5
|
+
*/
|
|
6
|
+
export type CreditBalanceSlotProps = PlacementSlotProps & {
|
|
7
|
+
/**
|
|
8
|
+
* Visual display variant.
|
|
9
|
+
* - `numeric_balance` — large number (default)
|
|
10
|
+
* - `balance_bar` — horizontal progress bar
|
|
11
|
+
* - `balance_burn_rate` — bar with burn rate label
|
|
12
|
+
*/
|
|
13
|
+
displayStyle?: 'numeric_balance' | 'balance_bar' | 'balance_burn_rate';
|
|
14
|
+
};
|
|
15
|
+
export declare function CreditBalanceSlot({ content, onCtaClick, visible, className, style, }: CreditBalanceSlotProps): import("react").JSX.Element | null;
|
|
16
|
+
export declare namespace CreditBalanceSlot {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=CreditBalanceSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreditBalanceSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/CreditBalanceSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,iBAAiB,GAAG,aAAa,GAAG,mBAAmB,CAAC;CACxE,CAAC;AA0EF,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,sBAAsB,sCA0DxB;yBAhEe,iBAAiB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlacementSlotProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link FullPageSlot}.
|
|
4
|
+
* Extends {@link PlacementSlotProps} with page template options.
|
|
5
|
+
*/
|
|
6
|
+
export type FullPageSlotProps = PlacementSlotProps & {
|
|
7
|
+
/** Page template layout. Currently informational; rendering is uniform. */
|
|
8
|
+
pageTemplate?: 'plan_cards' | 'feature_comparison' | 'upgrade_comparison' | 'custom';
|
|
9
|
+
};
|
|
10
|
+
export declare function FullPageSlot({ content, onCtaClick, onSecondaryCtaClick, visible, className, style, }: FullPageSlotProps): import("react").JSX.Element | null;
|
|
11
|
+
export declare namespace FullPageSlot {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FullPageSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullPageSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/FullPageSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD,2EAA2E;IAC3E,YAAY,CAAC,EAAE,YAAY,GAAG,oBAAoB,GAAG,oBAAoB,GAAG,QAAQ,CAAC;CACtF,CAAC;AA0DF,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,iBAAiB,sCA0BnB;yBAjCe,YAAY"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InlineEmbedSlotProps } from './InlineEmbedSlot';
|
|
2
|
+
/**
|
|
3
|
+
* Explicit in-page surface renderer.
|
|
4
|
+
*
|
|
5
|
+
* This is the canonical SDK component for the `in_page` surface type.
|
|
6
|
+
* It wraps `InlineEmbedSlot` for backwards compatibility.
|
|
7
|
+
*/
|
|
8
|
+
export type InPageSlotProps = InlineEmbedSlotProps;
|
|
9
|
+
export declare function InPageSlot(props: InPageSlotProps): import("react").JSX.Element;
|
|
10
|
+
export declare namespace InPageSlot {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=InPageSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InPageSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/InPageSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAEhD;yBAFe,UAAU"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PlacementSlotProps } from '../types';
|
|
2
|
+
/** Props for {@link InlineEmbedSlot}. */
|
|
3
|
+
export type InlineEmbedSlotProps = PlacementSlotProps;
|
|
4
|
+
/**
|
|
5
|
+
* Inline card/embed placement rendered within the page flow.
|
|
6
|
+
*
|
|
7
|
+
* Lightweight card with optional image, header, body, and CTA button.
|
|
8
|
+
* Designed to sit naturally within page content.
|
|
9
|
+
*
|
|
10
|
+
* **Content fields used:** `header`, `body`, `message`, `image_url`, `cta_label`
|
|
11
|
+
*/
|
|
12
|
+
export declare function InlineEmbedSlot({ content, onCtaClick, visible, className, style, }: InlineEmbedSlotProps): import("react").JSX.Element | null;
|
|
13
|
+
export declare namespace InlineEmbedSlot {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=InlineEmbedSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineEmbedSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/InlineEmbedSlot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,yCAAyC;AACzC,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAStD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,sCAoEtB;yBA1Ee,eAAe"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlacementSlotProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link ModalSlot}.
|
|
5
|
+
* Extends {@link PlacementSlotProps} with modal-specific options.
|
|
6
|
+
*/
|
|
7
|
+
export type ModalSlotProps = PlacementSlotProps & {
|
|
8
|
+
/**
|
|
9
|
+
* Modal dismissibility behavior.
|
|
10
|
+
* - `optional` — user can dismiss via ESC, close button, or clicking outside
|
|
11
|
+
* - `blocking` — user must interact with a CTA (no dismiss controls)
|
|
12
|
+
*/
|
|
13
|
+
modalType?: 'optional' | 'blocking';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Centered modal overlay placement.
|
|
17
|
+
*
|
|
18
|
+
* Supports optional and blocking modes. Optional modals can be
|
|
19
|
+
* dismissed via ESC key, close button, or overlay click. Blocking modals
|
|
20
|
+
* require CTA interaction.
|
|
21
|
+
*
|
|
22
|
+
* **Content fields used:** `header`, `body`, `image_url`, `cta_label`, `secondary_cta_label`, `style`
|
|
23
|
+
*
|
|
24
|
+
* **Accessibility:** `role="dialog"`, `aria-modal="true"`, keyboard trap
|
|
25
|
+
*/
|
|
26
|
+
export declare function ModalSlot({ content, onCtaClick, onSecondaryCtaClick, onDismiss, visible, className, style, }: ModalSlotProps): React.JSX.Element | null;
|
|
27
|
+
export declare namespace ModalSlot {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=ModalSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/ModalSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD;;;;OAIG;IACH,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACrC,CAAC;AAwBF;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,cAAc,4BAgKhB;yBAxKe,SAAS"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PlacementSlotProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link QuotaMeterSlot}.
|
|
4
|
+
* Extends {@link PlacementSlotProps} with display style options.
|
|
5
|
+
*/
|
|
6
|
+
export type QuotaMeterSlotProps = PlacementSlotProps & {
|
|
7
|
+
/**
|
|
8
|
+
* Visual display variant.
|
|
9
|
+
* - `progress_bar` — horizontal bar (default)
|
|
10
|
+
* - `circular_gauge` — SVG circle
|
|
11
|
+
* - `numeric_counter` — large number display
|
|
12
|
+
*/
|
|
13
|
+
displayStyle?: 'progress_bar' | 'circular_gauge' | 'numeric_counter';
|
|
14
|
+
};
|
|
15
|
+
export declare function QuotaMeterSlot({ content, onCtaClick, visible, className, style, }: QuotaMeterSlotProps): import("react").JSX.Element | null;
|
|
16
|
+
export declare namespace QuotaMeterSlot {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=QuotaMeterSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotaMeterSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/QuotaMeterSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,UAAU,CAAC;AAIpE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;CACtE,CAAC;AA0IF,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,sCAoDrB;yBA1De,cAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlacementSlotProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link ToastSlot}.
|
|
5
|
+
* Extends {@link PlacementSlotProps} with toast-specific options.
|
|
6
|
+
*/
|
|
7
|
+
export type ToastSlotProps = PlacementSlotProps & {
|
|
8
|
+
/** Auto-dismiss duration in seconds. Set to `0` to disable. Default `5`. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** Screen position for the toast notification. Default `'bottom-right'`. */
|
|
11
|
+
toastPosition?: 'top-right' | 'bottom-right' | 'bottom-center';
|
|
12
|
+
};
|
|
13
|
+
export declare function ToastSlot({ content, onCtaClick, onDismiss, visible, className, style, }: ToastSlotProps): React.JSX.Element | null;
|
|
14
|
+
export declare namespace ToastSlot {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ToastSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/ToastSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,WAAW,GAAG,cAAc,GAAG,eAAe,CAAC;CAChE,CAAC;AAwBF,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,cAAc,4BA2FhB;yBAlGe,SAAS"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlacementSlotProps } from '../types';
|
|
3
|
+
type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
+
export type TooltipSlotProps = PlacementSlotProps & {
|
|
5
|
+
/** Preferred side for anchored tooltip rendering. */
|
|
6
|
+
tooltipPosition?: TooltipPosition;
|
|
7
|
+
/** Optional CSS selector used to anchor the tooltip to an on-page element. */
|
|
8
|
+
anchorSelector?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function TooltipSlot({ content, onCtaClick, onDismiss, visible, className, style, }: TooltipSlotProps): React.JSX.Element | null;
|
|
11
|
+
export declare namespace TooltipSlot {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=TooltipSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipSlot.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/TooltipSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,KAAK,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG;IAClD,qDAAqD;IACrD,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAmDF,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,GACN,EAAE,gBAAgB,4BAoIlB;yBA3Ie,WAAW"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { BannerSlot, type BannerSlotProps } from './BannerSlot';
|
|
2
|
+
export { ModalSlot, type ModalSlotProps } from './ModalSlot';
|
|
3
|
+
export { InlineEmbedSlot, type InlineEmbedSlotProps } from './InlineEmbedSlot';
|
|
4
|
+
export { InPageSlot, type InPageSlotProps } from './InPageSlot';
|
|
5
|
+
export { ToastSlot, type ToastSlotProps } from './ToastSlot';
|
|
6
|
+
export { ButtonSlot, type ButtonSlotProps } from './ButtonSlot';
|
|
7
|
+
export { QuotaMeterSlot, type QuotaMeterSlotProps } from './QuotaMeterSlot';
|
|
8
|
+
export { FullPageSlot, type FullPageSlotProps } from './FullPageSlot';
|
|
9
|
+
export { CliSlot, type CliSlotProps } from './CliSlot';
|
|
10
|
+
export { CreditBalanceSlot, type CreditBalanceSlotProps } from './CreditBalanceSlot';
|
|
11
|
+
export { TooltipSlot, type TooltipSlotProps } from './TooltipSlot';
|
|
12
|
+
export { AgentConnectorSlot, type AgentConnectorSlotProps } from './AgentConnectorSlot';
|
|
13
|
+
export { EmailPreviewSlot, SmsPreviewSlot, PushPreviewSlot } from './ChannelPreviewSlots';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../placements/slots/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface template ID constants.
|
|
3
|
+
*
|
|
4
|
+
* Extracted into a standalone .ts file so the headless (React-free) barrel
|
|
5
|
+
* can import them without pulling in React component modules.
|
|
6
|
+
*/
|
|
7
|
+
/** Default template IDs accepted by `FixedSurfaceSlot`. */
|
|
8
|
+
export declare const FIXED_SURFACE_TEMPLATE_IDS: readonly string[];
|
|
9
|
+
/** Default template IDs accepted by `AccessGateSurfaceSlot`. */
|
|
10
|
+
export declare const GATED_SURFACE_TEMPLATE_IDS: readonly string[];
|
|
11
|
+
/** Default template IDs accepted by `MessageSurfaceSlot`. */
|
|
12
|
+
export declare const MESSAGE_SURFACE_TEMPLATE_IDS: readonly string[];
|
|
13
|
+
//# sourceMappingURL=surface-slot-constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-slot-constants.d.ts","sourceRoot":"","sources":["../../../../placements/surface-slot-constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAKvD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAGvD,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAIzD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-defined surface template ID sets.
|
|
3
|
+
*
|
|
4
|
+
* Each array represents a semantic grouping of template IDs that a
|
|
5
|
+
* SurfaceSlot can accept. Components can import these directly or
|
|
6
|
+
* pass them as `surfaceTemplateIds` props.
|
|
7
|
+
*/
|
|
8
|
+
/** Banner templates only — for fixed or triggered banner slots. */
|
|
9
|
+
export declare const FIXED_BANNER_TEMPLATE_IDS: readonly string[];
|
|
10
|
+
/** General banner slot — accepts banners and in-page cards. */
|
|
11
|
+
export declare const GENERAL_BANNER_TEMPLATE_IDS: readonly string[];
|
|
12
|
+
/** General toast slot — accepts toast messages. */
|
|
13
|
+
export declare const GENERAL_TOAST_TEMPLATE_IDS: readonly string[];
|
|
14
|
+
/** General modal slot — accepts modal overlays. */
|
|
15
|
+
export declare const GENERAL_MODAL_TEMPLATE_IDS: readonly string[];
|
|
16
|
+
//# sourceMappingURL=surface-template-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-template-defaults.d.ts","sourceRoot":"","sources":["../../../../placements/surface-template-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mEAAmE;AACnE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAEtD,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAGxD,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAEvD,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAEvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-derivation.d.ts","sourceRoot":"","sources":["../../../../placements/token-derivation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oCAAoC,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { RevTurbineSurfaceType, PlacementOutput } from '../customer-side';
|
|
2
|
+
import type { ExportedConfigUiPathActionType, RuntimePromotionSnapshot } from '../generated';
|
|
3
|
+
/**
|
|
4
|
+
* Content fields common to most surface templates.
|
|
5
|
+
* Individual placement slot types extend or narrow these.
|
|
6
|
+
*/
|
|
7
|
+
export interface PlacementContentFields {
|
|
8
|
+
header?: string;
|
|
9
|
+
body?: string;
|
|
10
|
+
cta_label?: string;
|
|
11
|
+
secondary_cta_label?: string;
|
|
12
|
+
message?: string;
|
|
13
|
+
image_url?: string;
|
|
14
|
+
style?: string;
|
|
15
|
+
dismissible?: boolean;
|
|
16
|
+
position?: string;
|
|
17
|
+
duration?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Resolved content with personalization tokens expanded. */
|
|
20
|
+
export type ResolvedContent = PlacementContentFields & Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* CTA action types recognized by the SDK.
|
|
23
|
+
*
|
|
24
|
+
* The built-in action types come from the schema's
|
|
25
|
+
* `ExportedConfigUiPathActionType` (the single source of truth). The
|
|
26
|
+
* `(string & {})` member keeps autocomplete for the built-ins while also
|
|
27
|
+
* admitting **tenant-defined custom action names** — a placement authored
|
|
28
|
+
* with a `custom` (or any unmapped) CTA action flows through the engine as
|
|
29
|
+
* `{ type: <action-name>, ...config }`, and the SDK preserves that name so a
|
|
30
|
+
* {@link CtaResolver} can be registered against it via `registerCtaResolver`.
|
|
31
|
+
*/
|
|
32
|
+
export type PlacementUiPathActionType = ExportedConfigUiPathActionType | (string & {});
|
|
33
|
+
/** UI path action that the CTA triggers. */
|
|
34
|
+
export interface PlacementUiPath {
|
|
35
|
+
type: PlacementUiPathActionType;
|
|
36
|
+
plan_handle?: string;
|
|
37
|
+
promotion_id?: string;
|
|
38
|
+
placement_handle?: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
tour_id?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Non-whitelisted config keys carried by a tenant-defined custom CTA.
|
|
43
|
+
*
|
|
44
|
+
* The engine spreads a custom CTA's authored `config` into the `cta_path`
|
|
45
|
+
* record; {@link parseUiPath} lifts the known fields (`url`, `plan_handle`,
|
|
46
|
+
* …) onto this object and collects every remaining key here so a custom
|
|
47
|
+
* {@link CtaResolver} can read tenant-specific parameters. Omitted when the
|
|
48
|
+
* action carries no extra params.
|
|
49
|
+
*/
|
|
50
|
+
params?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Context handed to a {@link CtaResolver} when a placement CTA is activated.
|
|
54
|
+
*/
|
|
55
|
+
export interface CtaResolverContext {
|
|
56
|
+
/** The full placement output whose CTA was activated. */
|
|
57
|
+
placement: PlacementOutput;
|
|
58
|
+
/** Which CTA fired — the primary button or a secondary action. */
|
|
59
|
+
kind: 'primary' | 'secondary';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A resolver bound to a CTA action type via `registerCtaResolver`.
|
|
63
|
+
*
|
|
64
|
+
* When a placement's CTA is clicked and a resolver is registered for the
|
|
65
|
+
* parsed `uiPath.type`, the renderer invokes it instead of the generic
|
|
66
|
+
* `onCtaClick` callback — letting customers handle tenant-defined custom
|
|
67
|
+
* actions (e.g. opening an integration flow) with their own logic.
|
|
68
|
+
*/
|
|
69
|
+
export type CtaResolver = (uiPath: PlacementUiPath, context: CtaResolverContext) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Promotion attached to a placement payload.
|
|
72
|
+
*
|
|
73
|
+
* Re-exported from the schema's {@link RuntimePromotionSnapshot} —
|
|
74
|
+
* lightweight promotion snapshot for placement rendering contexts.
|
|
75
|
+
*/
|
|
76
|
+
export type PlacementPromotion = RuntimePromotionSnapshot;
|
|
77
|
+
/**
|
|
78
|
+
* Props passed to every placement slot renderer.
|
|
79
|
+
*
|
|
80
|
+
* The generic parameter `C` allows custom slot types to narrow
|
|
81
|
+
* the `content` field to a specific shape, eliminating `unknown` casts:
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* interface MyContent extends ResolvedContent {
|
|
85
|
+
* modal_type: string;
|
|
86
|
+
* benefits: Array<{ text: string }>;
|
|
87
|
+
* }
|
|
88
|
+
* function MySlot(props: PlacementSlotProps<MyContent>) {
|
|
89
|
+
* props.content.modal_type; // string — no cast needed
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export interface PlacementSlotProps<C extends ResolvedContent = ResolvedContent> {
|
|
94
|
+
/** The full placement output from the decision engine. */
|
|
95
|
+
placement: PlacementOutput;
|
|
96
|
+
/** Resolved content fields with personalization tokens expanded. */
|
|
97
|
+
content: C;
|
|
98
|
+
/** Parsed UI path for CTA handling. */
|
|
99
|
+
uiPath: PlacementUiPath;
|
|
100
|
+
/** Optional promotion data. */
|
|
101
|
+
promotion?: PlacementPromotion;
|
|
102
|
+
/** Callback when user clicks the primary CTA. */
|
|
103
|
+
onCtaClick: () => void;
|
|
104
|
+
/** Callback when user clicks a secondary CTA. */
|
|
105
|
+
onSecondaryCtaClick?: () => void;
|
|
106
|
+
/** Callback when user dismisses the placement. */
|
|
107
|
+
onDismiss: () => void;
|
|
108
|
+
/** Whether the placement is currently visible. */
|
|
109
|
+
visible: boolean;
|
|
110
|
+
/** Custom CSS class name for styling overrides. */
|
|
111
|
+
className?: string;
|
|
112
|
+
/** Custom inline styles. */
|
|
113
|
+
style?: React.CSSProperties;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A placement slot type definition.
|
|
117
|
+
*
|
|
118
|
+
* Each slot type provides:
|
|
119
|
+
* - A unique `id` matching a surface type or custom identifier
|
|
120
|
+
* - A human-readable `label`
|
|
121
|
+
* - A description of the slot behavior
|
|
122
|
+
* - A React component that renders the placement
|
|
123
|
+
* - Optional `defaultProps` for sensible defaults
|
|
124
|
+
* - An `accepts` predicate controlling which outputs this type handles
|
|
125
|
+
*/
|
|
126
|
+
export interface PlacementSlotType<P extends PlacementSlotProps = PlacementSlotProps> {
|
|
127
|
+
/** Unique identifier for this slot type (e.g. 'banner', 'modal', 'custom:my-widget'). */
|
|
128
|
+
id: string;
|
|
129
|
+
/** Human-readable label for the studio UI. */
|
|
130
|
+
label: string;
|
|
131
|
+
/** Description of this placement type. */
|
|
132
|
+
description: string;
|
|
133
|
+
/** The surface type this slot type handles, or 'custom' for custom types. */
|
|
134
|
+
surfaceType: RevTurbineSurfaceType;
|
|
135
|
+
/** The React component that renders this placement type. */
|
|
136
|
+
component: React.ComponentType<P>;
|
|
137
|
+
/** Default props merged with resolved props before rendering. */
|
|
138
|
+
defaultProps?: Partial<P>;
|
|
139
|
+
/**
|
|
140
|
+
* Predicate to determine if this slot type can handle a given output.
|
|
141
|
+
* Defaults to matching on `surfaceType`. Custom implementations can
|
|
142
|
+
* match on template name, content shape, etc.
|
|
143
|
+
*/
|
|
144
|
+
accepts?: (output: PlacementOutput) => boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Resolution priority. Higher values are evaluated first when multiple
|
|
147
|
+
* slot types match the same surface type. Use this to let narrow/specific
|
|
148
|
+
* predicates take precedence over broad ones without relying on
|
|
149
|
+
* registration order. Default `0`.
|
|
150
|
+
*/
|
|
151
|
+
priority: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Options for registering a custom placement type.
|
|
155
|
+
* Identical to PlacementSlotType but all fields are required except defaultProps, accepts, and priority.
|
|
156
|
+
*/
|
|
157
|
+
export type RegisterPlacementSlotTypeOptions<P extends PlacementSlotProps = PlacementSlotProps> = Omit<PlacementSlotType<P>, 'accepts' | 'defaultProps' | 'priority'> & {
|
|
158
|
+
defaultProps?: Partial<P>;
|
|
159
|
+
accepts?: (output: PlacementOutput) => boolean;
|
|
160
|
+
/** Resolution priority (default `0`). Higher values are evaluated first. */
|
|
161
|
+
priority?: number;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Personalization token context for resolving `{{token}}` placeholders in content.
|
|
165
|
+
*/
|
|
166
|
+
export interface PersonalizationContext {
|
|
167
|
+
user_name?: string;
|
|
168
|
+
plan_name?: string;
|
|
169
|
+
plan_price?: string;
|
|
170
|
+
upgrade_plan_name?: string;
|
|
171
|
+
upgrade_plan_price?: string;
|
|
172
|
+
usage_current?: string | number;
|
|
173
|
+
usage_limit?: string | number;
|
|
174
|
+
usage_percent?: string | number;
|
|
175
|
+
usage_remaining?: string | number;
|
|
176
|
+
reset_date?: string;
|
|
177
|
+
trial_days_remaining?: string | number;
|
|
178
|
+
trial_days_total?: string | number;
|
|
179
|
+
trial_plan_name?: string;
|
|
180
|
+
trial_features_used?: string | number;
|
|
181
|
+
premium_features_used_count?: string | number;
|
|
182
|
+
top_unused_premium_feature?: string;
|
|
183
|
+
premium_action_count?: string | number;
|
|
184
|
+
specific_features_lost?: string;
|
|
185
|
+
estimated_depletion_date?: string;
|
|
186
|
+
credits_remaining?: string | number;
|
|
187
|
+
seat_count?: string | number;
|
|
188
|
+
seat_limit?: string | number;
|
|
189
|
+
promo_discount?: string;
|
|
190
|
+
[key: string]: string | number | undefined;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Configuration for the placement preview sandbox.
|
|
194
|
+
*/
|
|
195
|
+
export interface PlacementPreviewConfig {
|
|
196
|
+
/** The placement output to preview. */
|
|
197
|
+
placement: PlacementOutput;
|
|
198
|
+
/** Personalization context for token resolution. */
|
|
199
|
+
personalization?: PersonalizationContext;
|
|
200
|
+
/** Whether to render in a sandboxed iframe. */
|
|
201
|
+
sandboxed?: boolean;
|
|
202
|
+
/** Viewport width for preview. */
|
|
203
|
+
viewportWidth?: number;
|
|
204
|
+
/** Viewport height for preview. */
|
|
205
|
+
viewportHeight?: number;
|
|
206
|
+
/** Device form factor for preview. */
|
|
207
|
+
device?: 'desktop' | 'tablet' | 'mobile';
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Custom code bundle uploaded by a customer for custom placement rendering.
|
|
211
|
+
*/
|
|
212
|
+
export interface PlacementCustomCode {
|
|
213
|
+
/** Unique identifier for this code bundle. */
|
|
214
|
+
id: string;
|
|
215
|
+
/** The placement slot type this code renders. */
|
|
216
|
+
slotTypeId: string;
|
|
217
|
+
/** The React component source code (JSX/TSX). */
|
|
218
|
+
code: string;
|
|
219
|
+
/** Optional CSS/styling to apply. */
|
|
220
|
+
css?: string;
|
|
221
|
+
/** Version identifier for cache busting. */
|
|
222
|
+
version: string;
|
|
223
|
+
/** When this code was last updated. */
|
|
224
|
+
updatedAt: string;
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../placements/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7F;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,yBAAyB,GAAG,8BAA8B,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEvF,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,yBAAyB,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CA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IACb,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PersonalizationContext } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Options for deriving placement personalization tokens from provider state.
|
|
4
|
+
*/
|
|
5
|
+
export interface UsePlacementPersonalizationOptions {
|
|
6
|
+
/** Optional explicit user ID. Falls back to provider default user ID when omitted. */
|
|
7
|
+
userId?: string;
|
|
8
|
+
/** Optional base personalization values merged before derived provider tokens. */
|
|
9
|
+
personalization?: PersonalizationContext;
|
|
10
|
+
/** Optional dependency trigger for re-resolving provider state. */
|
|
11
|
+
refreshKey?: string | number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Derive placement personalization tokens from the SDK's registered providers.
|
|
15
|
+
*
|
|
16
|
+
* This hook resolves provider state through `sdk.providerRegistry.resolveAll()` so
|
|
17
|
+
* token values honor provider strategies configured during SDK initialization.
|
|
18
|
+
*/
|
|
19
|
+
export declare function usePlacementPersonalization({ userId, personalization, refreshKey, }: UsePlacementPersonalizationOptions): PersonalizationContext;
|
|
20
|
+
//# sourceMappingURL=usePlacementPersonalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePlacementPersonalization.d.ts","sourceRoot":"","sources":["../../../../placements/usePlacementPersonalization.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAoCtD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,eAAe,EACf,UAAU,GACX,EAAE,kCAAkC,GAAG,sBAAsB,CAqD7D"}
|