@active-reach/web-sdk 1.14.1 → 1.19.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/README.md +35 -54
- package/dist/aegis-sw.js +1 -1
- package/dist/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/{analytics-CjLItVo2.mjs → analytics-DblhjFhs.mjs} +66 -3
- package/dist/analytics-DblhjFhs.mjs.map +1 -0
- package/dist/cdn.d.ts +5 -2
- package/dist/cdn.d.ts.map +1 -1
- package/dist/chat/AegisChat.d.ts +138 -0
- package/dist/chat/AegisChat.d.ts.map +1 -0
- package/dist/chat/index.d.ts +3 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/core/analytics.d.ts +37 -2
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/ecommerce/index.d.ts +32 -14
- package/dist/ecommerce/index.d.ts.map +1 -1
- package/dist/inapp/AegisInAppManager.d.ts +349 -1
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inapp/devicePairing.d.ts +70 -0
- package/dist/inapp/devicePairing.d.ts.map +1 -0
- package/dist/inapp/index.d.ts +2 -0
- package/dist/inapp/index.d.ts.map +1 -1
- package/dist/inapp/renderPreview.d.ts.map +1 -1
- package/dist/inapp/renderers/active-web-chat.d.ts +38 -0
- package/dist/inapp/renderers/active-web-chat.d.ts.map +1 -0
- package/dist/inapp/renderers/carousel-cards.d.ts.map +1 -1
- package/dist/inapp/renderers/coachmark-tour.d.ts.map +1 -1
- package/dist/inapp/renderers/games.d.ts +27 -0
- package/dist/inapp/renderers/games.d.ts.map +1 -0
- package/dist/inapp/renderers/index.d.ts +8 -3
- package/dist/inapp/renderers/index.d.ts.map +1 -1
- package/dist/inapp/renderers/product-recommendation.d.ts +4 -4
- package/dist/inapp/renderers/product-recommendation.d.ts.map +1 -1
- package/dist/inapp/renderers/progress-bar.d.ts +14 -0
- package/dist/inapp/renderers/progress-bar.d.ts.map +1 -1
- package/dist/inapp/renderers/sticky-bar.d.ts.map +1 -1
- package/dist/inapp/renderers/stories.d.ts +31 -0
- package/dist/inapp/renderers/stories.d.ts.map +1 -0
- package/dist/inapp/renderers/types.d.ts +73 -2
- package/dist/inapp/renderers/types.d.ts.map +1 -1
- package/dist/inapp/renderers/video.d.ts +20 -0
- package/dist/inapp/renderers/video.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8696 -3093
- package/dist/index.js.map +1 -1
- package/dist/loyalty/AegisLoyaltyManager.d.ts +120 -0
- package/dist/loyalty/AegisLoyaltyManager.d.ts.map +1 -0
- package/dist/loyalty/index.d.ts +3 -0
- package/dist/loyalty/index.d.ts.map +1 -0
- package/dist/push/AegisWebPush.d.ts.map +1 -1
- package/dist/push/AegisWebPush.js +13 -2
- package/dist/push/AegisWebPush.js.map +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +96 -1
- package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
- package/dist/triggers/ContactScoresFetcher.d.ts +105 -0
- package/dist/triggers/ContactScoresFetcher.d.ts.map +1 -0
- package/dist/triggers/IntentRuleEvaluator.d.ts +1 -1
- package/dist/triggers/IntentRuleEvaluator.d.ts.map +1 -1
- package/dist/triggers/index.d.ts +2 -0
- package/dist/triggers/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/analytics-CjLItVo2.mjs.map +0 -1
- package/dist/placements/AegisPlacementManager.d.ts +0 -97
- package/dist/placements/AegisPlacementManager.d.ts.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gamification renderers — the 11 locked game mechanics (2026-06-14):
|
|
3
|
+
* streak · milestone · challenge · achievements · leaderboard · check_in ·
|
|
4
|
+
* stamp_card · mystery_box · tier_ladder · lucky_draw · slot_machine
|
|
5
|
+
*
|
|
6
|
+
* All are config-authored (operator sets the values / demo state via
|
|
7
|
+
* interactive_config; the serve endpoint can later enrich with the customer's
|
|
8
|
+
* real streak/stamps/tier). Each reuses campaign.title/body for the heading and
|
|
9
|
+
* grants its reward via `ctx.submitResponse` on the key action (claim / play /
|
|
10
|
+
* reveal) + the campaign CTA via `ctx.navigate`. Dispatched from
|
|
11
|
+
* AegisInAppManager.renderInteractive (these are interactive sub_types).
|
|
12
|
+
*/
|
|
13
|
+
import type { RenderContext } from './types';
|
|
14
|
+
export declare function renderStreak(ctx: RenderContext): void;
|
|
15
|
+
export declare function renderMilestone(ctx: RenderContext): void;
|
|
16
|
+
export declare function renderChallenge(ctx: RenderContext): void;
|
|
17
|
+
export declare function renderAchievements(ctx: RenderContext): void;
|
|
18
|
+
export declare function renderLeaderboard(ctx: RenderContext): void;
|
|
19
|
+
export declare function renderCheckIn(ctx: RenderContext): void;
|
|
20
|
+
export declare function renderStampCard(ctx: RenderContext): void;
|
|
21
|
+
export declare function renderMysteryBox(ctx: RenderContext): void;
|
|
22
|
+
export declare function renderTierLadder(ctx: RenderContext): void;
|
|
23
|
+
export declare function renderLuckyDraw(ctx: RenderContext): void;
|
|
24
|
+
export declare function renderSlotMachine(ctx: RenderContext): void;
|
|
25
|
+
export declare const GAME_SUB_TYPES: string[];
|
|
26
|
+
export declare function renderGame(ctx: RenderContext, subType: string): boolean;
|
|
27
|
+
//# sourceMappingURL=games.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"games.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/games.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoI7C,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA2BrD;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsBxD;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAiBxD;AAGD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAwB3D;AAGD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgB1D;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoBtD;AAgCD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAyJxD;AAGD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAuDzD;AAGD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA8BzD;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsBxD;AAoFD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA2F1D;AAiBD,eAAO,MAAM,cAAc,UAA8B,CAAC;AAE1D,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKvE"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Barrel for the
|
|
2
|
+
* Barrel for the preload-first renderers. These are pure DOM-mutation
|
|
3
3
|
* functions that operate on a shared `RenderContext` — they never do
|
|
4
4
|
* network I/O at render time, consistent with the preload-first contract.
|
|
5
5
|
*/
|
|
6
|
-
export type { RenderContext, Renderer } from './types';
|
|
6
|
+
export type { RenderContext, Renderer, CartState } from './types';
|
|
7
7
|
export { renderCarouselCards } from './carousel-cards';
|
|
8
8
|
export { renderStickyBar } from './sticky-bar';
|
|
9
|
-
export { renderProgressBar } from './progress-bar';
|
|
9
|
+
export { renderProgressBar, renderProgressBarInline } from './progress-bar';
|
|
10
10
|
export { renderCoachmarkTour } from './coachmark-tour';
|
|
11
11
|
export { renderProductRecommendation } from './product-recommendation';
|
|
12
|
+
export { renderStories, renderStoriesRings } from './stories';
|
|
13
|
+
export { renderGame, GAME_SUB_TYPES } from './games';
|
|
14
|
+
export { renderVideo, renderVideoInline } from './video';
|
|
15
|
+
export { renderActiveWebChat, disposeActiveWebChat } from './active-web-chat';
|
|
16
|
+
export type { ActiveWebChatCredentials } from './active-web-chat';
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The layout is narrower than the generic carousel because product recs
|
|
9
9
|
* should feel like a first-class product grid, not a marketing slider.
|
|
10
|
-
*
|
|
11
|
-
* carousel (same as carousel_cards but different framing copy).
|
|
10
|
+
* Two layouts: grid (2-col responsive) and row (horizontal-scroll).
|
|
12
11
|
*
|
|
13
12
|
* interactive_config:
|
|
14
|
-
* rec_source?: '
|
|
13
|
+
* rec_source?: 'similar_items' | 'also_viewed' | 'also_purchased' | 'trending'
|
|
14
|
+
* | 'personalized' | 'manual'
|
|
15
15
|
* (metadata only — the actual product list is in `cards[]`)
|
|
16
16
|
* rec_count?: number (display hint; rendering is driven by cards.length)
|
|
17
|
-
* rec_layout?: 'grid' | 'row'
|
|
17
|
+
* rec_layout?: 'grid' | 'row' default 'grid'
|
|
18
18
|
* rec_cta_text?: string default 'Shop now'
|
|
19
19
|
* cards: Array<{ image_url?, title?, body?, cta_url?, metadata? }>
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-recommendation.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/product-recommendation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAa7C,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"product-recommendation.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/product-recommendation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAa7C,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgMpE"}
|
|
@@ -20,5 +20,19 @@
|
|
|
20
20
|
* progress_source?: 'client' | 'sse' default 'client'
|
|
21
21
|
*/
|
|
22
22
|
import type { RenderContext } from './types';
|
|
23
|
+
/**
|
|
24
|
+
* Overlay progress bar — a fixed bar pinned to the bottom of the viewport.
|
|
25
|
+
* Used by third-party storefront embeds (Shopify/Woo/Magento) that have no
|
|
26
|
+
* native footer to host the mechanic.
|
|
27
|
+
*/
|
|
23
28
|
export declare function renderProgressBar(ctx: RenderContext): void;
|
|
29
|
+
/**
|
|
30
|
+
* Inline progress bar — renders the SAME live mechanic into a
|
|
31
|
+
* `[data-aegis-slot]` anchor instead of a fixed overlay. This is how a
|
|
32
|
+
* first-party storefront's value-bar footer is driven by a campaign: the host
|
|
33
|
+
* owns the structural cart-summary card + a slot, and an operator-authored
|
|
34
|
+
* `progress_bar` campaign fills the slot (replacing any host-rendered default).
|
|
35
|
+
* Returns true when rendered so the slot dispatcher can track the impression.
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderProgressBarInline(ctx: RenderContext, target: HTMLElement): boolean;
|
|
24
38
|
//# sourceMappingURL=progress-bar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAsN7C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAG1D;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAKxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/sticky-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"sticky-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/sticky-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgHxD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stories renderer — Instagram/Plotline-style stories, in two surfaces:
|
|
3
|
+
*
|
|
4
|
+
* 1. LAUNCHER BAR (the collapsed entry) — a horizontal row of story-GROUP
|
|
5
|
+
* thumbnails. Each group is one bubble (circular gradient ring OR
|
|
6
|
+
* rectangular cover card) with a title + cover; tapping it opens the
|
|
7
|
+
* player and plays that group's FRAMES in sequence. Renders inline in a
|
|
8
|
+
* `[data-aegis-slot]` anchor (the embedded widget, Plotline-parity).
|
|
9
|
+
* 2. PLAYER — full-screen tap-through. tap RIGHT → next frame · tap LEFT →
|
|
10
|
+
* previous · press-and-hold → pause · segmented progress fills per frame ·
|
|
11
|
+
* ✕ / Esc closes · ←/→ navigate.
|
|
12
|
+
*
|
|
13
|
+
* Data shape (interactive_config):
|
|
14
|
+
* stories: Array<{ id?, title?, cover_image_url?, frames: Frame[] }> // GROUPS
|
|
15
|
+
* Frame: { image_url?, video_url?, title?, body?, cta_text?, cta_url?, cta_target?, duration_ms? }
|
|
16
|
+
* stories_thumbnail_shape?: 'circle' | 'rectangle'
|
|
17
|
+
* stories_ring_style?: 'brand' | 'instagram' | 'custom' // default brand
|
|
18
|
+
* stories_ring_color?: string // for 'custom'
|
|
19
|
+
* stories_autoplay?: boolean · stories_loop?: boolean · stories_show_progress?: boolean
|
|
20
|
+
* stories_default_duration_ms?: number
|
|
21
|
+
* surface_style?: 'clean' | 'branded' // branded → brand-fill launcher bar
|
|
22
|
+
*
|
|
23
|
+
* A flat `stories: Frame[]` (pre-groups shape) is tolerated — treated as one group.
|
|
24
|
+
*/
|
|
25
|
+
import type { RenderContext } from './types';
|
|
26
|
+
/** Overlay entry — a stories campaign delivered as an OVERLAY is a full-screen
|
|
27
|
+
* takeover; open at the first group and auto-advance through every group. */
|
|
28
|
+
export declare function renderStories(ctx: RenderContext): void;
|
|
29
|
+
/** Slot/embedded entry — the inline launcher bar of group thumbnails. */
|
|
30
|
+
export declare function renderStoriesRings(ctx: RenderContext, target: HTMLElement | null): boolean;
|
|
31
|
+
//# sourceMappingURL=stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stories.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyH7C;8EAC8E;AAC9E,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAMtD;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAO1F"}
|
|
@@ -9,12 +9,83 @@
|
|
|
9
9
|
* campaign payload from the prefetch bundle.
|
|
10
10
|
*/
|
|
11
11
|
import type { InAppCampaign } from '../AegisInAppManager';
|
|
12
|
+
/**
|
|
13
|
+
* Live cart snapshot fed imperatively into the runtime by a headless
|
|
14
|
+
* storefront via `runtime.setCartState(...)`. Held in PRIVATE SDK state
|
|
15
|
+
* (not a `window.*` global) and surfaced to renderers through
|
|
16
|
+
* `RenderContext.getCartState` — the first-party, encapsulated equivalent
|
|
17
|
+
* of the `window.aegis_cart` / `window.Shopify` cart globals the SDK reads
|
|
18
|
+
* for third-party storefront embeds. Used by the progress-bar renderer
|
|
19
|
+
* (free-delivery / cart-total goals) and, via the runtime, to feed the
|
|
20
|
+
* `cart_value` micro-intent signal.
|
|
21
|
+
*/
|
|
22
|
+
export interface CartState {
|
|
23
|
+
/** Cart subtotal in the storefront's display currency (major units). */
|
|
24
|
+
total: number;
|
|
25
|
+
/** Distinct line count (or summed quantity — caller's choice, used for `items_in_cart`). */
|
|
26
|
+
itemCount: number;
|
|
27
|
+
/** ISO currency code (e.g. 'INR'). */
|
|
28
|
+
currency: string;
|
|
29
|
+
}
|
|
12
30
|
export interface RenderContext {
|
|
13
31
|
campaign: InAppCampaign;
|
|
14
|
-
/**
|
|
15
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Read the live cart state set via `runtime.setCartState(...)`. Renderers
|
|
34
|
+
* (e.g. progress-bar) prefer this over `window.*` cart globals — it's the
|
|
35
|
+
* first-party path and is undefined only when the host app never fed a cart.
|
|
36
|
+
*/
|
|
37
|
+
getCartState?: () => CartState | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Track served/impression/click/dismiss via navigator.sendBeacon-capable writer.
|
|
40
|
+
*
|
|
41
|
+
* Event semantics (WEB_SDK_DLR_ENHANCEMENT_TRACKER P2):
|
|
42
|
+
* - `served` — SDK received the campaign payload (post-refreshCampaigns).
|
|
43
|
+
* Fires automatically from AegisInAppManager; renderers do NOT fire this.
|
|
44
|
+
* - `impression` — DOM element entered the viewport (IntersectionObserver, ≥200ms threshold).
|
|
45
|
+
* Renderers fire this from their IntersectionObserver callback.
|
|
46
|
+
* - `clicked` — user clicked the primary CTA.
|
|
47
|
+
* - `dismissed` — user closed/dismissed the campaign.
|
|
48
|
+
* - `anchor_unresolved` — an anchored renderer (tooltip / coachmark step)
|
|
49
|
+
* declared an anchor but it couldn't be resolved on this
|
|
50
|
+
* surface, so the widget rendered at a fallback position (or
|
|
51
|
+
* not at all). Surfaces a silent misconfiguration the
|
|
52
|
+
* operator otherwise can't see — impressions still look
|
|
53
|
+
* healthy. `meta.anchor_selector` carries the unresolved key.
|
|
54
|
+
* - `step_id` — optional, present on multi-step renderers (WEB P3).
|
|
55
|
+
* - `meta` — optional free-form metadata merged into the event's
|
|
56
|
+
* metadata map (e.g. `{ anchor_resolved: false }`).
|
|
57
|
+
*/
|
|
58
|
+
trackEvent: (campaignId: string, eventType: 'served' | 'impression' | 'clicked' | 'dismissed' | 'anchor_unresolved', extra?: {
|
|
59
|
+
stepId?: string;
|
|
60
|
+
meta?: Record<string, unknown>;
|
|
61
|
+
}) => void;
|
|
16
62
|
/** Null-safe URL hardener — rejects javascript:/data: */
|
|
17
63
|
sanitizeUrl: (url: string) => string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Navigate to a campaign action URL with the manager's full semantics —
|
|
66
|
+
* `aegis://` action verbs (dismiss / push / cart-add), the campaign-click
|
|
67
|
+
* lifecycle event + preventDefault contract, then the hard nav. Renderers
|
|
68
|
+
* should prefer this over `window.location.href` for CTA destinations so
|
|
69
|
+
* structured cta_target values (page / product / dismiss) resolve correctly.
|
|
70
|
+
*/
|
|
71
|
+
navigate?: (url: string, buttonId?: string) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Submit a widget response (records it + triggers the loyalty/coupon grant on
|
|
74
|
+
* the server). Used by the gamification renderers on their key action
|
|
75
|
+
* (claim / play / reveal). Resolves to the server's response JSON or null.
|
|
76
|
+
*/
|
|
77
|
+
submitResponse?: (responseType: string, payload: Record<string, unknown>) => Promise<Record<string, unknown> | null>;
|
|
78
|
+
/**
|
|
79
|
+
* Play a celebration/feedback reaction on `el` — the SHARED Lottie + confetti
|
|
80
|
+
* + ring system (existing assets: trophy/gift/affirm/check/empathize).
|
|
81
|
+
* celebrate → trophy + rings + confetti (big win) · affirm → affirm + confetti
|
|
82
|
+
* acknowledge → check (neutral) · empathize → empathize (loss/near-miss)
|
|
83
|
+
* `lottieFile` overrides the intent's default (e.g. 'gift.json'). Reduced-motion
|
|
84
|
+
* aware. Reuse this instead of bespoke CSS celebrations.
|
|
85
|
+
*/
|
|
86
|
+
playReaction?: (el: HTMLElement, intent: 'celebrate' | 'affirm' | 'acknowledge' | 'empathize', lottieFile?: string) => void;
|
|
87
|
+
/** Haptic feedback (navigator.vibrate). Gated on support; intensity ∝ moment. */
|
|
88
|
+
haptic?: (pattern: number | number[]) => void;
|
|
18
89
|
/** Only accept #hex / rgb() / rgba() / named tokens — everything else returns the default. */
|
|
19
90
|
sanitizeColor: (color: string) => string;
|
|
20
91
|
/** Debug logger — forwarded to the manager's logger. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;IAC3C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,EAAE,CACV,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,EAClF,KAAK,CAAC,EAAE;QA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— a prominent
|
|
3
|
+
* muted-autoplay-loop video with an unmute pill, optional poster, and
|
|
4
|
+
* title/body/CTA either OVERLAID on the video or BELOW it. Two surfaces:
|
|
5
|
+
* - inline (renders into a `[data-aegis-slot]` anchor) — the Video Banner
|
|
6
|
+
* - overlay (centred hero card) — the takeover
|
|
7
|
+
* Distinct from `pip` (small floating corner) and `full_screen` (full-bleed
|
|
8
|
+
* takeover). Reuses interactive_config.video_url + image_url (poster) + the
|
|
9
|
+
* campaign title/body/button_text/action_url.
|
|
10
|
+
*
|
|
11
|
+
* interactive_config:
|
|
12
|
+
* video_url (the muted-inline video) · video_aspect '16:9'|'9:16'|'1:1'|'4:5'
|
|
13
|
+
* video_caption 'overlay'|'below' · video_autoplay (default true) · video_loop (default true)
|
|
14
|
+
*/
|
|
15
|
+
import type { RenderContext } from './types';
|
|
16
|
+
/** Overlay entry — a centred video hero card. */
|
|
17
|
+
export declare function renderVideo(ctx: RenderContext): void;
|
|
18
|
+
/** Slot/embedded entry — the inline Video Banner. */
|
|
19
|
+
export declare function renderVideoInline(ctx: RenderContext, target: HTMLElement | null): boolean;
|
|
20
|
+
//# sourceMappingURL=video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/video.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkH7C,iDAAiD;AACjD,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA2BpD;AAED,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAczF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,10 +9,8 @@ export type { OptInChannel } from './core/user-namespace';
|
|
|
9
9
|
export type { Plugin, PluginRegistry } from './types/plugin';
|
|
10
10
|
export { debounce, throttle } from './utils/debounce';
|
|
11
11
|
export type { ConsentPreferences, ConsentCategory, ConsentStatus, } from './utils/consent';
|
|
12
|
-
export type { InAppCampaign, AegisInAppConfig, CampaignClickEvent, CampaignDismissEvent, AegisErrorEvent, InAppLifecycleEventMap, } from './inapp';
|
|
12
|
+
export type { InAppCampaign, AegisInAppConfig, CartState, CampaignClickEvent, CampaignDismissEvent, AegisErrorEvent, InAppLifecycleEventMap, } from './inapp';
|
|
13
13
|
export { renderPreview } from './inapp';
|
|
14
|
-
export { AegisPlacementManager } from './placements/AegisPlacementManager';
|
|
15
|
-
export type { PlacementContent, PlacementSlot, AegisPlacementConfig, } from './placements/AegisPlacementManager';
|
|
16
14
|
export type { WidgetConfig, GamificationPrize, AegisWidgetConfig, } from './widgets';
|
|
17
15
|
export { TriggerEngine } from './triggers';
|
|
18
16
|
export type { TriggerRule, ScrollDepthConfig, TimeOnPageConfig, ExitIntentConfig, InactivityConfig, TriggerEvent, } from './triggers';
|
|
@@ -24,6 +22,10 @@ export { AegisInbox } from './inbox';
|
|
|
24
22
|
export type { AegisInboxConfig, AegisInboxEntry, InboxListener } from './inbox';
|
|
25
23
|
export { AegisMessageRuntime } from './runtime';
|
|
26
24
|
export type { AegisMessageRuntimeConfig } from './runtime';
|
|
25
|
+
export { AegisChat } from './chat';
|
|
26
|
+
export type { AegisChatConfig } from './chat';
|
|
27
|
+
export { AegisLoyaltyManager } from './loyalty';
|
|
28
|
+
export type { AegisLoyaltyManagerConfig, StoreCreditBalance, ReloadCheckoutResult, GiftCard, GiftCardPurchaseResult, GiftCardClaimResult, } from './loyalty';
|
|
27
29
|
export { AegisWebPush } from './push/AegisWebPush';
|
|
28
30
|
export type { AegisWebPushConfig, AegisAPIClient, ContactIdentity, PushEventTracker, } from './push/AegisWebPush';
|
|
29
31
|
export { bootstrap, readFirstPartyCookie, writeFirstPartyCookie, deriveDeviceFingerprint, BootstrapError, } from './core/bootstrap';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,QAAA,MAAM,KAAK,OAAc,CAAC;AAE1B,eAAe,KAAK,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5E,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,iBAAiB,CAAC;AAIzB,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,QAAA,MAAM,KAAK,OAAc,CAAC;AAE1B,eAAe,KAAK,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,YAAY,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