@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NotificationDeepLinkZ
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GX7BBYX6.js";
|
|
4
4
|
import {
|
|
5
5
|
TriggerWhenZ
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4HXPGXUC.js";
|
|
7
7
|
|
|
8
8
|
// src/actions/schema.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -187,7 +187,7 @@ var ParallelZ = z.object({
|
|
|
187
187
|
label: z.string().optional()
|
|
188
188
|
}).extend(ActionTriggerZ).strict();
|
|
189
189
|
var TourZ = z.object({
|
|
190
|
-
kind: z.literal("
|
|
190
|
+
kind: z.literal("overlays:tour"),
|
|
191
191
|
tourId: z.string(),
|
|
192
192
|
steps: z.array(TourStepForSchemaZ).min(1),
|
|
193
193
|
startStep: z.string().optional(),
|
|
@@ -249,4 +249,4 @@ export {
|
|
|
249
249
|
TourZ,
|
|
250
250
|
coreActionStepSchemas
|
|
251
251
|
};
|
|
252
|
-
//# sourceMappingURL=chunk-
|
|
252
|
+
//# sourceMappingURL=chunk-XVRDKBYF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/actions/schema.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Core Action Zod Schemas\n *\n * Single source of truth for the shape of all 18 core action types.\n * These schemas are converted to JSON Schema during build and merged\n * into the unified canvas-config.schema.json.\n *\n * Design decisions:\n * - `.strict()` on most objects \u2192 `additionalProperties: false` in JSON Schema\n * - Tour/TourStep use `.passthrough()` to allow adaptive-specific extensions (e.g. `workflow`)\n * - Matches `types.ts` exactly (fixes all drift from the old manual JSON defs)\n * - Recursive ActionStep references use `z.any()` as placeholder; the generator\n * replaces `{}` with `{ \"$ref\": \"#/$defs/actionStep\" }` post-conversion\n */\n\nimport { z } from 'zod';\nimport { NotificationDeepLinkZ } from '../config/schema';\nimport { TriggerWhenZ } from '../decisions/schema';\n\n// ============================================================================\n// Shared Sub-Types\n// ============================================================================\n\n/**\n * Conditional execution for actions.\n *\n * Actions use `triggerWhen` (DecisionStrategy) exclusively.\n * NOTE: `activation` (with routes/strategy) is for TILES only \u2014 it is evaluated\n * by `runtime.filterTiles()` in useShadowCanvasConfig but is NEVER checked by\n * ActionEngine. Do not add `activation` here; use `triggerWhen` with a\n * `page_url` condition instead.\n */\nconst ActionTriggerZ = {\n triggerWhen: TriggerWhenZ,\n};\n\n/** Route-scoped anchor identifier */\nconst AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n })\n .strict();\n\n/** Highlight style configuration */\nconst HighlightStyleZ = z\n .object({\n color: z.string().optional(),\n scrimOpacity: z.number().min(0).max(1).optional(),\n paddingPx: z.number().optional(),\n radiusPx: z.number().optional(),\n })\n .strict();\n\n/** Badge position relative to anchor */\nconst BadgePositionZ = z.enum(['top-left', 'top-right', 'bottom-left', 'bottom-right']);\n\n/**\n * Floating-ui Placement \u2014 all 12 values.\n * Matches `@floating-ui/dom` `Placement` type.\n */\nconst PlacementZ = z.enum([\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n]);\n\n/** CTA button configuration for tooltips/modals */\nconst CtaButtonZ = z\n .object({\n label: z.string(),\n actionId: z.string(),\n primary: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Tooltip content (schema-safe version).\n * Omits `cta` (legacy field with recursive ActionStep; never in JSON schema).\n */\nconst TooltipContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n })\n .strict();\n\n/** Modal content configuration */\nconst ModalContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n })\n .strict();\n\n/** Position where HTML/content should be inserted */\nconst InsertPositionZ = z.enum(['before', 'after', 'prepend', 'append', 'replace']);\n\n/** Tooltip trigger mode */\nconst TooltipTriggerZ = z.enum(['immediate', 'hover', 'click']);\n\n/** Widget configuration for surface mounting */\nconst WidgetConfigZ = z\n .object({\n widgetId: z.string(),\n props: z.record(z.unknown()).optional(),\n priority: z.number().optional(),\n })\n .strict();\n\n/**\n * Tour step (schema-safe version).\n * Uses `z.any()` for the `action` field \u2014 the generator replaces it with a $ref.\n */\nconst TourStepForSchemaZ = z\n .object({\n id: z.string(),\n action: z.any(),\n route: z.string().optional(),\n onAction: z.record(z.string()).optional(),\n })\n .passthrough();\n\n// ============================================================================\n// ScrollBehavior / ScrollLogicalPosition (DOM built-in types as Zod enums)\n// ============================================================================\n\nconst ScrollBehaviorZ = z.enum(['auto', 'smooth', 'instant']);\nconst ScrollLogicalPositionZ = z.enum(['start', 'center', 'end', 'nearest']);\n\n// ============================================================================\n// Core Action Schemas (18 total)\n// ============================================================================\n\n// --- Content Actions ---\n\nconst SetTextZ = z\n .object({\n kind: z.literal('content:setText'),\n anchorId: AnchorIdZ,\n text: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst SetAttrZ = z\n .object({\n kind: z.literal('content:setAttr'),\n anchorId: AnchorIdZ,\n attr: z.string(),\n value: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst AddClassZ = z\n .object({\n kind: z.literal('content:addClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst RemoveClassZ = z\n .object({\n kind: z.literal('content:removeClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst SetStyleZ = z\n .object({\n kind: z.literal('content:setStyle'),\n anchorId: AnchorIdZ,\n styles: z.record(z.string()),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst InsertHtmlZ = z\n .object({\n kind: z.literal('content:insertHtml'),\n anchorId: AnchorIdZ,\n html: z.string(),\n position: InsertPositionZ,\n deepLink: NotificationDeepLinkZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Overlay Actions ---\n\nconst HighlightZ = z\n .object({\n kind: z.literal('overlays:highlight'),\n anchorId: AnchorIdZ,\n style: HighlightStyleZ.optional(),\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst PulseZ = z\n .object({\n kind: z.literal('overlays:pulse'),\n anchorId: AnchorIdZ,\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst BadgeZ = z\n .object({\n kind: z.literal('overlays:badge'),\n anchorId: AnchorIdZ,\n content: z.string(),\n position: BadgePositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst TooltipZ = z\n .object({\n kind: z.literal('overlays:tooltip'),\n anchorId: AnchorIdZ,\n content: TooltipContentZ,\n trigger: TooltipTriggerZ.optional(),\n placement: PlacementZ.optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst ModalZ = z\n .object({\n kind: z.literal('overlays:modal'),\n content: ModalContentZ,\n size: z.enum(['sm', 'md', 'lg']).optional(),\n blocking: z.boolean().optional(),\n scrim: z\n .object({\n opacity: z.number().min(0).max(1).optional(),\n })\n .strict()\n .optional(),\n dismiss: z\n .object({\n onEsc: z.boolean().optional(),\n closeButton: z.boolean().optional(),\n timeoutMs: z.number().min(0).optional(),\n })\n .strict()\n .optional(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Navigation Actions ---\n\nconst ScrollToZ = z\n .object({\n kind: z.literal('navigation:scrollTo'),\n anchorId: AnchorIdZ,\n behavior: ScrollBehaviorZ.optional(),\n block: ScrollLogicalPositionZ.optional(),\n inline: ScrollLogicalPositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst NavigateZ = z\n .object({\n kind: z.literal('navigation:navigate'),\n url: z.string(),\n target: z.enum(['_self', '_blank']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Core Primitives ---\n\nconst MountWidgetZ = z\n .object({\n kind: z.literal('core:mountWidget'),\n slot: z.string(),\n widget: WidgetConfigZ,\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst WaitZ = z\n .object({\n kind: z.literal('core:wait'),\n durationMs: z.number().min(0).optional(),\n event: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Sequence \u2014 executes actions serially.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst SequenceZ = z\n .object({\n kind: z.literal('core:sequence'),\n actions: z.array(z.any()),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Parallel \u2014 executes actions concurrently.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst ParallelZ = z\n .object({\n kind: z.literal('core:parallel'),\n actions: z.array(z.any()),\n waitFor: z.enum(['all', 'any']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Tour \u2014 orchestrate sequential steps with cross-page state.\n * `steps` contains TourStepForSchemaZ which uses z.any() for step.action.\n */\nconst TourZ = z\n .object({\n kind: z.literal('core:tour'),\n tourId: z.string(),\n steps: z.array(TourStepForSchemaZ).min(1),\n startStep: z.string().optional(),\n autoStart: z.boolean().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .passthrough();\n\n// ============================================================================\n// Export: Array for unified schema generation\n// ============================================================================\n\n/**\n * All 18 core action step schemas for unified JSON Schema generation.\n * The generator imports this array and converts each to JSON Schema,\n * then merges them into `$defs` and `actionStep.oneOf`.\n *\n * `defName` values match the existing `$defs` keys for backward compat.\n */\nexport const coreActionStepSchemas = [\n { defName: 'setText', schema: SetTextZ },\n { defName: 'setAttr', schema: SetAttrZ },\n { defName: 'addClass', schema: AddClassZ },\n { defName: 'removeClass', schema: RemoveClassZ },\n { defName: 'setStyle', schema: SetStyleZ },\n { defName: 'insertHtml', schema: InsertHtmlZ },\n { defName: 'highlight', schema: HighlightZ },\n { defName: 'pulse', schema: PulseZ },\n { defName: 'badge', schema: BadgeZ },\n { defName: 'tooltip', schema: TooltipZ },\n { defName: 'modal', schema: ModalZ },\n { defName: 'scrollTo', schema: ScrollToZ },\n { defName: 'navigate', schema: NavigateZ },\n { defName: 'mountWidget', schema: MountWidgetZ },\n { defName: 'wait', schema: WaitZ },\n { defName: 'sequence', schema: SequenceZ },\n { defName: 'parallel', schema: ParallelZ },\n { defName: 'tour', schema: TourZ },\n];\n\n// ============================================================================\n// Named Exports (for unit tests and direct usage)\n// ============================================================================\n\nexport {\n // Sub-types\n AnchorIdZ,\n HighlightStyleZ,\n BadgePositionZ,\n PlacementZ,\n CtaButtonZ,\n TooltipContentZ,\n ModalContentZ,\n InsertPositionZ,\n TooltipTriggerZ,\n WidgetConfigZ,\n TourStepForSchemaZ,\n ScrollBehaviorZ,\n ScrollLogicalPositionZ,\n // Actions\n SetTextZ,\n SetAttrZ,\n AddClassZ,\n RemoveClassZ,\n SetStyleZ,\n InsertHtmlZ,\n HighlightZ,\n PulseZ,\n BadgeZ,\n TooltipZ,\n ModalZ,\n ScrollToZ,\n NavigateZ,\n MountWidgetZ,\n WaitZ,\n SequenceZ,\n ParallelZ,\n TourZ,\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAeA,SAAS,SAAS;AAiBlB,IAAM,iBAAiB;AAAA,EACrB,aAAa;AACf;AAGA,IAAM,YAAY,EACf,OAAO;AAAA,EACN,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC,EACA,OAAO;AAGV,IAAM,kBAAkB,EACrB,OAAO;AAAA,EACN,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAChD,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC,EACA,OAAO;AAGV,IAAM,iBAAi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,EACN,MAAM,EAAE,QAAQ,kBAAkB;AAAA,EAClC,MAAM,EAAE,OAAO;AAAA,EACf,QAAQ;AAAA,EACR,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO;AAEV,IAAM,QAAQ,EACX,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,WAAW;AAAA,EAC3B,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACvC,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO;AAMV,IAAM,YAAY,EACf,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,eAAe;AAAA,EAC/B,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC;AAAA,EACxB,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO;AAMV,IAAM,YAAY,EACf,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,eAAe;AAAA,EAC/B,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC;AAAA,EACxB,SAAS,EAAE,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,SAAS;AAAA,EACzC,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC,EACA,OAAO,cAAc,EACrB,OAAO;AAMV,IAAM,QAAQ,EACX,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,
|
|
4
|
+
"sourcesContent": ["/**\n * Core Action Zod Schemas\n *\n * Single source of truth for the shape of all 18 core action types.\n * These schemas are converted to JSON Schema during build and merged\n * into the unified canvas-config.schema.json.\n *\n * Design decisions:\n * - `.strict()` on most objects \u2192 `additionalProperties: false` in JSON Schema\n * - Tour/TourStep use `.passthrough()` to allow adaptive-specific extensions (e.g. `workflow`)\n * - Matches `types.ts` exactly (fixes all drift from the old manual JSON defs)\n * - Recursive ActionStep references use `z.any()` as placeholder; the generator\n * replaces `{}` with `{ \"$ref\": \"#/$defs/actionStep\" }` post-conversion\n */\n\nimport { z } from 'zod';\nimport { NotificationDeepLinkZ } from '../config/schema';\nimport { TriggerWhenZ } from '../decisions/schema';\n\n// ============================================================================\n// Shared Sub-Types\n// ============================================================================\n\n/**\n * Conditional execution for actions.\n *\n * Actions use `triggerWhen` (DecisionStrategy) exclusively.\n * NOTE: `activation` (with routes/strategy) is for TILES only \u2014 it is evaluated\n * by `runtime.filterTiles()` in useShadowCanvasConfig but is NEVER checked by\n * ActionEngine. Do not add `activation` here; use `triggerWhen` with a\n * `page_url` condition instead.\n */\nconst ActionTriggerZ = {\n triggerWhen: TriggerWhenZ,\n};\n\n/** Route-scoped anchor identifier */\nconst AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n })\n .strict();\n\n/** Highlight style configuration */\nconst HighlightStyleZ = z\n .object({\n color: z.string().optional(),\n scrimOpacity: z.number().min(0).max(1).optional(),\n paddingPx: z.number().optional(),\n radiusPx: z.number().optional(),\n })\n .strict();\n\n/** Badge position relative to anchor */\nconst BadgePositionZ = z.enum(['top-left', 'top-right', 'bottom-left', 'bottom-right']);\n\n/**\n * Floating-ui Placement \u2014 all 12 values.\n * Matches `@floating-ui/dom` `Placement` type.\n */\nconst PlacementZ = z.enum([\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n]);\n\n/** CTA button configuration for tooltips/modals */\nconst CtaButtonZ = z\n .object({\n label: z.string(),\n actionId: z.string(),\n primary: z.boolean().optional(),\n })\n .strict();\n\n/**\n * Tooltip content (schema-safe version).\n * Omits `cta` (legacy field with recursive ActionStep; never in JSON schema).\n */\nconst TooltipContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n })\n .strict();\n\n/** Modal content configuration */\nconst ModalContentZ = z\n .object({\n title: z.string().optional(),\n body: z.string(),\n })\n .strict();\n\n/** Position where HTML/content should be inserted */\nconst InsertPositionZ = z.enum(['before', 'after', 'prepend', 'append', 'replace']);\n\n/** Tooltip trigger mode */\nconst TooltipTriggerZ = z.enum(['immediate', 'hover', 'click']);\n\n/** Widget configuration for surface mounting */\nconst WidgetConfigZ = z\n .object({\n widgetId: z.string(),\n props: z.record(z.unknown()).optional(),\n priority: z.number().optional(),\n })\n .strict();\n\n/**\n * Tour step (schema-safe version).\n * Uses `z.any()` for the `action` field \u2014 the generator replaces it with a $ref.\n */\nconst TourStepForSchemaZ = z\n .object({\n id: z.string(),\n action: z.any(),\n route: z.string().optional(),\n onAction: z.record(z.string()).optional(),\n })\n .passthrough();\n\n// ============================================================================\n// ScrollBehavior / ScrollLogicalPosition (DOM built-in types as Zod enums)\n// ============================================================================\n\nconst ScrollBehaviorZ = z.enum(['auto', 'smooth', 'instant']);\nconst ScrollLogicalPositionZ = z.enum(['start', 'center', 'end', 'nearest']);\n\n// ============================================================================\n// Core Action Schemas (18 total)\n// ============================================================================\n\n// --- Content Actions ---\n\nconst SetTextZ = z\n .object({\n kind: z.literal('content:setText'),\n anchorId: AnchorIdZ,\n text: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst SetAttrZ = z\n .object({\n kind: z.literal('content:setAttr'),\n anchorId: AnchorIdZ,\n attr: z.string(),\n value: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst AddClassZ = z\n .object({\n kind: z.literal('content:addClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst RemoveClassZ = z\n .object({\n kind: z.literal('content:removeClass'),\n anchorId: AnchorIdZ,\n className: z.string(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst SetStyleZ = z\n .object({\n kind: z.literal('content:setStyle'),\n anchorId: AnchorIdZ,\n styles: z.record(z.string()),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst InsertHtmlZ = z\n .object({\n kind: z.literal('content:insertHtml'),\n anchorId: AnchorIdZ,\n html: z.string(),\n position: InsertPositionZ,\n deepLink: NotificationDeepLinkZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Overlay Actions ---\n\nconst HighlightZ = z\n .object({\n kind: z.literal('overlays:highlight'),\n anchorId: AnchorIdZ,\n style: HighlightStyleZ.optional(),\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst PulseZ = z\n .object({\n kind: z.literal('overlays:pulse'),\n anchorId: AnchorIdZ,\n duration: z.number().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst BadgeZ = z\n .object({\n kind: z.literal('overlays:badge'),\n anchorId: AnchorIdZ,\n content: z.string(),\n position: BadgePositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst TooltipZ = z\n .object({\n kind: z.literal('overlays:tooltip'),\n anchorId: AnchorIdZ,\n content: TooltipContentZ,\n trigger: TooltipTriggerZ.optional(),\n placement: PlacementZ.optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst ModalZ = z\n .object({\n kind: z.literal('overlays:modal'),\n content: ModalContentZ,\n size: z.enum(['sm', 'md', 'lg']).optional(),\n blocking: z.boolean().optional(),\n scrim: z\n .object({\n opacity: z.number().min(0).max(1).optional(),\n })\n .strict()\n .optional(),\n dismiss: z\n .object({\n onEsc: z.boolean().optional(),\n closeButton: z.boolean().optional(),\n timeoutMs: z.number().min(0).optional(),\n })\n .strict()\n .optional(),\n ctaButtons: z.array(CtaButtonZ).optional(),\n waitFor: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Navigation Actions ---\n\nconst ScrollToZ = z\n .object({\n kind: z.literal('navigation:scrollTo'),\n anchorId: AnchorIdZ,\n behavior: ScrollBehaviorZ.optional(),\n block: ScrollLogicalPositionZ.optional(),\n inline: ScrollLogicalPositionZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst NavigateZ = z\n .object({\n kind: z.literal('navigation:navigate'),\n url: z.string(),\n target: z.enum(['_self', '_blank']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n// --- Core Primitives ---\n\nconst MountWidgetZ = z\n .object({\n kind: z.literal('core:mountWidget'),\n slot: z.string(),\n widget: WidgetConfigZ,\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\nconst WaitZ = z\n .object({\n kind: z.literal('core:wait'),\n durationMs: z.number().min(0).optional(),\n event: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Sequence \u2014 executes actions serially.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst SequenceZ = z\n .object({\n kind: z.literal('core:sequence'),\n actions: z.array(z.any()),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Parallel \u2014 executes actions concurrently.\n * `actions` uses `z.any()` as placeholder for recursive ActionStep refs.\n */\nconst ParallelZ = z\n .object({\n kind: z.literal('core:parallel'),\n actions: z.array(z.any()),\n waitFor: z.enum(['all', 'any']).optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .strict();\n\n/**\n * Tour \u2014 orchestrate sequential steps with cross-page state.\n * `steps` contains TourStepForSchemaZ which uses z.any() for step.action.\n */\nconst TourZ = z\n .object({\n kind: z.literal('overlays:tour'),\n tourId: z.string(),\n steps: z.array(TourStepForSchemaZ).min(1),\n startStep: z.string().optional(),\n autoStart: z.boolean().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .passthrough();\n\n// ============================================================================\n// Export: Array for unified schema generation\n// ============================================================================\n\n/**\n * All 18 core action step schemas for unified JSON Schema generation.\n * The generator imports this array and converts each to JSON Schema,\n * then merges them into `$defs` and `actionStep.oneOf`.\n *\n * `defName` values match the existing `$defs` keys for backward compat.\n */\nexport const coreActionStepSchemas = [\n { defName: 'setText', schema: SetTextZ },\n { defName: 'setAttr', schema: SetAttrZ },\n { defName: 'addClass', schema: AddClassZ },\n { defName: 'removeClass', schema: RemoveClassZ },\n { defName: 'setStyle', schema: SetStyleZ },\n { defName: 'insertHtml', schema: InsertHtmlZ },\n { defName: 'highlight', schema: HighlightZ },\n { defName: 'pulse', schema: PulseZ },\n { defName: 'badge', schema: BadgeZ },\n { defName: 'tooltip', schema: TooltipZ },\n { defName: 'modal', schema: ModalZ },\n { defName: 'scrollTo', schema: ScrollToZ },\n { defName: 'navigate', schema: NavigateZ },\n { defName: 'mountWidget', schema: MountWidgetZ },\n { defName: 'wait', schema: WaitZ },\n { defName: 'sequence', schema: SequenceZ },\n { defName: 'parallel', schema: ParallelZ },\n { defName: 'tour', schema: TourZ },\n];\n\n// ============================================================================\n// Named Exports (for unit tests and direct usage)\n// ============================================================================\n\nexport {\n AddClassZ,\n // Sub-types\n AnchorIdZ,\n BadgePositionZ,\n BadgeZ,\n CtaButtonZ,\n HighlightStyleZ,\n HighlightZ,\n InsertHtmlZ,\n InsertPositionZ,\n ModalContentZ,\n ModalZ,\n MountWidgetZ,\n NavigateZ,\n ParallelZ,\n PlacementZ,\n PulseZ,\n RemoveClassZ,\n ScrollBehaviorZ,\n ScrollLogicalPositionZ,\n ScrollToZ,\n SequenceZ,\n SetAttrZ,\n SetStyleZ,\n // Actions\n SetTextZ,\n TooltipContentZ,\n TooltipTriggerZ,\n TooltipZ,\n TourStepForSchemaZ,\n TourZ,\n WaitZ,\n WidgetConfigZ,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAeA,SAAS,SAAS;AAiBlB,I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AAAA,EACzC,EAAE,SAAS,QAAQ,QAAQ,MAAM;AACnC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,6 @@ export interface ShadowCanvasOverlayProps {
|
|
|
6
6
|
onToggle: () => void;
|
|
7
7
|
telemetry?: TelemetryClient;
|
|
8
8
|
launcherLabel?: string;
|
|
9
|
-
launcherIcon?: string;
|
|
10
9
|
launcherAnimate?: boolean;
|
|
11
10
|
launcherAnimationStyle?: 'pulse' | 'bounce' | 'glow';
|
|
12
11
|
notificationCount?: number;
|
|
@@ -17,4 +16,4 @@ export interface ShadowCanvasOverlayProps {
|
|
|
17
16
|
canvasTitle?: string;
|
|
18
17
|
displayMode?: 'standard' | 'focused';
|
|
19
18
|
}
|
|
20
|
-
export declare function ShadowCanvasOverlay({ isOpen, onToggle, telemetry, launcherLabel: _launcherLabel,
|
|
19
|
+
export declare function ShadowCanvasOverlay({ isOpen, onToggle, telemetry, launcherLabel: _launcherLabel, launcherAnimate, launcherAnimationStyle: _launcherAnimationStyle, notificationCount: _notificationCount, footerSlot, tiles, isLoading, error, canvasTitle, displayMode, }: ShadowCanvasOverlayProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SyntroCanvasOverlay — Lit web component equivalent of ShadowCanvasOverlay.tsx.
|
|
3
|
+
*
|
|
4
|
+
* Composes three child custom elements:
|
|
5
|
+
* - <syntro-launcher> FAB button
|
|
6
|
+
* - <syntro-drawer> Side panel
|
|
7
|
+
* - <syntro-toast-stack> Notification toasts
|
|
8
|
+
*
|
|
9
|
+
* Wiring responsibilities:
|
|
10
|
+
* - Manages open/closed state via isOpen property
|
|
11
|
+
* - Runs NotifyWatcher loop (equivalent of useNotifyWatcher) to fire
|
|
12
|
+
* notification events even when the drawer is closed
|
|
13
|
+
* - Handles notification clicks: publish telemetry events, open canvas,
|
|
14
|
+
* deep-link, dismiss toast
|
|
15
|
+
* - Tracks tile viewed telemetry when canvas opens
|
|
16
|
+
* - Publishes canvas.opened / canvas.closed on each toggle
|
|
17
|
+
* - Forwards all properties to child elements via Lit bindings
|
|
18
|
+
*
|
|
19
|
+
* Uses light DOM (createRenderRoot returns this) so that host-page CSS
|
|
20
|
+
* variables reach the child elements without piercing shadow boundaries.
|
|
21
|
+
*
|
|
22
|
+
* Decorator-free: uses `static override properties` (tsconfig has no
|
|
23
|
+
* experimentalDecorators).
|
|
24
|
+
*/
|
|
25
|
+
import { LitElement } from 'lit';
|
|
26
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
27
|
+
import type { TelemetryClient } from '../telemetry/types.js';
|
|
28
|
+
import type { TileConfig } from '../types.js';
|
|
29
|
+
export declare class SyntroCanvasOverlay extends LitElement {
|
|
30
|
+
static properties: {
|
|
31
|
+
isOpen: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
};
|
|
34
|
+
tiles: {
|
|
35
|
+
attribute: boolean;
|
|
36
|
+
};
|
|
37
|
+
isLoading: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
};
|
|
40
|
+
error: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
};
|
|
43
|
+
canvasTitle: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
};
|
|
46
|
+
displayMode: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
};
|
|
49
|
+
runtimeRef: {
|
|
50
|
+
attribute: boolean;
|
|
51
|
+
};
|
|
52
|
+
telemetry: {
|
|
53
|
+
attribute: boolean;
|
|
54
|
+
};
|
|
55
|
+
themeConfig: {
|
|
56
|
+
attribute: boolean;
|
|
57
|
+
};
|
|
58
|
+
launcherAnimate: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
isOpen: boolean;
|
|
63
|
+
tiles: TileConfig[];
|
|
64
|
+
isLoading: boolean;
|
|
65
|
+
error: string | undefined;
|
|
66
|
+
canvasTitle: string | undefined;
|
|
67
|
+
displayMode: 'standard' | 'focused';
|
|
68
|
+
runtimeRef: SmartCanvasRuntime | null;
|
|
69
|
+
telemetry: TelemetryClient | null;
|
|
70
|
+
themeConfig: Record<string, any>;
|
|
71
|
+
launcherAnimate: boolean;
|
|
72
|
+
private _notifications;
|
|
73
|
+
/** Prev-state map: entry.id → last evaluated boolean */
|
|
74
|
+
private _notifyPrevState;
|
|
75
|
+
/** Unsubscribe for the EventBus notify-watcher subscription */
|
|
76
|
+
private _notifyUnsub;
|
|
77
|
+
/** Unsubscribe for the sessionMetrics notify-watcher subscription */
|
|
78
|
+
private _notifyUnsubMetrics;
|
|
79
|
+
constructor();
|
|
80
|
+
createRenderRoot(): this;
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
disconnectedCallback(): void;
|
|
83
|
+
updated(changed: Map<string, unknown>): void;
|
|
84
|
+
private _syncNotificationsController;
|
|
85
|
+
private _startNotifyWatcher;
|
|
86
|
+
private _stopNotifyWatcher;
|
|
87
|
+
private _restartNotifyWatcher;
|
|
88
|
+
private _trackTilesViewed;
|
|
89
|
+
private _toggle;
|
|
90
|
+
private _handleNotificationClick;
|
|
91
|
+
private _handleNotificationDismiss;
|
|
92
|
+
private _onLauncherToggle;
|
|
93
|
+
private _onDrawerClose;
|
|
94
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
95
|
+
}
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
'syntro-canvas-overlay': SyntroCanvasOverlay;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SyntroDrawer — Lit web component equivalent of the drawer panel from
|
|
3
|
+
* ShadowCanvasOverlay.tsx.
|
|
4
|
+
*
|
|
5
|
+
* Renders the slide-in/out side panel with:
|
|
6
|
+
* - CSS transform (translateX) + opacity transition
|
|
7
|
+
* - Configurable position (left/right), width, blur, border, border-radius
|
|
8
|
+
* - Tile cards (standard: stacked, focused: single full-width)
|
|
9
|
+
* - Loading and error states
|
|
10
|
+
* - Optional canvas title header (focused mode)
|
|
11
|
+
* - Push-mode margin on document.documentElement
|
|
12
|
+
* - ResizeObserver to keep push margin in sync
|
|
13
|
+
* - Outside-click-to-close via document mousedown + composedPath()
|
|
14
|
+
* - Configurable transition duration / easing from theme config
|
|
15
|
+
* - Mask-image fade at leading edge (disabled when border is visible)
|
|
16
|
+
*
|
|
17
|
+
* Decorator-free: uses static `properties` (tsconfig has no experimentalDecorators).
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* <syntro-drawer
|
|
21
|
+
* .isOpen=${true}
|
|
22
|
+
* .tiles=${tiles}
|
|
23
|
+
* .isLoading=${false}
|
|
24
|
+
* .error=${undefined}
|
|
25
|
+
* .canvasTitle=${'My Canvas'}
|
|
26
|
+
* .displayMode=${'standard'}
|
|
27
|
+
* .runtimeRef=${runtime}
|
|
28
|
+
* .telemetry=${telemetry}
|
|
29
|
+
* .themeConfig=${themeConfig}
|
|
30
|
+
* @drawer-close=${handleClose}
|
|
31
|
+
* ></syntro-drawer>
|
|
32
|
+
*/
|
|
33
|
+
import { LitElement } from 'lit';
|
|
34
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
35
|
+
import type { TelemetryClient } from '../telemetry/types.js';
|
|
36
|
+
import type { TileConfig } from '../types.js';
|
|
37
|
+
export interface DrawerThemeConfig {
|
|
38
|
+
canvas: {
|
|
39
|
+
position?: string;
|
|
40
|
+
width?: string;
|
|
41
|
+
layout?: string;
|
|
42
|
+
blur?: string;
|
|
43
|
+
border?: string;
|
|
44
|
+
transitionDuration?: string;
|
|
45
|
+
transitionEasing?: string;
|
|
46
|
+
transitionFade?: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare class SyntroDrawer extends LitElement {
|
|
50
|
+
static properties: {
|
|
51
|
+
isOpen: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
};
|
|
54
|
+
tiles: {
|
|
55
|
+
attribute: boolean;
|
|
56
|
+
};
|
|
57
|
+
isLoading: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
};
|
|
60
|
+
error: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
};
|
|
63
|
+
canvasTitle: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
};
|
|
66
|
+
displayMode: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
};
|
|
69
|
+
runtimeRef: {
|
|
70
|
+
attribute: boolean;
|
|
71
|
+
};
|
|
72
|
+
telemetry: {
|
|
73
|
+
attribute: boolean;
|
|
74
|
+
};
|
|
75
|
+
themeConfig: {
|
|
76
|
+
attribute: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
isOpen: boolean;
|
|
80
|
+
tiles: TileConfig[];
|
|
81
|
+
isLoading: boolean;
|
|
82
|
+
error: string | undefined;
|
|
83
|
+
canvasTitle: string | undefined;
|
|
84
|
+
displayMode: 'standard' | 'focused';
|
|
85
|
+
runtimeRef: SmartCanvasRuntime | null;
|
|
86
|
+
telemetry: TelemetryClient | null;
|
|
87
|
+
themeConfig: DrawerThemeConfig;
|
|
88
|
+
private _containerEl;
|
|
89
|
+
private _resizeObserver;
|
|
90
|
+
private _onDocumentMousedown;
|
|
91
|
+
createRenderRoot(): this;
|
|
92
|
+
private get _canvas();
|
|
93
|
+
private get _isRight();
|
|
94
|
+
private get _isPush();
|
|
95
|
+
private get _isFocused();
|
|
96
|
+
private get _canvasBorder();
|
|
97
|
+
private get _duration();
|
|
98
|
+
private get _easing();
|
|
99
|
+
connectedCallback(): void;
|
|
100
|
+
updated(changed: Map<string, unknown>): void;
|
|
101
|
+
disconnectedCallback(): void;
|
|
102
|
+
private _teardownResizeObserver;
|
|
103
|
+
private _cleanupPushMargin;
|
|
104
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
105
|
+
}
|
|
106
|
+
declare global {
|
|
107
|
+
interface HTMLElementTagNameMap {
|
|
108
|
+
'syntro-drawer': SyntroDrawer;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SyntroLauncher — Lit web component equivalent of the launcher FAB
|
|
3
|
+
* from ShadowCanvasOverlay.tsx.
|
|
4
|
+
*
|
|
5
|
+
* Renders a floating action button that:
|
|
6
|
+
* - Toggles the canvas open/closed (fires `launcher-toggle`)
|
|
7
|
+
* - Supports drag-to-reposition (pointerdown/move/up with 5px threshold)
|
|
8
|
+
* - Shows different icons: X when open, custom image if configured, sparkles default
|
|
9
|
+
* - Pulse/glow animation when `launcherAnimate` is true and canvas is closed
|
|
10
|
+
* - Notification badge with count, ping ring, glow pulse, and bounce animation
|
|
11
|
+
* - Hover changes background color using theme config values
|
|
12
|
+
* - CSS keyframe animations built dynamically using theme colors
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* <syntro-launcher
|
|
16
|
+
* .isOpen=${false}
|
|
17
|
+
* .launcherAnimate=${true}
|
|
18
|
+
* .notificationCount=${3}
|
|
19
|
+
* .position=${'right'}
|
|
20
|
+
* .launcherIcon=${null}
|
|
21
|
+
* .colorPrimary=${primaryHex}
|
|
22
|
+
* .colorPrimaryHover=${primaryHoverHex}
|
|
23
|
+
* .launcherConfig=${{ background: bgHex, backgroundHover: hoverHex }}
|
|
24
|
+
* ></syntro-launcher>
|
|
25
|
+
*
|
|
26
|
+
* element.addEventListener('launcher-toggle', () => { ... });
|
|
27
|
+
*
|
|
28
|
+
* Decorator-free: uses `static override properties` (tsconfig has no experimentalDecorators).
|
|
29
|
+
* Light DOM: uses `createRenderRoot() { return this; }` to inherit parent shadow CSS vars.
|
|
30
|
+
*/
|
|
31
|
+
import { LitElement } from 'lit';
|
|
32
|
+
import type { LauncherElementConfig } from '../theme/types.js';
|
|
33
|
+
export declare class SyntroLauncher extends LitElement {
|
|
34
|
+
static properties: {
|
|
35
|
+
isOpen: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
};
|
|
38
|
+
launcherAnimate: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
};
|
|
41
|
+
notificationCount: {
|
|
42
|
+
type: NumberConstructor;
|
|
43
|
+
};
|
|
44
|
+
position: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
launcherIcon: {
|
|
48
|
+
attribute: boolean;
|
|
49
|
+
};
|
|
50
|
+
colorPrimary: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
};
|
|
53
|
+
colorPrimaryHover: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
};
|
|
56
|
+
launcherConfig: {
|
|
57
|
+
attribute: boolean;
|
|
58
|
+
};
|
|
59
|
+
_launcherPos: {
|
|
60
|
+
state: boolean;
|
|
61
|
+
};
|
|
62
|
+
_hovered: {
|
|
63
|
+
state: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
isOpen: boolean;
|
|
67
|
+
launcherAnimate: boolean;
|
|
68
|
+
notificationCount: number;
|
|
69
|
+
position: 'left' | 'right';
|
|
70
|
+
launcherIcon: string | null;
|
|
71
|
+
colorPrimary: string;
|
|
72
|
+
colorPrimaryHover: string;
|
|
73
|
+
launcherConfig: LauncherElementConfig;
|
|
74
|
+
_launcherPos: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
} | null;
|
|
78
|
+
_hovered: boolean;
|
|
79
|
+
private _drag;
|
|
80
|
+
private _styleEl;
|
|
81
|
+
createRenderRoot(): this;
|
|
82
|
+
connectedCallback(): void;
|
|
83
|
+
updated(changed: Map<string, unknown>): void;
|
|
84
|
+
disconnectedCallback(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Inject/update a <style> element with dynamic keyframe CSS that uses
|
|
87
|
+
* the current colorPrimary and colorPrimaryHover values.
|
|
88
|
+
* These cannot live in `static styles` because keyframe values
|
|
89
|
+
* need to be literal colors (var() is unreliable in keyframes).
|
|
90
|
+
*/
|
|
91
|
+
private _ensureDynamicStyles;
|
|
92
|
+
private _onPointerDown;
|
|
93
|
+
private _onPointerMove;
|
|
94
|
+
private _onPointerUp;
|
|
95
|
+
private _onMouseEnter;
|
|
96
|
+
private _onMouseLeave;
|
|
97
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
98
|
+
private _renderIcon;
|
|
99
|
+
private _renderBadge;
|
|
100
|
+
}
|
|
101
|
+
declare global {
|
|
102
|
+
interface HTMLElementTagNameMap {
|
|
103
|
+
'syntro-launcher': SyntroLauncher;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SyntroTileCard — Lit web component equivalent of TileCard.tsx.
|
|
3
|
+
*
|
|
4
|
+
* Renders a tile card with header (icon + title + subtitle) and body
|
|
5
|
+
* (imperatively mounted widget). Preserves:
|
|
6
|
+
* - IntersectionObserver tracking for `syntro_intervention_seen`
|
|
7
|
+
* - EventBus subscription for `syntro_intervention_interacted`
|
|
8
|
+
* - Hover effects (scale + background change)
|
|
9
|
+
* - CSS variable theming (var(--sc-tile-*))
|
|
10
|
+
* - Imperative widget mounting via WidgetRegistry
|
|
11
|
+
* - Late widget registration (subscribes to registry for re-render)
|
|
12
|
+
* - Prop forwarding without remounting
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* <syntro-tile-card
|
|
16
|
+
* .config=${tileConfig}
|
|
17
|
+
* .surface=${'overlay'}
|
|
18
|
+
* .runtimeRef=${runtime}
|
|
19
|
+
* ></syntro-tile-card>
|
|
20
|
+
*
|
|
21
|
+
* Decorator-free: uses static `properties` (tsconfig has no experimentalDecorators).
|
|
22
|
+
*/
|
|
23
|
+
import { LitElement, nothing } from 'lit';
|
|
24
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
25
|
+
import type { TileConfig } from '../types.js';
|
|
26
|
+
export declare class SyntroTileCard extends LitElement {
|
|
27
|
+
static properties: {
|
|
28
|
+
config: {
|
|
29
|
+
attribute: boolean;
|
|
30
|
+
};
|
|
31
|
+
surface: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
runtimeRef: {
|
|
35
|
+
attribute: boolean;
|
|
36
|
+
};
|
|
37
|
+
_hovered: {
|
|
38
|
+
state: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
config: TileConfig | null;
|
|
42
|
+
surface: 'overlay' | 'wheel';
|
|
43
|
+
runtimeRef: SmartCanvasRuntime | null;
|
|
44
|
+
_hovered: boolean;
|
|
45
|
+
private _widgetHandle;
|
|
46
|
+
private _widgetContainer;
|
|
47
|
+
private _mountedWidgetId;
|
|
48
|
+
private _registryUnsub;
|
|
49
|
+
private _eventBusUnsub;
|
|
50
|
+
private _intersectionObserver;
|
|
51
|
+
private _prevPropsJson;
|
|
52
|
+
createRenderRoot(): this;
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
updated(changed: Map<string, unknown>): void;
|
|
55
|
+
disconnectedCallback(): void;
|
|
56
|
+
private _mountWidgetIfReady;
|
|
57
|
+
private _unmountWidget;
|
|
58
|
+
private _forwardPropUpdates;
|
|
59
|
+
private _setupRegistrySubscription;
|
|
60
|
+
private _setupIntersectionObserver;
|
|
61
|
+
private _setupEventBusSubscription;
|
|
62
|
+
private _teardownSubscriptions;
|
|
63
|
+
private get _registration();
|
|
64
|
+
private get _resolvedIcon();
|
|
65
|
+
private get _resolvedSubtitle();
|
|
66
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
67
|
+
private _onMouseEnter;
|
|
68
|
+
private _onMouseLeave;
|
|
69
|
+
}
|
|
70
|
+
declare global {
|
|
71
|
+
interface HTMLElementTagNameMap {
|
|
72
|
+
'syntro-tile-card': SyntroTileCard;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
import type { SmartCanvasRuntime } from '../runtime.js';
|
|
3
|
+
import type { TelemetryClient } from '../telemetry/types.js';
|
|
4
|
+
import type { TileConfig } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* <syntro-tile-wheel>
|
|
7
|
+
*
|
|
8
|
+
* Lit port of TileWheel.tsx — a carousel that auto-rotates through a sorted
|
|
9
|
+
* list of tiles, tracks telemetry, and shows clickable dot indicators.
|
|
10
|
+
*
|
|
11
|
+
* Uses static properties (no decorators) — tsconfig has no experimentalDecorators.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SyntroTileWheel extends LitElement {
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
static properties: {
|
|
16
|
+
tiles: {
|
|
17
|
+
type: ArrayConstructor;
|
|
18
|
+
};
|
|
19
|
+
intervalMs: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
};
|
|
22
|
+
telemetry: {
|
|
23
|
+
type: ObjectConstructor;
|
|
24
|
+
};
|
|
25
|
+
runtimeRef: {
|
|
26
|
+
type: ObjectConstructor;
|
|
27
|
+
};
|
|
28
|
+
_index: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
state: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
tiles: TileConfig[];
|
|
34
|
+
intervalMs: number;
|
|
35
|
+
telemetry: TelemetryClient | null;
|
|
36
|
+
runtimeRef: SmartCanvasRuntime | null;
|
|
37
|
+
private _index;
|
|
38
|
+
private _ordered;
|
|
39
|
+
private _intervalId;
|
|
40
|
+
private _canvasOpenedTracked;
|
|
41
|
+
connectedCallback(): void;
|
|
42
|
+
disconnectedCallback(): void;
|
|
43
|
+
updated(changed: Map<string, unknown>): void;
|
|
44
|
+
private _syncOrdered;
|
|
45
|
+
private _trackCanvasOpened;
|
|
46
|
+
private _trackRectangleViewed;
|
|
47
|
+
private _startInterval;
|
|
48
|
+
private _stopInterval;
|
|
49
|
+
private _goTo;
|
|
50
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
51
|
+
}
|