@vite-hub/ui 0.7.0 → 0.9.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/README.md +68 -52
- package/dist/{Chat-BZxkf3Tt.js → Chat-DYQitDw8.js} +1 -1
- package/dist/{ChatMessage-Blr5F-zi.js → ChatMessage-DzjHnxMT.js} +1 -1
- package/dist/{CodeBlockTitle-DYrYpc1U.js → CodeBlockTitle-DX13mCTi.js} +1 -1
- package/dist/{CommentRow-ViZ7r8nr.js → CommentRow-DLW77qch.js} +2 -2
- package/dist/CopyButton-D-g6PWc8.js +188 -0
- package/dist/{Markdown-_w7feFzl.js → Markdown-3-Tvy5Kl.js} +1 -1
- package/dist/{MarkdownCodeBlock-B4j7x0H6.js → MarkdownCodeBlock-CALGW0iw.js} +1 -1
- package/dist/{MessageParts-FVyYZNsn.js → MessageParts-BGSctG7Z.js} +1 -1
- package/dist/{MorphText-CYTndbyp.js → MorphText-DAHAswWX.js} +1 -1
- package/dist/{RollNumber-Bo2tzfAp.js → RollNumber-CkdLiy2i.js} +1 -1
- package/dist/{motion-dPwxx3Wk.js → SwapIcon-Bjkk7WlZ.js} +2 -11
- package/dist/{agent-session-DhlTKCQG.js → agent-session-D291hyRk.js} +1 -1
- package/dist/{avatar-stack-nQErr0qn.js → avatar-stack-Bi4CJPuU.js} +1 -1
- package/dist/{chat-session-hjZRL6jY.js → chat-session-Bl-x4c9b.js} +1 -1
- package/dist/{comment-composer-BUt6vbnr.js → comment-composer-BtYrIT5W.js} +14 -19
- package/dist/{comment-composer-CIsbz-78.d.ts → comment-composer-PmERtNNb.d.ts} +3 -3
- package/dist/{comment-layer-BlVNORgj.d.ts → comment-layer-BgQz1ixK.d.ts} +3 -3
- package/dist/{comment-layer-Ck2H24oJ.js → comment-layer-T8hN_7bN.js} +11 -12
- package/dist/{comment-panel-Djx-KxVa.d.ts → comment-panel-Vo3m6rHB.d.ts} +2 -2
- package/dist/{comment-selection-bar-CxPkJxVl.js → comment-selection-bar-BMFTtI3V.js} +2 -4
- package/dist/{comment-selection-bar-CbOEI98x.d.ts → comment-selection-bar-B_bchB2O.d.ts} +1 -1
- package/dist/{comment-thread-C_Q4UDaV.js → comment-thread-CAexk1r7.js} +78 -38
- package/dist/{comment-thread-X6gYMNay.d.ts → comment-thread-Cp9k80uv.d.ts} +50 -2
- package/dist/{comments-B1itauwb.d.ts → comments-BBNiQTxK.d.ts} +12 -14
- package/dist/{components-CM5mZe0a.js → components-D44u1fsy.js} +22 -47
- package/dist/{config-CFwvNt4Y.js → config-7CiYbXk6.js} +9 -6
- package/dist/{config-JmsTI7gs.d.ts → config-BYLPA0Ts.d.ts} +8 -6
- package/dist/{drop-field-DKpYQ3tO.js → drop-field-BkoJOWR9.js} +1 -1
- package/dist/{editor-DJPUs1nt.js → editor-CE_q2Yzb.js} +89 -49
- package/dist/{editor-BsOTjnnN.d.ts → editor-DZxaa6vs.d.ts} +8 -7
- package/dist/editor.d.ts +2 -2
- package/dist/editor.js +2 -2
- package/dist/{hold-to-delete-cOPqQ9FJ.js → hold-to-delete-pyrlKzk0.js} +1 -1
- package/dist/{hold-to-delete-CcQbfiQx.js → hold-to-delete-sscThmPW.js} +30 -3
- package/dist/icon-component-ofUeRW4L.js +4 -0
- package/dist/{index-9Z6Gwtnf.d.ts → index-BlQsW8ZZ.d.ts} +1 -1
- package/dist/index.d.ts +32 -39
- package/dist/index.js +25 -26
- package/dist/{markdown-DDyOdYq_.js → markdown-CqVyNG-h.js} +2 -2
- package/dist/markdown-editor.d.ts +1 -1
- package/dist/markdown-editor.js +4 -4
- package/dist/markdown.js +1 -1
- package/dist/motion/core.d.ts +1 -1
- package/dist/motion/core.js +4 -4
- package/dist/{motion-itHFtXwA.js → motion-C8P5yWaA.js} +1 -1
- package/dist/{motion-core-BfIefToe.d.ts → motion-core-BEwxN7Il.d.ts} +4 -2
- package/dist/{motion-core-BdTfxAhY.js → motion-core-pkL0M4Y1.js} +57 -115
- package/dist/{motion-list-BBbz93WT.js → motion-list-DDVUyVYa.js} +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +5 -5
- package/dist/nuxt.d.ts +2 -4
- package/dist/nuxt.js +1 -34
- package/dist/parts/components/agent-session.js +1 -1
- package/dist/parts/components/avatar-stack.js +1 -1
- package/dist/parts/components/chat-message.js +1 -1
- package/dist/parts/components/chat-session.js +1 -1
- package/dist/parts/components/chat.js +1 -1
- package/dist/parts/components/code-block.js +1 -1
- package/dist/parts/components/comment-composer.d.ts +1 -1
- package/dist/parts/components/comment-composer.js +1 -1
- package/dist/parts/components/comment-layer.d.ts +1 -1
- package/dist/parts/components/comment-layer.js +1 -1
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +6 -7
- package/dist/parts/components/comment-selection-bar.d.ts +1 -1
- package/dist/parts/components/comment-selection-bar.js +1 -1
- package/dist/parts/components/comment-thread.d.ts +1 -1
- package/dist/parts/components/comment-thread.js +1 -1
- package/dist/parts/components/comments.d.ts +8 -8
- package/dist/parts/components/comments.js +5 -6
- package/dist/parts/components/copy-button.js +1 -3
- package/dist/parts/components/drop-field.js +1 -1
- package/dist/parts/components/hold-to-delete.js +1 -1
- package/dist/parts/components/markdown.js +1 -1
- package/dist/parts/components/message-parts.js +1 -1
- package/dist/parts/components/motion-list.d.ts +1 -1
- package/dist/parts/components/motion-list.js +1 -1
- package/dist/parts/components/motion.d.ts +2 -2
- package/dist/parts/components/motion.js +12 -3
- package/dist/parts/components/progress.js +1 -1
- package/dist/parts/components/prompt-input.d.ts +1 -1
- package/dist/parts/components/sync-status.js +1 -1
- package/dist/parts/playground/share.js +0 -1
- package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
- package/dist/parts/workspace/browser-support-notice.js +4 -4
- package/dist/parts/workspace/codemirror.js +0 -4
- package/dist/parts/workspace/connect-panel.js +2 -3
- package/dist/parts/workspace/file-icons.js +0 -8
- package/dist/parts/workspace/runners/web-container.js +2 -2
- package/dist/parts/workspace/workspace-bar.d.ts +1 -1
- package/dist/parts/workspace/workspace-bar.js +2 -3
- package/dist/parts/workspace/workspace-boot-status.js +1 -1
- package/dist/parts/workspace/workspace-editor-head.js +2 -3
- package/dist/parts/workspace/workspace-examples.js +4 -5
- package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
- package/dist/parts/workspace/workspace-guide.js +3 -4
- package/dist/parts/workspace/workspace-preview.d.ts +1 -1
- package/dist/parts/workspace/workspace-preview.js +2 -4
- package/dist/parts/workspace/workspace-shell.d.ts +1 -1
- package/dist/parts/workspace/workspace-shell.js +2 -7
- package/dist/parts/workspace/workspace-sidebar.d.ts +1 -1
- package/dist/parts/workspace/workspace-sidebar.js +5 -6
- package/dist/parts/workspace/workspace-start.js +2 -3
- package/dist/parts/workspace/workspace-steps.js +6 -7
- package/dist/parts/workspace/workspace-terminal.js +0 -6
- package/dist/parts/workspace/workspace.d.ts +3 -3
- package/dist/parts/workspace/workspace.js +15 -18
- package/dist/{progress-D_9sG648.js → progress-D7CyDkLW.js} +1 -1
- package/dist/{prompt-input-j4OFTF5p.d.ts → prompt-input-DZM3E6WP.d.ts} +2 -2
- package/dist/{ring-DoL9jivj.js → ring-C5lNUEAG.js} +1 -1
- package/dist/runtime/nuxt-plugin.js +27 -1
- package/dist/{stand-ins-CuKM1UH1.js → stand-ins-C2oSoNwV.js} +29 -84
- package/dist/styles.css +37 -21
- package/dist/{sync-status-BRroyOre.js → sync-status-D27Qt7mk.js} +1 -1
- package/dist/theme-focus-ring.css +1 -1
- package/dist/{tween-lVMRCUEv.js → tween-DGAmrS3r.js} +4 -2
- package/dist/{types-BF_U0tgp.d.ts → types-CMU8Vmew.d.ts} +2 -5
- package/dist/{vue-DdYvDVOr.js → vue-D70TZJhJ.js} +1 -1
- package/dist/{workspace-boot-status-CyGlJS06.js → workspace-boot-status-BDkpubHd.js} +0 -1
- package/dist/{workspace-shell-B4A7CINd.d.ts → workspace-shell-CwEQT_1s.d.ts} +1 -1
- package/dist/workspace.d.ts +1 -1
- package/dist/workspace.js +1 -1
- package/package.json +10 -18
- package/dist/CopyButton-Dtg_Oc9_.js +0 -115
- package/dist/announce-CJNXaYbT.js +0 -29
- package/dist/comment-send.css +0 -267
- package/dist/comments-BtD28xEn.js +0 -390
- package/dist/nuxt-ui-CPdiTwwD.js +0 -22
- package/dist/theme.css +0 -379
- package/dist/theme.d.ts +0 -410
- package/dist/theme.js +0 -290
- package/dist/ui-components-CKQAPI-W.js +0 -7
- package/dist/use-copy-DK1SSZkh.js +0 -66
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/vite-hub/vitehub/blob/main/LICENSE)
|
|
6
6
|
[](https://vitehub.dev/docs)
|
|
7
7
|
|
|
8
|
-
Vue primitives for AI chat, traces, diffs, and file trees. The styled components render [ui-sdk](https://ui-sdk.dev) components by
|
|
8
|
+
Vue primitives for AI chat, traces, diffs, and file trees. The styled components render [ui-sdk](https://ui-sdk.dev) components, styled by the `@vite-hub/kit` style family, and render [AI SDK](https://ai-sdk.dev/) message contracts; the headless entry point provides message-scrolling behavior without the styled component layer.
|
|
9
9
|
|
|
10
10
|
`Markdown` accepts a string or a parsed Content page. Comark UI block components and document styles are bundled, so readers do not install Comark packages or assemble a component map. `vite-hub/nuxt` auto-imports the primitive; Vite apps import it from `@vite-hub/ui`.
|
|
11
11
|
|
|
@@ -25,24 +25,23 @@ Markdown images and image attachments use compact thumbnails with an expanded pr
|
|
|
25
25
|
| `@vite-hub/ui/motion` | The motion layer: press, toggle, select, drag, and appear motion by role, the shared spring engine, and reduced motion. No Vue, so a plain TypeScript page or a shadow root can use it | Nothing: `createViteHubUI()` and the Nuxt module install it |
|
|
26
26
|
| `@vite-hub/ui/motion/core` | The same layer, where `installMotion(root, { effects })` runs only the effects that you list, such as `pressEffect`, so a small script bundles only those | Which effects the script runs |
|
|
27
27
|
| `@vite-hub/ui/playground` | Share links and zips for any playground, with no UI. It runs in Node too | Where the links and zips go |
|
|
28
|
-
| `@vite-hub/ui/theme` and `@vite-hub/ui/theme.css` | `vitehubTheme`, the Nuxt UI app config, and the tokens and focus ring. The tokens use shadcn/ui names, such as `--background` and `--radius`, which an app can override. Import the theme in `nuxt.config` or `app.config` | Loading Nuxt UI and Tailwind CSS |
|
|
29
28
|
| `@vite-hub/ui/vite` | Vue with Vite setup | Configures the Comark Vite plugin |
|
|
30
|
-
| `@vite-hub/ui/styles.css` | The styles of every part | The `@vite-hub/kit` style family
|
|
29
|
+
| `@vite-hub/ui/styles.css` | The styles of every part | The `@vite-hub/kit` style family: `default.css`, or `default.scoped.css` next to Nuxt UI |
|
|
31
30
|
| `@vite-hub/ui/comment-marks.css` | Comment pins, areas, and text highlights in plain CSS, for a page or a shadow root without Vue. `styles.css` includes it | Rendering the marks with their data attributes |
|
|
32
31
|
|
|
33
32
|
Import components from the root. A production build keeps only the components that the app imports. `markdown-editor` and `workspace` have their own entries because their dependencies are large, and a chat page must not load them. The components do not need a ViteHub Agent: `Chat` and `PromptInput` render the messages and status of any AI SDK chat, such as `new Chat()` of `@ai-sdk/vue` on a route that returns `streamText().toUIMessageStreamResponse()`.
|
|
34
33
|
|
|
35
|
-
`vite-hub/nuxt` registers the `vitehub` Iconify collection, so `i-vitehub-kv` works in `
|
|
34
|
+
`vite-hub/nuxt` registers the `vitehub` Iconify collection, so `i-vitehub-kv` works in the `Icon` component of `@nuxt/icon`. The icon rail of ViteHub docs and the Console is in `@vite-hub/docs/primitive-rail`. Its styles stay in `@vite-hub/ui/styles.css`.
|
|
36
35
|
|
|
37
36
|
The parts `Message`, `Bubble`, `Marker`, `Trace`, and `Attachment` follow the [shadcn/ui agentic components](https://ui.shadcn.com/docs/changelog/2026-10-ai-elements): the same part names and `data-slot` attributes. `Message`, `Bubble`, `Attachment`, and `PromptInput` are also `@vitehub` registry items, with the props of the ViteHub contract. Their default styles map shadcn/ui tokens to Nuxt UI tokens and live in the `components` layer of `styles.css`, so Tailwind utility classes on a part override them. Import them under another name, for example `import { Message as VhMessage } from "@vite-hub/ui"`, when the application already has a `Message` or `Trace` component.
|
|
38
37
|
|
|
39
|
-
The package declares `vue` and `ai` as required peers. The Vite integration requires `vite`, an optional peer. The styled components need no Nuxt UI
|
|
38
|
+
The package declares `vue` and `ai` as required peers. The Vite integration requires `vite`, an optional peer. The styled components need no Nuxt UI. They render the ui-sdk components and need the kit styles (see [the ui-sdk components](#the-ui-sdk-components)).
|
|
40
39
|
|
|
41
40
|
`RelativeTime` shows the full date in a ui-sdk tooltip, the `@vitehub/tooltip` item, once it mounts. Set `plain` to leave it out.
|
|
42
41
|
|
|
43
42
|
## Edit Markdown
|
|
44
43
|
|
|
45
|
-
`MarkdownEditor` from `@vite-hub/ui/markdown-editor` edits Markdown with [comark-ui's editor](https://comark-ui.onmax.me/guide/editor/), a bubble toolbar, a "/" menu, and a drag handle. The editor uses ui-sdk parts
|
|
44
|
+
`MarkdownEditor` from `@vite-hub/ui/markdown-editor` edits Markdown with [comark-ui's editor](https://comark-ui.onmax.me/guide/editor/), a bubble toolbar, a "/" menu, and a drag handle. The editor uses ui-sdk parts. Bind the Markdown with `v-model`, or pass `editor` with a Tiptap editor the app made, such as a Realtime room's. A document that the editor can't save unchanged opens read-only.
|
|
46
45
|
|
|
47
46
|
Pass `upload` to take pasted and dropped images, video, and audio, and to add Image to the "/" menu, which opens the file picker. Each file shows a placeholder with its percentage only on your screen, so a collaborative room never holds a half-uploaded file. A string is a route that returns `blob.handleUpload()`, and the store must be served (`blob.serve`) so the file has a URL:
|
|
48
47
|
|
|
@@ -60,7 +59,7 @@ const markdown = ref("# Release notes\n");
|
|
|
60
59
|
```
|
|
61
60
|
|
|
62
61
|
```ts [server/api/uploads.post.ts]
|
|
63
|
-
import { defineEventHandler } from "h3";
|
|
62
|
+
import { defineEventHandler } from "nitro/h3";
|
|
64
63
|
import { blob } from "vite-hub/blob";
|
|
65
64
|
|
|
66
65
|
// Check who may upload before this call
|
|
@@ -76,7 +75,7 @@ export default defineEventHandler(async (event) => {
|
|
|
76
75
|
|
|
77
76
|
`upload` also takes a function, `(file, progress) => Promise<url>`, for any other storage; `blobUpload(route)` is the one a string uses. The default slot receives `{ editor }` for more menus. The entry isn't in the root barrel, so pages that only render Markdown don't load Tiptap. It needs these Tiptap packages: `@tiptap/core`, `@tiptap/pm`, `@tiptap/vue-3`, `@tiptap/starter-kit`, `@tiptap/extension-image`, `@tiptap/extension-list`, `@tiptap/extension-table`, `@tiptap/extension-drag-handle`, `@tiptap/extension-drag-handle-vue-3`, and `@floating-ui/dom`. The `@vitehub/markdown-editor` item adds them to the app. Start without `v-model` with `defaultValue`. A failed upload emits `error` with `{ error, file }`.
|
|
78
77
|
|
|
79
|
-
The menus run each item's `kind`, such as `{ kind: "heading", level: 2 }`, through the handlers that the editor provides. `createEditorHandlers()` returns them, and `mapEditorItems(editor, items)` turns editor items into dropdown entries with `active`, `disabled`, and `onSelect`, as Nuxt UI's `mapEditorItems()` does. Provide your own under `editorHandlersKey` to add kinds
|
|
78
|
+
The menus run each item's `kind`, such as `{ kind: "heading", level: 2 }`, through the handlers that the editor provides. `createEditorHandlers()` returns them, and `mapEditorItems(editor, items)` turns editor items into dropdown entries with `active`, `disabled`, and `onSelect`, as Nuxt UI's `mapEditorItems()` does. Provide your own under `editorHandlersKey` to add kinds. The editor parts read them.
|
|
80
79
|
|
|
81
80
|
## Run an app in the browser
|
|
82
81
|
|
|
@@ -181,34 +180,37 @@ const runner = render(async files => ({ html: await marked.parse(files["content.
|
|
|
181
180
|
|
|
182
181
|
## Nuxt
|
|
183
182
|
|
|
184
|
-
Add the package, ViteHub, and the runtime peers to an existing Nuxt application:
|
|
183
|
+
Add the package, ViteHub, the kit, and the runtime peers to an existing Nuxt application:
|
|
185
184
|
|
|
186
185
|
```bash
|
|
187
|
-
pnpm add vite-hub @vite-hub/ui @
|
|
186
|
+
pnpm add vite-hub @vite-hub/ui @vite-hub/kit ai vue
|
|
188
187
|
```
|
|
189
188
|
|
|
190
|
-
Register
|
|
189
|
+
Register `vite-hub/nuxt`:
|
|
191
190
|
|
|
192
191
|
```ts
|
|
193
192
|
// nuxt.config.ts
|
|
194
193
|
export default defineNuxtConfig({
|
|
195
|
-
modules: ["
|
|
194
|
+
modules: ["vite-hub/nuxt"],
|
|
196
195
|
css: ["~/assets/css/main.css"],
|
|
197
196
|
});
|
|
198
197
|
```
|
|
199
198
|
|
|
200
|
-
Load
|
|
199
|
+
Load the kit style family before the package styles:
|
|
201
200
|
|
|
202
201
|
```css
|
|
203
202
|
/* assets/css/main.css */
|
|
204
|
-
@
|
|
205
|
-
@import "@
|
|
203
|
+
@layer theme, base, kit, comark, components, utilities;
|
|
204
|
+
@import "@vite-hub/kit/styles/tokens.css";
|
|
205
|
+
@import "@vite-hub/kit/styles/default.css" layer(kit);
|
|
206
206
|
@import "@vite-hub/ui/styles.css";
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
The parts render the ui-sdk components
|
|
209
|
+
Nuxt UI is optional. The parts render the ui-sdk components, so they need the kit styles also in an app with Nuxt UI. For that app, see [Nuxt UI apps](#nuxt-ui-apps).
|
|
210
210
|
|
|
211
|
-
`vite-hub/nuxt`
|
|
211
|
+
`vite-hub/nuxt` auto-imports public components such as `Chat`, `Markdown`, and `TraceRun`. No separate Vue plugin registration is needed. The stylesheet stays an explicit import.
|
|
212
|
+
|
|
213
|
+
If the app enables `@nuxt/icon`, `vite-hub/nuxt` adds the component icons to its client bundle and registers the `vitehub` collection for names such as `<Icon name="i-vitehub-kv" />`. Install `@iconify-json/lucide` if the app uses Lucide names through `@nuxt/icon`. The default ViteHub parts do not need that collection installed in the app.
|
|
212
214
|
|
|
213
215
|
`@vite-hub/ui/nuxt` is internal. `vite-hub/nuxt` and `@vite-hub/docs/nuxt` load it, and it can change in any release. Do not add it to Nuxt `modules`.
|
|
214
216
|
|
|
@@ -256,7 +258,7 @@ Load the kit style family before the package styles:
|
|
|
256
258
|
@import "@vite-hub/ui/styles.css";
|
|
257
259
|
```
|
|
258
260
|
|
|
259
|
-
For Nuxt UI
|
|
261
|
+
For an app with Nuxt UI, see [Nuxt UI apps](#nuxt-ui-apps).
|
|
260
262
|
|
|
261
263
|
Unlike `vite-hub/nuxt`, the Vite integration does not auto-register ViteHub UI components. Import them from `@vite-hub/ui` in each component or use the application's component-registration convention.
|
|
262
264
|
|
|
@@ -312,24 +314,24 @@ Without Vue, `createMotionList`, `createProgress`, `createDropField`, and `creat
|
|
|
312
314
|
|
|
313
315
|
### Labels, icons, counts, and rings
|
|
314
316
|
|
|
315
|
-
The layer also morphs what changes with state. When the label of a
|
|
317
|
+
The layer also morphs what changes with state. When the label of a button changes, such as `:label="loading ? 'Publishing' : 'Publish'"`, its letters change one at a time and the button's width follows with a spring. When Vue draws another icon into the button's leading or trailing icon, such as the spinner of `loading`, the old icon blurs out and the spinner draws its stroke in. The app only changes the label and the icon. With `@nuxt/icon` in CSS mode an icon is a class, which the layer does not watch, so the icon changes at once there; use `SwapIcon` in the button's `leading` slot.
|
|
316
318
|
|
|
317
319
|
For everything else, use the component or the helper:
|
|
318
320
|
|
|
319
321
|
| Vue | Helper in `@vite-hub/ui/motion` | Use it for |
|
|
320
322
|
| --- | --- | --- |
|
|
321
|
-
| `<MorphText :text="copied ? 'Copied' : 'Copy link'" />` | `morphText(element, text)` | A label outside a
|
|
322
|
-
| `<SwapIcon :name="icon" enter="draw" v-slot="{ name }"><
|
|
323
|
+
| `<MorphText :text="copied ? 'Copied' : 'Copy link'" />` | `morphText(element, text)` | A label outside a button |
|
|
324
|
+
| `<SwapIcon :name="icon" enter="draw" v-slot="{ name }"><Icon :name="name" /></SwapIcon>` | `swapIcon(container, icon, { exit, enter })` | An icon that says what happened: `exit: "right"` for an arrow that leaves the way it points, `enter: "draw"` for a check or a spinner |
|
|
323
325
|
| `<RollNumber :value="count" />` | `rollNumber(element, value, format?)` | A count: only the changed digits roll, up when it grows, down when it shrinks |
|
|
324
|
-
| `<
|
|
326
|
+
| `<button v-ring="saved">` | `ring(element)` | A finished action, such as saved or copied: a ring in the border color grows once and fades. A button joined to others in a field group rings the whole group |
|
|
325
327
|
|
|
326
328
|
`CopyButton` uses all of them. Each helper can be called again in the middle of its motion and continues from where it is. The element keeps the final text for screen readers the whole time and holds plain text again at the end. Under reduced motion a label, an icon, or a digit crossfades in 150ms, and there is no ring. Inside `data-motion="none"` the change happens at once.
|
|
327
329
|
|
|
328
330
|
The entry also has the spring engine (`createSpring`, `springs.snappy`, `springs.soft`), reduced motion (`prefersReducedMotion`, `onReducedMotionChange`, `forceReducedMotion`), `setMotionSlowFactor(4)` to watch an effect at ¼×, and `defineMotionEffect` to add an effect for a role. The motion page in `test/browser/motion/` renders every role; `pnpm --filter @vite-hub/ui test:motion` checks it in Chromium, and `MOTION_RECORD=<dir>` records each press at ¼×.
|
|
329
331
|
|
|
330
|
-
## The ui-sdk
|
|
332
|
+
## The ui-sdk components
|
|
331
333
|
|
|
332
|
-
The styled parts render
|
|
334
|
+
The styled parts render [ui-sdk](https://ui-sdk.dev) components for their buttons, icons, fields, dialogs, tabs, tooltips, and menus. The `@vite-hub/kit` style family styles them. The editor toolbar, the "/" menu, and the drag handle are in the editor entry, so other parts do not load Tiptap. Load the kit styles:
|
|
333
335
|
|
|
334
336
|
```css
|
|
335
337
|
/* src/assets/main.css */
|
|
@@ -339,46 +341,60 @@ The styled parts render a few components by Nuxt UI's names: `UButton`, `UIcon`,
|
|
|
339
341
|
@import "@vite-hub/ui/styles.css";
|
|
340
342
|
```
|
|
341
343
|
|
|
342
|
-
-
|
|
344
|
+
- The parts draw the Lucide icons that they use. To draw other icon names, such as your own in `createViteHubUI({ icons })` pass a component that takes the icon name in its `name` prop. See [Icons](#icons).
|
|
343
345
|
- The buttons and fields keep the kit's `data-slot` (`button`, `input`), so a part's own name moves to `data-part`, for example `data-part="copy-button"`.
|
|
344
|
-
-
|
|
345
|
-
- The
|
|
346
|
+
- A tooltip puts ui-sdk's `Tooltip` on the trigger. The content opens on hover and focus, above the trigger by default.
|
|
347
|
+
- The editor parts of `MarkdownEditor` are on ui-sdk too. The toolbar uses `Toolbar` and `Toggle`, which say the pressed state with `aria-pressed`. The "/" menu uses `TriggerMenu`, a listbox at the caret while focus stays in the editor. The drag handle uses Tiptap's drag handle. They load on first render.
|
|
346
348
|
- In the "/" menu, Escape closes the list until the trigger is typed again or Control+Space reopens it, and a disabled item can be highlighted but not chosen, as the listbox pattern asks.
|
|
347
349
|
|
|
348
|
-
|
|
350
|
+
The parts do not use components that the app registers, such as Nuxt UI's `UButton`.
|
|
349
351
|
|
|
350
|
-
###
|
|
352
|
+
### Icons
|
|
351
353
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
In Nuxt, [register the overrides globally](https://vitehub.dev/docs/ui/installation#nuxt-ui-components) without reinstalling the ViteHub UI plugin. In Vue with Vite, pass the overrides when you install the plugin in `src/main.ts`:
|
|
354
|
+
Pass your icon component to `createViteHubUI({ iconComponent })`. The parts give it the icon name in its `name` prop, such as `i-lucide-x`:
|
|
355
355
|
|
|
356
356
|
```ts fragment
|
|
357
357
|
import { createViteHubUI } from "@vite-hub/ui";
|
|
358
|
-
import
|
|
359
|
-
|
|
360
|
-
app.use(createViteHubUI({
|
|
361
|
-
components: {
|
|
362
|
-
UButton: defineAsyncComponent(() => import("@nuxt/ui/components/Button.vue")),
|
|
363
|
-
UDropdownMenu: defineAsyncComponent(() => import("@nuxt/ui/components/DropdownMenu.vue")),
|
|
364
|
-
UIcon: defineAsyncComponent(() => import("@nuxt/ui/components/Icon.vue")),
|
|
365
|
-
UInput: defineAsyncComponent(() => import("@nuxt/ui/components/Input.vue")),
|
|
366
|
-
UModal: defineAsyncComponent(() => import("@nuxt/ui/components/Modal.vue")),
|
|
367
|
-
UTabs: defineAsyncComponent(() => import("@nuxt/ui/components/Tabs.vue")),
|
|
368
|
-
UTooltip: defineAsyncComponent(() => import("@nuxt/ui/components/Tooltip.vue")),
|
|
369
|
-
},
|
|
370
|
-
}));
|
|
358
|
+
import MyIcon from "./MyIcon.vue";
|
|
359
|
+
|
|
360
|
+
app.use(createViteHubUI({ iconComponent: MyIcon }));
|
|
371
361
|
```
|
|
372
362
|
|
|
373
|
-
|
|
363
|
+
In Nuxt, the module draws the icons with a `UIcon` that the app registers, else with the `Icon` component of `@nuxt/icon`, else with the Lucide icons that the parts draw.
|
|
364
|
+
|
|
365
|
+
### Nuxt UI apps
|
|
366
|
+
|
|
367
|
+
The parts do not render Nuxt UI components. In an app that also renders Nuxt UI, load the scoped kit family, `@vite-hub/kit/styles/default.scoped.css`, instead of `default.css`. It styles only the elements inside an element with the `ui-sdk` class, so the component styles of Nuxt UI stay as they are outside it:
|
|
368
|
+
|
|
369
|
+
```css
|
|
370
|
+
/* assets/css/main.css */
|
|
371
|
+
@layer theme, base, kit, comark, components, utilities;
|
|
372
|
+
@import "tailwindcss";
|
|
373
|
+
@import "@nuxt/ui";
|
|
374
|
+
@import "@vite-hub/kit/styles/tokens.css";
|
|
375
|
+
@import "@vite-hub/kit/styles/default.scoped.css" layer(kit);
|
|
376
|
+
@import "@vite-hub/ui/styles.css";
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
```vue
|
|
380
|
+
<template>
|
|
381
|
+
<section class="ui-sdk">
|
|
382
|
+
<Chat :messages="messages" />
|
|
383
|
+
</section>
|
|
384
|
+
</template>
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
`tokens.css` is global, not scoped. It sets the shadcn/ui names and the `--ui-*` text, background, border, and status tokens on `:root`, so Nuxt UI's colors take the ViteHub values on the whole page. Only the component rules of the kit family stay inside the scope root.
|
|
388
|
+
|
|
389
|
+
Put no Nuxt UI component inside a scope root. A popup stays inside its root. See [Next to Nuxt UI](../kit/README.md#next-to-nuxt-ui) in the kit README for the rules of the scope root.
|
|
374
390
|
|
|
375
|
-
`pnpm --filter @vite-hub/ui test:ui-sdk` renders every part
|
|
391
|
+
`pnpm --filter @vite-hub/ui test:ui-sdk` renders every part with the ui-sdk components and drives each one with the keyboard. It fails when a page loads `@nuxt/ui`. `pnpm --filter @vite-hub/ui test:editor` drives the editor parts with the keyboard and the pointer.
|
|
376
392
|
|
|
377
393
|
## Registry
|
|
378
394
|
|
|
379
395
|
The `@vitehub` registry in the shadcn-vue format is built from the same files as the npm package. Each item lives in `registry/<item>/`. `src/` re-exports the components from there, so `@vite-hub/ui` and `shadcn-vue add` ship the same `.vue` files.
|
|
380
396
|
|
|
381
|
-
`pnpm --filter @vite-hub/ui build:registry` writes the registry to `docs/public/r/`, which vitehub.dev serves at `https://vitehub.dev/r/{name}.json`. `test/registry.test.ts` fails when
|
|
397
|
+
`pnpm --filter @vite-hub/ui build:registry` writes the registry to `docs/public/r/`, which vitehub.dev serves at `https://vitehub.dev/r/{name}.json`. Git ignores that folder. The docs site writes it again each time `nuxi dev`, `nuxi build`, or `nuxi prepare` starts. `test/registry.test.ts` fails when the built files do not match the vendored shadcn-vue 2.9.0 schema.
|
|
382
398
|
|
|
383
399
|
The builder reads `registry/registry.json`. An item without `files` publishes every file in `registry/<item>/` to `components/vitehub/<item>/`. It derives the rest from the imports:
|
|
384
400
|
|
|
@@ -401,7 +417,7 @@ An item component follows one contract: compound parts, `data-slot` on the root,
|
|
|
401
417
|
|
|
402
418
|
`core` also writes `:where([data-slot]) { box-sizing: border-box }` in `@layer components` into the app's CSS. That rule changes nothing, but it keeps the `components` layer after `base`. Without it, Tailwind 4 emits an empty `components` layer as the statement `@layer components;`, and when the app's CSS keeps an external `@import`, such as the Google Fonts line from `shadcn-vue init`, Vite's postcss-import (16.2.0 in Vite 8.4) moves that statement to the top. Then `components` is the first layer, and Tailwind's Preflight in `base` removes the padding and background of a button.
|
|
403
419
|
|
|
404
|
-
`node --test test/registry-install/install.mjs` (from the repository root
|
|
420
|
+
`node --test test/registry-install/install.mjs` (from the repository root) runs `build:registry` and serves `docs/public/r/` on a local port and makes four apps: Vite + Vue + Tailwind 4 from `init --preset`, Nuxt 5, Vite with stock shadcn-vue and Reka UI, and Nuxt 5 with Nuxt UI. It runs `shadcn-vue@2.9.0 add` for every item, installs `@vite-hub/ui`, `@vite-hub/comments`, and their required workspace dependencies from tarballs packed from this checkout, builds each app, and renders every example in Chromium. Build UI and its workspace dependencies first with `corepack pnpm exec vp run --cache -t @vite-hub/ui#build`. The check fails on a console error, a root without `data-slot`, a copy button that lost its padding or background to Preflight, or Reka UI in the item files of the first two apps. It needs the npm registry. `REGISTRY_APPS=vite-vue,nuxt` runs some apps, `REGISTRY_INSTALL_DIR` keeps them, and `REGISTRY_SCREENSHOTS` saves a screenshot of each.
|
|
405
421
|
|
|
406
422
|
## Verify the setup
|
|
407
423
|
|
|
@@ -425,16 +441,16 @@ The page displays **ViteHub UI is ready.** in bold. This confirms the public com
|
|
|
425
441
|
- The components render state supplied by the application. They do not send messages, fetch Agent Invocations, choose routes, persist sessions, or authorize access to instruction and trace data.
|
|
426
442
|
- `PromptInput` submits only in the ready state after attachment conversion finishes. It preserves the draft while blocked; Stop and Retry remain separate actions. The default slot of `PromptInput` receives `canSubmit` and `preparing` for a custom submit button. The application owns draft recovery and clearing after a send; unmount the prompt when switching sessions with pending file reads.
|
|
427
443
|
- Primary chat and trace output supports Vue server rendering. Scrolling observers, clipboard actions, and attachment conversion use browser APIs and become interactive after hydration. Upload and persist raw files yourself when data URLs are not appropriate.
|
|
428
|
-
- The styled components depend on the ui-sdk components and the kit
|
|
444
|
+
- The styled components depend on the ui-sdk components and the kit styles. `@vite-hub/ui/styles.css` adds ViteHub presentation but does not replace those styles.
|
|
429
445
|
- The package supplies accessible defaults for its message log, prompt, scroll controls, lists, and built-in actions. The application remains responsible for accessible names on custom controls and slots, meaningful status and error copy, focus behavior around application-owned navigation, and testing the completed interface.
|
|
430
446
|
- `FileTree` names its search input **Search files** by default. Pass `search-label` for a localized or context-specific accessible name.
|
|
431
|
-
- The headless entry point owns scrolling behavior, not appearance. Importing `@vite-hub/ui/headless` does not load the stylesheet or
|
|
447
|
+
- The headless entry point owns scrolling behavior, not appearance. Importing `@vite-hub/ui/headless` does not load the stylesheet or the ui-sdk components.
|
|
432
448
|
|
|
433
449
|
## Documentation
|
|
434
450
|
|
|
435
451
|
- [AI components overview and layer ownership](https://vitehub.dev/docs/ui/ai-components)
|
|
436
452
|
- [Installation and package defaults](https://vitehub.dev/docs/ui/installation)
|
|
437
|
-
- [Icons](https://vitehub.dev/docs/ui/installation#icons): the parts read
|
|
453
|
+
- [Icons](https://vitehub.dev/docs/ui/installation#icons): in Nuxt the parts read their icon names from `appConfig.ui.icons` and `appConfig.viteHubUI.icons`, and `createViteHubUI({ iconComponent })` draws names that the parts do not draw
|
|
438
454
|
- [Chat and transport boundary](https://vitehub.dev/docs/ui/chat)
|
|
439
455
|
- [Prompt input](https://vitehub.dev/docs/ui/prompt-input) and [attachments](https://vitehub.dev/docs/ui/attachments)
|
|
440
456
|
- [Headless message scroller](https://vitehub.dev/docs/ui/message-scroller)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ChatMessage_default } from "./ChatMessage-
|
|
1
|
+
import { t as ChatMessage_default } from "./ChatMessage-DzjHnxMT.js";
|
|
2
2
|
import { a as MessageScroller_default, i as MessageScrollerButton_default, n as MessageScrollerItem_default, r as MessageScrollerContent_default, t as MessageScrollerViewport_default } from "./MessageScrollerViewport-BaTlWLki.js";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, renderList, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
4
4
|
import { ChevronDown } from "@lucide/vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as Bubble_default, t as BubbleContent_default } from "./BubbleContent-B1a4e3vE.js";
|
|
2
2
|
import { a as Message_default, i as MessageAvatar_default, n as MessageFooter_default, r as MessageContent_default, t as MessageHeader_default } from "./MessageHeader-CJ9eBHSS.js";
|
|
3
|
-
import { t as MessageParts_default } from "./MessageParts-
|
|
3
|
+
import { t as MessageParts_default } from "./MessageParts-BGSctG7Z.js";
|
|
4
4
|
import { computed, createBlock, createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
5
5
|
// registry/chat-message/ChatMessage.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CopyButton_default } from "./CopyButton-
|
|
1
|
+
import { t as CopyButton_default } from "./CopyButton-D-g6PWc8.js";
|
|
2
2
|
import { createBlock, createElementBlock, createSlots, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, withCtx } from "vue";
|
|
3
3
|
// registry/code-block/CodeBlockActions.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1$2 = { "data-slot": "code-block-actions" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as AvatarStack_default } from "./avatar-stack-
|
|
2
|
-
import { c as writerName, l as writerPerson, o as plainText } from "./comment-composer-
|
|
1
|
+
import { t as AvatarStack_default } from "./avatar-stack-Bi4CJPuU.js";
|
|
2
|
+
import { c as writerName, l as writerPerson, o as plainText } from "./comment-composer-BtYrIT5W.js";
|
|
3
3
|
import { t as RelativeTime_default } from "./relative-time-BnJfjeEm.js";
|
|
4
4
|
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref } from "vue";
|
|
5
5
|
// src/internal/comment-attachments.ts
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { m as prepareAnnouncer, p as announce } from "./hold-to-delete-sscThmPW.js";
|
|
2
|
+
import { t as MorphText_default } from "./MorphText-DAHAswWX.js";
|
|
3
|
+
import { t as SwapIcon_default } from "./SwapIcon-Bjkk7WlZ.js";
|
|
4
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, getCurrentScope, mergeProps, onMounted, onScopeDispose, openBlock, readonly, ref, renderSlot, resolveDynamicComponent, toValue, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
5
|
+
import { Check, Copy, LoaderCircle } from "@lucide/vue";
|
|
6
|
+
import { Button } from "@ui-sdk/vue/button";
|
|
7
|
+
// registry/copy-button/use-copy.ts
|
|
8
|
+
async function writeClipboard(value) {
|
|
9
|
+
const text = typeof value === "function" ? value() : value;
|
|
10
|
+
try {
|
|
11
|
+
if (await writeClipboardApi(text)) return true;
|
|
12
|
+
} catch {}
|
|
13
|
+
return copyWithCommand(await text);
|
|
14
|
+
}
|
|
15
|
+
async function writeClipboardApi(text) {
|
|
16
|
+
const clipboard = globalThis.navigator?.clipboard;
|
|
17
|
+
if (typeof clipboard?.writeText !== "function") return false;
|
|
18
|
+
if (typeof text === "string") await clipboard.writeText(text);
|
|
19
|
+
else if (typeof ClipboardItem === "function" && typeof clipboard.write === "function") await clipboard.write([new ClipboardItem({ "text/plain": text.then((resolved) => new Blob([resolved], { type: "text/plain" })) })]);
|
|
20
|
+
else await clipboard.writeText(await text);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
function copyWithCommand(text) {
|
|
24
|
+
const doc = globalThis.document;
|
|
25
|
+
if (typeof doc?.execCommand !== "function" || !doc.body) return false;
|
|
26
|
+
const focused = doc.activeElement;
|
|
27
|
+
const area = doc.createElement("textarea");
|
|
28
|
+
area.value = text;
|
|
29
|
+
area.readOnly = true;
|
|
30
|
+
area.style.position = "fixed";
|
|
31
|
+
area.style.opacity = "0";
|
|
32
|
+
doc.body.append(area);
|
|
33
|
+
area.focus({ preventScroll: true });
|
|
34
|
+
area.select();
|
|
35
|
+
try {
|
|
36
|
+
return doc.execCommand("copy");
|
|
37
|
+
} catch {
|
|
38
|
+
return false;
|
|
39
|
+
} finally {
|
|
40
|
+
area.remove();
|
|
41
|
+
if (focused instanceof HTMLElement) focused.focus({ preventScroll: true });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function useCopy(options = {}) {
|
|
45
|
+
const copied = ref(false);
|
|
46
|
+
const failed = ref(false);
|
|
47
|
+
let timer;
|
|
48
|
+
if (getCurrentScope()) onScopeDispose(() => clearTimeout(timer));
|
|
49
|
+
async function copy(value) {
|
|
50
|
+
clearTimeout(timer);
|
|
51
|
+
copied.value = false;
|
|
52
|
+
failed.value = false;
|
|
53
|
+
try {
|
|
54
|
+
copied.value = await writeClipboard(value);
|
|
55
|
+
} catch {
|
|
56
|
+
copied.value = false;
|
|
57
|
+
}
|
|
58
|
+
failed.value = !copied.value;
|
|
59
|
+
timer = setTimeout(() => {
|
|
60
|
+
copied.value = false;
|
|
61
|
+
failed.value = false;
|
|
62
|
+
}, toValue(options.duration) ?? 2e3);
|
|
63
|
+
return copied.value;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
copy,
|
|
67
|
+
copied: readonly(copied),
|
|
68
|
+
failed: readonly(failed)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// registry/copy-button/CopyButton.vue?vue&type=script&setup=true&lang.ts
|
|
72
|
+
const _hoisted_1 = {
|
|
73
|
+
key: 0,
|
|
74
|
+
"data-slot": "copy-button-label"
|
|
75
|
+
};
|
|
76
|
+
// registry/copy-button/CopyButton.vue
|
|
77
|
+
var CopyButton_default = /* @__PURE__ */ defineComponent({
|
|
78
|
+
__name: "CopyButton",
|
|
79
|
+
props: {
|
|
80
|
+
value: { type: [String, Function] },
|
|
81
|
+
label: {},
|
|
82
|
+
copyLabel: { default: "Copy" },
|
|
83
|
+
copiedLabel: { default: "Copied" },
|
|
84
|
+
failedLabel: { default: "Copy failed" },
|
|
85
|
+
variant: { default: "ghost" },
|
|
86
|
+
size: { default: "sm" },
|
|
87
|
+
duration: { default: 2e3 },
|
|
88
|
+
preload: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false
|
|
91
|
+
},
|
|
92
|
+
disabled: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
emits: ["copy", "error"],
|
|
98
|
+
setup(__props, { emit: __emit }) {
|
|
99
|
+
const emit = __emit;
|
|
100
|
+
const slots = useSlots();
|
|
101
|
+
const { copy, copied } = useCopy({ duration: () => __props.duration });
|
|
102
|
+
const root = useTemplateRef("root");
|
|
103
|
+
const element = () => root.value?.$el instanceof Element ? root.value.$el : void 0;
|
|
104
|
+
onMounted(() => prepareAnnouncer(element()));
|
|
105
|
+
let preloaded;
|
|
106
|
+
watch(() => __props.value, () => preloaded = void 0);
|
|
107
|
+
function startPreload() {
|
|
108
|
+
if (!__props.preload || preloaded || typeof __props.value !== "function") return;
|
|
109
|
+
const entry = { text: callValue(__props.value) };
|
|
110
|
+
preloaded = entry;
|
|
111
|
+
if (typeof entry.text === "string") return;
|
|
112
|
+
entry.text.then((text) => {
|
|
113
|
+
if (preloaded === entry) entry.text = text;
|
|
114
|
+
}, () => {
|
|
115
|
+
if (preloaded === entry) preloaded = void 0;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const loading = ref(false);
|
|
119
|
+
async function onClick() {
|
|
120
|
+
let text = __props.value;
|
|
121
|
+
if (typeof text === "function") {
|
|
122
|
+
const pending = preloaded?.text ?? callValue(text);
|
|
123
|
+
preloaded = void 0;
|
|
124
|
+
text = typeof pending === "string" ? pending : () => pending;
|
|
125
|
+
loading.value = typeof pending !== "string";
|
|
126
|
+
}
|
|
127
|
+
const ok = await copy(text);
|
|
128
|
+
loading.value = false;
|
|
129
|
+
announce(element(), ok ? __props.copiedLabel : __props.failedLabel, __props.duration);
|
|
130
|
+
if (ok) emit("copy");
|
|
131
|
+
else emit("error");
|
|
132
|
+
}
|
|
133
|
+
const name = computed(() => __props.label || slots.default ? void 0 : __props.copyLabel);
|
|
134
|
+
const icon = computed(() => loading.value ? "loading" : copied.value ? "copied" : "copy");
|
|
135
|
+
function callValue(read) {
|
|
136
|
+
try {
|
|
137
|
+
return read();
|
|
138
|
+
} catch (error) {
|
|
139
|
+
return Promise.reject(error);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return (_ctx, _cache) => {
|
|
143
|
+
return openBlock(), createBlock(unref(Button), {
|
|
144
|
+
ref_key: "root",
|
|
145
|
+
ref: root,
|
|
146
|
+
"data-slot": "copy-button",
|
|
147
|
+
"data-variant": __props.variant,
|
|
148
|
+
"data-size": __props.size,
|
|
149
|
+
"data-copied": unref(copied) ? "" : void 0,
|
|
150
|
+
"data-loading": loading.value ? "" : void 0,
|
|
151
|
+
"aria-label": name.value,
|
|
152
|
+
disabled: __props.disabled || loading.value,
|
|
153
|
+
onClick,
|
|
154
|
+
onFocus: startPreload,
|
|
155
|
+
onPointerenter: startPreload
|
|
156
|
+
}, {
|
|
157
|
+
render: withCtx(({ props: part, children }) => [createElementVNode("button", mergeProps(part, { "data-slot": "copy-button" }), [(openBlock(), createBlock(resolveDynamicComponent(children)))], 16)]),
|
|
158
|
+
default: withCtx(() => [createVNode(unref(SwapIcon_default), {
|
|
159
|
+
name: icon.value,
|
|
160
|
+
enter: icon.value === "copy" ? "blur" : "draw"
|
|
161
|
+
}, {
|
|
162
|
+
default: withCtx(({ name: shown }) => [shown === "loading" ? (openBlock(), createBlock(unref(LoaderCircle), {
|
|
163
|
+
key: 0,
|
|
164
|
+
"data-slot": "copy-button-icon",
|
|
165
|
+
"data-copy-button-loader": "",
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
})) : shown === "copied" ? renderSlot(_ctx.$slots, "copied-icon", {}, () => [createVNode(unref(Check), {
|
|
168
|
+
"data-slot": "copy-button-icon",
|
|
169
|
+
"aria-hidden": "true"
|
|
170
|
+
})], void 0, 1) : renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(unref(Copy), {
|
|
171
|
+
"data-slot": "copy-button-icon",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
})], void 0, 2)]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 8, ["name", "enter"]), __props.label || unref(slots).default ? (openBlock(), createElementBlock("span", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(unref(MorphText_default), { text: unref(copied) ? __props.copiedLabel : __props.label ?? "" }, null, 8, ["text"])])])) : createCommentVNode("v-if", true)]),
|
|
176
|
+
_: 3
|
|
177
|
+
}, 8, [
|
|
178
|
+
"data-variant",
|
|
179
|
+
"data-size",
|
|
180
|
+
"data-copied",
|
|
181
|
+
"data-loading",
|
|
182
|
+
"aria-label",
|
|
183
|
+
"disabled"
|
|
184
|
+
]);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
export { useCopy as n, CopyButton_default as t };
|
|
@@ -17,7 +17,7 @@ var Markdown_default = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
setup(__props) {
|
|
18
18
|
const props = __props;
|
|
19
19
|
const MarkdownRenderer = defineAsyncComponent(() => import("./markdown.js").then((module) => module.MarkdownRenderer));
|
|
20
|
-
const MarkdownCodeBlock = defineAsyncComponent(() => import("./MarkdownCodeBlock-
|
|
20
|
+
const MarkdownCodeBlock = defineAsyncComponent(() => import("./MarkdownCodeBlock-CALGW0iw.js"));
|
|
21
21
|
const MarkdownImage = defineAsyncComponent(() => import("./MarkdownImage-CJN3myt4.js").then((n) => n.n));
|
|
22
22
|
const instance = getCurrentInstance();
|
|
23
23
|
const hasParentSuspense = Boolean(instance && "suspense" in instance && instance.suspense);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CodeBlockLine_default, r as CodeBlock_default, t as CodeBlockContent_default } from "./CodeBlockContent-BjXJm8lO.js";
|
|
2
|
-
import { i as CodeBlockActions_default, n as CodeBlockHeader_default, r as CodeBlockCopyButton_default, t as CodeBlockTitle_default } from "./CodeBlockTitle-
|
|
2
|
+
import { i as CodeBlockActions_default, n as CodeBlockHeader_default, r as CodeBlockCopyButton_default, t as CodeBlockTitle_default } from "./CodeBlockTitle-DX13mCTi.js";
|
|
3
3
|
import { Comment, Fragment, Text, computed, createBlock, createTextVNode, createVNode, defineComponent, h, isVNode, normalizeClass, openBlock, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
4
4
|
// registry/markdown/MarkdownCodeBlock.vue
|
|
5
5
|
var MarkdownCodeBlock_default = /* @__PURE__ */ defineComponent({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessagePartsRenderer } from "./message-parts.js";
|
|
2
|
-
import { t as Markdown_default } from "./Markdown-
|
|
2
|
+
import { t as Markdown_default } from "./Markdown-3-Tvy5Kl.js";
|
|
3
3
|
import { t as MarkdownImage_default } from "./MarkdownImage-CJN3myt4.js";
|
|
4
4
|
import { createBlock, createCommentVNode, createSlots, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderList, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
5
5
|
// registry/message-parts/MessageParts.vue
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as morphText } from "./motion-core-
|
|
1
|
+
import { b as morphText } from "./motion-core-pkL0M4Y1.js";
|
|
2
2
|
import { t as elementOf } from "./element-BpjNQvZ0.js";
|
|
3
3
|
import { createElementVNode, createTextVNode, defineComponent, mergeProps, renderSlot, toDisplayString, unref, watch } from "vue";
|
|
4
4
|
// registry/motion/MorphText.vue
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as rollNumber } from "./motion-core-
|
|
1
|
+
import { o as rollNumber } from "./motion-core-pkL0M4Y1.js";
|
|
2
2
|
import { t as elementOf } from "./element-BpjNQvZ0.js";
|
|
3
3
|
import { createElementVNode, createTextVNode, defineComponent, mergeProps, renderSlot, shallowRef, toDisplayString, unref, watch } from "vue";
|
|
4
4
|
// registry/motion/RollNumber.vue
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { x as swapIcon } from "./motion-core-BdTfxAhY.js";
|
|
1
|
+
import { x as swapIcon } from "./motion-core-pkL0M4Y1.js";
|
|
3
2
|
import { Fragment, createCommentVNode, createElementBlock, defineComponent, mergeProps, nextTick, openBlock, ref, renderList, renderSlot, useTemplateRef, watch } from "vue";
|
|
4
3
|
// registry/motion/SwapIcon.vue?vue&type=script&setup=true&lang.ts
|
|
5
4
|
const _hoisted_1 = ["data-icon-key", "data-spin"];
|
|
@@ -65,12 +64,4 @@ var SwapIcon_default = /* @__PURE__ */ defineComponent({
|
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* `v-ring="done"` rings the element once each time `done` becomes true, for a finished action such as saved or copied.
|
|
71
|
-
* `createViteHubUI()` registers it as `v-ring`.
|
|
72
|
-
*/
|
|
73
|
-
const vRing = { updated(element, binding) {
|
|
74
|
-
if (binding.value && !binding.oldValue) ring(element);
|
|
75
|
-
} };
|
|
76
|
-
export { SwapIcon_default as n, vRing as t };
|
|
67
|
+
export { SwapIcon_default as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Markdown_default } from "./Markdown-
|
|
1
|
+
import { t as Markdown_default } from "./Markdown-3-Tvy5Kl.js";
|
|
2
2
|
import { Comment, Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, isVNode, mergeProps, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useId, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
3
3
|
import { Bot, Brain, ChevronDown, CircleX, FilePenLine, FileText, Globe, ListChecks, Maximize2, Minimize2, PanelRight, Plug, Plus, Search, Sparkles, SquareMenu, Terminal, Wrench, X } from "@lucide/vue";
|
|
4
4
|
import { Tabs, TabsList, TabsPanel, TabsTab } from "@ui-sdk/vue/tabs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as RollNumber_default } from "./RollNumber-
|
|
1
|
+
import { t as RollNumber_default } from "./RollNumber-CkdLiy2i.js";
|
|
2
2
|
import { Fragment, computed, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeStyle, openBlock, renderList, toDisplayString, unref } from "vue";
|
|
3
3
|
// registry/avatar-stack/initials.ts
|
|
4
4
|
function initials(name) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Chat_default } from "./Chat-
|
|
1
|
+
import { t as Chat_default } from "./Chat-DYQitDw8.js";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
3
3
|
// registry/chat-session/ChatSession.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["aria-label", "data-session-id"];
|