@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
@@ -10,10 +10,12 @@ export interface CanvasFetcherOptions {
10
10
  manifestKey?: string;
11
11
  /** Prefix for variant flag discovery */
12
12
  variantFlagPrefix?: string;
13
+ /** SDK version for offline config caching. When set, enables localStorage caching. */
14
+ sdkVersion?: string;
13
15
  }
14
16
  export declare const resolveConfigUri: ({ configUri, experiments, featureKey, }: {
15
17
  configUri?: string;
16
18
  experiments?: ExperimentClient;
17
19
  featureKey?: string;
18
20
  }) => string | undefined;
19
- export declare const createCanvasConfigFetcher: ({ configUri, experiments, featureKey, credentials, configFeatureKey, manifestKey, variantFlagPrefix, }: CanvasFetcherOptions) => CanvasConfigFetcher;
21
+ export declare const createCanvasConfigFetcher: ({ configUri, experiments, featureKey, credentials, configFeatureKey, manifestKey, variantFlagPrefix, sdkVersion, }: CanvasFetcherOptions) => CanvasConfigFetcher;
@@ -6,6 +6,7 @@
6
6
  * - Notifying subscribers when context changes
7
7
  * - Providing the current context snapshot
8
8
  */
9
+ import type { NavigationMonitor } from '../navigation/NavigationMonitor';
9
10
  import type { TelemetryClient } from '../telemetry/types';
10
11
  import type { RoutesConfig } from '../types';
11
12
  import type { AnchorState, ContextChangeCallback, PageHistoryEntry, RuntimeContext, Unsubscribe } from './types';
@@ -16,6 +17,8 @@ export interface ContextManagerOptions {
16
17
  routes?: RoutesConfig;
17
18
  /** Initial page history (optional) */
18
19
  initialPageHistory?: PageHistoryEntry[];
20
+ /** Centralized navigation monitor (replaces direct History API patching) */
21
+ navigation?: NavigationMonitor;
19
22
  }
20
23
  /**
21
24
  * ContextManager class for managing runtime context.
@@ -26,6 +29,7 @@ export declare class ContextManager {
26
29
  private listeners;
27
30
  private telemetry?;
28
31
  private routes?;
32
+ private navigation?;
29
33
  private cleanupFns;
30
34
  constructor(options?: ContextManagerOptions);
31
35
  /**
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Service Worker Compatibility Diagnostic
3
+ *
4
+ * Detects active service workers that may interfere with SDK
5
+ * script loading or caching behavior on PWA sites.
6
+ */
7
+ export interface ServiceWorkerDiagnostics {
8
+ /** Whether the browser supports service workers */
9
+ supported: boolean;
10
+ /** Whether a service worker controller is active */
11
+ controllerActive: boolean;
12
+ /** Warning message if service worker detected */
13
+ warning?: string;
14
+ /** Registration scope if found */
15
+ scope?: string;
16
+ /** Error message if detection failed */
17
+ error?: string;
18
+ }
19
+ /**
20
+ * Check for active service workers and return diagnostics.
21
+ * This is async because getRegistration() returns a promise.
22
+ */
23
+ export declare function checkServiceWorker(): Promise<ServiceWorkerDiagnostics>;
@@ -9,9 +9,15 @@ export interface EditorConf {
9
9
  audit_session_id?: string;
10
10
  [key: string]: unknown;
11
11
  }
12
- /** Get decoded editor_source from URL or global (cached). */
12
+ /**
13
+ * Reset the editor params cache, forcing re-evaluation on next access.
14
+ * Called by the Chrome extension after restoring URL params via replaceState,
15
+ * or in tests to simulate fresh state without module reloading.
16
+ */
17
+ export declare function resetEditorParamsCache(): void;
18
+ /** Get decoded editor_source from URL or global (re-evaluates on null). */
13
19
  export declare function getEditorSource(): EditorSource | null;
14
- /** Get decoded editor_conf from URL or global (cached). */
20
+ /** Get decoded editor_conf from URL or global (re-evaluates on null). */
15
21
  export declare function getEditorConf(): EditorConf | null;
16
22
  /**
17
23
  * Checks if the editor should be loaded.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export declare const RUNTIME_SDK_BUILD: string;
1
2
  export * from './api';
2
3
  export * from './components/ShadowCanvasOverlay';
3
4
  export * from './components/TileCard';
@@ -24,6 +25,8 @@ export * from './context';
24
25
  export * from './decisions';
25
26
  export * from './events';
26
27
  export * from './events';
28
+ export type { NavigationDiagnostics, NavigationListener } from './navigation/NavigationMonitor';
29
+ export { NavigationMonitor } from './navigation/NavigationMonitor';
27
30
  export * from './notifications';
28
31
  export { RuntimeProvider, useDecision, usePageContext, useRuntime, useRuntimeContext, useRuntimeEvents, useRuntimeState, useSessionContext, useViewportContext, } from './RuntimeProvider';
29
32
  export type { RuntimeMode, SmartCanvasRuntime, SmartCanvasRuntimeOptions } from './runtime';