@adea-ai/ui 0.155.1 → 0.156.0
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/NOTICE +27 -0
- package/dist/components/composites/model-selector/model-selector.js +45 -53
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/prompt-input/index.d.ts +2 -0
- package/dist/components/composites/prompt-input/index.d.ts.map +1 -0
- package/dist/components/composites/prompt-input/index.js +1 -0
- package/dist/components/composites/prompt-input/prompt-input.d.ts +71 -0
- package/dist/components/composites/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/components/composites/prompt-input/prompt-input.js +247 -0
- package/dist/components/composites/prompt-input/prompt-input.js.map +1 -0
- package/dist/components/conversation/chat-composer.d.ts.map +1 -1
- package/dist/components/conversation/chat-composer.js +43 -29
- package/dist/components/conversation/chat-composer.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +155 -163
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +186 -192
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/paste-token-editor.js +2 -2
- package/dist/components/conversation/paste-token-editor.js.map +1 -1
- package/dist/components/ui/badge/badge.js +1 -1
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/input-group/index.d.ts +1 -1
- package/dist/components/ui/input-group/index.d.ts.map +1 -1
- package/dist/components/ui/input-group/index.js +2 -2
- package/dist/components/ui/input-group/input-group.d.ts +34 -9
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +101 -28
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd/kbd.js +6 -1
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/message/index.d.ts +1 -1
- package/dist/components/ui/message/index.d.ts.map +1 -1
- package/dist/components/ui/message/index.js +2 -2
- package/dist/components/ui/message/message.d.ts +16 -0
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +52 -1
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +1 -1
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/lib/overlay.d.ts +5 -5
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +5 -5
- package/dist/lib/overlay.js.map +1 -1
- package/dist/r/conversation.json +1 -2
- package/dist/r/input-group.json +1 -0
- package/dist/r/message.json +4 -1
- package/dist/r/model-selector.json +1 -1
- package/dist/r/prompt-input.json +28 -0
- package/dist/r/registry.json +35 -4
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +19 -25
- package/dist/r/src/components/composites/prompt-input/index.ts +15 -0
- package/dist/r/src/components/composites/prompt-input/prompt-input.tsx +267 -0
- package/dist/r/src/components/conversation/chat-composer.tsx +4 -2
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +27 -38
- package/dist/r/src/components/conversation/message-composer.tsx +93 -97
- package/dist/r/src/components/conversation/paste-token-editor.tsx +2 -2
- package/dist/r/src/components/ui/badge/badge.tsx +1 -1
- package/dist/r/src/components/ui/input-group/index.ts +3 -0
- package/dist/r/src/components/ui/input-group/input-group.tsx +121 -29
- package/dist/r/src/components/ui/kbd/kbd.tsx +3 -0
- package/dist/r/src/components/ui/message/index.ts +3 -0
- package/dist/r/src/components/ui/message/message.tsx +56 -0
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +1 -1
- package/dist/r/src/lib/overlay.ts +5 -6
- package/package.json +1 -1
- package/registry.json +35 -4
- package/src/components/composites/model-selector/model-selector.tsx +19 -25
- package/src/components/composites/prompt-input/index.ts +15 -0
- package/src/components/composites/prompt-input/prompt-input.tsx +267 -0
- package/src/components/conversation/chat-composer.tsx +4 -2
- package/src/components/conversation/internal/chat-composer-shell.tsx +27 -38
- package/src/components/conversation/message-composer.tsx +93 -97
- package/src/components/conversation/paste-token-editor.tsx +2 -2
- package/src/components/ui/badge/badge.tsx +1 -1
- package/src/components/ui/input-group/index.ts +3 -0
- package/src/components/ui/input-group/input-group.tsx +121 -29
- package/src/components/ui/kbd/kbd.tsx +3 -0
- package/src/components/ui/message/index.ts +3 -0
- package/src/components/ui/message/message.tsx +56 -0
- package/src/components/ui/tooltip/tooltip.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lib/overlay.ts +5 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.js","names":["splitProps","useFormFieldControl","cn","size","InputGroup","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","undefined","InputGroupInput","field","_el$2","_tmpl$2","id","align","InputGroupAddon","_el$3","_tmpl$3","_$insert","children","InputGroupButton","_el$4","_tmpl$4","InputGroupText","_el$5","_tmpl$5"],"sources":["../../../../src/components/ui/input-group/input-group.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * InputGroup.\n *\n * A field with attached chrome: a leading icon, a unit, a trailing button, a\n * clear affordance. The point of the component is that the adornments and the\n * input share *one* border and *one* focus ring, so the group reads as a single\n * control. Two separate elements side by side always drift, the ring appears\n * on the wrong box, or the border doubles where they meet.\n *\n * The focus ring therefore lives on the group and follows `focus-within`. A\n * group containing several focusable things still reads as focused once, which\n * is the correct affordance: the user is somewhere inside it.\n *\n * `size` is the control rung, matching `Input`: `sm` for a toolbar search beside\n * `icon-sm` actions, `md` (the default) everywhere else. The group's input and\n * text follow it.\n */\nexport type InputGroupProps = ComponentProps<'div'> & {\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport function InputGroup(props: InputGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'size'])\n\n return (\n <div\n data-slot=\"input-group\"\n data-size={local.size}\n class={cn(\n 'group/input-group border-input flex w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent',\n {\n 'h-control-sm px-control-xs': local.size === 'sm',\n 'h-control-md px-control-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-md': local.size === 'lg',\n },\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle',\n 'has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function InputGroupInput(props: ComponentProps<'input'>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', local)\n\n return (\n <input\n data-slot=\"input-group-input\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-sm outline-none group-data-[size=sm]/input-group:text-xs',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type InputGroupAddonProps = ComponentProps<'span'> & {\n /** Which edge the adornment sits on; also sets the pointer-events rule. */\n align?: 'start' | 'end'\n}\n\n/**\n * A non-interactive adornment. `pointer-events-none` by default, because an\n * adornment that swallows a click makes the whole control feel dead just to\n * the left of the caret — the most annoying possible bug. Pass `align=\"end\"`\n * and a real element when the adornment must be clickable.\n */\nexport function InputGroupAddon(props: InputGroupAddonProps) {\n const [local, rest] = splitProps(props, ['class', 'align', 'children'])\n\n return (\n <span\n data-slot=\"input-group-addon\"\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center gap-1.5 text-sm select-none',\n '[&_svg]:pointer-events-none [&_svg]:size-4',\n 'group-data-[size=sm]/input-group:text-xs group-data-[size=sm]/input-group:[&_svg]:size-3.5',\n { 'order-first': local.align !== 'end', 'order-last': local.align === 'end' },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </span>\n )\n}\n\n/** A clickable trailing button, sized to the group's height. */\nexport function InputGroupButton(props: ComponentProps<'button'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <button\n type=\"button\"\n data-slot=\"input-group-button\"\n class={cn(\n 'text-muted-foreground -me-1 flex size-6 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:bg-surface-hover hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:size-3.5',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </button>\n )\n}\n\n/** Text that reads as a value but is not an input, e.g. a unit or a suffix. */\nexport function InputGroupText(props: ComponentProps<'span'> & { children?: JSX.Element }) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n class={cn(\n 'text-muted-foreground text-sm group-data-[size=sm]/input-group:text-xs',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgBI,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,SAAS,MAAM,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,eAAA;IAAA,OAGeL,MAAMH;GAAI;GAAA,KAA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,gFACA,8CACA,8FACA;IAAE,eAAeI,MAAMa,UAAU;IAAO,cAAcb,MAAMa,UAAU;GAAM,GAC5Eb,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAgB,OAAAF,aAEPf,MAAMkB,QAAQ;EAAA,OAAAH;CAAA,EAAA,CAAA;AAGrB;;AAGA,SAAgBI,iBAAiBpB,OAAiC;CAChE,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAqB,QAAAC,QAAA;EAAAjB,OAAAgB,OAAAf,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWT,GACL,2FACA,wFACA,oFACA,oDACA,oBACAI,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAgB,OAAAG,aAEPpB,MAAMkB,QAAQ;EAAA,OAAAE;CAAA,EAAA,CAAA;AAGrB;;AAGA,SAAgBE,eAAevB,OAA4D;CACzF,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAwB,QAAAC,QAAA;EAAApB,OAAAmB,OAAAlB,WAAA,EAAA,KAAA,WAAA;GAAA,OAEWT,GACL,0EACAI,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAGd"}
|
|
1
|
+
{"version":3,"file":"input-group.js","names":["splitProps","callHandler","useFormFieldControl","cn","Button","size","InputGroup","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","undefined","InputGroupInput","field","_el$2","_tmpl$2","id","InputGroupTextarea","_el$3","_tmpl$3","align","addonAlign","InputGroupAddon","_el$4","_tmpl$4","$$click","event","onClick","defaultPrevented","target","closest","control","currentTarget","parentElement","querySelector","focus","_$insert","children","InputGroupButton","_$createComponent","type","variant","InputGroupText","_el$5","_tmpl$5","_$delegateEvents"],"sources":["../../../../src/components/ui/input-group/input-group.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Button, type ButtonProps } from '../button'\n\n/**\n * InputGroup.\n *\n * A field with attached chrome: a leading icon, a unit, a trailing button, a\n * clear affordance. The point of the component is that the adornments and the\n * input share *one* border and *one* focus ring, so the group reads as a single\n * control. Two separate elements side by side always drift, the ring appears\n * on the wrong box, or the border doubles where they meet.\n *\n * The focus ring therefore lives on the group and follows `focus-within`. A\n * group containing several focusable things still reads as focused once, which\n * is the correct affordance: the user is somewhere inside it.\n *\n * `size` is the control rung, matching `Input`: `sm` for a toolbar search beside\n * `icon-sm` actions, `md` (the default) everywhere else. The group's input and\n * text follow it.\n *\n * The part list and alignments follow shadcn's InputGroup: an addon aligned\n * `block-start` or `block-end` turns the group into a column (a header or a\n * footer row around a field), and an `InputGroupTextarea` lets the group grow\n * with its content. That column form is what a prompt input is, so the chat\n * composers are built from these parts instead of their own box.\n */\nexport type InputGroupProps = ComponentProps<'div'> & {\n size?: 'sm' | 'md' | 'lg'\n}\n\nexport function InputGroup(props: InputGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'size'])\n\n return (\n <div\n role=\"group\"\n data-slot=\"input-group\"\n data-size={local.size}\n class={cn(\n 'group/input-group border-input flex w-full min-w-0 items-center gap-1.5 rounded-md border bg-transparent',\n {\n 'h-control-sm px-control-xs': local.size === 'sm',\n 'h-control-md px-control-sm': local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-md': local.size === 'lg',\n },\n // A textarea, or an addon on a block edge, makes the group a column\n // that grows with its content: shadcn's prompt-input form.\n 'has-[>textarea]:h-auto',\n 'has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:items-stretch',\n 'has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:items-stretch',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-3 has-[[aria-invalid=true]]:ring-destructive-subtle',\n 'has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50',\n 'has-[textarea:disabled]:cursor-not-allowed has-[textarea:disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function InputGroupInput(props: ComponentProps<'input'>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', local)\n\n return (\n <input\n data-slot=\"input-group-input\"\n data-input-group-control=\"\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full min-w-0 flex-1 bg-transparent text-sm outline-none group-data-[size=sm]/input-group:text-xs',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * The multi-line field of a group. It grows with its content up to the\n * group's cap (`max-h-48`, the comfortable textarea ceiling) and then scrolls,\n * so a long draft never pushes the footer row off screen.\n */\nexport function InputGroupTextarea(props: ComponentProps<'textarea'>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', local)\n\n return (\n <textarea\n data-slot=\"input-group-textarea\"\n data-input-group-control=\"\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n rows={1}\n class={cn(\n 'field-sizing-content max-h-48 min-h-10 w-full min-w-0 flex-1 resize-none bg-transparent py-2 text-sm outline-none',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type InputGroupAddonAlign =\n | 'inline-start'\n | 'inline-end'\n | 'block-start'\n | 'block-end'\n /** @deprecated Use `inline-start`. */\n | 'start'\n /** @deprecated Use `inline-end`. */\n | 'end'\n\nexport type InputGroupAddonProps = ComponentProps<'div'> & {\n /** Which edge the adornment sits on. Block edges make the group a column. */\n align?: InputGroupAddonAlign\n}\n\nfunction addonAlign(align: InputGroupAddonAlign | undefined) {\n if (align === 'end') return 'inline-end'\n if (align === 'start' || align === undefined) return 'inline-start'\n return align\n}\n\n/**\n * An adornment: an icon, a unit, a row of actions. A press on the addon\n * itself, outside a control it holds, moves focus to the group's field, as in\n * shadcn, so the whole group behaves as one control instead of having a dead\n * strip beside the caret.\n */\nexport function InputGroupAddon(props: InputGroupAddonProps) {\n const [local, rest] = splitProps(props, ['class', 'align', 'children', 'onClick'])\n const align = () => addonAlign(local.align)\n\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align()}\n class={cn(\n 'text-muted-foreground flex shrink-0 cursor-text items-center gap-1.5 text-sm select-none',\n '[&_svg]:pointer-events-none [&>svg]:size-4',\n 'group-data-[size=sm]/input-group:text-xs group-data-[size=sm]/input-group:[&>svg]:size-3.5',\n {\n 'order-first': align() === 'inline-start' || align() === 'block-start',\n 'order-last': align() === 'inline-end' || align() === 'block-end',\n 'w-full justify-start gap-1': align() === 'block-start' || align() === 'block-end',\n 'pt-2': align() === 'block-start',\n 'pb-2': align() === 'block-end',\n },\n local.class\n )}\n onClick={(event) => {\n callHandler(local.onClick, event)\n if (event.defaultPrevented) return\n const target = event.target as Element\n if (target.closest('button, a, input, textarea, select, [role=button], [role=combobox]'))\n return\n const control = event.currentTarget.parentElement?.querySelector<HTMLElement>(\n '[data-input-group-control]'\n )\n control?.focus()\n }}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport type InputGroupButtonProps = Omit<ButtonProps, 'size'> & {\n /** shadcn's four InputGroupButton sizes, mapped onto the control ladder. */\n size?: 'xs' | 'sm' | 'icon-xs' | 'icon-sm'\n}\n\n/**\n * A button inside the group. It is a `Button` (ghost by default), so it shares\n * the system's pressed, focus and disabled states rather than drawing its own.\n */\nexport function InputGroupButton(props: InputGroupButtonProps) {\n const [local, rest] = splitProps(props, ['size', 'variant'])\n\n return (\n <Button\n type=\"button\"\n data-slot=\"input-group-button\"\n variant={local.variant ?? 'ghost'}\n size={local.size ?? 'icon-xs'}\n {...rest}\n />\n )\n}\n\n/** Text that reads as a value but is not an input, e.g. a unit or a suffix. */\nexport function InputGroupText(props: ComponentProps<'span'> & { children?: JSX.Element }) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"input-group-text\"\n class={cn(\n 'text-muted-foreground text-sm group-data-[size=sm]/input-group:text-xs',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,SAAgBM,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,SAAS,MAAM,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,eAAA;IAAA,OAIeL,MAAMH;GAAI;GAAA,KAAA,WAAA;IAAA,OACdF,GACL,4GACA;KACE,8BAA8BK,MAAMH,SAAS;KAC7C,8BAA8BG,MAAMH,SAAS,QAAQG,MAAMH,SAASU,KAAAA;KACpE,8BAA8BP,MAAM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M;KACvE,QAAQA,MAAM,MAAM;KACpB,QAAQA,MAAM,MAAM;IACtB,GACAhB,MAAMM,KACR;GAAC;EAAA,GAYGL,IAAI,GAAA,OAAA,IAAA;EAAA+B,OAAAb,aAEPnB,MAAMiC,QAAQ;EAAA,OAAAd;CAAA,EAAA,CAAA;AAGrB;;;;;AAWA,SAAgBe,iBAAiBnC,OAA8B;CAC7D,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,QAAQ,SAAS,CAAC;CAE3D,OAAAoC,gBACGvC,QAAMS,WAAA;EACL+B,MAAI;EAAA,aAAA;EAAA,IAEJC,UAAO;GAAA,OAAErC,MAAMqC,WAAW;EAAO;EAAA,IACjCxC,OAAI;GAAA,OAAEG,MAAMH,QAAQ;EAAS;CAAA,GACzBI,IAAI,CAAA;AAGd;;AAGA,SAAgBqC,eAAevC,OAA4D;CACzF,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAwC,QAAAC,QAAA;EAAApC,OAAAmC,OAAAlC,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GACL,0EACAK,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAsC;CAAA,EAAA,CAAA;AAGd;AAACE,eAAA,CAAA,OAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/kbd/kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW;;
|
|
1
|
+
{"version":3,"file":"kbd.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/kbd/kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW;;8EAmBvB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AAE3E,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,kCAMpE;AAED,eAAO,MAAM,gBAAgB;;8EAW3B,CAAA;AAEF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,kCAU1E;AAMD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBnD;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kCAQ5C"}
|
|
@@ -25,7 +25,12 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=kbd-group>`);
|
|
|
25
25
|
* `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`
|
|
26
26
|
* needs a gap between them that is a layout concern, not punctuation.
|
|
27
27
|
*/
|
|
28
|
-
var kbdVariants = cva([
|
|
28
|
+
var kbdVariants = cva([
|
|
29
|
+
"bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none",
|
|
30
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
31
|
+
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background",
|
|
32
|
+
"[[data-slot=side-rail-tip]_&]:bg-background/20 [[data-slot=side-rail-tip]_&]:text-background"
|
|
33
|
+
], {
|
|
29
34
|
variants: { size: {
|
|
30
35
|
default: "",
|
|
31
36
|
compact: "min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kbd.js","names":["For","splitProps","cva","cn","kbdVariants","variants","size","default","compact","defaultVariants","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","NAMED_KEY","kbdChordKeys","keys","caps","separated","length","first","slice","named","exec","cap","test","charAt","String","fromCodePoint","codePointAt","push","KbdChord","_$createComponent","children","each","key"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, ported from shadcn/ui's `Kbd` (MIT, see NOTICE). The element\n * is a real `<kbd>` so the semantics survive copy-paste.\n *\n * The cap is set in the UI face at `text-xs`, as shadcn draws it, not in the\n * code face. Monospace faces carry letters but rarely the modifier glyphs, so\n * a mono `⌘` fell back to another font and sat visibly smaller than the mono\n * `K` beside it. The UI face draws `⌘ ⇧ ⌥ ⌃` and letters as one family, so\n * every cap in a chord reads at the same size.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh, a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n [\n 'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none',\n \"[&_svg:not([class*='size-'])]:size-3\",\n ],\n {\n variants: {\n size: {\n default: '',\n compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\n/**\n * shadcn renders the group as a `<kbd>`; it stays a `<span>` here so a\n * `kbd` selector still finds exactly the caps, which hosts and tests count.\n */\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/** Key names that are drawn as one word on one cap. */\nconst NAMED_KEY =\n /^(?:Ctrl|Control|Alt|Option|Opt|Shift|Cmd|Command|Meta|Super|Win|Fn|Enter|Return|Escape|Esc|Tab|Space|Backspace|Delete|Del|Insert|Home|End|PageUp|PageDown|PgUp|PgDn|Up|Down|Left|Right|F(?:1\\d|2[0-4]|[1-9]))/\n\n/**\n * Split a written chord into one entry per key cap.\n *\n * - Glyph chords draw one cap per character: `⌘K` is `⌘` + `K`, and `⇧⌘P`\n * stays three caps wide, which matches how the system draws chords in menus.\n * - Spelled-out names stay whole: `CtrlK` is `Ctrl` + `K`, `⇧Enter` is\n * `⇧` + `Enter`.\n * - `+` and spaces separate keys and are not drawn (`Ctrl+K`, `Ctrl Shift P`),\n * except a `+` that is itself the key (`Ctrl++`, `⌘+`).\n */\nexport function kbdChordKeys(keys: string): string[] {\n const caps: string[] = []\n let rest = keys\n let separated = true\n while (rest.length > 0) {\n const first = rest[0]!\n if (first === ' ' || (first === '+' && !separated && rest.length > 1)) {\n rest = rest.slice(1)\n separated = true\n continue\n }\n const named = NAMED_KEY.exec(rest)?.[0]\n // A name only counts when a lowercase letter does not continue it: `Tab`\n // in `Table` is not a key, so a caller's literal text is drawn as written.\n const cap =\n named && !/^[a-z]/.test(rest.charAt(named.length))\n ? named\n : String.fromCodePoint(rest.codePointAt(0)!)\n caps.push(cap)\n rest = rest.slice(cap.length)\n separated = false\n }\n return caps\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"`, `\"⇧⌘P\"` or `\"Ctrl+K\"`. See `kbdChordKeys`. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per key (see `kbdChordKeys`). Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children, the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAaI,cAAcF,IACzB
|
|
1
|
+
{"version":3,"file":"kbd.js","names":["For","splitProps","cva","cn","kbdVariants","variants","size","default","compact","defaultVariants","Kbd","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","kbdGroupVariants","KbdGroup","_el$2","_tmpl$2","NAMED_KEY","kbdChordKeys","keys","caps","separated","length","first","slice","named","exec","cap","test","charAt","String","fromCodePoint","codePointAt","push","KbdChord","_$createComponent","children","each","key"],"sources":["../../../../src/components/ui/kbd/kbd.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Kbd.\n *\n * A keyboard key, ported from shadcn/ui's `Kbd` (MIT, see NOTICE). The element\n * is a real `<kbd>` so the semantics survive copy-paste.\n *\n * The cap is set in the UI face at `text-xs`, as shadcn draws it, not in the\n * code face. Monospace faces carry letters but rarely the modifier glyphs, so\n * a mono `⌘` fell back to another font and sat visibly smaller than the mono\n * `K` beside it. The UI face draws `⌘ ⇧ ⌥ ⌃` and letters as one family, so\n * every cap in a chord reads at the same size.\n *\n * `size=\"compact\"` exists for the dense rows a default cap would outweigh, a\n * rail search row, a sidebar shortcut hint. It drops a height rung, and it\n * lightens the fill and weight with it because at that size a solid muted cap\n * reads heavier than the row text it sits in.\n *\n * `KbdGroup` exists because a shortcut is a sequence: typing `⌘` then `K`\n * needs a gap between them that is a layout concern, not punctuation.\n */\nexport const kbdVariants = cva(\n [\n 'bg-muted text-muted-foreground pointer-events-none inline-flex min-h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none',\n \"[&_svg:not([class*='size-'])]:size-3\",\n // Inside the inverted tooltip chip the cap inverts with it, as in shadcn.\n '[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background',\n '[[data-slot=side-rail-tip]_&]:bg-background/20 [[data-slot=side-rail-tip]_&]:text-background',\n ],\n {\n variants: {\n size: {\n default: '',\n compact: 'min-h-4 min-w-4 bg-muted/40 px-0.5 font-normal leading-none',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>['size']>\n\nexport function Kbd(props: ComponentProps<'kbd'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <kbd data-slot=\"kbd\" class={cn(kbdVariants({ size: local.size }), local.class)} {...rest} />\n )\n}\n\nexport const kbdGroupVariants = cva('inline-flex items-center gap-1', {\n variants: {\n size: {\n default: '',\n /** The gap is what separates caps, so it tightens with them. */\n compact: 'gap-0.5',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\n/**\n * shadcn renders the group as a `<kbd>`; it stays a `<span>` here so a\n * `kbd` selector still finds exactly the caps, which hosts and tests count.\n */\nexport function KbdGroup(props: ComponentProps<'span'> & { size?: KbdSize }) {\n const [local, rest] = splitProps(props, ['size', 'class'])\n\n return (\n <span\n data-slot=\"kbd-group\"\n class={cn(kbdGroupVariants({ size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n\n/** Key names that are drawn as one word on one cap. */\nconst NAMED_KEY =\n /^(?:Ctrl|Control|Alt|Option|Opt|Shift|Cmd|Command|Meta|Super|Win|Fn|Enter|Return|Escape|Esc|Tab|Space|Backspace|Delete|Del|Insert|Home|End|PageUp|PageDown|PgUp|PgDn|Up|Down|Left|Right|F(?:1\\d|2[0-4]|[1-9]))/\n\n/**\n * Split a written chord into one entry per key cap.\n *\n * - Glyph chords draw one cap per character: `⌘K` is `⌘` + `K`, and `⇧⌘P`\n * stays three caps wide, which matches how the system draws chords in menus.\n * - Spelled-out names stay whole: `CtrlK` is `Ctrl` + `K`, `⇧Enter` is\n * `⇧` + `Enter`.\n * - `+` and spaces separate keys and are not drawn (`Ctrl+K`, `Ctrl Shift P`),\n * except a `+` that is itself the key (`Ctrl++`, `⌘+`).\n */\nexport function kbdChordKeys(keys: string): string[] {\n const caps: string[] = []\n let rest = keys\n let separated = true\n while (rest.length > 0) {\n const first = rest[0]!\n if (first === ' ' || (first === '+' && !separated && rest.length > 1)) {\n rest = rest.slice(1)\n separated = true\n continue\n }\n const named = NAMED_KEY.exec(rest)?.[0]\n // A name only counts when a lowercase letter does not continue it: `Tab`\n // in `Table` is not a key, so a caller's literal text is drawn as written.\n const cap =\n named && !/^[a-z]/.test(rest.charAt(named.length))\n ? named\n : String.fromCodePoint(rest.codePointAt(0)!)\n caps.push(cap)\n rest = rest.slice(cap.length)\n separated = false\n }\n return caps\n}\n\nexport type KbdChordProps = Omit<ComponentProps<'span'>, 'children'> & {\n /** The chord as it is drawn, e.g. `\"⌘K\"`, `\"⇧⌘P\"` or `\"Ctrl+K\"`. See `kbdChordKeys`. */\n keys: string\n size?: KbdSize\n}\n\n/**\n * KbdChord.\n *\n * A written chord drawn as caps, one per key (see `kbdChordKeys`). Decoration only: the\n * composition renders `aria-hidden`, so the accessible name and the parseable\n * `aria-keyshortcuts` stay on the control the chord belongs to. That is why\n * there is no children, the chord says what was drawn, nothing more.\n */\nexport function KbdChord(props: KbdChordProps) {\n const [local, rest] = splitProps(props, ['keys', 'size', 'class'])\n\n return (\n <KbdGroup {...rest} size={local.size} class={local.class} aria-hidden=\"true\">\n <For each={kbdChordKeys(local.keys)}>{(key) => <Kbd size={local.size}>{key}</Kbd>}</For>\n </KbdGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAaI,cAAcF,IACzB;CACE;CACA;CAEA;CACA;AAA8F,GAEhG;CACEG,UAAU,EACRC,MAAM;EACJC,SAAS;EACTC,SAAS;CACX,EACF;CACAC,iBAAiB,EACfH,MAAM,UACR;AACF,CACF;AAIA,SAAgBI,IAAIC,OAAmD;CACrE,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO,CAAC,QAAQ,OAAO,CAAC;CAEzD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAC8Bd,GAAGC,YAAY,EAAEE,MAAMM,MAAMN,KAAK,CAAC,GAAG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SAAgBc,SAAS7B,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQZ,WAAWU,OAAO;EAAC;EAAQ;EAAQ;CAAO,CAAC;CAEjE,OAAA8B,gBACGrB,UAAQH,WAAKJ,MAAI;EAAA,IAAEP,OAAI;GAAA,OAAEM,MAAMN;EAAI;EAAA,KAAA,WAAA;GAAA,OAASM,MAAMM;EAAK;EAAA,eAAA;EAAA,IAAAwB,WAAA;GAAA,OAAAD,gBACrDzC,KAAG;IAAA,IAAC2C,OAAI;KAAA,OAAEnB,aAAaZ,MAAMa,IAAI;IAAC;IAAAiB,WAAIE,QAAGH,gBAAM/B,KAAG;KAAA,IAACJ,OAAI;MAAA,OAAEM,MAAMN;KAAI;KAAAoC,UAAGE;IAAG,CAAA;GAAO,CAAA;EAAA;CAAA,CAAA,CAAA;AAGvF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Message, MessageActions, MessageContent, MessageFooter, MessageHeader, MessageText, type MessageCitations, type MessageCodeBlockInfo, type MessageCodeBlockProps, type MessageProps, type MessageRole, type MessageTextProps, } from './message';
|
|
1
|
+
export { Message, MessageAction, MessageActions, MessageCopyAction, MessageContent, MessageFooter, MessageHeader, MessageText, type MessageCitations, type MessageCodeBlockInfo, type MessageCodeBlockProps, type MessageActionProps, type MessageProps, type MessageRole, type MessageTextProps, } from './message';
|
|
2
2
|
export { placeCitationMarkers, type CitationPlacement, type PlacedCitations } from './cite-ranges';
|
|
3
3
|
export { parseInline, parseMessageText, parseMessageTextIncremental, safeHref, type MessageBlock, type MessageInline, type MessageParse, type MessageParseOptions, type ParseInlineOptions, } from './parse-message-text';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,2BAA2B,EAC3B,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAClG,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,2BAA2B,EAC3B,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { safeHref } from "../../../lib/url.js";
|
|
2
|
-
import { Message, MessageActions, MessageContent, MessageFooter, MessageHeader, MessageText } from "./message.js";
|
|
2
|
+
import { Message, MessageAction, MessageActions, MessageContent, MessageCopyAction, MessageFooter, MessageHeader, MessageText } from "./message.js";
|
|
3
3
|
import { placeCitationMarkers } from "./cite-ranges.js";
|
|
4
4
|
import { parseInline, parseMessageText, parseMessageTextIncremental } from "./parse-message-text.js";
|
|
5
|
-
export { Message, MessageActions, MessageContent, MessageFooter, MessageHeader, MessageText, parseInline, parseMessageText, parseMessageTextIncremental, placeCitationMarkers, safeHref };
|
|
5
|
+
export { Message, MessageAction, MessageActions, MessageContent, MessageCopyAction, MessageFooter, MessageHeader, MessageText, parseInline, parseMessageText, parseMessageTextIncremental, placeCitationMarkers, safeHref };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type JSX } from 'solid-js';
|
|
2
|
+
import { type ActionButtonProps } from '../../composites/action-button';
|
|
2
3
|
import { type CodeBlockProps } from '../code-block';
|
|
3
4
|
/**
|
|
4
5
|
* Message.
|
|
@@ -45,6 +46,21 @@ export declare function MessageContent(props: ComponentProps<'div'>): JSX.Elemen
|
|
|
45
46
|
* and on a touch screen there is no hover, so coarse pointers always see them.
|
|
46
47
|
*/
|
|
47
48
|
export declare function MessageActions(props: ComponentProps<'div'>): JSX.Element;
|
|
49
|
+
export type MessageActionProps = Omit<ActionButtonProps, 'tooltip' | 'aria-label'> & {
|
|
50
|
+
/** The action's name: its accessible name and its tooltip. */
|
|
51
|
+
label: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* One action on a turn: an icon button whose name is also its tooltip, as in
|
|
55
|
+
* AI Elements' MessageAction. Turn actions are icons, never words, so a row of
|
|
56
|
+
* them stays one line under any message.
|
|
57
|
+
*/
|
|
58
|
+
export declare function MessageAction(props: MessageActionProps): JSX.Element;
|
|
59
|
+
/** Copies the turn's text and shows a check for a moment once the clipboard took it. */
|
|
60
|
+
export declare function MessageCopyAction(props: Omit<MessageActionProps, 'label' | 'children' | 'onClick'> & {
|
|
61
|
+
text: string | (() => string);
|
|
62
|
+
label?: string;
|
|
63
|
+
}): JSX.Element;
|
|
48
64
|
export declare function MessageFooter(props: ComponentProps<'footer'>): JSX.Element;
|
|
49
65
|
/** The props of a fenced block the host may set. */
|
|
50
66
|
export type MessageCodeBlockProps = Pick<CodeBlockProps, 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/message/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/message/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,GAAG,EACT,MAAM,UAAU,CAAA;AAIjB,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACrF,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAQ1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEzD,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,GAAG;IACnE,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,eAgC1C;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,eAc/E;AAED,qFAA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C,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,uFAAuF;IACvF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,qBAAqB,GAAG,CAAC,CAAC,KAAK,EAAE,oBAAoB,KAAK,qBAAqB,CAAC,CAAA;IACjG,mEAAmE;IACnE,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B,CAAA;AAWD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eA0DlD"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { createCopyFeedback } from "../../../lib/clipboard.js";
|
|
1
2
|
import { cn } from "../../../lib/utils.js";
|
|
3
|
+
import { ActionButton } from "../../composites/action-button/action-button.js";
|
|
2
4
|
import { CodeBlock, InlineCode } from "../code-block/code-block.js";
|
|
3
5
|
import { parseMessageTextIncremental } from "./parse-message-text.js";
|
|
4
6
|
import { createComponent, effect, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
|
|
7
|
+
import { Check, Copy } from "lucide-solid";
|
|
5
8
|
import { For, Index, Match, Show, Switch, createMemo, splitProps } from "solid-js";
|
|
6
9
|
// src/components/ui/message/message.tsx
|
|
7
10
|
var _tmpl$ = /*#__PURE__*/ template(`<article data-slot=message>`);
|
|
@@ -118,6 +121,54 @@ function MessageActions(props) {
|
|
|
118
121
|
return _el$6;
|
|
119
122
|
})();
|
|
120
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* One action on a turn: an icon button whose name is also its tooltip, as in
|
|
126
|
+
* AI Elements' MessageAction. Turn actions are icons, never words, so a row of
|
|
127
|
+
* them stays one line under any message.
|
|
128
|
+
*/
|
|
129
|
+
function MessageAction(props) {
|
|
130
|
+
const [local, rest] = splitProps(props, ["label"]);
|
|
131
|
+
return createComponent(ActionButton, mergeProps({
|
|
132
|
+
type: "button",
|
|
133
|
+
variant: "ghost",
|
|
134
|
+
size: "icon-xs",
|
|
135
|
+
"data-slot": "message-action",
|
|
136
|
+
get ["aria-label"]() {
|
|
137
|
+
return local.label;
|
|
138
|
+
},
|
|
139
|
+
get tooltip() {
|
|
140
|
+
return local.label;
|
|
141
|
+
},
|
|
142
|
+
tooltipSide: "bottom"
|
|
143
|
+
}, rest));
|
|
144
|
+
}
|
|
145
|
+
/** Copies the turn's text and shows a check for a moment once the clipboard took it. */
|
|
146
|
+
function MessageCopyAction(props) {
|
|
147
|
+
const [local, rest] = splitProps(props, ["text", "label"]);
|
|
148
|
+
const feedback = createCopyFeedback();
|
|
149
|
+
const label = () => feedback.copied() ? "Copied" : feedback.failed() ? "Copy failed" : local.label ?? "Copy";
|
|
150
|
+
return createComponent(MessageAction, mergeProps({
|
|
151
|
+
get label() {
|
|
152
|
+
return label();
|
|
153
|
+
},
|
|
154
|
+
onClick: () => {
|
|
155
|
+
const text = typeof local.text === "function" ? local.text() : local.text;
|
|
156
|
+
feedback.copy(text);
|
|
157
|
+
}
|
|
158
|
+
}, rest, { get children() {
|
|
159
|
+
return createComponent(Show, {
|
|
160
|
+
get when() {
|
|
161
|
+
return feedback.copied();
|
|
162
|
+
},
|
|
163
|
+
get fallback() {
|
|
164
|
+
return createComponent(Copy, {});
|
|
165
|
+
},
|
|
166
|
+
get children() {
|
|
167
|
+
return createComponent(Check, {});
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
} }));
|
|
171
|
+
}
|
|
121
172
|
function MessageFooter(props) {
|
|
122
173
|
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
123
174
|
return (() => {
|
|
@@ -437,6 +488,6 @@ function Inline(props) {
|
|
|
437
488
|
} })
|
|
438
489
|
});
|
|
439
490
|
}
|
|
440
|
-
export { Message, MessageActions, MessageContent, MessageFooter, MessageHeader, MessageText };
|
|
491
|
+
export { Message, MessageAction, MessageActions, MessageContent, MessageCopyAction, MessageFooter, MessageHeader, MessageText };
|
|
441
492
|
|
|
442
493
|
//# sourceMappingURL=message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","names":["createMemo","For","Index","Match","Show","splitProps","Switch","cn","CodeBlock","InlineCode","parseMessageTextIncremental","role","label","streaming","anchorId","Message","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","undefined","class","_$insert","children","MessageHeader","avatar","time","_el$2","_tmpl$2","_el$3","firstChild","_$createComponent","when","avatarSlot","_$memo","timeSlot","_el$4","_tmpl$3","MessageContent","_el$5","_tmpl$4","MessageActions","_el$6","_tmpl$5","MessageFooter","_el$7","_tmpl$6","index","language","code","complete","count","render","numbers","text","codeBlockProps","block","citations","sameBlock","a","b","kind","raw","MessageText","previous","previousCount","parsed","citationCount","blocks","next","merged","map","codeIndexes","lastIsProse","last","at","_el$8","_tmpl$8","each","BlockView","codeProps","codeIndex","_tmpl$7","chosen","choice","heading","_el$0","_tmpl$9","Inline","nodes","inline","_$effect","_$setAttribute","level","list","ordered","fallback","_el$10","_tmpl$1","items","item","_el$11","_tmpl$10","_el$1","_tmpl$0","_el$12","start","quote","_el$13","_tmpl$11","paragraph","_el$14","_tmpl$12","node","strong","_el$15","_tmpl$13","em","_el$16","_tmpl$14","link","_el$17","_tmpl$15","href","cite","marker"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import {\n createMemo,\n For,\n Index,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'role',\n 'label',\n 'streaming',\n 'anchorId',\n 'children',\n ])\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming || undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const [local, rest] = splitProps(props, ['class', 'avatar', 'time', 'children'])\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'streaming',\n 'codeBlockProps',\n 'citations',\n ])\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <Index each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </Index>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <Index each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </Index>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgBe,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CACD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,eAAA;IAAA,OAGeL,MAAMN;GAAI;GAAA,KAAA,oBAAA;IAAA,OACLM,MAAMH;GAAQ;GAAA,KAAA,gBAAA;IAAA,OAClBG,MAAML;GAAK;GAAA,KAAA,eAAA;IAAA,OACZK,MAAMJ,aAAaU,KAAAA;GAAS;GAAA,KAAA,WAAA;IAAA,OAChChB,GACL,2EAGA,gEACA;KACE,uCAAuCU,MAAMN,SAAS;KACtD,iBAAiBM,MAAMN,SAAS;IAClC,GACAM,MAAMO,KACR;GAAC;EAAA,GACGN,IAAI,GAAA,OAAA,IAAA;EAAAO,OAAAN,YAEPF,MAAMS,QAAQ;EAAA,OAAAP;CAAA,EAAA,CAAA;AAGrB;;AAGA,SA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AAA,IAACC,QAAK;OAAA,OAAG+B,KAAK,CAAC,CAA4CjG;MAAQ,EAAA,CAAA,CAAA;MAAAoE,aAAAC,aAAA6B,QAAA,QALnED,KAAK,CAAC,CAAsBG,IAAI,CAAA;MAAA,OAAAF;KAAA,EAAA,CAAA;IAO1C,CAAA;IAAA1F,gBAEF/B,OAAK;KAAA,IAACgC,OAAI;MAAA,OAAEE,WAAA+E,KAAK,CAAC,CAACpD,SAAS,MAAM,CAAA,CAAA,KAAIoD,KAAK;KAAC;KAAA1F,WACzCqG,SAAS;MACT,MAAMC,eAAeD,KAAK;MAK1B,OAAA1F,WACKA,WAAA,CAAA,CAAArB,MAAM4C,SAAS,CAAA,CAAA,IAAG5C,MAAM4C,UAAUL,OAAOyE,OAAO,CAAC,CAACxE,OAAO,IAAIwE,OAAO,CAAC,CAAC/D,GAAG;KAEhF;IAAC,CAAA;GAAA;EAAA,EAAA,CAAA;CAGN,CAAA;AAGP"}
|
|
1
|
+
{"version":3,"file":"message.js","names":["createMemo","For","Index","Match","Show","splitProps","Switch","Check","Copy","createCopyFeedback","cn","ActionButton","CodeBlock","InlineCode","parseMessageTextIncremental","role","label","streaming","anchorId","Message","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","undefined","class","_$insert","children","MessageHeader","avatar","time","_el$2","_tmpl$2","_el$3","firstChild","_$createComponent","when","avatarSlot","_$memo","timeSlot","_el$4","_tmpl$3","MessageContent","_el$5","_tmpl$4","MessageActions","_el$6","_tmpl$5","MessageAction","type","variant","size","tooltip","tooltipSide","MessageCopyAction","text","feedback","copied","failed","onClick","copy","fallback","MessageFooter","_el$7","_tmpl$6","index","language","code","complete","count","render","numbers","codeBlockProps","block","citations","sameBlock","a","b","kind","raw","MessageText","previous","previousCount","parsed","citationCount","blocks","next","merged","map","codeIndexes","lastIsProse","last","at","_el$8","_tmpl$8","each","BlockView","codeProps","codeIndex","_tmpl$7","chosen","choice","heading","_el$0","_tmpl$9","Inline","nodes","inline","_$effect","_$setAttribute","level","list","ordered","_el$10","_tmpl$1","items","item","_el$11","_tmpl$10","_el$1","_tmpl$0","_el$12","start","quote","_el$13","_tmpl$11","paragraph","_el$14","_tmpl$12","node","strong","_el$15","_tmpl$13","em","_el$16","_tmpl$14","link","_el$17","_tmpl$15","href","cite","marker"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import {\n createMemo,\n For,\n Index,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Check, Copy } from 'lucide-solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton, type ActionButtonProps } from '../../composites/action-button'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'role',\n 'label',\n 'streaming',\n 'anchorId',\n 'children',\n ])\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming || undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const [local, rest] = splitProps(props, ['class', 'avatar', 'time', 'children'])\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport type MessageActionProps = Omit<ActionButtonProps, 'tooltip' | 'aria-label'> & {\n /** The action's name: its accessible name and its tooltip. */\n label: string\n}\n\n/**\n * One action on a turn: an icon button whose name is also its tooltip, as in\n * AI Elements' MessageAction. Turn actions are icons, never words, so a row of\n * them stays one line under any message.\n */\nexport function MessageAction(props: MessageActionProps) {\n const [local, rest] = splitProps(props, ['label'])\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />\n )\n}\n\n/** Copies the turn's text and shows a check for a moment once the clipboard took it. */\nexport function MessageCopyAction(\n props: Omit<MessageActionProps, 'label' | 'children' | 'onClick'> & {\n text: string | (() => string)\n label?: string\n }\n) {\n const [local, rest] = splitProps(props, ['text', 'label'])\n const feedback = createCopyFeedback()\n const label = () =>\n feedback.copied() ? 'Copied' : feedback.failed() ? 'Copy failed' : (local.label ?? 'Copy')\n return (\n <MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'streaming',\n 'codeBlockProps',\n 'citations',\n ])\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <Index each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </Index>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <Index each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </Index>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgBmB,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CACD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,eAAA;IAAA,OAGeL,MAAMN;GAAI;GAAA,KAAA,oBAAA;IAAA,OACLM,MAAMH;GAAQ;GAAA,KAAA,gBAAA;IAAA,OAClBG,MAAML;GAAK;GAAA,KAAA,eAAA;IAAA,OACZK,MAAMJ,aAAaU,KAAAA;GAAS;GAAA,KAAA,WAA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AC,SAAAC,SAAA;MAAAhH,OAAA+G,QAAAtG,gBAODsE,QAAM,EAAA,IAACC,QAAK;OAAA,OAAG8B,KAAK,CAAC,CAA4C7G;MAAQ,EAAA,CAAA,CAAA;MAAAiF,aAAAC,aAAA4B,QAAA,QALnED,KAAK,CAAC,CAAsBG,IAAI,CAAA;MAAA,OAAAF;KAAA,EAAA,CAAA;IAO1C,CAAA;IAAAtG,gBAEFnC,OAAK;KAAA,IAACoC,OAAI;MAAA,OAAEE,WAAA2F,KAAK,CAAC,CAACnD,SAAS,MAAM,CAAA,CAAA,KAAImD,KAAK;KAAC;KAAAtG,WACzCiH,SAAS;MACT,MAAMC,eAAeD,KAAK;MAK1B,OAAAtG,WACKA,WAAA,CAAA,CAAArB,MAAMyD,SAAS,CAAA,CAAA,IAAGzD,MAAMyD,UAAUJ,OAAOuE,OAAO,CAAC,CAACtE,OAAO,IAAIsE,OAAO,CAAC,CAAC9D,GAAG;KAEhF;IAAC,CAAA;GAAA;EAAA,EAAA,CAAA;CAGN,CAAA;AAGP"}
|
|
@@ -291,7 +291,7 @@ function TooltipContent(props) {
|
|
|
291
291
|
return createComponent(Tooltip.Content, mergeProps({
|
|
292
292
|
"data-slot": "tooltip-content",
|
|
293
293
|
get ["class"]() {
|
|
294
|
-
return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-
|
|
294
|
+
return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5", "origin-(--kb-tooltip-content-transform-origin) text-balance", tooltipMotion, { "flex items-center gap-2 whitespace-nowrap": !!icon() }, local.class);
|
|
295
295
|
},
|
|
296
296
|
style: { "pointer-events": "none" },
|
|
297
297
|
get ["aria-hidden"]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","children","resolveChildren","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","dismiss","event","ESCAPE_LAYER_SELECTOR","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","TooltipProvider","props","_$createComponent","Provider","value","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","Content","icon","TooltipContent","context","escapeTarget","Portal","class","style","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","iconSlot","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n const icon = resolveChildren(() => local.icon)\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,IAAMwB,kBAAiC;;CAErCH,WAAW;;CAEXC,YAAY;;;;;;CAMZC,mBAAmB;AACrB;AAEA,IAAME,uBAA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+
{"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","children","resolveChildren","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","dismiss","event","ESCAPE_LAYER_SELECTOR","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","TooltipProvider","props","_$createComponent","Provider","value","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","Content","icon","TooltipContent","context","escapeTarget","Portal","class","style","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","iconSlot","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n const icon = resolveChildren(() => local.icon)\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n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EAAA,CAAA;GAEZ,CAAA,GAAAP,WAEF7C,MAAMxE,QAAQ,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAIvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ export * from './components/composites/file-tree';
|
|
|
113
113
|
export * from './components/composites/inline-citation';
|
|
114
114
|
export * from './components/composites/model-selector';
|
|
115
115
|
export * from './components/composites/plan';
|
|
116
|
+
export * from './components/composites/prompt-input';
|
|
116
117
|
export * from './components/composites/queue';
|
|
117
118
|
export * from './components/composites/reasoning';
|
|
118
119
|
export * from './components/composites/sources';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;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