@active-reach/web-sdk 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/inapp/AegisInAppManager.d.ts +26 -57
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inapp/eval-throttle.d.ts +33 -0
- package/dist/inapp/eval-throttle.d.ts.map +1 -0
- package/dist/inapp/renderers/active-web-chat.d.ts.map +1 -1
- package/dist/inapp/renderers/card-template.d.ts +21 -0
- package/dist/inapp/renderers/card-template.d.ts.map +1 -1
- package/dist/inapp/renderers/carousel-cards.d.ts.map +1 -1
- package/dist/inapp/renderers/games.d.ts.map +1 -1
- package/dist/inapp/renderers/interactive-contract.d.ts +40 -0
- package/dist/inapp/renderers/interactive-contract.d.ts.map +1 -0
- package/dist/inapp/renderers/progress-bar.d.ts.map +1 -1
- package/dist/inapp/renderers/progress-core.d.ts +80 -0
- package/dist/inapp/renderers/progress-core.d.ts.map +1 -0
- package/dist/index.js +372 -709
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -312,6 +312,15 @@ export declare class AegisInAppManager {
|
|
|
312
312
|
private processABAssignments;
|
|
313
313
|
private getVariantId;
|
|
314
314
|
private tryDisplayNextCampaign;
|
|
315
|
+
/** Persistent launchers (active_web_chat) mount AMBIENTLY on every arm — a
|
|
316
|
+
* single always-on entry point, NOT an interruption, so they must not
|
|
317
|
+
* compete in the one-at-a-time overlay queue (tryDisplayNextCampaign).
|
|
318
|
+
* Idempotent: renderActiveWebChatLauncher no-ops once a launcher is live and
|
|
319
|
+
* displayedCampaigns guards re-display. Before this, the launcher only
|
|
320
|
+
* mounted when it happened to be the single campaign tryDisplayNextCampaign
|
|
321
|
+
* picked — so aegis.chat.open() / the mobile "Ask" tab silently did nothing
|
|
322
|
+
* whenever another non-triggered campaign was armed first. */
|
|
323
|
+
private mountPersistentLaunchers;
|
|
315
324
|
private filledSlots;
|
|
316
325
|
private slotSignatures;
|
|
317
326
|
private slotTimers;
|
|
@@ -406,20 +415,27 @@ export declare class AegisInAppManager {
|
|
|
406
415
|
* skip — those types only make sense as fullscreen overlays.
|
|
407
416
|
*/
|
|
408
417
|
private renderCampaignIntoSlot;
|
|
409
|
-
/**
|
|
410
|
-
* Slot-mode wrappers. They build a small card container (no overlay
|
|
411
|
-
* positioning, no close button) and append the SHARED body element
|
|
412
|
-
* the overlay path also uses. Body construction lives in the
|
|
413
|
-
* `_buildXxxBody` helpers below so visual output stays identical
|
|
414
|
-
* between overlay and slot modes — adding a renderer feature in
|
|
415
|
-
* one place updates both.
|
|
416
|
-
*/
|
|
417
|
-
private renderStarRatingSlot;
|
|
418
|
-
private renderNPSSurveySlot;
|
|
419
418
|
/** §7.13.H — generic embedded card: image / title / body / coupon chip / CTA.
|
|
420
419
|
* The catch-all for banner + nudge sub_types (birthday, referral, app-install,
|
|
421
420
|
* win-back, etc.) so EVERY gallery nudge renders on the bill (previously only
|
|
422
421
|
* star_rating / nps_survey / form were handled → nudges never appeared). */
|
|
422
|
+
/**
|
|
423
|
+
* Whether `interactive_config` carries a composed `card_template` (non-empty
|
|
424
|
+
* `elements[]`). The ONE detector shared by all three composed-card cutover
|
|
425
|
+
* gates — inline slot, chrome overlay, and the P6 survey-overlay cutover — so
|
|
426
|
+
* they can't drift (the inline gate previously omitted the non-empty check).
|
|
427
|
+
*/
|
|
428
|
+
private _hasComposedTemplate;
|
|
429
|
+
/**
|
|
430
|
+
* P6.full — flat survey → card_template adapter. A `nps_survey` / `star_rating`
|
|
431
|
+
* / `quick_poll` authored WITHOUT a card_template gets one synthesised in place
|
|
432
|
+
* (carrying its follow-up config), so the EXISTING composed-template gates route
|
|
433
|
+
* it through the ONE card-template engine + the shared element builders (with
|
|
434
|
+
* the ported reason-capture/thank-you flows) — overlay AND slot. Back-compat:
|
|
435
|
+
* the field names + follow-up defaults match the retired bespoke renderers.
|
|
436
|
+
* No-op when a template already exists or the type isn't a single-card survey.
|
|
437
|
+
*/
|
|
438
|
+
private _ensureSurveyTemplate;
|
|
423
439
|
/**
|
|
424
440
|
* Composed single card — renders a campaign's top-level `card_template`
|
|
425
441
|
* (frame + elements: icon/text/progress/image/cta/group/…) through the generic
|
|
@@ -468,17 +484,6 @@ export declare class AegisInAppManager {
|
|
|
468
484
|
* segments, and the wheel animates to that segment + reveals the prize/coupon.
|
|
469
485
|
*/
|
|
470
486
|
private renderSpinWheelSlot;
|
|
471
|
-
/** Built-in embedded QUICK POLL — option buttons submit the chosen index. */
|
|
472
|
-
private renderQuickPollSlot;
|
|
473
|
-
/** Pull a poll vote distribution out of the server response, if present.
|
|
474
|
-
* Accepts `results`/`distribution`/`tallies` as a number[] aligned to the
|
|
475
|
-
* option order. Returns null when the server didn't surface tallies (then
|
|
476
|
-
* we only confirm the chosen option — never fabricate percentages). */
|
|
477
|
-
private _readPollDistribution;
|
|
478
|
-
/** Animate result bars on the poll options. With a real `dist` it renders
|
|
479
|
-
* each option's share; without one it just fills the selected option 100%
|
|
480
|
-
* as a "vote locked in" confirmation. */
|
|
481
|
-
private _paintPollResult;
|
|
482
487
|
/**
|
|
483
488
|
* Built-in embedded IMAGE/VIDEO CAROUSEL — a swipeable horizontal strip of
|
|
484
489
|
* `interactive_config.cards` (image OR video + title + body + CTA), contained
|
|
@@ -503,13 +508,6 @@ export declare class AegisInAppManager {
|
|
|
503
508
|
private _extractPrizeLabel;
|
|
504
509
|
/** Extract a redeemable coupon code from a spin/scratch server response. */
|
|
505
510
|
private _extractCouponCode;
|
|
506
|
-
/**
|
|
507
|
-
* Token-bound submission helper. POSTs the structured response to
|
|
508
|
-
* the per-token submit URL the page handler embedded. Best-effort
|
|
509
|
-
* — failure is logged but doesn't throw (the customer already
|
|
510
|
-
* clicked; we can't undo their interaction).
|
|
511
|
-
*/
|
|
512
|
-
private _submitTokenResponse;
|
|
513
511
|
/**
|
|
514
512
|
* Slot styling — the operator's look-&-feel knobs (Style panel) applied to the
|
|
515
513
|
* EMBEDDED render, CLAMPED to boundary-safe ranges so an authored value can
|
|
@@ -528,32 +526,6 @@ export declare class AegisInAppManager {
|
|
|
528
526
|
* `[data-campaign-id]` card inside `container` (or the container itself).
|
|
529
527
|
*/
|
|
530
528
|
private _flattenSlotCard;
|
|
531
|
-
private _appendHeaderImage;
|
|
532
|
-
private _buildStarRatingBody;
|
|
533
|
-
/**
|
|
534
|
-
* Post-rating flow — the Reelo/Plotline "smart rating" gate. A happy rater
|
|
535
|
-
* (>= threshold) is invited to leave a PUBLIC review; an unhappy one is given
|
|
536
|
-
* a PRIVATE "what went wrong?" comment box so the complaint is captured for
|
|
537
|
-
* the operator instead of landing on a public platform. Exactly ONE response
|
|
538
|
-
* row is written per rating (deferred on the low path until Send/Skip) so the
|
|
539
|
-
* star distribution isn't double-counted.
|
|
540
|
-
*/
|
|
541
|
-
private _onStarRatingPicked;
|
|
542
|
-
/** Thank-you takeover; happy raters also get a public-review CTA when authored. */
|
|
543
|
-
private _renderRatingThankYou;
|
|
544
|
-
/** Unhappy-path private comment capture; submits {stars, comment} once. */
|
|
545
|
-
private _renderRatingLowFollowup;
|
|
546
|
-
private _buildNPSSurveyBody;
|
|
547
|
-
/**
|
|
548
|
-
* NPS reason-capture step (overlay). Wires the per-band `nps_follow_up_*`
|
|
549
|
-
* prompt (promoter / passive / detractor) as the heading and captures an
|
|
550
|
-
* open-text reason (+ optional quick-pick chips). Submits {score, comment}
|
|
551
|
-
* exactly ONCE (deferred from the pick), then shows the thank-you (promoters
|
|
552
|
-
* get an optional review/referral CTA).
|
|
553
|
-
*/
|
|
554
|
-
private _renderNpsReasonFollowup;
|
|
555
|
-
/** NPS thank-you takeover; promoters get an optional review/referral CTA. */
|
|
556
|
-
private _renderNpsThankYou;
|
|
557
529
|
/**
|
|
558
530
|
* Evaluate the currently armed campaigns against a client-side event
|
|
559
531
|
* and render any that match their `client_trigger`.
|
|
@@ -625,10 +597,7 @@ export declare class AegisInAppManager {
|
|
|
625
597
|
/** Embedded-slot custom HTML (e.g. on the bill) — the same sandboxed frame in
|
|
626
598
|
* a slot card instead of an overlay. */
|
|
627
599
|
private renderCustomHtmlSlot;
|
|
628
|
-
private renderNPSSurvey;
|
|
629
600
|
private renderCountdownOffer;
|
|
630
|
-
private renderStarRating;
|
|
631
|
-
private renderQuickPoll;
|
|
632
601
|
/**
|
|
633
602
|
* Multi-step form (SDK Demo v4 W1b) — in-app render type matching the
|
|
634
603
|
* Plotline multi-step flow pattern: a progress bar + per-step question with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAyC5D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EACA,OAAO,GACP,QAAQ,GACR,SAAS,GACT,aAAa,GACb,mBAAmB,GACnB,OAAO,GACP,KAAK,GACL,OAAO,GAEP,SAAS,GAET,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,wBAAwB,GAGxB,iBAAiB,GACjB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAA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AO,CAAC,aAAa;IA6PrB;;;0BAGsB;IACtB,OAAO,CAAC,aAAa;IAmCrB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,aAAa;IA4GrB;;+EAE2E;IAC3E,OAAO,CAAC,YAAY;IAyCpB;;;uDAGmD;IACnD,OAAO,CAAC,UAAU;IAWlB;+EAC2E;IAC3E,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,kBAAkB;IAiI1B,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,aAAa;IAqBrB;;;;;;;;;;;OAWG;YACW,UAAU;IA6GxB,OAAO,CAAC,GAAG;IAMX,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;CA2CpD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluation Throttle — the formalized layer that separates STATE UPDATES (must
|
|
3
|
+
* be immediate, for smooth UI) from RULE EVALUATION (must be bounded, to protect
|
|
4
|
+
* the main thread under high-frequency mutation bursts like a flash sale).
|
|
5
|
+
*
|
|
6
|
+
* Architecture: docs/architecture/INTERACTIVE_WIDGET_UNIFICATION.md §16.1.
|
|
7
|
+
*
|
|
8
|
+
* The SDK already debounces the network refresh (AegisInAppManager
|
|
9
|
+
* `refreshDebounceTimer`, 300ms) and budgets per-session interruptions
|
|
10
|
+
* (IntentRuleEvaluator). This primitive is the canonical, reusable throttle for
|
|
11
|
+
* any client-side re-evaluation triggered by rapid data-bound state changes
|
|
12
|
+
* (cart / loyalty mutations driving progress + the 8 earn mechanics): update the
|
|
13
|
+
* local model synchronously, then schedule the heavy evaluation through here so
|
|
14
|
+
* it runs at most once per `minIntervalMs`, preferring an idle window.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* const evalThrottle = createEvalThrottle(() => this.reEvaluateArmedCampaigns());
|
|
18
|
+
* setCartState(s) { this.cart = s; evalThrottle.schedule(); } // model now, eval bounded
|
|
19
|
+
*/
|
|
20
|
+
export interface EvalThrottle {
|
|
21
|
+
/** Request an evaluation; coalesces bursts to ≤1 run per minIntervalMs. */
|
|
22
|
+
schedule(): void;
|
|
23
|
+
/** Cancel a pending run (e.g. on teardown). */
|
|
24
|
+
cancel(): void;
|
|
25
|
+
}
|
|
26
|
+
export interface EvalThrottleOptions {
|
|
27
|
+
/** Floor between evaluations during a burst. Default 500ms (§16.1). */
|
|
28
|
+
minIntervalMs?: number;
|
|
29
|
+
/** Prefer requestIdleCallback when available (yields to input/paint). */
|
|
30
|
+
preferIdle?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function createEvalThrottle(run: () => void, opts?: EvalThrottleOptions): EvalThrottle;
|
|
33
|
+
//# sourceMappingURL=eval-throttle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-throttle.d.ts","sourceRoot":"","sources":["../../src/inapp/eval-throttle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,IAAI,IAAI,CAAC;IACjB,+CAA+C;IAC/C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAOD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,mBAAwB,GAAG,YAAY,CA0ChG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-web-chat.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/active-web-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAwB,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C;gEACgE;AAChE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"active-web-chat.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/active-web-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAwB,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C;gEACgE;AAChE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B;AA2BD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,wBAAwB,GAC9B,SAAS,GAAG,IAAI,CAqElB;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,SAAS,GAAG,IAAI,CAEnD;AAED;;6EAE6E;AAC7E,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAExD;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
|
|
@@ -56,6 +56,27 @@ export interface CardElement {
|
|
|
56
56
|
* (the "thank-you" state). Blank → a sensible default. Operator-controlled
|
|
57
57
|
* post-response acknowledgement. */
|
|
58
58
|
thanks_text?: string;
|
|
59
|
+
/** nps: enable the band-conditional reason-capture step after the score. */
|
|
60
|
+
nps_followup_enabled?: boolean;
|
|
61
|
+
/** nps: per-band reason prompts (fallbacks applied when blank). */
|
|
62
|
+
nps_follow_up_promoter?: string;
|
|
63
|
+
nps_follow_up_passive?: string;
|
|
64
|
+
nps_follow_up_detractor?: string;
|
|
65
|
+
/** nps: quick-pick chips that fill the reason textarea. */
|
|
66
|
+
nps_reason_chips?: string[];
|
|
67
|
+
/** nps: score at/above which the contact is a promoter (default 9). */
|
|
68
|
+
nps_promoter_threshold?: number;
|
|
69
|
+
/** nps: promoter-only review/referral CTA shown on the thank-you takeover. */
|
|
70
|
+
nps_promoter_url?: string;
|
|
71
|
+
nps_promoter_cta?: string;
|
|
72
|
+
/** rating_input: enable the low-score reason-capture step. */
|
|
73
|
+
rating_followup_enabled?: boolean;
|
|
74
|
+
/** rating_input: stars at/below which the low-score follow-up fires (default ceil(80%)). */
|
|
75
|
+
rating_followup_threshold?: number;
|
|
76
|
+
rating_followup_prompt?: string;
|
|
77
|
+
/** rating_input: high-score review/referral CTA. */
|
|
78
|
+
rating_high_url?: string;
|
|
79
|
+
rating_high_cta?: string;
|
|
59
80
|
height?: number;
|
|
60
81
|
/** group: nested layout + children. */
|
|
61
82
|
layout?: 'stack' | 'row';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-template.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/card-template.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"card-template.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/card-template.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,KAAK,GAEL,MAAM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M,qBAAqB,EAAE,YAenC,CAAC;AA6BF,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAU/E;AAgmBD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE;IACJ,QAAQ,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,aAAa,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,WAAW,CAkRb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-cards.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/carousel-cards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS7C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"carousel-cards.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/carousel-cards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS7C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsN5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"games.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/games.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"games.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/games.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA2I7C,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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive widget contract — Zod-FREE mirror of the canonical registry in
|
|
3
|
+
* `@aegis/shared-types/src/interactive-registry.ts` (Layer 1, SDUI unification).
|
|
4
|
+
*
|
|
5
|
+
* The web-SDK is a standalone, ZERO-dependency published package: it must NOT
|
|
6
|
+
* import `zod`. The SDK only needs the contract TYPES + the response-type / band
|
|
7
|
+
* constants to emit conforming payloads (validation runs author-time in the
|
|
8
|
+
* editor and ingest-time in the backend, both against the Zod registry).
|
|
9
|
+
*
|
|
10
|
+
* The region between the sync sentinels below is kept identical to the contract
|
|
11
|
+
* tokens of the Zod registry by `scripts/check-interactive-contract-sync.mjs`
|
|
12
|
+
* (wired into `npm run lint`). Edit the registry → edit here, or the build fails.
|
|
13
|
+
*/
|
|
14
|
+
export type InteractiveWidgetType = 'progress' | 'rating' | 'poll' | 'nps' | 'countdown';
|
|
15
|
+
export type WidgetCapability = 'followup' | 'bands' | 'data_bound' | 'celebrate' | 'thanks';
|
|
16
|
+
export type NpsBand = 'detractor' | 'passive' | 'promoter';
|
|
17
|
+
export interface RatingPayload {
|
|
18
|
+
stars: number;
|
|
19
|
+
feedback_text?: string;
|
|
20
|
+
properties?: Record<string, string | number | boolean>;
|
|
21
|
+
}
|
|
22
|
+
export interface PollPayload {
|
|
23
|
+
option_index: number;
|
|
24
|
+
option_label: string;
|
|
25
|
+
properties?: Record<string, string | number | boolean>;
|
|
26
|
+
}
|
|
27
|
+
export interface NpsPayload {
|
|
28
|
+
score: number;
|
|
29
|
+
band?: NpsBand;
|
|
30
|
+
reason_text?: string;
|
|
31
|
+
properties?: Record<string, string | number | boolean>;
|
|
32
|
+
}
|
|
33
|
+
export declare const RESPONSE_TYPE: {
|
|
34
|
+
readonly rating: "rating";
|
|
35
|
+
readonly poll: "poll";
|
|
36
|
+
readonly nps: "nps";
|
|
37
|
+
};
|
|
38
|
+
/** Derive the NPS band from a score (mirror of registry npsBandFromScore). */
|
|
39
|
+
export declare function npsBandFromScore(score: number): NpsBand;
|
|
40
|
+
//# sourceMappingURL=interactive-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive-contract.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/interactive-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;AACzF,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC5F,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAE3D,MAAM,WAAW,aAAa;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;CAAE;AAChI,MAAM,WAAW,WAAW;IAAG,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;CAAE;AACnI,MAAM,WAAW,UAAU;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;CAAE;AAE3I,eAAO,MAAM,aAAa;;;;CAA0D,CAAC;AAGrF,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoO7C;;;;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"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress-bar mechanic — the ONE computation shared by BOTH web-SDK progress
|
|
3
|
+
* renderers: the standalone `progress_bar` widget (`progress-bar.ts`) and the
|
|
4
|
+
* `progress` card element (`card-template.ts::buildProgressElement`). Before this
|
|
5
|
+
* module each renderer re-implemented the pct / completion / remaining /
|
|
6
|
+
* milestone math independently (drift waiting to happen).
|
|
7
|
+
*
|
|
8
|
+
* This is a BYTE-FOR-BYTE MIRROR of `@aegis/shared-types/src/progress.ts` (which
|
|
9
|
+
* the dashboard compose preview imports). The SDK is a standalone published
|
|
10
|
+
* package and cannot depend on the workspace `@aegis/shared-types` without
|
|
11
|
+
* leaking it into the SDK's public `.d.ts`, so the core is duplicated here and
|
|
12
|
+
* both copies are pinned to the same golden vectors (`progress-core.test.ts` +
|
|
13
|
+
* `shared-types/src/progress.test.ts`). Change one, change both, or a test fails.
|
|
14
|
+
*
|
|
15
|
+
* Pure — no DOM, no SDK context — so it's trivially testable and identical
|
|
16
|
+
* across runtime + preview.
|
|
17
|
+
*/
|
|
18
|
+
export type ProgressGoalType = 'cart_total' | 'items_in_cart' | 'loyalty_points' | 'referrals';
|
|
19
|
+
export type ProgressMilestone = 'q25' | 'q50' | 'q75' | 'unlocked';
|
|
20
|
+
export interface ProgressComputeInput {
|
|
21
|
+
goalType: ProgressGoalType;
|
|
22
|
+
threshold: number;
|
|
23
|
+
current: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ProgressState {
|
|
26
|
+
pct: number;
|
|
27
|
+
complete: boolean;
|
|
28
|
+
remaining: number;
|
|
29
|
+
milestonesReached: ProgressMilestone[];
|
|
30
|
+
}
|
|
31
|
+
export declare function computeProgress(input: ProgressComputeInput): ProgressState;
|
|
32
|
+
export interface CardProgressLabelInput extends ProgressComputeInput {
|
|
33
|
+
rewardText?: string;
|
|
34
|
+
currencySymbol?: string;
|
|
35
|
+
showPct?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function cardProgressSubLabel(i: CardProgressLabelInput): {
|
|
38
|
+
text: string;
|
|
39
|
+
complete: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare function readGoalFromCart(goalType: ProgressGoalType, cart: {
|
|
42
|
+
total?: number;
|
|
43
|
+
itemCount?: number;
|
|
44
|
+
} | undefined | null): number | undefined;
|
|
45
|
+
export interface CountdownState {
|
|
46
|
+
totalMs: number;
|
|
47
|
+
expired: boolean;
|
|
48
|
+
days: number;
|
|
49
|
+
hours: number;
|
|
50
|
+
minutes: number;
|
|
51
|
+
seconds: number;
|
|
52
|
+
display: string;
|
|
53
|
+
}
|
|
54
|
+
export declare function computeCountdown(targetMs: number, nowMs: number): CountdownState;
|
|
55
|
+
export interface FlowStepRecord {
|
|
56
|
+
step_id: string;
|
|
57
|
+
response_type?: string;
|
|
58
|
+
payload?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export interface FlowAccumulator {
|
|
61
|
+
recordStep(r: FlowStepRecord): void;
|
|
62
|
+
steps(): FlowStepRecord[];
|
|
63
|
+
consolidated(): {
|
|
64
|
+
steps: FlowStepRecord[];
|
|
65
|
+
step_count: number;
|
|
66
|
+
completed: boolean;
|
|
67
|
+
};
|
|
68
|
+
markCompleted(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare function createFlowAccumulator(): FlowAccumulator;
|
|
71
|
+
export type PlaybackPhase = 'idle' | 'playing' | 'paused' | 'completed';
|
|
72
|
+
export interface PlaybackState {
|
|
73
|
+
phase: PlaybackPhase;
|
|
74
|
+
pct: number;
|
|
75
|
+
positionSec: number;
|
|
76
|
+
durationSec: number;
|
|
77
|
+
reachedComplete: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare function computePlaybackState(positionSec: number, durationSec: number, phase: PlaybackPhase): PlaybackState;
|
|
80
|
+
//# sourceMappingURL=progress-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-core.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/progress-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,WAAW,CAAC;AAEhB,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;CACxC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,aAAa,CAgB1E;AAED,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,sBAAsB,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAWA;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC9D,MAAM,GAAG,SAAS,CAKpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,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