@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
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Smart Canvas Runtime SDK
2
2
 
3
+ > Config is delivered via GrowthBook feature flags — discovered automatically, no hardcoded keys.
4
+
3
5
  ## Runtime SDK (React + Shadow DOM)
4
6
 
5
7
  The SDK ships a framework-agnostic `<smart-canvas>` custom element with an **open shadow root**. We render everything with React, but the canvas is encapsulated so host Tailwind configs, resets, or stacking contexts can't break the UI.
@@ -513,3 +515,4 @@ The telemetry client emits:
513
515
  4. Configure the SDK with your API credentials
514
516
  5. Use `runtime.actions` for interventions, `runtime.surfaces` for UI
515
517
  6. For non-React pages, call `window.SmartCanvas.create()` with configuration
518
+
@@ -2,6 +2,7 @@ import { type ReactNode } from 'react';
2
2
  import type { BatchActionHandle } from './actions/types';
3
3
  import type { SmartCanvasController } from './controller';
4
4
  import type { ExperimentClient } from './experiments/types';
5
+ import type { PlatformAdapter } from './platform/PlatformAdapter';
5
6
  import type { SmartCanvasRuntime } from './runtime';
6
7
  import type { TelemetryClient } from './telemetry/types';
7
8
  import type { CanvasThemeConfig } from './theme';
@@ -34,5 +35,7 @@ export interface SmartCanvasAppProps {
34
35
  initialBatchHandle?: BatchActionHandle | null;
35
36
  /** Workspace-level theme for 3-layer inheritance (defaults → workspace → config) */
36
37
  workspaceTheme?: CanvasThemeConfig;
38
+ /** Platform adapter for host-platform-specific integrations (Shopify, WordPress, etc.) */
39
+ platformAdapter?: PlatformAdapter;
37
40
  }
38
- export declare function SmartCanvasApp({ controller, fetcher, configUri, configUriFeatureKey, configFeatureKey, fetchCredentials, pollIntervalMs, experiments, telemetry, runtime, overlayFetcher, overlayConfigUri, overlayConfigFeatureKey, overlayFetchCredentials, footerSlot, launcherLabel, canvasHost, initialBatchHandle, workspaceTheme, }: SmartCanvasAppProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function SmartCanvasApp({ controller, fetcher, configUri, configUriFeatureKey, configFeatureKey, fetchCredentials, pollIntervalMs, experiments, telemetry, runtime, overlayFetcher, overlayConfigUri, overlayConfigFeatureKey, overlayFetchCredentials, footerSlot, launcherLabel, canvasHost, initialBatchHandle, workspaceTheme, platformAdapter, }: SmartCanvasAppProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,166 @@
1
+ /**
2
+ * SmartCanvasElementLit — LitElement shell for the Smart Canvas SDK.
3
+ *
4
+ * This is the Lit equivalent of SmartCanvasElement.tsx (raw HTMLElement + React).
5
+ * It absorbs the logic from SmartCanvasApp.tsx directly into the element class:
6
+ * - Config fetching (useShadowCanvasConfig equivalent)
7
+ * - Action lifecycle (batch handle, revert/apply, version counter)
8
+ * - Theme via ThemeController
9
+ * - Canvas open/close via SmartCanvasController
10
+ * - Runtime context via @lit/context
11
+ *
12
+ * Renders <syntro-canvas-overlay> as its main child (Lit component).
13
+ *
14
+ * Decorator-free: uses `static override properties` (tsconfig has no
15
+ * experimentalDecorators).
16
+ */
17
+ import { LitElement, nothing } from 'lit';
18
+ import type { BatchActionHandle } from './actions/types.js';
19
+ import './components/SyntroCanvasOverlay.js';
20
+ import { type SmartCanvasController } from './controller.js';
21
+ import type { ExperimentClient } from './experiments/types.js';
22
+ import './interop/ReactInLit.js';
23
+ import type { SmartCanvasRuntime } from './runtime.js';
24
+ import type { TelemetryClient } from './telemetry/types.js';
25
+ import type { ActionStep, CanvasConfigFetcher, CanvasThemeConfig, LauncherConfig, TileConfig } from './types.js';
26
+ export declare const runtimeContext: {
27
+ __context__: SmartCanvasRuntime | null;
28
+ };
29
+ /**
30
+ * Props accepted by mountLitApp(). Mirrors SmartCanvasAppProps minus controller
31
+ * (the element owns the controller) and footerSlot/canvasHost (React-only).
32
+ */
33
+ export interface SmartCanvasLitProps {
34
+ fetcher?: CanvasConfigFetcher;
35
+ configUri?: string;
36
+ configUriFeatureKey?: string;
37
+ configFeatureKey?: string;
38
+ fetchCredentials?: RequestCredentials;
39
+ experiments?: ExperimentClient;
40
+ telemetry?: TelemetryClient;
41
+ runtime?: SmartCanvasRuntime;
42
+ launcherLabel?: string;
43
+ initialBatchHandle?: BatchActionHandle | null;
44
+ workspaceTheme?: CanvasThemeConfig;
45
+ }
46
+ export declare class SmartCanvasElementLit extends LitElement {
47
+ #private;
48
+ static shadowRootOptions: ShadowRootInit;
49
+ static styles: import("lit").CSSResult;
50
+ static properties: {
51
+ fetcher: {
52
+ attribute: boolean;
53
+ };
54
+ configUri: {
55
+ type: StringConstructor;
56
+ };
57
+ configUriFeatureKey: {
58
+ type: StringConstructor;
59
+ };
60
+ configFeatureKey: {
61
+ type: StringConstructor;
62
+ };
63
+ fetchCredentials: {
64
+ type: StringConstructor;
65
+ };
66
+ experiments: {
67
+ attribute: boolean;
68
+ };
69
+ telemetry: {
70
+ attribute: boolean;
71
+ };
72
+ runtime: {
73
+ attribute: boolean;
74
+ };
75
+ launcherLabel: {
76
+ type: StringConstructor;
77
+ };
78
+ initialBatchHandle: {
79
+ attribute: boolean;
80
+ };
81
+ workspaceTheme: {
82
+ attribute: boolean;
83
+ };
84
+ _tiles: {
85
+ state: boolean;
86
+ };
87
+ _configActions: {
88
+ state: boolean;
89
+ };
90
+ _isLoading: {
91
+ state: boolean;
92
+ };
93
+ _error: {
94
+ state: boolean;
95
+ };
96
+ _theme: {
97
+ state: boolean;
98
+ };
99
+ _launcher: {
100
+ state: boolean;
101
+ };
102
+ _canvasTitle: {
103
+ state: boolean;
104
+ };
105
+ _displayMode: {
106
+ state: boolean;
107
+ };
108
+ _isOpen: {
109
+ state: boolean;
110
+ };
111
+ _pageUrl: {
112
+ state: boolean;
113
+ };
114
+ };
115
+ fetcher: CanvasConfigFetcher | undefined;
116
+ configUri: string | undefined;
117
+ configUriFeatureKey: string | undefined;
118
+ configFeatureKey: string | undefined;
119
+ fetchCredentials: RequestCredentials;
120
+ experiments: ExperimentClient | undefined;
121
+ telemetry: TelemetryClient | undefined;
122
+ runtime: SmartCanvasRuntime | undefined;
123
+ launcherLabel: string | undefined;
124
+ initialBatchHandle: BatchActionHandle | null;
125
+ workspaceTheme: CanvasThemeConfig | undefined;
126
+ /** @internal */ _tiles: TileConfig[];
127
+ /** @internal */ _configActions: ActionStep[];
128
+ /** @internal */ _isLoading: boolean;
129
+ /** @internal */ _error: string | undefined;
130
+ /** @internal */ _theme: CanvasThemeConfig | undefined;
131
+ /** @internal */ _launcher: LauncherConfig | undefined;
132
+ /** @internal */ _canvasTitle: string | undefined;
133
+ /** @internal */ _displayMode: 'standard' | 'focused';
134
+ /** @internal */ _isOpen: boolean;
135
+ /** @internal */ _pageUrl: string;
136
+ constructor();
137
+ connectedCallback(): void;
138
+ disconnectedCallback(): void;
139
+ updated(changed: Map<string, unknown>): void;
140
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
141
+ open(): void;
142
+ close(): void;
143
+ toggle(): void;
144
+ setOverrideFetcher(fetcher: CanvasConfigFetcher): void;
145
+ getMountNode(): HTMLElement;
146
+ getController(): SmartCanvasController;
147
+ /** React portal target inside shadow root (launcher, drawer, toasts) */
148
+ getPortalRoot(): HTMLDivElement | null;
149
+ /** Vanilla JS overlay container inside shadow root (tooltips, modals, spotlights) */
150
+ getOverlayContainer(): HTMLDivElement | null;
151
+ /** Direct access to the shadow root (for style injection) */
152
+ getShadowRoot(): ShadowRoot;
153
+ /**
154
+ * Mount the React-based SmartCanvasApp inside this element's shadow root.
155
+ * Uses the ReactBridge interop element. During the transition period, callers
156
+ * can use either mountReactApp() (React) or mountLitApp() (Lit).
157
+ */
158
+ mountReactApp(appProps: Record<string, unknown>): void;
159
+ /**
160
+ * Set properties directly on the element. The Lit property change triggers
161
+ * re-render and re-fetch without React.
162
+ */
163
+ mountLitApp(props: SmartCanvasLitProps): void;
164
+ _loadConfig(): Promise<void>;
165
+ }
166
+ export declare const registerSmartCanvasElement: () => void;