@syntrologie/runtime-sdk 2.1.0 → 2.2.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.
- package/CAPABILITIES.md +50 -43
- package/README.md +7 -7
- package/dist/RuntimeProvider.d.ts +1 -1
- package/dist/ShadowRootContext.d.ts +19 -0
- package/dist/SmartCanvasApp.d.ts +3 -3
- package/dist/SmartCanvasElement.d.ts +7 -2
- package/dist/SmartCanvasPortal.d.ts +1 -1
- package/dist/actions/executors/index.d.ts +3 -3
- package/dist/actions/executors/tour.d.ts +1 -1
- package/dist/actions/index.d.ts +4 -3
- package/dist/actions/schema.d.ts +1229 -0
- package/dist/actions/schema.js +67 -0
- package/dist/actions/schema.js.map +7 -0
- package/dist/adaptives/adaptive-chatbot/index.js +4 -4
- package/dist/adaptives/adaptive-chatbot/index.js.map +4 -4
- package/dist/adaptives/adaptive-content/index.js +2 -2
- package/dist/adaptives/adaptive-content/index.js.map +4 -4
- package/dist/adaptives/adaptive-faq/index.js +23 -6
- package/dist/adaptives/adaptive-faq/index.js.map +4 -4
- package/dist/adaptives/adaptive-gamification/index.js.map +1 -1
- package/dist/adaptives/adaptive-nav/index.js +22 -7
- package/dist/adaptives/adaptive-nav/index.js.map +4 -4
- package/dist/adaptives/adaptive-overlays/index.js +13 -13
- package/dist/adaptives/adaptive-overlays/index.js.map +4 -4
- package/dist/api.d.ts +2 -2
- package/dist/apps/examples/gamification-app.example.d.ts +4 -4
- package/dist/apps/index.d.ts +7 -7
- package/dist/blocks/data/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/interactive/index.d.ts +1 -1
- package/dist/blocks/notification/NotificationBlock.d.ts +1 -1
- package/dist/blocks/notification/index.d.ts +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/chunk-AYTRRBR5.js +251 -0
- package/dist/chunk-AYTRRBR5.js.map +7 -0
- package/dist/chunk-CU354JTM.js +7921 -0
- package/dist/chunk-CU354JTM.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -2
- package/dist/components/TileCard.d.ts +1 -1
- package/dist/context/ContextManager.d.ts +1 -1
- package/dist/context/index.d.ts +3 -3
- package/dist/decisions/engine.d.ts +1 -1
- package/dist/decisions/index.d.ts +3 -3
- package/dist/decisions/schema.d.ts +24 -24
- package/dist/decisions/strategies/rules.d.ts +1 -1
- package/dist/decisions/strategies/score.d.ts +1 -1
- package/dist/editorLoader.d.ts +4 -4
- package/dist/events/EventAccumulator.d.ts +1 -1
- package/dist/events/EventBus.d.ts +1 -1
- package/dist/events/index.d.ts +7 -6
- package/dist/events/registerConfigPredicates.d.ts +19 -0
- package/dist/experiments/adapters/growthbook.d.ts +1 -1
- package/dist/experiments/index.d.ts +2 -2
- package/dist/experiments/registry.d.ts +1 -1
- package/dist/fetchers/index.d.ts +2 -2
- package/dist/hooks/useShadowCanvasConfig.d.ts +1 -1
- package/dist/hostPatcher/index.d.ts +2 -2
- package/dist/index.d.ts +24 -21
- package/dist/index.js +816 -75
- package/dist/index.js.map +7 -1
- package/dist/metrics/index.d.ts +1 -1
- package/dist/notifications/index.d.ts +6 -6
- package/dist/overlays/runtime/index.d.ts +3 -3
- package/dist/overlays/runtime/overlay/root.d.ts +17 -1
- package/dist/overlays/runtime/overlay/tooltip.d.ts +1 -1
- package/dist/react.js +90 -134
- package/dist/react.js.map +7 -1
- package/dist/render/RenderContext.d.ts +2 -2
- package/dist/render/index.d.ts +2 -2
- package/dist/render/types.d.ts +2 -2
- package/dist/runtime.d.ts +8 -8
- package/dist/smart-canvas.esm.js +127 -124
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +17160 -16782
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +127 -124
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/state/StateStore.d.ts +1 -1
- package/dist/state/helpers/cooldowns.d.ts +1 -1
- package/dist/state/helpers/dismissals.d.ts +1 -1
- package/dist/state/helpers/frequency.d.ts +1 -1
- package/dist/state/index.d.ts +3 -3
- package/dist/surfaces/index.d.ts +3 -3
- package/dist/surfaces/positioning.d.ts +1 -1
- package/dist/telemetry/adapters/posthog.d.ts +2 -2
- package/dist/telemetry/index.d.ts +3 -3
- package/dist/telemetry/registry.d.ts +1 -1
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/extractHostTheme.d.ts +1 -1
- package/dist/theme/index.d.ts +4 -4
- package/dist/types-only.d.ts +1 -1
- package/dist/types-only.js +1 -11
- package/dist/types-only.js.map +7 -1
- package/dist/types.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/widgets/index.d.ts +1 -1
- package/package.json +24 -17
- package/schema/canvas-config.base.schema.json +351 -0
- package/schema/canvas-config.schema.json +3202 -440
- package/scripts/validate-config.mjs +54 -58
- package/dist/RuntimeProvider.js +0 -113
- package/dist/RuntimeProvider.js.map +0 -1
- package/dist/SmartCanvasApp.js +0 -143
- package/dist/SmartCanvasApp.js.map +0 -1
- package/dist/SmartCanvasElement.js +0 -138
- package/dist/SmartCanvasElement.js.map +0 -1
- package/dist/SmartCanvasPortal.js +0 -17
- package/dist/SmartCanvasPortal.js.map +0 -1
- package/dist/actions/ActionEngine.js +0 -272
- package/dist/actions/ActionEngine.js.map +0 -1
- package/dist/actions/executors/index.js +0 -240
- package/dist/actions/executors/index.js.map +0 -1
- package/dist/actions/executors/tour.js +0 -332
- package/dist/actions/executors/tour.js.map +0 -1
- package/dist/actions/index.js +0 -12
- package/dist/actions/index.js.map +0 -1
- package/dist/actions/types.js +0 -8
- package/dist/actions/types.js.map +0 -1
- package/dist/actions/validation.js +0 -577
- package/dist/actions/validation.js.map +0 -1
- package/dist/antiFlicker.js +0 -39
- package/dist/antiFlicker.js.map +0 -1
- package/dist/api.js +0 -205
- package/dist/api.js.map +0 -1
- package/dist/apps/AppContext.js +0 -91
- package/dist/apps/AppContext.js.map +0 -1
- package/dist/apps/AppLoader.js +0 -293
- package/dist/apps/AppLoader.js.map +0 -1
- package/dist/apps/AppRegistry.js +0 -317
- package/dist/apps/AppRegistry.js.map +0 -1
- package/dist/apps/examples/gamification-app.example.js +0 -329
- package/dist/apps/examples/gamification-app.example.js.map +0 -1
- package/dist/apps/index.js +0 -16
- package/dist/apps/index.js.map +0 -1
- package/dist/apps/types.js +0 -8
- package/dist/apps/types.js.map +0 -1
- package/dist/blocks/data/ComparisonBlock.js +0 -95
- package/dist/blocks/data/ComparisonBlock.js.map +0 -1
- package/dist/blocks/data/StatsBlock.js +0 -102
- package/dist/blocks/data/StatsBlock.js.map +0 -1
- package/dist/blocks/data/index.js +0 -3
- package/dist/blocks/data/index.js.map +0 -1
- package/dist/blocks/index.js +0 -93
- package/dist/blocks/index.js.map +0 -1
- package/dist/blocks/interactive/ChecklistBlock.js +0 -111
- package/dist/blocks/interactive/ChecklistBlock.js.map +0 -1
- package/dist/blocks/interactive/RatingBlock.js +0 -147
- package/dist/blocks/interactive/RatingBlock.js.map +0 -1
- package/dist/blocks/interactive/index.js +0 -3
- package/dist/blocks/interactive/index.js.map +0 -1
- package/dist/blocks/notification/NotificationBlock.js +0 -171
- package/dist/blocks/notification/NotificationBlock.js.map +0 -1
- package/dist/blocks/notification/index.js +0 -2
- package/dist/blocks/notification/index.js.map +0 -1
- package/dist/blocks/theme-tokens.js +0 -25
- package/dist/blocks/theme-tokens.js.map +0 -1
- package/dist/bootstrap.js +0 -448
- package/dist/bootstrap.js.map +0 -1
- package/dist/bundle-entry.js +0 -9
- package/dist/bundle-entry.js.map +0 -1
- package/dist/components/ShadowCanvasOverlay.js +0 -327
- package/dist/components/ShadowCanvasOverlay.js.map +0 -1
- package/dist/components/TileCard.js +0 -103
- package/dist/components/TileCard.js.map +0 -1
- package/dist/components/TileWheel.js +0 -50
- package/dist/components/TileWheel.js.map +0 -1
- package/dist/config-validator.js +0 -173
- package/dist/config-validator.js.map +0 -1
- package/dist/configFetcher.js +0 -131
- package/dist/configFetcher.js.map +0 -1
- package/dist/context/ContextManager.js +0 -269
- package/dist/context/ContextManager.js.map +0 -1
- package/dist/context/index.js +0 -7
- package/dist/context/index.js.map +0 -1
- package/dist/context/schema.js +0 -50
- package/dist/context/schema.js.map +0 -1
- package/dist/context/types.js +0 -8
- package/dist/context/types.js.map +0 -1
- package/dist/controller.js +0 -34
- package/dist/controller.js.map +0 -1
- package/dist/decisions/engine.js +0 -117
- package/dist/decisions/engine.js.map +0 -1
- package/dist/decisions/index.js +0 -10
- package/dist/decisions/index.js.map +0 -1
- package/dist/decisions/schema.js +0 -151
- package/dist/decisions/schema.js.map +0 -1
- package/dist/decisions/strategies/rules.js +0 -166
- package/dist/decisions/strategies/rules.js.map +0 -1
- package/dist/decisions/strategies/score.js +0 -29
- package/dist/decisions/strategies/score.js.map +0 -1
- package/dist/decisions/types.js +0 -2
- package/dist/decisions/types.js.map +0 -1
- package/dist/earlyPatcher.js +0 -20
- package/dist/earlyPatcher.js.map +0 -1
- package/dist/editorLoader.js +0 -254
- package/dist/editorLoader.js.map +0 -1
- package/dist/events/EventAccumulator.js +0 -101
- package/dist/events/EventAccumulator.js.map +0 -1
- package/dist/events/EventBus.js +0 -152
- package/dist/events/EventBus.js.map +0 -1
- package/dist/events/index.js +0 -11
- package/dist/events/index.js.map +0 -1
- package/dist/events/normalizers/canvas.js +0 -116
- package/dist/events/normalizers/canvas.js.map +0 -1
- package/dist/events/normalizers/posthog.js +0 -171
- package/dist/events/normalizers/posthog.js.map +0 -1
- package/dist/events/schema.js +0 -30
- package/dist/events/schema.js.map +0 -1
- package/dist/events/types.js +0 -54
- package/dist/events/types.js.map +0 -1
- package/dist/experiments/adapters/growthbook.js +0 -81
- package/dist/experiments/adapters/growthbook.js.map +0 -1
- package/dist/experiments/index.js +0 -4
- package/dist/experiments/index.js.map +0 -1
- package/dist/experiments/registry.js +0 -30
- package/dist/experiments/registry.js.map +0 -1
- package/dist/experiments/types.js +0 -2
- package/dist/experiments/types.js.map +0 -1
- package/dist/fetchers/cdnFetcher.js +0 -96
- package/dist/fetchers/cdnFetcher.js.map +0 -1
- package/dist/fetchers/experimentsFetcher.js +0 -109
- package/dist/fetchers/experimentsFetcher.js.map +0 -1
- package/dist/fetchers/index.js +0 -5
- package/dist/fetchers/index.js.map +0 -1
- package/dist/fetchers/mergeConfigs.js +0 -38
- package/dist/fetchers/mergeConfigs.js.map +0 -1
- package/dist/fetchers/registry.js +0 -58
- package/dist/fetchers/registry.js.map +0 -1
- package/dist/fetchers/types.js +0 -2
- package/dist/fetchers/types.js.map +0 -1
- package/dist/hooks/useCanvasOverlays.js +0 -128
- package/dist/hooks/useCanvasOverlays.js.map +0 -1
- package/dist/hooks/useHostPatches.js +0 -40
- package/dist/hooks/useHostPatches.js.map +0 -1
- package/dist/hooks/useShadowCanvasConfig.js +0 -63
- package/dist/hooks/useShadowCanvasConfig.js.map +0 -1
- package/dist/hostPatcher/core/patcher.js +0 -181
- package/dist/hostPatcher/core/patcher.js.map +0 -1
- package/dist/hostPatcher/core/sanitizer.js +0 -66
- package/dist/hostPatcher/core/sanitizer.js.map +0 -1
- package/dist/hostPatcher/core/types.js +0 -2
- package/dist/hostPatcher/core/types.js.map +0 -1
- package/dist/hostPatcher/index.js +0 -7
- package/dist/hostPatcher/index.js.map +0 -1
- package/dist/hostPatcher/policy/defaultPolicy.js +0 -23
- package/dist/hostPatcher/policy/defaultPolicy.js.map +0 -1
- package/dist/hostPatcher/utils/anchors.js +0 -105
- package/dist/hostPatcher/utils/anchors.js.map +0 -1
- package/dist/hostPatcher/utils/observer.js +0 -11
- package/dist/hostPatcher/utils/observer.js.map +0 -1
- package/dist/logger.js +0 -81
- package/dist/logger.js.map +0 -1
- package/dist/metrics/index.js +0 -5
- package/dist/metrics/index.js.map +0 -1
- package/dist/metrics/sessionMetrics.js +0 -178
- package/dist/metrics/sessionMetrics.js.map +0 -1
- package/dist/notifications/NotificationToastStack.js +0 -118
- package/dist/notifications/NotificationToastStack.js.map +0 -1
- package/dist/notifications/index.js +0 -6
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/matcher.js +0 -66
- package/dist/notifications/matcher.js.map +0 -1
- package/dist/notifications/types.js +0 -13
- package/dist/notifications/types.js.map +0 -1
- package/dist/notifications/useNotifications.js +0 -104
- package/dist/notifications/useNotifications.js.map +0 -1
- package/dist/notifications/useNotifyWatcher.js +0 -62
- package/dist/notifications/useNotifyWatcher.js.map +0 -1
- package/dist/overlays/fetcher.js +0 -15
- package/dist/overlays/fetcher.js.map +0 -1
- package/dist/overlays/recipeRegistry.js +0 -32
- package/dist/overlays/recipeRegistry.js.map +0 -1
- package/dist/overlays/runtime/anchor/resolve.js +0 -87
- package/dist/overlays/runtime/anchor/resolve.js.map +0 -1
- package/dist/overlays/runtime/index.js +0 -8
- package/dist/overlays/runtime/index.js.map +0 -1
- package/dist/overlays/runtime/overlay/highlight.js +0 -160
- package/dist/overlays/runtime/overlay/highlight.js.map +0 -1
- package/dist/overlays/runtime/overlay/modal.js +0 -78
- package/dist/overlays/runtime/overlay/modal.js.map +0 -1
- package/dist/overlays/runtime/overlay/root.js +0 -297
- package/dist/overlays/runtime/overlay/root.js.map +0 -1
- package/dist/overlays/runtime/overlay/runner.js +0 -602
- package/dist/overlays/runtime/overlay/runner.js.map +0 -1
- package/dist/overlays/runtime/overlay/tooltip.js +0 -232
- package/dist/overlays/runtime/overlay/tooltip.js.map +0 -1
- package/dist/overlays/runtime/utils/dom.js +0 -12
- package/dist/overlays/runtime/utils/dom.js.map +0 -1
- package/dist/overlays/schema.js +0 -52
- package/dist/overlays/schema.js.map +0 -1
- package/dist/overlays/types.js +0 -2
- package/dist/overlays/types.js.map +0 -1
- package/dist/render/RenderContext.js +0 -69
- package/dist/render/RenderContext.js.map +0 -1
- package/dist/render/index.js +0 -3
- package/dist/render/index.js.map +0 -1
- package/dist/render/types.js +0 -2
- package/dist/render/types.js.map +0 -1
- package/dist/runtime.js +0 -237
- package/dist/runtime.js.map +0 -1
- package/dist/state/StateStore.js +0 -176
- package/dist/state/StateStore.js.map +0 -1
- package/dist/state/helpers/cooldowns.js +0 -31
- package/dist/state/helpers/cooldowns.js.map +0 -1
- package/dist/state/helpers/dismissals.js +0 -34
- package/dist/state/helpers/dismissals.js.map +0 -1
- package/dist/state/helpers/frequency.js +0 -43
- package/dist/state/helpers/frequency.js.map +0 -1
- package/dist/state/index.js +0 -7
- package/dist/state/index.js.map +0 -1
- package/dist/state/schema.js +0 -25
- package/dist/state/schema.js.map +0 -1
- package/dist/state/types.js +0 -9
- package/dist/state/types.js.map +0 -1
- package/dist/store/example.js +0 -43
- package/dist/store/example.js.map +0 -1
- package/dist/store/mini-effector.js +0 -88
- package/dist/store/mini-effector.js.map +0 -1
- package/dist/surfaces/Surfaces.js +0 -361
- package/dist/surfaces/Surfaces.js.map +0 -1
- package/dist/surfaces/index.js +0 -12
- package/dist/surfaces/index.js.map +0 -1
- package/dist/surfaces/positioning.js +0 -228
- package/dist/surfaces/positioning.js.map +0 -1
- package/dist/surfaces/types.js +0 -23
- package/dist/surfaces/types.js.map +0 -1
- package/dist/telemetry/adapters/noop.js +0 -42
- package/dist/telemetry/adapters/noop.js.map +0 -1
- package/dist/telemetry/adapters/posthog.js +0 -180
- package/dist/telemetry/adapters/posthog.js.map +0 -1
- package/dist/telemetry/index.js +0 -4
- package/dist/telemetry/index.js.map +0 -1
- package/dist/telemetry/registry.js +0 -29
- package/dist/telemetry/registry.js.map +0 -1
- package/dist/telemetry/types.js +0 -2
- package/dist/telemetry/types.js.map +0 -1
- package/dist/theme/ThemeProvider.js +0 -109
- package/dist/theme/ThemeProvider.js.map +0 -1
- package/dist/theme/defaultTheme.js +0 -190
- package/dist/theme/defaultTheme.js.map +0 -1
- package/dist/theme/extractHostTheme.js +0 -259
- package/dist/theme/extractHostTheme.js.map +0 -1
- package/dist/theme/index.js +0 -7
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/types.js +0 -6
- package/dist/theme/types.js.map +0 -1
- package/dist/token.js +0 -44
- package/dist/token.js.map +0 -1
- package/dist/types.js +0 -17
- package/dist/types.js.map +0 -1
- package/dist/version.js +0 -14
- package/dist/version.js.map +0 -1
- package/dist/widgets/WidgetRegistry.js +0 -190
- package/dist/widgets/WidgetRegistry.js.map +0 -1
- package/dist/widgets/index.js +0 -7
- package/dist/widgets/index.js.map +0 -1
package/CAPABILITIES.md
CHANGED
|
@@ -742,38 +742,38 @@ Accordion of contextual navigation tips. Each tip has a collapsible header and e
|
|
|
742
742
|
|
|
743
743
|
### Tile Config
|
|
744
744
|
|
|
745
|
-
| Property
|
|
746
|
-
|
|
|
747
|
-
| `widget`
|
|
748
|
-
| `props.expandBehavior`
|
|
749
|
-
| `props.theme`
|
|
750
|
-
| `props.actions`
|
|
745
|
+
| Property | Type | Required | Default | Description |
|
|
746
|
+
| ---------------------- | --------------------------------- | -------- | ---------- | --------------------- |
|
|
747
|
+
| `widget` | `"adaptive-nav:tips"` | Yes | | Widget identifier |
|
|
748
|
+
| `props.expandBehavior` | `"single"` \| `"multiple"` | No | `"single"` | Accordion expand mode |
|
|
749
|
+
| `props.theme` | `"light"` \| `"dark"` \| `"auto"` | No | `"auto"` | Color theme |
|
|
750
|
+
| `props.actions` | `NavTipAction[]` | Yes | | Navigation tip items |
|
|
751
751
|
|
|
752
752
|
### Nav Tip Action (`nav:tip`)
|
|
753
753
|
|
|
754
754
|
Compositional action — rendered as an accordion item by the parent widget.
|
|
755
755
|
|
|
756
|
-
| Property
|
|
757
|
-
|
|
|
758
|
-
| `kind`
|
|
759
|
-
| `config.id`
|
|
760
|
-
| `config.title`
|
|
761
|
-
| `config.description`
|
|
762
|
-
| `config.href`
|
|
763
|
-
| `config.icon`
|
|
764
|
-
| `config.external`
|
|
765
|
-
| `config.category`
|
|
766
|
-
| `showWhen`
|
|
767
|
-
| `notify`
|
|
768
|
-
| `rationale`
|
|
756
|
+
| Property | Type | Required | Description |
|
|
757
|
+
| -------------------- | --------------------------- | -------- | ------------------------------------ |
|
|
758
|
+
| `kind` | `"nav:tip"` | Yes | Action type |
|
|
759
|
+
| `config.id` | string | Yes | Unique tip identifier |
|
|
760
|
+
| `config.title` | string | Yes | Accordion header text |
|
|
761
|
+
| `config.description` | string | Yes | Expanded body text |
|
|
762
|
+
| `config.href` | string | No | Optional CTA link URL |
|
|
763
|
+
| `config.icon` | string | No | Icon (emoji or icon key) |
|
|
764
|
+
| `config.external` | boolean | No | Open link in new tab |
|
|
765
|
+
| `config.category` | string | No | Category for grouping |
|
|
766
|
+
| `showWhen` | `DecisionStrategy<boolean>` | No | Conditional visibility |
|
|
767
|
+
| `notify` | `{ title?, body?, icon? }` | No | Toast config for showWhen transition |
|
|
768
|
+
| `rationale` | `{ why, confidence? }` | No | AI reasoning for recommendation |
|
|
769
769
|
|
|
770
770
|
### Events Published
|
|
771
771
|
|
|
772
|
-
| Event | When
|
|
773
|
-
| ------------------ |
|
|
774
|
-
| `nav:toggled` | User expands/collapses a tip
|
|
775
|
-
| `nav:tip_clicked` | User clicks a tip's CTA link
|
|
776
|
-
| `nav:tip_revealed` | `showWhen` transitions false → true
|
|
772
|
+
| Event | When | Props |
|
|
773
|
+
| ------------------ | ----------------------------------- | --------------------------------- |
|
|
774
|
+
| `nav:toggled` | User expands/collapses a tip | `{ instanceId, tipId, expanded }` |
|
|
775
|
+
| `nav:tip_clicked` | User clicks a tip's CTA link | `{ instanceId, href, external }` |
|
|
776
|
+
| `nav:tip_revealed` | `showWhen` transitions false → true | `{ tipId, title, body, icon }` |
|
|
777
777
|
|
|
778
778
|
### Notify Watchers
|
|
779
779
|
|
|
@@ -808,7 +808,14 @@ Tips with both `showWhen` and `notify` are registered as notify watchers. The ru
|
|
|
808
808
|
"notify": { "title": "New Tip", "body": "Advanced Analytics", "icon": "📊" },
|
|
809
809
|
"showWhen": {
|
|
810
810
|
"type": "rules",
|
|
811
|
-
"rules": [
|
|
811
|
+
"rules": [
|
|
812
|
+
{
|
|
813
|
+
"conditions": [
|
|
814
|
+
{ "type": "event_count", "key": "link-clicks", "operator": "gte", "count": 3 }
|
|
815
|
+
],
|
|
816
|
+
"value": true
|
|
817
|
+
}
|
|
818
|
+
],
|
|
812
819
|
"default": false
|
|
813
820
|
}
|
|
814
821
|
}
|
|
@@ -823,12 +830,12 @@ Tips with both `showWhen` and `notify` are registered as notify watchers. The ru
|
|
|
823
830
|
|
|
824
831
|
Scrolls the viewport to bring an element into view.
|
|
825
832
|
|
|
826
|
-
| Property | Type
|
|
827
|
-
| ---------- |
|
|
828
|
-
| `kind` | `"navigation:scrollTo"` | Yes
|
|
829
|
-
| `anchorId` | string
|
|
830
|
-
| `behavior` | string
|
|
831
|
-
| `block` | string
|
|
833
|
+
| Property | Type | Required | Default | Description |
|
|
834
|
+
| ---------- | ----------------------- | -------- | ---------- | ------------------------------------------- |
|
|
835
|
+
| `kind` | `"navigation:scrollTo"` | Yes | | Action type |
|
|
836
|
+
| `anchorId` | string | Yes | | Element selector |
|
|
837
|
+
| `behavior` | string | No | `"smooth"` | `"smooth"`, `"instant"`, `"auto"` |
|
|
838
|
+
| `block` | string | No | `"center"` | `"start"`, `"center"`, `"end"`, `"nearest"` |
|
|
832
839
|
|
|
833
840
|
### `navigation:navigate`
|
|
834
841
|
|
|
@@ -836,7 +843,7 @@ Navigates to a URL.
|
|
|
836
843
|
|
|
837
844
|
| Property | Type | Required | Default | Description |
|
|
838
845
|
| -------- | ----------------------- | -------- | --------- | ----------------------- |
|
|
839
|
-
| `kind` | `"navigation:navigate"` | Yes
|
|
846
|
+
| `kind` | `"navigation:navigate"` | Yes | | Action type |
|
|
840
847
|
| `url` | string | Yes | | Destination URL |
|
|
841
848
|
| `target` | string | No | `"_self"` | `"_self"` or `"_blank"` |
|
|
842
849
|
|
|
@@ -879,17 +886,17 @@ Creates a spotlight effect around an element with a scrim overlay.
|
|
|
879
886
|
|
|
880
887
|
Shows a tooltip near an element with optional title, body, and CTA.
|
|
881
888
|
|
|
882
|
-
| Property | Type | Required | Default | Description
|
|
883
|
-
| -------------------- | ----------- | -------- | ------------- |
|
|
884
|
-
| `kind` | `"tooltip"` | Yes | | Action type
|
|
885
|
-
| `anchorId` | string | Yes | | Element selector
|
|
886
|
-
| `content.title` | string | No | | Tooltip heading
|
|
887
|
-
| `content.body` | string | Yes | | Tooltip text
|
|
888
|
-
| `content.cta.label` | string | No | | CTA button text (single-CTA shorthand)
|
|
889
|
-
| `content.cta.action` | Action | No | | Action to execute on CTA click
|
|
890
|
-
| `content.ctaButtons` | array | No | | Multiple CTA buttons (see below)
|
|
891
|
-
| `trigger` | string | No | `"immediate"` | `"immediate"`, `"hover"`, `"click"`
|
|
892
|
-
| `placement` | string | No | `"top"` | See placement options below
|
|
889
|
+
| Property | Type | Required | Default | Description |
|
|
890
|
+
| -------------------- | ----------- | -------- | ------------- | -------------------------------------- |
|
|
891
|
+
| `kind` | `"tooltip"` | Yes | | Action type |
|
|
892
|
+
| `anchorId` | string | Yes | | Element selector |
|
|
893
|
+
| `content.title` | string | No | | Tooltip heading |
|
|
894
|
+
| `content.body` | string | Yes | | Tooltip text |
|
|
895
|
+
| `content.cta.label` | string | No | | CTA button text (single-CTA shorthand) |
|
|
896
|
+
| `content.cta.action` | Action | No | | Action to execute on CTA click |
|
|
897
|
+
| `content.ctaButtons` | array | No | | Multiple CTA buttons (see below) |
|
|
898
|
+
| `trigger` | string | No | `"immediate"` | `"immediate"`, `"hover"`, `"click"` |
|
|
899
|
+
| `placement` | string | No | `"top"` | See placement options below |
|
|
893
900
|
|
|
894
901
|
**Placement options:** `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `left`, `left-start`, `left-end`, `right`, `right-start`, `right-end`
|
|
895
902
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Smart Canvas Runtime SDK
|
|
2
2
|
|
|
3
|
-
## Smart Canvas SDK (React + Shadow DOM)
|
|
3
|
+
## Smart Canvas Runtime SDK (React + Shadow DOM)
|
|
4
4
|
|
|
5
5
|
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.
|
|
6
6
|
|
|
@@ -73,7 +73,7 @@ For quick setup without a build process:
|
|
|
73
73
|
### Local Development
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
cd
|
|
76
|
+
cd packages/runtime-sdk
|
|
77
77
|
npm run build
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -322,7 +322,7 @@ if (result.value) {
|
|
|
322
322
|
- Validate a config file locally:
|
|
323
323
|
|
|
324
324
|
```bash
|
|
325
|
-
cd
|
|
325
|
+
cd packages/runtime-sdk
|
|
326
326
|
npm run validate-config -- path/to/config.json
|
|
327
327
|
```
|
|
328
328
|
|
|
@@ -336,7 +336,7 @@ The SDK uses [semantic-release](https://github.com/semantic-release/semantic-rel
|
|
|
336
336
|
|
|
337
337
|
| Channel | Trigger | npm dist-tag | CDN path |
|
|
338
338
|
| ---------- | ---------------------------------------------- | ------------ | ----------------------------- |
|
|
339
|
-
| **Canary** | Push to `develop` touching `
|
|
339
|
+
| **Canary** | Push to `develop` touching `packages/**` | `develop` | `/v2/canary/` |
|
|
340
340
|
| **Stable** | Manual workflow dispatch from `main` | `latest` | `/v2/latest/` + `/{VERSION}/` |
|
|
341
341
|
|
|
342
342
|
### Commit Messages → Version Bumps
|
|
@@ -411,7 +411,7 @@ https://cdn.syntrologie.com/runtime-sdk/v2/latest/adaptives/{appId}/index.js
|
|
|
411
411
|
|
|
412
412
|
- **"No new version is released"** — 0 relevant commits since last tag. Push a `fix:` or `feat:` commit touching SDK paths.
|
|
413
413
|
- **npm 404 / auth error** — package missing trusted publisher config on npmjs.com.
|
|
414
|
-
- **Format check fails** — run `npx
|
|
414
|
+
- **Format check fails** — run `npx biome check --fix <file>` locally before pushing.
|
|
415
415
|
|
|
416
416
|
---
|
|
417
417
|
|
|
@@ -426,7 +426,7 @@ https://cdn.syntrologie.com/runtime-sdk/v2/latest/adaptives/{appId}/index.js
|
|
|
426
426
|
## Directory Overview
|
|
427
427
|
|
|
428
428
|
```
|
|
429
|
-
|
|
429
|
+
packages/runtime-sdk
|
|
430
430
|
├─ src
|
|
431
431
|
│ ├─ actions/ # ActionEngine (interventions)
|
|
432
432
|
│ │ ├─ types.ts
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides access to the SmartCanvasRuntime from any component in the tree.
|
|
5
5
|
*/
|
|
6
|
-
import { ReactNode } from 'react';
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
7
|
import type { RuntimeContext } from './context/types';
|
|
8
8
|
import type { SmartCanvasRuntime } from './runtime';
|
|
9
9
|
export interface RuntimeProviderProps {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface ShadowRootContextValue {
|
|
3
|
+
shadowRoot: ShadowRoot;
|
|
4
|
+
portalRoot: HTMLElement;
|
|
5
|
+
overlayContainer: HTMLElement;
|
|
6
|
+
}
|
|
7
|
+
export interface ShadowRootProviderProps {
|
|
8
|
+
shadowRoot: ShadowRoot;
|
|
9
|
+
portalRoot: HTMLElement;
|
|
10
|
+
overlayContainer: HTMLElement;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function ShadowRootProvider({ shadowRoot, portalRoot, overlayContainer, children, }: ShadowRootProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Access the shadow root context. Always available — SmartCanvasElement
|
|
16
|
+
* wraps the React tree in ShadowRootProvider, and tests use the helper.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useShadowRoot(): ShadowRootContextValue;
|
|
19
|
+
export {};
|
package/dist/SmartCanvasApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CanvasTheme } from './components/ShadowCanvasOverlay';
|
|
3
|
-
import { SmartCanvasController } from './controller';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CanvasTheme } from './components/ShadowCanvasOverlay';
|
|
3
|
+
import type { SmartCanvasController } from './controller';
|
|
4
4
|
import type { ExperimentClient } from './experiments/types';
|
|
5
5
|
import type { SmartCanvasRuntime } from './runtime';
|
|
6
6
|
import type { TelemetryClient } from './telemetry/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SmartCanvasController } from './controller';
|
|
1
|
+
import { type SmartCanvasController } from './controller';
|
|
2
2
|
import { type SmartCanvasAppProps } from './SmartCanvasApp';
|
|
3
3
|
export declare class SmartCanvasElement extends HTMLElement {
|
|
4
4
|
#private;
|
|
@@ -7,7 +7,12 @@ export declare class SmartCanvasElement extends HTMLElement {
|
|
|
7
7
|
disconnectedCallback(): void;
|
|
8
8
|
getMountNode(): HTMLDivElement;
|
|
9
9
|
getController(): SmartCanvasController;
|
|
10
|
-
|
|
10
|
+
/** React portal target inside shadow root (launcher, drawer, toasts) */
|
|
11
|
+
getPortalRoot(): HTMLDivElement;
|
|
12
|
+
/** Vanilla JS overlay container inside shadow root (tooltips, modals, spotlights) */
|
|
13
|
+
getOverlayContainer(): HTMLDivElement;
|
|
14
|
+
/** Direct access to the shadow root (for style injection) */
|
|
15
|
+
getShadowRoot(): ShadowRoot;
|
|
11
16
|
open(): void;
|
|
12
17
|
close(): void;
|
|
13
18
|
toggle(): void;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Core app executors are imported from their respective app packages.
|
|
8
8
|
*/
|
|
9
9
|
import type { ZodSchema } from 'zod';
|
|
10
|
-
import type {
|
|
10
|
+
import type { ActionExecutor, ActionKind, ActionStep, ValidationResult } from '../types';
|
|
11
11
|
/**
|
|
12
12
|
* Registration entry for an executor.
|
|
13
13
|
*/
|
|
@@ -111,6 +111,6 @@ export declare function getExecutor(kind: ActionKind | string): ActionExecutor<A
|
|
|
111
111
|
* @deprecated Use executorRegistry.has() instead
|
|
112
112
|
*/
|
|
113
113
|
export declare function hasExecutor(kind: ActionKind | string): boolean;
|
|
114
|
-
export { executeInsertHtml,
|
|
115
|
-
export { executeHighlight,
|
|
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';
|
|
116
116
|
export { executeTour } from './tour';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Each step contains an inner action (modal, tooltip) that gets executed.
|
|
8
8
|
* The tour listens for CTA click events to advance to the next step.
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { ActionExecutor, TourAction } from '../types';
|
|
11
11
|
/**
|
|
12
12
|
* Execute a tour action
|
|
13
13
|
*
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Unified execution layer for interventions (highlight, tooltip, badge, DOM modifications).
|
|
5
5
|
*/
|
|
6
6
|
export { createActionEngine } from './ActionEngine';
|
|
7
|
-
export type { ActionEngine, ActionEngineOptions, ActionEngineExecutorRegistry, ActionHandle, BatchActionHandle, ActiveAction, ActionStep, ActionKind, HighlightAction, PulseAction, BadgeAction, TooltipAction, InsertHtmlAction, SetTextAction, SetAttrAction, AddClassAction, RemoveClassAction, SetStyleAction, MountWidgetAction, ScrollToAction, NavigateAction, HighlightStyle, BadgePosition, TooltipContent, TooltipTrigger, InsertPosition, WidgetConfig, ActionState, ValidationResult, ValidationError, ValidationWarning, ExecutorResult, ExecutorContext, ExecutorCleanup, ExecutorUpdate, ActionExecutor, } from './types';
|
|
8
|
-
export { validateAction, validateActions } from './validation';
|
|
9
|
-
export { ExecutorRegistry, executorRegistry, getExecutor, hasExecutor } from './executors';
|
|
10
7
|
export type { ExecutorRegistration } from './executors';
|
|
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';
|
|
11
|
+
export { validateAction, validateActions } from './validation';
|