@syntrologie/runtime-sdk 2.2.0-canary.8 → 2.2.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 (45) hide show
  1. package/README.md +2 -1
  2. package/dist/actions/types.d.ts +7 -0
  3. package/dist/antiFlicker.d.ts +2 -0
  4. package/dist/apps/builtinRuntimeModules.generated.d.ts +20 -0
  5. package/dist/{chunk-MEBUEMEZ.js → chunk-V4MDQX67.js} +2868 -1417
  6. package/dist/chunk-V4MDQX67.js.map +7 -0
  7. package/dist/configFetcher.d.ts +3 -1
  8. package/dist/context/ContextManager.d.ts +4 -0
  9. package/dist/diagnostics/service-worker-check.d.ts +23 -0
  10. package/dist/editorLoader.d.ts +8 -2
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +1563 -12
  13. package/dist/index.js.map +4 -4
  14. package/dist/integrations/gtm-bridge.d.ts +36 -0
  15. package/dist/navigation/NavigationMonitor.d.ts +45 -0
  16. package/dist/overlays/runtime/utils/AnchorWatcher.d.ts +22 -0
  17. package/dist/overlays/types.d.ts +2 -0
  18. package/dist/react.js +1 -1
  19. package/dist/runtime.d.ts +3 -0
  20. package/dist/smart-canvas.esm.js +62 -36
  21. package/dist/smart-canvas.esm.js.map +4 -4
  22. package/dist/smart-canvas.js +15828 -23049
  23. package/dist/smart-canvas.js.map +4 -4
  24. package/dist/smart-canvas.min.js +62 -36
  25. package/dist/smart-canvas.min.js.map +4 -4
  26. package/dist/telemetry/adapters/posthog.d.ts +19 -0
  27. package/dist/telemetry/consent.d.ts +62 -0
  28. package/dist/version.d.ts +1 -1
  29. package/dist/widgets/WidgetRegistry.d.ts +10 -0
  30. package/package.json +13 -4
  31. package/schema/canvas-config.schema.json +124 -22
  32. package/scripts/syntroReactPlugin.mjs +113 -0
  33. package/dist/adaptives/adaptive-chatbot/index.js +0 -9
  34. package/dist/adaptives/adaptive-chatbot/index.js.map +0 -7
  35. package/dist/adaptives/adaptive-content/index.js +0 -22
  36. package/dist/adaptives/adaptive-content/index.js.map +0 -7
  37. package/dist/adaptives/adaptive-faq/index.js +0 -28
  38. package/dist/adaptives/adaptive-faq/index.js.map +0 -7
  39. package/dist/adaptives/adaptive-gamification/index.js +0 -2
  40. package/dist/adaptives/adaptive-gamification/index.js.map +0 -7
  41. package/dist/adaptives/adaptive-nav/index.js +0 -27
  42. package/dist/adaptives/adaptive-nav/index.js.map +0 -7
  43. package/dist/adaptives/adaptive-overlays/index.js +0 -94
  44. package/dist/adaptives/adaptive-overlays/index.js.map +0 -7
  45. package/dist/chunk-MEBUEMEZ.js.map +0 -7
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smart Canvas Runtime SDK
2
2
 
3
- ## Smart Canvas Runtime SDK (React + Shadow DOM)
3
+ ## Runtime SDK (React + Shadow DOM)
4
4
 
5
5
  The SDK ships a framework-agnostic `<smart-canvas>` custom element with an **open shadow root**. We render everything with React, but the canvas is encapsulated so host Tailwind configs, resets, or stacking contexts can't break the UI.
6
6
 
@@ -12,6 +12,7 @@ The SDK ships a framework-agnostic `<smart-canvas>` custom element with an **ope
12
12
  - `createSmartCanvas` – imperative API (`window.SmartCanvas.create`) for non-React hosts.
13
13
  - **ActionEngine** – unified execution layer for interventions (highlight, tooltip, badge, DOM modifications)
14
14
  - **Surfaces** – managed surface system for rendering UI into named slots
15
+ - **v2 Runtime** – context, events, state, and decisions modules for activation-based rendering
15
16
  - GrowthBook/PostHog wrappers, hooks, rectangle components, and wheel remain available.
16
17
 
17
18
  ---
@@ -306,6 +306,11 @@ export interface ExecutorContext {
306
306
  * Returns an unsubscribe function.
307
307
  */
308
308
  subscribeEvent?: (name: string, callback: (props?: Record<string, unknown>) => void) => () => void;
309
+ /**
310
+ * Subscribe to navigation changes (pushState, replaceState, popstate).
311
+ * Provided by NavigationMonitor. Returns an unsubscribe function.
312
+ */
313
+ subscribeNavigation?: (callback: (url: string, method: string) => void) => () => void;
309
314
  }
310
315
  /** Executor registry interface (subset needed by ActionEngine) */
311
316
  export interface ActionEngineExecutorRegistry {
@@ -337,6 +342,8 @@ export interface ActionEngineOptions {
337
342
  adaptiveId?: string;
338
343
  /** Optional executor registry (uses default singleton if not provided) */
339
344
  executorRegistry?: ActionEngineExecutorRegistry;
345
+ /** Subscribe to navigation changes (from NavigationMonitor) */
346
+ subscribeNavigation?: (callback: (url: string, method: string) => void) => () => void;
340
347
  }
341
348
  /** The ActionEngine interface */
342
349
  export interface ActionEngine {
@@ -5,6 +5,8 @@ export interface AntiFlickerConfig {
5
5
  timeout?: number;
6
6
  className?: string;
7
7
  style?: string;
8
+ hostLoadingSelector?: string;
9
+ waitForHostReady?: string;
8
10
  }
9
11
  export declare function initAntiFlicker(config?: AntiFlickerConfig): () => void;
10
12
  export declare function getAntiFlickerSnippet(config?: AntiFlickerConfig): string;
@@ -0,0 +1,20 @@
1
+ export declare const builtinAdaptiveManifests: {
2
+ id: any;
3
+ version: any;
4
+ name: any;
5
+ description: any;
6
+ runtime: {
7
+ actions: any;
8
+ widgets: any;
9
+ notifyWatchers: any;
10
+ events: any;
11
+ };
12
+ editor: undefined;
13
+ metadata: {
14
+ isBuiltIn: boolean;
15
+ };
16
+ }[];
17
+ export declare function registerBuiltinRuntimeModules(registry: {
18
+ has: (id: string) => boolean;
19
+ register: (manifest: any) => void;
20
+ }): void;