@active-reach/web-sdk 1.43.6 → 1.45.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.
Files changed (39) hide show
  1. package/README.md +39 -0
  2. package/dist/aegis.min.js +1 -1
  3. package/dist/aegis.min.js.map +1 -1
  4. package/dist/{analytics-C-Go3Pm5.mjs → analytics-CfEHNTzy.mjs} +1 -1
  5. package/dist/{analytics-C-Go3Pm5.mjs.map → analytics-CfEHNTzy.mjs.map} +1 -1
  6. package/dist/chat/AegisChat.d.ts.map +1 -1
  7. package/dist/inapp/AegisInAppManager.d.ts +55 -0
  8. package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
  9. package/dist/inapp/font.d.ts +118 -11
  10. package/dist/inapp/font.d.ts.map +1 -1
  11. package/dist/inapp/renderPreview.d.ts.map +1 -1
  12. package/dist/inapp/renderers/card-template.d.ts +15 -5
  13. package/dist/inapp/renderers/card-template.d.ts.map +1 -1
  14. package/dist/inapp/renderers/carousel-cards.d.ts.map +1 -1
  15. package/dist/inapp/renderers/coachmark-tour.d.ts.map +1 -1
  16. package/dist/inapp/renderers/games.d.ts.map +1 -1
  17. package/dist/inapp/renderers/hero.d.ts +0 -16
  18. package/dist/inapp/renderers/hero.d.ts.map +1 -1
  19. package/dist/inapp/renderers/product-recommendation.d.ts +1 -1
  20. package/dist/inapp/renderers/product-recommendation.d.ts.map +1 -1
  21. package/dist/inapp/renderers/progress-bar.d.ts.map +1 -1
  22. package/dist/inapp/renderers/reviews.d.ts +1 -1
  23. package/dist/inapp/renderers/reviews.d.ts.map +1 -1
  24. package/dist/inapp/renderers/sticky-bar.d.ts.map +1 -1
  25. package/dist/inapp/renderers/stories.d.ts.map +1 -1
  26. package/dist/inapp/renderers/video.d.ts.map +1 -1
  27. package/dist/inapp/slot-shells.d.ts +99 -0
  28. package/dist/inapp/slot-shells.d.ts.map +1 -0
  29. package/dist/inapp/slot-winners.d.ts +43 -0
  30. package/dist/inapp/slot-winners.d.ts.map +1 -0
  31. package/dist/index.js +680 -124
  32. package/dist/index.js.map +1 -1
  33. package/dist/integrations/react.d.ts.map +1 -1
  34. package/dist/react.js +1 -1
  35. package/dist/runtime/AegisMessageRuntime.d.ts +6 -0
  36. package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
  37. package/dist/triggers/IntentRuleEvaluator.d.ts.map +1 -1
  38. package/dist/widgets/AegisWidgetManager.d.ts.map +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Slot winners — which campaign fills which `[data-aegis-slot]`.
3
+ *
4
+ * The client twin of the cell's `pick_slot_winners`
5
+ * (apps/cell-plane/app/services/in_app/slot_shapes.py), which picks the winner
6
+ * whose `slot_shape` a host draws as a shell before the SDK runs (slot plan
7
+ * Phase 2). `renderIntoSlots` places campaigns with THIS function, and both
8
+ * sides are tested against ONE fixture file,
9
+ * `src/inapp/__fixtures__/slot-winners.json`: change the rule in both files and
10
+ * the fixtures in the same commit, or in none.
11
+ *
12
+ * The rule, in campaign list order (the server's priority DESC, updated_at
13
+ * DESC):
14
+ * - only campaigns whose `delivery_modes` include `embedded_card` and that
15
+ * name a slot (`widget_category`);
16
+ * - only campaigns placeable on this page (`isPlaceable`: the surface/screen
17
+ * tier + page rules — the server already applied both);
18
+ * - a campaign with an operator element anchor
19
+ * (`interactive_config.anchor.element_selector`) whose element exists on the
20
+ * page renders there, never also in its slot (`anchorResolves`; the server
21
+ * cannot see the page and assumes every anchor resolves);
22
+ * - a campaign id counts once;
23
+ * - the first campaign per slot wins; the slot rotates through all of them
24
+ * when one declares `interactive_config.slot_rotate_ms` (or the host's
25
+ * `data-aegis-slot-rotate` attribute asks) and more than one is eligible.
26
+ */
27
+ import type { InAppCampaign } from './AegisInAppManager';
28
+ export interface SlotGroup {
29
+ slot: string;
30
+ /** Eligible campaigns for the slot, winner first. */
31
+ members: InAppCampaign[];
32
+ /** Largest `interactive_config.slot_rotate_ms` any member declares, else 0. */
33
+ declaredRotateMs: number;
34
+ }
35
+ export interface PickSlotWinnersOptions {
36
+ isPlaceable?: (c: InAppCampaign) => boolean;
37
+ anchorResolves?: (selector: string) => boolean;
38
+ }
39
+ /** Largest finite positive `slot_rotate_ms` (JS `Number()` coercion), else 0. */
40
+ export declare function declaredRotateMs(members: InAppCampaign[]): number;
41
+ /** Group slot campaigns by slot key, in first-appearance order. */
42
+ export declare function pickSlotWinners(campaigns: InAppCampaign[], opts?: PickSlotWinnersOptions): SlotGroup[];
43
+ //# sourceMappingURL=slot-winners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-winners.d.ts","sourceRoot":"","sources":["../../src/inapp/slot-winners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,+EAA+E;IAC/E,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CAChD;AAQD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CAKjE;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EAAE,EAC1B,IAAI,GAAE,sBAA2B,GAChC,SAAS,EAAE,CAsBb"}