@syntrologie/runtime-sdk 2.3.0 → 2.4.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 (36) hide show
  1. package/dist/actions/schema.js +2 -1
  2. package/dist/chunk-BIYMC56J.js +165 -0
  3. package/dist/chunk-BIYMC56J.js.map +7 -0
  4. package/dist/{chunk-AYTRRBR5.js → chunk-DOJR7R46.js} +1 -16
  5. package/dist/{chunk-AYTRRBR5.js.map → chunk-DOJR7R46.js.map} +1 -1
  6. package/dist/chunk-JMHRHAEL.js +18 -0
  7. package/dist/chunk-JMHRHAEL.js.map +7 -0
  8. package/dist/{chunk-RUKIPJEJ.js → chunk-ZDZ3IYFN.js} +16 -41
  9. package/dist/chunk-ZDZ3IYFN.js.map +7 -0
  10. package/dist/config/schema.d.ts +4107 -0
  11. package/dist/config/schema.js +73 -0
  12. package/dist/config/schema.js.map +7 -0
  13. package/dist/context/ContextManager.d.ts +3 -3
  14. package/dist/context/types.d.ts +1 -1
  15. package/dist/decisions/schema.d.ts +1487 -49
  16. package/dist/decisions/schema.js +54 -0
  17. package/dist/decisions/schema.js.map +7 -0
  18. package/dist/decisions/types.d.ts +1 -1
  19. package/dist/hooks/useShadowCanvasConfig.d.ts +1 -3
  20. package/dist/index.js +48 -149
  21. package/dist/index.js.map +4 -4
  22. package/dist/react.js +3 -2
  23. package/dist/react.js.map +1 -1
  24. package/dist/runtime.d.ts +4 -4
  25. package/dist/smart-canvas.esm.js +27 -27
  26. package/dist/smart-canvas.esm.js.map +3 -3
  27. package/dist/smart-canvas.js +22 -36
  28. package/dist/smart-canvas.js.map +3 -3
  29. package/dist/smart-canvas.min.js +27 -27
  30. package/dist/smart-canvas.min.js.map +3 -3
  31. package/dist/types.d.ts +17 -76
  32. package/dist/version.d.ts +1 -1
  33. package/package.json +7 -7
  34. package/schema/canvas-config.schema.json +2044 -299
  35. package/dist/chunk-RUKIPJEJ.js.map +0 -7
  36. package/schema/canvas-config.base.schema.json +0 -351
package/dist/types.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ import type { z } from 'zod';
1
2
  import type { ActionStep } from './actions/types';
2
- import type { TileNotificationRule } from './notifications/types';
3
+ import type { CanvasConfigResponseZ, CanvasThemeConfigZ, LauncherConfigZ, TileZ } from './config/schema';
4
+ import type { ActivationConfig } from './decisions/types';
3
5
  export { SDK_VERSION } from './version';
4
6
  /**
5
7
  * SDK schema version in Major.Minor format (e.g., "2.0", "2.1").
@@ -206,85 +208,24 @@ export interface TableContent {
206
208
  export type DataContent = StatsContent | ComparisonContent | ChartContent | TableContent;
207
209
  export type { ActivationConfig, DecisionStrategy, RouteFilter } from './decisions/types';
208
210
  /**
209
- * Full tile configuration.
210
- *
211
- * Each tile delegates its rendering to a registered widget in the WidgetRegistry.
212
- * The `widget` field is the widget ID (e.g., "faq:panel", "chatbot:main").
213
- * The `props` field is passed through to the widget's mount() call.
214
- */
215
- export interface TileConfig {
216
- id: string;
217
- title?: string;
218
- priority?: number;
219
- widget: string;
220
- props?: Record<string, unknown>;
221
- /** Declarative rules that map EventBus events to toast notifications */
222
- notifications?: TileNotificationRule[];
223
- }
224
- /**
225
- * Theme configuration for the SmartCanvas overlay.
226
- */
227
- export interface CanvasThemeConfig {
228
- name?: string;
229
- description?: string;
230
- mode?: 'dark' | 'light';
231
- colorPrimary?: string;
232
- colorBackground?: string;
233
- colorText?: string;
234
- colorTextSecondary?: string;
235
- borderRadius?: string;
236
- position?: 'left' | 'right';
237
- }
238
- /**
239
- * Launcher button configuration.
240
- */
241
- export interface LauncherConfig {
242
- label?: string;
243
- animate?: boolean;
244
- animationStyle?: 'pulse' | 'bounce' | 'glow';
245
- notificationCount?: number;
246
- }
247
- /**
248
- * Route filtering - control where canvas appears.
211
+ * Full tile configuration. Inferred from TileZ in config/schema.ts.
212
+ * The `activation` field is overridden with the generic-typed ActivationConfig
213
+ * from decisions/types.ts since Zod can't express TypeScript generics.
249
214
  */
250
- export interface RoutesConfig {
251
- exclude?: string[];
252
- include?: string[];
253
- }
215
+ export type TileConfig = Omit<z.infer<typeof TileZ>, 'activation'> & {
216
+ activation?: ActivationConfig;
217
+ };
218
+ /** Theme configuration. Inferred from CanvasThemeConfigZ in config/schema.ts. */
219
+ export type CanvasThemeConfig = z.infer<typeof CanvasThemeConfigZ>;
220
+ /** Launcher button configuration. Inferred from LauncherConfigZ in config/schema.ts. */
221
+ export type LauncherConfig = z.infer<typeof LauncherConfigZ>;
254
222
  /**
255
223
  * Canvas configuration response.
256
- *
257
- * This is the complete config format. Actions are the single mechanism
258
- * for all interventions: DOM modifications, tooltips, highlights, modals.
224
+ * Inferred from CanvasConfigResponseZ, with actions narrowed to ActionStep[].
225
+ * (Zod uses z.any() for actions since the union is resolved at schema generation time.)
259
226
  */
260
- export interface CanvasConfigResponse {
261
- /**
262
- * Schema version this config conforms to (e.g., "2.0", "2.1").
263
- * Used for compatibility checking and automatic migration between versions.
264
- * If omitted, defaults to "1.0" for backwards compatibility.
265
- *
266
- * @since 2.0.0
267
- */
268
- schemaVersion?: string;
269
- /** Tiles to display in the canvas drawer */
227
+ export type CanvasConfigResponse = Omit<z.infer<typeof CanvasConfigResponseZ>, 'actions' | 'tiles'> & {
270
228
  tiles: TileConfig[];
271
- /**
272
- * Actions to execute.
273
- * This is the unified intervention format. Every DOM change, tooltip,
274
- * highlight, or modal is an ActionStep.
275
- */
276
229
  actions: ActionStep[];
277
- /** When the config was fetched */
278
- fetchedAt: string;
279
- /** Optional version string for cache invalidation */
280
- configVersion?: string;
281
- /** Display title for the canvas */
282
- canvasTitle?: string;
283
- /** Theme configuration */
284
- theme?: CanvasThemeConfig;
285
- /** Launcher button configuration */
286
- launcher?: LauncherConfig;
287
- /** Route filtering */
288
- routes?: RoutesConfig;
289
- }
230
+ };
290
231
  export type CanvasConfigFetcher = () => Promise<CanvasConfigResponse>;
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.3.0";
13
+ export declare const SDK_VERSION = "2.4.0-canary.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/runtime-sdk",
3
- "version": "2.3.0",
3
+ "version": "2.4.0-canary.2",
4
4
  "description": "Syntrologie Runtime SDK for web experimentation and analytics",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -67,12 +67,12 @@
67
67
  "@floating-ui/dom": "^1.7.5",
68
68
  "@growthbook/growthbook": "~1.6.2",
69
69
  "@growthbook/growthbook-react": "^1.6.4",
70
- "@syntrologie/adapt-chatbot": "2.3.0",
71
- "@syntrologie/adapt-content": "2.3.0",
72
- "@syntrologie/adapt-faq": "2.3.0",
73
- "@syntrologie/adapt-gamification": "2.3.0",
74
- "@syntrologie/adapt-nav": "2.3.0",
75
- "@syntrologie/adapt-overlays": "2.3.0",
70
+ "@syntrologie/adapt-chatbot": "2.4.0-canary.2",
71
+ "@syntrologie/adapt-content": "2.4.0-canary.2",
72
+ "@syntrologie/adapt-faq": "2.4.0-canary.2",
73
+ "@syntrologie/adapt-gamification": "2.4.0-canary.2",
74
+ "@syntrologie/adapt-nav": "2.4.0-canary.2",
75
+ "@syntrologie/adapt-overlays": "2.4.0-canary.2",
76
76
  "posthog-js": "~1.302.2",
77
77
  "zod": "^3.25.76"
78
78
  },