@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
@@ -0,0 +1,73 @@
1
+ import {
2
+ ActivationConfigZ
3
+ } from "../chunk-BIYMC56J.js";
4
+ import "../chunk-JMHRHAEL.js";
5
+
6
+ // src/config/schema.ts
7
+ import { z } from "zod";
8
+ var NotificationDeepLinkZ = z.object({
9
+ tileId: z.string(),
10
+ itemId: z.string().optional()
11
+ }).strict();
12
+ var TileNotificationRuleZ = z.object({
13
+ on: z.string(),
14
+ title: z.string(),
15
+ body: z.string().optional(),
16
+ icon: z.string().optional(),
17
+ ttl: z.number().optional(),
18
+ cooldown: z.number().optional(),
19
+ deepLink: NotificationDeepLinkZ.optional()
20
+ }).strict();
21
+ var TileZ = z.object({
22
+ id: z.string(),
23
+ title: z.string().optional(),
24
+ priority: z.number().optional(),
25
+ widget: z.string(),
26
+ props: z.record(z.unknown()).optional(),
27
+ activation: ActivationConfigZ.optional(),
28
+ notifications: z.array(TileNotificationRuleZ).optional()
29
+ }).strict();
30
+ var CanvasThemeConfigZ = z.object({
31
+ name: z.string().optional(),
32
+ mode: z.enum(["dark", "light"]).optional(),
33
+ position: z.enum(["left", "right"]).optional(),
34
+ colorPrimary: z.string().optional(),
35
+ colorBackground: z.string().optional(),
36
+ colorText: z.string().optional(),
37
+ colorTextSecondary: z.string().optional(),
38
+ borderRadius: z.string().optional()
39
+ }).strict();
40
+ var LauncherConfigZ = z.object({
41
+ enabled: z.boolean().optional(),
42
+ label: z.string().optional(),
43
+ position: z.string().optional(),
44
+ animate: z.boolean().optional(),
45
+ animationStyle: z.enum(["pulse", "bounce", "glow"]).optional(),
46
+ notificationCount: z.number().optional()
47
+ }).strict();
48
+ var CanvasConfigResponseZ = z.object({
49
+ schemaVersion: z.string().optional(),
50
+ fetchedAt: z.string().datetime(),
51
+ configVersion: z.string().optional(),
52
+ canvasTitle: z.string().optional(),
53
+ tiles: z.array(TileZ),
54
+ actions: z.array(z.any()),
55
+ theme: CanvasThemeConfigZ.optional(),
56
+ launcher: LauncherConfigZ.optional()
57
+ }).strict();
58
+ var configSchemas = [
59
+ { defName: "tile", schema: TileZ },
60
+ { defName: "themeConfig", schema: CanvasThemeConfigZ },
61
+ { defName: "launcherConfig", schema: LauncherConfigZ },
62
+ { defName: "canvasConfigResponse", schema: CanvasConfigResponseZ }
63
+ ];
64
+ export {
65
+ CanvasConfigResponseZ,
66
+ CanvasThemeConfigZ,
67
+ LauncherConfigZ,
68
+ NotificationDeepLinkZ,
69
+ TileNotificationRuleZ,
70
+ TileZ,
71
+ configSchemas
72
+ };
73
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,7 @@
1
+ {
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,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E,QAAQ,EAAE,SAAS;AAAA,EAC9B,gBAAgB,EAAE,KAAK,CAAC,SAAS,UAAU,MAAM,CAAC,EAAE,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;",
6
+ "names": []
7
+ }
@@ -6,15 +6,15 @@
6
6
  * - Notifying subscribers when context changes
7
7
  * - Providing the current context snapshot
8
8
  */
9
+ import type { RouteFilter } from '../decisions/types';
9
10
  import type { NavigationMonitor } from '../navigation/NavigationMonitor';
10
11
  import type { TelemetryClient } from '../telemetry/types';
11
- import type { RoutesConfig } from '../types';
12
12
  import type { AnchorState, ContextChangeCallback, PageHistoryEntry, RuntimeContext, Unsubscribe } from './types';
13
13
  export interface ContextManagerOptions {
14
14
  /** Telemetry client for session ID */
15
15
  telemetry?: TelemetryClient;
16
16
  /** Routes config for route matching */
17
- routes?: RoutesConfig;
17
+ routes?: RouteFilter;
18
18
  /** Initial page history (optional) */
19
19
  initialPageHistory?: PageHistoryEntry[];
20
20
  /** Centralized navigation monitor (replaces direct History API patching) */
@@ -44,7 +44,7 @@ export declare class ContextManager {
44
44
  /**
45
45
  * Update the routes config (e.g., when config is fetched).
46
46
  */
47
- setRoutes(routes: RoutesConfig): void;
47
+ setRoutes(routes: RouteFilter): void;
48
48
  /**
49
49
  * Update anchor states.
50
50
  */
@@ -10,7 +10,7 @@
10
10
  export interface PageContext {
11
11
  /** Current page URL */
12
12
  url: string;
13
- /** Matched route pattern from RoutesConfig (e.g., "/products/:id") */
13
+ /** Matched route pattern from RouteFilter (e.g., "/products/:id") */
14
14
  routeId?: string;
15
15
  /** Document title */
16
16
  title?: string;