@syntrologie/runtime-sdk 2.8.0-canary.13 → 2.8.0-canary.130

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 (106) hide show
  1. package/CAPABILITIES.md +321 -173
  2. package/README.md +3 -0
  3. package/dist/SmartCanvasApp.d.ts +4 -1
  4. package/dist/SmartCanvasElementLit.d.ts +166 -0
  5. package/dist/actions/schema.d.ts +783 -783
  6. package/dist/actions/schema.js +3 -3
  7. package/dist/actions/types.d.ts +9 -3
  8. package/dist/actions/validation-core.d.ts +24 -0
  9. package/dist/actions/validation-rules.d.ts +74 -0
  10. package/dist/actions/validation.d.ts +5 -11
  11. package/dist/anchor/AnchorResolver.d.ts +1 -0
  12. package/dist/api-lit.d.ts +84 -0
  13. package/dist/api.d.ts +3 -0
  14. package/dist/apps/builtinRuntimeModules-lit.d.ts +20 -0
  15. package/dist/bootstrap-init.d.ts +35 -0
  16. package/dist/bootstrap-runtime.d.ts +7 -0
  17. package/dist/bootstrap-types.d.ts +100 -0
  18. package/dist/bootstrap.d.ts +19 -83
  19. package/dist/chunk-2IQ2PTLJ.js +871 -0
  20. package/dist/chunk-2IQ2PTLJ.js.map +7 -0
  21. package/dist/chunk-4HXPGXUC.js +226 -0
  22. package/dist/chunk-4HXPGXUC.js.map +7 -0
  23. package/dist/{chunk-37TTQRH5.js → chunk-GX7BBYX6.js} +4 -4
  24. package/dist/chunk-GX7BBYX6.js.map +7 -0
  25. package/dist/{chunk-G4PH7C7H.js → chunk-SC5B3YCG.js} +2702 -1442
  26. package/dist/chunk-SC5B3YCG.js.map +7 -0
  27. package/dist/{chunk-NBFQGKSV.js → chunk-XVRDKBYF.js} +4 -4
  28. package/dist/{chunk-NBFQGKSV.js.map → chunk-XVRDKBYF.js.map} +2 -2
  29. package/dist/components/ShadowCanvasOverlay.d.ts +1 -2
  30. package/dist/components/SyntroCanvasOverlay.d.ts +100 -0
  31. package/dist/components/SyntroDrawer.d.ts +110 -0
  32. package/dist/components/SyntroLauncher.d.ts +105 -0
  33. package/dist/components/SyntroTileCard.d.ts +74 -0
  34. package/dist/components/SyntroTileWheel.d.ts +51 -0
  35. package/dist/config/schema.d.ts +147 -136
  36. package/dist/config/schema.js +2 -2
  37. package/dist/controllers/DecisionController.d.ts +48 -0
  38. package/dist/controllers/NotificationsController.d.ts +59 -0
  39. package/dist/controllers/RuntimeController.d.ts +52 -0
  40. package/dist/controllers/RuntimeEventsController.d.ts +42 -0
  41. package/dist/controllers/ThemeController.d.ts +110 -0
  42. package/dist/controllers/index.d.ts +13 -0
  43. package/dist/decisions/schema.d.ts +47 -47
  44. package/dist/decisions/schema.js +1 -1
  45. package/dist/decisions/types.d.ts +4 -0
  46. package/dist/editorLoader.d.ts +5 -0
  47. package/dist/events/EventBus.d.ts +27 -1
  48. package/dist/events/history.d.ts +9 -0
  49. package/dist/events/index.d.ts +3 -0
  50. package/dist/events/types.d.ts +24 -0
  51. package/dist/events/validation.d.ts +7 -0
  52. package/dist/fetchers/experimentsFetcher.d.ts +3 -3
  53. package/dist/fetchers/mergeConfigs.d.ts +7 -7
  54. package/dist/index-lit.d.ts +40 -0
  55. package/dist/index.d.ts +1 -2
  56. package/dist/index.js +2435 -2022
  57. package/dist/index.js.map +4 -4
  58. package/dist/interop/LitInReact.d.ts +27 -0
  59. package/dist/interop/ReactInLit.d.ts +42 -0
  60. package/dist/interop/index.d.ts +7 -0
  61. package/dist/metrics/sessionMetrics.d.ts +4 -0
  62. package/dist/notifications/SyntroToastStack.d.ts +43 -0
  63. package/dist/overlays/runtime/overlay/overlay-runner.d.ts +4 -0
  64. package/dist/overlays/runtime/overlay/overlay-state.d.ts +21 -0
  65. package/dist/overlays/types.d.ts +3 -1
  66. package/dist/platform/PlatformAdapter.d.ts +46 -0
  67. package/dist/platform/ShopifyAdapter.d.ts +36 -0
  68. package/dist/platform/ShopifyAnchorResolver.d.ts +31 -0
  69. package/dist/platform/ShopifyAntiFlicker.d.ts +21 -0
  70. package/dist/platform/ShopifyPixelBridge.d.ts +37 -0
  71. package/dist/platform/detect.d.ts +9 -0
  72. package/dist/platform/index.d.ts +10 -0
  73. package/dist/platform/shopify-cookie-contract.d.ts +39 -0
  74. package/dist/react-compat.d.ts +114 -0
  75. package/dist/react.js +7 -4
  76. package/dist/react.js.map +2 -2
  77. package/dist/shopify-pixel-entry.d.ts +68 -0
  78. package/dist/shopify-pixel.js +77 -0
  79. package/dist/shopify-pixel.js.map +7 -0
  80. package/dist/shopify-pixel.min.js +2 -0
  81. package/dist/shopify-pixel.min.js.map +7 -0
  82. package/dist/smart-canvas.esm.js +858 -258
  83. package/dist/smart-canvas.esm.js.map +4 -4
  84. package/dist/smart-canvas.js +28024 -36411
  85. package/dist/smart-canvas.js.map +4 -4
  86. package/dist/smart-canvas.min.js +857 -258
  87. package/dist/smart-canvas.min.js.map +4 -4
  88. package/dist/telemetry/InterventionTracker.d.ts +23 -0
  89. package/dist/telemetry/adapters/posthog.d.ts +5 -10
  90. package/dist/telemetry/index.d.ts +1 -0
  91. package/dist/test/setup.d.ts +1 -0
  92. package/dist/theme/index.js +30 -0
  93. package/dist/theme/index.js.map +7 -0
  94. package/dist/token.d.ts +2 -0
  95. package/dist/version.d.ts +1 -1
  96. package/package.json +32 -29
  97. package/schema/canvas-config.schema.json +2345 -11394
  98. package/scripts/syntroReactPlugin.mjs +3 -0
  99. package/scripts/validate-config.mjs +42 -0
  100. package/dist/chunk-37TTQRH5.js.map +0 -7
  101. package/dist/chunk-G4PH7C7H.js.map +0 -7
  102. package/dist/chunk-Q77NT67W.js +0 -203
  103. package/dist/chunk-Q77NT67W.js.map +0 -7
  104. package/dist/replayMirror-QZ3GQ527.js +0 -32
  105. package/dist/replayMirror-QZ3GQ527.js.map +0 -7
  106. package/dist/telemetry/replayMirror.d.ts +0 -7
@@ -0,0 +1,23 @@
1
+ import type { TelemetryClient } from './types';
2
+ /**
3
+ * Tracks 4 intervention metrics via PostHog:
4
+ * - served: config delivered to browser
5
+ * - seen: intervention visible in viewport
6
+ * - triggered: activation conditions met
7
+ * - interacted: user clicked/engaged
8
+ *
9
+ * Deduplication: "seen" and "triggered" fire once per intervention per page.
10
+ * "served" fires once per fetch. "interacted" fires every time.
11
+ */
12
+ export declare class InterventionTracker {
13
+ private telemetry;
14
+ private variantId;
15
+ private seenSet;
16
+ private triggeredSet;
17
+ constructor(telemetry: TelemetryClient, variantId: string);
18
+ trackServed(tiles: number, actions: number): void;
19
+ trackSeen(interventionId: string, interventionKind: string): void;
20
+ trackTriggered(interventionId: string, interventionKind: string): void;
21
+ trackInteracted(interventionId: string, interventionKind: string, interactionType: string): void;
22
+ resetPage(): void;
23
+ }
@@ -32,10 +32,12 @@ export interface PostHogAdapterOptions {
32
32
  */
33
33
  sessionRecording?: boolean;
34
34
  /**
35
- * Enable pageview capture.
36
- * @default true
35
+ * Pageview capture mode.
36
+ * - true: capture only on initial page load
37
+ * - 'history_change': auto-capture on SPA navigation (pushState/replaceState)
38
+ * @default "history_change"
37
39
  */
38
- capturePageview?: boolean;
40
+ capturePageview?: boolean | 'history_change';
39
41
  /**
40
42
  * Enable page leave capture.
41
43
  * @default true
@@ -77,12 +79,6 @@ export interface PostHogAdapterOptions {
77
79
  * @default false
78
80
  */
79
81
  behavioralSignals?: boolean | Record<string, number>;
80
- /**
81
- * Endpoint URL to mirror session recording payloads.
82
- * When set, recording requests to PostHog's /s/ endpoint are also
83
- * sent (fire-and-forget) to this URL.
84
- */
85
- replayMirrorEndpoint?: string;
86
82
  /**
87
83
  * Callback for raw rrweb events from session recording.
88
84
  * Called with each rrweb eventWithTime before PostHog processes it.
@@ -103,7 +99,6 @@ export declare class PostHogAdapter implements TelemetryClient {
103
99
  private featureFlagsCallback?;
104
100
  private captureCallback?;
105
101
  private rrwebCallback?;
106
- private consentUnsub?;
107
102
  constructor(options?: PostHogAdapterOptions);
108
103
  /**
109
104
  * Initialize the PostHog client. Called immediately (no consent gate)
@@ -1,4 +1,5 @@
1
1
  export { createNoopClient } from './adapters/noop';
2
2
  export type { PostHogAdapterOptions } from './adapters/posthog';
3
3
  export { createPostHogClient } from './adapters/posthog';
4
+ export { InterventionTracker } from './InterventionTracker';
4
5
  export type { CanvasSurface, TelemetryClient } from './types';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/vitest';
@@ -0,0 +1,30 @@
1
+ import {
2
+ ThemeProvider,
3
+ darkDefaults,
4
+ darkTheme,
5
+ flattenThemeConfig,
6
+ getDefaultTheme,
7
+ lightDefaults,
8
+ lightTheme,
9
+ mergeThemeConfig,
10
+ mergeThemeWithWorkspace,
11
+ themeToCssVariables,
12
+ useTheme,
13
+ withAlpha
14
+ } from "../chunk-2IQ2PTLJ.js";
15
+ import "../chunk-JMHRHAEL.js";
16
+ export {
17
+ ThemeProvider,
18
+ darkDefaults,
19
+ darkTheme,
20
+ flattenThemeConfig,
21
+ getDefaultTheme,
22
+ lightDefaults,
23
+ lightTheme,
24
+ mergeThemeConfig,
25
+ mergeThemeWithWorkspace,
26
+ themeToCssVariables,
27
+ useTheme,
28
+ withAlpha
29
+ };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/dist/token.d.ts CHANGED
@@ -20,6 +20,8 @@ export interface SyntroTokenPayload {
20
20
  f?: string;
21
21
  /** Fetcher-specific options (e.g., configId for cdn fetcher) */
22
22
  o?: Record<string, string>;
23
+ /** Geo worker URL (e.g., "https://dev-geo.syntrologie.com" for dev) */
24
+ g?: string;
23
25
  /** Debug mode - enables console logging (default: false) */
24
26
  d?: boolean;
25
27
  }
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.8.0-canary.13";
13
+ export declare const SDK_VERSION = "2.8.0-canary.130";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/runtime-sdk",
3
- "version": "2.8.0-canary.13",
3
+ "version": "2.8.0-canary.130",
4
4
  "description": "Syntrologie Runtime SDK for web experimentation and analytics",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -27,6 +27,10 @@
27
27
  "types": "./dist/types-only.d.ts",
28
28
  "import": "./dist/types-only.js"
29
29
  },
30
+ "./theme": {
31
+ "types": "./dist/theme/index.d.ts",
32
+ "import": "./dist/theme/index.js"
33
+ },
30
34
  "./react": {
31
35
  "types": "./dist/react.d.ts",
32
36
  "import": "./dist/react.js",
@@ -61,47 +65,46 @@
61
65
  "validate-config": "node ./scripts/validate-config.mjs",
62
66
  "typecheck": "tsc --noEmit -p tsconfig.build.json",
63
67
  "test": "vitest run",
64
- "prepublishOnly": "npm run clean && npm run build"
68
+ "strip-internal-deps": "node ./scripts/strip-internal-deps.mjs",
69
+ "prepublishOnly": "npm run clean && npm run build && npm run strip-internal-deps"
65
70
  },
66
71
  "dependencies": {
67
- "@floating-ui/dom": "^1.7.5",
72
+ "@floating-ui/dom": "1.7.5",
68
73
  "@growthbook/growthbook": "~1.6.2",
69
- "@growthbook/growthbook-react": "^1.6.4",
70
- "@syntrologie/adapt-chatbot": "2.8.0-canary.13",
71
- "@syntrologie/adapt-content": "2.8.0-canary.13",
72
- "@syntrologie/adapt-faq": "2.8.0-canary.13",
73
- "@syntrologie/adapt-gamification": "2.8.0-canary.13",
74
- "@syntrologie/adapt-nav": "2.8.0-canary.13",
75
- "@syntrologie/adapt-overlays": "2.8.0-canary.13",
76
- "@syntrologie/event-processor": "*",
77
- "lucide-react": "^0.576.0",
78
- "posthog-js": "~1.302.2",
79
- "zod": "^3.25.76"
74
+ "@growthbook/growthbook-react": "1.6.4",
75
+ "@lit/context": "1.1.6",
76
+ "@lit/task": "1.0.3",
77
+ "lit": "3.3.2",
78
+ "lucide-react": "0.576.0",
79
+ "posthog-js": "1.341.0",
80
+ "zod": "3.25.76"
80
81
  },
81
82
  "peerDependencies": {
82
83
  "react": ">=18.0.0",
83
84
  "react-dom": ">=18.0.0"
84
85
  },
85
86
  "devDependencies": {
87
+ "@open-wc/testing": "4.0.0",
88
+ "@open-wc/testing-helpers": "3.0.1",
86
89
  "@semantic-release/exec": "~7.1.0",
87
90
  "@semantic-release/github": "~12.0.3",
88
91
  "@semantic-release/npm": "~13.1.3",
89
92
  "@syntro/design-system": "*",
90
- "@testing-library/dom": "^10.4.1",
91
- "@testing-library/jest-dom": "^6.9.1",
92
- "@testing-library/react": "^16.3.2",
93
- "@types/node": "^22.19.7",
94
- "@types/react": "^19.2.0",
95
- "@types/react-dom": "^19.2.0",
96
- "ajv": "^8.18.0",
97
- "ajv-formats": "^3.0.1",
98
- "esbuild": "^0.27.2",
99
- "jsdom": "^26.1.0",
100
- "react": "^19.2.0",
101
- "react-dom": "^19.2.0",
93
+ "@testing-library/dom": "10.4.1",
94
+ "@testing-library/jest-dom": "6.9.1",
95
+ "@testing-library/react": "16.3.2",
96
+ "@types/node": "22.19.7",
97
+ "@types/react": "19.2.14",
98
+ "@types/react-dom": "19.2.3",
99
+ "ajv": "8.18.0",
100
+ "ajv-formats": "3.0.1",
101
+ "esbuild": "0.27.2",
102
+ "jsdom": "26.1.0",
103
+ "react": "19.2.1",
104
+ "react-dom": "19.2.1",
102
105
  "semantic-release": "~25.0.3",
103
- "typescript": "^5.9.3",
104
- "vitest": "^4.0.18",
105
- "zod-to-json-schema": "^3.25.1"
106
+ "typescript": "5.9.3",
107
+ "vitest": "4.0.18",
108
+ "zod-to-json-schema": "3.25.1"
106
109
  }
107
110
  }