@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.
- package/CAPABILITIES.md +321 -173
- package/README.md +3 -0
- package/dist/SmartCanvasApp.d.ts +4 -1
- package/dist/SmartCanvasElementLit.d.ts +166 -0
- package/dist/actions/schema.d.ts +783 -783
- package/dist/actions/schema.js +3 -3
- package/dist/actions/types.d.ts +9 -3
- package/dist/actions/validation-core.d.ts +24 -0
- package/dist/actions/validation-rules.d.ts +74 -0
- package/dist/actions/validation.d.ts +5 -11
- package/dist/anchor/AnchorResolver.d.ts +1 -0
- package/dist/api-lit.d.ts +84 -0
- package/dist/api.d.ts +3 -0
- package/dist/apps/builtinRuntimeModules-lit.d.ts +20 -0
- package/dist/bootstrap-init.d.ts +35 -0
- package/dist/bootstrap-runtime.d.ts +7 -0
- package/dist/bootstrap-types.d.ts +100 -0
- package/dist/bootstrap.d.ts +19 -83
- package/dist/chunk-2IQ2PTLJ.js +871 -0
- package/dist/chunk-2IQ2PTLJ.js.map +7 -0
- package/dist/chunk-4HXPGXUC.js +226 -0
- package/dist/chunk-4HXPGXUC.js.map +7 -0
- package/dist/{chunk-37TTQRH5.js → chunk-GX7BBYX6.js} +4 -4
- package/dist/chunk-GX7BBYX6.js.map +7 -0
- package/dist/{chunk-G4PH7C7H.js → chunk-SC5B3YCG.js} +2702 -1442
- package/dist/chunk-SC5B3YCG.js.map +7 -0
- package/dist/{chunk-NBFQGKSV.js → chunk-XVRDKBYF.js} +4 -4
- package/dist/{chunk-NBFQGKSV.js.map → chunk-XVRDKBYF.js.map} +2 -2
- package/dist/components/ShadowCanvasOverlay.d.ts +1 -2
- package/dist/components/SyntroCanvasOverlay.d.ts +100 -0
- package/dist/components/SyntroDrawer.d.ts +110 -0
- package/dist/components/SyntroLauncher.d.ts +105 -0
- package/dist/components/SyntroTileCard.d.ts +74 -0
- package/dist/components/SyntroTileWheel.d.ts +51 -0
- package/dist/config/schema.d.ts +147 -136
- package/dist/config/schema.js +2 -2
- package/dist/controllers/DecisionController.d.ts +48 -0
- package/dist/controllers/NotificationsController.d.ts +59 -0
- package/dist/controllers/RuntimeController.d.ts +52 -0
- package/dist/controllers/RuntimeEventsController.d.ts +42 -0
- package/dist/controllers/ThemeController.d.ts +110 -0
- package/dist/controllers/index.d.ts +13 -0
- package/dist/decisions/schema.d.ts +47 -47
- package/dist/decisions/schema.js +1 -1
- package/dist/decisions/types.d.ts +4 -0
- package/dist/editorLoader.d.ts +5 -0
- package/dist/events/EventBus.d.ts +27 -1
- package/dist/events/history.d.ts +9 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/types.d.ts +24 -0
- package/dist/events/validation.d.ts +7 -0
- package/dist/fetchers/experimentsFetcher.d.ts +3 -3
- package/dist/fetchers/mergeConfigs.d.ts +7 -7
- package/dist/index-lit.d.ts +40 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2435 -2022
- package/dist/index.js.map +4 -4
- package/dist/interop/LitInReact.d.ts +27 -0
- package/dist/interop/ReactInLit.d.ts +42 -0
- package/dist/interop/index.d.ts +7 -0
- package/dist/metrics/sessionMetrics.d.ts +4 -0
- package/dist/notifications/SyntroToastStack.d.ts +43 -0
- package/dist/overlays/runtime/overlay/overlay-runner.d.ts +4 -0
- package/dist/overlays/runtime/overlay/overlay-state.d.ts +21 -0
- package/dist/overlays/types.d.ts +3 -1
- package/dist/platform/PlatformAdapter.d.ts +46 -0
- package/dist/platform/ShopifyAdapter.d.ts +36 -0
- package/dist/platform/ShopifyAnchorResolver.d.ts +31 -0
- package/dist/platform/ShopifyAntiFlicker.d.ts +21 -0
- package/dist/platform/ShopifyPixelBridge.d.ts +37 -0
- package/dist/platform/detect.d.ts +9 -0
- package/dist/platform/index.d.ts +10 -0
- package/dist/platform/shopify-cookie-contract.d.ts +39 -0
- package/dist/react-compat.d.ts +114 -0
- package/dist/react.js +7 -4
- package/dist/react.js.map +2 -2
- package/dist/shopify-pixel-entry.d.ts +68 -0
- package/dist/shopify-pixel.js +77 -0
- package/dist/shopify-pixel.js.map +7 -0
- package/dist/shopify-pixel.min.js +2 -0
- package/dist/shopify-pixel.min.js.map +7 -0
- package/dist/smart-canvas.esm.js +858 -258
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +28024 -36411
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +857 -258
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/telemetry/InterventionTracker.d.ts +23 -0
- package/dist/telemetry/adapters/posthog.d.ts +5 -10
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/theme/index.js +30 -0
- package/dist/theme/index.js.map +7 -0
- package/dist/token.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +32 -29
- package/schema/canvas-config.schema.json +2345 -11394
- package/scripts/syntroReactPlugin.mjs +3 -0
- package/scripts/validate-config.mjs +42 -0
- package/dist/chunk-37TTQRH5.js.map +0 -7
- package/dist/chunk-G4PH7C7H.js.map +0 -7
- package/dist/chunk-Q77NT67W.js +0 -203
- package/dist/chunk-Q77NT67W.js.map +0 -7
- package/dist/replayMirror-QZ3GQ527.js +0 -32
- package/dist/replayMirror-QZ3GQ527.js.map +0 -7
- 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
|
+
|
package/dist/SmartCanvasApp.d.ts
CHANGED
|
@@ -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;
|