@vite-hub/ui 0.3.1 → 0.4.1

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.
Files changed (71) hide show
  1. package/README.md +5 -5
  2. package/dist/{avatar-stack-DXmCQhxd.d.ts → avatar-stack-DPRFuezh.d.ts} +1 -1
  3. package/dist/{code-view-D0bqhogi.js → code-view-DsU-xzic.js} +4 -4
  4. package/dist/comment-attachments-C4yNbcx5.js +20 -0
  5. package/dist/{comment-composer-Cc8Jvu6u.d.ts → comment-composer-fINL5bxo.d.ts} +3 -3
  6. package/dist/{comment-layer-ClH4MLj4.d.ts → comment-layer-C_sbPIR5.d.ts} +18 -7
  7. package/dist/{comment-list-B8hphLfS.d.ts → comment-list-BcSaLngS.d.ts} +3 -3
  8. package/dist/{comment-panel-fcKSKwLC.d.ts → comment-panel-CfvdRUMX.d.ts} +16 -5
  9. package/dist/{comment-pin-CvwgRSDR.d.ts → comment-pin-DHOdRvUw.d.ts} +1 -1
  10. package/dist/{comment-row-Bbm9WwuF.js → comment-row-Bn3nr8l5.js} +1 -1
  11. package/dist/comment-selection-bar-CyVBNYl9.d.ts +42 -0
  12. package/dist/{comment-thread-CoTLrdal.d.ts → comment-thread-DKJjmWN0.d.ts} +23 -6
  13. package/dist/{comments-CkWc2Khc.js → comments-D0d26ghV.js} +65 -9
  14. package/dist/{comments-Bx2WRsYy.d.ts → comments-D8hulVPy.d.ts} +34 -6
  15. package/dist/format-orwcdZL_.js +39 -0
  16. package/dist/headless.d.ts +3 -3
  17. package/dist/headless.js +1 -1
  18. package/dist/{index-BD1e8vx5.d.ts → index-BYRFQfCd.d.ts} +6 -0
  19. package/dist/index.d.ts +13 -12
  20. package/dist/index.js +4 -3
  21. package/dist/{markdown-editor-DqdZfIEn.d.ts → markdown-editor-wQF0yD5o.d.ts} +1 -1
  22. package/dist/markdown-editor.d.ts +1 -1
  23. package/dist/{message-scroller-Bm1YWTeY.d.ts → message-scroller-jrYN9dG9.d.ts} +2 -2
  24. package/dist/nuxt.d.ts +1 -1
  25. package/dist/nuxt.js +8 -2
  26. package/dist/parts/components/attachment.d.ts +1 -1
  27. package/dist/parts/components/avatar-stack.d.ts +1 -1
  28. package/dist/parts/components/avatar-stack.js +1 -1
  29. package/dist/parts/components/bubble.d.ts +1 -1
  30. package/dist/parts/components/chat-session.d.ts +1 -1
  31. package/dist/parts/components/code-block.d.ts +1 -1
  32. package/dist/parts/components/code-view.js +1 -1
  33. package/dist/parts/components/comment-composer.d.ts +1 -1
  34. package/dist/parts/components/comment-layer.d.ts +1 -1
  35. package/dist/parts/components/comment-layer.js +32 -19
  36. package/dist/parts/components/comment-list.d.ts +1 -1
  37. package/dist/parts/components/comment-list.js +3 -2
  38. package/dist/parts/components/comment-panel.d.ts +1 -1
  39. package/dist/parts/components/comment-panel.js +24 -12
  40. package/dist/parts/components/comment-pin.d.ts +1 -1
  41. package/dist/parts/components/comment-pin.js +1 -1
  42. package/dist/parts/components/comment-selection-bar.d.ts +2 -0
  43. package/dist/parts/components/comment-selection-bar.js +116 -0
  44. package/dist/parts/components/comment-thread.d.ts +2 -2
  45. package/dist/parts/components/comment-thread.js +33 -6
  46. package/dist/parts/components/comments.d.ts +8 -7
  47. package/dist/parts/components/comments.js +3 -2
  48. package/dist/parts/components/copy-button.d.ts +1 -1
  49. package/dist/parts/components/device-frame.d.ts +2 -2
  50. package/dist/parts/components/markdown-editor.d.ts +1 -1
  51. package/dist/parts/components/marker.d.ts +1 -1
  52. package/dist/parts/components/prompt-input.d.ts +3 -3
  53. package/dist/parts/components/tool-list.d.ts +1 -1
  54. package/dist/parts/components/trace-run.d.ts +1 -1
  55. package/dist/parts/components/trace-run.js +1 -1
  56. package/dist/parts/components/trace.d.ts +1 -1
  57. package/dist/parts/headless/comments.d.ts +2 -2
  58. package/dist/parts/headless/comments.js +1 -1
  59. package/dist/parts/headless/message-scroller.d.ts +1 -1
  60. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  61. package/dist/parts/workspace/connect-panel.d.ts +1 -1
  62. package/dist/parts/workspace/playground-container.d.ts +2 -2
  63. package/dist/parts/workspace/workspace-boot-status.js +1 -1
  64. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  65. package/dist/{pierre-code-view-xgBL6DO7.js → pierre-code-view-NE35tkmR.js} +37 -17
  66. package/dist/styles.css +119 -1
  67. package/dist/{types-Dyr6CfBW.d.ts → types-Dj7vp0lZ.d.ts} +1 -1
  68. package/dist/workspace.d.ts +1 -1
  69. package/dist/workspace.js +1 -1
  70. package/package.json +7 -7
  71. package/dist/format-Du58PlsG.js +0 -18
package/dist/styles.css CHANGED
@@ -443,6 +443,10 @@
443
443
  --vh-primitive-icon-motion: translateX(1.5px);
444
444
  }
445
445
 
446
+ .vh-primitive-icon[data-icon="cli"] {
447
+ --vh-primitive-icon-opacity: 0;
448
+ }
449
+
446
450
  .vh-primitive-icon[data-icon="cms"] {
447
451
  --vh-primitive-icon-motion: translate(-1px, -1px);
448
452
  }
@@ -463,6 +467,10 @@
463
467
  --vh-primitive-icon-motion: translateY(1.5px);
464
468
  }
465
469
 
470
+ .vh-primitive-icon[data-icon="console"] {
471
+ --vh-primitive-icon-motion: translateX(1px);
472
+ }
473
+
466
474
  .vh-primitive-icon[data-icon="content"] {
467
475
  --vh-primitive-icon-motion: translateX(1.5px);
468
476
  }
@@ -471,7 +479,7 @@
471
479
  --vh-primitive-icon-motion: translateY(-1.5px);
472
480
  }
473
481
 
474
- .vh-primitive-icon[data-icon="decisions"] {
482
+ .vh-primitive-icon[data-icon="choices"] {
475
483
  --vh-primitive-icon-motion: translate(1px, -1px);
476
484
  }
477
485
 
@@ -529,6 +537,14 @@
529
537
  --vh-primitive-icon-motion: translateY(-1px);
530
538
  }
531
539
 
540
+ .vh-primitive-icon[data-icon="markdown-template"] {
541
+ --vh-primitive-icon-motion: translateY(1.5px);
542
+ }
543
+
544
+ .vh-primitive-icon[data-icon="presets"] {
545
+ --vh-primitive-icon-motion: translate(-1px, -1px);
546
+ }
547
+
532
548
  .vh-primitive-icon[data-icon="queue"] {
533
549
  --vh-primitive-icon-motion: translateX(2px);
534
550
  }
@@ -547,6 +563,10 @@
547
563
  --vh-primitive-icon-motion: translateX(1.5px);
548
564
  }
549
565
 
566
+ .vh-primitive-icon[data-icon="runtime"] {
567
+ --vh-primitive-icon-motion: scale(0.6);
568
+ }
569
+
550
570
  .vh-primitive-icon[data-icon="sandbox"] {
551
571
  --vh-primitive-icon-motion: scale(0.7);
552
572
  }
@@ -2132,6 +2152,104 @@
2132
2152
  top: -0.4rem;
2133
2153
  }
2134
2154
 
2155
+ /* The bar over selected text: a flat surface in the ink color, so it is dark on a light page and light on a dark one.
2156
+ It floats over any page, such as in the ViteHub pill's shadow root, so its sizes are in px and do not follow the
2157
+ page's root font size: the page places it by its fixed 38px height. */
2158
+ [data-slot="comment-selection-bar"] {
2159
+ --vh-selection-bar-text: color-mix(in oklab, var(--vh-inverted) 82%, var(--vh-highlighted));
2160
+ align-items: center;
2161
+ animation: vh-comment-selection-bar-in 140ms cubic-bezier(0.23, 1, 0.32, 1);
2162
+ background: var(--vh-highlighted);
2163
+ border: 1px solid color-mix(in oklab, var(--vh-inverted) 12%, transparent);
2164
+ border-radius: 12px;
2165
+ box-shadow: 0 8px 24px color-mix(in oklab, black 25%, transparent);
2166
+ display: flex;
2167
+ font-size: 12px;
2168
+ font-weight: 500;
2169
+ -webkit-font-smoothing: antialiased;
2170
+ gap: 4px;
2171
+ line-height: 1;
2172
+ padding: 4px;
2173
+ transform-origin: 50% 100%;
2174
+ width: max-content;
2175
+ }
2176
+
2177
+ [data-slot="comment-selection-bar"][data-side="bottom"] {
2178
+ transform-origin: 50% 0;
2179
+ }
2180
+
2181
+ [data-slot="comment-selection-bar-action"] {
2182
+ align-items: center;
2183
+ background: none;
2184
+ border: 0;
2185
+ border-radius: 8px;
2186
+ color: var(--vh-selection-bar-text);
2187
+ cursor: pointer;
2188
+ display: inline-flex;
2189
+ font: inherit;
2190
+ gap: 6px;
2191
+ height: 28px;
2192
+ padding: 0 10px;
2193
+ position: relative;
2194
+ touch-action: manipulation;
2195
+ transition-duration: 150ms;
2196
+ transition-property: background-color, color, scale;
2197
+ transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
2198
+ white-space: nowrap;
2199
+ }
2200
+
2201
+ /* 28px to sit in the bar, with a 44px hit area for fingers. The 4px gap keeps the hit areas of two buttons apart. */
2202
+ [data-slot="comment-selection-bar-action"]::before {
2203
+ content: "";
2204
+ inset: -8px -2px;
2205
+ position: absolute;
2206
+ }
2207
+
2208
+ [data-slot="comment-selection-bar-action"] > :first-child {
2209
+ flex: none;
2210
+ height: 14px;
2211
+ width: 14px;
2212
+ }
2213
+
2214
+ /* Only a real pointer hovers, so a tap does not leave the button lit. */
2215
+ @media (hover: hover) and (pointer: fine) {
2216
+ [data-slot="comment-selection-bar-action"]:hover {
2217
+ background: color-mix(in oklab, var(--vh-inverted) 8%, transparent);
2218
+ color: var(--vh-inverted);
2219
+ }
2220
+ }
2221
+
2222
+ [data-slot="comment-selection-bar-action"]:active {
2223
+ scale: 0.96;
2224
+ }
2225
+
2226
+ [data-slot="comment-selection-bar-kbd"] {
2227
+ font: inherit;
2228
+ margin-inline-start: 6px;
2229
+ opacity: 0.6;
2230
+ }
2231
+
2232
+ @keyframes vh-comment-selection-bar-in {
2233
+ from {
2234
+ opacity: 0;
2235
+ scale: 0.96;
2236
+ }
2237
+ }
2238
+
2239
+ @media (prefers-reduced-motion: reduce) {
2240
+ [data-slot="comment-selection-bar"] {
2241
+ animation: none;
2242
+ }
2243
+
2244
+ [data-slot="comment-selection-bar-action"] {
2245
+ transition-property: background-color, color;
2246
+ }
2247
+
2248
+ [data-slot="comment-selection-bar-action"]:active {
2249
+ scale: none;
2250
+ }
2251
+ }
2252
+
2135
2253
  /* Floating surfaces take the layered shadow of the theme, which draws their hairline too. Without the theme, the hairline stays. */
2136
2254
  [data-slot="comment-layer-popover"] {
2137
2255
  --vh-comment-card-width: 22.5rem;
@@ -1,4 +1,4 @@
1
- import "./index-BD1e8vx5.js";
1
+ import "./index-BYRFQfCd.js";
2
2
  import { UIDataTypes, UIMessage, UITools } from "ai";
3
3
  //#region src/types.d.ts
4
4
  type ViteHubUIMessage<Metadata = unknown, DataParts extends UIDataTypes = UIDataTypes, Tools extends UITools = UITools> = UIMessage<Metadata, DataParts, Tools>;
@@ -9,7 +9,7 @@ import { WorkspaceFileTree } from "./parts/workspace/workspace-file-tree.js";
9
9
  import { WorkspacePreview, WorkspacePreviewDevice, workspacePreviewScript } from "./parts/workspace/workspace-preview.js";
10
10
  import { WorkspaceTerminal, WorkspaceTerminalOutput } from "./parts/workspace/workspace-terminal.js";
11
11
  //#region src/internal/format.d.ts
12
- /** "320 ms", "1.2 s", "30 s", or "1 min 35 s". Seconds round down, so a running counter never shows "60 s". */
12
+ /** "320ms", "1.2s", "30s", or "1m 35s". Seconds round down, so a running counter never shows "60s". */
13
13
  declare function formatDuration(ms: number): string;
14
14
  //#endregion
15
15
  export { type BootStepState, type BootStepView, BrowserSupportNotice, ConnectPanel, ConnectProviderRow, type ConnectProviderState, type ConnectProviderStatus, type ConnectStore, PlaygroundContainer, type PlaygroundContainerTemplate, type PlaygroundContext, type PlaygroundDevice, type UnsupportedBrowser, type UseConnectStoreOptions, WorkspaceBootStatus, WorkspaceEditor, WorkspaceFileTree, type WorkspaceLayout, WorkspacePreview, type WorkspacePreviewDevice, WorkspaceShell, type WorkspaceSplits, type WorkspaceTab, type WorkspaceTabItem, WorkspaceTerminal, type WorkspaceTerminalOutput, bootChecklist, connectProviderLabel, detectUnsupportedBrowser, formatDuration as formatElapsed, useConnectStore, usePlaygroundDevice, workspacePreviewScript };
package/dist/workspace.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as formatDuration } from "./format-Du58PlsG.js";
1
+ import { t as formatDuration } from "./format-orwcdZL_.js";
2
2
  import { BrowserSupportNotice, detectUnsupportedBrowser } from "./parts/workspace/browser-support-notice.js";
3
3
  import { ConnectPanel, ConnectProviderRow, connectProviderLabel } from "./parts/workspace/connect-panel.js";
4
4
  import { useConnectStore } from "./parts/workspace/connect-store.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/ui",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "AI interface primitives for Vue and Nuxt.",
5
5
  "keywords": [
6
6
  "ai",
@@ -88,7 +88,7 @@
88
88
  "@shikijs/langs": "4.5.0",
89
89
  "@shikijs/themes": "4.5.0",
90
90
  "@types/node": "^24.19.1",
91
- "@vite-hub/comments": "0.3.1",
91
+ "@vite-hub/comments": "0.4.1",
92
92
  "@ui-sdk/core": "0.1.0-beta.5",
93
93
  "@ui-sdk/vue": "0.1.0-beta.5",
94
94
  "nostics": "1.4.0",
@@ -108,7 +108,7 @@
108
108
  "@codemirror/state": "6.7.6",
109
109
  "@codemirror/view": "6.43.15",
110
110
  "@lezer/highlight": "1.2.5",
111
- "@vite-hub/web-container": "0.3.1",
111
+ "@vite-hub/web-container": "0.4.1",
112
112
  "@xterm/addon-fit": "0.11.0",
113
113
  "@xterm/xterm": "6.0.0"
114
114
  },
@@ -127,7 +127,7 @@
127
127
  "@vitejs/plugin-vue": "^6.0.10",
128
128
  "@vite-hub/icons": "0.1.0",
129
129
  "@vite-hub/internal": "0.0.1",
130
- "@vite-hub/runtime": "0.3.1",
130
+ "@vite-hub/runtime": "0.4.1",
131
131
  "@vue/server-renderer": "3.5.44",
132
132
  "@vue/test-utils": "2.5.1",
133
133
  "ai": "7.0.130",
@@ -143,7 +143,7 @@
143
143
  "vue": "3.5.44",
144
144
  "@types/markdown-it": "^14.2.0",
145
145
  "comark-ui": "^0.12.0",
146
- "@vite-hub/content": "0.3.1",
146
+ "@vite-hub/content": "0.4.1",
147
147
  "playwright-core": "^1.63.0",
148
148
  "@tiptap/core": "^3.31.4",
149
149
  "@tiptap/extension-drag-handle": "3.23.6",
@@ -154,7 +154,7 @@
154
154
  "@tiptap/pm": "^3.31.4",
155
155
  "@tiptap/starter-kit": "^3.31.4",
156
156
  "@tiptap/vue-3": "3.31.4",
157
- "@vite-hub/blob": "0.3.1"
157
+ "@vite-hub/blob": "0.4.1"
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@floating-ui/dom": "^1.0.0",
@@ -215,7 +215,7 @@
215
215
  }
216
216
  },
217
217
  "engines": {
218
- "node": ">=22.22.0"
218
+ "node": ">=24.15.0"
219
219
  },
220
220
  "scripts": {
221
221
  "bench:headless": "node scripts/headless-weight.ts",
@@ -1,18 +0,0 @@
1
- //#region src/internal/format.ts
2
- /** "320 ms", "1.2 s", "30 s", or "1 min 35 s". Seconds round down, so a running counter never shows "60 s". */
3
- function formatDuration(ms) {
4
- if (ms < 1e3) return `${Math.round(ms)} ms`;
5
- const seconds = ms / 1e3;
6
- if (seconds < 10) return `${seconds.toFixed(1)} s`;
7
- if (seconds < 60) return `${Math.floor(seconds)} s`;
8
- return `${Math.floor(seconds / 60)} min ${Math.floor(seconds % 60)} s`;
9
- }
10
- /** Two letters for an avatar without an image: `Ana Lopez` and `ana.lopez@vitehub.dev` are `AL`, `Ana` is `AN`. */
11
- function initials(name) {
12
- const words = name.replace(/@.*/, "").trim().split(/[\s._-]+/).filter(Boolean);
13
- const first = words[0] ?? "";
14
- const second = words.length > 1 ? words.at(-1) ?? "" : first.slice(1);
15
- return (first.slice(0, 1) + second.slice(0, 1)).toUpperCase() || "?";
16
- }
17
- //#endregion
18
- export { initials as n, formatDuration as t };