@syntrologie/adapt-chatbot 2.8.0-canary.31 → 2.8.0-canary.310
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/AdaptiveChatBar.d.ts +85 -0
- package/dist/AdaptiveChatBar.d.ts.map +1 -0
- package/dist/AdaptiveChatBar.js +10 -0
- package/dist/AdaptiveChatBar.js.map +7 -0
- package/dist/AdaptiveChatBarMountable.d.ts +35 -0
- package/dist/AdaptiveChatBarMountable.d.ts.map +1 -0
- package/dist/AdaptiveChatTrail.d.ts +85 -0
- package/dist/AdaptiveChatTrail.d.ts.map +1 -0
- package/dist/AdaptiveChatTrail.js +9 -0
- package/dist/AdaptiveChatTrail.js.map +7 -0
- package/dist/AdaptiveChipsStrip.d.ts +1150 -0
- package/dist/AdaptiveChipsStrip.d.ts.map +1 -0
- package/dist/AdaptiveChipsStrip.js +11 -0
- package/dist/AdaptiveChipsStrip.js.map +7 -0
- package/dist/AdaptiveChipsStripMountable.d.ts +24 -0
- package/dist/AdaptiveChipsStripMountable.d.ts.map +1 -0
- package/dist/ChatAssistantLit.d.ts +60 -0
- package/dist/ChatAssistantLit.d.ts.map +1 -0
- package/dist/ChatAssistantLit.js +12 -0
- package/dist/ChatAssistantLit.js.map +7 -0
- package/dist/ChatSession.d.ts +178 -0
- package/dist/ChatSession.d.ts.map +1 -0
- package/dist/ChatTransport.d.ts +283 -0
- package/dist/ChatTransport.d.ts.map +1 -0
- package/dist/NavLinkMountable.d.ts +25 -0
- package/dist/NavLinkMountable.d.ts.map +1 -0
- package/dist/NavLinkMountable.test.d.ts +2 -0
- package/dist/NavLinkMountable.test.d.ts.map +1 -0
- package/dist/TextAnswerMountable.d.ts +17 -0
- package/dist/TextAnswerMountable.d.ts.map +1 -0
- package/dist/Turnstile.d.ts +83 -0
- package/dist/Turnstile.d.ts.map +1 -0
- package/dist/cdn.d.ts +2 -6
- package/dist/cdn.d.ts.map +1 -1
- package/dist/chunk-2ZUJ7DZI.js +8770 -0
- package/dist/chunk-2ZUJ7DZI.js.map +7 -0
- package/dist/chunk-BNN5YLN3.js +417 -0
- package/dist/chunk-BNN5YLN3.js.map +7 -0
- package/dist/chunk-FVNSOP7B.js +634 -0
- package/dist/chunk-FVNSOP7B.js.map +7 -0
- package/dist/chunk-ONGGPQER.js +3722 -0
- package/dist/chunk-ONGGPQER.js.map +7 -0
- package/dist/chunk-SCVTTLFJ.js +334 -0
- package/dist/chunk-SCVTTLFJ.js.map +7 -0
- package/dist/chunk-UVKRO5ER.js +13 -0
- package/dist/chunk-UVKRO5ER.js.map +7 -0
- package/dist/chunk-VLJ3WOEX.js +231 -0
- package/dist/chunk-VLJ3WOEX.js.map +7 -0
- package/dist/editor-lit.d.ts +37 -0
- package/dist/editor-lit.d.ts.map +1 -0
- package/dist/editor-lit.js +134 -0
- package/dist/editor-lit.js.map +7 -0
- package/dist/elements/ActionHandler.d.ts +34 -0
- package/dist/elements/ActionHandler.d.ts.map +1 -0
- package/dist/elements/ElementInstanceStore.d.ts +155 -0
- package/dist/elements/ElementInstanceStore.d.ts.map +1 -0
- package/dist/elements/ElementInstanceStore.test.d.ts +2 -0
- package/dist/elements/ElementInstanceStore.test.d.ts.map +1 -0
- package/dist/elements/ElementTypeHandler.d.ts +77 -0
- package/dist/elements/ElementTypeHandler.d.ts.map +1 -0
- package/dist/elements/ItemHandler.d.ts +60 -0
- package/dist/elements/ItemHandler.d.ts.map +1 -0
- package/dist/elements/ItemHandler.test.d.ts +2 -0
- package/dist/elements/ItemHandler.test.d.ts.map +1 -0
- package/dist/elements/TileHandler.d.ts +52 -0
- package/dist/elements/TileHandler.d.ts.map +1 -0
- package/dist/elements/blockRenderer.d.ts +46 -0
- package/dist/elements/blockRenderer.d.ts.map +1 -0
- package/dist/elements/blockRenderer.test.d.ts +13 -0
- package/dist/elements/blockRenderer.test.d.ts.map +1 -0
- package/dist/elements/blocks.d.ts +58 -0
- package/dist/elements/blocks.d.ts.map +1 -0
- package/dist/elements/envelope.d.ts +24 -0
- package/dist/elements/envelope.d.ts.map +1 -0
- package/dist/elements/fetcher.d.ts +40 -0
- package/dist/elements/fetcher.d.ts.map +1 -0
- package/dist/elements/index.d.ts +32 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/types.d.ts +106 -0
- package/dist/elements/types.d.ts.map +1 -0
- package/dist/observer/__tests__/allowlist.test.d.ts +9 -0
- package/dist/observer/__tests__/allowlist.test.d.ts.map +1 -0
- package/dist/observer/__tests__/observer-isolation.test.d.ts +13 -0
- package/dist/observer/__tests__/observer-isolation.test.d.ts.map +1 -0
- package/dist/observer/__tests__/queue.test.d.ts +2 -0
- package/dist/observer/__tests__/queue.test.d.ts.map +1 -0
- package/dist/observer/__tests__/transport.test.d.ts +2 -0
- package/dist/observer/__tests__/transport.test.d.ts.map +1 -0
- package/dist/observer/allowlist.d.ts +32 -0
- package/dist/observer/allowlist.d.ts.map +1 -0
- package/dist/observer/index.d.ts +35 -0
- package/dist/observer/index.d.ts.map +1 -0
- package/dist/observer/queue.d.ts +57 -0
- package/dist/observer/queue.d.ts.map +1 -0
- package/dist/observer/transport.d.ts +26 -0
- package/dist/observer/transport.d.ts.map +1 -0
- package/dist/runtime-lit.d.ts +8 -0
- package/dist/runtime-lit.d.ts.map +1 -0
- package/dist/runtime.d.ts +8 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1649 -29
- package/dist/runtime.js.map +7 -0
- package/dist/schema.d.ts +3298 -11
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +126 -31
- package/dist/schema.js.map +7 -0
- package/dist/types.d.ts +47 -31
- package/dist/types.d.ts.map +1 -1
- package/package.json +50 -19
- package/dist/ChatAssistant.d.ts +0 -18
- package/dist/ChatAssistant.d.ts.map +0 -1
- package/dist/ChatAssistant.js +0 -178
- package/dist/actionParser.d.ts +0 -15
- package/dist/actionParser.d.ts.map +0 -1
- package/dist/actionParser.js +0 -52
- package/dist/apiClient.d.ts +0 -23
- package/dist/apiClient.d.ts.map +0 -1
- package/dist/apiClient.js +0 -51
- package/dist/cdn.js +0 -37
- package/dist/editor.d.ts +0 -17
- package/dist/editor.d.ts.map +0 -1
- package/dist/editor.js +0 -36
- package/dist/types.js +0 -6
- package/dist/useChat.d.ts +0 -25
- package/dist/useChat.d.ts.map +0 -1
- package/dist/useChat.js +0 -106
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/AdaptiveChipsStrip.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * AdaptiveChipsStrip \u2014 the suggested-chips tile kind.\n *\n * A horizontally scrollable strip of chips. Each chip carries a title\n * and a typed payload. Clicking a chip mounts its payload widget in a\n * chromed drawer directly below the strip; clicking again (or the\n * payload's close button) collapses it. Only one chip is open at a\n * time per strip.\n *\n * Payload rendering goes through the runtime widget registry \u2014 the\n * payload is a `{ widget, props? }` reference (same shape as\n * `slots.drawer.lid`). Click \u2192 strip looks the widget id up in\n * `runtime.widgets`, mounts it into the drawer body, unmounts on\n * close. No resolver map, no per-customer JS \u2014 the same registry\n * that mounts tile widgets handles chip payloads.\n *\n * Built-in payload widgets (registered by this adaptive):\n * - `adaptive-chatbot:text-answer` \u2014 single paragraph of text\n *\n * Customers ship their own widgets through the standard adaptive\n * registration path (each adaptive's `runtime.widgets` list). LLM-\n * authored configs reference them by id; the widget owns its props\n * schema. No new vocabulary per chip \u2014 same as every other widget\n * in the SDK.\n *\n * Light DOM. The strip itself is chromeless per the PRD; the payload\n * drawer below is *always* chromed (PRD \u00A76.7) \u2014 the chromed boundary\n * is what visually links the open chip to its content.\n *\n * See PRD \u00A74.5 (the suggested-chips pattern) for the canonical UX.\n */\n\nimport { AuthoringFieldsZ, NotifyZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';\nimport { html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { z } from 'zod';\n\n/**\n * Structural type for just the runtime surfaces this strip uses.\n * Avoids a hard dependency on @syntrologie/runtime-sdk while staying\n * compatible with the real `SmartCanvasRuntime` shape.\n *\n * `events.subscribe` is optional \u2014 present when running inside the full\n * canvas runtime where the chips strip wants to receive LLM-authored\n * chips via `element.compositional_append`. Absent in standalone test\n * harnesses; the strip falls back to hand-authored chips only.\n */\ninterface ChipsStripRuntime {\n widgets: {\n has: (id: string) => boolean;\n mount: (\n id: string,\n container: HTMLElement,\n props?: Record<string, unknown>\n ) => { unmount: () => void; update?: (props?: Record<string, unknown>) => void };\n };\n events?: {\n /** Used to ping the store with a replay request when the chip strip\n * (re)mounts \u2014 see `_subscribeCompositional`. */\n publish?: (name: string, props?: Record<string, unknown>) => void;\n subscribe?: (\n handler: (event: { name: string; props?: Record<string, unknown> }) => void\n ) => () => void;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Schema \u2014 `suggestions:chip` follows the compositional-action pattern\n// used by `faq:question`. Each chip is a discriminated-union action\n// envelope (`kind`, `config`, optional `triggerWhen` + `notify`) so it\n// inherits the SDK's validation, conditional-gating, authoring-metadata,\n// and LLM-authoring vocabulary for free.\n//\n// The chip's `payload` is a widget reference \u2014 same `{ widget, props }`\n// shape used by `slots.drawer.lid` and tile configs. The strip mounts\n// the widget via the runtime widget registry. LLMs author payloads by\n// picking from the catalog of registered widget ids \u2014 same closed\n// vocabulary they use everywhere else in the SDK. No per-customer JS,\n// no resolver maps.\n// ---------------------------------------------------------------------------\n\nconst ChipPayloadZ = z\n .object({\n widget: z\n .string()\n .min(1)\n .describe(\n \"Widget id from the runtime registry \u2014 same vocabulary as a tile's `widget` field. Click \u2192 strip mounts this widget into the chip drawer. Built-ins shipped by adaptive-chatbot: `adaptive-chatbot:text-answer`. Other adaptives register their own (e.g. `adaptive-faq:question-card`, `adaptive-product:mini`).\"\n ),\n props: z\n .record(z.unknown())\n .optional()\n .describe('Props passed to the mounted widget. The widget owns its own props schema.'),\n })\n .strict()\n .describe(\n \"The content that mounts in the chip's drawer when it opens. Same { widget, props } shape used by slots.lid and tile configs \u2014 chips are tiles by another name.\"\n );\n\n/**\n * Schema for a single suggestion chip (compositional action).\n *\n * Mirrors the `faq:question` pattern: discriminated by `kind`, body in\n * `config`, optional `triggerWhen` for per-chip conditional visibility,\n * optional `notify` for a toast when the chip first becomes relevant,\n * plus the standard `AuthoringFieldsZ` (id/title/description/validation \u2014\n * stripped server-side before serving to the runtime).\n */\nexport const SuggestionChipSchema = z\n .object({\n ...AuthoringFieldsZ,\n kind: z\n .literal('suggestions:chip')\n .describe(\n 'Compositional action type for a single chip in the AdaptiveChipsStrip. Rendered by the strip widget; not executed by the runtime action engine.'\n ),\n config: z\n .object({\n id: z.string().min(1).describe('Stable identity for keyed rendering and event payloads.'),\n title: z\n .string()\n .min(1)\n .describe('Chip label \u2014 single line, ~32ch typical, ellipsis-truncates beyond.'),\n payload: ChipPayloadZ,\n })\n .describe(\n 'Per-chip configuration: identity, label, and the payload that opens in the drawer.'\n ),\n triggerWhen: TriggerWhenZ.describe(\n 'Conditional visibility strategy. When null or omitted, the chip is always shown. Use a rules strategy to show/hide based on page URL, event counts, or session metrics \u2014 same evaluator that powers tile activation.'\n ),\n notify: NotifyZ.describe(\n 'Toast notification shown when triggerWhen transitions false \u2192 true. Required when triggerWhen is set \u2014 pass null to opt out of the toast.'\n ),\n })\n .refine((data) => !data.triggerWhen || data.notify !== undefined, {\n message:\n 'notify is required when triggerWhen is present (use null to opt out of notifications)',\n })\n .describe(\n 'A single suggestion chip in the chips strip. Same authoring shape as faq:question \u2014 discriminator + config body + optional conditional gating + optional proactive notification.'\n );\n\n// ---------------------------------------------------------------------------\n// Types (inferred from schema \u2014 single source of truth)\n// ---------------------------------------------------------------------------\n\n/** A widget-reference payload that mounts in the drawer when its chip is opened. */\nexport type ChipPayload = z.infer<typeof ChipPayloadZ>;\n\n/** Declarative chip data. Inferred from `SuggestionChipSchema`. */\nexport type SuggestionChip = z.infer<typeof SuggestionChipSchema>;\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport class AdaptiveChipsStrip extends LitElement {\n static override properties = {\n chips: { attribute: false },\n runtimeRef: { attribute: false },\n chromeless: { type: Boolean, reflect: true },\n _openId: { state: true },\n _canScrollLeft: { state: true },\n _canScrollRight: { state: true },\n };\n\n chips: SuggestionChip[] = [];\n /**\n * Runtime reference \u2014 provides `widgets.has(id)` and\n * `widgets.mount(id, container, props)` so the strip can render\n * chip payloads through the same registry that mounts tile widgets.\n * Null until the host wires it (the AdaptiveChipsStripMountable\n * passes it in from the runtime).\n */\n runtimeRef: ChipsStripRuntime | null = null;\n /**\n * Strip-level chrome toggle \u2014 applies uniformly to all chips +\n * the payload drawer. Resolved upstream from `tile.chromeless`\n * (which itself defaults from `slot.theme.chromeless`). Per-chip\n * inconsistency would break the mini-canvas visual rhythm so\n * there's no per-chip flag \u2014 one strip, one style.\n */\n chromeless = false;\n _openId: string | null = null;\n /**\n * Horizontal-scroll affordance state. The strip is a single row that\n * overflows horizontally when there are more chips than the panel\n * width can hold; the left/right chevron buttons are visible only\n * when the user can actually scroll in that direction. ResizeObserver\n * + scroll listener keep these in sync.\n */\n _canScrollLeft = false;\n _canScrollRight = false;\n private _stripResizeObserver: ResizeObserver | null = null;\n /** Unsubscribe handle for the compositional-append/patch/remove event\n * subscription on `runtime.events`. Null when the strip hasn't yet\n * resolved its tile id (no parent container yet) or the runtime\n * doesn't expose an event bus. */\n private _compositionalUnsub: (() => void) | null = null;\n /** Tile id this strip occupies. Resolved on first `updated()` pass by\n * walking the DOM ancestor chain for `data-tile-id`. Cached because\n * the lookup is stable for the lifetime of the mount. Null while\n * unresolved (or when not running inside a SyntroTileCard, e.g.\n * in standalone test fixtures). */\n private _tileId: string | null = null;\n /** Instance ids of chips appended by LLM mounts (vs. authored chip\n * configs from `props.chips`). Tracked so `removeItem(instance_id)`\n * can find and prune by id. */\n private _llmAppendedIds: Set<string> = new Set();\n\n /**\n * Tracks the currently-mounted payload widget so we can swap on chip\n * change + unmount on close. Same lifecycle pattern as\n * `SyntroCanvasOverlay._lidMountHandle`.\n */\n private _payloadMount: {\n chipId: string;\n widgetId: string;\n handle: { unmount: () => void; update?: (props?: Record<string, unknown>) => void };\n } | null = null;\n\n override createRenderRoot(): HTMLElement {\n return this;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._unmountPayload();\n this._stripResizeObserver?.disconnect();\n this._stripResizeObserver = null;\n this._compositionalUnsub?.();\n this._compositionalUnsub = null;\n }\n\n override updated(changed: Map<string, unknown>): void {\n super.updated(changed);\n // Reconcile the payload mount whenever the open chip, the chip\n // data (props could have changed), or the runtime changes.\n if (changed.has('_openId') || changed.has('chips') || changed.has('runtimeRef')) {\n this._syncPayloadMount();\n }\n // Wire scroll affordances every render in case the strip DOM was\n // recreated. Idempotent: re-attaching to the same node is a no-op.\n this._syncStripObserver();\n this._updateScrollAffordances();\n // Re-resolve the tile id + (re)attach the compositional-append\n // subscription whenever the runtime ref changes. The tile id is\n // looked up from the closest `[data-tile-id]` ancestor \u2014 set by\n // SyntroTileCard's render.\n if (changed.has('runtimeRef')) {\n this._compositionalUnsub?.();\n this._compositionalUnsub = null;\n this._tileId = this._resolveTileId();\n }\n // Lazy-subscribe: the runtime may not have `events.subscribe`\n // resolved at first `updated()` pass (the chips strip mounts before\n // the runtime finishes wiring its event bus). Re-attempt on every\n // updated() pass while we're still unsubscribed \u2014 idempotent once\n // the subscription lands.\n if (!this._compositionalUnsub && this._tileId == null) {\n this._tileId = this._resolveTileId();\n }\n if (!this._compositionalUnsub) {\n this._subscribeCompositional();\n }\n }\n\n private _resolveTileId(): string | null {\n const anchor = this.closest<HTMLElement>('[data-tile-id]');\n return anchor?.getAttribute('data-tile-id') ?? null;\n }\n\n /**\n * Subscribe to the runtime's event bus for compositional-item events\n * targeting this strip's tile id. The subscription survives until\n * disconnect; when an event arrives with a non-matching tile_id, it's\n * a no-op (the same subscription handles all strips on the page \u2014\n * filter is just per-event check).\n */\n private _subscribeCompositional(): void {\n // Call via the bus object so `this` stays bound to the EventBus\n // instance \u2014 extracting the method to a local would lose its\n // `this.subscriptions` and throw at the first call.\n const bus = this.runtimeRef?.events;\n if (!bus?.subscribe || !this._tileId) return;\n const tileId = this._tileId;\n this._compositionalUnsub = bus.subscribe((event) => {\n const props = event.props ?? {};\n // Filter to events targeting THIS strip's tile.\n if (props.tile_id !== tileId) return;\n if (event.name === 'element.compositional_append') {\n this.insertItem(\n String(props.instance_id ?? ''),\n props.item as Record<string, unknown>,\n (props.position as 'append' | 'prepend') ?? 'append'\n );\n } else if (event.name === 'element.compositional_patch') {\n this.patchItem(String(props.instance_id ?? ''), props.item as Record<string, unknown>);\n } else if (event.name === 'element.compositional_remove') {\n this.removeItem(String(props.instance_id ?? ''));\n }\n });\n // Ask the store to replay any items it already has for our tile.\n // The store is a module-singleton that survives chat-bar unmount/\n // remount, so SPA-navigating away and back leaves persisted items\n // in memory; the replay re-publishes append events the subscription\n // above picks up. Dedup on `insertItem` keeps it idempotent if a\n // fresh hydrate is also in flight.\n bus.publish?.('element.compositional_replay_request', { tile_id: tileId });\n }\n\n // \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // CompositionalContainer contract \u2014 `ItemHandler` translates wire\n // mutations into events that call these methods. The wire `item`\n // shape is fully formed (`{kind, config: {id, title, payload, \u2026}}`);\n // the strip just appends, patches, or removes by `instance_id`.\n // `instance_id` is the canonical id; chip.config.id is set to it by\n // the backend, so they're the same value. We store the id on\n // `chip.config.id` and use that as the lookup key.\n // \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n /** Append (or prepend) a new chip authored by the LLM. */\n insertItem(\n instanceId: string,\n item: Record<string, unknown>,\n position: 'append' | 'prepend'\n ): void {\n if (!instanceId) return;\n if (this._llmAppendedIds.has(instanceId)) return; // dedup\n // The wire shape is `{kind: 'suggestions:chip', config: {\u2026}}`. We\n // accept it as-is \u2014 fully-formed chip envelope from the backend.\n const chip = item as unknown as SuggestionChip;\n if (!chip?.config?.id) return;\n this._llmAppendedIds.add(instanceId);\n this.chips = position === 'prepend' ? [chip, ...this.chips] : [...this.chips, chip];\n }\n\n /** Replace the existing chip's content. v1: full replacement (no\n * in-place merge); the chip widget already re-renders on chip data\n * changes. */\n patchItem(instanceId: string, item: Record<string, unknown>): void {\n if (!instanceId) return;\n const idx = this.chips.findIndex((c) => c.config.id === instanceId);\n if (idx < 0) return;\n const next = [...this.chips];\n next[idx] = item as unknown as SuggestionChip;\n this.chips = next;\n }\n\n /** Remove a chip by instance id. Closes the payload drawer if the\n * removed chip was the open one. */\n removeItem(instanceId: string): void {\n if (!instanceId) return;\n const next = this.chips.filter((c) => c.config.id !== instanceId);\n if (next.length === this.chips.length) return;\n this.chips = next;\n this._llmAppendedIds.delete(instanceId);\n if (this._openId === instanceId) this._openId = null;\n }\n\n /**\n * Attach a ResizeObserver to the scroll container so we recompute\n * left/right arrow visibility when chips are added/removed or the\n * panel width changes. The scroll listener on the strip element\n * handles user-driven scrolls.\n */\n private _syncStripObserver(): void {\n const strip = this.querySelector<HTMLElement>('[data-chips-strip]');\n if (!strip) {\n this._stripResizeObserver?.disconnect();\n this._stripResizeObserver = null;\n return;\n }\n // JSDOM (component tests) doesn't ship ResizeObserver. The strip\n // still functions without it \u2014 _updateScrollAffordances runs on\n // every `updated()` pass and on scroll events, so the only thing\n // missing is the \"external width change while no chip data changed\"\n // sync, which can't be exercised in a JSDOM unit test anyway.\n if (typeof ResizeObserver === 'undefined') return;\n if (!this._stripResizeObserver) {\n this._stripResizeObserver = new ResizeObserver(() => this._updateScrollAffordances());\n }\n // disconnect+observe is cheap and avoids dangling observation when\n // Lit recycles the DOM node for whatever reason.\n this._stripResizeObserver.disconnect();\n this._stripResizeObserver.observe(strip);\n }\n\n /**\n * Recompute whether the left/right scroll arrows should be visible.\n * Left arrow \u21D0 scrollLeft > 0. Right arrow \u21D0 there are more chips\n * to the right (scrollLeft + clientWidth < scrollWidth). Threshold\n * of 1px tolerance handles sub-pixel rounding on scaled displays.\n */\n private _updateScrollAffordances(): void {\n const strip = this.querySelector<HTMLElement>('[data-chips-strip]');\n if (!strip) return;\n const canLeft = strip.scrollLeft > 1;\n const canRight = strip.scrollLeft + strip.clientWidth < strip.scrollWidth - 1;\n if (canLeft !== this._canScrollLeft) this._canScrollLeft = canLeft;\n if (canRight !== this._canScrollRight) this._canScrollRight = canRight;\n }\n\n private _onStripScroll = (): void => {\n this._updateScrollAffordances();\n };\n\n /**\n * Scroll the strip by ~80% of its visible width, so each arrow click\n * advances the user past most-but-not-all of the current chips\n * (a small overlap helps the user keep their place in the row).\n */\n private _scrollBy(direction: 'left' | 'right'): void {\n const strip = this.querySelector<HTMLElement>('[data-chips-strip]');\n if (!strip) return;\n const delta = strip.clientWidth * 0.8 * (direction === 'left' ? -1 : 1);\n strip.scrollBy({ left: delta, behavior: 'smooth' });\n }\n\n private _unmountPayload(): void {\n if (this._payloadMount) {\n try {\n this._payloadMount.handle.unmount();\n } catch (err) {\n console.warn('[adaptive-chips-strip] payload widget unmount threw:', err);\n }\n this._payloadMount = null;\n }\n }\n\n /**\n * Reconcile the payload mount with the current `_openId`:\n * - drawer closed / no runtime / widget id unknown \u2192 tear down\n * - same chip + same widget id \u2192 no-op (or props update)\n * - different chip \u2192 unmount old, mount new\n */\n private _syncPayloadMount(): void {\n const chip = this.chips.find((c) => c.config.id === this._openId) ?? null;\n const widgets = this.runtimeRef?.widgets;\n if (!chip || !widgets || !widgets.has(chip.config.payload.widget)) {\n this._unmountPayload();\n return;\n }\n const nextWidget = chip.config.payload.widget;\n const nextProps = chip.config.payload.props ?? {};\n if (\n this._payloadMount?.chipId === chip.config.id &&\n this._payloadMount.widgetId === nextWidget\n ) {\n // Same chip + same widget \u2014 update props in-place if the widget\n // supports it; otherwise leave untouched (no-op covers the\n // common no-change render case).\n this._payloadMount.handle.update?.(nextProps);\n return;\n }\n this._unmountPayload();\n const container = this.querySelector<HTMLElement>('[data-chip-payload-mount]');\n if (!container) {\n // Template hasn't laid down the mount target yet (Lit microtask\n // race). Retry after paint \u2014 without this, fast chip clicks can\n // land on a render where _openId changes but the conditional\n // template branch hasn't committed, and the payload silently\n // never mounts.\n requestAnimationFrame(() => {\n if (this._openId !== chip.config.id) return;\n const retry = this.querySelector<HTMLElement>('[data-chip-payload-mount]');\n if (!retry) return;\n const handle = widgets.mount(nextWidget, retry, nextProps);\n this._payloadMount = { chipId: chip.config.id, widgetId: nextWidget, handle };\n });\n return;\n }\n const handle = widgets.mount(nextWidget, container, nextProps);\n this._payloadMount = { chipId: chip.config.id, widgetId: nextWidget, handle };\n }\n\n private _onChipClick(chip: SuggestionChip): void {\n if (this._openId === chip.config.id) {\n // Toggle closed.\n this._openId = null;\n return;\n }\n this._openId = chip.config.id;\n this.dispatchEvent(\n new CustomEvent<{ id: string; payload: ChipPayload }>('chip-revealed', {\n detail: { id: chip.config.id, payload: chip.config.payload },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private _onChipDismiss(chip: SuggestionChip, e: Event): void {\n // Don't let the dismiss click bubble up to the chip's own click\n // handler \u2014 the user is removing the chip, not opening it.\n e.stopPropagation();\n // If the dismissed chip was the open one, close the drawer first\n // so the payload region doesn't briefly point at nothing.\n if (this._openId === chip.config.id) this._openId = null;\n this.dispatchEvent(\n new CustomEvent<{ id: string }>('chip-dismissed', {\n detail: { id: chip.config.id },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private _onPayloadClose = (): void => {\n this._openId = null;\n };\n\n override render(): TemplateResult {\n const open = this.chips.find((c) => c.config.id === this._openId) ?? null;\n\n return html`\n <div data-syntro-chips-tile style=${styleMap(rootStyles())}>\n <div data-chips-strip-frame style=${styleMap(stripFrameStyles())}>\n ${\n this._canScrollLeft\n ? html`<button\n type=\"button\"\n data-chips-scroll=\"left\"\n aria-label=\"Scroll suggestions left\"\n @click=${() => this._scrollBy('left')}\n style=${styleMap(scrollButtonStyles('left'))}\n >\u2039</button>`\n : nothing\n }\n <div\n data-chips-strip\n style=${styleMap(stripStyles())}\n @scroll=${this._onStripScroll}\n >\n ${this.chips.map(\n (chip) => html`<button\n type=\"button\"\n data-chip-id=${chip.config.id}\n data-syntro-element-id=${chip.config.id}\n data-state=${this._openId === chip.config.id ? 'open' : 'closed'}\n data-chromeless=${this.chromeless ? 'true' : 'false'}\n style=${styleMap(chipStyles(this._openId === chip.config.id, this.chromeless))}\n @click=${() => this._onChipClick(chip)}\n >\n <span style=${styleMap(chipTitleStyles())}>${chip.config.title}</span>\n <span style=${styleMap(chipGlyphStyles())}>\n ${this._openId === chip.config.id ? '\u25BC' : '\u203A'}\n </span>\n ${\n // Per-chip dismiss \u00D7 is suppressed when the strip is\n // chromeless \u2014 LLM-curated suggestions in a mini-\n // canvas surface shouldn't be user-dismissible (the\n // model picks them; the user can't \"remove\" them\n // any more than they can remove a paragraph of\n // prose). Also suppressed on the open chip in any\n // mode (the chip's button-toggle handles close).\n this.chromeless || this._openId === chip.config.id\n ? nothing\n : html`<span\n role=\"button\"\n tabindex=\"0\"\n data-chip-dismiss=${chip.config.id}\n aria-label=\"Dismiss suggestion\"\n title=\"Dismiss\"\n style=${styleMap(chipDismissStyles())}\n @click=${(e: Event) => this._onChipDismiss(chip, e)}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this._onChipDismiss(chip, e);\n }\n }}\n >\u00D7</span>`\n }\n </button>`\n )}\n </div>\n ${\n this._canScrollRight\n ? html`<button\n type=\"button\"\n data-chips-scroll=\"right\"\n aria-label=\"Scroll suggestions right\"\n @click=${() => this._scrollBy('right')}\n style=${styleMap(scrollButtonStyles('right'))}\n >\u203A</button>`\n : nothing\n }\n </div>\n ${\n open\n ? html`<div\n data-chip-payload\n data-for-chip=${open.config.id}\n data-chromeless=${this.chromeless ? 'true' : 'false'}\n style=${styleMap(payloadStyles(this.chromeless))}\n >\n <!--\n Drawer header \u2014 title (the Q in Q&A) ALWAYS renders\n because it's the actual content of the answer\n pairing, not chrome. Chromeless mode drops the\n surrounding chrome (border, background, \u2303 close)\n but the title stays so the chip \u2192 answer link is\n visible above the body. User closes by re-clicking\n the chip.\n -->\n <div\n data-chip-payload-header\n style=${styleMap(payloadHeaderStyles(this.chromeless))}\n >\n <span>${open.config.title}</span>\n ${\n this.chromeless\n ? nothing\n : html`<button\n type=\"button\"\n data-chip-payload-close\n aria-label=\"Collapse\"\n @click=${this._onPayloadClose}\n style=${styleMap(payloadCloseStyles())}\n >\u2303</button>`\n }\n </div>\n <div style=${styleMap(payloadBodyStyles(this.chromeless))}>\n <!--\n Payload widget mounts here imperatively in updated().\n The mount container is a stable element across renders so\n the runtime registry can track + update + unmount\n properly. If the widget id is unknown to the registry,\n we leave a labeled placeholder so the gap is visible\n in development rather than silently empty.\n -->\n ${\n this.runtimeRef?.widgets?.has(open.config.payload.widget)\n ? html`<div data-chip-payload-mount></div>`\n : html`<p style=${styleMap(unresolvedStyles())}>\n Widget <code>${open.config.payload.widget}</code> not registered.\n </p>`\n }\n </div>\n </div>`\n : nothing\n }\n </div>\n `;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nfunction rootStyles(): Record<string, string> {\n return {\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n width: '100%',\n };\n}\n\nfunction stripFrameStyles(): Record<string, string> {\n return {\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n };\n}\n\nfunction stripStyles(): Record<string, string> {\n return {\n display: 'flex',\n flexDirection: 'row',\n // Single row \u2014 chips never wrap. Horizontal overflow becomes\n // a scrollable region with left/right arrow affordances on either\n // side of the frame. `flex-wrap: wrap` (the old behavior) packed\n // chips into multiple rows, which broke the mini-canvas surface's\n // visual rhythm \u2014 chat-bar above, ONE row of chips, payload below.\n flexWrap: 'nowrap',\n gap: '8px',\n width: '100%',\n overflowX: 'auto',\n overflowY: 'hidden',\n // Hide the native scrollbar \u2014 the chevron buttons are the\n // affordance. Firefox: `scrollbarWidth: 'none'`. WebKit: the\n // global `::-webkit-scrollbar { display: none }` rule in\n // chatTrailGlobalStyles.ts (which is shared chat-surface CSS) is\n // what hides it across all our scroll surfaces.\n scrollbarWidth: 'none',\n scrollSnapType: 'x proximity',\n scrollBehavior: 'smooth',\n // Don't let touch scroll bubble up to the page when the strip\n // can scroll horizontally \u2014 keeps wheel scroll on the canvas\n // intact while letting the strip move under the cursor.\n overscrollBehavior: 'contain',\n };\n}\n\n/**\n * Left/right scroll arrows. Absolute-positioned on either edge of the\n * frame so they overlay the chips at the edge \u2014 combined with the\n * frame's relative positioning, they sit on top of the chip pills at\n * the boundary, with a small backdrop blur so the underlying chip is\n * still legible. Visible only when there's more content in that\n * direction (controlled by `_canScrollLeft` / `_canScrollRight`).\n */\nfunction scrollButtonStyles(side: 'left' | 'right'): Record<string, string> {\n return {\n position: 'absolute',\n [side]: '0',\n top: '50%',\n transform: 'translateY(-50%)',\n zIndex: '2',\n width: '24px',\n height: '24px',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0',\n borderRadius: '9999px',\n border: '1px solid hsl(var(--sc-tile-border-color, 0 0% 100%) / 0.18)',\n background: 'hsl(var(--sc-accent-color) / 0.18)',\n backdropFilter: 'blur(6px)',\n WebkitBackdropFilter: 'blur(6px)',\n color: 'var(--sc-tile-title-color, currentColor)',\n fontSize: '14px',\n lineHeight: '1',\n cursor: 'pointer',\n opacity: '0.85',\n transition: 'opacity 150ms ease, background 150ms ease',\n };\n}\n\nfunction chipStyles(isOpen: boolean, _chromeless: boolean): Record<string, string> {\n // The chip itself ALWAYS renders as a pill with title. Chromeless\n // is about dropping wrapping chrome (tile-card, drawer chrome,\n // per-chip dismiss \u00D7), not about turning the chip into raw text \u2014\n // mixed-style chips inside a single strip looked bad and lost the\n // affordance. Keep the pill, drop the surroundings.\n return {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '6px',\n // Flex to text width up to a sane cap. The title span inside owns\n // the ellipsis safety net for genuinely-long titles.\n maxWidth: '32ch',\n color: isOpen\n ? 'var(--sc-tile-title-color, currentColor)'\n : 'var(--sc-tile-text-color, currentColor)',\n fontSize: '12px',\n fontWeight: '600',\n cursor: 'pointer',\n transition: 'background 180ms ease, border-color 180ms ease, color 180ms ease',\n padding: '6px 12px',\n borderRadius: '9999px',\n border: isOpen\n ? '1px solid hsl(var(--sc-accent-color) / 0.45)'\n : '1px solid hsl(var(--sc-tile-border-color, 0 0% 100%) / 0.18)',\n background: isOpen ? 'hsl(var(--sc-accent-color) / 0.10)' : 'transparent',\n };\n}\n\nfunction chipTitleStyles(): Record<string, string> {\n return {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n minWidth: '0',\n };\n}\n\n// Small \u2715 inside each closed chip. Uses a span+role=\"button\" so it\n// nests inside the chip's <button> without violating \"no interactive\n// inside interactive\" \u2014 the click handler stopPropagation-s so it\n// doesn't open the chip.\nfunction chipDismissStyles(): Record<string, string> {\n return {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n marginLeft: '2px',\n borderRadius: '9999px',\n color: 'inherit',\n fontSize: '12px',\n lineHeight: '1',\n cursor: 'pointer',\n opacity: '0.45',\n flexShrink: '0',\n transition: 'opacity 150ms ease, background 150ms ease',\n };\n}\n\nfunction chipGlyphStyles(): Record<string, string> {\n return {\n fontSize: '10px',\n opacity: '0.7',\n flexShrink: '0',\n };\n}\n\nfunction payloadStyles(chromeless: boolean): Record<string, string> {\n const base: Record<string, string> = {\n display: 'flex',\n flexDirection: 'column',\n gap: '6px',\n color: 'var(--sc-tile-title-color, currentColor)',\n };\n if (chromeless) {\n // No drawer chrome \u2014 the payload sits flush with the strip\n // above it. Visual separation comes from typography (the chip's\n // underline) and slight spacing, not borders/backgrounds.\n return {\n ...base,\n padding: '4px 0 0',\n borderRadius: '0',\n border: 'none',\n background: 'transparent',\n };\n }\n return {\n ...base,\n padding: '10px 12px',\n borderRadius: 'var(--sc-tile-border-radius, 12px)',\n border: '1px solid hsl(var(--sc-accent-color) / 0.18)',\n background: 'hsl(var(--sc-accent-color) / 0.04)',\n };\n}\n\nfunction payloadHeaderStyles(chromeless: boolean): Record<string, string> {\n return {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '8px',\n fontSize: '12px',\n fontWeight: '600',\n // In chromeless mode the header is the only visible heading for\n // the answer below (no surrounding box/border). Use the accent\n // color so the Q reads distinctly as the prompt for the A.\n ...(chromeless ? { color: 'hsl(var(--sc-accent-color) / 0.95)' } : {}),\n };\n}\n\nfunction payloadCloseStyles(): Record<string, string> {\n return {\n width: '22px',\n height: '22px',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '9999px',\n background: 'transparent',\n border: '1px solid hsl(var(--sc-tile-border-color, 0 0% 100%) / 0.18)',\n color: 'inherit',\n fontSize: '11px',\n cursor: 'pointer',\n opacity: '0.65',\n };\n}\n\nfunction payloadBodyStyles(chromeless: boolean): Record<string, string> {\n return {\n fontSize: '12px',\n lineHeight: '1.55',\n color: 'var(--sc-tile-text-color, currentColor)',\n // No top divider needed when the header is suppressed.\n ...(chromeless ? {} : {}),\n };\n}\n\nfunction unresolvedStyles(): Record<string, string> {\n return {\n margin: '0',\n fontStyle: 'italic',\n opacity: '0.7',\n };\n}\n\nif (!customElements.get('adaptive-chips-strip')) {\n customElements.define('adaptive-chips-strip', AdaptiveChipsStrip);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'adaptive-chips-strip': AdaptiveChipsStrip;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAiCA,SAAS,MAAM,YAAY,eAAoC;AAC/D,SAAS,gBAAgB;AACzB,SAAS,SAAS;AA8ClB,IAAM,eAAe,EAClB,OAAO;AAAA,EACN,QAAQ,EACL,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EACJ,OAAO,EAAE,QAAQ,CAAC,EAClB,SAAS,EACT,SAAS,2EAA2E;AACzF,CAAC,EACA,OAAO,EACP;AAAA,EACC;AACF;AAWK,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,GAAG;AAAA,EACH,MAAM,EACH,QAAQ,kBAAkB,EAC1B;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO;AAAA,IACN,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,yDAAyD;AAAA,IACxF,OAAO,EACJ,OAAO,EACP,IAAI,CAAC,EACL,SAAS,0EAAqE;AAAA,IACjF,SAAS;AAAA,EACX,CAAC,EACA;AAAA,IACC;AAAA,EACF;AAAA,EACF,aAAa,aAAa;AAAA,IACxB;AAAA,EACF;AAAA,EACA,QAAQ,QAAQ;AAAA,IACd;AAAA,EACF;AACF,CAAC,EACA,OAAO,CAAC,SAAS,CAAC,KAAK,eAAe,KAAK,WAAW,QAAW;AAAA,EAChE,SACE;AACJ,C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