@vite-hub/ui 0.4.1 → 0.5.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.
Files changed (175) hide show
  1. package/README.md +102 -76
  2. package/dist/announce-Cy_Tn9wW.js +32 -0
  3. package/dist/{avatar-stack-DPRFuezh.d.ts → avatar-stack-DXmCQhxd.d.ts} +1 -1
  4. package/dist/{comment-composer-jYv2ULNP.js → comment-composer-D7ZytyER.js} +257 -10
  5. package/dist/{comment-composer-fINL5bxo.d.ts → comment-composer-DvKMTrAi.d.ts} +4 -4
  6. package/dist/{comment-layer-C_sbPIR5.d.ts → comment-layer-GTsLdABl.d.ts} +4 -4
  7. package/dist/{comment-list-BcSaLngS.d.ts → comment-list-BI96empx.d.ts} +2 -2
  8. package/dist/comment-marks.css +18 -22
  9. package/dist/{comment-panel-CfvdRUMX.d.ts → comment-panel-CsKWTms_.d.ts} +2 -2
  10. package/dist/{comment-pin-DHOdRvUw.d.ts → comment-pin-CvwgRSDR.d.ts} +1 -1
  11. package/dist/{comment-row-Bn3nr8l5.js → comment-row-JmTC0uXr.js} +1 -1
  12. package/dist/comment-send-7bg4NEEM.js +277 -0
  13. package/dist/comment-send-C45dHC22.d.ts +25 -0
  14. package/dist/comment-send.css +267 -0
  15. package/dist/comment-thread-B_Sc2QX6.js +797 -0
  16. package/dist/{comment-thread-DKJjmWN0.d.ts → comment-thread-C6U-bsK_.d.ts} +4 -4
  17. package/dist/{comments-D0d26ghV.js → comments-B88zg9gC.js} +1 -1
  18. package/dist/{comments-context-C2lOZyQ5.js → comments-context-DhbIdYQ1.js} +2 -1
  19. package/dist/{config-Dk67emQt.js → config-B1u7zqMB.js} +8 -1
  20. package/dist/{config-DgxBW013.d.ts → config-pHazYdq6.d.ts} +11 -0
  21. package/dist/drop-field-3CDRFFRm.js +163 -0
  22. package/dist/{editor-C_wt4RRV.js → editor-BHYGLgty.js} +42 -3
  23. package/dist/effects-Ql6VzCRa.js +2971 -0
  24. package/dist/headless.d.ts +1 -1
  25. package/dist/headless.js +1 -1
  26. package/dist/hold-to-delete-DjWzRDyY.d.ts +51 -0
  27. package/dist/hold-to-delete-ROLQRZg_.js +434 -0
  28. package/dist/icon-c5Jb_Tl7.d.ts +31 -0
  29. package/dist/{image-preview-C9tdkmEj.js → image-preview-BigoAvb3.js} +2 -2
  30. package/dist/{index-BYRFQfCd.d.ts → index-YUvL2nV8.d.ts} +8 -10
  31. package/dist/index.d.ts +19 -14
  32. package/dist/index.js +45 -44
  33. package/dist/install-D5f6msEU.js +17 -0
  34. package/dist/list-RCbNZ14q.js +271 -0
  35. package/dist/{markdown-editor-CMbNZOdN.js → markdown-editor-Dfl2DgPS.js} +1 -1
  36. package/dist/markdown-editor.js +1 -1
  37. package/dist/{message-scroller-jrYN9dG9.d.ts → message-scroller-Bm1YWTeY.d.ts} +2 -2
  38. package/dist/motion/core.d.ts +4 -0
  39. package/dist/motion/core.js +11 -0
  40. package/dist/motion-core-lHRF8PZz.d.ts +456 -0
  41. package/dist/motion.d.ts +16 -0
  42. package/dist/motion.js +13 -0
  43. package/dist/{nuxt-ui-DSQFzq3s.js → nuxt-ui-CgvMzO5v.js} +20 -14
  44. package/dist/nuxt.d.ts +1 -1
  45. package/dist/nuxt.js +12 -3
  46. package/dist/opt-out-b6bnUjIT.js +208 -0
  47. package/dist/parts/components/agent-session.js +1 -1
  48. package/dist/parts/components/attachment.d.ts +1 -1
  49. package/dist/parts/components/attachment.js +1 -1
  50. package/dist/parts/components/avatar-stack.d.ts +1 -1
  51. package/dist/parts/components/avatar-stack.js +2 -1
  52. package/dist/parts/components/bubble.d.ts +1 -1
  53. package/dist/parts/components/chat-session.d.ts +1 -1
  54. package/dist/parts/components/chat.js +2 -2
  55. package/dist/parts/components/code-block.d.ts +1 -1
  56. package/dist/parts/components/code-block.js +1 -1
  57. package/dist/parts/components/comment-composer.d.ts +1 -1
  58. package/dist/parts/components/comment-composer.js +1 -1
  59. package/dist/parts/components/comment-layer.d.ts +1 -1
  60. package/dist/parts/components/comment-layer.js +24 -6
  61. package/dist/parts/components/comment-list.d.ts +1 -1
  62. package/dist/parts/components/comment-list.js +12 -7
  63. package/dist/parts/components/comment-panel.d.ts +1 -1
  64. package/dist/parts/components/comment-panel.js +24 -10
  65. package/dist/parts/components/comment-pin.d.ts +1 -1
  66. package/dist/parts/components/comment-selection-bar.js +3 -2
  67. package/dist/parts/components/comment-send.d.ts +2 -0
  68. package/dist/parts/components/comment-send.js +2 -0
  69. package/dist/parts/components/comment-thread.d.ts +1 -1
  70. package/dist/parts/components/comment-thread.js +2 -597
  71. package/dist/parts/components/comments.d.ts +8 -7
  72. package/dist/parts/components/comments.js +5 -4
  73. package/dist/parts/components/copy-button.d.ts +13 -3
  74. package/dist/parts/components/copy-button.js +226 -1
  75. package/dist/parts/components/device-frame.d.ts +2 -2
  76. package/dist/parts/components/drop-field.d.ts +69 -0
  77. package/dist/parts/components/drop-field.js +77 -0
  78. package/dist/parts/components/filter-search.js +1 -1
  79. package/dist/parts/components/hold-to-delete.d.ts +82 -0
  80. package/dist/parts/components/hold-to-delete.js +76 -0
  81. package/dist/parts/components/markdown-editor.js +1 -1
  82. package/dist/parts/components/markdown-renderer.js +1 -1
  83. package/dist/parts/components/markdown.js +1 -1
  84. package/dist/parts/components/marker.d.ts +1 -1
  85. package/dist/parts/components/message-parts.js +13 -5
  86. package/dist/parts/components/motion-list.d.ts +42 -0
  87. package/dist/parts/components/motion-list.js +42 -0
  88. package/dist/parts/components/motion.d.ts +124 -0
  89. package/dist/parts/components/motion.js +172 -0
  90. package/dist/parts/components/progress.d.ts +41 -0
  91. package/dist/parts/components/progress.js +54 -0
  92. package/dist/parts/components/prompt-input.d.ts +5 -5
  93. package/dist/parts/components/prompt-input.js +3 -3
  94. package/dist/parts/components/relative-time.js +1 -1
  95. package/dist/parts/components/sync-status.js +2 -1
  96. package/dist/parts/components/tool-list.d.ts +1 -1
  97. package/dist/parts/components/trace-run.d.ts +1 -1
  98. package/dist/parts/components/trace-run.js +1 -1
  99. package/dist/parts/components/trace.d.ts +1 -1
  100. package/dist/parts/headless/comments.js +1 -1
  101. package/dist/parts/headless/message-scroller.d.ts +1 -1
  102. package/dist/parts/playground/share.d.ts +36 -2
  103. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  104. package/dist/parts/workspace/browser-support-notice.js +12 -4
  105. package/dist/parts/workspace/codemirror.d.ts +9 -0
  106. package/dist/parts/workspace/codemirror.js +37 -4
  107. package/dist/parts/workspace/connect-panel.d.ts +1 -1
  108. package/dist/parts/workspace/connect-panel.js +1 -1
  109. package/dist/parts/workspace/file-icons.d.ts +16 -0
  110. package/dist/parts/workspace/file-icons.js +82 -0
  111. package/dist/parts/workspace/icons.d.ts +1 -0
  112. package/dist/parts/workspace/icons.js +1 -0
  113. package/dist/parts/workspace/runners/render.d.ts +26 -0
  114. package/dist/parts/workspace/runners/render.js +124 -0
  115. package/dist/parts/workspace/runners/web-container.d.ts +29 -0
  116. package/dist/parts/workspace/runners/web-container.js +186 -0
  117. package/dist/parts/workspace/workspace-bar.d.ts +51 -0
  118. package/dist/parts/workspace/workspace-bar.js +51 -0
  119. package/dist/parts/workspace/workspace-editor-head.d.ts +47 -0
  120. package/dist/parts/workspace/workspace-editor-head.js +66 -0
  121. package/dist/parts/workspace/workspace-editor.d.ts +17 -0
  122. package/dist/parts/workspace/workspace-editor.js +29 -3
  123. package/dist/parts/workspace/workspace-examples.d.ts +74 -0
  124. package/dist/parts/workspace/workspace-examples.js +72 -0
  125. package/dist/parts/workspace/workspace-file-link.d.ts +35 -0
  126. package/dist/parts/workspace/workspace-file-link.js +39 -0
  127. package/dist/parts/workspace/workspace-file-tree.d.ts +8 -8
  128. package/dist/parts/workspace/workspace-file-tree.js +26 -19
  129. package/dist/parts/workspace/workspace-guide.d.ts +52 -0
  130. package/dist/parts/workspace/workspace-guide.js +91 -0
  131. package/dist/parts/workspace/workspace-issues.d.ts +46 -0
  132. package/dist/parts/workspace/workspace-issues.js +49 -0
  133. package/dist/parts/workspace/workspace-preview.js +1 -1
  134. package/dist/parts/workspace/workspace-shell.d.ts +2 -88
  135. package/dist/parts/workspace/workspace-shell.js +131 -78
  136. package/dist/parts/workspace/workspace-sidebar.d.ts +75 -0
  137. package/dist/parts/workspace/workspace-sidebar.js +132 -0
  138. package/dist/parts/workspace/workspace-start.d.ts +47 -0
  139. package/dist/parts/workspace/workspace-start.js +60 -0
  140. package/dist/parts/workspace/workspace-status.d.ts +69 -0
  141. package/dist/parts/workspace/workspace-status.js +74 -0
  142. package/dist/parts/workspace/workspace-steps.d.ts +2 -0
  143. package/dist/parts/workspace/workspace-steps.js +128 -0
  144. package/dist/parts/workspace/workspace-task.d.ts +20 -0
  145. package/dist/parts/workspace/workspace-task.js +20 -0
  146. package/dist/parts/workspace/workspace.d.ts +251 -0
  147. package/dist/parts/workspace/workspace.js +665 -0
  148. package/dist/playground.d.ts +1 -1
  149. package/dist/progress-C7afI5vq.js +266 -0
  150. package/dist/registry-D3-ysX7l.js +78 -0
  151. package/dist/{relative-time-BVmjOsYG.js → relative-time-DgSS3zKN.js} +1 -1
  152. package/dist/ring-B7Qxu7zd.js +175 -0
  153. package/dist/runtime/nuxt-plugin.js +2 -2
  154. package/dist/styles.css +586 -573
  155. package/dist/text-BCJflBJf.js +826 -0
  156. package/dist/theme.d.ts +43 -0
  157. package/dist/theme.js +22 -7
  158. package/dist/travel-C87xd5Wh.js +182 -0
  159. package/dist/tween-CO24nMpf.js +62 -0
  160. package/dist/{types-Dj7vp0lZ.d.ts → types-BX64qHlV.d.ts} +1 -1
  161. package/dist/visual-copy-CrVc3z4n.js +15 -0
  162. package/dist/workspace-shell-BJGnoF3p.d.ts +112 -0
  163. package/dist/workspace-steps-Bgph2rpr.d.ts +72 -0
  164. package/dist/workspace.d.ts +16 -3
  165. package/dist/workspace.js +15 -2
  166. package/package.json +21 -10
  167. package/dist/copy-button-CRN3kmSD.js +0 -253
  168. package/dist/icon-swap.css +0 -69
  169. package/dist/parts/playground/highlight.d.ts +0 -5
  170. package/dist/parts/playground/highlight.js +0 -23
  171. package/dist/parts/playground/playground-render.d.ts +0 -126
  172. package/dist/parts/playground/playground-render.js +0 -356
  173. package/dist/parts/workspace/playground-container.d.ts +0 -192
  174. package/dist/parts/workspace/playground-container.js +0 -603
  175. package/dist/share-DM4eNy4q.d.ts +0 -37
@@ -0,0 +1,42 @@
1
+ import { t as createMotionList } from "../../list-RCbNZ14q.js";
2
+ import { defineComponent, h, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, ref } from "vue";
3
+ //#region src/components/motion-list.ts
4
+ /**
5
+ * A list whose items move with the list mover of `@vite-hub/ui/motion` (docs/design/motion.md, "Items are added,
6
+ * removed, or reordered"). Use it in place of `<TransitionGroup>`: render keyed items in its slot. When they change,
7
+ * neighbors spring to their new place, a new item grows from `origin` or from its slot, and a removed item folds away
8
+ * or leaves toward `target`.
9
+ */
10
+ const MotionList = defineComponent({
11
+ name: "MotionList",
12
+ props: {
13
+ tag: {
14
+ default: "div",
15
+ type: String
16
+ },
17
+ origin: {
18
+ default: void 0,
19
+ type: Function
20
+ },
21
+ target: {
22
+ default: void 0,
23
+ type: Function
24
+ }
25
+ },
26
+ setup(props, { slots }) {
27
+ const root = ref();
28
+ let list;
29
+ onMounted(() => {
30
+ if (root.value) list = createMotionList(root.value);
31
+ });
32
+ onBeforeUpdate(() => list?.measure());
33
+ onUpdated(() => list?.play({
34
+ origin: props.origin,
35
+ target: props.target?.()
36
+ }));
37
+ onBeforeUnmount(() => list?.destroy());
38
+ return () => h(props.tag, { ref: root }, slots.default?.());
39
+ }
40
+ });
41
+ //#endregion
42
+ export { MotionList };
@@ -0,0 +1,124 @@
1
+ import { n as IconExit, t as IconEnter } from "../../icon-c5Jb_Tl7.js";
2
+ import { Directive, PropType } from "vue";
3
+ //#region src/components/motion.d.ts
4
+ /**
5
+ * A text that changes letter by letter when `text` changes, with the width following. Use it for a label that changes
6
+ * with state outside a Nuxt UI button, such as "Copy link" to "Copied". The label of a `UButton` already morphs.
7
+ */
8
+ export declare const MorphText: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
+ text: {
10
+ required: true;
11
+ type: StringConstructor;
12
+ };
13
+ as: {
14
+ default: string;
15
+ type: StringConstructor;
16
+ };
17
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
18
+ [key: string]: any;
19
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
+ text: {
21
+ required: true;
22
+ type: StringConstructor;
23
+ };
24
+ as: {
25
+ default: string;
26
+ type: StringConstructor;
27
+ };
28
+ }>> & Readonly<{}>, {
29
+ as: string;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
31
+ /** A number whose changed digits roll when `value` changes: up when it grows, down when it shrinks. */
32
+ export declare const RollNumber: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
33
+ value: {
34
+ required: true;
35
+ type: NumberConstructor;
36
+ };
37
+ format: {
38
+ default: undefined;
39
+ type: PropType<(value: number) => string>;
40
+ };
41
+ text: {
42
+ default: undefined;
43
+ type: StringConstructor;
44
+ };
45
+ as: {
46
+ default: string;
47
+ type: StringConstructor;
48
+ };
49
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
50
+ [key: string]: any;
51
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
52
+ value: {
53
+ required: true;
54
+ type: NumberConstructor;
55
+ };
56
+ format: {
57
+ default: undefined;
58
+ type: PropType<(value: number) => string>;
59
+ };
60
+ text: {
61
+ default: undefined;
62
+ type: StringConstructor;
63
+ };
64
+ as: {
65
+ default: string;
66
+ type: StringConstructor;
67
+ };
68
+ }>> & Readonly<{}>, {
69
+ text: string;
70
+ format: (value: number) => string;
71
+ as: string;
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
73
+ /**
74
+ * An icon that swaps when `name` changes: the old icon blurs out, or leaves the way it points with `exit`, and the new
75
+ * one comes in. A spinner and a check draw their stroke with `enter: "draw"`. Set `exit` and `enter` with the new name.
76
+ * The default slot draws an icon of its own from `{ name }`, such as an inline SVG, in place of `UIcon`.
77
+ */
78
+ export declare const SwapIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
79
+ name: {
80
+ required: true;
81
+ type: StringConstructor;
82
+ };
83
+ exit: {
84
+ default: undefined;
85
+ type: PropType<IconExit>;
86
+ };
87
+ enter: {
88
+ default: undefined;
89
+ type: PropType<IconEnter>;
90
+ };
91
+ spin: {
92
+ default: boolean;
93
+ type: BooleanConstructor;
94
+ };
95
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
96
+ [key: string]: any;
97
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
98
+ name: {
99
+ required: true;
100
+ type: StringConstructor;
101
+ };
102
+ exit: {
103
+ default: undefined;
104
+ type: PropType<IconExit>;
105
+ };
106
+ enter: {
107
+ default: undefined;
108
+ type: PropType<IconEnter>;
109
+ };
110
+ spin: {
111
+ default: boolean;
112
+ type: BooleanConstructor;
113
+ };
114
+ }>> & Readonly<{}>, {
115
+ exit: IconExit;
116
+ enter: IconEnter;
117
+ spin: boolean;
118
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
119
+ /**
120
+ * `v-ring="done"` rings the element once each time `done` becomes true, for a finished action such as saved or copied.
121
+ * `createViteHubUI()` registers it as `v-ring`.
122
+ */
123
+ export declare const vRing: Directive<HTMLElement, unknown>;
124
+ //#endregion
@@ -0,0 +1,172 @@
1
+ import { r as useUIComponent } from "../../nuxt-ui-CgvMzO5v.js";
2
+ import { a as rollNumber, i as morphText, l as swapIcon } from "../../text-BCJflBJf.js";
3
+ import { t as ring } from "../../ring-B7Qxu7zd.js";
4
+ import { defineComponent, h, nextTick, ref, watch } from "vue";
5
+ //#region src/components/motion.ts
6
+ /**
7
+ * A text that changes letter by letter when `text` changes, with the width following. Use it for a label that changes
8
+ * with state outside a Nuxt UI button, such as "Copy link" to "Copied". The label of a `UButton` already morphs.
9
+ */
10
+ const MorphText = defineComponent({
11
+ name: "MorphText",
12
+ props: {
13
+ text: {
14
+ required: true,
15
+ type: String
16
+ },
17
+ as: {
18
+ default: "span",
19
+ type: String
20
+ }
21
+ },
22
+ setup(props) {
23
+ const element = ref();
24
+ let tag = props.as;
25
+ let seed = props.text;
26
+ watch(() => props.text, (text) => {
27
+ if (element.value) morphText(element.value, text);
28
+ }, { flush: "post" });
29
+ return () => {
30
+ if (tag !== props.as) {
31
+ tag = props.as;
32
+ seed = props.text;
33
+ }
34
+ return h(tag, {
35
+ "ref": element,
36
+ "data-slot": "morph-text"
37
+ }, seed);
38
+ };
39
+ }
40
+ });
41
+ /** A number whose changed digits roll when `value` changes: up when it grows, down when it shrinks. */
42
+ const RollNumber = defineComponent({
43
+ name: "RollNumber",
44
+ props: {
45
+ value: {
46
+ required: true,
47
+ type: Number
48
+ },
49
+ format: {
50
+ default: void 0,
51
+ type: Function
52
+ },
53
+ text: {
54
+ default: void 0,
55
+ type: String
56
+ },
57
+ as: {
58
+ default: "span",
59
+ type: String
60
+ }
61
+ },
62
+ setup(props) {
63
+ const element = ref();
64
+ const format = (value) => props.text ?? (props.format ?? String)(value);
65
+ let tag = props.as;
66
+ let seed = format(props.value);
67
+ watch(() => [
68
+ element.value,
69
+ props.value,
70
+ props.text,
71
+ props.format
72
+ ], ([root, value]) => {
73
+ if (root) rollNumber(root, value, format);
74
+ }, { flush: "post" });
75
+ return () => {
76
+ if (tag !== props.as) {
77
+ tag = props.as;
78
+ seed = format(props.value);
79
+ }
80
+ return h(tag, {
81
+ "ref": element,
82
+ "data-slot": "roll-number",
83
+ "style": { fontVariantNumeric: "tabular-nums" }
84
+ }, seed);
85
+ };
86
+ }
87
+ });
88
+ /**
89
+ * An icon that swaps when `name` changes: the old icon blurs out, or leaves the way it points with `exit`, and the new
90
+ * one comes in. A spinner and a check draw their stroke with `enter: "draw"`. Set `exit` and `enter` with the new name.
91
+ * The default slot draws an icon of its own from `{ name }`, such as an inline SVG, in place of `UIcon`.
92
+ */
93
+ const SwapIcon = defineComponent({
94
+ name: "SwapIcon",
95
+ props: {
96
+ name: {
97
+ required: true,
98
+ type: String
99
+ },
100
+ exit: {
101
+ default: void 0,
102
+ type: String
103
+ },
104
+ enter: {
105
+ default: void 0,
106
+ type: String
107
+ },
108
+ spin: {
109
+ default: false,
110
+ type: Boolean
111
+ }
112
+ },
113
+ setup(props, { attrs, slots }) {
114
+ const UIcon = useUIComponent("UIcon");
115
+ const container = ref();
116
+ let next = 0;
117
+ const icons = ref([{
118
+ key: next++,
119
+ name: props.name,
120
+ spin: props.spin
121
+ }]);
122
+ watch(() => [props.name, props.spin], async ([name, spin]) => {
123
+ const key = next++;
124
+ icons.value = [...icons.value, {
125
+ key,
126
+ name,
127
+ spin
128
+ }];
129
+ await nextTick();
130
+ const element = container.value?.querySelector(`[data-icon-key="${key}"]`);
131
+ if (!container.value || !element) return;
132
+ swapIcon(container.value, element, {
133
+ exit: props.exit,
134
+ enter: props.enter,
135
+ onRemove: (old) => {
136
+ const gone = Number(old.getAttribute("data-icon-key"));
137
+ icons.value = icons.value.filter((icon) => icon.key !== gone);
138
+ }
139
+ });
140
+ });
141
+ return () => {
142
+ const { class: iconClass, ...rest } = attrs;
143
+ return h("span", {
144
+ "data-slot": "swap-icon",
145
+ ...rest,
146
+ "ref": container,
147
+ "aria-hidden": "true",
148
+ "style": {
149
+ display: "inline-flex",
150
+ flexShrink: 0
151
+ }
152
+ }, icons.value.map((icon) => h("span", {
153
+ "key": icon.key,
154
+ "data-icon-key": icon.key,
155
+ "style": { display: "inline-flex" }
156
+ }, [slots.default?.({ name: icon.name }) ?? h(UIcon, {
157
+ name: icon.name,
158
+ class: [iconClass, icon.spin && "animate-spin"]
159
+ })])));
160
+ };
161
+ },
162
+ inheritAttrs: false
163
+ });
164
+ /**
165
+ * `v-ring="done"` rings the element once each time `done` becomes true, for a finished action such as saved or copied.
166
+ * `createViteHubUI()` registers it as `v-ring`.
167
+ */
168
+ const vRing = { updated(element, binding) {
169
+ if (binding.value && !binding.oldValue) ring(element);
170
+ } };
171
+ //#endregion
172
+ export { MorphText, RollNumber, SwapIcon, vRing };
@@ -0,0 +1,41 @@
1
+ import { PropType } from "vue";
2
+ //#region src/components/progress.d.ts
3
+ /**
4
+ * The progress of work that runs, such as an upload, a deploy, or a sync, with the progress helper of
5
+ * `@vite-hub/ui/motion` (docs/design/motion.md, "Work runs"). A `value` from 0 to 1 fills the bar with a head at its
6
+ * end, `null` shows a wave while work runs with no known total, and `done` draws a dot into a check.
7
+ */
8
+ export declare const Progress: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
+ value: {
10
+ default: undefined;
11
+ type: PropType<number | null>;
12
+ };
13
+ done: {
14
+ default: boolean;
15
+ type: BooleanConstructor;
16
+ };
17
+ label: {
18
+ default: undefined;
19
+ type: StringConstructor;
20
+ };
21
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ value: {
25
+ default: undefined;
26
+ type: PropType<number | null>;
27
+ };
28
+ done: {
29
+ default: boolean;
30
+ type: BooleanConstructor;
31
+ };
32
+ label: {
33
+ default: undefined;
34
+ type: StringConstructor;
35
+ };
36
+ }>> & Readonly<{}>, {
37
+ done: boolean;
38
+ label: string;
39
+ value: number | null;
40
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
41
+ //#endregion
@@ -0,0 +1,54 @@
1
+ import { t as createProgress } from "../../progress-C7afI5vq.js";
2
+ import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from "vue";
3
+ //#region src/components/progress.ts
4
+ /**
5
+ * The progress of work that runs, such as an upload, a deploy, or a sync, with the progress helper of
6
+ * `@vite-hub/ui/motion` (docs/design/motion.md, "Work runs"). A `value` from 0 to 1 fills the bar with a head at its
7
+ * end, `null` shows a wave while work runs with no known total, and `done` draws a dot into a check.
8
+ */
9
+ const Progress = defineComponent({
10
+ name: "Progress",
11
+ props: {
12
+ value: {
13
+ default: void 0,
14
+ type: Number
15
+ },
16
+ done: {
17
+ default: false,
18
+ type: Boolean
19
+ },
20
+ label: {
21
+ default: void 0,
22
+ type: String
23
+ }
24
+ },
25
+ setup(props) {
26
+ const root = ref();
27
+ let progress;
28
+ function apply() {
29
+ if (!progress) return;
30
+ if (props.done) progress.done();
31
+ else if (props.value === void 0) progress.reset();
32
+ else progress.set(props.value);
33
+ }
34
+ onMounted(() => {
35
+ if (!root.value) return;
36
+ progress = createProgress(root.value);
37
+ apply();
38
+ });
39
+ watch(() => [props.value, props.done], apply);
40
+ onBeforeUnmount(() => progress?.destroy());
41
+ const now = () => props.done ? 100 : typeof props.value === "number" ? Math.round(Math.max(0, Math.min(1, props.value)) * 100) : void 0;
42
+ return () => h("div", {
43
+ ref: root,
44
+ "aria-label": props.label,
45
+ "aria-valuemax": 100,
46
+ "aria-valuemin": 0,
47
+ "aria-valuenow": now(),
48
+ "data-slot": "progress",
49
+ role: "progressbar"
50
+ });
51
+ }
52
+ });
53
+ //#endregion
54
+ export { Progress };
@@ -61,7 +61,7 @@ export declare const PromptInput: import("vue").DefineComponent<import("vue").Ex
61
61
  };
62
62
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
63
63
  [key: string]: any;
64
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "submit" | "stop" | "update:modelValue" | "reload" | "update:files")[], "error" | "submit" | "stop" | "update:modelValue" | "reload" | "update:files", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
64
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "submit" | "stop" | "update:modelValue" | "update:files" | "reload")[], "error" | "submit" | "stop" | "update:modelValue" | "update:files" | "reload", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
65
65
  accept: {
66
66
  type: StringConstructor;
67
67
  };
@@ -120,17 +120,17 @@ export declare const PromptInput: import("vue").DefineComponent<import("vue").Ex
120
120
  onSubmit?: ((...args: any[]) => any) | undefined;
121
121
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
122
122
  "onUpdate:files"?: ((...args: any[]) => any) | undefined;
123
- onStop?: ((...args: any[]) => any) | undefined;
124
123
  onReload?: ((...args: any[]) => any) | undefined;
124
+ onStop?: ((...args: any[]) => any) | undefined;
125
125
  }>, {
126
+ multiple: boolean;
126
127
  disabled: boolean;
127
128
  modelValue: string;
128
- status: ChatStatus;
129
- multiple: boolean;
130
129
  readonly: boolean;
131
- attachments: boolean;
132
130
  files: readonly FileUIPart[];
131
+ attachments: boolean;
133
132
  attachVariant: "ghost" | "outline";
134
133
  filesDisabled: boolean;
134
+ status: ChatStatus;
135
135
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
136
136
  //#endregion
@@ -1,7 +1,7 @@
1
- import { r as useUIComponent } from "../../nuxt-ui-DSQFzq3s.js";
2
- import { a as useViteHubUIIcons } from "../../config-Dk67emQt.js";
1
+ import { r as useUIComponent } from "../../nuxt-ui-CgvMzO5v.js";
2
+ import { a as useViteHubUIIcons } from "../../config-B1u7zqMB.js";
3
3
  import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentGroup, AttachmentMedia, AttachmentTitle } from "./attachment.js";
4
- import { t as ImagePreview } from "../../image-preview-C9tdkmEj.js";
4
+ import { t as ImagePreview } from "../../image-preview-BigoAvb3.js";
5
5
  import { a as nextPromptFiles, n as fileToUIPart } from "../../attachments-BzTwqRTU.js";
6
6
  import { computed, defineComponent, h, onBeforeUnmount, onMounted, ref } from "vue";
7
7
  //#region src/components/prompt-input.ts
@@ -1,2 +1,2 @@
1
- import { n as provideRelativeNow, t as RelativeTime } from "../../relative-time-BVmjOsYG.js";
1
+ import { n as provideRelativeNow, t as RelativeTime } from "../../relative-time-DgSS3zKN.js";
2
2
  export { RelativeTime, provideRelativeNow };
@@ -1,3 +1,4 @@
1
+ import { MorphText } from "./motion.js";
1
2
  import { defineComponent, h, inject, provide, ref, toRef } from "vue";
2
3
  //#region src/components/sync-status.ts
3
4
  const statusKey = Symbol("SyncStatus");
@@ -41,7 +42,7 @@ const SyncStatusLabel = defineComponent({
41
42
  return () => h("span", {
42
43
  "data-slot": "sync-status-label",
43
44
  "data-status": status.value
44
- }, slots.default?.({ status: status.value }) ?? labels[status.value]);
45
+ }, slots.default?.({ status: status.value }) ?? [h(MorphText, { text: labels[status.value] })]);
45
46
  }
46
47
  });
47
48
  //#endregion
@@ -1,4 +1,4 @@
1
- import { n as AgentToolInspection } from "../../types-Dj7vp0lZ.js";
1
+ import { n as AgentToolInspection } from "../../types-BX64qHlV.js";
2
2
  import { PropType } from "vue";
3
3
  //#region src/components/tool-list.d.ts
4
4
  export declare const ToolList: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -1,4 +1,4 @@
1
- import { n as TraceRunView } from "../../index-BYRFQfCd.js";
1
+ import { n as TraceRunView } from "../../index-YUvL2nV8.js";
2
2
  import { PropType } from "vue";
3
3
  //#region src/components/trace-run.d.ts
4
4
  export declare const TraceRun: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -1,4 +1,4 @@
1
- import { r as useUIComponent } from "../../nuxt-ui-DSQFzq3s.js";
1
+ import { r as useUIComponent } from "../../nuxt-ui-CgvMzO5v.js";
2
2
  import { t as formatDuration } from "../../format-orwcdZL_.js";
3
3
  import { CodeBlock, CodeBlockContent } from "./code-block.js";
4
4
  import { t as payloadText } from "../../payload-text-sjkYAwvw.js";
@@ -49,8 +49,8 @@ export declare const TraceCollapsible: import("vue").DefineComponent<import("vue
49
49
  }>> & Readonly<{
50
50
  "onUpdate:open"?: ((_open: boolean) => any) | undefined;
51
51
  }>, {
52
- defaultOpen: boolean;
53
52
  open: boolean;
53
+ defaultOpen: boolean;
54
54
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
55
55
  export declare const TraceCollapsibleTrigger: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
56
56
  [key: string]: any;
@@ -1,2 +1,2 @@
1
- import { a as useCommentsContext, i as useComments, n as draftPositionKey, r as provideComments, t as defaultCommentCan } from "../../comments-D0d26ghV.js";
1
+ import { a as useCommentsContext, i as useComments, n as draftPositionKey, r as provideComments, t as defaultCommentCan } from "../../comments-B88zg9gC.js";
2
2
  export { defaultCommentCan, draftPositionKey, provideComments, useComments, useCommentsContext };
@@ -1,2 +1,2 @@
1
- import { a as MessageScrollerContent, c as MessageScrollerViewport, i as MessageScrollerButton, l as calculatePrependScrollTop, n as MessageScrollPosition, o as MessageScrollerContext, r as MessageScroller, s as MessageScrollerItem, t as MessageScrollBehavior, u as useMessageScroller } from "../../message-scroller-jrYN9dG9.js";
1
+ import { a as MessageScrollerContent, c as MessageScrollerViewport, i as MessageScrollerButton, l as calculatePrependScrollTop, n as MessageScrollPosition, o as MessageScrollerContext, r as MessageScroller, s as MessageScrollerItem, t as MessageScrollBehavior, u as useMessageScroller } from "../../message-scroller-Bm1YWTeY.js";
2
2
  export { MessageScrollBehavior, MessageScrollPosition, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerContext, MessageScrollerItem, MessageScrollerViewport, calculatePrependScrollTop, useMessageScroller };
@@ -1,2 +1,36 @@
1
- import { a as encodePlaygroundLink, c as playgroundUrl, i as decodePlaygroundLink, l as readPlaygroundHash, n as PlaygroundState, o as playgroundHashKey, r as PlaygroundTemplate, s as playgroundLinkLimit, t as PlaygroundFiles } from "../../share-DM4eNy4q.js";
2
- export { PlaygroundFiles, PlaygroundState, PlaygroundTemplate, decodePlaygroundLink, encodePlaygroundLink, playgroundHashKey, playgroundLinkLimit, playgroundUrl, readPlaygroundHash };
1
+ //#region src/playground/share.d.ts
2
+ /** Files by project-relative path. */
3
+ export type PlaygroundFiles = Record<string, string>;
4
+ /** What a share link holds: the template the files start from, and the files. */
5
+ export interface PlaygroundState {
6
+ /** The id of the template. A playground without templates leaves it out, and its files start from nothing. */
7
+ template?: string;
8
+ files: PlaygroundFiles;
9
+ }
10
+ /** A template that a link can start from. */
11
+ export interface PlaygroundTemplate {
12
+ id: string;
13
+ files: PlaygroundFiles;
14
+ }
15
+ /**
16
+ * The longest share link, in characters. Chat apps and issue trackers cut longer URLs, and a link this long already
17
+ * holds about 60 KB of code. A bigger playground goes out as a zip.
18
+ */
19
+ export declare const playgroundLinkLimit = 16000;
20
+ /** The URL hash key that holds the files, as in `/play#code=…`. */
21
+ export declare const playgroundHashKey = "code";
22
+ /**
23
+ * Encodes the files as their differences from `base`, the files of the template, compressed for a URL hash.
24
+ * It runs in browsers and in Node, so a build can write playground links too.
25
+ */
26
+ export declare function encodePlaygroundLink(state: PlaygroundState, base?: PlaygroundFiles): Promise<string>;
27
+ /**
28
+ * Reads a share code back into files. A malformed code, an unsafe path, or a template that is not in `templates` gives
29
+ * `undefined`.
30
+ */
31
+ export declare function decodePlaygroundLink(code: string, templates?: readonly PlaygroundTemplate[]): Promise<PlaygroundState | undefined>;
32
+ /** The share code in a URL hash such as `#code=…`, or `undefined`. */
33
+ export declare function readPlaygroundHash(hash: string): string | undefined;
34
+ /** The link to `path` that opens `code`, such as `/play#code=…`. */
35
+ export declare function playgroundUrl(path: string, code: string): string;
36
+ //#endregion
@@ -68,9 +68,9 @@ export declare const BrowserSupportNotice: import("vue").DefineComponent<import(
68
68
  onCopied?: ((url: string) => any) | undefined;
69
69
  }>, {
70
70
  url: string;
71
+ description: string;
71
72
  supported: boolean | undefined;
72
73
  reason: string;
73
74
  browser: UnsupportedBrowser;
74
- description: string;
75
75
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
76
  //#endregion
@@ -1,4 +1,6 @@
1
- import { n as useCopy } from "../../copy-button-CRN3kmSD.js";
1
+ import { t as ring } from "../../ring-B7Qxu7zd.js";
2
+ import { MorphText, SwapIcon } from "../components/motion.js";
3
+ import { useCopy } from "../components/copy-button.js";
2
4
  import { icon } from "./icons.js";
3
5
  import { defineComponent, h, onBeforeUnmount, onMounted, ref, useId } from "vue";
4
6
  //#region src/workspace/browser-support-notice.ts
@@ -59,9 +61,12 @@ const BrowserSupportNotice = defineComponent({
59
61
  document.addEventListener("pointerdown", closeOnOutside);
60
62
  });
61
63
  onBeforeUnmount(() => document.removeEventListener("pointerdown", closeOnOutside));
62
- async function copy() {
64
+ async function copy(event) {
65
+ const button = event.currentTarget;
63
66
  const url = props.url ?? location.href;
64
- if (await copyText(url)) emit("copied", url);
67
+ if (!await copyText(url)) return;
68
+ emit("copied", url);
69
+ if (button instanceof HTMLElement) ring(button);
65
70
  }
66
71
  return () => {
67
72
  if (!mounted.value || props.supported !== false) return null;
@@ -81,7 +86,10 @@ const BrowserSupportNotice = defineComponent({
81
86
  class: "vh-ws-button",
82
87
  type: "button",
83
88
  onClick: copy
84
- }, [icon(copied.value ? "check" : "copy"), copied.value ? "Copied" : "Copy link"]), h("div", { class: "vh-ws-popover-anchor" }, [h("button", {
89
+ }, [h(SwapIcon, {
90
+ name: copied.value ? "check" : "copy",
91
+ enter: copied.value ? "draw" : "blur"
92
+ }, { default: ({ name }) => icon(name) }), h(MorphText, { text: copied.value ? "Copied" : "Copy link" })]), h("div", { class: "vh-ws-popover-anchor" }, [h("button", {
85
93
  "aria-controls": whyId,
86
94
  "aria-expanded": why.value ? "true" : "false",
87
95
  class: "vh-ws-button",
@@ -4,11 +4,20 @@ export interface CodeEditorOptions {
4
4
  doc: string;
5
5
  path: string;
6
6
  readonly: boolean;
7
+ wrap: boolean;
7
8
  onChange: (doc: string) => void;
9
+ /** Alt+Z asks for the other wrap state, as in VS Code. The editor wraps when `setWrap` gets it. */
10
+ onToggleWrap: () => void;
11
+ /** The cursor moved. The line and the column start at 1. */
12
+ onCursor: (cursor: {
13
+ line: number;
14
+ column: number;
15
+ }) => void;
8
16
  }
9
17
  export interface CodeEditor {
10
18
  setDoc: (doc: string, path: string) => void;
11
19
  setReadonly: (readonly: boolean) => void;
20
+ setWrap: (wrap: boolean) => void;
12
21
  focus: () => void;
13
22
  destroy: () => void;
14
23
  }