@syntrologie/adapt-nav 2.8.0-canary.243 → 2.8.0-canary.245
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/dist/{chunk-ZYHZ6JAD.js → chunk-T25MLN7O.js} +15 -1
- package/dist/chunk-T25MLN7O.js.map +7 -0
- package/dist/runtime.d.ts +5 -10
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +13 -11
- package/dist/runtime.js.map +2 -2
- package/dist/schema.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZYHZ6JAD.js.map +0 -7
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
// ../../sdk-contracts/dist/mount-plumbing.js
|
|
2
|
+
var MOUNT_PLUMBING_KEYS = ["instanceId", "runtime", "tileId"];
|
|
3
|
+
function stripMountPlumbing(config) {
|
|
4
|
+
if (!config || typeof config !== "object") {
|
|
5
|
+
return {};
|
|
6
|
+
}
|
|
7
|
+
const out = { ...config };
|
|
8
|
+
for (const key of MOUNT_PLUMBING_KEYS) {
|
|
9
|
+
delete out[key];
|
|
10
|
+
}
|
|
11
|
+
return out;
|
|
12
|
+
}
|
|
13
|
+
|
|
1
14
|
// ../../sdk-contracts/dist/schemas.js
|
|
2
15
|
import { z } from "zod";
|
|
3
16
|
var AnchorIdZ = z.object({
|
|
@@ -439,9 +452,10 @@ function renderIcon(emoji, options = {}) {
|
|
|
439
452
|
|
|
440
453
|
export {
|
|
441
454
|
renderIcon,
|
|
455
|
+
stripMountPlumbing,
|
|
442
456
|
AnchorIdZ,
|
|
443
457
|
AuthoringFieldsZ,
|
|
444
458
|
TriggerWhenZ,
|
|
445
459
|
NotifyZ
|
|
446
460
|
};
|
|
447
|
-
//# sourceMappingURL=chunk-
|
|
461
|
+
//# sourceMappingURL=chunk-T25MLN7O.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../sdk-contracts/dist/mount-plumbing.js", "../../../sdk-contracts/dist/schemas.js", "../../../sdk-contracts/dist/icons.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Mount contract types and helper for adaptive widget mountables.\n *\n * The `WidgetRegistry` in `@syntrologie/runtime-sdk` delivers props to each\n * mountable as `{ ...tile.props, instanceId, runtime, tileId? }` spread flat\n * (see `MountableContract.test.ts` in runtime-sdk for the end-to-end lockdown).\n *\n * Adaptives that strip plumbing manually maintain private blacklists that\n * silently drift when the contract grows (PR #2234 and #2238 documented this).\n * `stripMountPlumbing` centralizes the list so adding a new plumbing key in\n * the future is a one-line change here that every adaptive picks up automatically.\n *\n * Adaptives whose widget schemas use Zod `.strict()` MUST call this before\n * validating, or strict-mode will reject the runtime-injected keys and the\n * widget will silently render its empty/error state.\n */\nexport const MOUNT_PLUMBING_KEYS = ['instanceId', 'runtime', 'tileId'];\nexport function stripMountPlumbing(config) {\n if (!config || typeof config !== 'object') {\n return {};\n }\n const out = { ...config };\n for (const key of MOUNT_PLUMBING_KEYS) {\n delete out[key];\n }\n return out;\n}\n", "/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 title / description / validation\n//\n// These live on every action *during authoring* (LLM produces them; dashboard\n// displays them; reviewers QA-verify with them) but are stripped before the\n// runtime SDK receives the config. Stripping happens server-side in\n// `to_runtime_config` (platform/backend/app/domains/experiments/helpers.py).\n// They appear in the JSON Schema (and therefore in the tactician's prompt)\n// because the LLM needs to know they are valid action properties \u2014 otherwise\n// schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions. Validation is an ordered list of\n// human-readable step strings \u2014 reviewers scan it as a checklist.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions. */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n // Derived behavioral signals\n 'behavior.rage_click',\n 'behavior.hesitation',\n 'behavior.confusion',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Centralized emoji \u2192 Lucide SVG icon mapping.\n *\n * Adaptives and the runtime can render config-supplied emoji icons as inline\n * Lucide SVGs without depending on `lucide-react`. Sourced from\n * https://lucide.dev (ISC license).\n *\n * Each entry is an array of inner SVG elements (`<path>`, `<polygon>`,\n * `<circle>`, etc.) for the canonical 24\u00D724 viewBox. `renderIcon()` wraps\n * them in a `<svg>` of the requested size + colour.\n *\n * If you add a new emoji to a config (action plan icon, FAQ icon, nav tip\n * icon, \u2026) add a matching entry here so it renders as a Lucide SVG instead\n * of falling back to the raw glyph.\n */\nconst PREFIX = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"';\n/** Inner-SVG path/shape data keyed by emoji character. */\nexport const EMOJI_SVG_PATHS = {\n // \u2500\u2500 existing in adaptive-nav \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCB5': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83C\uDFDB\uFE0F': [\n '<line x1=\"3\" x2=\"21\" y1=\"22\" y2=\"22\"/>',\n '<line x1=\"6\" x2=\"6\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"10\" x2=\"10\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"14\" x2=\"14\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"18\" x2=\"18\" y1=\"18\" y2=\"11\"/>',\n '<polygon points=\"12 2 20 7 4 7\"/>',\n ],\n '\u23ED\uFE0F': ['<polygon points=\"5 4 15 12 5 20 5 4\"/>', '<line x1=\"19\" x2=\"19\" y1=\"5\" y2=\"19\"/>'],\n '\u27A1\uFE0F': ['<path d=\"M5 12h14\"/>', '<path d=\"m12 5 7 7-7 7\"/>'],\n '\uD83D\uDCA1': [\n '<path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/>',\n '<path d=\"M9 18h6\"/>',\n '<path d=\"M10 22h4\"/>',\n ],\n '\uD83D\uDCB0': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83D\uDCCB': [\n '<rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\"/>',\n '<path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"/>',\n '<path d=\"M12 11h4\"/>',\n '<path d=\"M12 16h4\"/>',\n '<path d=\"M8 11h.01\"/>',\n '<path d=\"M8 16h.01\"/>',\n ],\n '\u2705': ['<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/>', '<path d=\"m9 11 3 3L22 4\"/>'],\n '\u26A0\uFE0F': [\n '<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/>',\n '<path d=\"M12 9v4\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n // \u2500\u2500 added for healthmaxxer action_plans \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDEE1\uFE0F': [\n '<path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\"/>',\n ],\n '\uD83D\uDCC8': [\n '<polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>',\n '<polyline points=\"16 7 22 7 22 13\"/>',\n ],\n '\uD83D\uDD2C': [\n '<path d=\"M6 18h8\"/>',\n '<path d=\"M3 22h18\"/>',\n '<path d=\"M14 22a7 7 0 1 0 0-14h-1\"/>',\n '<path d=\"M9 14h2\"/>',\n '<path d=\"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z\"/>',\n '<path d=\"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3\"/>',\n ],\n '\uD83D\uDC8A': [\n '<path d=\"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z\"/>',\n '<path d=\"m8.5 8.5 7 7\"/>',\n ],\n '\uD83D\uDCC4': [\n '<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/>',\n '<path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/>',\n '<path d=\"M10 9H8\"/>',\n '<path d=\"M16 13H8\"/>',\n '<path d=\"M16 17H8\"/>',\n ],\n '\uD83E\uDDEA': [\n '<path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\"/>',\n '<path d=\"M6.453 15h11.094\"/>',\n '<path d=\"M8.5 2h7\"/>',\n ],\n '\uD83D\uDD01': [\n '<path d=\"m17 2 4 4-4 4\"/>',\n '<path d=\"M3 11v-1a4 4 0 0 1 4-4h14\"/>',\n '<path d=\"m7 22-4-4 4-4\"/>',\n '<path d=\"M21 13v1a4 4 0 0 1-4 4H3\"/>',\n ],\n '\uD83E\uDDE0': [\n '<path d=\"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z\"/>',\n '<path d=\"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z\"/>',\n '<path d=\"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4\"/>',\n '<path d=\"M17.599 6.5a3 3 0 0 0 .399-1.375\"/>',\n '<path d=\"M6.003 5.125A3 3 0 0 0 6.401 6.5\"/>',\n '<path d=\"M3.477 10.896a4 4 0 0 1 .585-.396\"/>',\n '<path d=\"M19.938 10.5a4 4 0 0 1 .585.396\"/>',\n '<path d=\"M6 18a4 4 0 0 1-1.967-.516\"/>',\n '<path d=\"M19.967 17.484A4 4 0 0 1 18 18\"/>',\n ],\n '\uD83C\uDF19': ['<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"/>'],\n '\uD83D\uDCE6': [\n '<path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\"/>',\n '<path d=\"M12 22V12\"/>',\n '<path d=\"m3.3 7 8.7 5 8.7-5\"/>',\n '<path d=\"m7.5 4.27 9 5.15\"/>',\n ],\n '\uD83D\uDE9A': [\n // Lucide truck\n '<path d=\"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2\"/>',\n '<path d=\"M15 18H9\"/>',\n '<path d=\"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14\"/>',\n '<circle cx=\"17\" cy=\"18\" r=\"2\"/>',\n '<circle cx=\"7\" cy=\"18\" r=\"2\"/>',\n ],\n '\uD83C\uDF31': [\n '<path d=\"M7 20h10\"/>',\n '<path d=\"M10 20c5.5-2.5.8-6.4 3-10\"/>',\n '<path d=\"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z\"/>',\n '<path d=\"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z\"/>',\n ],\n '\u26A1': [\n '<path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\"/>',\n ],\n '\uD83D\uDD25': [\n // Lucide flame\n '<path d=\"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z\"/>',\n ],\n '\uD83C\uDF33': [\n '<path d=\"M12 22V8\"/>',\n '<path d=\"m17 8-5-6-5 6\"/>',\n '<path d=\"M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0\"/>',\n '<path d=\"M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0\"/>',\n ],\n '\uD83C\uDF3F': [\n '<path d=\"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5\"/>',\n '<path d=\"M2 21c0-3 1.85-5.36 5.08-6\"/>',\n ],\n // \u2500\u2500 added for runtime-sdk SyntroTileCard / SyntroToastStack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\u2753': [\n // HelpCircle\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n '\uD83E\uDDED': [\n // Compass\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<polygon points=\"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76\"/>',\n ],\n '\uD83D\uDCDD': [\n // FileText\n '<path d=\"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z\"/>',\n '<polyline points=\"14 2 14 8 20 8\"/>',\n '<line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/>',\n '<line x1=\"10\" y1=\"9\" x2=\"8\" y2=\"9\"/>',\n ],\n '\uD83C\uDFAF': [\n // Layers (bullseye-shaped emoji rendered as Lucide Layers \u2014 historical)\n '<polygon points=\"12 2 2 7 12 12 22 7 12 2\"/>',\n '<polyline points=\"2 17 12 22 22 17\"/>',\n '<polyline points=\"2 12 12 17 22 12\"/>',\n ],\n '\uD83C\uDFC6': [\n // Trophy\n '<path d=\"M6 9H4.5a2.5 2.5 0 0 1 0-5H6\"/>',\n '<path d=\"M18 9h1.5a2.5 2.5 0 0 0 0-5H18\"/>',\n '<path d=\"M4 22h16\"/>',\n '<path d=\"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22\"/>',\n '<path d=\"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22\"/>',\n '<path d=\"M18 2H6v7a6 6 0 0 0 12 0V2Z\"/>',\n ],\n '\u2728': [\n // Sparkles\n '<path d=\"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z\"/>',\n '<path d=\"M5 3v4\"/>',\n '<path d=\"M19 17v4\"/>',\n '<path d=\"M3 5h4\"/>',\n '<path d=\"M17 19h4\"/>',\n ],\n '\uD83D\uDCAC': [\n // MessageCircle\n '<path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\"/>',\n ],\n '\uD83C\uDFAE': [\n // Gamepad2\n '<line x1=\"6\" y1=\"11\" x2=\"10\" y2=\"11\"/>',\n '<line x1=\"8\" y1=\"9\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"15\" y1=\"12\" x2=\"15.01\" y2=\"12\"/>',\n '<line x1=\"18\" y1=\"10\" x2=\"18.01\" y2=\"10\"/>',\n '<path d=\"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z\"/>',\n ],\n '\u23F1\uFE0F': [\n // Timer\n '<line x1=\"10\" y1=\"2\" x2=\"14\" y2=\"2\"/>',\n '<line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"8\"/>',\n '<circle cx=\"12\" cy=\"14\" r=\"8\"/>',\n ],\n '\uD83D\uDCD6': [\n // BookOpen\n '<path d=\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\"/>',\n '<path d=\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\"/>',\n ],\n '\uD83D\uDD14': [\n // Bell\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>',\n '<path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n ],\n // \u2500\u2500 common UI icons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83C\uDF93': [\n // GraduationCap\n '<path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\"/>',\n '<path d=\"M22 10v6\"/>',\n '<path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\"/>',\n ],\n '\u23F0': [\n // AlarmClock\n '<circle cx=\"12\" cy=\"13\" r=\"8\"/>',\n '<path d=\"M12 9v4l2 2\"/>',\n '<path d=\"M5 3 2 6\"/>',\n '<path d=\"m22 6-3-3\"/>',\n '<path d=\"M6.38 18.7 4 21\"/>',\n '<path d=\"M17.64 18.67 20 21\"/>',\n ],\n '\uD83D\uDD04': [\n // RefreshCw\n '<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\"/>',\n '<path d=\"M21 3v5h-5\"/>',\n '<path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\"/>',\n '<path d=\"M8 16H3v5\"/>',\n ],\n '\uD83D\uDC64': [\n // User\n '<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/>',\n '<circle cx=\"12\" cy=\"7\" r=\"4\"/>',\n ],\n '\uD83C\uDFE0': [\n // House\n '<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"/>',\n '<path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>',\n ],\n '\uD83D\uDED2': [\n // ShoppingCart\n '<circle cx=\"8\" cy=\"21\" r=\"1\"/>',\n '<circle cx=\"19\" cy=\"21\" r=\"1\"/>',\n '<path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\"/>',\n ],\n // \u2500\u2500 viz / chart icons (paired with adaptive-viz) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCCA': [\n // BarChart3 \u2014 pairs with \uD83D\uDCC8 (TrendingUp)\n '<path d=\"M3 3v18h18\"/>',\n '<path d=\"M18 17V9\"/>',\n '<path d=\"M13 17V5\"/>',\n '<path d=\"M8 17v-3\"/>',\n ],\n '\uD83D\uDCC9': [\n // TrendingDown\n '<polyline points=\"22 17 13.5 8.5 8.5 13.5 2 7\"/>',\n '<polyline points=\"16 17 22 17 22 11\"/>',\n ],\n '\uD83E\uDD67': [\n // PieChart\n '<path d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"/>',\n '<path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\"/>',\n ],\n '\uD83D\uDCB9': [\n // Activity \u2014 line-chart-style waveform\n '<path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2\"/>',\n ],\n '\uD83C\uDF21\uFE0F': [\n // Thermometer \u2014 gauge-style indicator\n '<path d=\"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z\"/>',\n ],\n};\n/**\n * Render a Lucide SVG for the given emoji. Returns the inline `<svg>` string.\n * If the emoji isn't mapped, returns an empty string \u2014 caller should fall back\n * to rendering the raw emoji glyph (e.g. via text or HTML escape).\n */\nexport function renderIcon(emoji, options = {}) {\n const paths = EMOJI_SVG_PATHS[emoji];\n if (!paths)\n return '';\n const size = options.size ?? 14;\n const stroke = options.color ?? 'currentColor';\n return `${PREFIX} width=\"${size}\" height=\"${size}\" stroke=\"${stroke}\">${paths.join('')}</svg>`;\n}\n/** Whether an emoji has a Lucide SVG mapping. */\nexport function hasIcon(emoji) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: tsconfig target ES2020 doesn't include Object.hasOwn\n return Object.prototype.hasOwnProperty.call(EMOJI_SVG_PATHS, emoji);\n}\n"],
|
|
5
|
+
"mappings": ";AAgBO,IAAM,sBAAsB,CAAC,cAAc,WAAW,QAAQ;AAC9D,SAAS,mBAAmB,QAAQ;AACvC,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACvC,WAAO,CAAC;AAAA,EACZ;AACA,QAAM,MAAM,EAAE,GAAG,OAAO;AACxB,aAAW,OAAO,qBAAqB;AACnC,WAAO,IAAI,GAAG;AAAA,EAClB;AACA,SAAO;AACX;;;ACpBA,SAAS,SAAS;AAIX,IAAM,YAAY,EACpB,OAAO;AAAA,EACR,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,EACI,OAAO;AAgBL,IAAM,mBAAmB;AAAA,EAC5B,OAAO,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,6GAA6G;AAAA,EAC3H,aAAa,EACR,OAAO,EACP,IAAI,GAAI,EACR,SAAS,EACT,SAAS,wHAAwH;AAAA,EACtI,YAAY,EACP,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EACzB,IAAI,EAAE,EACN,SAAS,EACT,SAAS,+KAA+K;AACjM;AAMO,IAAM,mBAAmB;AAAA;AAAA,EAE5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AA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AC;AACD,WAAO;AACX,QAAM,OAAO,QAAQ,QAAQ;AAC7B,QAAM,SAAS,QAAQ,SAAS;AAChC,SAAO,GAAG,MAAM,WAAW,IAAI,aAAa,IAAI,aAAa,MAAM,KAAK,MAAM,KAAK,EAAE,CAAC;AAC1F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Includes widget-based nav tips and navigation action executors
|
|
7
7
|
* (scrollTo, navigate) previously in adaptive-navigation.
|
|
8
8
|
*/
|
|
9
|
+
import { type MountPlumbing } from '@syntrologie/sdk-contracts';
|
|
9
10
|
import type { ActionExecutor, NavConfig, NavigateAction, NavWidgetRuntime, ScrollToAction } from './types';
|
|
10
11
|
/**
|
|
11
12
|
* Execute a scrollTo action
|
|
@@ -25,15 +26,10 @@ export declare function navigateWithFrameworkRouter(url: string): boolean;
|
|
|
25
26
|
* Execute a navigate action
|
|
26
27
|
*/
|
|
27
28
|
export declare const executeNavigate: ActionExecutor<NavigateAction>;
|
|
28
|
-
/**
|
|
29
|
-
* NavWidgetLitMountable — Mounts the `<syntro-nav-tips>` Lit web component.
|
|
30
|
-
* Self-registers the custom element on first use.
|
|
31
|
-
*/
|
|
32
29
|
export declare const NavWidgetLitMountable: {
|
|
33
|
-
mount(container: HTMLElement, config?: NavConfig & {
|
|
30
|
+
mount(container: HTMLElement, config?: (NavConfig & MountPlumbing & {
|
|
34
31
|
runtime?: NavWidgetRuntime;
|
|
35
|
-
|
|
36
|
-
}): () => void;
|
|
32
|
+
}) | null): () => void;
|
|
37
33
|
};
|
|
38
34
|
/**
|
|
39
35
|
* All executors provided by this app.
|
|
@@ -74,10 +70,9 @@ export declare const runtime: {
|
|
|
74
70
|
widgets: {
|
|
75
71
|
id: string;
|
|
76
72
|
component: {
|
|
77
|
-
mount(container: HTMLElement, config?: NavConfig & {
|
|
73
|
+
mount(container: HTMLElement, config?: (NavConfig & MountPlumbing & {
|
|
78
74
|
runtime?: NavWidgetRuntime;
|
|
79
|
-
|
|
80
|
-
}): () => void;
|
|
75
|
+
}) | null): () => void;
|
|
81
76
|
};
|
|
82
77
|
metadata: {
|
|
83
78
|
name: string;
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAEpF,OAAO,KAAK,EACV,cAAc,EAEd,SAAS,EACT,cAAc,EAEd,gBAAgB,EAChB,cAAc,EACf,MAAM,SAAS,CAAC;AAMjB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,cAAc,CA+B1D,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAgDhE;AAgBD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,cAAc,CAuC1D,CAAC;AAgBF,eAAO,MAAM,qBAAqB;qBAEnB,WAAW,WACb,CAAC,SAAS,GAAG,aAAa,GAAG;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC,GAAG,IAAI;CAuB/E,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;EAGZ,CAAC;AAMX;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;;IAMlB;;OAEG;;;;;;;;IAGH;;OAEG;;;;6BA/DU,WAAW,WACb,CAAC,SAAS,GAAG,aAAa,GAAG;gBAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;aAAE,CAAC,GAAG,IAAI;;;;;;;;IA2E9E;;;;OAIG;0BACmB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;CAgB9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
renderIcon
|
|
3
|
-
|
|
2
|
+
renderIcon,
|
|
3
|
+
stripMountPlumbing
|
|
4
|
+
} from "./chunk-T25MLN7O.js";
|
|
4
5
|
import {
|
|
5
6
|
__privateAdd,
|
|
6
7
|
__privateGet,
|
|
@@ -550,19 +551,20 @@ var executeNavigate = async (action, context) => {
|
|
|
550
551
|
}
|
|
551
552
|
};
|
|
552
553
|
};
|
|
554
|
+
var DEFAULT_NAV_CONFIG = {
|
|
555
|
+
expandBehavior: "single",
|
|
556
|
+
theme: "auto",
|
|
557
|
+
actions: []
|
|
558
|
+
};
|
|
553
559
|
var NavWidgetLitMountable = {
|
|
554
560
|
mount(container, config) {
|
|
555
561
|
registerNavWidgetLit();
|
|
556
562
|
const el = document.createElement("syntro-nav-tips");
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
expandBehavior: "single",
|
|
563
|
-
theme: "auto",
|
|
564
|
-
actions: []
|
|
565
|
-
};
|
|
563
|
+
const incoming = config ?? null;
|
|
564
|
+
const stripped = stripMountPlumbing(incoming);
|
|
565
|
+
const runtime2 = incoming?.runtime;
|
|
566
|
+
const instanceId = incoming?.instanceId ?? "nav-widget";
|
|
567
|
+
const navConfig = incoming ? stripped : { ...DEFAULT_NAV_CONFIG };
|
|
566
568
|
Object.assign(el, {
|
|
567
569
|
config: navConfig,
|
|
568
570
|
runtime: runtime2,
|
package/dist/runtime.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/NavWidgetLit.ts", "../src/resolveNavTarget.ts", "../src/runtime.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Adaptive Nav - NavWidgetLit Web Component\n *\n * Lit web component equivalent of NavWidget.tsx. Renders a collapsible\n * navigation tips accordion with per-item conditional visibility, framework-aware\n * navigation, and CSS variable theming.\n *\n * Decorator-free: uses `static override properties` (tsconfig has no\n * experimentalDecorators).\n *\n * Uses light DOM (createRenderRoot returns this) so host-page CSS variables\n * (--sc-*) are inherited without crossing a shadow boundary.\n */\n\nimport { renderIcon as renderEmojiIcon } from '@syntrologie/sdk-contracts';\nimport { html, LitElement, nothing } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nimport { detectIsIframe, resolveNavTarget } from './resolveNavTarget';\nimport { navigateWithFrameworkRouter } from './runtime';\nimport type { NavConfig, NavTipAction, NavWidgetRuntime } from './types';\n\n// ============================================================================\n// Design system token fallbacks (inlined to avoid bundling @syntro/design-system\n// as a hard dep for this file; values match packages/design-system/src/tokens/colors.ts)\n// ============================================================================\n\nconst TOKEN_PURPLE_4 = '#6a59ce';\nconst TOKEN_SLATE_GREY_7 = '#677384';\nconst TOKEN_SLATE_GREY_8 = '#87919f';\n\n// ============================================================================\n// Emoji \u2192 Lucide SVG mapping is centralized in @syntrologie/sdk-contracts.\n// To add a new emoji, edit that package's icons.ts \u2014 every adaptive picks it\n// up automatically.\n// ============================================================================\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nfunction renderIcon(emoji: string): string {\n return renderEmojiIcon(emoji) || escapeHtml(emoji);\n}\n\n// (resolveNavTarget extracted to ./resolveNavTarget \u2014 also consumed by\n// NavWidget.tsx so both Lit and React variants share the routing decision)\n\n// ============================================================================\n// Route matching helper\n// ============================================================================\n\nfunction routeMatchesCurrent(routes: string[]): boolean {\n if (typeof window === 'undefined') return false;\n const current = window.location.pathname;\n return routes.some((route) => {\n const routePath = route.split('?')[0].split('#')[0];\n if (routePath.endsWith('/**')) {\n return current.startsWith(routePath.slice(0, -3));\n }\n return current === routePath;\n });\n}\n\n// ============================================================================\n// Pulse animation helper\n// ============================================================================\n\nfunction pulseElement(el: HTMLElement): void {\n const keyframes: Keyframe[] = [\n { boxShadow: '0 0 0 0 rgba(13, 148, 136, 0.5)' },\n { boxShadow: '0 0 0 8px rgba(13, 148, 136, 0)' },\n ];\n el.animate(keyframes, { duration: 600, iterations: 3, easing: 'ease-out' });\n}\n\n// ============================================================================\n// Theme helpers\n// ============================================================================\n\ntype ResolvedTheme = 'light' | 'dark';\n\nfunction resolveTheme(theme: string | undefined): ResolvedTheme {\n if (theme === 'dark') return 'dark';\n if (theme === 'light') return 'light';\n // auto or undefined: detect system preference\n if (typeof window !== 'undefined') {\n return window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return 'light';\n}\n\n// ============================================================================\n// AnchorId type (matches sdk-contracts shape used in NavWidget.tsx)\n// ============================================================================\n\ninterface AnchorId {\n route: string | string[];\n selector: string;\n}\n\n// ============================================================================\n// NavWidgetLit \u2014 LitElement\n// ============================================================================\n\nexport class NavWidgetLit extends LitElement {\n // ---------- No shadow DOM \u2014 inherit host CSS variables --------------------\n\n override createRenderRoot() {\n return this;\n }\n\n // ---------- Reactive properties (no decorators) --------------------------\n\n static override properties = {\n // Public inputs\n config: { attribute: false },\n runtime: { attribute: false },\n instanceId: { type: String },\n\n // Internal reactive state\n _expandedIds: { state: true },\n _renderTick: { state: true },\n _hoveredId: { state: true },\n };\n\n // ---------- Public properties --------------------------------------------\n\n config: NavConfig = { expandBehavior: 'single', theme: 'auto', actions: [] };\n runtime: NavWidgetRuntime | undefined = undefined;\n instanceId: string = 'nav-widget';\n\n // ---------- Internal state -----------------------------------------------\n\n /** @internal */ _expandedIds: Set<string> = new Set();\n /** @internal */ _renderTick = 0;\n /** @internal */ _hoveredId: string | null = null;\n\n // ---------- Private subscriptions ----------------------------------------\n\n #contextUnsub: (() => void) | null = null;\n #accumulatorUnsub: (() => void) | null = null;\n\n // ---------- Lifecycle: connectedCallback ---------------------------------\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.#subscribeRuntime();\n }\n\n // ---------- Lifecycle: disconnectedCallback ------------------------------\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#unsubscribeRuntime();\n }\n\n // ---------- Lifecycle: updated -------------------------------------------\n\n override updated(changed: Map<string, unknown>): void {\n if (changed.has('runtime')) {\n this.#unsubscribeRuntime();\n this.#subscribeRuntime();\n }\n }\n\n // ---------- Runtime subscriptions ----------------------------------------\n\n #subscribeRuntime(): void {\n if (!this.runtime) return;\n\n this.#contextUnsub = this.runtime.context.subscribe(() => {\n this._renderTick += 1;\n });\n\n if (this.runtime.accumulator?.subscribe) {\n this.#accumulatorUnsub = this.runtime.accumulator.subscribe(() => {\n this._renderTick += 1;\n });\n }\n }\n\n #unsubscribeRuntime(): void {\n this.#contextUnsub?.();\n this.#contextUnsub = null;\n this.#accumulatorUnsub?.();\n this.#accumulatorUnsub = null;\n }\n\n // ---------- Computed helpers (called on each render) ---------------------\n\n #getVisibleTips(): NavTipAction[] {\n // _renderTick is read here to ensure this re-runs when context/accumulator\n // notify (same pattern as useMemo with renderTick dep in React version).\n void this._renderTick;\n\n if (!this.runtime) return this.config.actions;\n\n return this.config.actions.filter((tip) => {\n if (!tip.triggerWhen) return true;\n try {\n const result = this.runtime!.evaluateSync<boolean>(tip.triggerWhen);\n return result.value;\n } catch {\n // Fail-closed: hide tip when strategy evaluation throws\n return false;\n }\n });\n }\n\n #getResolvedTheme(): ResolvedTheme {\n return resolveTheme(this.config.theme);\n }\n\n // ---------- Event handlers -----------------------------------------------\n\n #handleToggle(id: string): void {\n const wasExpanded = this._expandedIds.has(id);\n\n let next: Set<string>;\n if (this.config.expandBehavior === 'single') {\n // Emit collapse events for previously-expanded tips (single mode)\n for (const prevId of this._expandedIds) {\n if (prevId !== id) {\n this.#publishEvent('nav:toggled', {\n tipId: prevId,\n expanded: false,\n });\n }\n }\n next = wasExpanded ? new Set() : new Set([id]);\n } else {\n next = new Set(this._expandedIds);\n if (wasExpanded) {\n next.delete(id);\n } else {\n next.add(id);\n }\n }\n\n this.#publishEvent('nav:toggled', {\n tipId: id,\n expanded: !wasExpanded,\n });\n\n this._expandedIds = next;\n }\n\n #handleNavigate(href: string, external: boolean): void {\n // Reject dangerous URIs\n const normalized = href.trim().toLowerCase();\n if (normalized.startsWith('javascript:') || normalized.startsWith('data:')) return;\n\n this.#publishEvent('nav:tip_clicked', { href, external });\n\n // Also fire a standard custom event for host-page listeners\n this.dispatchEvent(\n new CustomEvent('nav-tip-clicked', {\n bubbles: true,\n detail: { href, external, instanceId: this.instanceId },\n })\n );\n\n // Routing decision is in resolveNavTarget (a pure helper). When mounted\n // in an iframe (canvas surface, partner embed, etc.), every nav escapes\n // via window.open \u2014 sandbox `allow-popups` lets it pop out to the user's\n // main browser. On the customer site (top-level window), normal cross-/\n // same-origin handling applies.\n const target = resolveNavTarget({\n href,\n external,\n windowOrigin: typeof window !== 'undefined' ? window.location.origin : '',\n isIframe: detectIsIframe(),\n });\n\n if (target.kind === 'open') {\n window.open(target.url, '_blank', 'noopener,noreferrer');\n return;\n }\n if (target.kind === 'fullnav') {\n window.location.href = target.url;\n return;\n }\n // kind === 'spa'\n target.url.search = window.location.search;\n if (!navigateWithFrameworkRouter(target.url.toString())) {\n window.history.pushState(null, '', target.url.toString());\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n }\n\n #handleFocusAnchor(anchor: AnchorId): void {\n const el = document.querySelector(anchor.selector);\n if (!(el instanceof HTMLElement)) return;\n\n this.#publishEvent('nav:tip_focused', {\n selector: anchor.selector,\n route: anchor.route,\n });\n\n this.dispatchEvent(\n new CustomEvent('nav-tip-focused', {\n bubbles: true,\n detail: { selector: anchor.selector, instanceId: this.instanceId },\n })\n );\n\n el.scrollIntoView({ behavior: 'smooth', block: 'center' });\n pulseElement(el);\n setTimeout(() => el.focus(), 400);\n }\n\n #publishEvent(name: string, props: Record<string, unknown>): void {\n this.runtime?.events.publish(name, {\n instanceId: this.instanceId,\n timestamp: Date.now(),\n ...props,\n });\n }\n\n // ---------- Tip item rendering -------------------------------------------\n\n #renderTipItem(tip: NavTipAction, index: number, total: number) {\n const { id, title, description, href, icon, external, anchor, category: _cat } = tip.config;\n const isExpanded = this._expandedIds.has(id);\n const isLast = index === total - 1;\n const isHovered = this._hoveredId === id;\n const theme = this.#getResolvedTheme();\n\n // Determine the effective href from anchor or legacy href\n const effectiveHref = anchor\n ? Array.isArray(anchor.route)\n ? anchor.route[0]\n : anchor.route\n : href;\n\n // Same-page check\n const isSamePage = anchor\n ? routeMatchesCurrent(Array.isArray(anchor.route) ? anchor.route : [anchor.route])\n : effectiveHref\n ? routeMatchesCurrent([effectiveHref])\n : false;\n const hasSelector = anchor?.selector && anchor.selector !== '*';\n const isFocusAction = isSamePage && hasSelector;\n const hasAction = !!effectiveHref || isFocusAction;\n\n const ctaLabel = isFocusAction ? 'Focus \\u2192' : external ? 'Go \\u2197' : 'Go \\u2192';\n\n // Item container styles\n const itemStyle = styleMap({\n borderRadius: 'var(--sc-content-border-radius, 8px)',\n overflow: 'hidden',\n transition: 'box-shadow 0.2s ease',\n backgroundColor: 'var(--sc-content-background)',\n border: 'var(--sc-content-border)',\n ...(isExpanded\n ? {\n boxShadow:\n theme === 'dark'\n ? '0 4px 12px rgba(0, 0, 0, 0.15)'\n : '0 4px 12px rgba(0, 0, 0, 0.08)',\n }\n : {}),\n ...(!isLast ? { borderBottom: 'var(--sc-content-item-divider, none)' } : {}),\n });\n\n // Header styles\n const headerStyle = styleMap({\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n width: '100%',\n padding: 'var(--sc-content-item-padding, 12px 16px)',\n border: 'none',\n cursor: 'pointer',\n fontSize: 'var(--sc-content-item-font-size, 15px)',\n fontWeight: '500',\n fontFamily: 'inherit',\n textAlign: 'left',\n transition: 'background-color 0.15s ease',\n backgroundColor: isHovered ? 'var(--sc-content-background-hover)' : 'transparent',\n color: 'var(--sc-content-text-color)',\n });\n\n // Chevron styles\n const chevronStyle = styleMap({\n fontSize: '20px',\n transition: 'transform 0.2s ease',\n marginLeft: 'auto',\n flexShrink: '0',\n color: 'var(--sc-content-chevron-color, currentColor)',\n transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',\n });\n\n // Body styles\n const bodyStyle = styleMap({\n overflow: 'hidden',\n transition: 'max-height 0.25s ease, padding-bottom 0.25s ease',\n padding: 'var(--sc-content-body-padding, 0 16px 12px 16px)',\n color: 'var(--sc-content-text-secondary-color)',\n maxHeight: isExpanded ? '500px' : '0',\n paddingBottom: isExpanded ? '16px' : '0',\n });\n\n // Description styles\n const descriptionStyle = styleMap({\n fontSize: 'var(--sc-content-body-font-size, 14px)',\n lineHeight: '1.5',\n margin: '0',\n });\n\n // CTA / link button styles\n const linkButtonStyle = styleMap({\n display: 'inline-flex',\n alignItems: 'center',\n gap: '4px',\n marginTop: '10px',\n padding: '6px 12px',\n borderRadius: '6px',\n textDecoration: 'none',\n fontSize: '13px',\n fontWeight: '500',\n cursor: 'pointer',\n border: 'none',\n transition: 'background-color 0.15s ease',\n backgroundColor: `var(--sc-color-primary, ${TOKEN_PURPLE_4})`,\n color: '#ffffff',\n });\n\n // Icon styles\n const iconStyle = styleMap({\n fontSize: '16px',\n flexShrink: '0',\n });\n\n // Anchor click handler\n const onLinkClick = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n if (isFocusAction && anchor) {\n this.#handleFocusAnchor(anchor);\n } else if (effectiveHref) {\n this.#handleNavigate(effectiveHref, external ?? false);\n }\n };\n\n return html`\n <div\n style=${itemStyle}\n data-nav-tip-id=${id}\n >\n <button\n type=\"button\"\n style=${headerStyle}\n aria-expanded=${isExpanded}\n @click=${() => this.#handleToggle(id)}\n @mouseenter=${() => {\n this._hoveredId = id;\n }}\n @mouseleave=${() => {\n this._hoveredId = null;\n }}\n >\n ${icon ? html`<span style=${iconStyle}>${unsafeHTML(renderIcon(icon))}</span>` : nothing}\n <span>${title}</span>\n <span style=${chevronStyle}>${'\\u203A'}</span>\n </button>\n <div style=${bodyStyle} aria-hidden=${!isExpanded}>\n <p style=${descriptionStyle}>${description}</p>\n ${\n hasAction\n ? html`\n <a\n href=${effectiveHref || '#'}\n style=${linkButtonStyle}\n target=${external ? '_blank' : nothing}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${onLinkClick}\n >${ctaLabel}</a>\n `\n : nothing\n }\n </div>\n </div>\n `;\n }\n\n // ---------- Render --------------------------------------------------------\n\n override render() {\n const visibleTips = this.#getVisibleTips();\n const theme = this.#getResolvedTheme();\n\n const containerStyle = styleMap({\n fontFamily: 'var(--sc-font-family, system-ui, -apple-system, sans-serif)',\n maxWidth: '100%',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n color: 'inherit',\n });\n\n const accordionStyle = styleMap({\n display: 'flex',\n flexDirection: 'column',\n gap: 'var(--sc-content-item-gap, 6px)',\n });\n\n const categoryHeaderStyle = styleMap({\n fontSize: 'var(--sc-content-category-font-size, 12px)',\n fontWeight: '600',\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n padding: 'var(--sc-content-category-padding, 8px 4px 4px 4px)',\n color: theme === 'dark' ? TOKEN_SLATE_GREY_8 : TOKEN_SLATE_GREY_7,\n });\n\n const emptyStateStyle = styleMap({\n fontSize: '13px',\n padding: '16px',\n textAlign: 'center',\n color: theme === 'dark' ? TOKEN_SLATE_GREY_7 : TOKEN_SLATE_GREY_8,\n });\n\n // Empty state\n if (visibleTips.length === 0) {\n return html`\n <div\n style=${containerStyle}\n data-adaptive-id=${this.instanceId}\n data-adaptive-type=\"adaptive-nav\"\n >\n <div style=${emptyStateStyle}>\n You're all set for now! We'll share helpful tips here when they're relevant to what\n you're doing.\n </div>\n </div>\n `;\n }\n\n // Group by category\n const categoryGroups = new Map<string | undefined, NavTipAction[]>();\n for (const tip of visibleTips) {\n const cat = tip.config.category;\n if (!categoryGroups.has(cat)) {\n categoryGroups.set(cat, []);\n }\n categoryGroups.get(cat)!.push(tip);\n }\n\n const hasCategories = visibleTips.some((t) => t.config.category);\n\n return html`\n <div\n style=${containerStyle}\n data-adaptive-id=${this.instanceId}\n data-adaptive-type=\"adaptive-nav\"\n >\n <div style=${accordionStyle}>\n ${\n hasCategories\n ? Array.from(categoryGroups.entries()).map(\n ([category, items]) => html`\n ${\n category\n ? html`<div style=${categoryHeaderStyle} data-category-header=${category}>${category}</div>`\n : nothing\n }\n ${items.map((tip, idx) => this.#renderTipItem(tip, idx, items.length))}\n `\n )\n : visibleTips.map((tip, idx) => this.#renderTipItem(tip, idx, visibleTips.length))\n }\n </div>\n </div>\n `;\n }\n}\n\n// ============================================================================\n// Custom element registration\n// ============================================================================\n\nconst TAG_NAME = 'syntro-nav-tips';\n\nexport function registerNavWidgetLit(): void {\n if (typeof window === 'undefined') return;\n if (!customElements.get(TAG_NAME)) {\n customElements.define(TAG_NAME, NavWidgetLit);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syntro-nav-tips': NavWidgetLit;\n }\n}\n", "/**\n * Pure decision function for nav-tip click routing.\n *\n * Given an href, an `external` flag, the current window's origin, and whether\n * the SDK is mounted inside an iframe, returns the navigation action to take.\n *\n * Extracted from NavWidgetLit so both the Lit and React widget variants\n * share one decision matrix and so the routing logic can be unit-tested\n * without mutating window.location (jsdom doesn't allow redefining\n * origin/href).\n */\n\nexport type NavTarget =\n | { kind: 'open'; url: string }\n | { kind: 'fullnav'; url: string }\n | { kind: 'spa'; url: URL };\n\nexport interface ResolveNavTargetArgs {\n href: string;\n external: boolean;\n windowOrigin: string;\n /**\n * True when the SDK is mounted inside an iframe (window !== window.top, or\n * window.top access threw cross-origin). When true, every nav escapes via\n * window.open \u2014 the parent page's sandbox `allow-popups` lets the new\n * window pop out to the user's main browser.\n */\n isIframe: boolean;\n}\n\n/**\n * Decide what to do with a nav-tip click.\n *\n * Routing branches (in order):\n *\n * 1. **Iframe context** (`isIframe=true` OR opaque origin \"null\"):\n * always `window.open` the href as-is. Action-plan authors who want\n * cross-iframe nav must use absolute URLs (any host \u2014 customer's,\n * partner's, doesn't matter). The sandbox's `allow-popups` lets the\n * open() call escape to the user's main browser.\n *\n * 2. **Explicit external** (`external=true`): always opens in `_blank`.\n *\n * 3. **Cross-origin absolute href** (no iframe; URL parses to a different\n * origin): full `window.location.href` navigation.\n *\n * 4. **Same-origin** (most common \u2014 SDK on customer site, internal route):\n * SPA-style `pushState` (caller falls back to framework router).\n *\n * 5. **Parse failure**: full-nav fallback; browser does its best.\n */\nexport function resolveNavTarget(args: ResolveNavTargetArgs): NavTarget {\n const { href, external, windowOrigin, isIframe } = args;\n\n const isOpaqueOrigin = windowOrigin === 'null';\n if (isIframe || isOpaqueOrigin) {\n return { kind: 'open', url: href };\n }\n\n if (external) {\n return { kind: 'open', url: href };\n }\n\n let url: URL;\n try {\n url = new URL(href, windowOrigin);\n } catch {\n return { kind: 'fullnav', url: href };\n }\n\n if (url.origin !== windowOrigin) {\n return { kind: 'fullnav', url: url.toString() };\n }\n\n return { kind: 'spa', url };\n}\n\n/**\n * Helper: detect whether the current window is mounted in an iframe.\n * Cross-origin parent access can throw \u2014 treat that as \"in iframe.\"\n */\nexport function detectIsIframe(): boolean {\n if (typeof window === 'undefined') return false;\n try {\n return window !== window.top;\n } catch {\n return true;\n }\n}\n", "/**\n * Adaptive Nav - Runtime Module\n *\n * Runtime manifest for the navigation tips accordion adaptive.\n * Mounts the `<syntro-nav-tips>` Lit web component.\n * Includes widget-based nav tips and navigation action executors\n * (scrollTo, navigate) previously in adaptive-navigation.\n */\n\nimport { registerNavWidgetLit } from './NavWidgetLit';\nimport type {\n ActionExecutor,\n ExecutorResult,\n NavConfig,\n NavigateAction,\n NavTipAction,\n NavWidgetRuntime,\n ScrollToAction,\n} from './types';\n\n// ============================================================================\n// Navigation Action Executors (merged from adaptive-navigation)\n// ============================================================================\n\n/**\n * Execute a scrollTo action\n */\nexport const executeScrollTo: ActionExecutor<ScrollToAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n const anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl) {\n console.error(\n `[adaptive-nav] Anchor not found for scrollTo, skipping: ${action.anchorId.selector}`\n );\n return { cleanup: () => {} };\n }\n\n // Scroll to element\n anchorEl.scrollIntoView({\n behavior: action.behavior ?? 'smooth',\n block: action.block ?? 'center',\n inline: action.inline ?? 'nearest',\n });\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'navigation:scrollTo',\n anchorId: action.anchorId,\n behavior: action.behavior ?? 'smooth',\n });\n\n return {\n cleanup: () => {\n // Optionally restore scroll position on revert\n },\n };\n};\n\n/**\n * Try to navigate using the host framework's native router.\n * Returns true if a framework router handled the navigation,\n * false if no framework was detected (caller should use pushState or location.href).\n *\n * Using the native router preserves SPA behavior (no full reload),\n * layout state, scroll position, and framework-specific features\n * (RSC streaming, view transitions, etc.).\n */\nexport function navigateWithFrameworkRouter(url: string): boolean {\n if (typeof window === 'undefined') return false;\n const w = window as any;\n\n // Next.js \u2014 window.next.router.push() triggers App Router navigation\n // with RSC fetch, layout preservation, and loading states\n try {\n const nextRouter = w.next?.router;\n if (nextRouter?.push) {\n nextRouter.push(url);\n return true;\n }\n } catch {\n /* fall through */\n }\n\n // Nuxt 3 \u2014 useRouter() isn't accessible from outside Vue, but\n // $nuxt.$router (Nuxt 2) or window.__NUXT__?.hooks (Nuxt 3) + navigateTo\n // aren't reliably exposed. Nuxt 2 exposes $nuxt.$router.push().\n try {\n if (w.$nuxt?.$router?.push) {\n w.$nuxt.$router.push(url);\n return true;\n }\n } catch {\n /* fall through */\n }\n\n // Angular \u2014 Angular Router isn't exposed on window by default.\n // The most reliable approach is to detect Angular and use location.href.\n if (w.ng || w.getAllAngularRootElements || document.querySelector('[ng-version]')) {\n window.location.href = url;\n return true;\n }\n\n // SvelteKit \u2014 goto() isn't on window, but __SVELTEKIT_DATA__ confirms the framework.\n if (w.__SVELTEKIT_DATA__ || document.body?.hasAttribute('data-sveltekit')) {\n window.location.href = url;\n return true;\n }\n\n // Astro (View Transitions) \u2014 no client-side router API exposed\n if (document.querySelector('[data-astro-transition-fallback]')) {\n window.location.href = url;\n return true;\n }\n\n return false;\n}\n\n/**\n * Check if a URL is same-origin as the current page.\n * Relative URLs (e.g. \"/dashboard\") are always same-origin.\n */\nfunction isSameOrigin(url: string): boolean {\n try {\n const parsed = new URL(url, window.location.origin);\n return parsed.origin === window.location.origin;\n } catch {\n // If URL parsing fails, fall back to full navigation\n return false;\n }\n}\n\n/**\n * Execute a navigate action\n */\nexport const executeNavigate: ActionExecutor<NavigateAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n // Validate URL to prevent javascript: URLs\n const url = action.url.trim();\n if (url.toLowerCase().startsWith('javascript:')) {\n throw new Error('javascript: URLs are not allowed');\n }\n\n const target = action.target ?? '_self';\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'navigation:navigate',\n url: action.url,\n target,\n });\n\n if (target === '_blank') {\n // Open in new tab\n window.open(url, '_blank', 'noopener,noreferrer');\n } else if (!action.forceFullNavigation && isSameOrigin(url)) {\n // Try the host framework's native router first (Next.js, Nuxt, Angular, etc.)\n // Falls back to pushState for vanilla SPAs, or location.href as last resort.\n if (!navigateWithFrameworkRouter(url)) {\n window.history.pushState(null, '', url);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n } else {\n // Full navigation for cross-origin URLs or when explicitly requested\n window.location.href = url;\n }\n\n return {\n cleanup: () => {\n // Navigation cannot be reverted\n },\n };\n};\n\n// ============================================================================\n// Lit Mountable Widget\n// ============================================================================\n\n/**\n * NavWidgetLitMountable \u2014 Mounts the `<syntro-nav-tips>` Lit web component.\n * Self-registers the custom element on first use.\n */\nexport const NavWidgetLitMountable = {\n mount(\n container: HTMLElement,\n config?: NavConfig & { runtime?: NavWidgetRuntime; instanceId?: string }\n ) {\n registerNavWidgetLit();\n\n const el = document.createElement('syntro-nav-tips');\n\n const {\n runtime,\n instanceId = 'nav-widget',\n ...navConfig\n } = config ?? {\n expandBehavior: 'single' as const,\n theme: 'auto' as const,\n actions: [],\n };\n\n // Assign structured props as JS properties (not HTML attributes)\n Object.assign(el, {\n config: navConfig,\n runtime,\n instanceId,\n });\n\n container.appendChild(el);\n\n return () => el.remove();\n },\n};\n\n// ============================================================================\n// Executor Definitions for Registration\n// ============================================================================\n\n/**\n * All executors provided by this app.\n * These are registered with the runtime's ExecutorRegistry.\n */\nexport const executors = [\n { kind: 'navigation:scrollTo', executor: executeScrollTo },\n { kind: 'navigation:navigate', executor: executeNavigate },\n] as const;\n\n// ============================================================================\n// App Runtime Manifest\n// ============================================================================\n\n/**\n * Runtime manifest for adaptive-nav.\n *\n * Provides:\n * - Navigation action executors (scrollTo, navigate)\n * - Widget-based nav tips accordion using the Lit web component\n */\nexport const runtime = {\n id: 'adaptive-nav',\n version: '2.0.0',\n name: 'Navigation Tips',\n description: 'Navigation actions and accordion-based tips with per-item conditional visibility',\n\n /**\n * Navigation action executors (scrollTo, navigate).\n */\n executors,\n\n /**\n * Widget definitions for the runtime's WidgetRegistry.\n */\n widgets: [\n {\n id: 'adaptive-nav:tips',\n component: NavWidgetLitMountable,\n metadata: {\n name: 'Navigation Tips',\n description: 'Accordion of contextual navigation tips with per-item visibility',\n icon: '\\u{1F9ED}',\n },\n },\n ],\n\n /**\n * Extract notify watcher entries from tile config props.\n * The runtime evaluates these continuously (even with drawer closed)\n * and publishes nav:tip_revealed when triggerWhen transitions false \u2192 true.\n */\n notifyWatchers(props: Record<string, unknown>) {\n const actions = (props.actions ?? []) as NavTipAction[];\n return actions\n .filter((a) => a.notify && a.triggerWhen)\n .map((a) => ({\n id: `nav:${a.config.id}`,\n strategy: a.triggerWhen!,\n eventName: 'nav:tip_revealed',\n eventProps: {\n tipId: a.config.id,\n title: a.notify!.title,\n body: a.notify!.body,\n icon: a.notify!.icon,\n },\n }));\n },\n};\n\nexport default runtime;\n"],
|
|
5
|
-
"mapp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,OAAO;AAAA,MACX,IAAI,OAAO,EAAE,OAAO,EAAE;AAAA,MACtB,UAAU,EAAE;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,QACV,OAAO,EAAE,OAAO;AAAA,QAChB,OAAO,EAAE,OAAQ;AAAA,QACjB,MAAM,EAAE,OAAQ;AAAA,QAChB,MAAM,EAAE,OAAQ;AAAA,MAClB;AAAA,IACF,EAAE;AAAA,EACN;AACF;AAEA,IAAO,kBAAQ;",
|
|
4
|
+
"sourcesContent": ["/**\n * Adaptive Nav - NavWidgetLit Web Component\n *\n * Lit web component equivalent of NavWidget.tsx. Renders a collapsible\n * navigation tips accordion with per-item conditional visibility, framework-aware\n * navigation, and CSS variable theming.\n *\n * Decorator-free: uses `static override properties` (tsconfig has no\n * experimentalDecorators).\n *\n * Uses light DOM (createRenderRoot returns this) so host-page CSS variables\n * (--sc-*) are inherited without crossing a shadow boundary.\n */\n\nimport { renderIcon as renderEmojiIcon } from '@syntrologie/sdk-contracts';\nimport { html, LitElement, nothing } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nimport { detectIsIframe, resolveNavTarget } from './resolveNavTarget';\nimport { navigateWithFrameworkRouter } from './runtime';\nimport type { NavConfig, NavTipAction, NavWidgetRuntime } from './types';\n\n// ============================================================================\n// Design system token fallbacks (inlined to avoid bundling @syntro/design-system\n// as a hard dep for this file; values match packages/design-system/src/tokens/colors.ts)\n// ============================================================================\n\nconst TOKEN_PURPLE_4 = '#6a59ce';\nconst TOKEN_SLATE_GREY_7 = '#677384';\nconst TOKEN_SLATE_GREY_8 = '#87919f';\n\n// ============================================================================\n// Emoji \u2192 Lucide SVG mapping is centralized in @syntrologie/sdk-contracts.\n// To add a new emoji, edit that package's icons.ts \u2014 every adaptive picks it\n// up automatically.\n// ============================================================================\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nfunction renderIcon(emoji: string): string {\n return renderEmojiIcon(emoji) || escapeHtml(emoji);\n}\n\n// (resolveNavTarget extracted to ./resolveNavTarget \u2014 also consumed by\n// NavWidget.tsx so both Lit and React variants share the routing decision)\n\n// ============================================================================\n// Route matching helper\n// ============================================================================\n\nfunction routeMatchesCurrent(routes: string[]): boolean {\n if (typeof window === 'undefined') return false;\n const current = window.location.pathname;\n return routes.some((route) => {\n const routePath = route.split('?')[0].split('#')[0];\n if (routePath.endsWith('/**')) {\n return current.startsWith(routePath.slice(0, -3));\n }\n return current === routePath;\n });\n}\n\n// ============================================================================\n// Pulse animation helper\n// ============================================================================\n\nfunction pulseElement(el: HTMLElement): void {\n const keyframes: Keyframe[] = [\n { boxShadow: '0 0 0 0 rgba(13, 148, 136, 0.5)' },\n { boxShadow: '0 0 0 8px rgba(13, 148, 136, 0)' },\n ];\n el.animate(keyframes, { duration: 600, iterations: 3, easing: 'ease-out' });\n}\n\n// ============================================================================\n// Theme helpers\n// ============================================================================\n\ntype ResolvedTheme = 'light' | 'dark';\n\nfunction resolveTheme(theme: string | undefined): ResolvedTheme {\n if (theme === 'dark') return 'dark';\n if (theme === 'light') return 'light';\n // auto or undefined: detect system preference\n if (typeof window !== 'undefined') {\n return window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return 'light';\n}\n\n// ============================================================================\n// AnchorId type (matches sdk-contracts shape used in NavWidget.tsx)\n// ============================================================================\n\ninterface AnchorId {\n route: string | string[];\n selector: string;\n}\n\n// ============================================================================\n// NavWidgetLit \u2014 LitElement\n// ============================================================================\n\nexport class NavWidgetLit extends LitElement {\n // ---------- No shadow DOM \u2014 inherit host CSS variables --------------------\n\n override createRenderRoot() {\n return this;\n }\n\n // ---------- Reactive properties (no decorators) --------------------------\n\n static override properties = {\n // Public inputs\n config: { attribute: false },\n runtime: { attribute: false },\n instanceId: { type: String },\n\n // Internal reactive state\n _expandedIds: { state: true },\n _renderTick: { state: true },\n _hoveredId: { state: true },\n };\n\n // ---------- Public properties --------------------------------------------\n\n config: NavConfig = { expandBehavior: 'single', theme: 'auto', actions: [] };\n runtime: NavWidgetRuntime | undefined = undefined;\n instanceId: string = 'nav-widget';\n\n // ---------- Internal state -----------------------------------------------\n\n /** @internal */ _expandedIds: Set<string> = new Set();\n /** @internal */ _renderTick = 0;\n /** @internal */ _hoveredId: string | null = null;\n\n // ---------- Private subscriptions ----------------------------------------\n\n #contextUnsub: (() => void) | null = null;\n #accumulatorUnsub: (() => void) | null = null;\n\n // ---------- Lifecycle: connectedCallback ---------------------------------\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.#subscribeRuntime();\n }\n\n // ---------- Lifecycle: disconnectedCallback ------------------------------\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#unsubscribeRuntime();\n }\n\n // ---------- Lifecycle: updated -------------------------------------------\n\n override updated(changed: Map<string, unknown>): void {\n if (changed.has('runtime')) {\n this.#unsubscribeRuntime();\n this.#subscribeRuntime();\n }\n }\n\n // ---------- Runtime subscriptions ----------------------------------------\n\n #subscribeRuntime(): void {\n if (!this.runtime) return;\n\n this.#contextUnsub = this.runtime.context.subscribe(() => {\n this._renderTick += 1;\n });\n\n if (this.runtime.accumulator?.subscribe) {\n this.#accumulatorUnsub = this.runtime.accumulator.subscribe(() => {\n this._renderTick += 1;\n });\n }\n }\n\n #unsubscribeRuntime(): void {\n this.#contextUnsub?.();\n this.#contextUnsub = null;\n this.#accumulatorUnsub?.();\n this.#accumulatorUnsub = null;\n }\n\n // ---------- Computed helpers (called on each render) ---------------------\n\n #getVisibleTips(): NavTipAction[] {\n // _renderTick is read here to ensure this re-runs when context/accumulator\n // notify (same pattern as useMemo with renderTick dep in React version).\n void this._renderTick;\n\n if (!this.runtime) return this.config.actions;\n\n return this.config.actions.filter((tip) => {\n if (!tip.triggerWhen) return true;\n try {\n const result = this.runtime!.evaluateSync<boolean>(tip.triggerWhen);\n return result.value;\n } catch {\n // Fail-closed: hide tip when strategy evaluation throws\n return false;\n }\n });\n }\n\n #getResolvedTheme(): ResolvedTheme {\n return resolveTheme(this.config.theme);\n }\n\n // ---------- Event handlers -----------------------------------------------\n\n #handleToggle(id: string): void {\n const wasExpanded = this._expandedIds.has(id);\n\n let next: Set<string>;\n if (this.config.expandBehavior === 'single') {\n // Emit collapse events for previously-expanded tips (single mode)\n for (const prevId of this._expandedIds) {\n if (prevId !== id) {\n this.#publishEvent('nav:toggled', {\n tipId: prevId,\n expanded: false,\n });\n }\n }\n next = wasExpanded ? new Set() : new Set([id]);\n } else {\n next = new Set(this._expandedIds);\n if (wasExpanded) {\n next.delete(id);\n } else {\n next.add(id);\n }\n }\n\n this.#publishEvent('nav:toggled', {\n tipId: id,\n expanded: !wasExpanded,\n });\n\n this._expandedIds = next;\n }\n\n #handleNavigate(href: string, external: boolean): void {\n // Reject dangerous URIs\n const normalized = href.trim().toLowerCase();\n if (normalized.startsWith('javascript:') || normalized.startsWith('data:')) return;\n\n this.#publishEvent('nav:tip_clicked', { href, external });\n\n // Also fire a standard custom event for host-page listeners\n this.dispatchEvent(\n new CustomEvent('nav-tip-clicked', {\n bubbles: true,\n detail: { href, external, instanceId: this.instanceId },\n })\n );\n\n // Routing decision is in resolveNavTarget (a pure helper). When mounted\n // in an iframe (canvas surface, partner embed, etc.), every nav escapes\n // via window.open \u2014 sandbox `allow-popups` lets it pop out to the user's\n // main browser. On the customer site (top-level window), normal cross-/\n // same-origin handling applies.\n const target = resolveNavTarget({\n href,\n external,\n windowOrigin: typeof window !== 'undefined' ? window.location.origin : '',\n isIframe: detectIsIframe(),\n });\n\n if (target.kind === 'open') {\n window.open(target.url, '_blank', 'noopener,noreferrer');\n return;\n }\n if (target.kind === 'fullnav') {\n window.location.href = target.url;\n return;\n }\n // kind === 'spa'\n target.url.search = window.location.search;\n if (!navigateWithFrameworkRouter(target.url.toString())) {\n window.history.pushState(null, '', target.url.toString());\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n }\n\n #handleFocusAnchor(anchor: AnchorId): void {\n const el = document.querySelector(anchor.selector);\n if (!(el instanceof HTMLElement)) return;\n\n this.#publishEvent('nav:tip_focused', {\n selector: anchor.selector,\n route: anchor.route,\n });\n\n this.dispatchEvent(\n new CustomEvent('nav-tip-focused', {\n bubbles: true,\n detail: { selector: anchor.selector, instanceId: this.instanceId },\n })\n );\n\n el.scrollIntoView({ behavior: 'smooth', block: 'center' });\n pulseElement(el);\n setTimeout(() => el.focus(), 400);\n }\n\n #publishEvent(name: string, props: Record<string, unknown>): void {\n this.runtime?.events.publish(name, {\n instanceId: this.instanceId,\n timestamp: Date.now(),\n ...props,\n });\n }\n\n // ---------- Tip item rendering -------------------------------------------\n\n #renderTipItem(tip: NavTipAction, index: number, total: number) {\n const { id, title, description, href, icon, external, anchor, category: _cat } = tip.config;\n const isExpanded = this._expandedIds.has(id);\n const isLast = index === total - 1;\n const isHovered = this._hoveredId === id;\n const theme = this.#getResolvedTheme();\n\n // Determine the effective href from anchor or legacy href\n const effectiveHref = anchor\n ? Array.isArray(anchor.route)\n ? anchor.route[0]\n : anchor.route\n : href;\n\n // Same-page check\n const isSamePage = anchor\n ? routeMatchesCurrent(Array.isArray(anchor.route) ? anchor.route : [anchor.route])\n : effectiveHref\n ? routeMatchesCurrent([effectiveHref])\n : false;\n const hasSelector = anchor?.selector && anchor.selector !== '*';\n const isFocusAction = isSamePage && hasSelector;\n const hasAction = !!effectiveHref || isFocusAction;\n\n const ctaLabel = isFocusAction ? 'Focus \\u2192' : external ? 'Go \\u2197' : 'Go \\u2192';\n\n // Item container styles\n const itemStyle = styleMap({\n borderRadius: 'var(--sc-content-border-radius, 8px)',\n overflow: 'hidden',\n transition: 'box-shadow 0.2s ease',\n backgroundColor: 'var(--sc-content-background)',\n border: 'var(--sc-content-border)',\n ...(isExpanded\n ? {\n boxShadow:\n theme === 'dark'\n ? '0 4px 12px rgba(0, 0, 0, 0.15)'\n : '0 4px 12px rgba(0, 0, 0, 0.08)',\n }\n : {}),\n ...(!isLast ? { borderBottom: 'var(--sc-content-item-divider, none)' } : {}),\n });\n\n // Header styles\n const headerStyle = styleMap({\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n width: '100%',\n padding: 'var(--sc-content-item-padding, 12px 16px)',\n border: 'none',\n cursor: 'pointer',\n fontSize: 'var(--sc-content-item-font-size, 15px)',\n fontWeight: '500',\n fontFamily: 'inherit',\n textAlign: 'left',\n transition: 'background-color 0.15s ease',\n backgroundColor: isHovered ? 'var(--sc-content-background-hover)' : 'transparent',\n color: 'var(--sc-content-text-color)',\n });\n\n // Chevron styles\n const chevronStyle = styleMap({\n fontSize: '20px',\n transition: 'transform 0.2s ease',\n marginLeft: 'auto',\n flexShrink: '0',\n color: 'var(--sc-content-chevron-color, currentColor)',\n transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',\n });\n\n // Body styles\n const bodyStyle = styleMap({\n overflow: 'hidden',\n transition: 'max-height 0.25s ease, padding-bottom 0.25s ease',\n padding: 'var(--sc-content-body-padding, 0 16px 12px 16px)',\n color: 'var(--sc-content-text-secondary-color)',\n maxHeight: isExpanded ? '500px' : '0',\n paddingBottom: isExpanded ? '16px' : '0',\n });\n\n // Description styles\n const descriptionStyle = styleMap({\n fontSize: 'var(--sc-content-body-font-size, 14px)',\n lineHeight: '1.5',\n margin: '0',\n });\n\n // CTA / link button styles\n const linkButtonStyle = styleMap({\n display: 'inline-flex',\n alignItems: 'center',\n gap: '4px',\n marginTop: '10px',\n padding: '6px 12px',\n borderRadius: '6px',\n textDecoration: 'none',\n fontSize: '13px',\n fontWeight: '500',\n cursor: 'pointer',\n border: 'none',\n transition: 'background-color 0.15s ease',\n backgroundColor: `var(--sc-color-primary, ${TOKEN_PURPLE_4})`,\n color: '#ffffff',\n });\n\n // Icon styles\n const iconStyle = styleMap({\n fontSize: '16px',\n flexShrink: '0',\n });\n\n // Anchor click handler\n const onLinkClick = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n if (isFocusAction && anchor) {\n this.#handleFocusAnchor(anchor);\n } else if (effectiveHref) {\n this.#handleNavigate(effectiveHref, external ?? false);\n }\n };\n\n return html`\n <div\n style=${itemStyle}\n data-nav-tip-id=${id}\n >\n <button\n type=\"button\"\n style=${headerStyle}\n aria-expanded=${isExpanded}\n @click=${() => this.#handleToggle(id)}\n @mouseenter=${() => {\n this._hoveredId = id;\n }}\n @mouseleave=${() => {\n this._hoveredId = null;\n }}\n >\n ${icon ? html`<span style=${iconStyle}>${unsafeHTML(renderIcon(icon))}</span>` : nothing}\n <span>${title}</span>\n <span style=${chevronStyle}>${'\\u203A'}</span>\n </button>\n <div style=${bodyStyle} aria-hidden=${!isExpanded}>\n <p style=${descriptionStyle}>${description}</p>\n ${\n hasAction\n ? html`\n <a\n href=${effectiveHref || '#'}\n style=${linkButtonStyle}\n target=${external ? '_blank' : nothing}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${onLinkClick}\n >${ctaLabel}</a>\n `\n : nothing\n }\n </div>\n </div>\n `;\n }\n\n // ---------- Render --------------------------------------------------------\n\n override render() {\n const visibleTips = this.#getVisibleTips();\n const theme = this.#getResolvedTheme();\n\n const containerStyle = styleMap({\n fontFamily: 'var(--sc-font-family, system-ui, -apple-system, sans-serif)',\n maxWidth: '100%',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n color: 'inherit',\n });\n\n const accordionStyle = styleMap({\n display: 'flex',\n flexDirection: 'column',\n gap: 'var(--sc-content-item-gap, 6px)',\n });\n\n const categoryHeaderStyle = styleMap({\n fontSize: 'var(--sc-content-category-font-size, 12px)',\n fontWeight: '600',\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n padding: 'var(--sc-content-category-padding, 8px 4px 4px 4px)',\n color: theme === 'dark' ? TOKEN_SLATE_GREY_8 : TOKEN_SLATE_GREY_7,\n });\n\n const emptyStateStyle = styleMap({\n fontSize: '13px',\n padding: '16px',\n textAlign: 'center',\n color: theme === 'dark' ? TOKEN_SLATE_GREY_7 : TOKEN_SLATE_GREY_8,\n });\n\n // Empty state\n if (visibleTips.length === 0) {\n return html`\n <div\n style=${containerStyle}\n data-adaptive-id=${this.instanceId}\n data-adaptive-type=\"adaptive-nav\"\n >\n <div style=${emptyStateStyle}>\n You're all set for now! We'll share helpful tips here when they're relevant to what\n you're doing.\n </div>\n </div>\n `;\n }\n\n // Group by category\n const categoryGroups = new Map<string | undefined, NavTipAction[]>();\n for (const tip of visibleTips) {\n const cat = tip.config.category;\n if (!categoryGroups.has(cat)) {\n categoryGroups.set(cat, []);\n }\n categoryGroups.get(cat)!.push(tip);\n }\n\n const hasCategories = visibleTips.some((t) => t.config.category);\n\n return html`\n <div\n style=${containerStyle}\n data-adaptive-id=${this.instanceId}\n data-adaptive-type=\"adaptive-nav\"\n >\n <div style=${accordionStyle}>\n ${\n hasCategories\n ? Array.from(categoryGroups.entries()).map(\n ([category, items]) => html`\n ${\n category\n ? html`<div style=${categoryHeaderStyle} data-category-header=${category}>${category}</div>`\n : nothing\n }\n ${items.map((tip, idx) => this.#renderTipItem(tip, idx, items.length))}\n `\n )\n : visibleTips.map((tip, idx) => this.#renderTipItem(tip, idx, visibleTips.length))\n }\n </div>\n </div>\n `;\n }\n}\n\n// ============================================================================\n// Custom element registration\n// ============================================================================\n\nconst TAG_NAME = 'syntro-nav-tips';\n\nexport function registerNavWidgetLit(): void {\n if (typeof window === 'undefined') return;\n if (!customElements.get(TAG_NAME)) {\n customElements.define(TAG_NAME, NavWidgetLit);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syntro-nav-tips': NavWidgetLit;\n }\n}\n", "/**\n * Pure decision function for nav-tip click routing.\n *\n * Given an href, an `external` flag, the current window's origin, and whether\n * the SDK is mounted inside an iframe, returns the navigation action to take.\n *\n * Extracted from NavWidgetLit so both the Lit and React widget variants\n * share one decision matrix and so the routing logic can be unit-tested\n * without mutating window.location (jsdom doesn't allow redefining\n * origin/href).\n */\n\nexport type NavTarget =\n | { kind: 'open'; url: string }\n | { kind: 'fullnav'; url: string }\n | { kind: 'spa'; url: URL };\n\nexport interface ResolveNavTargetArgs {\n href: string;\n external: boolean;\n windowOrigin: string;\n /**\n * True when the SDK is mounted inside an iframe (window !== window.top, or\n * window.top access threw cross-origin). When true, every nav escapes via\n * window.open \u2014 the parent page's sandbox `allow-popups` lets the new\n * window pop out to the user's main browser.\n */\n isIframe: boolean;\n}\n\n/**\n * Decide what to do with a nav-tip click.\n *\n * Routing branches (in order):\n *\n * 1. **Iframe context** (`isIframe=true` OR opaque origin \"null\"):\n * always `window.open` the href as-is. Action-plan authors who want\n * cross-iframe nav must use absolute URLs (any host \u2014 customer's,\n * partner's, doesn't matter). The sandbox's `allow-popups` lets the\n * open() call escape to the user's main browser.\n *\n * 2. **Explicit external** (`external=true`): always opens in `_blank`.\n *\n * 3. **Cross-origin absolute href** (no iframe; URL parses to a different\n * origin): full `window.location.href` navigation.\n *\n * 4. **Same-origin** (most common \u2014 SDK on customer site, internal route):\n * SPA-style `pushState` (caller falls back to framework router).\n *\n * 5. **Parse failure**: full-nav fallback; browser does its best.\n */\nexport function resolveNavTarget(args: ResolveNavTargetArgs): NavTarget {\n const { href, external, windowOrigin, isIframe } = args;\n\n const isOpaqueOrigin = windowOrigin === 'null';\n if (isIframe || isOpaqueOrigin) {\n return { kind: 'open', url: href };\n }\n\n if (external) {\n return { kind: 'open', url: href };\n }\n\n let url: URL;\n try {\n url = new URL(href, windowOrigin);\n } catch {\n return { kind: 'fullnav', url: href };\n }\n\n if (url.origin !== windowOrigin) {\n return { kind: 'fullnav', url: url.toString() };\n }\n\n return { kind: 'spa', url };\n}\n\n/**\n * Helper: detect whether the current window is mounted in an iframe.\n * Cross-origin parent access can throw \u2014 treat that as \"in iframe.\"\n */\nexport function detectIsIframe(): boolean {\n if (typeof window === 'undefined') return false;\n try {\n return window !== window.top;\n } catch {\n return true;\n }\n}\n", "/**\n * Adaptive Nav - Runtime Module\n *\n * Runtime manifest for the navigation tips accordion adaptive.\n * Mounts the `<syntro-nav-tips>` Lit web component.\n * Includes widget-based nav tips and navigation action executors\n * (scrollTo, navigate) previously in adaptive-navigation.\n */\n\nimport { type MountPlumbing, stripMountPlumbing } from '@syntrologie/sdk-contracts';\nimport { registerNavWidgetLit } from './NavWidgetLit';\nimport type {\n ActionExecutor,\n ExecutorResult,\n NavConfig,\n NavigateAction,\n NavTipAction,\n NavWidgetRuntime,\n ScrollToAction,\n} from './types';\n\n// ============================================================================\n// Navigation Action Executors (merged from adaptive-navigation)\n// ============================================================================\n\n/**\n * Execute a scrollTo action\n */\nexport const executeScrollTo: ActionExecutor<ScrollToAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n const anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl) {\n console.error(\n `[adaptive-nav] Anchor not found for scrollTo, skipping: ${action.anchorId.selector}`\n );\n return { cleanup: () => {} };\n }\n\n // Scroll to element\n anchorEl.scrollIntoView({\n behavior: action.behavior ?? 'smooth',\n block: action.block ?? 'center',\n inline: action.inline ?? 'nearest',\n });\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'navigation:scrollTo',\n anchorId: action.anchorId,\n behavior: action.behavior ?? 'smooth',\n });\n\n return {\n cleanup: () => {\n // Optionally restore scroll position on revert\n },\n };\n};\n\n/**\n * Try to navigate using the host framework's native router.\n * Returns true if a framework router handled the navigation,\n * false if no framework was detected (caller should use pushState or location.href).\n *\n * Using the native router preserves SPA behavior (no full reload),\n * layout state, scroll position, and framework-specific features\n * (RSC streaming, view transitions, etc.).\n */\nexport function navigateWithFrameworkRouter(url: string): boolean {\n if (typeof window === 'undefined') return false;\n const w = window as any;\n\n // Next.js \u2014 window.next.router.push() triggers App Router navigation\n // with RSC fetch, layout preservation, and loading states\n try {\n const nextRouter = w.next?.router;\n if (nextRouter?.push) {\n nextRouter.push(url);\n return true;\n }\n } catch {\n /* fall through */\n }\n\n // Nuxt 3 \u2014 useRouter() isn't accessible from outside Vue, but\n // $nuxt.$router (Nuxt 2) or window.__NUXT__?.hooks (Nuxt 3) + navigateTo\n // aren't reliably exposed. Nuxt 2 exposes $nuxt.$router.push().\n try {\n if (w.$nuxt?.$router?.push) {\n w.$nuxt.$router.push(url);\n return true;\n }\n } catch {\n /* fall through */\n }\n\n // Angular \u2014 Angular Router isn't exposed on window by default.\n // The most reliable approach is to detect Angular and use location.href.\n if (w.ng || w.getAllAngularRootElements || document.querySelector('[ng-version]')) {\n window.location.href = url;\n return true;\n }\n\n // SvelteKit \u2014 goto() isn't on window, but __SVELTEKIT_DATA__ confirms the framework.\n if (w.__SVELTEKIT_DATA__ || document.body?.hasAttribute('data-sveltekit')) {\n window.location.href = url;\n return true;\n }\n\n // Astro (View Transitions) \u2014 no client-side router API exposed\n if (document.querySelector('[data-astro-transition-fallback]')) {\n window.location.href = url;\n return true;\n }\n\n return false;\n}\n\n/**\n * Check if a URL is same-origin as the current page.\n * Relative URLs (e.g. \"/dashboard\") are always same-origin.\n */\nfunction isSameOrigin(url: string): boolean {\n try {\n const parsed = new URL(url, window.location.origin);\n return parsed.origin === window.location.origin;\n } catch {\n // If URL parsing fails, fall back to full navigation\n return false;\n }\n}\n\n/**\n * Execute a navigate action\n */\nexport const executeNavigate: ActionExecutor<NavigateAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n // Validate URL to prevent javascript: URLs\n const url = action.url.trim();\n if (url.toLowerCase().startsWith('javascript:')) {\n throw new Error('javascript: URLs are not allowed');\n }\n\n const target = action.target ?? '_self';\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'navigation:navigate',\n url: action.url,\n target,\n });\n\n if (target === '_blank') {\n // Open in new tab\n window.open(url, '_blank', 'noopener,noreferrer');\n } else if (!action.forceFullNavigation && isSameOrigin(url)) {\n // Try the host framework's native router first (Next.js, Nuxt, Angular, etc.)\n // Falls back to pushState for vanilla SPAs, or location.href as last resort.\n if (!navigateWithFrameworkRouter(url)) {\n window.history.pushState(null, '', url);\n window.dispatchEvent(new PopStateEvent('popstate'));\n }\n } else {\n // Full navigation for cross-origin URLs or when explicitly requested\n window.location.href = url;\n }\n\n return {\n cleanup: () => {\n // Navigation cannot be reverted\n },\n };\n};\n\n// ============================================================================\n// Lit Mountable Widget\n// ============================================================================\n\n/**\n * NavWidgetLitMountable \u2014 Mounts the `<syntro-nav-tips>` Lit web component.\n * Self-registers the custom element on first use.\n */\nconst DEFAULT_NAV_CONFIG: NavConfig = {\n expandBehavior: 'single',\n theme: 'auto',\n actions: [],\n};\n\nexport const NavWidgetLitMountable = {\n mount(\n container: HTMLElement,\n config?: (NavConfig & MountPlumbing & { runtime?: NavWidgetRuntime }) | null\n ) {\n registerNavWidgetLit();\n\n const el = document.createElement('syntro-nav-tips');\n\n const incoming = config ?? null;\n const stripped = stripMountPlumbing<NavConfig & { runtime?: NavWidgetRuntime }>(incoming);\n const runtime = incoming?.runtime as NavWidgetRuntime | undefined;\n const instanceId = incoming?.instanceId ?? 'nav-widget';\n const navConfig: NavConfig = incoming ? (stripped as NavConfig) : { ...DEFAULT_NAV_CONFIG };\n\n // Assign structured props as JS properties (not HTML attributes)\n Object.assign(el, {\n config: navConfig,\n runtime,\n instanceId,\n });\n\n container.appendChild(el);\n\n return () => el.remove();\n },\n};\n\n// ============================================================================\n// Executor Definitions for Registration\n// ============================================================================\n\n/**\n * All executors provided by this app.\n * These are registered with the runtime's ExecutorRegistry.\n */\nexport const executors = [\n { kind: 'navigation:scrollTo', executor: executeScrollTo },\n { kind: 'navigation:navigate', executor: executeNavigate },\n] as const;\n\n// ============================================================================\n// App Runtime Manifest\n// ============================================================================\n\n/**\n * Runtime manifest for adaptive-nav.\n *\n * Provides:\n * - Navigation action executors (scrollTo, navigate)\n * - Widget-based nav tips accordion using the Lit web component\n */\nexport const runtime = {\n id: 'adaptive-nav',\n version: '2.0.0',\n name: 'Navigation Tips',\n description: 'Navigation actions and accordion-based tips with per-item conditional visibility',\n\n /**\n * Navigation action executors (scrollTo, navigate).\n */\n executors,\n\n /**\n * Widget definitions for the runtime's WidgetRegistry.\n */\n widgets: [\n {\n id: 'adaptive-nav:tips',\n component: NavWidgetLitMountable,\n metadata: {\n name: 'Navigation Tips',\n description: 'Accordion of contextual navigation tips with per-item visibility',\n icon: '\\u{1F9ED}',\n },\n },\n ],\n\n /**\n * Extract notify watcher entries from tile config props.\n * The runtime evaluates these continuously (even with drawer closed)\n * and publishes nav:tip_revealed when triggerWhen transitions false \u2192 true.\n */\n notifyWatchers(props: Record<string, unknown>) {\n const actions = (props.actions ?? []) as NavTipAction[];\n return actions\n .filter((a) => a.notify && a.triggerWhen)\n .map((a) => ({\n id: `nav:${a.config.id}`,\n strategy: a.triggerWhen!,\n eventName: 'nav:tip_revealed',\n eventProps: {\n tipId: a.config.id,\n title: a.notify!.title,\n body: a.notify!.body,\n icon: a.notify!.icon,\n },\n }));\n },\n};\n\nexport default runtime;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAeA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;;;ACkCpB,SAAS,iBAAiB,MAAuC;AACtE,QAAM,EAAE,MAAM,UAAU,cAAc,SAAS,IAAI;AAEnD,QAAM,iBAAiB,iBAAiB;AACxC,MAAI,YAAY,gBAAgB;AAC9B,WAAO,EAAE,MAAM,QAAQ,KAAK,KAAK;AAAA,EACnC;AAEA,MAAI,UAAU;AACZ,WAAO,EAAE,MAAM,QAAQ,KAAK,KAAK;AAAA,EACnC;AAEA,MAAI;AACJ,MAAI;AACF,UAAM,IAAI,IAAI,MAAM,YAAY;AAAA,EAClC,QAAQ;AACN,WAAO,EAAE,MAAM,WAAW,KAAK,KAAK;AAAA,EACtC;AAEA,MAAI,IAAI,WAAW,cAAc;AAC/B,WAAO,EAAE,MAAM,WAAW,KAAK,IAAI,SAAS,EAAE;AAAA,EAChD;AAEA,SAAO,EAAE,MAAM,OAAO,IAAI;AAC5B;AAMO,SAAS,iBAA0B;AACxC,MA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AAA,IACF,CAAC;AAED,cAAU,YAAY,EAAE;AAExB,WAAO,MAAM,GAAG,OAAO;AAAA,EACzB;AACF;AAUO,IAAM,YAAY;AAAA,EACvB,EAAE,MAAM,uBAAuB,UAAU,gBAAgB;AAAA,EACzD,EAAE,MAAM,uBAAuB,UAAU,gBAAgB;AAC3D;AAaO,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA;AAAA;AAAA;AAAA,EAKb;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AAAA,IACP;AAAA,MACE,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,eAAe,OAAgC;AAC7C,UAAM,UAAW,MAAM,WAAW,CAAC;AACnC,WAAO,QACJ,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EACvC,IAAI,CAAC,OAAO;AAAA,MACX,IAAI,OAAO,EAAE,OAAO,EAAE;AAAA,MACtB,UAAU,EAAE;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,QACV,OAAO,EAAE,OAAO;AAAA,QAChB,OAAO,EAAE,OAAQ;AAAA,QACjB,MAAM,EAAE,OAAQ;AAAA,QAChB,MAAM,EAAE,OAAQ;AAAA,MAClB;AAAA,IACF,EAAE;AAAA,EACN;AACF;AAEA,IAAO,kBAAQ;",
|
|
6
6
|
"names": ["renderIcon", "runtime"]
|
|
7
7
|
}
|
package/dist/schema.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../sdk-contracts/dist/schemas.js", "../../../sdk-contracts/dist/icons.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 title / description / validation\n//\n// These live on every action *during authoring* (LLM produces them; dashboard\n// displays them; reviewers QA-verify with them) but are stripped before the\n// runtime SDK receives the config. Stripping happens server-side in\n// `to_runtime_config` (platform/backend/app/domains/experiments/helpers.py).\n// They appear in the JSON Schema (and therefore in the tactician's prompt)\n// because the LLM needs to know they are valid action properties \u2014 otherwise\n// schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions. Validation is an ordered list of\n// human-readable step strings \u2014 reviewers scan it as a checklist.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions. */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n // Derived behavioral signals\n 'behavior.rage_click',\n 'behavior.hesitation',\n 'behavior.confusion',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Centralized emoji \u2192 Lucide SVG icon mapping.\n *\n * Adaptives and the runtime can render config-supplied emoji icons as inline\n * Lucide SVGs without depending on `lucide-react`. Sourced from\n * https://lucide.dev (ISC license).\n *\n * Each entry is an array of inner SVG elements (`<path>`, `<polygon>`,\n * `<circle>`, etc.) for the canonical 24\u00D724 viewBox. `renderIcon()` wraps\n * them in a `<svg>` of the requested size + colour.\n *\n * If you add a new emoji to a config (action plan icon, FAQ icon, nav tip\n * icon, \u2026) add a matching entry here so it renders as a Lucide SVG instead\n * of falling back to the raw glyph.\n */\nconst PREFIX = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"';\n/** Inner-SVG path/shape data keyed by emoji character. */\nexport const EMOJI_SVG_PATHS = {\n // \u2500\u2500 existing in adaptive-nav \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCB5': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83C\uDFDB\uFE0F': [\n '<line x1=\"3\" x2=\"21\" y1=\"22\" y2=\"22\"/>',\n '<line x1=\"6\" x2=\"6\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"10\" x2=\"10\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"14\" x2=\"14\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"18\" x2=\"18\" y1=\"18\" y2=\"11\"/>',\n '<polygon points=\"12 2 20 7 4 7\"/>',\n ],\n '\u23ED\uFE0F': ['<polygon points=\"5 4 15 12 5 20 5 4\"/>', '<line x1=\"19\" x2=\"19\" y1=\"5\" y2=\"19\"/>'],\n '\u27A1\uFE0F': ['<path d=\"M5 12h14\"/>', '<path d=\"m12 5 7 7-7 7\"/>'],\n '\uD83D\uDCA1': [\n '<path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/>',\n '<path d=\"M9 18h6\"/>',\n '<path d=\"M10 22h4\"/>',\n ],\n '\uD83D\uDCB0': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83D\uDCCB': [\n '<rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\"/>',\n '<path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"/>',\n '<path d=\"M12 11h4\"/>',\n '<path d=\"M12 16h4\"/>',\n '<path d=\"M8 11h.01\"/>',\n '<path d=\"M8 16h.01\"/>',\n ],\n '\u2705': ['<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/>', '<path d=\"m9 11 3 3L22 4\"/>'],\n '\u26A0\uFE0F': [\n '<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/>',\n '<path d=\"M12 9v4\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n // \u2500\u2500 added for healthmaxxer action_plans \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDEE1\uFE0F': [\n '<path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\"/>',\n ],\n '\uD83D\uDCC8': [\n '<polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>',\n '<polyline points=\"16 7 22 7 22 13\"/>',\n ],\n '\uD83D\uDD2C': [\n '<path d=\"M6 18h8\"/>',\n '<path d=\"M3 22h18\"/>',\n '<path d=\"M14 22a7 7 0 1 0 0-14h-1\"/>',\n '<path d=\"M9 14h2\"/>',\n '<path d=\"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z\"/>',\n '<path d=\"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3\"/>',\n ],\n '\uD83D\uDC8A': [\n '<path d=\"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z\"/>',\n '<path d=\"m8.5 8.5 7 7\"/>',\n ],\n '\uD83D\uDCC4': [\n '<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/>',\n '<path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/>',\n '<path d=\"M10 9H8\"/>',\n '<path d=\"M16 13H8\"/>',\n '<path d=\"M16 17H8\"/>',\n ],\n '\uD83E\uDDEA': [\n '<path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\"/>',\n '<path d=\"M6.453 15h11.094\"/>',\n '<path d=\"M8.5 2h7\"/>',\n ],\n '\uD83D\uDD01': [\n '<path d=\"m17 2 4 4-4 4\"/>',\n '<path d=\"M3 11v-1a4 4 0 0 1 4-4h14\"/>',\n '<path d=\"m7 22-4-4 4-4\"/>',\n '<path d=\"M21 13v1a4 4 0 0 1-4 4H3\"/>',\n ],\n '\uD83E\uDDE0': [\n '<path d=\"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z\"/>',\n '<path d=\"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z\"/>',\n '<path d=\"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4\"/>',\n '<path d=\"M17.599 6.5a3 3 0 0 0 .399-1.375\"/>',\n '<path d=\"M6.003 5.125A3 3 0 0 0 6.401 6.5\"/>',\n '<path d=\"M3.477 10.896a4 4 0 0 1 .585-.396\"/>',\n '<path d=\"M19.938 10.5a4 4 0 0 1 .585.396\"/>',\n '<path d=\"M6 18a4 4 0 0 1-1.967-.516\"/>',\n '<path d=\"M19.967 17.484A4 4 0 0 1 18 18\"/>',\n ],\n '\uD83C\uDF19': ['<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"/>'],\n '\uD83D\uDCE6': [\n '<path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\"/>',\n '<path d=\"M12 22V12\"/>',\n '<path d=\"m3.3 7 8.7 5 8.7-5\"/>',\n '<path d=\"m7.5 4.27 9 5.15\"/>',\n ],\n '\uD83D\uDE9A': [\n // Lucide truck\n '<path d=\"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2\"/>',\n '<path d=\"M15 18H9\"/>',\n '<path d=\"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14\"/>',\n '<circle cx=\"17\" cy=\"18\" r=\"2\"/>',\n '<circle cx=\"7\" cy=\"18\" r=\"2\"/>',\n ],\n '\uD83C\uDF31': [\n '<path d=\"M7 20h10\"/>',\n '<path d=\"M10 20c5.5-2.5.8-6.4 3-10\"/>',\n '<path d=\"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z\"/>',\n '<path d=\"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z\"/>',\n ],\n '\u26A1': [\n '<path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\"/>',\n ],\n '\uD83D\uDD25': [\n // Lucide flame\n '<path d=\"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z\"/>',\n ],\n '\uD83C\uDF33': [\n '<path d=\"M12 22V8\"/>',\n '<path d=\"m17 8-5-6-5 6\"/>',\n '<path d=\"M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0\"/>',\n '<path d=\"M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0\"/>',\n ],\n '\uD83C\uDF3F': [\n '<path d=\"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5\"/>',\n '<path d=\"M2 21c0-3 1.85-5.36 5.08-6\"/>',\n ],\n // \u2500\u2500 added for runtime-sdk SyntroTileCard / SyntroToastStack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\u2753': [\n // HelpCircle\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n '\uD83E\uDDED': [\n // Compass\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<polygon points=\"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76\"/>',\n ],\n '\uD83D\uDCDD': [\n // FileText\n '<path d=\"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z\"/>',\n '<polyline points=\"14 2 14 8 20 8\"/>',\n '<line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/>',\n '<line x1=\"10\" y1=\"9\" x2=\"8\" y2=\"9\"/>',\n ],\n '\uD83C\uDFAF': [\n // Layers (bullseye-shaped emoji rendered as Lucide Layers \u2014 historical)\n '<polygon points=\"12 2 2 7 12 12 22 7 12 2\"/>',\n '<polyline points=\"2 17 12 22 22 17\"/>',\n '<polyline points=\"2 12 12 17 22 12\"/>',\n ],\n '\uD83C\uDFC6': [\n // Trophy\n '<path d=\"M6 9H4.5a2.5 2.5 0 0 1 0-5H6\"/>',\n '<path d=\"M18 9h1.5a2.5 2.5 0 0 0 0-5H18\"/>',\n '<path d=\"M4 22h16\"/>',\n '<path d=\"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22\"/>',\n '<path d=\"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22\"/>',\n '<path d=\"M18 2H6v7a6 6 0 0 0 12 0V2Z\"/>',\n ],\n '\u2728': [\n // Sparkles\n '<path d=\"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z\"/>',\n '<path d=\"M5 3v4\"/>',\n '<path d=\"M19 17v4\"/>',\n '<path d=\"M3 5h4\"/>',\n '<path d=\"M17 19h4\"/>',\n ],\n '\uD83D\uDCAC': [\n // MessageCircle\n '<path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\"/>',\n ],\n '\uD83C\uDFAE': [\n // Gamepad2\n '<line x1=\"6\" y1=\"11\" x2=\"10\" y2=\"11\"/>',\n '<line x1=\"8\" y1=\"9\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"15\" y1=\"12\" x2=\"15.01\" y2=\"12\"/>',\n '<line x1=\"18\" y1=\"10\" x2=\"18.01\" y2=\"10\"/>',\n '<path d=\"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z\"/>',\n ],\n '\u23F1\uFE0F': [\n // Timer\n '<line x1=\"10\" y1=\"2\" x2=\"14\" y2=\"2\"/>',\n '<line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"8\"/>',\n '<circle cx=\"12\" cy=\"14\" r=\"8\"/>',\n ],\n '\uD83D\uDCD6': [\n // BookOpen\n '<path d=\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\"/>',\n '<path d=\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\"/>',\n ],\n '\uD83D\uDD14': [\n // Bell\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>',\n '<path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n ],\n // \u2500\u2500 common UI icons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83C\uDF93': [\n // GraduationCap\n '<path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\"/>',\n '<path d=\"M22 10v6\"/>',\n '<path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\"/>',\n ],\n '\u23F0': [\n // AlarmClock\n '<circle cx=\"12\" cy=\"13\" r=\"8\"/>',\n '<path d=\"M12 9v4l2 2\"/>',\n '<path d=\"M5 3 2 6\"/>',\n '<path d=\"m22 6-3-3\"/>',\n '<path d=\"M6.38 18.7 4 21\"/>',\n '<path d=\"M17.64 18.67 20 21\"/>',\n ],\n '\uD83D\uDD04': [\n // RefreshCw\n '<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\"/>',\n '<path d=\"M21 3v5h-5\"/>',\n '<path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\"/>',\n '<path d=\"M8 16H3v5\"/>',\n ],\n '\uD83D\uDC64': [\n // User\n '<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/>',\n '<circle cx=\"12\" cy=\"7\" r=\"4\"/>',\n ],\n '\uD83C\uDFE0': [\n // House\n '<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"/>',\n '<path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>',\n ],\n '\uD83D\uDED2': [\n // ShoppingCart\n '<circle cx=\"8\" cy=\"21\" r=\"1\"/>',\n '<circle cx=\"19\" cy=\"21\" r=\"1\"/>',\n '<path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\"/>',\n ],\n // \u2500\u2500 viz / chart icons (paired with adaptive-viz) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCCA': [\n // BarChart3 \u2014 pairs with \uD83D\uDCC8 (TrendingUp)\n '<path d=\"M3 3v18h18\"/>',\n '<path d=\"M18 17V9\"/>',\n '<path d=\"M13 17V5\"/>',\n '<path d=\"M8 17v-3\"/>',\n ],\n '\uD83D\uDCC9': [\n // TrendingDown\n '<polyline points=\"22 17 13.5 8.5 8.5 13.5 2 7\"/>',\n '<polyline points=\"16 17 22 17 22 11\"/>',\n ],\n '\uD83E\uDD67': [\n // PieChart\n '<path d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"/>',\n '<path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\"/>',\n ],\n '\uD83D\uDCB9': [\n // Activity \u2014 line-chart-style waveform\n '<path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2\"/>',\n ],\n '\uD83C\uDF21\uFE0F': [\n // Thermometer \u2014 gauge-style indicator\n '<path d=\"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z\"/>',\n ],\n};\n/**\n * Render a Lucide SVG for the given emoji. Returns the inline `<svg>` string.\n * If the emoji isn't mapped, returns an empty string \u2014 caller should fall back\n * to rendering the raw emoji glyph (e.g. via text or HTML escape).\n */\nexport function renderIcon(emoji, options = {}) {\n const paths = EMOJI_SVG_PATHS[emoji];\n if (!paths)\n return '';\n const size = options.size ?? 14;\n const stroke = options.color ?? 'currentColor';\n return `${PREFIX} width=\"${size}\" height=\"${size}\" stroke=\"${stroke}\">${paths.join('')}</svg>`;\n}\n/** Whether an emoji has a Lucide SVG mapping. */\nexport function hasIcon(emoji) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: tsconfig target ES2020 doesn't include Object.hasOwn\n return Object.prototype.hasOwnProperty.call(EMOJI_SVG_PATHS, emoji);\n}\n"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,SAAS;AAIX,IAAM,YAAY,EACpB,OAAO;AAAA,EACR,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,EACI,OAAO;AAgBL,IAAM,mBAAmB;AAAA,EAC5B,OAAO,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,6GAA6G;AAAA,EAC3H,aAAa,EAC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