@syntrologie/runtime-sdk 2.4.1 → 2.6.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 (62) hide show
  1. package/CAPABILITIES.md +66 -1
  2. package/dist/SmartCanvasApp.d.ts +5 -3
  3. package/dist/actions/executors/index.d.ts +1 -2
  4. package/dist/actions/index.d.ts +2 -2
  5. package/dist/actions/schema.d.ts +19111 -20709
  6. package/dist/actions/schema.js +5 -2
  7. package/dist/actions/types.d.ts +45 -48
  8. package/dist/anchor/AnchorResolver.d.ts +18 -0
  9. package/dist/anchor/index.d.ts +2 -0
  10. package/dist/api.d.ts +3 -8
  11. package/dist/apps/examples/gamification-app.example.d.ts +8 -8
  12. package/dist/{chunk-4NYS7GAW.js → chunk-BU4Z6PD7.js} +45 -7
  13. package/dist/chunk-BU4Z6PD7.js.map +7 -0
  14. package/dist/{chunk-QGWATS3Z.js → chunk-Q4WGXNKC.js} +2775 -1052
  15. package/dist/chunk-Q4WGXNKC.js.map +7 -0
  16. package/dist/{chunk-OGTCFYR3.js → chunk-R5DNAIRI.js} +45 -34
  17. package/dist/chunk-R5DNAIRI.js.map +7 -0
  18. package/dist/chunk-XDYJ64IN.js +178 -0
  19. package/dist/chunk-XDYJ64IN.js.map +7 -0
  20. package/dist/components/ShadowCanvasOverlay.d.ts +2 -20
  21. package/dist/components/TileIcon.d.ts +14 -0
  22. package/dist/config/schema.d.ts +5529 -3620
  23. package/dist/config/schema.js +21 -61
  24. package/dist/config/schema.js.map +3 -3
  25. package/dist/context/schema.d.ts +16 -16
  26. package/dist/decisions/schema.d.ts +357 -2789
  27. package/dist/decisions/schema.js +7 -1
  28. package/dist/decisions/types.d.ts +24 -2
  29. package/dist/events/registerConfigPredicates.d.ts +7 -10
  30. package/dist/events/schema.d.ts +12 -12
  31. package/dist/experiments/adapters/growthbook.d.ts +2 -0
  32. package/dist/experiments/types.d.ts +7 -0
  33. package/dist/hooks/useShadowCanvasConfig.d.ts +6 -4
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +154 -186
  36. package/dist/index.js.map +3 -3
  37. package/dist/overlays/schema.d.ts +70 -70
  38. package/dist/react.js +4 -3
  39. package/dist/react.js.map +1 -1
  40. package/dist/runtime.d.ts +3 -0
  41. package/dist/smart-canvas.esm.js +123 -84
  42. package/dist/smart-canvas.esm.js.map +4 -4
  43. package/dist/smart-canvas.js +3271 -1210
  44. package/dist/smart-canvas.js.map +4 -4
  45. package/dist/smart-canvas.min.js +123 -84
  46. package/dist/smart-canvas.min.js.map +4 -4
  47. package/dist/surfaces/types.d.ts +2 -1
  48. package/dist/theme/ThemeProvider.d.ts +11 -16
  49. package/dist/theme/defaultTheme.d.ts +6 -1
  50. package/dist/theme/index.d.ts +3 -4
  51. package/dist/theme/types.d.ts +11 -0
  52. package/dist/version.d.ts +1 -1
  53. package/dist/widgets/WidgetRegistry.d.ts +1 -0
  54. package/package.json +9 -8
  55. package/schema/canvas-config.schema.json +10583 -1049
  56. package/scripts/validate-config.mjs +180 -0
  57. package/dist/actions/executors/tour.d.ts +0 -18
  58. package/dist/chunk-4NYS7GAW.js.map +0 -7
  59. package/dist/chunk-OGTCFYR3.js.map +0 -7
  60. package/dist/chunk-QGWATS3Z.js.map +0 -7
  61. package/dist/hooks/useHostPatches.d.ts +0 -9
  62. package/dist/theme/extractHostTheme.d.ts +0 -14
@@ -1,70 +1,30 @@
1
1
  import {
2
- ActivationConfigZ
3
- } from "../chunk-4NYS7GAW.js";
4
-
5
- // src/config/schema.ts
6
- import { z } from "zod";
7
- var NotificationDeepLinkZ = z.object({
8
- tileId: z.string(),
9
- itemId: z.string().optional()
10
- }).strict();
11
- var TileNotificationRuleZ = z.object({
12
- on: z.string(),
13
- title: z.string(),
14
- body: z.string().optional(),
15
- icon: z.string().optional(),
16
- ttl: z.number().optional(),
17
- cooldown: z.number().optional(),
18
- deepLink: NotificationDeepLinkZ.optional()
19
- }).strict();
20
- var TileZ = z.object({
21
- id: z.string(),
22
- title: z.string().optional(),
23
- priority: z.number().optional(),
24
- widget: z.string(),
25
- props: z.record(z.unknown()).optional(),
26
- activation: ActivationConfigZ.optional(),
27
- notifications: z.array(TileNotificationRuleZ).optional()
28
- }).strict();
29
- var CanvasThemeConfigZ = z.object({
30
- name: z.string().optional(),
31
- mode: z.enum(["dark", "light"]).optional(),
32
- position: z.enum(["left", "right"]).optional(),
33
- colorPrimary: z.string().optional(),
34
- colorBackground: z.string().optional(),
35
- colorText: z.string().optional(),
36
- colorTextSecondary: z.string().optional(),
37
- borderRadius: z.string().optional()
38
- }).strict();
39
- var LauncherConfigZ = z.object({
40
- enabled: z.boolean().optional(),
41
- label: z.string().optional(),
42
- position: z.string().optional(),
43
- animate: z.boolean().optional(),
44
- animationStyle: z.enum(["pulse", "bounce", "glow"]).optional(),
45
- notificationCount: z.number().optional()
46
- }).strict();
47
- var CanvasConfigResponseZ = z.object({
48
- schemaVersion: z.string().optional(),
49
- fetchedAt: z.string().datetime(),
50
- configVersion: z.string().optional(),
51
- canvasTitle: z.string().optional(),
52
- tiles: z.array(TileZ),
53
- actions: z.array(z.any()),
54
- theme: CanvasThemeConfigZ.optional(),
55
- launcher: LauncherConfigZ.optional()
56
- }).strict();
57
- var configSchemas = [
58
- { defName: "tile", schema: TileZ },
59
- { defName: "themeConfig", schema: CanvasThemeConfigZ },
60
- { defName: "launcherConfig", schema: LauncherConfigZ },
61
- { defName: "canvasConfigResponse", schema: CanvasConfigResponseZ }
62
- ];
2
+ CanvasConfigResponseZ,
3
+ CanvasElementConfigZ,
4
+ CanvasThemeConfigZ,
5
+ ContentElementConfigZ,
6
+ LauncherConfigZ,
7
+ LauncherElementConfigZ,
8
+ NotificationDeepLinkZ,
9
+ NotificationElementConfigZ,
10
+ OverlayElementConfigZ,
11
+ TileElementConfigZ,
12
+ TileNotificationRuleZ,
13
+ TileZ,
14
+ configSchemas
15
+ } from "../chunk-XDYJ64IN.js";
16
+ import "../chunk-BU4Z6PD7.js";
63
17
  export {
64
18
  CanvasConfigResponseZ,
19
+ CanvasElementConfigZ,
65
20
  CanvasThemeConfigZ,
21
+ ContentElementConfigZ,
66
22
  LauncherConfigZ,
23
+ LauncherElementConfigZ,
67
24
  NotificationDeepLinkZ,
25
+ NotificationElementConfigZ,
26
+ OverlayElementConfigZ,
27
+ TileElementConfigZ,
68
28
  TileNotificationRuleZ,
69
29
  TileZ,
70
30
  configSchemas
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/config/schema.ts"],
4
- "sourcesContent": ["/**\n * Zod schemas for canvas configuration types.\n *\n * Single source of truth for tile, theme, launcher, and top-level\n * CanvasConfigResponse shapes. These schemas are converted to JSON Schema\n * during build and merged into the unified canvas-config.schema.json.\n *\n * Design decisions:\n * - `.strict()` on every object \u2192 `additionalProperties: false` in JSON Schema\n * - Matches runtime usage (includes fields like colorTextSecondary, schemaVersion\n * that were previously missing from the hand-written JSON schema)\n */\n\nimport { z } from 'zod';\nimport { ActivationConfigZ } from '../decisions/schema';\n\n// ============================================================================\n// Tile Notification Sub-Types\n// ============================================================================\n\nconst NotificationDeepLinkZ = z\n .object({\n tileId: z.string(),\n itemId: z.string().optional(),\n })\n .strict();\n\nconst TileNotificationRuleZ = z\n .object({\n on: z.string(),\n title: z.string(),\n body: z.string().optional(),\n icon: z.string().optional(),\n ttl: z.number().optional(),\n cooldown: z.number().optional(),\n deepLink: NotificationDeepLinkZ.optional(),\n })\n .strict();\n\n// ============================================================================\n// Tile\n// ============================================================================\n\nexport const TileZ = z\n .object({\n id: z.string(),\n title: z.string().optional(),\n priority: z.number().optional(),\n widget: z.string(),\n props: z.record(z.unknown()).optional(),\n activation: ActivationConfigZ.optional(),\n notifications: z.array(TileNotificationRuleZ).optional(),\n })\n .strict();\n\n// ============================================================================\n// Theme Config\n// ============================================================================\n\nexport const CanvasThemeConfigZ = z\n .object({\n name: z.string().optional(),\n mode: z.enum(['dark', 'light']).optional(),\n position: z.enum(['left', 'right']).optional(),\n colorPrimary: z.string().optional(),\n colorBackground: z.string().optional(),\n colorText: z.string().optional(),\n colorTextSecondary: z.string().optional(),\n borderRadius: z.string().optional(),\n })\n .strict();\n\n// ============================================================================\n// Launcher Config\n// ============================================================================\n\nexport const LauncherConfigZ = z\n .object({\n enabled: z.boolean().optional(),\n label: z.string().optional(),\n position: z.string().optional(),\n animate: z.boolean().optional(),\n animationStyle: z.enum(['pulse', 'bounce', 'glow']).optional(),\n notificationCount: z.number().optional(),\n })\n .strict();\n\n// ============================================================================\n// Canvas Config Response (top-level)\n// ============================================================================\n\nexport const CanvasConfigResponseZ = z\n .object({\n schemaVersion: z.string().optional(),\n fetchedAt: z.string().datetime(),\n configVersion: z.string().optional(),\n canvasTitle: z.string().optional(),\n tiles: z.array(TileZ),\n actions: z.array(z.any()),\n theme: CanvasThemeConfigZ.optional(),\n launcher: LauncherConfigZ.optional(),\n })\n .strict();\n\n// ============================================================================\n// Export: Array for unified schema generation\n// ============================================================================\n\n/**\n * Config schemas for unified JSON Schema generation.\n * The generator imports this array and converts each to a JSON Schema $def.\n */\nexport const configSchemas = [\n { defName: 'tile', schema: TileZ },\n { defName: 'themeConfig', schema: CanvasThemeConfigZ },\n { defName: 'launcherConfig', schema: LauncherConfigZ },\n { defName: 'canvasConfigResponse', schema: CanvasConfigResponseZ },\n];\n\n// ============================================================================\n// Named Exports\n// ============================================================================\n\nexport { NotificationDeepLinkZ, TileNotificationRuleZ };\n"],
5
- "mappings": ";;;;;AAaA,SAAS,SAAS;AAOlB,IAAM,wBAAwB,EAC3B,OAAO;AAAA,EACN,QAAQ,EAAE,OAAO;AAAA,EACjB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC,EACA,OAAO;AAEV,IAAM,wBAAwB,EAC3B,OAAO;AAAA,EACN,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,MAAM,EA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AAE,SAAS;AAAA,EAC7D,mBAAmB,EAAE,OAAO,EAAE,SAAS;AACzC,CAAC,EACA,OAAO;AAMH,IAAM,wBAAwB,EAClC,OAAO;AAAA,EACN,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EAAE,MAAM,KAAK;AAAA,EACpB,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC;AAAA,EACxB,OAAO,mBAAmB,SAAS;AAAA,EACnC,UAAU,gBAAgB,SAAS;AACrC,CAAC,EACA,OAAO;AAUH,IAAM,gBAAgB;AAAA,EAC3B,EAAE,SAAS,QAAQ,QAAQ,MAAM;AAAA,EACjC,EAAE,SAAS,eAAe,QAAQ,mBAAmB;AAAA,EACrD,EAAE,SAAS,kBAAkB,QAAQ,gBAAgB;AAAA,EACrD,EAAE,SAAS,wBAAwB,QAAQ,sBAAsB;AACnE;",
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
6
  "names": []
7
7
  }
@@ -9,13 +9,13 @@ export declare const PageContextZ: z.ZodObject<{
9
9
  locale: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  url: string;
12
- routeId?: string | undefined;
13
12
  title?: string | undefined;
13
+ routeId?: string | undefined;
14
14
  locale?: string | undefined;
15
15
  }, {
16
16
  url: string;
17
- routeId?: string | undefined;
18
17
  title?: string | undefined;
18
+ routeId?: string | undefined;
19
19
  locale?: string | undefined;
20
20
  }>;
21
21
  export declare const PageHistoryEntryZ: z.ZodObject<{
@@ -103,8 +103,8 @@ export declare const AnchorStateZ: z.ZodObject<{
103
103
  h: number;
104
104
  }>>;
105
105
  }, "strip", z.ZodTypeAny, {
106
- anchorId: string;
107
106
  present: boolean;
107
+ anchorId: string;
108
108
  visible?: boolean | undefined;
109
109
  boundingBox?: {
110
110
  x: number;
@@ -113,8 +113,8 @@ export declare const AnchorStateZ: z.ZodObject<{
113
113
  h: number;
114
114
  } | undefined;
115
115
  }, {
116
- anchorId: string;
117
116
  present: boolean;
117
+ anchorId: string;
118
118
  visible?: boolean | undefined;
119
119
  boundingBox?: {
120
120
  x: number;
@@ -132,13 +132,13 @@ export declare const RuntimeContextZ: z.ZodObject<{
132
132
  locale: z.ZodOptional<z.ZodString>;
133
133
  }, "strip", z.ZodTypeAny, {
134
134
  url: string;
135
- routeId?: string | undefined;
136
135
  title?: string | undefined;
136
+ routeId?: string | undefined;
137
137
  locale?: string | undefined;
138
138
  }, {
139
139
  url: string;
140
- routeId?: string | undefined;
141
140
  title?: string | undefined;
141
+ routeId?: string | undefined;
142
142
  locale?: string | undefined;
143
143
  }>;
144
144
  session: z.ZodObject<{
@@ -200,8 +200,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
200
200
  h: number;
201
201
  }>>;
202
202
  }, "strip", z.ZodTypeAny, {
203
- anchorId: string;
204
203
  present: boolean;
204
+ anchorId: string;
205
205
  visible?: boolean | undefined;
206
206
  boundingBox?: {
207
207
  x: number;
@@ -210,8 +210,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
210
210
  h: number;
211
211
  } | undefined;
212
212
  }, {
213
- anchorId: string;
214
213
  present: boolean;
214
+ anchorId: string;
215
215
  visible?: boolean | undefined;
216
216
  boundingBox?: {
217
217
  x: number;
@@ -228,8 +228,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
228
228
  };
229
229
  page: {
230
230
  url: string;
231
- routeId?: string | undefined;
232
231
  title?: string | undefined;
232
+ routeId?: string | undefined;
233
233
  locale?: string | undefined;
234
234
  };
235
235
  session: {
@@ -241,8 +241,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
241
241
  }[] | undefined;
242
242
  };
243
243
  anchors?: {
244
- anchorId: string;
245
244
  present: boolean;
245
+ anchorId: string;
246
246
  visible?: boolean | undefined;
247
247
  boundingBox?: {
248
248
  x: number;
@@ -259,8 +259,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
259
259
  };
260
260
  page: {
261
261
  url: string;
262
- routeId?: string | undefined;
263
262
  title?: string | undefined;
263
+ routeId?: string | undefined;
264
264
  locale?: string | undefined;
265
265
  };
266
266
  session: {
@@ -272,8 +272,8 @@ export declare const RuntimeContextZ: z.ZodObject<{
272
272
  }[] | undefined;
273
273
  };
274
274
  anchors?: {
275
- anchorId: string;
276
275
  present: boolean;
276
+ anchorId: string;
277
277
  visible?: boolean | undefined;
278
278
  boundingBox?: {
279
279
  x: number;
@@ -294,8 +294,8 @@ export declare function validateRuntimeContext(data: unknown): z.SafeParseReturn
294
294
  };
295
295
  page: {
296
296
  url: string;
297
- routeId?: string | undefined;
298
297
  title?: string | undefined;
298
+ routeId?: string | undefined;
299
299
  locale?: string | undefined;
300
300
  };
301
301
  session: {
@@ -307,8 +307,8 @@ export declare function validateRuntimeContext(data: unknown): z.SafeParseReturn
307
307
  }[] | undefined;
308
308
  };
309
309
  anchors?: {
310
- anchorId: string;
311
310
  present: boolean;
311
+ anchorId: string;
312
312
  visible?: boolean | undefined;
313
313
  boundingBox?: {
314
314
  x: number;
@@ -325,8 +325,8 @@ export declare function validateRuntimeContext(data: unknown): z.SafeParseReturn
325
325
  };
326
326
  page: {
327
327
  url: string;
328
- routeId?: string | undefined;
329
328
  title?: string | undefined;
329
+ routeId?: string | undefined;
330
330
  locale?: string | undefined;
331
331
  };
332
332
  session: {
@@ -338,8 +338,8 @@ export declare function validateRuntimeContext(data: unknown): z.SafeParseReturn
338
338
  }[] | undefined;
339
339
  };
340
340
  anchors?: {
341
- anchorId: string;
342
341
  present: boolean;
342
+ anchorId: string;
343
343
  visible?: boolean | undefined;
344
344
  boundingBox?: {
345
345
  x: number;