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

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-HJKAXD5S.js +7921 -0
  37. package/dist/chunk-HJKAXD5S.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 type { ScopedStorage, DismissalStore, CooldownStore, FrequencyStore } from './types';
1
+ import type { CooldownStore, DismissalStore, FrequencyStore, ScopedStorage } from './types';
2
2
  export interface StateStoreOptions {
3
3
  /** Namespace prefix for storage keys */
4
4
  namespace?: string;
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Tracks time-based cooldowns to prevent items from showing too frequently.
5
5
  */
6
- import type { ScopedStorage, CooldownStore } from '../types';
6
+ import type { CooldownStore, ScopedStorage } from '../types';
7
7
  export declare function createCooldownStore(storage: ScopedStorage): CooldownStore;
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Tracks dismissed items in session or user storage.
5
5
  */
6
- import type { ScopedStorage, DismissalStore } from '../types';
6
+ import type { DismissalStore, ScopedStorage } from '../types';
7
7
  export declare function createDismissalStore(sessionStorage: ScopedStorage, userStorage: ScopedStorage): DismissalStore;
@@ -4,5 +4,5 @@
4
4
  * Tracks how many times items have been shown or actions taken,
5
5
  * optionally resetting after a time window.
6
6
  */
7
- import type { ScopedStorage, FrequencyStore } from '../types';
7
+ import type { FrequencyStore, ScopedStorage } from '../types';
8
8
  export declare function createFrequencyStore(storage: ScopedStorage): FrequencyStore;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * State module exports.
3
3
  */
4
- export * from './types';
5
- export * from './schema';
6
- export { StateStore, createStateStore } from './StateStore';
7
4
  export type { StateStoreOptions } from './StateStore';
5
+ export { createStateStore, StateStore } from './StateStore';
6
+ export * from './schema';
7
+ export * from './types';
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Managed surface system for rendering UI into named slots.
5
5
  */
6
+ export { ANIMATION_KEYFRAMES, applyStaticSlotStyles, createSurfaceContainer, getSlotZIndex, playEnterAnimation, playExitAnimation, STATIC_SLOT_STYLES, setupAdjacentPositioning, setupInlinePositioning, } from './positioning';
6
7
  export { createSurfaces } from './Surfaces';
7
- export type { Surfaces, SurfacesOptions, SurfacesWidgetRegistry, MountHandle, SurfaceState, SurfaceChangeCallback, SurfaceSlot, StaticSurfaceSlot, InlineSurfaceSlot, AdjacentSurfaceSlot, RenderableContent, ReactContent, HtmlContent, WidgetContent, CustomContent, MountOptions, PositionConfig, MountConstraints, AnimationType, } from './types';
8
- export { getSlotType, getSlotAnchorId } from './types';
9
- export { STATIC_SLOT_STYLES, ANIMATION_KEYFRAMES, applyStaticSlotStyles, setupAdjacentPositioning, setupInlinePositioning, playEnterAnimation, playExitAnimation, createSurfaceContainer, getSlotZIndex, } from './positioning';
8
+ export type { AdjacentSurfaceSlot, AnimationType, CustomContent, HtmlContent, InlineSurfaceSlot, MountConstraints, MountHandle, MountOptions, PositionConfig, ReactContent, RenderableContent, StaticSurfaceSlot, SurfaceChangeCallback, SurfaceSlot, SurfaceState, Surfaces, SurfacesOptions, SurfacesWidgetRegistry, WidgetContent, } from './types';
9
+ export { getSlotAnchorId, getSlotType } from './types';
@@ -4,7 +4,7 @@
4
4
  * Handles positioning for different slot types using CSS for static slots
5
5
  * and Floating UI for adjacent slots.
6
6
  */
7
- import type { SurfaceSlot, StaticSurfaceSlot, PositionConfig, MountConstraints, AnimationType } from './types';
7
+ import type { AnimationType, MountConstraints, PositionConfig, StaticSurfaceSlot, SurfaceSlot } from './types';
8
8
  /**
9
9
  * CSS styles for static surface slots.
10
10
  */
@@ -5,7 +5,7 @@
5
5
  * and use the TelemetryClient interface.
6
6
  */
7
7
  import type { PostHog, Properties } from 'posthog-js';
8
- import type { TelemetryClient, CanvasSurface } from '../types';
8
+ import type { CanvasSurface, TelemetryClient } from '../types';
9
9
  export interface PostHogAdapterOptions {
10
10
  /**
11
11
  * PostHog API key.
@@ -67,7 +67,7 @@ interface CanvasAnalyticsPayload extends Properties {
67
67
  * Internal adapter that implements TelemetryClient using PostHog.
68
68
  */
69
69
  export declare class PostHogAdapter implements TelemetryClient {
70
- private readonly options;
70
+ readonly options: PostHogAdapterOptions;
71
71
  private client?;
72
72
  private featureFlagsCallback?;
73
73
  private captureCallback?;
@@ -1,4 +1,4 @@
1
- export type { TelemetryClient, CanvasSurface } from './types';
2
- export { createPostHogClient } from './adapters/posthog';
3
- export type { PostHogAdapterOptions } from './adapters/posthog';
4
1
  export { createNoopClient } from './adapters/noop';
2
+ export type { PostHogAdapterOptions } from './adapters/posthog';
3
+ export { createPostHogClient } from './adapters/posthog';
4
+ export type { CanvasSurface, TelemetryClient } from './types';
@@ -1,4 +1,4 @@
1
- import { PostHogAdapterOptions } from './adapters/posthog';
1
+ import { type PostHogAdapterOptions } from './adapters/posthog';
2
2
  import type { TelemetryClient } from './types';
3
3
  /**
4
4
  * Create a telemetry client for the specified provider.
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import type { CanvasThemeTokens, ThemeAppearance, ThemeMode } from './types';
3
3
  interface ThemeContextValue {
4
4
  theme: CanvasThemeTokens;
@@ -1,4 +1,4 @@
1
- import type { ExtractedTheme, CanvasThemeTokens } from './types';
1
+ import type { CanvasThemeTokens, ExtractedTheme } from './types';
2
2
  /**
3
3
  * Extract theme information from the host page
4
4
  */
@@ -1,5 +1,5 @@
1
- export type { CanvasThemeTokens, ExtractedTheme, ThemeMode, ThemeAppearance } from './types';
2
- export { darkTheme, lightTheme, getDefaultTheme, themeToCssVariables, withAlpha } from './defaultTheme';
3
- export { extractHostTheme, mergeWithExtractedTheme, autoDetectTheme } from './extractHostTheme';
4
- export { ThemeProvider, useTheme, useThemeToken, useThemeVar } from './ThemeProvider';
1
+ export { darkTheme, getDefaultTheme, lightTheme, themeToCssVariables, withAlpha, } from './defaultTheme';
2
+ export { autoDetectTheme, extractHostTheme, mergeWithExtractedTheme } from './extractHostTheme';
5
3
  export type { ThemeProviderProps } from './ThemeProvider';
4
+ export { ThemeProvider, useTheme, useThemeToken, useThemeVar } from './ThemeProvider';
5
+ export type { CanvasThemeTokens, ExtractedTheme, ThemeAppearance, ThemeMode } from './types';
@@ -29,4 +29,4 @@ export interface EditorPanelProps {
29
29
  /** Platform client for API calls (optional) */
30
30
  platformClient?: unknown;
31
31
  }
32
- export type { StaticSurfaceSlot, InlineSurfaceSlot, AdjacentSurfaceSlot, SurfaceSlot, HighlightStyle, BadgePosition, TooltipContent, TooltipTrigger, InsertPosition, WidgetConfig, HighlightAction, PulseAction, BadgeAction, TooltipAction, InsertHtmlAction, SetTextAction, SetAttrAction, AddClassAction, RemoveClassAction, SetStyleAction, MountWidgetAction, ScrollToAction, NavigateAction, ActionStep, ActionKind, ActionState, ActionHandle, BatchActionHandle, ActiveAction, ValidationError, ValidationWarning, ValidationResult, ExecutorCleanup, ExecutorUpdate, ExecutorResult, ActionExecutor, ExecutorContext, } from './actions/types';
32
+ export type { ActionExecutor, ActionHandle, ActionKind, ActionState, ActionStep, ActiveAction, AddClassAction, AdjacentSurfaceSlot, BadgeAction, BadgePosition, BatchActionHandle, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, HighlightAction, HighlightStyle, InlineSurfaceSlot, InsertHtmlAction, InsertPosition, MountWidgetAction, NavigateAction, PulseAction, RemoveClassAction, ScrollToAction, SetAttrAction, SetStyleAction, SetTextAction, StaticSurfaceSlot, SurfaceSlot, TooltipAction, TooltipContent, TooltipTrigger, ValidationError, ValidationResult, ValidationWarning, WidgetConfig, } from './actions/types';
@@ -1,11 +1 @@
1
- /**
2
- * Types-only export for app packages.
3
- *
4
- * This file re-exports action types without importing any runtime code,
5
- * allowing app packages to import types without circular dependency issues.
6
- *
7
- * Apps should import from "@syntrologie/runtime-sdk/types" instead of
8
- * the main entry point when they only need type definitions.
9
- */
10
- export {};
11
- //# sourceMappingURL=types-only.js.map
1
+ //# sourceMappingURL=types-only.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"types-only.js","sourceRoot":"","sources":["../src/types-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/dist/types.d.ts CHANGED
@@ -204,7 +204,7 @@ export interface TableContent {
204
204
  maxHeight?: string;
205
205
  }
206
206
  export type DataContent = StatsContent | ComparisonContent | ChartContent | TableContent;
207
- export type { ActivationConfig, RouteFilter, DecisionStrategy } from './decisions/types';
207
+ export type { ActivationConfig, DecisionStrategy, RouteFilter } from './decisions/types';
208
208
  /**
209
209
  * Full tile configuration.
210
210
  *
package/dist/version.d.ts CHANGED
@@ -10,4 +10,4 @@
10
10
  *
11
11
  * @since 2.0.0
12
12
  */
13
- export declare const SDK_VERSION = "2.1.0";
13
+ export declare const SDK_VERSION = "2.2.0-canary.1";
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Extensible widget registry for mountable components.
5
5
  */
6
+ export type { MountableWidget, MountedWidgetHandle, WidgetCleanup, WidgetRegistration, } from './WidgetRegistry';
6
7
  export { WidgetRegistry, widgetRegistry } from './WidgetRegistry';
7
- export type { MountableWidget, WidgetRegistration, MountedWidgetHandle, WidgetCleanup, } from './WidgetRegistry';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/runtime-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-canary.1",
4
4
  "description": "Syntrologie Runtime SDK for web experimentation and analytics",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -8,7 +8,7 @@
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/SyntropyForge/amazing-demos.git",
11
- "directory": "tech-core/sdks/runtime-sdk"
11
+ "directory": "packages/runtime-sdk"
12
12
  },
13
13
  "publishConfig": {
14
14
  "access": "public"
@@ -46,44 +46,51 @@
46
46
  "scripts": {
47
47
  "clean": "rm -rf dist",
48
48
  "aggregate-capabilities": "node ./scripts/aggregate-capabilities.mjs",
49
- "build": "npm run aggregate-capabilities && npm run build:lib && npm run build:cdn",
50
- "build:lib": "tsc --project tsconfig.build.json",
49
+ "generate-schema": "node ./scripts/generate-unified-schema.mjs",
50
+ "generate-schema:check": "node ./scripts/generate-unified-schema.mjs --check",
51
+ "build": "npm run aggregate-capabilities && npm run build:types && npm run build:lib && npm run generate-schema && npm run build:cdn",
52
+ "build:types": "tsc --project tsconfig.build.json",
53
+ "build:lib": "node ./scripts/build-lib.mjs",
51
54
  "build:cdn": "node ./scripts/build-cdn.js",
52
55
  "dev:adaptives": "node ./scripts/build-adaptives-only.js --watch",
53
56
  "validate-config": "node ./scripts/validate-config.mjs",
57
+ "typecheck": "tsc --noEmit -p tsconfig.build.json",
54
58
  "test": "vitest run",
55
59
  "prepublishOnly": "npm run clean && npm run build"
56
60
  },
57
61
  "dependencies": {
58
62
  "@floating-ui/dom": "^1.7.5",
59
63
  "@growthbook/growthbook": "~1.6.2",
60
- "@growthbook/growthbook-react": "~1.6.2",
61
- "@syntro/design-system": "*",
62
- "@syntrologie/adapt-content": "2.1.0",
63
- "@syntrologie/adapt-overlays": "2.1.0",
64
+ "@growthbook/growthbook-react": "^1.6.4",
65
+ "@syntrologie/adapt-content": "2.2.0-canary.1",
66
+ "@syntrologie/adapt-overlays": "2.2.0-canary.1",
64
67
  "posthog-js": "~1.302.2",
65
- "zod": "~3.25.0"
68
+ "zod": "^3.25.76"
66
69
  },
67
70
  "peerDependencies": {
68
71
  "react": ">=18.0.0",
69
72
  "react-dom": ">=18.0.0"
70
73
  },
71
74
  "devDependencies": {
75
+ "@syntro/design-system": "*",
72
76
  "@semantic-release/exec": "~7.1.0",
73
77
  "@semantic-release/github": "~12.0.3",
74
78
  "@semantic-release/npm": "~13.1.3",
75
79
  "@testing-library/dom": "^10.4.1",
76
80
  "@testing-library/jest-dom": "^6.9.1",
77
81
  "@testing-library/react": "^16.3.2",
78
- "@types/node": "^25.2.0",
79
- "@types/react": "^19.1.0",
80
- "@types/react-dom": "^19.1.0",
82
+ "@types/node": "^22.19.7",
83
+ "@types/react": "^19.2.0",
84
+ "@types/react-dom": "^19.2.0",
85
+ "ajv": "^8.18.0",
86
+ "ajv-formats": "^3.0.1",
81
87
  "esbuild": "^0.27.2",
82
- "jsdom": "^25.0.1",
83
- "react": "^19.2.4",
84
- "react-dom": "^19.2.4",
88
+ "jsdom": "^26.1.0",
89
+ "react": "^19.2.0",
90
+ "react-dom": "^19.2.0",
85
91
  "semantic-release": "~25.0.3",
86
- "typescript": "~5.7.0",
87
- "vitest": "^4.0.18"
92
+ "typescript": "^5.9.3",
93
+ "vitest": "^4.0.18",
94
+ "zod-to-json-schema": "^3.25.1"
88
95
  }
89
96
  }
@@ -0,0 +1,351 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://syntropyforge.com/schemas/smart-canvas-config.json",
4
+ "title": "Smart Canvas Configuration",
5
+ "description": "Action-based configuration for Smart Canvas. All interventions are unified as ActionStep.",
6
+ "type": "object",
7
+ "required": ["fetchedAt", "tiles", "actions"],
8
+ "properties": {
9
+ "fetchedAt": {
10
+ "type": "string",
11
+ "format": "date-time",
12
+ "description": "When the config was fetched"
13
+ },
14
+ "configVersion": {
15
+ "type": "string",
16
+ "description": "Version string for cache invalidation"
17
+ },
18
+ "canvasTitle": {
19
+ "type": "string",
20
+ "description": "Display title for the canvas"
21
+ },
22
+ "tiles": {
23
+ "type": "array",
24
+ "description": "Tiles to display in the canvas drawer",
25
+ "items": { "$ref": "#/$defs/tile" }
26
+ },
27
+ "actions": {
28
+ "type": "array",
29
+ "description": "Actions to execute. This is the unified intervention format - every DOM change, tooltip, highlight, or modal is an ActionStep.",
30
+ "items": { "$ref": "#/$defs/actionStep" }
31
+ },
32
+ "theme": {
33
+ "$ref": "#/$defs/themeConfig",
34
+ "description": "Theme configuration"
35
+ },
36
+ "launcher": {
37
+ "$ref": "#/$defs/launcherConfig",
38
+ "description": "Launcher button configuration"
39
+ },
40
+ "routes": {
41
+ "$ref": "#/$defs/routesConfig",
42
+ "description": "Route filtering"
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "$defs": {
47
+ "tile": {
48
+ "type": "object",
49
+ "required": ["id", "widget"],
50
+ "properties": {
51
+ "id": { "type": "string" },
52
+ "title": { "type": "string" },
53
+ "priority": { "type": "number" },
54
+ "widget": { "type": "string" },
55
+ "props": { "type": "object" },
56
+ "notifications": {
57
+ "type": "array",
58
+ "description": "Declarative rules mapping EventBus events to toast notifications",
59
+ "items": {
60
+ "type": "object",
61
+ "required": ["on", "title"],
62
+ "properties": {
63
+ "on": { "type": "string", "description": "EventBus event name (exact or regex)" },
64
+ "title": { "type": "string", "description": "Toast title (supports {{props.x}})" },
65
+ "body": { "type": "string", "description": "Toast body (supports {{props.x}})" },
66
+ "icon": { "type": "string", "description": "Icon name or emoji" },
67
+ "ttl": {
68
+ "type": "number",
69
+ "description": "Auto-dismiss ms (default 8000)",
70
+ "default": 8000
71
+ },
72
+ "cooldown": {
73
+ "type": "number",
74
+ "description": "Cooldown ms (default 30000)",
75
+ "default": 30000
76
+ },
77
+ "deepLink": {
78
+ "type": "object",
79
+ "properties": {
80
+ "tileId": { "type": "string" },
81
+ "itemId": { "type": "string", "description": "Supports {{props.x}}" }
82
+ },
83
+ "required": ["tileId"]
84
+ }
85
+ },
86
+ "additionalProperties": false
87
+ }
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ },
92
+ "actionStep": {
93
+ "oneOf": []
94
+ },
95
+ "themeConfig": {
96
+ "type": "object",
97
+ "properties": {
98
+ "name": { "type": "string" },
99
+ "mode": { "type": "string", "enum": ["dark", "light"] },
100
+ "position": { "type": "string", "enum": ["left", "right"] },
101
+ "colorPrimary": { "type": "string" },
102
+ "colorBackground": { "type": "string" },
103
+ "colorText": { "type": "string" },
104
+ "borderRadius": { "type": "string" }
105
+ },
106
+ "additionalProperties": false
107
+ },
108
+ "launcherConfig": {
109
+ "type": "object",
110
+ "properties": {
111
+ "enabled": { "type": "boolean" },
112
+ "label": { "type": "string" },
113
+ "position": { "type": "string" }
114
+ },
115
+ "additionalProperties": false
116
+ },
117
+ "routesConfig": {
118
+ "type": "object",
119
+ "properties": {
120
+ "exclude": {
121
+ "type": "array",
122
+ "items": { "type": "string" }
123
+ },
124
+ "include": {
125
+ "type": "array",
126
+ "items": { "type": "string" }
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ },
131
+ "activationConfig": {
132
+ "type": "object",
133
+ "description": "Activation configuration for conditional tile rendering",
134
+ "properties": {
135
+ "routes": { "$ref": "#/$defs/routeFilter" },
136
+ "strategy": { "$ref": "#/$defs/decisionStrategy" }
137
+ },
138
+ "additionalProperties": false
139
+ },
140
+ "routeFilter": {
141
+ "type": "object",
142
+ "properties": {
143
+ "include": {
144
+ "type": "array",
145
+ "items": { "type": "string" },
146
+ "description": "Routes where the tile should appear"
147
+ },
148
+ "exclude": {
149
+ "type": "array",
150
+ "items": { "type": "string" },
151
+ "description": "Routes where the tile should NOT appear"
152
+ }
153
+ },
154
+ "additionalProperties": false
155
+ },
156
+ "decisionStrategy": {
157
+ "oneOf": [
158
+ { "$ref": "#/$defs/ruleStrategy" },
159
+ { "$ref": "#/$defs/scoreStrategy" },
160
+ { "$ref": "#/$defs/modelStrategy" },
161
+ { "$ref": "#/$defs/externalStrategy" }
162
+ ]
163
+ },
164
+ "ruleStrategy": {
165
+ "type": "object",
166
+ "required": ["type", "rules", "default"],
167
+ "properties": {
168
+ "type": { "const": "rules" },
169
+ "rules": {
170
+ "type": "array",
171
+ "items": { "$ref": "#/$defs/rule" }
172
+ },
173
+ "default": {}
174
+ },
175
+ "additionalProperties": false
176
+ },
177
+ "scoreStrategy": {
178
+ "type": "object",
179
+ "required": ["type", "field", "threshold", "above", "below"],
180
+ "properties": {
181
+ "type": { "const": "score" },
182
+ "field": { "type": "string" },
183
+ "threshold": { "type": "number" },
184
+ "above": {},
185
+ "below": {}
186
+ },
187
+ "additionalProperties": false
188
+ },
189
+ "modelStrategy": {
190
+ "type": "object",
191
+ "required": ["type", "modelId", "inputs", "outputMapping", "default"],
192
+ "properties": {
193
+ "type": { "const": "model" },
194
+ "modelId": { "type": "string" },
195
+ "inputs": { "type": "array", "items": { "type": "string" } },
196
+ "outputMapping": { "type": "object" },
197
+ "default": {}
198
+ },
199
+ "additionalProperties": false
200
+ },
201
+ "externalStrategy": {
202
+ "type": "object",
203
+ "required": ["type", "endpoint", "default"],
204
+ "properties": {
205
+ "type": { "const": "external" },
206
+ "endpoint": { "type": "string" },
207
+ "method": { "enum": ["GET", "POST"] },
208
+ "default": {},
209
+ "timeoutMs": { "type": "number" }
210
+ },
211
+ "additionalProperties": false
212
+ },
213
+ "rule": {
214
+ "type": "object",
215
+ "required": ["conditions", "value"],
216
+ "properties": {
217
+ "conditions": {
218
+ "type": "array",
219
+ "items": { "$ref": "#/$defs/condition" }
220
+ },
221
+ "value": {}
222
+ },
223
+ "additionalProperties": false
224
+ },
225
+ "condition": {
226
+ "oneOf": [
227
+ {
228
+ "type": "object",
229
+ "required": ["type", "url"],
230
+ "properties": {
231
+ "type": { "const": "page_url" },
232
+ "url": { "type": "string" }
233
+ },
234
+ "additionalProperties": false
235
+ },
236
+ {
237
+ "type": "object",
238
+ "required": ["type", "routeId"],
239
+ "properties": {
240
+ "type": { "const": "route" },
241
+ "routeId": { "type": "string" }
242
+ },
243
+ "additionalProperties": false
244
+ },
245
+ {
246
+ "type": "object",
247
+ "required": ["type", "anchorId", "state"],
248
+ "properties": {
249
+ "type": { "const": "anchor_visible" },
250
+ "anchorId": { "type": "string" },
251
+ "state": { "enum": ["visible", "present", "absent"] }
252
+ },
253
+ "additionalProperties": false
254
+ },
255
+ {
256
+ "type": "object",
257
+ "required": ["type", "eventName"],
258
+ "properties": {
259
+ "type": { "const": "event_occurred" },
260
+ "eventName": { "type": "string" },
261
+ "withinMs": { "type": "number" }
262
+ },
263
+ "additionalProperties": false
264
+ },
265
+ {
266
+ "type": "object",
267
+ "required": ["type", "key"],
268
+ "properties": {
269
+ "type": { "const": "state_equals" },
270
+ "key": { "type": "string" },
271
+ "value": {}
272
+ },
273
+ "additionalProperties": false
274
+ },
275
+ {
276
+ "type": "object",
277
+ "required": ["type"],
278
+ "properties": {
279
+ "type": { "const": "viewport" },
280
+ "minWidth": { "type": "number" },
281
+ "maxWidth": { "type": "number" },
282
+ "minHeight": { "type": "number" },
283
+ "maxHeight": { "type": "number" }
284
+ },
285
+ "additionalProperties": false
286
+ },
287
+ {
288
+ "type": "object",
289
+ "required": ["type", "key", "operator", "threshold"],
290
+ "properties": {
291
+ "type": { "const": "session_metric" },
292
+ "key": { "type": "string" },
293
+ "operator": { "enum": ["gte", "lte", "eq", "gt", "lt"] },
294
+ "threshold": { "type": "number" }
295
+ },
296
+ "additionalProperties": false
297
+ },
298
+ {
299
+ "type": "object",
300
+ "required": ["type", "key"],
301
+ "properties": {
302
+ "type": { "const": "dismissed" },
303
+ "key": { "type": "string" },
304
+ "inverted": { "type": "boolean" }
305
+ },
306
+ "additionalProperties": false
307
+ },
308
+ {
309
+ "type": "object",
310
+ "required": ["type", "key"],
311
+ "properties": {
312
+ "type": { "const": "cooldown_active" },
313
+ "key": { "type": "string" },
314
+ "inverted": { "type": "boolean" }
315
+ },
316
+ "additionalProperties": false
317
+ },
318
+ {
319
+ "type": "object",
320
+ "required": ["type", "key", "limit"],
321
+ "properties": {
322
+ "type": { "const": "frequency_limit" },
323
+ "key": { "type": "string" },
324
+ "limit": { "type": "number" },
325
+ "inverted": { "type": "boolean" }
326
+ },
327
+ "additionalProperties": false
328
+ },
329
+ {
330
+ "type": "object",
331
+ "required": ["type", "key", "operator", "count"],
332
+ "properties": {
333
+ "type": { "const": "event_count" },
334
+ "key": {
335
+ "type": "string",
336
+ "description": "Key referencing a callback registered by the adaptive via accumulator.register()"
337
+ },
338
+ "operator": { "enum": ["gte", "lte", "eq", "gt", "lt"] },
339
+ "count": { "type": "integer", "minimum": 0 },
340
+ "withinMs": {
341
+ "type": "number",
342
+ "exclusiveMinimum": 0,
343
+ "description": "Only count events within this time window (ms). Omit = session lifetime."
344
+ }
345
+ },
346
+ "additionalProperties": false
347
+ }
348
+ ]
349
+ }
350
+ }
351
+ }