@encorekit/web-sdk 2.2.1 → 2.4.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 (269) hide show
  1. package/README.md +66 -1
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/preview.cjs +2 -0
  5. package/dist/cjs/preview.cjs.map +1 -0
  6. package/dist/cjs/react.cjs +1 -1
  7. package/dist/cjs/react.cjs.map +1 -1
  8. package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js +2 -0
  9. package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js.map +1 -0
  10. package/dist/esm/chunks/GiftsButton-B0lVB463.js +2 -0
  11. package/dist/esm/chunks/GiftsButton-B0lVB463.js.map +1 -0
  12. package/dist/esm/chunks/TriggerHost-CNTiNrTH.js +2 -0
  13. package/dist/esm/chunks/TriggerHost-CNTiNrTH.js.map +1 -0
  14. package/dist/esm/chunks/autoPops-CngtK_R0.js +2 -0
  15. package/dist/esm/chunks/autoPops-CngtK_R0.js.map +1 -0
  16. package/dist/esm/chunks/customClaim-B4uj-aOc.js +2 -0
  17. package/dist/esm/chunks/customClaim-B4uj-aOc.js.map +1 -0
  18. package/dist/esm/chunks/eligibility-BY7fL8Ve.js +2 -0
  19. package/dist/esm/chunks/eligibility-BY7fL8Ve.js.map +1 -0
  20. package/dist/esm/chunks/index-CaBSqauy.js +2 -0
  21. package/dist/esm/chunks/index-CaBSqauy.js.map +1 -0
  22. package/dist/esm/chunks/lookValues-B9z2VWpH.js +2 -0
  23. package/dist/esm/chunks/lookValues-B9z2VWpH.js.map +1 -0
  24. package/dist/esm/chunks/sduiView-Ds7QtFId.js +2 -0
  25. package/dist/esm/chunks/sduiView-Ds7QtFId.js.map +1 -0
  26. package/dist/esm/chunks/spot-DkKMLpB-.js +2 -0
  27. package/dist/esm/chunks/spot-DkKMLpB-.js.map +1 -0
  28. package/dist/esm/chunks/template-B9p4CbPD.js +2 -0
  29. package/dist/esm/chunks/template-B9p4CbPD.js.map +1 -0
  30. package/dist/esm/chunks/textSlots-BnwxUg9V.js +2 -0
  31. package/dist/esm/chunks/textSlots-BnwxUg9V.js.map +1 -0
  32. package/dist/esm/chunks/timers-Bva4yoGM.js +2 -0
  33. package/dist/esm/chunks/timers-Bva4yoGM.js.map +1 -0
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/preview.js +2 -0
  37. package/dist/esm/preview.js.map +1 -0
  38. package/dist/esm/react.js +1 -1
  39. package/dist/esm/react.js.map +1 -1
  40. package/dist/umd/encore.min.js +1 -1
  41. package/dist/umd/encore.min.js.map +1 -1
  42. package/package.json +9 -1
  43. package/types/analytics/DiagnosticsOutbox.d.ts +1 -0
  44. package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -1
  45. package/types/analytics/events.d.ts +108 -8
  46. package/types/analytics/events.d.ts.map +1 -1
  47. package/types/analytics/models.d.ts +2 -0
  48. package/types/analytics/models.d.ts.map +1 -1
  49. package/types/analytics/transport.d.ts +6 -0
  50. package/types/analytics/transport.d.ts.map +1 -1
  51. package/types/api/APIClient.d.ts +70 -33
  52. package/types/api/APIClient.d.ts.map +1 -1
  53. package/types/api/contract.d.ts +4 -1
  54. package/types/api/contract.d.ts.map +1 -1
  55. package/types/api/generated/types.d.ts +994 -17
  56. package/types/api/generated/types.d.ts.map +1 -1
  57. package/types/api/models.d.ts +29 -8
  58. package/types/api/models.d.ts.map +1 -1
  59. package/types/api/offerBuilder.d.ts +51 -0
  60. package/types/api/offerBuilder.d.ts.map +1 -0
  61. package/types/core/Configuration.d.ts +9 -0
  62. package/types/core/Configuration.d.ts.map +1 -1
  63. package/types/core/Encore.d.ts +145 -3
  64. package/types/core/Encore.d.ts.map +1 -1
  65. package/types/core/OfferManager.d.ts +27 -5
  66. package/types/core/OfferManager.d.ts.map +1 -1
  67. package/types/core/PlacementBuilder.d.ts +6 -1
  68. package/types/core/PlacementBuilder.d.ts.map +1 -1
  69. package/types/core/SignalManager.d.ts.map +1 -1
  70. package/types/core/StorageManager.d.ts +3 -2
  71. package/types/core/StorageManager.d.ts.map +1 -1
  72. package/types/core/StrictUnlockReconciler.d.ts +1 -1
  73. package/types/core/StrictUnlockReconciler.d.ts.map +1 -1
  74. package/types/core/claimHandle.d.ts +44 -0
  75. package/types/core/claimHandle.d.ts.map +1 -0
  76. package/types/core/claimLog.d.ts +102 -0
  77. package/types/core/claimLog.d.ts.map +1 -0
  78. package/types/core/claimRefusal.d.ts +3 -0
  79. package/types/core/claimRefusal.d.ts.map +1 -0
  80. package/types/core/claimScreenVariant.d.ts +3 -0
  81. package/types/core/claimScreenVariant.d.ts.map +1 -0
  82. package/types/core/claimStatusCheck.d.ts +62 -0
  83. package/types/core/claimStatusCheck.d.ts.map +1 -0
  84. package/types/core/giftVariant.d.ts +5 -0
  85. package/types/core/giftVariant.d.ts.map +1 -1
  86. package/types/core/hostDisplay.d.ts +9 -2
  87. package/types/core/hostDisplay.d.ts.map +1 -1
  88. package/types/core/sduiVariables.d.ts +20 -0
  89. package/types/core/sduiVariables.d.ts.map +1 -0
  90. package/types/core/strings.d.ts +114 -0
  91. package/types/core/strings.d.ts.map +1 -0
  92. package/types/core/unlockCode.d.ts +12 -2
  93. package/types/core/unlockCode.d.ts.map +1 -1
  94. package/types/core/userKeys.d.ts +7 -0
  95. package/types/core/userKeys.d.ts.map +1 -0
  96. package/types/core/version.d.ts +1 -1
  97. package/types/experiments/ExposureOutbox.d.ts +1 -0
  98. package/types/experiments/ExposureOutbox.d.ts.map +1 -1
  99. package/types/preview.d.ts +51 -0
  100. package/types/preview.d.ts.map +1 -0
  101. package/types/react.d.ts +53 -1
  102. package/types/react.d.ts.map +1 -1
  103. package/types/sdui/actions.d.ts +93 -0
  104. package/types/sdui/actions.d.ts.map +1 -0
  105. package/types/sdui/bindings.d.ts +63 -0
  106. package/types/sdui/bindings.d.ts.map +1 -0
  107. package/types/sdui/compile.d.ts +88 -0
  108. package/types/sdui/compile.d.ts.map +1 -0
  109. package/types/sdui/conditions.d.ts +22 -0
  110. package/types/sdui/conditions.d.ts.map +1 -0
  111. package/types/sdui/context.d.ts +132 -0
  112. package/types/sdui/context.d.ts.map +1 -0
  113. package/types/sdui/countdown.d.ts +31 -0
  114. package/types/sdui/countdown.d.ts.map +1 -0
  115. package/types/sdui/decode.d.ts +35 -0
  116. package/types/sdui/decode.d.ts.map +1 -0
  117. package/types/sdui/deps.d.ts +43 -0
  118. package/types/sdui/deps.d.ts.map +1 -0
  119. package/types/sdui/dominantColor.d.ts +24 -0
  120. package/types/sdui/dominantColor.d.ts.map +1 -0
  121. package/types/sdui/elements/confetti.d.ts +38 -0
  122. package/types/sdui/elements/confetti.d.ts.map +1 -0
  123. package/types/sdui/elements/content.d.ts +27 -0
  124. package/types/sdui/elements/content.d.ts.map +1 -0
  125. package/types/sdui/elements/interactive.d.ts +48 -0
  126. package/types/sdui/elements/interactive.d.ts.map +1 -0
  127. package/types/sdui/elements/layout.d.ts +41 -0
  128. package/types/sdui/elements/layout.d.ts.map +1 -0
  129. package/types/sdui/elements/marquee.d.ts +17 -0
  130. package/types/sdui/elements/marquee.d.ts.map +1 -0
  131. package/types/sdui/elements/progress.d.ts +10 -0
  132. package/types/sdui/elements/progress.d.ts.map +1 -0
  133. package/types/sdui/elements/shared.d.ts +138 -0
  134. package/types/sdui/elements/shared.d.ts.map +1 -0
  135. package/types/sdui/elements/symbols.d.ts +22 -0
  136. package/types/sdui/elements/symbols.d.ts.map +1 -0
  137. package/types/sdui/elements/triggerText.d.ts +55 -0
  138. package/types/sdui/elements/triggerText.d.ts.map +1 -0
  139. package/types/sdui/host.d.ts +274 -0
  140. package/types/sdui/host.d.ts.map +1 -0
  141. package/types/sdui/inlineMarkup.d.ts +22 -0
  142. package/types/sdui/inlineMarkup.d.ts.map +1 -0
  143. package/types/sdui/lookValues.d.ts +50 -0
  144. package/types/sdui/lookValues.d.ts.map +1 -0
  145. package/types/sdui/model.d.ts +130 -0
  146. package/types/sdui/model.d.ts.map +1 -0
  147. package/types/sdui/motion.d.ts +37 -0
  148. package/types/sdui/motion.d.ts.map +1 -0
  149. package/types/sdui/precheck.d.ts +94 -0
  150. package/types/sdui/precheck.d.ts.map +1 -0
  151. package/types/sdui/scrollMath.d.ts +32 -0
  152. package/types/sdui/scrollMath.d.ts.map +1 -0
  153. package/types/sdui/style.d.ts +99 -0
  154. package/types/sdui/style.d.ts.map +1 -0
  155. package/types/sdui/triggerKit.d.ts +24 -0
  156. package/types/sdui/triggerKit.d.ts.map +1 -0
  157. package/types/sdui/unrunnable.d.ts +11 -0
  158. package/types/sdui/unrunnable.d.ts.map +1 -0
  159. package/types/sdui/vocabulary.d.ts +119 -0
  160. package/types/sdui/vocabulary.d.ts.map +1 -0
  161. package/types/triggers/claimReminder/ClaimReminder.d.ts +65 -0
  162. package/types/triggers/claimReminder/ClaimReminder.d.ts.map +1 -0
  163. package/types/triggers/claimReminder/bindings.d.ts +40 -0
  164. package/types/triggers/claimReminder/bindings.d.ts.map +1 -0
  165. package/types/triggers/claimReminder/config.d.ts +56 -0
  166. package/types/triggers/claimReminder/config.d.ts.map +1 -0
  167. package/types/triggers/claimReminder/eligibility.d.ts +37 -0
  168. package/types/triggers/claimReminder/eligibility.d.ts.map +1 -0
  169. package/types/triggers/claimReminder/servedWindow.d.ts +15 -0
  170. package/types/triggers/claimReminder/servedWindow.d.ts.map +1 -0
  171. package/types/triggers/claimReminder/source.d.ts +29 -0
  172. package/types/triggers/claimReminder/source.d.ts.map +1 -0
  173. package/types/triggers/giftsButton/GiftsButton.d.ts +60 -0
  174. package/types/triggers/giftsButton/GiftsButton.d.ts.map +1 -0
  175. package/types/triggers/giftsButton/config.d.ts +53 -0
  176. package/types/triggers/giftsButton/config.d.ts.map +1 -0
  177. package/types/triggers/giftsButton/spot.d.ts +54 -0
  178. package/types/triggers/giftsButton/spot.d.ts.map +1 -0
  179. package/types/triggers/host/TriggerHost.d.ts +127 -0
  180. package/types/triggers/host/TriggerHost.d.ts.map +1 -0
  181. package/types/triggers/host/autoPops.d.ts +16 -0
  182. package/types/triggers/host/autoPops.d.ts.map +1 -0
  183. package/types/triggers/host/configCache.d.ts +29 -0
  184. package/types/triggers/host/configCache.d.ts.map +1 -0
  185. package/types/triggers/host/customClaim.d.ts +85 -0
  186. package/types/triggers/host/customClaim.d.ts.map +1 -0
  187. package/types/triggers/host/dismissStore.d.ts +37 -0
  188. package/types/triggers/host/dismissStore.d.ts.map +1 -0
  189. package/types/triggers/host/readThrottle.d.ts +15 -0
  190. package/types/triggers/host/readThrottle.d.ts.map +1 -0
  191. package/types/triggers/host/registry.d.ts +17 -0
  192. package/types/triggers/host/registry.d.ts.map +1 -0
  193. package/types/triggers/host/sduiView.d.ts +31 -0
  194. package/types/triggers/host/sduiView.d.ts.map +1 -0
  195. package/types/triggers/host/template.d.ts +28 -0
  196. package/types/triggers/host/template.d.ts.map +1 -0
  197. package/types/triggers/host/textSlots.d.ts +35 -0
  198. package/types/triggers/host/textSlots.d.ts.map +1 -0
  199. package/types/triggers/host/theme.d.ts +87 -0
  200. package/types/triggers/host/theme.d.ts.map +1 -0
  201. package/types/triggers/host/timers.d.ts +11 -0
  202. package/types/triggers/host/timers.d.ts.map +1 -0
  203. package/types/triggers/host/types.d.ts +278 -0
  204. package/types/triggers/host/types.d.ts.map +1 -0
  205. package/types/triggers/host/wire.d.ts +55 -0
  206. package/types/triggers/host/wire.d.ts.map +1 -0
  207. package/types/triggers/preview.d.ts +78 -0
  208. package/types/triggers/preview.d.ts.map +1 -0
  209. package/types/triggers/request.d.ts +53 -0
  210. package/types/triggers/request.d.ts.map +1 -0
  211. package/types/types.d.ts +420 -4
  212. package/types/types.d.ts.map +1 -1
  213. package/types/ui/ClaimScreen.d.ts +62 -0
  214. package/types/ui/ClaimScreen.d.ts.map +1 -0
  215. package/types/ui/CodeUnlock.d.ts +26 -2
  216. package/types/ui/CodeUnlock.d.ts.map +1 -1
  217. package/types/ui/GiftHero.d.ts.map +1 -1
  218. package/types/ui/GiftList.d.ts.map +1 -1
  219. package/types/ui/GiftPicker.d.ts.map +1 -1
  220. package/types/ui/GiftPickerHero.d.ts.map +1 -1
  221. package/types/ui/GiftReveal.d.ts.map +1 -1
  222. package/types/ui/GiftSheet.d.ts +5 -5
  223. package/types/ui/GiftSheet.d.ts.map +1 -1
  224. package/types/ui/GiftUnwrap.d.ts.map +1 -1
  225. package/types/ui/OfferCard.d.ts.map +1 -1
  226. package/types/ui/OfferCarousel.d.ts.map +1 -1
  227. package/types/ui/OfferModal.d.ts +31 -6
  228. package/types/ui/OfferModal.d.ts.map +1 -1
  229. package/types/ui/PrimerScreen.d.ts +2 -0
  230. package/types/ui/PrimerScreen.d.ts.map +1 -1
  231. package/types/ui/RedemptionScreen.d.ts +5 -0
  232. package/types/ui/RedemptionScreen.d.ts.map +1 -1
  233. package/types/ui/RewardActions.d.ts.map +1 -1
  234. package/types/ui/RewardCard.d.ts.map +1 -1
  235. package/types/ui/SduiRewardSurface.d.ts +145 -0
  236. package/types/ui/SduiRewardSurface.d.ts.map +1 -0
  237. package/types/ui/Tooltip.d.ts.map +1 -1
  238. package/types/ui/brandComponents.d.ts.map +1 -1
  239. package/types/ui/brandTint.d.ts.map +1 -1
  240. package/types/ui/colorScheme.d.ts +15 -0
  241. package/types/ui/colorScheme.d.ts.map +1 -0
  242. package/types/ui/covered.d.ts +12 -0
  243. package/types/ui/covered.d.ts.map +1 -0
  244. package/types/ui/giftCategoryGroups.d.ts +13 -0
  245. package/types/ui/giftCategoryGroups.d.ts.map +1 -1
  246. package/types/ui/giftCopy.d.ts +14 -9
  247. package/types/ui/giftCopy.d.ts.map +1 -1
  248. package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
  249. package/types/ui/imageURL.d.ts +44 -0
  250. package/types/ui/imageURL.d.ts.map +1 -0
  251. package/types/ui/impressionGate.d.ts +9 -0
  252. package/types/ui/impressionGate.d.ts.map +1 -1
  253. package/types/ui/offerBadge.d.ts.map +1 -1
  254. package/types/ui/rewardSurface.d.ts +11 -1
  255. package/types/ui/rewardSurface.d.ts.map +1 -1
  256. package/types/ui/sduiTheme.d.ts +48 -0
  257. package/types/ui/sduiTheme.d.ts.map +1 -0
  258. package/types/ui/sheetDetents.d.ts +28 -0
  259. package/types/ui/sheetDetents.d.ts.map +1 -0
  260. package/types/ui/styles.d.ts +11 -8
  261. package/types/ui/styles.d.ts.map +1 -1
  262. package/types/ui/termsLine.d.ts +3 -3
  263. package/types/ui/termsLine.d.ts.map +1 -1
  264. package/types/ui/toast.d.ts +11 -0
  265. package/types/ui/toast.d.ts.map +1 -0
  266. package/types/utils/logger.d.ts +10 -0
  267. package/types/utils/logger.d.ts.map +1 -1
  268. package/types/utils/text.d.ts +17 -0
  269. package/types/utils/text.d.ts.map +1 -1
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Turns the served template `Encore.ts` caches into DOM. Every entry point returns
3
+ * `undefined` rather than throwing, so a variant this build cannot draw keeps the
4
+ * built-in surface: a half-rendered sheet is worse than the surface that works.
5
+ */
6
+ import type { CompiledTree } from "./compile";
7
+ import type { SduiEvaluationContext, SduiOfferBindingData, SduiTextDefaults, SduiHostListItem } from "./context";
8
+ import type { ActionHost } from "./actions";
9
+ import type { SduiAction } from "./model";
10
+ import type { ColorResolver } from "./style";
11
+ import type { TextEnvironment } from "./elements/content";
12
+ import type { MotionSheet } from "./motion";
13
+ import type { TriggerKit } from "./triggerKit";
14
+ /** The SDK's offer shape, narrowed to what the engine reads. */
15
+ export interface HostOffer {
16
+ id: string;
17
+ title?: string;
18
+ description?: string;
19
+ ctaText?: string;
20
+ merchantName?: string;
21
+ imageUrl?: string;
22
+ logoUrl?: string;
23
+ heroImageUrl?: string;
24
+ termsUrl?: string;
25
+ shareUrl?: string;
26
+ perk?: string;
27
+ badgeLabel?: string;
28
+ category?: string;
29
+ quickInstructions?: string;
30
+ instructions?: {
31
+ title: string;
32
+ subtitle: string;
33
+ ctaButtonText?: string;
34
+ imageUrl?: string;
35
+ }[];
36
+ displayProperties?: Record<string, string>;
37
+ }
38
+ /**
39
+ * Map the SDK's offer onto the engine's.
40
+ *
41
+ * `shareUrl` is carried only when the backend minted one, so `hasOfferAttribute:
42
+ * "shareUrl"` stays false for an offer with no link and its share control does not
43
+ * draw: a link the backend never minted cannot be attributed. `newPrice` and
44
+ * `oldPrice` are absent because `OfferModel` carries neither.
45
+ */
46
+ export declare function toBindingData(offer: HostOffer): SduiOfferBindingData;
47
+ /**
48
+ * What the ENGINE knows and the host cannot see, for the `sdk_sdui_*` events.
49
+ *
50
+ * The engine reports facts, not events: it has no analytics client, no
51
+ * `distinctId`, and no `presentationId`, `variantId`, `useCase` or
52
+ * `placementId`. Those are the host's, and Swift passes them INTO its context
53
+ * (`SDUIContext.swift:508-556`). So the engine hands over the half only it
54
+ * holds and the host stamps the rest, which is also how a host drops an event
55
+ * that has no presentation yet, the way Swift's `guard let presentationId`
56
+ * does.
57
+ */
58
+ export type SduiAnalyticsEvent = {
59
+ readonly kind: "stateTransition";
60
+ readonly fromState: string;
61
+ readonly toState: string;
62
+ readonly timeInPreviousStateMs: number;
63
+ } | {
64
+ readonly kind: "valueSet";
65
+ readonly key: string;
66
+ readonly value: string;
67
+ /** Set when `value` is a selected offer's id, so the host can report its campaign. */
68
+ readonly offerId?: string;
69
+ } | {
70
+ readonly kind: "buttonTapped";
71
+ readonly actionType: string;
72
+ readonly currentState: string;
73
+ };
74
+ export interface SduiSurfaceOptions {
75
+ /** The tree cached by `Encore.ts`, exactly as served. */
76
+ readonly template: unknown;
77
+ readonly offers: readonly HostOffer[];
78
+ readonly textEnvironment: TextEnvironment;
79
+ readonly actionHost: ActionHost;
80
+ /** Resolves an SDUI colour operand. Wrapped in the cssSafe grammar here. */
81
+ readonly color: ColorResolver;
82
+ readonly initialState?: string;
83
+ readonly initialIndex?: number;
84
+ readonly document?: Document;
85
+ /** Fire and forget. Never throws into the engine; see `#report`. */
86
+ readonly analytics?: (event: SduiAnalyticsEvent) => void;
87
+ /** Reads a logo's brand colour. Defaults to the canvas extractor. */
88
+ readonly dominantColor?: (url: string) => Promise<string | null>;
89
+ /** False dims and disables every claim button, as Swift does. */
90
+ readonly claimEnabled?: boolean;
91
+ /**
92
+ * `inline`: a trigger mount. Draws inside a host element at the root's own
93
+ * `frame.height` instead of filling a sheet, decodes the trigger vocabulary
94
+ * (`TRIGGER_*` in `vocabulary.ts`), and reads `lists`. A root without a
95
+ * positive numeric height does not mount. Absent is the sheet, unchanged.
96
+ */
97
+ readonly mode?: "sheet" | "inline";
98
+ /**
99
+ * Inline mounts only, and required there: the trigger-only engine code
100
+ * (`triggerKit.ts`), which the trigger chunk loads and passes in.
101
+ */
102
+ readonly kit?: TriggerKit;
103
+ /**
104
+ * Inline mounts only: whether a colour operand names a colour its owner chose
105
+ * exactly, so the operand's `opacity` does not apply (`lighten` and `darken` still
106
+ * do). A trigger's `secondary` or `track` is faded only when it falls back to the
107
+ * text colour, never when the publisher set it.
108
+ */
109
+ readonly exactColor?: (raw: unknown) => boolean;
110
+ /** Inline mounts only: the trigger host's named lists, for `hostList` rows. */
111
+ readonly lists?: Readonly<Record<string, readonly SduiHostListItem[]>>;
112
+ /**
113
+ * Inline mounts only: the host's time keys (`start`, `deadline`), ms since the
114
+ * epoch, read by `text.countdown` and `progress`.
115
+ */
116
+ readonly times?: Readonly<Record<string, number>>;
117
+ /** Inline mounts only: the clock at mount, ms since the epoch. Defaults to `Date.now()`. */
118
+ readonly now?: number;
119
+ /** Inline mounts only: loops and marquees hold still (§2.6; the host computes it). */
120
+ readonly motionPaused?: boolean;
121
+ /** Inline mounts only: the host's reduce-motion read (web: `prefers-reduced-motion`). */
122
+ readonly reduceMotion?: boolean;
123
+ }
124
+ /**
125
+ * How much an inline mount scales its text: the user's default text size (what the
126
+ * browser computes for `font-size: medium`, which the page's own CSS cannot move)
127
+ * against 16px, clamped to [1, `maxFontScale`]. Never below 1. Read from a probe,
128
+ * not the root element: a page that sets a larger root size as a design choice is
129
+ * not a user asking for larger text.
130
+ */
131
+ export declare function inlineFontScale(doc: Document, maxFontScale: unknown): number;
132
+ /**
133
+ * The positive numeric `frame.height` on the template's root element, or
134
+ * undefined. Read from the wire: the root is one `{ element: payload }` object.
135
+ */
136
+ export declare function rootFrameHeight(template: unknown): number | undefined;
137
+ /**
138
+ * A mounted variant.
139
+ *
140
+ * State changes go through the setters, which compute the dependencies that
141
+ * moved and re-run only the sites that read them. Nothing here re-walks the
142
+ * tree.
143
+ */
144
+ export declare class SduiSurface {
145
+ #private;
146
+ readonly root: Node;
147
+ /** The root's height in an inline mount; undefined for a sheet. */
148
+ readonly inlineHeight?: number;
149
+ constructor(root: Node, tree: CompiledTree, ctx: SduiEvaluationContext, stateActions?: Readonly<Record<string, {
150
+ onEnter?: SduiAction;
151
+ }>>, analytics?: (event: SduiAnalyticsEvent) => void, extractColor?: (url: string) => Promise<string | null>, inlineHeight?: number, motion?: MotionSheet);
152
+ /** Take the surface out of the page, with its generated keyframes. */
153
+ destroy(): void;
154
+ /** Extract every offer logo's colour, as Swift does on first render. */
155
+ requestDominantColors(): void;
156
+ /**
157
+ * Hand a fact to the host's sink, and survive a sink that throws.
158
+ *
159
+ * The repo's rule is that analytics never blocks UX. A host callback that
160
+ * throws must not take the state machine with it, so the write has already
161
+ * happened by the time this runs.
162
+ */
163
+ report(event: SduiAnalyticsEvent): void;
164
+ get context(): SduiEvaluationContext;
165
+ /** The action a state declares for being entered, or undefined. */
166
+ onEnter(state: string): SduiAction | undefined;
167
+ /**
168
+ * Move to a state, and hand back the action it declares for being entered.
169
+ *
170
+ * The engine does NOT run it, exactly as Swift's `setState` does not: it
171
+ * returns the action and the host decides. That matters, because the host has
172
+ * policy the engine cannot have. On a claim success Swift fires the success
173
+ * state's `onEnter` WITHOUT transitioning to it
174
+ * (`OfferSheetViewModel.swift:1354-1359`), and an `onEnter` never counts as the
175
+ * user answering a question, because no tap happened.
176
+ */
177
+ setState(state: string): SduiAction | undefined;
178
+ /**
179
+ * A text field's keystroke, as Swift writes it: the value with no analytics
180
+ * event (it can be an email address), and `<key>Error` removed on edit.
181
+ */
182
+ editValue(key: string, value: string): void;
183
+ setValue(key: string, value: string): void;
184
+ /**
185
+ * Move what the sheet is focused on, and publish the offer it lands on.
186
+ *
187
+ * Writing only `currentIndex` was the bug Swift's own comment
188
+ * (`SDUIContext.swift:441-444`) describes: the carousel moves while
189
+ * `${selectedAdvertiserName}` and `selectedOfferId` stay on the card the user
190
+ * scrolled away from, so the CTA names one advertiser and the claim targets
191
+ * another. `scopedOfferId` is selection-first, so a claim after an advance hit
192
+ * the OLD offer.
193
+ *
194
+ * An out-of-range index is a no-op, as it is in Swift.
195
+ */
196
+ setOfferIndex(index: number, targetKey?: string): void;
197
+ /**
198
+ * Move an offer to `index`, reordering the list the rows are keyed against.
199
+ *
200
+ * An unknown id, an unchanged position and an empty list are all no-ops, and
201
+ * the target is clamped into range. `promoteToIndex` rides `selectOffer`, so
202
+ * this runs first and `selectOffer` then finds the offer where the user will
203
+ * see it.
204
+ */
205
+ promoteOffer(offerId: string, index: number): void;
206
+ /**
207
+ * Commit to an offer: write the whole selection snapshot AND re-centre.
208
+ *
209
+ * Both halves are load bearing, and writing only the id was wrong twice over.
210
+ * Swift's `writeSelectionValues` (`SDUIContext.swift:387`) publishes the
211
+ * advertiser, logo, description, perk and free-trial flag, which is what
212
+ * `${selectedAdvertiserName}` and the free-trial copy gates read. And moving
213
+ * `currentIndex` is what Android's `selectOffer` carries Swift's comment
214
+ * about: without it a tap wrote the selection while the centred card stayed
215
+ * put, so the CTA named one advertiser and the claim button targeted another.
216
+ *
217
+ * `selectedOfferIsFreeTrial` publishes "false" when the backend labelled
218
+ * nothing. Never promise a free month the offer does not carry.
219
+ */
220
+ selectOffer(offerId: string, targetKey?: string): void;
221
+ /**
222
+ * The mount-time selection, which is NOT a user choice and reports nothing.
223
+ *
224
+ * `initialSelection: "first"` pre-seeds the selection keys so
225
+ * `${selectedAdvertiserName}` resolves on the first frame. Swift seeds it the
226
+ * same way, through the direct write, because at that point no user has acted
227
+ * and it has no `presentationId` yet (`SDUIContext.swift:380-385`). Routing it
228
+ * through `selectOffer` would open every presentation with a selection event
229
+ * nobody made.
230
+ */
231
+ seedSelection(offerId: string, targetKey?: string): void;
232
+ setOffers(offers: readonly HostOffer[]): void;
233
+ /** Trigger mounts: replace the host's lists, re-running every row and count that reads them. */
234
+ setLists(lists: Readonly<Record<string, readonly SduiHostListItem[]>>): void;
235
+ /**
236
+ * Trigger mounts: advance the clock. Re-runs only the sites that read time
237
+ * (`countdown`, `progress`); the host owns the interval and when to call it.
238
+ */
239
+ setNow(now: number): void;
240
+ /** Trigger mounts: replace the host's time keys, as `setNow` re-running only what reads time. */
241
+ setTimes(times: Readonly<Record<string, number>>): void;
242
+ /**
243
+ * Trigger mounts: the host's motion flags. `data-paused` on the root mirrors
244
+ * `paused`, and every loop and marquee re-reads both.
245
+ */
246
+ setMotion(motion: {
247
+ readonly paused: boolean;
248
+ readonly reduce: boolean;
249
+ }): void;
250
+ /** Re-run everything. For a wholesale context swap, not for a single change. */
251
+ refresh(): void;
252
+ }
253
+ /**
254
+ * Why a served template cannot render on web, or undefined: the checks
255
+ * `mountSduiSurface` runs. Read before a presentation is stamped.
256
+ */
257
+ export declare function templateRejection(raw: unknown): string | undefined;
258
+ /**
259
+ * Decode, compile and mount a served template.
260
+ *
261
+ * Returns `undefined` on ANY failure, so the caller keeps its hard-coded
262
+ * surface. The reason is logged, never thrown.
263
+ */
264
+ export declare function mountSduiSurface(options: SduiSurfaceOptions): SduiSurface | undefined;
265
+ /**
266
+ * Display order from ORIGINAL indices, as Swift's `applyOfferDisplayOrder`: each
267
+ * valid, unused index in turn, then every offer not listed, in original order.
268
+ */
269
+ export declare function applyOfferDisplayOrder<T>(order: readonly number[] | undefined, offers: readonly T[]): T[];
270
+ /** Swift's `SDUIInitialSelection.resolvedIndex`; any other value rejects the config. */
271
+ export declare function initialSelectionIndex(raw: unknown, count: number): number | undefined;
272
+ /** Re-exported so a host need not reach into the engine's internals. */
273
+ export type { SduiTextDefaults, TextEnvironment, ActionHost };
274
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/sdui/host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9C,OAAO,KAAK,EACV,qBAAqB,EAErB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAc1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO/C,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC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B,CACnC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAYpB;AAqID,wEAAwE;AACxE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `*marked*` inline markup, ported from Swift's `SDUIInlineMarkup`.
3
+ *
4
+ * A single asterisk rather than markdown's `**`, because the copy is written by
5
+ * humans in a CMS field, not by a markdown author.
6
+ *
7
+ * Deliberately conservative. This runs on publisher-authored copy, so the
8
+ * failure mode has to be "renders as typed", never "eats the sentence":
9
+ *
10
+ * - An unmatched marker is literal: `"5 * 3"` stays `"5 * 3"`.
11
+ * - An empty pair `**` contributes nothing but is still consumed.
12
+ * - Nesting is not a concept; the first close ends the run.
13
+ *
14
+ * Returns one un-highlighted run when there is nothing to mark, which lets the
15
+ * caller treat "no markup" and "no highlightColor" as the same path.
16
+ */
17
+ export interface MarkupRun {
18
+ readonly text: string;
19
+ readonly isHighlighted: boolean;
20
+ }
21
+ export declare function parseInlineMarkup(text: string): MarkupRun[];
22
+ //# sourceMappingURL=inlineMarkup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineMarkup.d.ts","sourceRoot":"","sources":["../../src/sdui/inlineMarkup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAiC3D"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Look values: an app's own words and numbers in a trigger's look, as
3
+ * `${values.K}` (trigger vocabulary §2.2). The look declares a default for every key
4
+ * it uses in a root `values` block; the app may pass its own on the mount. They are
5
+ * filled on the device and never leave it: no request, event, log or store.
6
+ *
7
+ * One rule set for the strict pre-check (the look's defaults) and the host (the
8
+ * mount's values), the same on every platform.
9
+ */
10
+ /** A value key: what follows `values.`. */
11
+ export declare const LOOK_VALUE_KEY: RegExp;
12
+ /** At most this many keys, in the look's defaults and on a mount. */
13
+ export declare const MAX_LOOK_VALUES = 16;
14
+ /** At most this many characters in one value. */
15
+ export declare const MAX_LOOK_VALUE_LENGTH = 64;
16
+ /** The token prefix. */
17
+ export declare const LOOK_VALUE_PREFIX = "values.";
18
+ /**
19
+ * The text slots' names (triggers/host/textSlots.ts): set with their own options, never a
20
+ * value key, on a look or on a mount.
21
+ */
22
+ export declare const TEXT_SLOT_NAMES: readonly string[];
23
+ /** Plain text a value may hold: 1 to 64 characters, no `${`, newline or control character. */
24
+ export declare function isPlainValue(value: unknown): value is string;
25
+ /** A look's own default: plain, and digits and punctuation only. */
26
+ export declare function isLookDefault(value: unknown): value is string;
27
+ /**
28
+ * The values a mount passed, as the look may use them: each entry checked on its own
29
+ * (a bad key or value is dropped, so the look's default shows), then the first 16
30
+ * keys in code-point order. `dropped` hears each dropped key, never its value.
31
+ */
32
+ export declare function mountLookValues(raw: unknown, dropped?: (key: string) => void): Readonly<Record<string, string>>;
33
+ /** A look's `values` defaults, already through the pre-check; anything unusable is skipped. */
34
+ export declare function lookValueDefaults(template: unknown): Readonly<Record<string, string>>;
35
+ /** Every `${values.K}` key in `text`. */
36
+ export declare function lookValueKeysIn(text: string): string[];
37
+ /**
38
+ * Fill one look string, in one pass that is never rescanned: `${values.K}` from
39
+ * `values` (the mount's over the look's defaults), and the host's `advertiserName`
40
+ * and `claimCount`. Any other token is left for the engine. A string that still holds
41
+ * a `${values.` token (a translation that lost its default) becomes `fallback` (the
42
+ * built-in English for that key), else empty: never a raw token, drawn or spoken.
43
+ */
44
+ export declare function fillLookString(text: string, values: Readonly<Record<string, string>>, host: Readonly<{
45
+ advertiserName?: string;
46
+ claimCount?: string;
47
+ }>, fallback?: string): string;
48
+ /** Every string the look declares (`template.strings`), as served. */
49
+ export declare function lookStringsOf(template: unknown): Readonly<Record<string, string>>;
50
+ //# sourceMappingURL=lookValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookValues.d.ts","sourceRoot":"","sources":["../../src/sdui/lookValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2CAA2C;AAC3C,eAAO,MAAM,cAAc,QAA6B,CAAC;AACzD,qEAAqE;AACrE,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,iDAAiD;AACjD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,wBAAwB;AACxB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAuC,CAAC;AAQrF,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAQ5D;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAY/G;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAQrF;AAED,yCAAyC;AACzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAItD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,IAAI,EAAE,QAAQ,CAAC;IAAE,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAChE,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAiBR;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAQjF"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * The decoded SDUI tree.
3
+ *
4
+ * WHAT THIS COMMIT OWNS, and what it deliberately does not. The decoder proves
5
+ * the wire vocabulary and the STRUCTURE: which element each node is, its
6
+ * children, its condition, its action, its data source, its style keys. Leaf
7
+ * visual props (a text's font, an image's contentMode) stay in `props` as raw
8
+ * values, because the element that reads them does not exist yet. Each later
9
+ * element commit narrows what it reads out of `props`; none of them re-decodes
10
+ * the tree.
11
+ *
12
+ * `SduiNode` is a single shape with an `element` tag rather than a 22-arm
13
+ * discriminated union. The union looks tidier and is wrong for this engine: the
14
+ * compile pass in commit 3 walks EVERY node the same way (style, children,
15
+ * bindings) and dispatches on `element` only at the leaf, so a union would force
16
+ * 22 near-identical branches through the generic walker.
17
+ */
18
+ import type { SduiActionType, SduiAlignment, SduiConditionName, SduiDataSource, SduiElementName, SduiOfferAttribute, SduiSemanticColor, SduiStyleProperty } from "./vocabulary";
19
+ /**
20
+ * A value operand. `literal` covers both wire forms: a bare string, and
21
+ * `{"value": "..."}`.
22
+ */
23
+ export type SduiValueRef = {
24
+ kind: "literal";
25
+ value: string;
26
+ } | {
27
+ kind: "binding";
28
+ key: string;
29
+ } | {
30
+ kind: "state";
31
+ } | {
32
+ kind: "offerIndex";
33
+ } | {
34
+ kind: "offerAttribute";
35
+ attribute: SduiOfferAttribute;
36
+ } | {
37
+ kind: "categoryName";
38
+ };
39
+ /**
40
+ * A condition. `operands` carries nested conditions for `and`/`or`/`not`;
41
+ * everything else carries its own payload in `payload`.
42
+ *
43
+ * `not` is normalised to a single-element `operands`, so a combinator always
44
+ * reads the same way.
45
+ */
46
+ export interface SduiCondition {
47
+ readonly name: SduiConditionName;
48
+ readonly operands?: readonly SduiCondition[];
49
+ readonly payload?: unknown;
50
+ }
51
+ /** An action. Both wire forms decode to this; `params` is empty for the bare string. */
52
+ export interface SduiAction {
53
+ readonly type: SduiActionType;
54
+ readonly params: Readonly<Record<string, unknown>>;
55
+ /** `setValueRef`, decoded. A malformed ref fails the variant, as in Swift. */
56
+ readonly valueRef?: SduiValueRef;
57
+ }
58
+ /** A colour operand. The four arms are `hex`, `semantic`, `appearance`, `binding`. */
59
+ export type SduiColor = {
60
+ kind: "hex";
61
+ hex: string;
62
+ opacity?: number;
63
+ } | {
64
+ kind: "semantic";
65
+ semantic: SduiSemanticColor;
66
+ } | {
67
+ kind: "appearance";
68
+ appearance: string;
69
+ } | {
70
+ kind: "binding";
71
+ binding: string;
72
+ };
73
+ /**
74
+ * Style as decoded: known keys only, values still raw.
75
+ *
76
+ * Commit 4 owns turning these into CSS. Keeping the values raw here means the
77
+ * style commit can change its representation without touching the decoder.
78
+ */
79
+ export type SduiStyle = Partial<Record<SduiStyleProperty, unknown>> & {
80
+ /** Decoded, because both are child elements rather than values. */
81
+ readonly overlay?: SduiNode;
82
+ readonly backgroundElement?: SduiNode;
83
+ };
84
+ /** One node of the tree. */
85
+ export interface SduiNode {
86
+ readonly element: SduiElementName;
87
+ /** Raw element payload, minus the keys promoted onto this interface. */
88
+ readonly props: Readonly<Record<string, unknown>>;
89
+ readonly style?: SduiStyle;
90
+ readonly children?: readonly SduiNode[];
91
+ /** `button`, `scrollView` and `group` carry a single child under `content`. */
92
+ readonly content?: SduiNode;
93
+ /** `forEach` only. Its repeated body, named `itemTemplate` on the wire. */
94
+ readonly itemTemplate?: SduiNode;
95
+ /** `forEach` only. Rows failing it are not drawn. */
96
+ readonly filter?: SduiCondition;
97
+ /** `toggle` only, and REQUIRED there in Swift. */
98
+ readonly label?: SduiNode;
99
+ readonly alignment?: SduiAlignment;
100
+ /** `conditional` only. */
101
+ readonly condition?: SduiCondition;
102
+ readonly ifTrue?: SduiNode;
103
+ readonly ifFalse?: SduiNode;
104
+ /** `forEach` only. */
105
+ readonly dataSource?: SduiDataSource;
106
+ /** `button` and `slideButton` only. */
107
+ readonly action?: SduiAction;
108
+ /** Trigger vocabulary, `asyncImage` only: drawn while loading, with no url, and on error. */
109
+ readonly fallback?: SduiNode;
110
+ /** Trigger vocabulary, `marquee` only: animate only while this holds. */
111
+ readonly animateWhen?: SduiCondition;
112
+ }
113
+ /** A whole variant template. */
114
+ export interface SduiTemplate {
115
+ readonly version?: string;
116
+ readonly useCase?: string;
117
+ readonly root: SduiNode;
118
+ /** Sheet chrome the root does not describe. Raw: the host reads it, not the engine. */
119
+ readonly presentation: Readonly<Record<string, unknown>>;
120
+ /**
121
+ * Per-state actions, keyed by state name.
122
+ *
123
+ * Decoded rather than passed through raw, so an action inside an `onEnter` is
124
+ * held to the same vocabulary a button's is.
125
+ */
126
+ readonly stateActions?: Readonly<Record<string, {
127
+ onEnter?: SduiAction;
128
+ }>>;
129
+ }
130
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/sdui/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,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AC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC,CAAC;CAC5E"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Trigger motion (contract §3.3 G3 `style.loop`, §3.4 G4 `marquee`) as CSS
3
+ * keyframes generated per element.
4
+ *
5
+ * Trigger mounts only: the host creates a {@link MotionSheet} for an inline
6
+ * mount and nothing else does, so a sheet never animates anything new. The
7
+ * keyframes live in one `<style>` inside the mount, named per element, so they
8
+ * neither collide across mounts nor outlive the mount they belong to.
9
+ *
10
+ * Reduced motion, and a pause before a loop has ever run, are static poses written
11
+ * inline, computed here because the contract fixes WHICH pose (the `reducedMotion`
12
+ * pose, or progress 0 with `phaseOffset`). A pause after the loop has run holds
13
+ * wherever it is (`animation-play-state: paused`) and resumes from there.
14
+ */
15
+ import type { CompileServices } from "./compile";
16
+ /** The `@keyframes` of one mount, one rule per owning element. */
17
+ export declare class MotionSheet {
18
+ #private;
19
+ readonly element: HTMLStyleElement;
20
+ constructor(doc: Document);
21
+ /** A keyframes name no other element, mount or SDK copy uses. */
22
+ name(): string;
23
+ /** Set (or replace) `name`'s rule. Rules of owners no longer in the mount are dropped. */
24
+ define(name: string, owner: Element, css: string): void;
25
+ /** Drop every rule and the `<style>` itself. */
26
+ destroy(): void;
27
+ }
28
+ /**
29
+ * Run `style.loop` on `el`: forever while the host lets it, held where it is while
30
+ * paused after it has run, a frozen pose under reduce motion or paused before it ran. `base` is the element's own transform and
31
+ * opacity from `planStyle`, which the loop composes after.
32
+ */
33
+ export declare function attachLoop(el: HTMLElement, raw: unknown, base: {
34
+ readonly transform: string;
35
+ readonly opacity: string;
36
+ }, sheet: MotionSheet, services: CompileServices): void;
37
+ //# sourceMappingURL=motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/sdui/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAMjD,kEAAkE;AAClE,qBAAa,WAAW;;IACtB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;gBAKvB,GAAG,EAAE,QAAQ;IASzB,iEAAiE;IACjE,IAAI,IAAI,MAAM;IAKd,0FAA0F;IAC1F,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAgBvD,gDAAgD;IAChD,OAAO,IAAI,IAAI;CAIhB;AAqJD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,eAAe,GACxB,IAAI,CA8CN"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The strict pre-check a trigger host runs on the raw template before it hands
3
+ * the tree to the engine (trigger SDUI vocabulary contract v1, §5).
4
+ *
5
+ * The decoder is strict about element names, conditions and enum values, and
6
+ * lenient about FIELDS: an unknown field is ignored so the backend can roll one
7
+ * out ahead of the clients. Behind that, an unknown action decodes to a dead
8
+ * button and an unknown symbol draws nothing. For a sheet that trade is right.
9
+ * For a trigger it is not: a trigger that draws wrong still counts an
10
+ * impression, so a broken file would read as a low click rate. So a trigger tree
11
+ * may use only `TRIGGER_ALLOW`, the contract's list, and anything else makes it
12
+ * unrenderable: the host draws nothing and reports `unrenderable`.
13
+ *
14
+ * Mirrors the contract's `check-fixtures.py`, which the backend validator runs
15
+ * at sync and in CI. Nested value shapes (font, frame, padding, loop keyframes,
16
+ * countdown, value, shadow) are left to the decoder.
17
+ */
18
+ export declare const TRIGGER_ALLOW: {
19
+ readonly elements: readonly ["text", "systemImage", "asyncImage", "button", "vStack", "hStack", "zStack", "spacer", "shape", "gradient", "forEach", "conditional", "group", "empty", "progress", "marquee"];
20
+ readonly fields: {
21
+ readonly text: readonly ["text", "countdown", "font", "color", "lineLimit", "minimumScaleFactor", "multilineAlignment", "segments", "scaleGroup", "style"];
22
+ readonly systemImage: readonly ["systemName", "font", "color", "style"];
23
+ readonly asyncImage: readonly ["url", "contentMode", "placeholderColor", "fallback", "style"];
24
+ readonly button: readonly ["content", "action", "disabled", "accessibilityLabel", "accessibilityHint", "pressedStyle", "style"];
25
+ readonly vStack: readonly ["alignment", "spacing", "children", "style"];
26
+ readonly hStack: readonly ["alignment", "spacing", "children", "style"];
27
+ readonly zStack: readonly ["alignment", "children", "style"];
28
+ readonly spacer: readonly ["minLength"];
29
+ readonly shape: readonly ["type", "cornerRadius", "fillColor", "strokeColor", "strokeWidth", "style"];
30
+ readonly gradient: readonly ["type", "direction", "colors", "startRadius", "endRadius", "style"];
31
+ readonly forEach: readonly ["dataSource", "list", "itemTemplate", "limit", "offset"];
32
+ readonly conditional: readonly ["condition", "ifTrue", "ifFalse"];
33
+ readonly group: readonly ["content", "style"];
34
+ readonly empty: readonly [];
35
+ readonly progress: readonly ["value", "fillColor", "trackColor", "style"];
36
+ readonly marquee: readonly ["axis", "duration", "reverse", "spacing", "animateWhen", "content", "style"];
37
+ };
38
+ readonly style: readonly ["padding", "frame", "cornerRadius", "backgroundColor", "shadow", "opacity", "clipShape", "clipped", "borderWidth", "borderColor", "offset", "scale", "rotation", "overlay", "backgroundElement", "fixedSize", "layoutPriority", "stateStyles", "stateAnimation", "loop", "layoutDirection", "accessibilityHidden"];
39
+ readonly actions: readonly ["trigger", "dismissTrigger"];
40
+ readonly targets: readonly ["card", "arrow", "button"];
41
+ readonly symbols: readonly ["gift", "gift.fill", "chevron.forward", "arrow.forward", "xmark"];
42
+ readonly conditions: readonly ["hasValue", "valueEquals", "stateEquals", "and", "or", "not", "listCountAtLeast"];
43
+ readonly appearance: readonly ["background", "onBackground", "surface", "onSurface", "accent", "onAccent", "inkOnAccent", "border", "secondary", "track", "backgroundEnd"];
44
+ readonly countdownFormats: readonly ["clock", "hoursMinutes", "hours", "minutes", "seconds", "largestUnit"];
45
+ readonly curves: readonly ["linear", "easeIn", "easeOut", "easeInOut"];
46
+ readonly shapeTypes: readonly ["rectangle", "roundedRectangle", "circle", "capsule", "ellipse"];
47
+ readonly dataSources: readonly ["hostList"];
48
+ readonly values: {
49
+ readonly giftsButton: readonly ["title", "subtitle", "cta", "layout", "icon", "appIconUrl", "offersTitle"];
50
+ readonly claimReminder: readonly ["title", "subtitle", "cta", "layout", "dismiss", "hours", "minutes", "seconds", "advertiserName", "advertiserInitial", "advertiserLogoUrl", "accessibilityTitle", "icon", "appIconUrl", "offerTitle", "titleMany", "claimCount", "perk", "accessibilityHint", "left"];
51
+ };
52
+ readonly times: {
53
+ readonly giftsButton: readonly [];
54
+ readonly claimReminder: readonly ["start", "deadline"];
55
+ };
56
+ readonly lists: {
57
+ readonly giftsButton: readonly ["offerLogos", "offerLogosA", "offerLogosB"];
58
+ readonly claimReminder: readonly ["claims", "marqueeLogos", "marqueeLogosA", "marqueeLogosB"];
59
+ };
60
+ readonly itemFields: {
61
+ readonly claims: readonly ["transactionId", "advertiserName", "advertiserInitial", "advertiserLogoUrl"];
62
+ readonly marqueeLogos: readonly ["logoUrl"];
63
+ readonly marqueeLogosA: readonly ["logoUrl"];
64
+ readonly marqueeLogosB: readonly ["logoUrl"];
65
+ readonly offerLogos: readonly ["logoUrl", "advertiserName", "advertiserInitial"];
66
+ readonly offerLogosA: readonly ["logoUrl", "advertiserName", "advertiserInitial"];
67
+ readonly offerLogosB: readonly ["logoUrl", "advertiserName", "advertiserInitial"];
68
+ };
69
+ readonly behavior: Readonly<Record<string, Readonly<Record<string, readonly string[] | "layout">>>>;
70
+ readonly ranges: Readonly<Record<string, readonly (number | string)[]>>;
71
+ readonly renders: Readonly<Record<string, readonly string[]>>;
72
+ };
73
+ /**
74
+ * The next-step rules a look carries, as this build reads them: each of the trigger's steps
75
+ * with its default, overridden by a value the look sets that the step allows. An unknown
76
+ * step, a value the step does not allow, or a `behavior` that is not an object is skipped,
77
+ * so that step keeps its default; none of them fails the look.
78
+ */
79
+ export declare function effectiveBehavior(template: Record<string, unknown>, trigger: string): Record<string, string>;
80
+ export declare const isPinnableLayout: (value: unknown) => value is string;
81
+ export type TriggerPrecheckId = keyof typeof TRIGGER_ALLOW.values;
82
+ export interface PrecheckFailure {
83
+ /** What is wrong, e.g. `style key "blur"`. */
84
+ readonly reason: string;
85
+ /** Where, as a JSON path from the template. */
86
+ readonly path: string;
87
+ }
88
+ /**
89
+ * The first thing in a trigger template this build must not render, or undefined.
90
+ * `trigger` is the trigger the host is mounting, whose values, times and lists
91
+ * the tree may name.
92
+ */
93
+ export declare function precheckTrigger(template: unknown, trigger: TriggerPrecheckId): PrecheckFailure | undefined;
94
+ //# sourceMappingURL=precheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"precheck.d.ts","sourceRoot":"","sources":["../../src/sdui/precheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA4EnB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;qBAmChF,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;sBAEwB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CACtH,CAAC;AAIX;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc5G;AAQD,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MACiC,CAAC;AAY7F,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,aAAa,CAAC,MAAM,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAoCD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,iBAAiB,GACzB,eAAe,GAAG,SAAS,CAkZ7B"}