@vite-hub/ui 0.3.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.
- package/README.md +107 -81
- package/dist/announce-Cy_Tn9wW.js +32 -0
- package/dist/{code-view-D0bqhogi.js → code-view-DsU-xzic.js} +4 -4
- package/dist/comment-attachments-C4yNbcx5.js +20 -0
- package/dist/{comment-composer-jYv2ULNP.js → comment-composer-D7ZytyER.js} +257 -10
- package/dist/{comment-composer-Cc8Jvu6u.d.ts → comment-composer-DvKMTrAi.d.ts} +1 -1
- package/dist/{comment-layer-ClH4MLj4.d.ts → comment-layer-GTsLdABl.d.ts} +17 -6
- package/dist/{comment-list-B8hphLfS.d.ts → comment-list-BI96empx.d.ts} +2 -2
- package/dist/comment-marks.css +18 -22
- package/dist/{comment-panel-fcKSKwLC.d.ts → comment-panel-CsKWTms_.d.ts} +15 -4
- package/dist/{comment-row-Bbm9WwuF.js → comment-row-JmTC0uXr.js} +2 -2
- package/dist/comment-selection-bar-CyVBNYl9.d.ts +42 -0
- package/dist/comment-send-7bg4NEEM.js +277 -0
- package/dist/comment-send-C45dHC22.d.ts +25 -0
- package/dist/comment-send.css +267 -0
- package/dist/comment-thread-B_Sc2QX6.js +797 -0
- package/dist/{comment-thread-CoTLrdal.d.ts → comment-thread-C6U-bsK_.d.ts} +23 -6
- package/dist/{comments-CkWc2Khc.js → comments-B88zg9gC.js} +66 -10
- package/dist/{comments-Bx2WRsYy.d.ts → comments-D8hulVPy.d.ts} +34 -6
- package/dist/{comments-context-C2lOZyQ5.js → comments-context-DhbIdYQ1.js} +2 -1
- package/dist/{config-Dk67emQt.js → config-B1u7zqMB.js} +8 -1
- package/dist/{config-DgxBW013.d.ts → config-pHazYdq6.d.ts} +11 -0
- package/dist/drop-field-3CDRFFRm.js +163 -0
- package/dist/{editor-C_wt4RRV.js → editor-BHYGLgty.js} +42 -3
- package/dist/effects-Ql6VzCRa.js +2971 -0
- package/dist/format-orwcdZL_.js +39 -0
- package/dist/headless.d.ts +2 -2
- package/dist/headless.js +1 -1
- package/dist/hold-to-delete-DjWzRDyY.d.ts +51 -0
- package/dist/hold-to-delete-ROLQRZg_.js +434 -0
- package/dist/icon-c5Jb_Tl7.d.ts +31 -0
- package/dist/{image-preview-C9tdkmEj.js → image-preview-BigoAvb3.js} +2 -2
- package/dist/{index-BD1e8vx5.d.ts → index-YUvL2nV8.d.ts} +10 -6
- package/dist/index.d.ts +18 -12
- package/dist/index.js +47 -45
- package/dist/install-D5f6msEU.js +17 -0
- package/dist/list-RCbNZ14q.js +271 -0
- package/dist/{markdown-editor-CMbNZOdN.js → markdown-editor-Dfl2DgPS.js} +1 -1
- package/dist/{markdown-editor-DqdZfIEn.d.ts → markdown-editor-wQF0yD5o.d.ts} +1 -1
- package/dist/markdown-editor.d.ts +1 -1
- package/dist/markdown-editor.js +1 -1
- package/dist/motion/core.d.ts +4 -0
- package/dist/motion/core.js +11 -0
- package/dist/motion-core-lHRF8PZz.d.ts +456 -0
- package/dist/motion.d.ts +16 -0
- package/dist/motion.js +13 -0
- package/dist/{nuxt-ui-DSQFzq3s.js → nuxt-ui-CgvMzO5v.js} +20 -14
- package/dist/nuxt.d.ts +2 -2
- package/dist/nuxt.js +20 -5
- package/dist/opt-out-b6bnUjIT.js +208 -0
- package/dist/parts/components/agent-session.js +1 -1
- package/dist/parts/components/attachment.js +1 -1
- package/dist/parts/components/avatar-stack.js +3 -2
- package/dist/parts/components/chat-session.d.ts +1 -1
- package/dist/parts/components/chat.js +2 -2
- package/dist/parts/components/code-block.js +1 -1
- package/dist/parts/components/code-view.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 +54 -23
- package/dist/parts/components/comment-list.d.ts +1 -1
- package/dist/parts/components/comment-list.js +13 -7
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +46 -20
- package/dist/parts/components/comment-pin.js +1 -1
- package/dist/parts/components/comment-selection-bar.d.ts +2 -0
- package/dist/parts/components/comment-selection-bar.js +117 -0
- package/dist/parts/components/comment-send.d.ts +2 -0
- package/dist/parts/components/comment-send.js +2 -0
- package/dist/parts/components/comment-thread.d.ts +2 -2
- package/dist/parts/components/comment-thread.js +2 -570
- package/dist/parts/components/comments.d.ts +8 -6
- package/dist/parts/components/comments.js +6 -4
- package/dist/parts/components/copy-button.d.ts +12 -2
- package/dist/parts/components/copy-button.js +226 -1
- package/dist/parts/components/drop-field.d.ts +69 -0
- package/dist/parts/components/drop-field.js +77 -0
- package/dist/parts/components/filter-search.js +1 -1
- package/dist/parts/components/hold-to-delete.d.ts +82 -0
- package/dist/parts/components/hold-to-delete.js +76 -0
- package/dist/parts/components/markdown-editor.d.ts +1 -1
- package/dist/parts/components/markdown-editor.js +1 -1
- package/dist/parts/components/markdown-renderer.js +1 -1
- package/dist/parts/components/markdown.js +1 -1
- package/dist/parts/components/message-parts.js +13 -5
- package/dist/parts/components/motion-list.d.ts +42 -0
- package/dist/parts/components/motion-list.js +42 -0
- package/dist/parts/components/motion.d.ts +124 -0
- package/dist/parts/components/motion.js +172 -0
- package/dist/parts/components/progress.d.ts +41 -0
- package/dist/parts/components/progress.js +54 -0
- package/dist/parts/components/prompt-input.d.ts +3 -3
- package/dist/parts/components/prompt-input.js +3 -3
- package/dist/parts/components/relative-time.js +1 -1
- package/dist/parts/components/sync-status.js +2 -1
- package/dist/parts/components/tool-list.d.ts +1 -1
- package/dist/parts/components/trace-run.d.ts +1 -1
- package/dist/parts/components/trace-run.js +2 -2
- package/dist/parts/headless/comments.d.ts +2 -2
- package/dist/parts/headless/comments.js +1 -1
- package/dist/parts/playground/share.d.ts +36 -2
- package/dist/parts/workspace/browser-support-notice.js +12 -4
- package/dist/parts/workspace/codemirror.d.ts +9 -0
- package/dist/parts/workspace/codemirror.js +37 -4
- package/dist/parts/workspace/connect-panel.js +1 -1
- package/dist/parts/workspace/file-icons.d.ts +16 -0
- package/dist/parts/workspace/file-icons.js +82 -0
- package/dist/parts/workspace/icons.d.ts +1 -0
- package/dist/parts/workspace/icons.js +1 -0
- package/dist/parts/workspace/runners/render.d.ts +26 -0
- package/dist/parts/workspace/runners/render.js +124 -0
- package/dist/parts/workspace/runners/web-container.d.ts +29 -0
- package/dist/parts/workspace/runners/web-container.js +186 -0
- package/dist/parts/workspace/workspace-bar.d.ts +51 -0
- package/dist/parts/workspace/workspace-bar.js +51 -0
- package/dist/parts/workspace/workspace-boot-status.js +1 -1
- package/dist/parts/workspace/workspace-editor-head.d.ts +47 -0
- package/dist/parts/workspace/workspace-editor-head.js +66 -0
- package/dist/parts/workspace/workspace-editor.d.ts +17 -0
- package/dist/parts/workspace/workspace-editor.js +29 -3
- package/dist/parts/workspace/workspace-examples.d.ts +74 -0
- package/dist/parts/workspace/workspace-examples.js +72 -0
- package/dist/parts/workspace/workspace-file-link.d.ts +35 -0
- package/dist/parts/workspace/workspace-file-link.js +39 -0
- package/dist/parts/workspace/workspace-file-tree.d.ts +8 -8
- package/dist/parts/workspace/workspace-file-tree.js +26 -19
- package/dist/parts/workspace/workspace-guide.d.ts +52 -0
- package/dist/parts/workspace/workspace-guide.js +91 -0
- package/dist/parts/workspace/workspace-issues.d.ts +46 -0
- package/dist/parts/workspace/workspace-issues.js +49 -0
- package/dist/parts/workspace/workspace-preview.js +1 -1
- package/dist/parts/workspace/workspace-shell.d.ts +2 -88
- package/dist/parts/workspace/workspace-shell.js +131 -78
- package/dist/parts/workspace/workspace-sidebar.d.ts +75 -0
- package/dist/parts/workspace/workspace-sidebar.js +132 -0
- package/dist/parts/workspace/workspace-start.d.ts +47 -0
- package/dist/parts/workspace/workspace-start.js +60 -0
- package/dist/parts/workspace/workspace-status.d.ts +69 -0
- package/dist/parts/workspace/workspace-status.js +74 -0
- package/dist/parts/workspace/workspace-steps.d.ts +2 -0
- package/dist/parts/workspace/workspace-steps.js +128 -0
- package/dist/parts/workspace/workspace-task.d.ts +20 -0
- package/dist/parts/workspace/workspace-task.js +20 -0
- package/dist/parts/workspace/workspace.d.ts +251 -0
- package/dist/parts/workspace/workspace.js +665 -0
- package/dist/{pierre-code-view-xgBL6DO7.js → pierre-code-view-NE35tkmR.js} +37 -17
- package/dist/playground.d.ts +1 -1
- package/dist/progress-C7afI5vq.js +266 -0
- package/dist/registry-D3-ysX7l.js +78 -0
- package/dist/{relative-time-BVmjOsYG.js → relative-time-DgSS3zKN.js} +1 -1
- package/dist/ring-B7Qxu7zd.js +175 -0
- package/dist/runtime/nuxt-plugin.js +2 -2
- package/dist/styles.css +657 -526
- package/dist/text-BCJflBJf.js +826 -0
- package/dist/theme.d.ts +43 -0
- package/dist/theme.js +22 -7
- package/dist/travel-C87xd5Wh.js +182 -0
- package/dist/tween-CO24nMpf.js +62 -0
- package/dist/{types-Dyr6CfBW.d.ts → types-BX64qHlV.d.ts} +1 -1
- package/dist/visual-copy-CrVc3z4n.js +15 -0
- package/dist/workspace-shell-BJGnoF3p.d.ts +112 -0
- package/dist/workspace-steps-Bgph2rpr.d.ts +72 -0
- package/dist/workspace.d.ts +17 -4
- package/dist/workspace.js +16 -3
- package/package.json +22 -11
- package/dist/copy-button-CRN3kmSD.js +0 -253
- package/dist/format-Du58PlsG.js +0 -18
- package/dist/icon-swap.css +0 -69
- package/dist/parts/playground/highlight.d.ts +0 -5
- package/dist/parts/playground/highlight.js +0 -23
- package/dist/parts/playground/playground-render.d.ts +0 -126
- package/dist/parts/playground/playground-render.js +0 -356
- package/dist/parts/workspace/playground-container.d.ts +0 -192
- package/dist/parts/workspace/playground-container.js +0 -603
- package/dist/share-DM4eNy4q.d.ts +0 -37
|
@@ -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" | "
|
|
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
126
|
multiple: boolean;
|
|
127
127
|
disabled: boolean;
|
|
128
128
|
modelValue: string;
|
|
129
129
|
readonly: boolean;
|
|
130
|
-
status: ChatStatus;
|
|
131
130
|
files: readonly FileUIPart[];
|
|
132
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-
|
|
2
|
-
import { a as useViteHubUIIcons } from "../../config-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { r as useUIComponent } from "../../nuxt-ui-
|
|
2
|
-
import { t as formatDuration } from "../../format-
|
|
1
|
+
import { r as useUIComponent } from "../../nuxt-ui-CgvMzO5v.js";
|
|
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";
|
|
5
5
|
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "./trace.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CommentThreadAction, c as
|
|
2
|
-
export { CommentCan, CommentDraft, CommentFilterState, CommentScope, CommentThreadAction, CommentsState, UseCommentsOptions, defaultCommentCan, draftPositionKey, provideComments, useComments, useCommentsContext };
|
|
1
|
+
import { a as CommentThreadAction, c as UseCommentsOptions, d as provideComments, f as useComments, i as CommentScope, l as defaultCommentCan, n as CommentDraft, o as CommentsOutboxState, p as useCommentsContext, r as CommentFilterState, s as CommentsState, t as CommentCan, u as draftPositionKey } from "../../comments-D8hulVPy.js";
|
|
2
|
+
export { CommentCan, CommentDraft, CommentFilterState, CommentScope, CommentThreadAction, CommentsOutboxState, CommentsState, UseCommentsOptions, defaultCommentCan, draftPositionKey, provideComments, useComments, useCommentsContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as useCommentsContext, i as useComments, n as draftPositionKey, r as provideComments, t as defaultCommentCan } from "../../comments-
|
|
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,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
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))
|
|
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
|
-
}, [
|
|
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
|
}
|