@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ViteHubIcon } from "../../stand-ins-C2oSoNwV.js";
|
|
2
2
|
import { defineComponent, h, useId } from "vue";
|
|
3
3
|
// src/workspace/workspace-start.ts
|
|
4
4
|
/**
|
|
@@ -25,7 +25,6 @@ const WorkspaceStart = defineComponent({
|
|
|
25
25
|
emits: { pick: (id) => typeof id === "string" },
|
|
26
26
|
slots: Object,
|
|
27
27
|
setup(props, { emit, slots }) {
|
|
28
|
-
const UIcon = useUIComponent("UIcon");
|
|
29
28
|
const titleId = useId();
|
|
30
29
|
const count = (files) => {
|
|
31
30
|
const length = files ? Object.keys(files).length : 0;
|
|
@@ -49,7 +48,7 @@ const WorkspaceStart = defineComponent({
|
|
|
49
48
|
example.description ? h("span", { class: "vh-ws-start-text" }, example.description) : void 0,
|
|
50
49
|
count(example.files)
|
|
51
50
|
])))),
|
|
52
|
-
h("div", { class: "vh-ws-start-foot" }, slots.footer?.() ?? [h(
|
|
51
|
+
h("div", { class: "vh-ws-start-foot" }, slots.footer?.() ?? [h(ViteHubIcon, {
|
|
53
52
|
class: "vh-ws-icon",
|
|
54
53
|
name: "i-lucide-link"
|
|
55
54
|
}), "Opened from a share link? The files open at once, without this screen."])
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ViteHubButton } from "../../stand-ins-C2oSoNwV.js";
|
|
2
|
+
import { t as ViteHubDropdownMenu } from "../../components-D44u1fsy.js";
|
|
2
3
|
import { computed, defineComponent, h, nextTick, ref } from "vue";
|
|
3
4
|
// src/workspace/workspace-steps.ts
|
|
4
5
|
/**
|
|
@@ -60,8 +61,6 @@ const WorkspaceSteps = defineComponent({
|
|
|
60
61
|
emits: { "update:step": (step) => Number.isInteger(step) },
|
|
61
62
|
setup(props, { emit }) {
|
|
62
63
|
const { current, go } = useStepModel(props, emit);
|
|
63
|
-
const UButton = useUIComponent("UButton");
|
|
64
|
-
const UDropdownMenu = useUIComponent("UDropdownMenu");
|
|
65
64
|
const nav = ref(null);
|
|
66
65
|
function move(index, other) {
|
|
67
66
|
go(index);
|
|
@@ -82,14 +81,14 @@ const WorkspaceSteps = defineComponent({
|
|
|
82
81
|
class: "vh-ws-step-nav",
|
|
83
82
|
ref: nav
|
|
84
83
|
}, [
|
|
85
|
-
h(
|
|
84
|
+
h(ViteHubDropdownMenu, {
|
|
86
85
|
content: { align: "start" },
|
|
87
86
|
items: props.label ? [[{
|
|
88
87
|
label: props.label,
|
|
89
88
|
type: "label"
|
|
90
89
|
}], items] : [items],
|
|
91
90
|
ui: { content: "w-72" }
|
|
92
|
-
}, () => h(
|
|
91
|
+
}, () => h(ViteHubButton, {
|
|
93
92
|
"aria-label": `Step: ${name}`,
|
|
94
93
|
class: "vh-ws-step-nav-menu",
|
|
95
94
|
color: "neutral",
|
|
@@ -98,7 +97,7 @@ const WorkspaceSteps = defineComponent({
|
|
|
98
97
|
variant: "ghost"
|
|
99
98
|
}, () => h("span", { class: "vh-ws-step-nav-name" }, name))),
|
|
100
99
|
h("span", { class: "vh-ws-step-nav-count" }, total ? `Step ${index + 1} of ${total}` : ""),
|
|
101
|
-
h(
|
|
100
|
+
h(ViteHubButton, {
|
|
102
101
|
"aria-label": "Previous step",
|
|
103
102
|
class: "vh-ws-step-nav-back",
|
|
104
103
|
color: "neutral",
|
|
@@ -109,7 +108,7 @@ const WorkspaceSteps = defineComponent({
|
|
|
109
108
|
variant: "ghost",
|
|
110
109
|
onClick: () => move(index - 1, ".vh-ws-step-nav-next")
|
|
111
110
|
}),
|
|
112
|
-
h(
|
|
111
|
+
h(ViteHubButton, {
|
|
113
112
|
"aria-label": "Next step",
|
|
114
113
|
class: "vh-ws-step-nav-next",
|
|
115
114
|
color: "neutral",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
2
2
|
// src/workspace/workspace-terminal.ts
|
|
3
3
|
let colorProbe;
|
|
4
|
-
/**
|
|
5
|
-
* A CSS color as `#rrggbbaa`. xterm parses only hex and `rgb()` itself, and it refuses translucent colors in other
|
|
6
|
-
* formats, but the tokens are `oklch()` and `color-mix()`. A canvas reads any CSS color as RGBA bytes. Without a canvas,
|
|
7
|
-
* as on the server or in a test DOM, the color stays as it is.
|
|
8
|
-
*/
|
|
9
4
|
function toHex(color) {
|
|
10
5
|
colorProbe ??= document.createElement("canvas").getContext("2d", { willReadFrequently: true });
|
|
11
6
|
if (!colorProbe) return color;
|
|
@@ -21,7 +16,6 @@ function cssColor(element, name) {
|
|
|
21
16
|
const value = getComputedStyle(element).getPropertyValue(name).trim();
|
|
22
17
|
return value ? toHex(value) : void 0;
|
|
23
18
|
}
|
|
24
|
-
/** The colors of the terminal, from the `--vh-ws-*` tokens of styles.css, which follow the theme and the color mode. */
|
|
25
19
|
function terminalTheme(element) {
|
|
26
20
|
return {
|
|
27
21
|
background: cssColor(element, "--vh-ws-terminal-bg"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkspaceExample } from "./workspace-examples.js";
|
|
2
|
-
import { a as WorkspaceTabItem, i as WorkspaceTab } from "../../workspace-shell-
|
|
2
|
+
import { a as WorkspaceTabItem, i as WorkspaceTab } from "../../workspace-shell-CwEQT_1s.js";
|
|
3
3
|
import { t as WorkspaceStep } from "../../workspace-steps-BKByX9DW.js";
|
|
4
4
|
import { ComputedRef, ExtractPropTypes, PropType, Ref, VNode } from "vue";
|
|
5
5
|
/** Files by project-relative path. */
|
|
@@ -229,9 +229,9 @@ export declare const Workspace: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
229
229
|
type: PropType<(files: WorkspaceFiles, example: WorkspaceExample) => WorkspaceFiles>;
|
|
230
230
|
};
|
|
231
231
|
}>> & Readonly<{
|
|
232
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
232
233
|
"onUpdate:selected"?: ((path: string) => any) | undefined;
|
|
233
234
|
"onUpdate:step"?: ((step: number) => any) | undefined;
|
|
234
|
-
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
235
235
|
"onUpdate:example"?: ((id: string) => any) | undefined;
|
|
236
236
|
}>, {
|
|
237
237
|
open: boolean;
|
|
@@ -241,8 +241,8 @@ export declare const Workspace: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
241
241
|
start: boolean;
|
|
242
242
|
step: number;
|
|
243
243
|
steps: readonly WorkspaceStep[];
|
|
244
|
-
selected: string;
|
|
245
244
|
tabs: readonly WorkspaceTabItem[];
|
|
245
|
+
selected: string;
|
|
246
246
|
example: string;
|
|
247
247
|
guide: "top" | "side";
|
|
248
248
|
share: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as useCopy } from "../../CopyButton-D-g6PWc8.js";
|
|
2
2
|
import { t as Status_default } from "../../status-B2Yhrwv8.js";
|
|
3
3
|
import { t as uiErrorDiagnostics } from "../../error-diagnostics-BlgA9rI2.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as ring } from "../../ring-
|
|
4
|
+
import { n as ViteHubButton } from "../../stand-ins-C2oSoNwV.js";
|
|
5
|
+
import { t as ring } from "../../ring-C5lNUEAG.js";
|
|
6
6
|
import { decodePlaygroundLink, encodePlaygroundLink, playgroundLinkLimit, playgroundUrl, readPlaygroundHash } from "../playground/share.js";
|
|
7
7
|
import { downloadZip } from "../playground/zip.js";
|
|
8
8
|
import { BrowserSupportNotice } from "./browser-support-notice.js";
|
|
@@ -18,6 +18,7 @@ import { WorkspaceSidebar } from "./workspace-sidebar.js";
|
|
|
18
18
|
import { WorkspaceStart } from "./workspace-start.js";
|
|
19
19
|
import { WorkspaceStatus } from "./workspace-status.js";
|
|
20
20
|
import { WorkspaceSteps } from "./workspace-steps.js";
|
|
21
|
+
import { r as ViteHubModal, t as ViteHubDropdownMenu } from "../../components-D44u1fsy.js";
|
|
21
22
|
import { computed, defineComponent, h, inject, markRaw, nextTick, onBeforeUnmount, onMounted, provide, reactive, ref, shallowRef, watch } from "vue";
|
|
22
23
|
// src/workspace/workspace.ts
|
|
23
24
|
const contextKey = Symbol("Workspace");
|
|
@@ -161,9 +162,6 @@ const WorkspaceSession = defineComponent({
|
|
|
161
162
|
restore: (link) => !!link
|
|
162
163
|
},
|
|
163
164
|
setup(props, { emit, slots }) {
|
|
164
|
-
const UButton = useUIComponent("UButton");
|
|
165
|
-
const UDropdownMenu = useUIComponent("UDropdownMenu");
|
|
166
|
-
const UModal = useUIComponent("UModal");
|
|
167
165
|
const config = props.config;
|
|
168
166
|
const tab = ref();
|
|
169
167
|
const showTab = (next) => {
|
|
@@ -309,7 +307,7 @@ const WorkspaceSession = defineComponent({
|
|
|
309
307
|
}))] : void 0,
|
|
310
308
|
actions: () => [
|
|
311
309
|
slots["bar-actions"]?.(slotProps),
|
|
312
|
-
hasSidebar ? void 0 : h(
|
|
310
|
+
hasSidebar ? void 0 : h(ViteHubButton, {
|
|
313
311
|
color: "neutral",
|
|
314
312
|
disabled: edited.value.length === 0,
|
|
315
313
|
icon: "i-lucide-rotate-ccw",
|
|
@@ -317,20 +315,20 @@ const WorkspaceSession = defineComponent({
|
|
|
317
315
|
variant: "ghost",
|
|
318
316
|
onClick: reset
|
|
319
317
|
}),
|
|
320
|
-
...config.share && !hasSidebar ? [h(
|
|
318
|
+
...config.share && !hasSidebar ? [h(ViteHubButton, {
|
|
321
319
|
color: "neutral",
|
|
322
320
|
icon: "i-lucide-download",
|
|
323
321
|
label: "Download",
|
|
324
322
|
variant: "ghost",
|
|
325
323
|
onClick: download
|
|
326
|
-
}), h(
|
|
324
|
+
}), h(ViteHubButton, {
|
|
327
325
|
color: "neutral",
|
|
328
326
|
icon: copied.value ? "i-lucide-check" : "i-lucide-link",
|
|
329
327
|
label: copied.value ? "Link copied" : "Copy link",
|
|
330
328
|
variant: "outline",
|
|
331
329
|
onClick: (event) => void copyLink(event.currentTarget)
|
|
332
330
|
})] : [],
|
|
333
|
-
actions.length ? h(
|
|
331
|
+
actions.length ? h(ViteHubDropdownMenu, {
|
|
334
332
|
content: { align: "end" },
|
|
335
333
|
items: [actions.map((item) => ({
|
|
336
334
|
disabled: item.disabled,
|
|
@@ -338,7 +336,7 @@ const WorkspaceSession = defineComponent({
|
|
|
338
336
|
label: item.label,
|
|
339
337
|
onSelect: item.onSelect
|
|
340
338
|
}))]
|
|
341
|
-
}, () => h(
|
|
339
|
+
}, () => h(ViteHubButton, {
|
|
342
340
|
"aria-label": "More actions",
|
|
343
341
|
color: "neutral",
|
|
344
342
|
icon: "i-lucide-ellipsis",
|
|
@@ -418,21 +416,21 @@ const WorkspaceSession = defineComponent({
|
|
|
418
416
|
tab: tab.value,
|
|
419
417
|
tabs: tabItems.value,
|
|
420
418
|
"onUpdate:tab": showTab
|
|
421
|
-
}, shellSlots), h(
|
|
419
|
+
}, shellSlots), h(ViteHubModal, {
|
|
422
420
|
description: config.share ? "Your edits to the current files are lost. Copy a link or download them first to keep them." : "Your edits to the current files are lost.",
|
|
423
421
|
open: !!confirm.value,
|
|
424
422
|
title: confirm.value?.title,
|
|
425
423
|
"onUpdate:open": (open) => {
|
|
426
424
|
if (!open) confirm.value = void 0;
|
|
427
425
|
}
|
|
428
|
-
}, { footer: () => h("div", { class: "vh-workspace-modal-actions" }, [h(
|
|
426
|
+
}, { footer: () => h("div", { class: "vh-workspace-modal-actions" }, [h(ViteHubButton, {
|
|
429
427
|
color: "neutral",
|
|
430
428
|
label: "Cancel",
|
|
431
429
|
variant: "ghost",
|
|
432
430
|
onClick: () => {
|
|
433
431
|
confirm.value = void 0;
|
|
434
432
|
}
|
|
435
|
-
}), h(
|
|
433
|
+
}), h(ViteHubButton, {
|
|
436
434
|
color: "neutral",
|
|
437
435
|
label: confirm.value?.label,
|
|
438
436
|
onClick: confirmAction
|
|
@@ -455,7 +453,6 @@ const Workspace = defineComponent({
|
|
|
455
453
|
"update:open": (open) => typeof open === "boolean"
|
|
456
454
|
},
|
|
457
455
|
setup(props, { emit, slots }) {
|
|
458
|
-
const UButton = useUIComponent("UButton");
|
|
459
456
|
const { device, supported } = useWorkspaceDevice(props.runner);
|
|
460
457
|
const root = ref();
|
|
461
458
|
const first = () => props.examples.find((item) => item.id === props.example) ?? props.examples[0];
|
|
@@ -584,7 +581,7 @@ const Workspace = defineComponent({
|
|
|
584
581
|
function download() {
|
|
585
582
|
downloadZip(session.value?.files ?? filesOf(active.value), zipName(props.name, active.value));
|
|
586
583
|
}
|
|
587
|
-
const downloadButton = () => h(
|
|
584
|
+
const downloadButton = () => h(ViteHubButton, {
|
|
588
585
|
color: "neutral",
|
|
589
586
|
icon: "i-lucide-download",
|
|
590
587
|
label: "Download files",
|
|
@@ -604,7 +601,7 @@ const Workspace = defineComponent({
|
|
|
604
601
|
"data-state": "pending"
|
|
605
602
|
}, h("div", { class: "vh-workspace-placeholder" }, [h("div", { class: "vh-workspace-placeholder-bar" }), h("p", { class: "vh-workspace-muted" }, `Starting the ${props.label}`)]));
|
|
606
603
|
const state = device.value === "pending" ? "pending" : device.value === "phone" ? "phone" : supported.value === false ? "unsupported" : device.value === "tablet" ? "tablet" : "pending";
|
|
607
|
-
const phone = h("aside", { class: "vh-workspace-card vh-workspace-phone" }, [h("p", { class: "vh-workspace-strong" }, `The live ${props.label} runs in a desktop browser. Open this page on a desktop to edit and run the code.`), h("div", { class: "vh-workspace-actions" }, [h(
|
|
604
|
+
const phone = h("aside", { class: "vh-workspace-card vh-workspace-phone" }, [h("p", { class: "vh-workspace-strong" }, `The live ${props.label} runs in a desktop browser. Open this page on a desktop to edit and run the code.`), h("div", { class: "vh-workspace-actions" }, [h(ViteHubButton, {
|
|
608
605
|
color: "neutral",
|
|
609
606
|
icon: copied.value ? "i-lucide-check" : "i-lucide-link",
|
|
610
607
|
label: copied.value ? "Copied" : "Copy link",
|
|
@@ -618,7 +615,7 @@ const Workspace = defineComponent({
|
|
|
618
615
|
const card = state === "pending" || state === "phone" ? phone : state === "unsupported" ? h("div", { class: "vh-workspace-unsupported" }, [h(BrowserSupportNotice, {
|
|
619
616
|
description: "Download the files to run the app on your machine, or open this page in Chrome, Edge, or Firefox on a desktop to edit and run it here.",
|
|
620
617
|
supported: false
|
|
621
|
-
}), h("div", { class: "vh-workspace-actions" }, [downloadButton()])]) : h("div", { class: "vh-workspace-card" }, [h("p", { class: "vh-workspace-muted" }, "Edit and run the code in your browser. The first start downloads the dependencies of the app."), h("div", { class: "vh-workspace-actions" }, [h(
|
|
618
|
+
}), h("div", { class: "vh-workspace-actions" }, [downloadButton()])]) : h("div", { class: "vh-workspace-card" }, [h("p", { class: "vh-workspace-muted" }, "Edit and run the code in your browser. The first start downloads the dependencies of the app."), h("div", { class: "vh-workspace-actions" }, [h(ViteHubButton, {
|
|
622
619
|
color: "neutral",
|
|
623
620
|
icon: "i-lucide-play",
|
|
624
621
|
label: `Open ${props.label}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createProgress } from "./motion-core-
|
|
1
|
+
import { n as createProgress } from "./motion-core-pkL0M4Y1.js";
|
|
2
2
|
import { computed, createElementBlock, defineComponent, onBeforeUnmount, onMounted, openBlock, useTemplateRef, watch } from "vue";
|
|
3
3
|
// registry/progress/Progress.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["aria-label", "aria-valuenow"];
|
|
@@ -61,8 +61,8 @@ declare const __VLS_base$3: import("vue", { with: { "resolution-mode": "import"
|
|
|
61
61
|
error: unknown;
|
|
62
62
|
}) => any;
|
|
63
63
|
submit: (event: PromptInputSubmitEvent) => any;
|
|
64
|
-
"update:modelValue": (value: string) => any;
|
|
65
64
|
"update:files": (files: readonly FileUIPart[]) => any;
|
|
65
|
+
"update:modelValue": (value: string) => any;
|
|
66
66
|
stop: () => any;
|
|
67
67
|
retry: () => any;
|
|
68
68
|
}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<PromptInputProps> & Readonly<{
|
|
@@ -70,8 +70,8 @@ declare const __VLS_base$3: import("vue", { with: { "resolution-mode": "import"
|
|
|
70
70
|
error: unknown;
|
|
71
71
|
}) => any) | undefined;
|
|
72
72
|
onSubmit?: ((event: PromptInputSubmitEvent) => any) | undefined;
|
|
73
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
74
73
|
"onUpdate:files"?: ((files: readonly FileUIPart[]) => any) | undefined;
|
|
74
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
75
75
|
onStop?: (() => any) | undefined;
|
|
76
76
|
onRetry?: (() => any) | undefined;
|
|
77
77
|
}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as tween, c as createSpring, h as prefersReducedMotion, o as isMotionOff, r as easeOut } from "./tween-
|
|
1
|
+
import { a as tween, c as createSpring, h as prefersReducedMotion, o as isMotionOff, r as easeOut } from "./tween-DGAmrS3r.js";
|
|
2
2
|
// src/motion/helpers/frame.ts
|
|
3
3
|
const ownNodes = /* @__PURE__ */ new WeakSet();
|
|
4
4
|
function own(node) {
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { r as startRelativeClock, t as provideRelativeNow } from "../relative-time-Dz2DR4eb.js";
|
|
2
|
-
import { t as createViteHubUI } from "../config-
|
|
2
|
+
import { t as createViteHubUI } from "../config-7CiYbXk6.js";
|
|
3
|
+
import { t as DrawnIcon } from "../stand-ins-C2oSoNwV.js";
|
|
4
|
+
import { defineComponent, h } from "vue";
|
|
3
5
|
import { defineNuxtPlugin, useAppConfig, useRuntimeConfig, useState } from "#app";
|
|
6
|
+
// src/internal/nuxt-icon.ts
|
|
7
|
+
/**
|
|
8
|
+
* The icon component that the parts render in a Nuxt app: a `UIcon` that the app registered, else the `Icon` that
|
|
9
|
+
* `@nuxt/icon` registers globally, which draws `appConfig.ui.icons` names such as `i-mingcute-add-line`. With neither,
|
|
10
|
+
* the parts draw their Lucide icons. It looks up the app component on each render, after every plugin, so the app's own
|
|
11
|
+
* `UIcon` wins.
|
|
12
|
+
*/
|
|
13
|
+
function nuxtIconComponent(app) {
|
|
14
|
+
return defineComponent({
|
|
15
|
+
name: "ViteHubNuxtIcon",
|
|
16
|
+
inheritAttrs: false,
|
|
17
|
+
props: { name: {
|
|
18
|
+
default: "",
|
|
19
|
+
type: String
|
|
20
|
+
} },
|
|
21
|
+
setup(props, { attrs }) {
|
|
22
|
+
return () => h(app.component("UIcon") ?? app.component("Icon") ?? DrawnIcon, {
|
|
23
|
+
...attrs,
|
|
24
|
+
name: props.name
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
4
29
|
// src/runtime/nuxt-plugin.ts
|
|
5
30
|
const viteHubUIPlugin = defineNuxtPlugin((nuxtApp) => {
|
|
6
31
|
const options = useRuntimeConfig().public.viteHubUI;
|
|
@@ -11,6 +36,7 @@ const viteHubUIPlugin = defineNuxtPlugin((nuxtApp) => {
|
|
|
11
36
|
});
|
|
12
37
|
nuxtApp.vueApp.use(createViteHubUI({
|
|
13
38
|
...options,
|
|
39
|
+
iconComponent: nuxtIconComponent(nuxtApp.vueApp),
|
|
14
40
|
icons
|
|
15
41
|
}));
|
|
16
42
|
const now = useState("vite-hub-ui:now", () => Date.now());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { defineComponent,
|
|
1
|
+
import { t as iconComponentKey } from "./icon-component-ofUeRW4L.js";
|
|
2
|
+
import { defineComponent, h, inject } from "vue";
|
|
3
3
|
import { Button } from "@ui-sdk/vue/button";
|
|
4
4
|
// src/internal/icon-shapes.ts
|
|
5
5
|
/** The stroke of every Lucide icon. An icon drawn from shapes without it sets it on its `<svg>`. */
|
|
@@ -12,29 +12,18 @@ const lucideStroke = {
|
|
|
12
12
|
};
|
|
13
13
|
// src/ui-sdk/icons.ts
|
|
14
14
|
const uiSdkIcons = {
|
|
15
|
-
"i-lucide-arrow-down": [["path", { "d": "M12 5v14m7-7l-7 7l-7-7" }]],
|
|
16
15
|
"i-lucide-arrow-left": [["path", { "d": "m12 19l-7-7l7-7m7 7H5" }]],
|
|
17
|
-
"i-lucide-arrow-right": [["path", { "d": "M5 12h14m-7-7l7 7l-7 7" }]],
|
|
18
16
|
"i-lucide-arrow-up": [["path", { "d": "m5 12l7-7l7 7m-7 7V5" }]],
|
|
19
|
-
"i-lucide-arrow-up-right": [["path", { "d": "M7 7h10v10M7 17L17 7" }]],
|
|
20
17
|
"i-lucide-bold": [["path", { "d": "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" }]],
|
|
21
18
|
"i-lucide-check": [["path", { "d": "M20 6L9 17l-5-5" }]],
|
|
22
19
|
"i-lucide-chevron-down": [["path", { "d": "m6 9l6 6l6-6" }]],
|
|
23
20
|
"i-lucide-chevron-left": [["path", { "d": "m15 18l-6-6l6-6" }]],
|
|
24
21
|
"i-lucide-chevron-right": [["path", { "d": "m9 18l6-6l-6-6" }]],
|
|
25
|
-
"i-lucide-
|
|
26
|
-
"i-lucide-chevrons-left": [["path", { "d": "m11 17l-5-5l5-5m7 10l-5-5l5-5" }]],
|
|
27
|
-
"i-lucide-chevrons-right": [["path", { "d": "m6 17l5-5l-5-5m7 10l5-5l-5-5" }]],
|
|
28
|
-
"i-lucide-circle-alert": [["circle", {
|
|
22
|
+
"i-lucide-circle-x": [["circle", {
|
|
29
23
|
"cx": "12",
|
|
30
24
|
"cy": "12",
|
|
31
25
|
"r": "10"
|
|
32
|
-
}], ["path", { "d": "
|
|
33
|
-
"i-lucide-circle-check": [["circle", {
|
|
34
|
-
"cx": "12",
|
|
35
|
-
"cy": "12",
|
|
36
|
-
"r": "10"
|
|
37
|
-
}], ["path", { "d": "m16 9l-5.5 5.5L8 12" }]],
|
|
26
|
+
}], ["path", { "d": "m15 9l-6 6m0-6l6 6" }]],
|
|
38
27
|
"i-lucide-code": [["path", { "d": "m16 18l6-6l-6-6M8 6l-6 6l6 6" }]],
|
|
39
28
|
"i-lucide-copy": [["rect", {
|
|
40
29
|
"width": "14",
|
|
@@ -73,15 +62,7 @@ const uiSdkIcons = {
|
|
|
73
62
|
}]
|
|
74
63
|
],
|
|
75
64
|
"i-lucide-external-link": [["path", { "d": "M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]],
|
|
76
|
-
"i-lucide-eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0" }], ["circle", {
|
|
77
|
-
"cx": "12",
|
|
78
|
-
"cy": "12",
|
|
79
|
-
"r": "3"
|
|
80
|
-
}]],
|
|
81
|
-
"i-lucide-eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20" }]],
|
|
82
65
|
"i-lucide-file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]],
|
|
83
|
-
"i-lucide-folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]],
|
|
84
|
-
"i-lucide-folder-open": [["path", { "d": "m6 14l1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" }]],
|
|
85
66
|
"i-lucide-grip-vertical": [
|
|
86
67
|
["circle", {
|
|
87
68
|
"cx": "9",
|
|
@@ -114,7 +95,6 @@ const uiSdkIcons = {
|
|
|
114
95
|
"r": "1"
|
|
115
96
|
}]
|
|
116
97
|
],
|
|
117
|
-
"i-lucide-hash": [["path", { "d": "M4 9h16M4 15h16M10 3L8 21m8-18l-2 18" }]],
|
|
118
98
|
"i-lucide-heading-1": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m5 6l3-2v8" }]],
|
|
119
99
|
"i-lucide-heading-2": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1" }]],
|
|
120
100
|
"i-lucide-heading-3": [["path", { "d": "M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" }]],
|
|
@@ -134,28 +114,13 @@ const uiSdkIcons = {
|
|
|
134
114
|
}],
|
|
135
115
|
["path", { "d": "m21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]
|
|
136
116
|
],
|
|
137
|
-
"i-lucide-info": [["circle", {
|
|
138
|
-
"cx": "12",
|
|
139
|
-
"cy": "12",
|
|
140
|
-
"r": "10"
|
|
141
|
-
}], ["path", { "d": "M12 16v-4m0-4h.01" }]],
|
|
142
117
|
"i-lucide-italic": [["path", { "d": "M19 4h-9m4 16H5M15 4L9 20" }]],
|
|
143
|
-
"i-lucide-lightbulb": [["path", { "d": "M15 14c.2-1 .7-1.7 1.5-2.5c1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5c.7.7 1.3 1.5 1.5 2.5m0 4h6m-5 4h4" }]],
|
|
144
118
|
"i-lucide-link": [["path", { "d": "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }], ["path", { "d": "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" }]],
|
|
145
119
|
"i-lucide-list": [["path", { "d": "M3 5h.01M3 12h.01M3 19h.01M8 5h13M8 12h13M8 19h13" }]],
|
|
146
120
|
"i-lucide-list-ordered": [["path", { "d": "M11 5h10m-10 7h10m-10 7h10M4 4h1v5M4 9h2m.5 11H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" }]],
|
|
147
121
|
"i-lucide-loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]],
|
|
148
|
-
"i-lucide-menu": [["path", { "d": "M4 5h16M4 12h16M4 19h16" }]],
|
|
149
122
|
"i-lucide-message-circle": [["path", { "d": "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719" }]],
|
|
150
123
|
"i-lucide-minus": [["path", { "d": "M5 12h14" }]],
|
|
151
|
-
"i-lucide-monitor": [["rect", {
|
|
152
|
-
"width": "20",
|
|
153
|
-
"height": "14",
|
|
154
|
-
"x": "2",
|
|
155
|
-
"y": "3",
|
|
156
|
-
"rx": "2"
|
|
157
|
-
}], ["path", { "d": "M8 21h8m-4-4v4" }]],
|
|
158
|
-
"i-lucide-moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]],
|
|
159
124
|
"i-lucide-panel-left": [["rect", {
|
|
160
125
|
"width": "18",
|
|
161
126
|
"height": "18",
|
|
@@ -163,20 +128,6 @@ const uiSdkIcons = {
|
|
|
163
128
|
"y": "3",
|
|
164
129
|
"rx": "2"
|
|
165
130
|
}], ["path", { "d": "M9 3v18" }]],
|
|
166
|
-
"i-lucide-panel-left-close": [["rect", {
|
|
167
|
-
"width": "18",
|
|
168
|
-
"height": "18",
|
|
169
|
-
"x": "3",
|
|
170
|
-
"y": "3",
|
|
171
|
-
"rx": "2"
|
|
172
|
-
}], ["path", { "d": "M9 3v18m7-6l-3-3l3-3" }]],
|
|
173
|
-
"i-lucide-panel-left-open": [["rect", {
|
|
174
|
-
"width": "18",
|
|
175
|
-
"height": "18",
|
|
176
|
-
"x": "3",
|
|
177
|
-
"y": "3",
|
|
178
|
-
"rx": "2"
|
|
179
|
-
}], ["path", { "d": "M9 3v18m5-12l3 3l-3 3" }]],
|
|
180
131
|
"i-lucide-pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4" }]],
|
|
181
132
|
"i-lucide-play": [["path", { "d": "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }]],
|
|
182
133
|
"i-lucide-plus": [["path", { "d": "M5 12h14m-7-7v14" }]],
|
|
@@ -187,11 +138,6 @@ const uiSdkIcons = {
|
|
|
187
138
|
["path", { "d": "M8 16H3v5" }]
|
|
188
139
|
],
|
|
189
140
|
"i-lucide-rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]],
|
|
190
|
-
"i-lucide-search": [["path", { "d": "m21 21l-4.34-4.34" }], ["circle", {
|
|
191
|
-
"cx": "11",
|
|
192
|
-
"cy": "11",
|
|
193
|
-
"r": "8"
|
|
194
|
-
}]],
|
|
195
141
|
"i-lucide-square": [["rect", {
|
|
196
142
|
"width": "18",
|
|
197
143
|
"height": "18",
|
|
@@ -207,24 +153,16 @@ const uiSdkIcons = {
|
|
|
207
153
|
"rx": "2"
|
|
208
154
|
}]],
|
|
209
155
|
"i-lucide-square-pen": [["path", { "d": "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }], ["path", { "d": "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" }]],
|
|
210
|
-
"i-lucide-star": [["path", { "d": "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.12 2.12 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16z" }]],
|
|
211
156
|
"i-lucide-strikethrough": [["path", { "d": "M16 4H9a3 3 0 0 0-2.83 4M14 12a4 4 0 0 1 0 8H6m-2-8h16" }]],
|
|
212
|
-
"i-lucide-sun": [["circle", {
|
|
213
|
-
"cx": "12",
|
|
214
|
-
"cy": "12",
|
|
215
|
-
"r": "4"
|
|
216
|
-
}], ["path", { "d": "M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41" }]],
|
|
217
157
|
"i-lucide-text-wrap": [["path", { "d": "m16 16l-3 3l3 3" }], ["path", { "d": "M3 12h14.5a1 1 0 0 1 0 7H13M3 19h6M3 5h18" }]],
|
|
218
158
|
"i-lucide-trash-2": [["path", { "d": "M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]],
|
|
219
|
-
"i-lucide-triangle-alert": [["path", { "d": "m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" }]],
|
|
220
159
|
"i-lucide-type": [["path", { "d": "M12 4v16M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M9 20h6" }]],
|
|
221
|
-
"i-lucide-upload": [["path", { "d": "M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]],
|
|
222
160
|
"i-lucide-x": [["path", { "d": "M18 6L6 18M6 6l12 12" }]]
|
|
223
161
|
};
|
|
224
162
|
// src/ui-sdk/stand-ins.ts
|
|
225
|
-
/**
|
|
226
|
-
const
|
|
227
|
-
name: "
|
|
163
|
+
/** The Lucide icons that the parts draw themselves. Other names draw nothing. */
|
|
164
|
+
const DrawnIcon = defineComponent({
|
|
165
|
+
name: "ViteHubDrawnIcon",
|
|
228
166
|
inheritAttrs: false,
|
|
229
167
|
props: { name: {
|
|
230
168
|
default: "",
|
|
@@ -241,6 +179,22 @@ const UIcon = defineComponent({
|
|
|
241
179
|
}, uiSdkIcons[props.name]?.map(([tag, shape]) => h(tag, shape)));
|
|
242
180
|
}
|
|
243
181
|
});
|
|
182
|
+
/** The icon of the parts: the component of `createViteHubUI({ iconComponent })`, else the drawn Lucide icons. */
|
|
183
|
+
const ViteHubIcon = defineComponent({
|
|
184
|
+
name: "ViteHubIcon",
|
|
185
|
+
inheritAttrs: false,
|
|
186
|
+
props: { name: {
|
|
187
|
+
default: "",
|
|
188
|
+
type: String
|
|
189
|
+
} },
|
|
190
|
+
setup(props, { attrs }) {
|
|
191
|
+
const own = inject(iconComponentKey, void 0);
|
|
192
|
+
return () => h(own ?? DrawnIcon, {
|
|
193
|
+
...attrs,
|
|
194
|
+
name: props.name
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
});
|
|
244
198
|
/** Reads an attribute that has to be a string. Attributes reach a component untyped. */
|
|
245
199
|
const text = (value) => typeof value === "string" ? value : void 0;
|
|
246
200
|
const Button$1 = Button;
|
|
@@ -251,11 +205,11 @@ function buttonVariant(color, variant) {
|
|
|
251
205
|
return variant === "solid" ? "solid" : void 0;
|
|
252
206
|
}
|
|
253
207
|
/**
|
|
254
|
-
* Nuxt UI's `UButton`
|
|
208
|
+
* The button of the parts, with the props of Nuxt UI's `UButton` that the parts use. A part that names its button, such as `data-slot="copy-button"`, finds the
|
|
255
209
|
* name in `data-part`, because `data-slot="button"` is what the kit styles.
|
|
256
210
|
*/
|
|
257
|
-
const
|
|
258
|
-
name: "
|
|
211
|
+
const ViteHubButton = defineComponent({
|
|
212
|
+
name: "ViteHubButton",
|
|
259
213
|
inheritAttrs: false,
|
|
260
214
|
props: {
|
|
261
215
|
color: {
|
|
@@ -297,7 +251,6 @@ const UButton = defineComponent({
|
|
|
297
251
|
}
|
|
298
252
|
},
|
|
299
253
|
setup(props, { attrs, slots }) {
|
|
300
|
-
const UIcon = useStandIn("UIcon");
|
|
301
254
|
return () => {
|
|
302
255
|
const shared = {
|
|
303
256
|
...attrs,
|
|
@@ -309,12 +262,12 @@ const UButton = defineComponent({
|
|
|
309
262
|
};
|
|
310
263
|
const leading = props.loading ? "i-lucide-loader-circle" : props.icon;
|
|
311
264
|
const content = () => [
|
|
312
|
-
slots.leading ? slots.leading({}) : leading ? h(
|
|
265
|
+
slots.leading ? slots.leading({}) : leading ? h(ViteHubIcon, {
|
|
313
266
|
"data-slot": props.loading ? "spinner" : void 0,
|
|
314
267
|
name: leading
|
|
315
268
|
}) : null,
|
|
316
269
|
slots.default ? slots.default() : props.label ? h("span", props.label) : null,
|
|
317
|
-
props.trailingIcon ? h(
|
|
270
|
+
props.trailingIcon ? h(ViteHubIcon, { name: props.trailingIcon }) : null
|
|
318
271
|
];
|
|
319
272
|
if (props.to) return h("a", {
|
|
320
273
|
...shared,
|
|
@@ -328,12 +281,4 @@ const UButton = defineComponent({
|
|
|
328
281
|
};
|
|
329
282
|
}
|
|
330
283
|
});
|
|
331
|
-
|
|
332
|
-
UButton,
|
|
333
|
-
UIcon
|
|
334
|
-
};
|
|
335
|
-
/** The component that the editor parts render for `name`: the one given to `createViteHubUI({ components })` or registered globally, else the ui-sdk one. */
|
|
336
|
-
function useStandIn(name) {
|
|
337
|
-
return inject(uiComponentsKey, void 0)?.[name] ?? getCurrentInstance()?.appContext.components[name] ?? standIns[name];
|
|
338
|
-
}
|
|
339
|
-
export { useStandIn as i, UIcon as n, text as r, UButton as t };
|
|
284
|
+
export { text as i, ViteHubButton as n, ViteHubIcon as r, DrawnIcon as t };
|