@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.
- package/CAPABILITIES.md +66 -1
- package/dist/SmartCanvasApp.d.ts +5 -3
- package/dist/actions/executors/index.d.ts +1 -2
- package/dist/actions/index.d.ts +2 -2
- package/dist/actions/schema.d.ts +19111 -20709
- package/dist/actions/schema.js +5 -2
- package/dist/actions/types.d.ts +45 -48
- package/dist/anchor/AnchorResolver.d.ts +18 -0
- package/dist/anchor/index.d.ts +2 -0
- package/dist/api.d.ts +3 -8
- package/dist/apps/examples/gamification-app.example.d.ts +8 -8
- package/dist/{chunk-4NYS7GAW.js → chunk-BU4Z6PD7.js} +45 -7
- package/dist/chunk-BU4Z6PD7.js.map +7 -0
- package/dist/{chunk-QGWATS3Z.js → chunk-Q4WGXNKC.js} +2775 -1052
- package/dist/chunk-Q4WGXNKC.js.map +7 -0
- package/dist/{chunk-OGTCFYR3.js → chunk-R5DNAIRI.js} +45 -34
- package/dist/chunk-R5DNAIRI.js.map +7 -0
- package/dist/chunk-XDYJ64IN.js +178 -0
- package/dist/chunk-XDYJ64IN.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -20
- package/dist/components/TileIcon.d.ts +14 -0
- package/dist/config/schema.d.ts +5529 -3620
- package/dist/config/schema.js +21 -61
- package/dist/config/schema.js.map +3 -3
- package/dist/context/schema.d.ts +16 -16
- package/dist/decisions/schema.d.ts +357 -2789
- package/dist/decisions/schema.js +7 -1
- package/dist/decisions/types.d.ts +24 -2
- package/dist/events/registerConfigPredicates.d.ts +7 -10
- package/dist/events/schema.d.ts +12 -12
- package/dist/experiments/adapters/growthbook.d.ts +2 -0
- package/dist/experiments/types.d.ts +7 -0
- package/dist/hooks/useShadowCanvasConfig.d.ts +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +154 -186
- package/dist/index.js.map +3 -3
- package/dist/overlays/schema.d.ts +70 -70
- package/dist/react.js +4 -3
- package/dist/react.js.map +1 -1
- package/dist/runtime.d.ts +3 -0
- package/dist/smart-canvas.esm.js +123 -84
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +3271 -1210
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +123 -84
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/surfaces/types.d.ts +2 -1
- package/dist/theme/ThemeProvider.d.ts +11 -16
- package/dist/theme/defaultTheme.d.ts +6 -1
- package/dist/theme/index.d.ts +3 -4
- package/dist/theme/types.d.ts +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +1 -0
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +10583 -1049
- package/scripts/validate-config.mjs +180 -0
- package/dist/actions/executors/tour.d.ts +0 -18
- package/dist/chunk-4NYS7GAW.js.map +0 -7
- package/dist/chunk-OGTCFYR3.js.map +0 -7
- package/dist/chunk-QGWATS3Z.js.map +0 -7
- package/dist/hooks/useHostPatches.d.ts +0 -9
- package/dist/theme/extractHostTheme.d.ts +0 -14
package/dist/surfaces/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Surfaces handles layout, stacking, animations, and priority-based arbitration.
|
|
6
6
|
*/
|
|
7
7
|
import type { Placement } from '@floating-ui/dom';
|
|
8
|
+
import type { AnchorId } from '../actions/types.js';
|
|
8
9
|
/** Static surface slots with fixed positioning */
|
|
9
10
|
export type StaticSurfaceSlot = 'drawer_right' | 'drawer_left' | 'drawer_bottom' | 'overlay_center' | 'overlay_corner_br' | 'overlay_corner_bl' | 'toast_top' | 'toast_bottom';
|
|
10
11
|
/** Dynamic inline slot (rendered inside anchor) */
|
|
@@ -122,7 +123,7 @@ export interface SurfacesOptions {
|
|
|
122
123
|
publish: (name: string, props?: Record<string, unknown>) => void;
|
|
123
124
|
};
|
|
124
125
|
/** Function to resolve anchor IDs to elements (for inline/adjacent slots) */
|
|
125
|
-
anchorResolver?: (anchorId:
|
|
126
|
+
anchorResolver?: (anchorId: AnchorId) => HTMLElement | null;
|
|
126
127
|
/** Default animation type */
|
|
127
128
|
defaultAnimation?: AnimationType;
|
|
128
129
|
/** Widget registry for resolving widget content */
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CanvasThemeConfig } from './types';
|
|
3
3
|
interface ThemeContextValue {
|
|
4
|
-
|
|
5
|
-
mode:
|
|
4
|
+
config: Required<CanvasThemeConfig>;
|
|
5
|
+
mode: 'light' | 'dark';
|
|
6
6
|
cssVariables: Record<string, string>;
|
|
7
|
-
setMode: (mode: ThemeMode) => void;
|
|
8
7
|
}
|
|
9
8
|
export interface ThemeProviderProps {
|
|
10
9
|
children: ReactNode;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/** Customer theme overrides (nested by visual element) */
|
|
11
|
+
themeConfig?: CanvasThemeConfig;
|
|
12
|
+
/** Workspace-level theme (applied between defaults and config overrides) */
|
|
13
|
+
workspaceTheme?: CanvasThemeConfig;
|
|
13
14
|
shadowRoot?: ShadowRoot | null;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
* Theme provider
|
|
17
|
+
* Theme provider: config → merge with defaults → flatten to CSS vars → inject into shadow root.
|
|
18
|
+
* When workspaceTheme is provided, uses 3-layer merge: defaults → workspace → config.
|
|
19
|
+
* No auto-detection. Fully deterministic.
|
|
17
20
|
*/
|
|
18
|
-
export declare function ThemeProvider({ children,
|
|
21
|
+
export declare function ThemeProvider({ children, themeConfig, workspaceTheme, shadowRoot, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
/**
|
|
20
23
|
* Hook to access theme context
|
|
21
24
|
*/
|
|
22
25
|
export declare function useTheme(): ThemeContextValue;
|
|
23
|
-
/**
|
|
24
|
-
* Hook to get specific theme token with CSS variable fallback
|
|
25
|
-
*/
|
|
26
|
-
export declare function useThemeToken<K extends keyof CanvasThemeTokens>(token: K): string;
|
|
27
|
-
/**
|
|
28
|
-
* Hook to get CSS variable name for a token
|
|
29
|
-
*/
|
|
30
|
-
export declare function useThemeVar(token: keyof CanvasThemeTokens): string;
|
|
31
26
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanvasThemeTokens } from './types';
|
|
1
|
+
import type { CanvasThemeConfig, CanvasThemeTokens } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Apply alpha transparency to a hex color.
|
|
4
4
|
* Converts a 0-1 alpha value to a 2-digit hex suffix.
|
|
@@ -20,3 +20,8 @@ export declare function getDefaultTheme(mode?: 'light' | 'dark'): CanvasThemeTok
|
|
|
20
20
|
* Convert theme tokens to CSS custom properties
|
|
21
21
|
*/
|
|
22
22
|
export declare function themeToCssVariables(theme: CanvasThemeTokens): Record<string, string>;
|
|
23
|
+
export declare const darkDefaults: Required<CanvasThemeConfig>;
|
|
24
|
+
export declare const lightDefaults: Required<CanvasThemeConfig>;
|
|
25
|
+
export declare function mergeThemeConfig(customer: CanvasThemeConfig): Required<CanvasThemeConfig>;
|
|
26
|
+
export declare function mergeThemeWithWorkspace(workspaceTheme: CanvasThemeConfig, configTheme: CanvasThemeConfig): Required<CanvasThemeConfig>;
|
|
27
|
+
export declare function flattenThemeConfig(config: Required<CanvasThemeConfig>): Record<string, string>;
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { darkTheme, getDefaultTheme, lightTheme, themeToCssVariables, withAlpha, } from './defaultTheme';
|
|
2
|
-
export { autoDetectTheme, extractHostTheme, mergeWithExtractedTheme } from './extractHostTheme';
|
|
1
|
+
export { darkDefaults, darkTheme, flattenThemeConfig, getDefaultTheme, lightDefaults, lightTheme, mergeThemeConfig, mergeThemeWithWorkspace, themeToCssVariables, withAlpha, } from './defaultTheme';
|
|
3
2
|
export type { ThemeProviderProps } from './ThemeProvider';
|
|
4
|
-
export { ThemeProvider, useTheme
|
|
5
|
-
export type { CanvasThemeTokens,
|
|
3
|
+
export { ThemeProvider, useTheme } from './ThemeProvider';
|
|
4
|
+
export type { CanvasElementConfig, CanvasThemeConfig, CanvasThemeTokens, LauncherElementConfig, NotificationElementConfig, OverlayElementConfig, ThemeAppearance, ThemeMode, TileElementConfig, } from './types';
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
* Theme token definitions for Smart Canvas
|
|
3
3
|
* Inspired by macOS design language and react.email aesthetics
|
|
4
4
|
*/
|
|
5
|
+
import type { z } from 'zod';
|
|
6
|
+
import type { CanvasElementConfigZ, ContentElementConfigZ, LauncherElementConfigZ, NotificationElementConfigZ, OverlayElementConfigZ, TileElementConfigZ } from '../config/schema';
|
|
7
|
+
export type CanvasElementConfig = z.infer<typeof CanvasElementConfigZ>;
|
|
8
|
+
export type LauncherElementConfig = z.infer<typeof LauncherElementConfigZ>;
|
|
9
|
+
export type TileElementConfig = z.infer<typeof TileElementConfigZ>;
|
|
10
|
+
export type OverlayElementConfig = z.infer<typeof OverlayElementConfigZ>;
|
|
11
|
+
export type NotificationElementConfig = z.infer<typeof NotificationElementConfigZ>;
|
|
12
|
+
export type ContentElementConfig = z.infer<typeof ContentElementConfigZ>;
|
|
13
|
+
export type { CanvasThemeConfig } from '../types';
|
|
5
14
|
/**
|
|
6
15
|
* Complete theme token interface
|
|
16
|
+
* @deprecated Use CanvasThemeConfig instead
|
|
7
17
|
*/
|
|
8
18
|
export interface CanvasThemeTokens {
|
|
9
19
|
colorPrimary: string;
|
|
@@ -72,6 +82,7 @@ export interface CanvasThemeTokens {
|
|
|
72
82
|
}
|
|
73
83
|
/**
|
|
74
84
|
* Theme extracted from host page CSS variables
|
|
85
|
+
* @deprecated Use CanvasThemeConfig instead
|
|
75
86
|
*/
|
|
76
87
|
export interface ExtractedTheme {
|
|
77
88
|
primaryColor: string | null;
|
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/runtime-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0-canary.1",
|
|
4
4
|
"description": "Syntrologie Runtime SDK for web experimentation and analytics",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"private": false,
|
|
@@ -67,12 +67,13 @@
|
|
|
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.
|
|
71
|
-
"@syntrologie/adapt-content": "2.
|
|
72
|
-
"@syntrologie/adapt-faq": "2.
|
|
73
|
-
"@syntrologie/adapt-gamification": "2.
|
|
74
|
-
"@syntrologie/adapt-nav": "2.
|
|
75
|
-
"@syntrologie/adapt-overlays": "2.
|
|
70
|
+
"@syntrologie/adapt-chatbot": "2.6.0-canary.1",
|
|
71
|
+
"@syntrologie/adapt-content": "2.6.0-canary.1",
|
|
72
|
+
"@syntrologie/adapt-faq": "2.6.0-canary.1",
|
|
73
|
+
"@syntrologie/adapt-gamification": "2.6.0-canary.1",
|
|
74
|
+
"@syntrologie/adapt-nav": "2.6.0-canary.1",
|
|
75
|
+
"@syntrologie/adapt-overlays": "2.6.0-canary.1",
|
|
76
|
+
"lucide-react": "^0.576.0",
|
|
76
77
|
"posthog-js": "~1.302.2",
|
|
77
78
|
"zod": "^3.25.76"
|
|
78
79
|
},
|
|
@@ -81,10 +82,10 @@
|
|
|
81
82
|
"react-dom": ">=18.0.0"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
|
-
"@syntro/design-system": "*",
|
|
85
85
|
"@semantic-release/exec": "~7.1.0",
|
|
86
86
|
"@semantic-release/github": "~12.0.3",
|
|
87
87
|
"@semantic-release/npm": "~13.1.3",
|
|
88
|
+
"@syntro/design-system": "*",
|
|
88
89
|
"@testing-library/dom": "^10.4.1",
|
|
89
90
|
"@testing-library/jest-dom": "^6.9.1",
|
|
90
91
|
"@testing-library/react": "^16.3.2",
|