@syntrologie/runtime-sdk 2.4.0-canary.2 → 2.4.0-canary.21
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 +116 -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 +58243 -201
- 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-2UYZ5DWI.js +126 -0
- package/dist/chunk-2UYZ5DWI.js.map +7 -0
- package/dist/{chunk-DOJR7R46.js → chunk-HF3D7YFQ.js} +49 -31
- package/dist/chunk-HF3D7YFQ.js.map +7 -0
- package/dist/{chunk-ZDZ3IYFN.js → chunk-IPU3WVPY.js} +3449 -2110
- package/dist/chunk-IPU3WVPY.js.map +7 -0
- package/dist/{chunk-BIYMC56J.js → chunk-P5G4KT2U.js} +54 -6
- package/dist/chunk-P5G4KT2U.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +1 -20
- package/dist/config/schema.d.ts +1797 -267
- package/dist/config/schema.js +19 -62
- package/dist/config/schema.js.map +3 -3
- package/dist/context/schema.d.ts +8 -8
- package/dist/decisions/schema.d.ts +506 -1490
- package/dist/decisions/schema.js +5 -2
- package/dist/decisions/types.d.ts +22 -0
- 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 +4 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +72 -98
- package/dist/index.js.map +3 -3
- package/dist/overlays/schema.d.ts +48 -48
- 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 +62 -66
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +2591 -1167
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +62 -66
- 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 +10 -0
- package/dist/version.d.ts +1 -1
- package/package.json +7 -7
- package/schema/canvas-config.schema.json +9418 -790
- package/scripts/validate-config.mjs +78 -0
- package/dist/actions/executors/tour.d.ts +0 -18
- package/dist/chunk-BIYMC56J.js.map +0 -7
- package/dist/chunk-DOJR7R46.js.map +0 -7
- package/dist/chunk-JMHRHAEL.js +0 -18
- package/dist/chunk-JMHRHAEL.js.map +0 -7
- package/dist/chunk-ZDZ3IYFN.js.map +0 -7
- package/dist/hooks/useHostPatches.d.ts +0 -9
- package/dist/theme/extractHostTheme.d.ts +0 -14
package/CAPABILITIES.md
CHANGED
|
@@ -10,6 +10,7 @@ This document describes all available operations and capabilities of the SmartCa
|
|
|
10
10
|
- [Adaptive Packages](#adaptive-packages)
|
|
11
11
|
- [Surfaces](#surfaces)
|
|
12
12
|
- [Anchor Resolution](#anchor-resolution)
|
|
13
|
+
- [Route Scoping](#route-scoping)
|
|
13
14
|
- [Decision Strategies](#decision-strategies)
|
|
14
15
|
- [Best Practices](#best-practices)
|
|
15
16
|
|
|
@@ -854,7 +855,7 @@ Navigates to a URL.
|
|
|
854
855
|
|
|
855
856
|
# @syntrologie/adapt-overlays
|
|
856
857
|
|
|
857
|
-
Visual overlay capabilities including highlights, tooltips, badges,
|
|
858
|
+
Visual overlay capabilities including highlights, tooltips, badges, pulse animations, and celebrations.
|
|
858
859
|
|
|
859
860
|
## Actions
|
|
860
861
|
|
|
@@ -1028,6 +1029,71 @@ Shows a centered modal dialog with optional CTA buttons.
|
|
|
1028
1029
|
}
|
|
1029
1030
|
```
|
|
1030
1031
|
|
|
1032
|
+
### celebrate
|
|
1033
|
+
|
|
1034
|
+
Renders a fullscreen Canvas 2D celebration effect. One action kind with a pluggable `effect` parameter supporting multiple visual presets.
|
|
1035
|
+
|
|
1036
|
+
| Property | Type | Required | Default | Description |
|
|
1037
|
+
| ----------- | ---------------------------------- | -------- | -------------------------- | --------------------------------------------- |
|
|
1038
|
+
| `kind` | `"overlays:celebrate"` | Yes | | Action type |
|
|
1039
|
+
| `effect` | string | Yes | | Effect name (see presets below) |
|
|
1040
|
+
| `duration` | number | No | `3000` | Animation duration in ms |
|
|
1041
|
+
| `intensity` | `"light"` \| `"medium"` \| `"heavy"` | No | `"medium"` | Particle density |
|
|
1042
|
+
| `colors` | string[] | No | Rainbow palette | Color palette for particles |
|
|
1043
|
+
| `props` | object | No | | Effect-specific properties (see presets below) |
|
|
1044
|
+
|
|
1045
|
+
**Available effect presets:**
|
|
1046
|
+
|
|
1047
|
+
- **`confetti`** — Falling rectangular/circular confetti pieces with gravity, air resistance, and rotation
|
|
1048
|
+
- **`fireworks`** — Multiple burst centers with radiating particles, deceleration, and glow effect
|
|
1049
|
+
- **`sparkles`** — Diamond shapes that twinkle via sine-wave opacity oscillation and float gently upward
|
|
1050
|
+
- **`emoji-rain`** — Emoji characters falling from the top with horizontal sine-wave wobble. Use `props.emoji` to set the character (default: `"🎉"`)
|
|
1051
|
+
|
|
1052
|
+
**Confetti:**
|
|
1053
|
+
|
|
1054
|
+
```json
|
|
1055
|
+
{
|
|
1056
|
+
"kind": "overlays:celebrate",
|
|
1057
|
+
"effect": "confetti",
|
|
1058
|
+
"duration": 4000,
|
|
1059
|
+
"intensity": "heavy",
|
|
1060
|
+
"colors": ["#ff0000", "#00ff00", "#0000ff", "#ffff00"]
|
|
1061
|
+
}
|
|
1062
|
+
```
|
|
1063
|
+
|
|
1064
|
+
**Fireworks:**
|
|
1065
|
+
|
|
1066
|
+
```json
|
|
1067
|
+
{
|
|
1068
|
+
"kind": "overlays:celebrate",
|
|
1069
|
+
"effect": "fireworks",
|
|
1070
|
+
"duration": 3000,
|
|
1071
|
+
"intensity": "medium"
|
|
1072
|
+
}
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
**Sparkles:**
|
|
1076
|
+
|
|
1077
|
+
```json
|
|
1078
|
+
{
|
|
1079
|
+
"kind": "overlays:celebrate",
|
|
1080
|
+
"effect": "sparkles",
|
|
1081
|
+
"duration": 5000,
|
|
1082
|
+
"colors": ["#ffd700", "#ffffff", "#fffacd"]
|
|
1083
|
+
}
|
|
1084
|
+
```
|
|
1085
|
+
|
|
1086
|
+
**Emoji rain:**
|
|
1087
|
+
|
|
1088
|
+
```json
|
|
1089
|
+
{
|
|
1090
|
+
"kind": "overlays:celebrate",
|
|
1091
|
+
"effect": "emoji-rain",
|
|
1092
|
+
"duration": 3000,
|
|
1093
|
+
"props": { "emoji": "🔥" }
|
|
1094
|
+
}
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1031
1097
|
|
|
1032
1098
|
---
|
|
1033
1099
|
|
|
@@ -1092,6 +1158,55 @@ Then reference by the anchor name:
|
|
|
1092
1158
|
|
|
1093
1159
|
---
|
|
1094
1160
|
|
|
1161
|
+
## Route Scoping
|
|
1162
|
+
|
|
1163
|
+
Every tile and action **must** declare which pages it applies to via `activation.routes`. The config itself is always active — individual tiles and actions decide independently whether to render.
|
|
1164
|
+
|
|
1165
|
+
### Per-Tile Activation
|
|
1166
|
+
|
|
1167
|
+
```json
|
|
1168
|
+
{
|
|
1169
|
+
"id": "faq-w2-boxes",
|
|
1170
|
+
"widget": "adaptive-faq:accordion",
|
|
1171
|
+
"activation": {
|
|
1172
|
+
"routes": { "include": ["/dashboard/income"] }
|
|
1173
|
+
},
|
|
1174
|
+
"props": { ... }
|
|
1175
|
+
}
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
### Per-Action Activation
|
|
1179
|
+
|
|
1180
|
+
```json
|
|
1181
|
+
{
|
|
1182
|
+
"kind": "content:insertHtml",
|
|
1183
|
+
"anchorId": "[data-section='refund-estimate']",
|
|
1184
|
+
"activation": {
|
|
1185
|
+
"routes": { "include": ["/dashboard"] }
|
|
1186
|
+
},
|
|
1187
|
+
"html": "...",
|
|
1188
|
+
"position": "after"
|
|
1189
|
+
}
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
### Route Patterns
|
|
1193
|
+
|
|
1194
|
+
| Pattern | Matches | Use Case |
|
|
1195
|
+
|---------|---------|----------|
|
|
1196
|
+
| `"/dashboard/income"` | Exact path only | Page-specific |
|
|
1197
|
+
| `"/dashboard/**"` | `/dashboard` and all sub-paths | Section-wide |
|
|
1198
|
+
| `"/**"` | All pages | Global (always active) |
|
|
1199
|
+
| `"/dashboard/:id"` | Any single segment after `/dashboard/` | Dynamic routes |
|
|
1200
|
+
|
|
1201
|
+
### Pattern Matching Rules
|
|
1202
|
+
|
|
1203
|
+
- Patterns match against **pathname only** (no domain, no query string)
|
|
1204
|
+
- `**` matches anything (including `/`)
|
|
1205
|
+
- `*` matches within a single path segment (not `/`)
|
|
1206
|
+
- `exclude` takes priority over `include`
|
|
1207
|
+
|
|
1208
|
+
---
|
|
1209
|
+
|
|
1095
1210
|
## Decision Strategies
|
|
1096
1211
|
|
|
1097
1212
|
Control when adaptives activate using `DecisionStrategy`:
|
package/dist/SmartCanvasApp.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { BatchActionHandle } from './actions/types';
|
|
3
|
-
import { type CanvasTheme } from './components/ShadowCanvasOverlay';
|
|
4
3
|
import type { SmartCanvasController } from './controller';
|
|
5
4
|
import type { ExperimentClient } from './experiments/types';
|
|
6
5
|
import type { SmartCanvasRuntime } from './runtime';
|
|
7
6
|
import type { TelemetryClient } from './telemetry/types';
|
|
7
|
+
import type { CanvasThemeConfig } from './theme';
|
|
8
8
|
import type { CanvasConfigFetcher } from './types';
|
|
9
9
|
export interface SmartCanvasAppProps {
|
|
10
10
|
controller: SmartCanvasController;
|
|
@@ -13,6 +13,7 @@ export interface SmartCanvasAppProps {
|
|
|
13
13
|
configUriFeatureKey?: string;
|
|
14
14
|
configFeatureKey?: string;
|
|
15
15
|
fetchCredentials?: RequestCredentials;
|
|
16
|
+
/** @deprecated No longer used — config updates are event-driven via ExperimentClient.onFeaturesChanged */
|
|
16
17
|
pollIntervalMs?: number;
|
|
17
18
|
experiments?: ExperimentClient;
|
|
18
19
|
telemetry?: TelemetryClient;
|
|
@@ -29,8 +30,9 @@ export interface SmartCanvasAppProps {
|
|
|
29
30
|
footerSlot?: ReactNode;
|
|
30
31
|
launcherLabel?: string;
|
|
31
32
|
canvasHost?: HTMLElement | null;
|
|
32
|
-
theme?: Partial<CanvasTheme>;
|
|
33
33
|
/** Batch handle from eager action application in createSmartCanvas(). Prevents double-apply. */
|
|
34
34
|
initialBatchHandle?: BatchActionHandle | null;
|
|
35
|
+
/** Workspace-level theme for 3-layer inheritance (defaults → workspace → config) */
|
|
36
|
+
workspaceTheme?: CanvasThemeConfig;
|
|
35
37
|
}
|
|
36
|
-
export declare function SmartCanvasApp({ controller, fetcher, configUri, configUriFeatureKey, configFeatureKey, fetchCredentials, pollIntervalMs, experiments, telemetry, runtime, overlayFetcher, overlayConfigUri, overlayConfigFeatureKey, overlayFetchCredentials, footerSlot, launcherLabel, canvasHost,
|
|
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;
|
|
@@ -112,6 +112,5 @@ export declare function getExecutor(kind: ActionKind | string): ActionExecutor<A
|
|
|
112
112
|
*/
|
|
113
113
|
export declare function hasExecutor(kind: ActionKind | string): boolean;
|
|
114
114
|
export { executeAddClass, executeInsertHtml, executeRemoveClass, executeSetAttr, executeSetStyle, executeSetText, } from '@syntrologie/adapt-content/runtime';
|
|
115
|
-
export { executeBadge, executeHighlight, executeModal, executePulse, executeTooltip, } from '@syntrologie/adapt-overlays/runtime';
|
|
115
|
+
export { executeBadge, executeHighlight, executeModal, executePulse, executeTooltip, executeTour, } from '@syntrologie/adapt-overlays/runtime';
|
|
116
116
|
export { executeParallel, executeSequence, executeWait } from './core-flow';
|
|
117
|
-
export { executeTour } from './tour';
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
export { createActionEngine } from './ActionEngine';
|
|
7
7
|
export type { ExecutorRegistration } from './executors';
|
|
8
8
|
export { ExecutorRegistry, executorRegistry, getExecutor, hasExecutor } from './executors';
|
|
9
|
-
export { AddClassZ, BadgePositionZ, BadgeZ, CtaButtonZ, coreActionStepSchemas, HighlightStyleZ, HighlightZ, InsertHtmlZ, InsertPositionZ, ModalContentZ, ModalZ, MountWidgetZ, NavigateZ, ParallelZ, PlacementZ, PulseZ, RemoveClassZ, ScrollBehaviorZ, ScrollLogicalPositionZ, ScrollToZ, SequenceZ, SetAttrZ, SetStyleZ, SetTextZ, TooltipContentZ, TooltipTriggerZ, TooltipZ, TourStepForSchemaZ, TourZ, WaitZ, WidgetConfigZ, } from './schema';
|
|
10
|
-
export type { ActionEngine, ActionEngineExecutorRegistry, ActionEngineOptions, ActionExecutor, ActionHandle, ActionKind, ActionState, ActionStep, ActiveAction, AddClassAction, BadgeAction, BadgePosition, BatchActionHandle, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, HighlightAction, HighlightStyle, InsertHtmlAction, InsertPosition, MountWidgetAction, NavigateAction, PulseAction, RemoveClassAction, ScrollToAction, SetAttrAction, SetStyleAction, SetTextAction, TooltipAction, TooltipContent, TooltipTrigger, ValidationError, ValidationResult, ValidationWarning, WidgetConfig, } from './types';
|
|
9
|
+
export { AddClassZ, AnchorIdZ, BadgePositionZ, BadgeZ, CtaButtonZ, coreActionStepSchemas, HighlightStyleZ, HighlightZ, InsertHtmlZ, InsertPositionZ, ModalContentZ, ModalZ, MountWidgetZ, NavigateZ, ParallelZ, PlacementZ, PulseZ, RemoveClassZ, ScrollBehaviorZ, ScrollLogicalPositionZ, ScrollToZ, SequenceZ, SetAttrZ, SetStyleZ, SetTextZ, TooltipContentZ, TooltipTriggerZ, TooltipZ, TourStepForSchemaZ, TourZ, WaitZ, WidgetConfigZ, } from './schema';
|
|
10
|
+
export type { ActionEngine, ActionEngineExecutorRegistry, ActionEngineOptions, ActionExecutor, ActionHandle, ActionKind, ActionState, ActionStep, ActiveAction, AddClassAction, AnchorId, BadgeAction, BadgePosition, BatchActionHandle, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, HighlightAction, HighlightStyle, InsertHtmlAction, InsertPosition, MountWidgetAction, NavigateAction, PulseAction, RemoveClassAction, ScrollToAction, SetAttrAction, SetStyleAction, SetTextAction, TooltipAction, TooltipContent, TooltipTrigger, TourAction, TourStep, ValidationError, ValidationResult, ValidationWarning, WidgetConfig, } from './types';
|
|
11
11
|
export { validateAction, validateActions } from './validation';
|