@syntrologie/runtime-sdk 2.1.0 → 2.2.0-canary.2

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 (356) hide show
  1. package/CAPABILITIES.md +50 -43
  2. package/README.md +7 -7
  3. package/dist/RuntimeProvider.d.ts +1 -1
  4. package/dist/ShadowRootContext.d.ts +19 -0
  5. package/dist/SmartCanvasApp.d.ts +3 -3
  6. package/dist/SmartCanvasElement.d.ts +7 -2
  7. package/dist/SmartCanvasPortal.d.ts +1 -1
  8. package/dist/actions/executors/index.d.ts +3 -3
  9. package/dist/actions/executors/tour.d.ts +1 -1
  10. package/dist/actions/index.d.ts +4 -3
  11. package/dist/actions/schema.d.ts +1229 -0
  12. package/dist/actions/schema.js +67 -0
  13. package/dist/actions/schema.js.map +7 -0
  14. package/dist/adaptives/adaptive-chatbot/index.js +4 -4
  15. package/dist/adaptives/adaptive-chatbot/index.js.map +4 -4
  16. package/dist/adaptives/adaptive-content/index.js +2 -2
  17. package/dist/adaptives/adaptive-content/index.js.map +4 -4
  18. package/dist/adaptives/adaptive-faq/index.js +23 -6
  19. package/dist/adaptives/adaptive-faq/index.js.map +4 -4
  20. package/dist/adaptives/adaptive-gamification/index.js.map +1 -1
  21. package/dist/adaptives/adaptive-nav/index.js +22 -7
  22. package/dist/adaptives/adaptive-nav/index.js.map +4 -4
  23. package/dist/adaptives/adaptive-overlays/index.js +13 -13
  24. package/dist/adaptives/adaptive-overlays/index.js.map +4 -4
  25. package/dist/api.d.ts +2 -2
  26. package/dist/apps/examples/gamification-app.example.d.ts +4 -4
  27. package/dist/apps/index.d.ts +7 -7
  28. package/dist/blocks/data/index.d.ts +1 -1
  29. package/dist/blocks/index.d.ts +2 -2
  30. package/dist/blocks/interactive/index.d.ts +1 -1
  31. package/dist/blocks/notification/NotificationBlock.d.ts +1 -1
  32. package/dist/blocks/notification/index.d.ts +1 -1
  33. package/dist/bootstrap.d.ts +4 -4
  34. package/dist/chunk-AYTRRBR5.js +251 -0
  35. package/dist/chunk-AYTRRBR5.js.map +7 -0
  36. package/dist/chunk-CU354JTM.js +7921 -0
  37. package/dist/chunk-CU354JTM.js.map +7 -0
  38. package/dist/components/ShadowCanvasOverlay.d.ts +2 -2
  39. package/dist/components/TileCard.d.ts +1 -1
  40. package/dist/context/ContextManager.d.ts +1 -1
  41. package/dist/context/index.d.ts +3 -3
  42. package/dist/decisions/engine.d.ts +1 -1
  43. package/dist/decisions/index.d.ts +3 -3
  44. package/dist/decisions/schema.d.ts +24 -24
  45. package/dist/decisions/strategies/rules.d.ts +1 -1
  46. package/dist/decisions/strategies/score.d.ts +1 -1
  47. package/dist/editorLoader.d.ts +4 -4
  48. package/dist/events/EventAccumulator.d.ts +1 -1
  49. package/dist/events/EventBus.d.ts +1 -1
  50. package/dist/events/index.d.ts +7 -6
  51. package/dist/events/registerConfigPredicates.d.ts +19 -0
  52. package/dist/experiments/adapters/growthbook.d.ts +1 -1
  53. package/dist/experiments/index.d.ts +2 -2
  54. package/dist/experiments/registry.d.ts +1 -1
  55. package/dist/fetchers/index.d.ts +2 -2
  56. package/dist/hooks/useShadowCanvasConfig.d.ts +1 -1
  57. package/dist/hostPatcher/index.d.ts +2 -2
  58. package/dist/index.d.ts +24 -21
  59. package/dist/index.js +816 -75
  60. package/dist/index.js.map +7 -1
  61. package/dist/metrics/index.d.ts +1 -1
  62. package/dist/notifications/index.d.ts +6 -6
  63. package/dist/overlays/runtime/index.d.ts +3 -3
  64. package/dist/overlays/runtime/overlay/root.d.ts +17 -1
  65. package/dist/overlays/runtime/overlay/tooltip.d.ts +1 -1
  66. package/dist/react.js +90 -134
  67. package/dist/react.js.map +7 -1
  68. package/dist/render/RenderContext.d.ts +2 -2
  69. package/dist/render/index.d.ts +2 -2
  70. package/dist/render/types.d.ts +2 -2
  71. package/dist/runtime.d.ts +8 -8
  72. package/dist/smart-canvas.esm.js +127 -124
  73. package/dist/smart-canvas.esm.js.map +4 -4
  74. package/dist/smart-canvas.js +17160 -16782
  75. package/dist/smart-canvas.js.map +4 -4
  76. package/dist/smart-canvas.min.js +127 -124
  77. package/dist/smart-canvas.min.js.map +4 -4
  78. package/dist/state/StateStore.d.ts +1 -1
  79. package/dist/state/helpers/cooldowns.d.ts +1 -1
  80. package/dist/state/helpers/dismissals.d.ts +1 -1
  81. package/dist/state/helpers/frequency.d.ts +1 -1
  82. package/dist/state/index.d.ts +3 -3
  83. package/dist/surfaces/index.d.ts +3 -3
  84. package/dist/surfaces/positioning.d.ts +1 -1
  85. package/dist/telemetry/adapters/posthog.d.ts +2 -2
  86. package/dist/telemetry/index.d.ts +3 -3
  87. package/dist/telemetry/registry.d.ts +1 -1
  88. package/dist/theme/ThemeProvider.d.ts +1 -1
  89. package/dist/theme/extractHostTheme.d.ts +1 -1
  90. package/dist/theme/index.d.ts +4 -4
  91. package/dist/types-only.d.ts +1 -1
  92. package/dist/types-only.js +1 -11
  93. package/dist/types-only.js.map +7 -1
  94. package/dist/types.d.ts +1 -1
  95. package/dist/version.d.ts +1 -1
  96. package/dist/widgets/index.d.ts +1 -1
  97. package/package.json +24 -17
  98. package/schema/canvas-config.base.schema.json +351 -0
  99. package/schema/canvas-config.schema.json +3202 -440
  100. package/scripts/validate-config.mjs +54 -58
  101. package/dist/RuntimeProvider.js +0 -113
  102. package/dist/RuntimeProvider.js.map +0 -1
  103. package/dist/SmartCanvasApp.js +0 -143
  104. package/dist/SmartCanvasApp.js.map +0 -1
  105. package/dist/SmartCanvasElement.js +0 -138
  106. package/dist/SmartCanvasElement.js.map +0 -1
  107. package/dist/SmartCanvasPortal.js +0 -17
  108. package/dist/SmartCanvasPortal.js.map +0 -1
  109. package/dist/actions/ActionEngine.js +0 -272
  110. package/dist/actions/ActionEngine.js.map +0 -1
  111. package/dist/actions/executors/index.js +0 -240
  112. package/dist/actions/executors/index.js.map +0 -1
  113. package/dist/actions/executors/tour.js +0 -332
  114. package/dist/actions/executors/tour.js.map +0 -1
  115. package/dist/actions/index.js +0 -12
  116. package/dist/actions/index.js.map +0 -1
  117. package/dist/actions/types.js +0 -8
  118. package/dist/actions/types.js.map +0 -1
  119. package/dist/actions/validation.js +0 -577
  120. package/dist/actions/validation.js.map +0 -1
  121. package/dist/antiFlicker.js +0 -39
  122. package/dist/antiFlicker.js.map +0 -1
  123. package/dist/api.js +0 -205
  124. package/dist/api.js.map +0 -1
  125. package/dist/apps/AppContext.js +0 -91
  126. package/dist/apps/AppContext.js.map +0 -1
  127. package/dist/apps/AppLoader.js +0 -293
  128. package/dist/apps/AppLoader.js.map +0 -1
  129. package/dist/apps/AppRegistry.js +0 -317
  130. package/dist/apps/AppRegistry.js.map +0 -1
  131. package/dist/apps/examples/gamification-app.example.js +0 -329
  132. package/dist/apps/examples/gamification-app.example.js.map +0 -1
  133. package/dist/apps/index.js +0 -16
  134. package/dist/apps/index.js.map +0 -1
  135. package/dist/apps/types.js +0 -8
  136. package/dist/apps/types.js.map +0 -1
  137. package/dist/blocks/data/ComparisonBlock.js +0 -95
  138. package/dist/blocks/data/ComparisonBlock.js.map +0 -1
  139. package/dist/blocks/data/StatsBlock.js +0 -102
  140. package/dist/blocks/data/StatsBlock.js.map +0 -1
  141. package/dist/blocks/data/index.js +0 -3
  142. package/dist/blocks/data/index.js.map +0 -1
  143. package/dist/blocks/index.js +0 -93
  144. package/dist/blocks/index.js.map +0 -1
  145. package/dist/blocks/interactive/ChecklistBlock.js +0 -111
  146. package/dist/blocks/interactive/ChecklistBlock.js.map +0 -1
  147. package/dist/blocks/interactive/RatingBlock.js +0 -147
  148. package/dist/blocks/interactive/RatingBlock.js.map +0 -1
  149. package/dist/blocks/interactive/index.js +0 -3
  150. package/dist/blocks/interactive/index.js.map +0 -1
  151. package/dist/blocks/notification/NotificationBlock.js +0 -171
  152. package/dist/blocks/notification/NotificationBlock.js.map +0 -1
  153. package/dist/blocks/notification/index.js +0 -2
  154. package/dist/blocks/notification/index.js.map +0 -1
  155. package/dist/blocks/theme-tokens.js +0 -25
  156. package/dist/blocks/theme-tokens.js.map +0 -1
  157. package/dist/bootstrap.js +0 -448
  158. package/dist/bootstrap.js.map +0 -1
  159. package/dist/bundle-entry.js +0 -9
  160. package/dist/bundle-entry.js.map +0 -1
  161. package/dist/components/ShadowCanvasOverlay.js +0 -327
  162. package/dist/components/ShadowCanvasOverlay.js.map +0 -1
  163. package/dist/components/TileCard.js +0 -103
  164. package/dist/components/TileCard.js.map +0 -1
  165. package/dist/components/TileWheel.js +0 -50
  166. package/dist/components/TileWheel.js.map +0 -1
  167. package/dist/config-validator.js +0 -173
  168. package/dist/config-validator.js.map +0 -1
  169. package/dist/configFetcher.js +0 -131
  170. package/dist/configFetcher.js.map +0 -1
  171. package/dist/context/ContextManager.js +0 -269
  172. package/dist/context/ContextManager.js.map +0 -1
  173. package/dist/context/index.js +0 -7
  174. package/dist/context/index.js.map +0 -1
  175. package/dist/context/schema.js +0 -50
  176. package/dist/context/schema.js.map +0 -1
  177. package/dist/context/types.js +0 -8
  178. package/dist/context/types.js.map +0 -1
  179. package/dist/controller.js +0 -34
  180. package/dist/controller.js.map +0 -1
  181. package/dist/decisions/engine.js +0 -117
  182. package/dist/decisions/engine.js.map +0 -1
  183. package/dist/decisions/index.js +0 -10
  184. package/dist/decisions/index.js.map +0 -1
  185. package/dist/decisions/schema.js +0 -151
  186. package/dist/decisions/schema.js.map +0 -1
  187. package/dist/decisions/strategies/rules.js +0 -166
  188. package/dist/decisions/strategies/rules.js.map +0 -1
  189. package/dist/decisions/strategies/score.js +0 -29
  190. package/dist/decisions/strategies/score.js.map +0 -1
  191. package/dist/decisions/types.js +0 -2
  192. package/dist/decisions/types.js.map +0 -1
  193. package/dist/earlyPatcher.js +0 -20
  194. package/dist/earlyPatcher.js.map +0 -1
  195. package/dist/editorLoader.js +0 -254
  196. package/dist/editorLoader.js.map +0 -1
  197. package/dist/events/EventAccumulator.js +0 -101
  198. package/dist/events/EventAccumulator.js.map +0 -1
  199. package/dist/events/EventBus.js +0 -152
  200. package/dist/events/EventBus.js.map +0 -1
  201. package/dist/events/index.js +0 -11
  202. package/dist/events/index.js.map +0 -1
  203. package/dist/events/normalizers/canvas.js +0 -116
  204. package/dist/events/normalizers/canvas.js.map +0 -1
  205. package/dist/events/normalizers/posthog.js +0 -171
  206. package/dist/events/normalizers/posthog.js.map +0 -1
  207. package/dist/events/schema.js +0 -30
  208. package/dist/events/schema.js.map +0 -1
  209. package/dist/events/types.js +0 -54
  210. package/dist/events/types.js.map +0 -1
  211. package/dist/experiments/adapters/growthbook.js +0 -81
  212. package/dist/experiments/adapters/growthbook.js.map +0 -1
  213. package/dist/experiments/index.js +0 -4
  214. package/dist/experiments/index.js.map +0 -1
  215. package/dist/experiments/registry.js +0 -30
  216. package/dist/experiments/registry.js.map +0 -1
  217. package/dist/experiments/types.js +0 -2
  218. package/dist/experiments/types.js.map +0 -1
  219. package/dist/fetchers/cdnFetcher.js +0 -96
  220. package/dist/fetchers/cdnFetcher.js.map +0 -1
  221. package/dist/fetchers/experimentsFetcher.js +0 -109
  222. package/dist/fetchers/experimentsFetcher.js.map +0 -1
  223. package/dist/fetchers/index.js +0 -5
  224. package/dist/fetchers/index.js.map +0 -1
  225. package/dist/fetchers/mergeConfigs.js +0 -38
  226. package/dist/fetchers/mergeConfigs.js.map +0 -1
  227. package/dist/fetchers/registry.js +0 -58
  228. package/dist/fetchers/registry.js.map +0 -1
  229. package/dist/fetchers/types.js +0 -2
  230. package/dist/fetchers/types.js.map +0 -1
  231. package/dist/hooks/useCanvasOverlays.js +0 -128
  232. package/dist/hooks/useCanvasOverlays.js.map +0 -1
  233. package/dist/hooks/useHostPatches.js +0 -40
  234. package/dist/hooks/useHostPatches.js.map +0 -1
  235. package/dist/hooks/useShadowCanvasConfig.js +0 -63
  236. package/dist/hooks/useShadowCanvasConfig.js.map +0 -1
  237. package/dist/hostPatcher/core/patcher.js +0 -181
  238. package/dist/hostPatcher/core/patcher.js.map +0 -1
  239. package/dist/hostPatcher/core/sanitizer.js +0 -66
  240. package/dist/hostPatcher/core/sanitizer.js.map +0 -1
  241. package/dist/hostPatcher/core/types.js +0 -2
  242. package/dist/hostPatcher/core/types.js.map +0 -1
  243. package/dist/hostPatcher/index.js +0 -7
  244. package/dist/hostPatcher/index.js.map +0 -1
  245. package/dist/hostPatcher/policy/defaultPolicy.js +0 -23
  246. package/dist/hostPatcher/policy/defaultPolicy.js.map +0 -1
  247. package/dist/hostPatcher/utils/anchors.js +0 -105
  248. package/dist/hostPatcher/utils/anchors.js.map +0 -1
  249. package/dist/hostPatcher/utils/observer.js +0 -11
  250. package/dist/hostPatcher/utils/observer.js.map +0 -1
  251. package/dist/logger.js +0 -81
  252. package/dist/logger.js.map +0 -1
  253. package/dist/metrics/index.js +0 -5
  254. package/dist/metrics/index.js.map +0 -1
  255. package/dist/metrics/sessionMetrics.js +0 -178
  256. package/dist/metrics/sessionMetrics.js.map +0 -1
  257. package/dist/notifications/NotificationToastStack.js +0 -118
  258. package/dist/notifications/NotificationToastStack.js.map +0 -1
  259. package/dist/notifications/index.js +0 -6
  260. package/dist/notifications/index.js.map +0 -1
  261. package/dist/notifications/matcher.js +0 -66
  262. package/dist/notifications/matcher.js.map +0 -1
  263. package/dist/notifications/types.js +0 -13
  264. package/dist/notifications/types.js.map +0 -1
  265. package/dist/notifications/useNotifications.js +0 -104
  266. package/dist/notifications/useNotifications.js.map +0 -1
  267. package/dist/notifications/useNotifyWatcher.js +0 -62
  268. package/dist/notifications/useNotifyWatcher.js.map +0 -1
  269. package/dist/overlays/fetcher.js +0 -15
  270. package/dist/overlays/fetcher.js.map +0 -1
  271. package/dist/overlays/recipeRegistry.js +0 -32
  272. package/dist/overlays/recipeRegistry.js.map +0 -1
  273. package/dist/overlays/runtime/anchor/resolve.js +0 -87
  274. package/dist/overlays/runtime/anchor/resolve.js.map +0 -1
  275. package/dist/overlays/runtime/index.js +0 -8
  276. package/dist/overlays/runtime/index.js.map +0 -1
  277. package/dist/overlays/runtime/overlay/highlight.js +0 -160
  278. package/dist/overlays/runtime/overlay/highlight.js.map +0 -1
  279. package/dist/overlays/runtime/overlay/modal.js +0 -78
  280. package/dist/overlays/runtime/overlay/modal.js.map +0 -1
  281. package/dist/overlays/runtime/overlay/root.js +0 -297
  282. package/dist/overlays/runtime/overlay/root.js.map +0 -1
  283. package/dist/overlays/runtime/overlay/runner.js +0 -602
  284. package/dist/overlays/runtime/overlay/runner.js.map +0 -1
  285. package/dist/overlays/runtime/overlay/tooltip.js +0 -232
  286. package/dist/overlays/runtime/overlay/tooltip.js.map +0 -1
  287. package/dist/overlays/runtime/utils/dom.js +0 -12
  288. package/dist/overlays/runtime/utils/dom.js.map +0 -1
  289. package/dist/overlays/schema.js +0 -52
  290. package/dist/overlays/schema.js.map +0 -1
  291. package/dist/overlays/types.js +0 -2
  292. package/dist/overlays/types.js.map +0 -1
  293. package/dist/render/RenderContext.js +0 -69
  294. package/dist/render/RenderContext.js.map +0 -1
  295. package/dist/render/index.js +0 -3
  296. package/dist/render/index.js.map +0 -1
  297. package/dist/render/types.js +0 -2
  298. package/dist/render/types.js.map +0 -1
  299. package/dist/runtime.js +0 -237
  300. package/dist/runtime.js.map +0 -1
  301. package/dist/state/StateStore.js +0 -176
  302. package/dist/state/StateStore.js.map +0 -1
  303. package/dist/state/helpers/cooldowns.js +0 -31
  304. package/dist/state/helpers/cooldowns.js.map +0 -1
  305. package/dist/state/helpers/dismissals.js +0 -34
  306. package/dist/state/helpers/dismissals.js.map +0 -1
  307. package/dist/state/helpers/frequency.js +0 -43
  308. package/dist/state/helpers/frequency.js.map +0 -1
  309. package/dist/state/index.js +0 -7
  310. package/dist/state/index.js.map +0 -1
  311. package/dist/state/schema.js +0 -25
  312. package/dist/state/schema.js.map +0 -1
  313. package/dist/state/types.js +0 -9
  314. package/dist/state/types.js.map +0 -1
  315. package/dist/store/example.js +0 -43
  316. package/dist/store/example.js.map +0 -1
  317. package/dist/store/mini-effector.js +0 -88
  318. package/dist/store/mini-effector.js.map +0 -1
  319. package/dist/surfaces/Surfaces.js +0 -361
  320. package/dist/surfaces/Surfaces.js.map +0 -1
  321. package/dist/surfaces/index.js +0 -12
  322. package/dist/surfaces/index.js.map +0 -1
  323. package/dist/surfaces/positioning.js +0 -228
  324. package/dist/surfaces/positioning.js.map +0 -1
  325. package/dist/surfaces/types.js +0 -23
  326. package/dist/surfaces/types.js.map +0 -1
  327. package/dist/telemetry/adapters/noop.js +0 -42
  328. package/dist/telemetry/adapters/noop.js.map +0 -1
  329. package/dist/telemetry/adapters/posthog.js +0 -180
  330. package/dist/telemetry/adapters/posthog.js.map +0 -1
  331. package/dist/telemetry/index.js +0 -4
  332. package/dist/telemetry/index.js.map +0 -1
  333. package/dist/telemetry/registry.js +0 -29
  334. package/dist/telemetry/registry.js.map +0 -1
  335. package/dist/telemetry/types.js +0 -2
  336. package/dist/telemetry/types.js.map +0 -1
  337. package/dist/theme/ThemeProvider.js +0 -109
  338. package/dist/theme/ThemeProvider.js.map +0 -1
  339. package/dist/theme/defaultTheme.js +0 -190
  340. package/dist/theme/defaultTheme.js.map +0 -1
  341. package/dist/theme/extractHostTheme.js +0 -259
  342. package/dist/theme/extractHostTheme.js.map +0 -1
  343. package/dist/theme/index.js +0 -7
  344. package/dist/theme/index.js.map +0 -1
  345. package/dist/theme/types.js +0 -6
  346. package/dist/theme/types.js.map +0 -1
  347. package/dist/token.js +0 -44
  348. package/dist/token.js.map +0 -1
  349. package/dist/types.js +0 -17
  350. package/dist/types.js.map +0 -1
  351. package/dist/version.js +0 -14
  352. package/dist/version.js.map +0 -1
  353. package/dist/widgets/WidgetRegistry.js +0 -190
  354. package/dist/widgets/WidgetRegistry.js.map +0 -1
  355. package/dist/widgets/index.js +0 -7
  356. package/dist/widgets/index.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import type { TelemetryClient } from '../telemetry/types';
3
3
  import type { TileConfig } from '../types';
4
4
  export interface CanvasTheme {
@@ -35,4 +35,4 @@ export interface ShadowCanvasOverlayProps {
35
35
  displayMode?: 'standard' | 'focused';
36
36
  theme?: Partial<CanvasTheme>;
37
37
  }
38
- export declare function ShadowCanvasOverlay({ isOpen, onToggle, telemetry, launcherLabel, launcherAnimate, launcherAnimationStyle: _launcherAnimationStyle, notificationCount, footerSlot, tiles, isLoading, error, canvasTitle, displayMode, theme: themeOverride, }: ShadowCanvasOverlayProps): import("react/jsx-runtime").JSX.Element | null;
38
+ export declare function ShadowCanvasOverlay({ isOpen, onToggle, telemetry, launcherLabel: _launcherLabel, launcherAnimate, launcherAnimationStyle: _launcherAnimationStyle, notificationCount: _notificationCount, footerSlot, tiles, isLoading, error, canvasTitle, displayMode, theme: themeOverride, }: ShadowCanvasOverlayProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import { type CSSProperties } from 'react';
2
2
  import type { TelemetryClient } from '../telemetry/types';
3
3
  import type { TileConfig } from '../types';
4
4
  interface TileCardProps {
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import type { TelemetryClient } from '../telemetry/types';
10
10
  import type { RoutesConfig } from '../types';
11
- import type { RuntimeContext, AnchorState, ContextChangeCallback, Unsubscribe, PageHistoryEntry } from './types';
11
+ import type { AnchorState, ContextChangeCallback, PageHistoryEntry, RuntimeContext, Unsubscribe } from './types';
12
12
  export interface ContextManagerOptions {
13
13
  /** Telemetry client for session ID */
14
14
  telemetry?: TelemetryClient;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Context module exports.
3
3
  */
4
- export * from './types';
5
- export * from './schema';
6
- export { ContextManager, createContextManager } from './ContextManager';
7
4
  export type { ContextManagerOptions } from './ContextManager';
5
+ export { ContextManager, createContextManager } from './ContextManager';
6
+ export * from './schema';
7
+ export * from './types';
@@ -8,7 +8,7 @@ import type { RuntimeContext } from '../context/types';
8
8
  import type { EventBus } from '../events/EventBus';
9
9
  import type { SessionMetricTracker } from '../metrics/sessionMetrics';
10
10
  import type { StateStore } from '../state/StateStore';
11
- import type { DecisionStrategy, DecisionResult } from './types';
11
+ import type { DecisionResult, DecisionStrategy } from './types';
12
12
  /**
13
13
  * Options for the decision engine evaluate function.
14
14
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Decisions module exports.
3
3
  */
4
- export * from './types';
5
- export * from './schema';
6
- export { evaluate, evaluateSync, createDecisionEngine } from './engine';
7
4
  export type { EvaluateOptions } from './engine';
5
+ export { createDecisionEngine, evaluate, evaluateSync } from './engine';
6
+ export * from './schema';
8
7
  export { evaluateCondition, evaluateRule, evaluateRuleStrategy } from './strategies/rules';
9
8
  export { evaluateScoreStrategy } from './strategies/score';
9
+ export * from './types';
@@ -806,6 +806,7 @@ export declare const RuleStrategyZ: z.ZodObject<{
806
806
  }>, "many">;
807
807
  default: z.ZodUnknown;
808
808
  }, "strip", z.ZodTypeAny, {
809
+ type: "rules";
809
810
  rules: {
810
811
  conditions: ({
811
812
  url: string;
@@ -858,9 +859,9 @@ export declare const RuleStrategyZ: z.ZodObject<{
858
859
  })[];
859
860
  value?: unknown;
860
861
  }[];
861
- type: "rules";
862
862
  default?: unknown;
863
863
  }, {
864
+ type: "rules";
864
865
  rules: {
865
866
  conditions: ({
866
867
  url: string;
@@ -913,7 +914,6 @@ export declare const RuleStrategyZ: z.ZodObject<{
913
914
  })[];
914
915
  value?: unknown;
915
916
  }[];
916
- type: "rules";
917
917
  default?: unknown;
918
918
  }>;
919
919
  export declare const ScoreStrategyZ: z.ZodObject<{
@@ -963,14 +963,14 @@ export declare const ExternalStrategyZ: z.ZodObject<{
963
963
  }, "strip", z.ZodTypeAny, {
964
964
  type: "external";
965
965
  endpoint: string;
966
- default?: unknown;
967
966
  timeoutMs?: number | undefined;
967
+ default?: unknown;
968
968
  method?: "GET" | "POST" | undefined;
969
969
  }, {
970
970
  type: "external";
971
971
  endpoint: string;
972
- default?: unknown;
973
972
  timeoutMs?: number | undefined;
973
+ default?: unknown;
974
974
  method?: "GET" | "POST" | undefined;
975
975
  }>;
976
976
  export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -1227,6 +1227,7 @@ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodOb
1227
1227
  }>, "many">;
1228
1228
  default: z.ZodUnknown;
1229
1229
  }, "strip", z.ZodTypeAny, {
1230
+ type: "rules";
1230
1231
  rules: {
1231
1232
  conditions: ({
1232
1233
  url: string;
@@ -1279,9 +1280,9 @@ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodOb
1279
1280
  })[];
1280
1281
  value?: unknown;
1281
1282
  }[];
1282
- type: "rules";
1283
1283
  default?: unknown;
1284
1284
  }, {
1285
+ type: "rules";
1285
1286
  rules: {
1286
1287
  conditions: ({
1287
1288
  url: string;
@@ -1334,7 +1335,6 @@ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodOb
1334
1335
  })[];
1335
1336
  value?: unknown;
1336
1337
  }[];
1337
- type: "rules";
1338
1338
  default?: unknown;
1339
1339
  }>, z.ZodObject<{
1340
1340
  type: z.ZodLiteral<"score">;
@@ -1381,14 +1381,14 @@ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodOb
1381
1381
  }, "strip", z.ZodTypeAny, {
1382
1382
  type: "external";
1383
1383
  endpoint: string;
1384
- default?: unknown;
1385
1384
  timeoutMs?: number | undefined;
1385
+ default?: unknown;
1386
1386
  method?: "GET" | "POST" | undefined;
1387
1387
  }, {
1388
1388
  type: "external";
1389
1389
  endpoint: string;
1390
- default?: unknown;
1391
1390
  timeoutMs?: number | undefined;
1391
+ default?: unknown;
1392
1392
  method?: "GET" | "POST" | undefined;
1393
1393
  }>]>;
1394
1394
  export declare const RouteFilterZ: z.ZodObject<{
@@ -1666,6 +1666,7 @@ export declare const ActivationConfigZ: z.ZodObject<{
1666
1666
  }>, "many">;
1667
1667
  default: z.ZodUnknown;
1668
1668
  }, "strip", z.ZodTypeAny, {
1669
+ type: "rules";
1669
1670
  rules: {
1670
1671
  conditions: ({
1671
1672
  url: string;
@@ -1718,9 +1719,9 @@ export declare const ActivationConfigZ: z.ZodObject<{
1718
1719
  })[];
1719
1720
  value?: unknown;
1720
1721
  }[];
1721
- type: "rules";
1722
1722
  default?: unknown;
1723
1723
  }, {
1724
+ type: "rules";
1724
1725
  rules: {
1725
1726
  conditions: ({
1726
1727
  url: string;
@@ -1773,7 +1774,6 @@ export declare const ActivationConfigZ: z.ZodObject<{
1773
1774
  })[];
1774
1775
  value?: unknown;
1775
1776
  }[];
1776
- type: "rules";
1777
1777
  default?: unknown;
1778
1778
  }>, z.ZodObject<{
1779
1779
  type: z.ZodLiteral<"score">;
@@ -1820,18 +1820,19 @@ export declare const ActivationConfigZ: z.ZodObject<{
1820
1820
  }, "strip", z.ZodTypeAny, {
1821
1821
  type: "external";
1822
1822
  endpoint: string;
1823
- default?: unknown;
1824
1823
  timeoutMs?: number | undefined;
1824
+ default?: unknown;
1825
1825
  method?: "GET" | "POST" | undefined;
1826
1826
  }, {
1827
1827
  type: "external";
1828
1828
  endpoint: string;
1829
- default?: unknown;
1830
1829
  timeoutMs?: number | undefined;
1830
+ default?: unknown;
1831
1831
  method?: "GET" | "POST" | undefined;
1832
1832
  }>]>>;
1833
1833
  }, "strip", z.ZodTypeAny, {
1834
1834
  strategy?: {
1835
+ type: "rules";
1835
1836
  rules: {
1836
1837
  conditions: ({
1837
1838
  url: string;
@@ -1884,7 +1885,6 @@ export declare const ActivationConfigZ: z.ZodObject<{
1884
1885
  })[];
1885
1886
  value?: unknown;
1886
1887
  }[];
1887
- type: "rules";
1888
1888
  default?: unknown;
1889
1889
  } | {
1890
1890
  type: "score";
@@ -1901,8 +1901,8 @@ export declare const ActivationConfigZ: z.ZodObject<{
1901
1901
  } | {
1902
1902
  type: "external";
1903
1903
  endpoint: string;
1904
- default?: unknown;
1905
1904
  timeoutMs?: number | undefined;
1905
+ default?: unknown;
1906
1906
  method?: "GET" | "POST" | undefined;
1907
1907
  } | undefined;
1908
1908
  routes?: {
@@ -1911,6 +1911,7 @@ export declare const ActivationConfigZ: z.ZodObject<{
1911
1911
  } | undefined;
1912
1912
  }, {
1913
1913
  strategy?: {
1914
+ type: "rules";
1914
1915
  rules: {
1915
1916
  conditions: ({
1916
1917
  url: string;
@@ -1963,7 +1964,6 @@ export declare const ActivationConfigZ: z.ZodObject<{
1963
1964
  })[];
1964
1965
  value?: unknown;
1965
1966
  }[];
1966
- type: "rules";
1967
1967
  default?: unknown;
1968
1968
  } | {
1969
1969
  type: "score";
@@ -1980,8 +1980,8 @@ export declare const ActivationConfigZ: z.ZodObject<{
1980
1980
  } | {
1981
1981
  type: "external";
1982
1982
  endpoint: string;
1983
- default?: unknown;
1984
1983
  timeoutMs?: number | undefined;
1984
+ default?: unknown;
1985
1985
  method?: "GET" | "POST" | undefined;
1986
1986
  } | undefined;
1987
1987
  routes?: {
@@ -2093,6 +2093,7 @@ export declare function validateCondition(data: unknown): z.SafeParseReturnType<
2093
2093
  * Validate a DecisionStrategy object.
2094
2094
  */
2095
2095
  export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2096
+ type: "rules";
2096
2097
  rules: {
2097
2098
  conditions: ({
2098
2099
  url: string;
@@ -2145,7 +2146,6 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2145
2146
  })[];
2146
2147
  value?: unknown;
2147
2148
  }[];
2148
- type: "rules";
2149
2149
  default?: unknown;
2150
2150
  } | {
2151
2151
  type: "score";
@@ -2162,10 +2162,11 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2162
2162
  } | {
2163
2163
  type: "external";
2164
2164
  endpoint: string;
2165
- default?: unknown;
2166
2165
  timeoutMs?: number | undefined;
2166
+ default?: unknown;
2167
2167
  method?: "GET" | "POST" | undefined;
2168
2168
  }, {
2169
+ type: "rules";
2169
2170
  rules: {
2170
2171
  conditions: ({
2171
2172
  url: string;
@@ -2218,7 +2219,6 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2218
2219
  })[];
2219
2220
  value?: unknown;
2220
2221
  }[];
2221
- type: "rules";
2222
2222
  default?: unknown;
2223
2223
  } | {
2224
2224
  type: "score";
@@ -2235,8 +2235,8 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2235
2235
  } | {
2236
2236
  type: "external";
2237
2237
  endpoint: string;
2238
- default?: unknown;
2239
2238
  timeoutMs?: number | undefined;
2239
+ default?: unknown;
2240
2240
  method?: "GET" | "POST" | undefined;
2241
2241
  }>;
2242
2242
  /**
@@ -2244,6 +2244,7 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2244
2244
  */
2245
2245
  export declare function validateActivationConfig(data: unknown): z.SafeParseReturnType<{
2246
2246
  strategy?: {
2247
+ type: "rules";
2247
2248
  rules: {
2248
2249
  conditions: ({
2249
2250
  url: string;
@@ -2296,7 +2297,6 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2296
2297
  })[];
2297
2298
  value?: unknown;
2298
2299
  }[];
2299
- type: "rules";
2300
2300
  default?: unknown;
2301
2301
  } | {
2302
2302
  type: "score";
@@ -2313,8 +2313,8 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2313
2313
  } | {
2314
2314
  type: "external";
2315
2315
  endpoint: string;
2316
- default?: unknown;
2317
2316
  timeoutMs?: number | undefined;
2317
+ default?: unknown;
2318
2318
  method?: "GET" | "POST" | undefined;
2319
2319
  } | undefined;
2320
2320
  routes?: {
@@ -2323,6 +2323,7 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2323
2323
  } | undefined;
2324
2324
  }, {
2325
2325
  strategy?: {
2326
+ type: "rules";
2326
2327
  rules: {
2327
2328
  conditions: ({
2328
2329
  url: string;
@@ -2375,7 +2376,6 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2375
2376
  })[];
2376
2377
  value?: unknown;
2377
2378
  }[];
2378
- type: "rules";
2379
2379
  default?: unknown;
2380
2380
  } | {
2381
2381
  type: "score";
@@ -2392,8 +2392,8 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2392
2392
  } | {
2393
2393
  type: "external";
2394
2394
  endpoint: string;
2395
- default?: unknown;
2396
2395
  timeoutMs?: number | undefined;
2396
+ default?: unknown;
2397
2397
  method?: "GET" | "POST" | undefined;
2398
2398
  } | undefined;
2399
2399
  routes?: {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Evaluates rules in order and returns the value of the first matching rule.
5
5
  */
6
- import type { RuleStrategy, Rule, Condition, DecisionResult, EvaluationContext } from '../types';
6
+ import type { Condition, DecisionResult, EvaluationContext, Rule, RuleStrategy } from '../types';
7
7
  /**
8
8
  * Evaluate a single condition against the evaluation context.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Compares an augmented field value against a threshold.
5
5
  */
6
- import type { ScoreStrategy, DecisionResult, EvaluationContext } from '../types';
6
+ import type { DecisionResult, EvaluationContext, ScoreStrategy } from '../types';
7
7
  /**
8
8
  * Evaluate a ScoreStrategy and return the result.
9
9
  */
@@ -5,7 +5,7 @@ export interface EditorSource {
5
5
  }
6
6
  /** Decoded editor_conf payload (passed through to editor SDK). */
7
7
  export interface EditorConf {
8
- mode: 'editor' | 'audit' | 'demo';
8
+ mode: 'editor' | 'audit' | 'review' | 'demo';
9
9
  audit_session_id?: string;
10
10
  [key: string]: unknown;
11
11
  }
@@ -24,10 +24,10 @@ export declare const shouldLoadEditor: () => boolean;
24
24
  */
25
25
  export declare const isAuditMode: () => boolean;
26
26
  /**
27
- * Checks if any SDK mode (editor or audit) should be loaded.
28
- * Returns the mode type if active, or null if neither.
27
+ * Checks if any SDK mode (editor, audit, or review) should be loaded.
28
+ * Returns the mode type if active, or null if none.
29
29
  */
30
- export declare const getActiveSdkMode: () => "editor" | "audit" | null;
30
+ export declare const getActiveSdkMode: () => "editor" | "audit" | "review" | null;
31
31
  export interface EditorLoadOptions {
32
32
  editorUrl?: string;
33
33
  integrity?: string;
@@ -6,9 +6,9 @@
6
6
  * - Counts stored in StateStore.session (session-scoped)
7
7
  * - Subscribers notified on every counter increment
8
8
  */
9
+ import type { StateStore } from '../state/StateStore';
9
10
  import type { EventBus } from './EventBus';
10
11
  import type { NormalizedEvent } from './types';
11
- import type { StateStore } from '../state/StateStore';
12
12
  export interface EventAccumulator {
13
13
  /** Register a named counter with a predicate callback. The adaptive provides ALL filtering logic. */
14
14
  register(key: string, predicate: (event: NormalizedEvent) => boolean, needsTimestamps?: boolean): void;
@@ -6,7 +6,7 @@
6
6
  * - Event history for recent event lookups
7
7
  * - Filtering by name, pattern, or source
8
8
  */
9
- import type { NormalizedEvent, EventFilter, EventCallback, EventUnsubscribe } from './types';
9
+ import type { EventCallback, EventFilter, EventUnsubscribe, NormalizedEvent } from './types';
10
10
  export interface EventBusOptions {
11
11
  /** Maximum number of events to keep in history */
12
12
  maxHistorySize?: number;
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Events module exports.
3
3
  */
4
- export * from './types';
5
- export * from './schema';
6
- export { EventBus, createEventBus } from './EventBus';
7
- export type { EventBusOptions } from './EventBus';
8
- export { createEventAccumulator } from './EventAccumulator';
9
4
  export type { EventAccumulator, EventAccumulatorOptions } from './EventAccumulator';
10
- export { normalizePostHogEvent, shouldNormalizeEvent, createPostHogNormalizer, } from './normalizers/posthog';
5
+ export { createEventAccumulator } from './EventAccumulator';
6
+ export type { EventBusOptions } from './EventBus';
7
+ export { createEventBus, EventBus } from './EventBus';
11
8
  export { CanvasEvents } from './normalizers/canvas';
9
+ export { createPostHogNormalizer, normalizePostHogEvent, shouldNormalizeEvent, } from './normalizers/posthog';
10
+ export { registerConfigPredicates } from './registerConfigPredicates';
11
+ export * from './schema';
12
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Register accumulator predicates from tile configs at config-load time.
3
+ *
4
+ * Previously, predicate registration lived inside FAQWidget's useEffect —
5
+ * meaning predicates were only active when the widget was mounted (canvas open).
6
+ * On multi-page apps with `defaultOpen: false`, the canvas stays closed after
7
+ * navigation, the widget never mounts, and clicks go uncounted.
8
+ *
9
+ * This module extracts that logic so predicates are registered as soon as the
10
+ * config is loaded, regardless of canvas state.
11
+ */
12
+ import type { TileConfig } from '../types';
13
+ import type { EventAccumulator } from './EventAccumulator';
14
+ /**
15
+ * Scan tile configs for scope + showWhen event_count conditions and register
16
+ * accumulator predicates. Safe to call multiple times — accumulator.register()
17
+ * is idempotent (skips if key already registered).
18
+ */
19
+ export declare function registerConfigPredicates(tiles: TileConfig[], accumulator: EventAccumulator): void;
@@ -4,8 +4,8 @@
4
4
  * This file is INTERNAL - consumers should only import from experiments/types.ts
5
5
  * and use the ExperimentClient interface.
6
6
  */
7
- import { GrowthBook } from '@growthbook/growthbook';
8
7
  import type { Context as GrowthBookInitOptions } from '@growthbook/growthbook';
8
+ import { GrowthBook } from '@growthbook/growthbook';
9
9
  import type { TileConfig } from '../../types';
10
10
  import type { ExperimentClient } from '../types';
11
11
  /**
@@ -1,3 +1,3 @@
1
- export type { ExperimentClient, SyntroExperimentClient } from './types';
2
- export { createGrowthBookClient } from './adapters/growthbook';
3
1
  export type { GrowthBookAdapterOptions } from './adapters/growthbook';
2
+ export { createGrowthBookClient } from './adapters/growthbook';
3
+ export type { ExperimentClient, SyntroExperimentClient } from './types';
@@ -5,7 +5,7 @@
5
5
  * This allows the bootstrap module to dynamically create
6
6
  * experiment clients based on token configuration.
7
7
  */
8
- import { ExperimentTrackingCallback } from './adapters/growthbook';
8
+ import { type ExperimentTrackingCallback } from './adapters/growthbook';
9
9
  import type { ExperimentClient } from './types';
10
10
  export interface CreateExperimentClientConfig {
11
11
  clientKey: string;
@@ -1,3 +1,3 @@
1
+ export { CdnFetcher, type CdnFetcherOptions, createCdnFetcher } from './cdnFetcher';
2
+ export { createExperimentsFetcher, ExperimentsFetcher, type ExperimentsFetcherOptions, } from './experimentsFetcher';
1
3
  export type { ConfigFetcher, FetchResult } from './types';
2
- export { ExperimentsFetcher, createExperimentsFetcher, type ExperimentsFetcherOptions, } from './experimentsFetcher';
3
- export { CdnFetcher, createCdnFetcher, type CdnFetcherOptions } from './cdnFetcher';
@@ -1,6 +1,6 @@
1
1
  import type { ExperimentClient } from '../experiments/types';
2
2
  import type { SmartCanvasRuntime } from '../runtime';
3
- import type { CanvasConfigFetcher, TileConfig, CanvasThemeConfig, LauncherConfig, RoutesConfig, ActionStep } from '../types';
3
+ import type { ActionStep, CanvasConfigFetcher, CanvasThemeConfig, LauncherConfig, RoutesConfig, TileConfig } from '../types';
4
4
  export interface UseShadowCanvasConfigOptions {
5
5
  fetcher: CanvasConfigFetcher;
6
6
  pollIntervalMs?: number;
@@ -1,6 +1,6 @@
1
- export * from './policy/defaultPolicy';
2
- export * from './core/types';
3
1
  export * from './core/patcher';
4
2
  export * from './core/sanitizer';
3
+ export * from './core/types';
4
+ export * from './policy/defaultPolicy';
5
5
  export * from './utils/anchors';
6
6
  export * from './utils/observer';
package/dist/index.d.ts CHANGED
@@ -1,35 +1,38 @@
1
- export * from './version';
2
- export * from './types';
3
- export * from './config-validator';
4
- export * from './telemetry';
5
- export * from './experiments';
6
- export * from './hooks/useShadowCanvasConfig';
7
- export * from './components/TileCard';
1
+ export * from './api';
8
2
  export * from './components/ShadowCanvasOverlay';
3
+ export * from './components/TileCard';
9
4
  export * from './components/TileWheel';
5
+ export * from './config-validator';
6
+ export * from './configFetcher';
10
7
  export * from './controller';
8
+ export * from './experiments';
9
+ export * from './hooks/useShadowCanvasConfig';
10
+ export * from './metrics';
11
+ export * from './overlays/fetcher';
12
+ export * from './overlays/schema';
13
+ export * from './overlays/types';
14
+ export * from './ShadowRootContext';
11
15
  export * from './SmartCanvasApp';
12
16
  export * from './SmartCanvasElement';
13
17
  export * from './SmartCanvasPortal';
14
- export * from './api';
15
- export * from './configFetcher';
16
- export * from './overlays/types';
17
- export * from './overlays/schema';
18
- export * from './overlays/fetcher';
19
- export * from './metrics';
18
+ export * from './telemetry';
19
+ export * from './types';
20
+ export * from './version';
21
+ export * from './actions';
22
+ export * from './apps';
20
23
  export * from './context';
24
+ export * from './decisions';
25
+ export * from './events';
21
26
  export * from './events';
22
27
  export * from './notifications';
28
+ export { RuntimeProvider, useDecision, usePageContext, useRuntime, useRuntimeContext, useRuntimeEvents, useRuntimeState, useSessionContext, useViewportContext, } from './RuntimeProvider';
29
+ export type { RuntimeMode, SmartCanvasRuntime, SmartCanvasRuntimeOptions } from './runtime';
30
+ export { createSmartCanvasRuntime, RUNTIME_VERSION } from './runtime';
31
+ export * from './state';
23
32
  export * from './state';
24
- export * from './decisions';
25
- export * from './actions';
26
33
  export * from './surfaces';
27
34
  export * from './widgets';
28
- export * from './apps';
29
- export { createSmartCanvasRuntime, RUNTIME_VERSION } from './runtime';
30
- export type { SmartCanvasRuntime, SmartCanvasRuntimeOptions, RuntimeMode } from './runtime';
31
- export { RuntimeProvider, useRuntime, useRuntimeContext, usePageContext, useSessionContext, useViewportContext, useRuntimeEvents, useRuntimeState, useDecision, } from './RuntimeProvider';
32
- export { Syntro } from './bootstrap';
33
35
  export type { SyntroInitOptions, SyntroInitResult } from './bootstrap';
34
- export { encodeToken, decodeToken } from './token';
36
+ export { Syntro } from './bootstrap';
35
37
  export type { SyntroTokenPayload } from './token';
38
+ export { decodeToken, encodeToken } from './token';