@vite-hub/ui 0.7.0 → 0.8.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 +3 -3
- package/dist/{Chat-BZxkf3Tt.js → Chat-CuSthJVg.js} +1 -1
- package/dist/{ChatMessage-Blr5F-zi.js → ChatMessage-CFQs0v4N.js} +1 -1
- package/dist/{CodeBlockTitle-DYrYpc1U.js → CodeBlockTitle-DIu8Ef3V.js} +1 -1
- package/dist/{CommentRow-ViZ7r8nr.js → CommentRow-XY3FNp30.js} +2 -2
- package/dist/CopyButton-Bs6DT-Z8.js +188 -0
- package/dist/{Markdown-_w7feFzl.js → Markdown-Da5t-931.js} +1 -1
- package/dist/{MarkdownCodeBlock-B4j7x0H6.js → MarkdownCodeBlock-BWDLOWPO.js} +1 -1
- package/dist/{MessageParts-FVyYZNsn.js → MessageParts-CyJLG34y.js} +1 -1
- package/dist/{MorphText-CYTndbyp.js → MorphText-B6MWdeIv.js} +1 -1
- package/dist/{RollNumber-Bo2tzfAp.js → RollNumber-CnF52zJM.js} +1 -1
- package/dist/{motion-dPwxx3Wk.js → SwapIcon-CUIq1TU5.js} +2 -11
- package/dist/{agent-session-DhlTKCQG.js → agent-session-2j2gbGpp.js} +1 -1
- package/dist/{avatar-stack-nQErr0qn.js → avatar-stack-CoLlsmwJ.js} +1 -1
- package/dist/{chat-session-hjZRL6jY.js → chat-session-cxUzvwdj.js} +1 -1
- package/dist/{code-block-Bp8y-XJp.d.ts → code-block-BqOEVWPh.d.ts} +1 -1
- package/dist/{comment-composer-CIsbz-78.d.ts → comment-composer-CsVOvG9j.d.ts} +3 -3
- package/dist/{comment-composer-BUt6vbnr.js → comment-composer-D_mcH3Ts.js} +5 -5
- package/dist/{comment-layer-BlVNORgj.d.ts → comment-layer-C3xmg-0_.d.ts} +6 -6
- package/dist/{comment-layer-Ck2H24oJ.js → comment-layer-Ci6ipGi2.js} +9 -9
- package/dist/{comment-panel-Djx-KxVa.d.ts → comment-panel-DxN21VoY.d.ts} +9 -9
- package/dist/{comment-selection-bar-CbOEI98x.d.ts → comment-selection-bar-B_bchB2O.d.ts} +1 -1
- package/dist/{comment-selection-bar-CxPkJxVl.js → comment-selection-bar-DZAtiRZ9.js} +1 -2
- package/dist/{comment-thread-X6gYMNay.d.ts → comment-thread-BmsqcjVQ.d.ts} +4 -4
- package/dist/{comment-thread-C_Q4UDaV.js → comment-thread-BzOZVqF2.js} +8 -8
- package/dist/{comments-B1itauwb.d.ts → comments-BU8cTt5o.d.ts} +12 -14
- package/dist/{components-CM5mZe0a.js → components-B_2Q0dJ3.js} +2 -2
- package/dist/{config-CFwvNt4Y.js → config-BDQYUjjp.js} +3 -3
- package/dist/{drop-field-DKpYQ3tO.js → drop-field-DeIvKoJs.js} +1 -1
- package/dist/{editor-DJPUs1nt.js → editor-hXea1i46.js} +2 -2
- package/dist/editor.js +1 -1
- package/dist/{hold-to-delete-CcQbfiQx.js → hold-to-delete-D1Vy40w5.js} +30 -3
- package/dist/{hold-to-delete-cOPqQ9FJ.js → hold-to-delete-DazElJT2.js} +1 -1
- package/dist/{index-9Z6Gwtnf.d.ts → index-CffOzibW.d.ts} +1 -1
- package/dist/index.d.ts +32 -32
- package/dist/index.js +26 -26
- package/dist/{markdown-DDyOdYq_.js → markdown-_0HhbsOo.js} +2 -2
- package/dist/markdown-editor.js +1 -1
- 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-BhARaNBB.js} +1 -1
- package/dist/{motion-core-BdTfxAhY.js → motion-core-JZZiPKEk.js} +57 -72
- package/dist/{motion-core-BfIefToe.d.ts → motion-core-gfsTPLbh.d.ts} +5 -1
- package/dist/{motion-list-BBbz93WT.js → motion-list-9vD1hSS0.js} +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +5 -5
- package/dist/{nuxt-ui-CPdiTwwD.js → nuxt-ui-D3Qda35W.js} +1 -1
- package/dist/nuxt.js +0 -1
- 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.d.ts +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 +5 -5
- 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/sync-status.js +1 -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/connect-panel.js +1 -1
- package/dist/parts/workspace/runners/web-container.js +1 -1
- package/dist/parts/workspace/workspace-bar.js +1 -1
- package/dist/parts/workspace/workspace-editor-head.js +1 -1
- package/dist/parts/workspace/workspace-examples.js +1 -1
- package/dist/parts/workspace/workspace-guide.d.ts +1 -1
- package/dist/parts/workspace/workspace-guide.js +1 -1
- package/dist/parts/workspace/workspace-preview.d.ts +1 -1
- package/dist/parts/workspace/workspace-preview.js +1 -1
- package/dist/parts/workspace/workspace-shell.js +1 -1
- package/dist/parts/workspace/workspace-sidebar.d.ts +2 -2
- package/dist/parts/workspace/workspace-sidebar.js +2 -2
- package/dist/parts/workspace/workspace-start.d.ts +1 -1
- package/dist/parts/workspace/workspace-start.js +1 -1
- package/dist/parts/workspace/workspace-steps.js +1 -1
- package/dist/parts/workspace/workspace.d.ts +2 -2
- package/dist/parts/workspace/workspace.js +3 -3
- package/dist/{progress-D_9sG648.js → progress-8P8RLYMy.js} +1 -1
- package/dist/{ring-DoL9jivj.js → ring-B0nZBnU0.js} +1 -1
- package/dist/runtime/nuxt-plugin.js +1 -1
- package/dist/styles.css +10 -12
- package/dist/{sync-status-BRroyOre.js → sync-status-B29eG_n-.js} +1 -1
- package/dist/{tween-lVMRCUEv.js → tween-1W-LlKk9.js} +5 -1
- package/dist/{types-BF_U0tgp.d.ts → types-CMU8Vmew.d.ts} +2 -5
- package/dist/{vue-DdYvDVOr.js → vue-BdA18K5-.js} +1 -1
- package/package.json +6 -9
- 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/use-copy-DK1SSZkh.js +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { getCurrentScope, onScopeDispose, readonly, ref, toValue } from "vue";
|
|
2
|
-
// registry/copy-button/use-copy.ts
|
|
3
|
-
async function writeClipboard(value) {
|
|
4
|
-
const text = typeof value === "function" ? value() : value;
|
|
5
|
-
try {
|
|
6
|
-
if (await writeClipboardApi(text)) return true;
|
|
7
|
-
} catch {}
|
|
8
|
-
return copyWithCommand(await text);
|
|
9
|
-
}
|
|
10
|
-
async function writeClipboardApi(text) {
|
|
11
|
-
const clipboard = globalThis.navigator?.clipboard;
|
|
12
|
-
if (typeof clipboard?.writeText !== "function") return false;
|
|
13
|
-
if (typeof text === "string") await clipboard.writeText(text);
|
|
14
|
-
else if (typeof ClipboardItem === "function" && typeof clipboard.write === "function") await clipboard.write([new ClipboardItem({ "text/plain": text.then((resolved) => new Blob([resolved], { type: "text/plain" })) })]);
|
|
15
|
-
else await clipboard.writeText(await text);
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
function copyWithCommand(text) {
|
|
19
|
-
const doc = globalThis.document;
|
|
20
|
-
if (typeof doc?.execCommand !== "function" || !doc.body) return false;
|
|
21
|
-
const focused = doc.activeElement;
|
|
22
|
-
const area = doc.createElement("textarea");
|
|
23
|
-
area.value = text;
|
|
24
|
-
area.readOnly = true;
|
|
25
|
-
area.style.position = "fixed";
|
|
26
|
-
area.style.opacity = "0";
|
|
27
|
-
doc.body.append(area);
|
|
28
|
-
area.focus({ preventScroll: true });
|
|
29
|
-
area.select();
|
|
30
|
-
try {
|
|
31
|
-
return doc.execCommand("copy");
|
|
32
|
-
} catch {
|
|
33
|
-
return false;
|
|
34
|
-
} finally {
|
|
35
|
-
area.remove();
|
|
36
|
-
if (focused instanceof HTMLElement) focused.focus({ preventScroll: true });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function useCopy(options = {}) {
|
|
40
|
-
const copied = ref(false);
|
|
41
|
-
const failed = ref(false);
|
|
42
|
-
let timer;
|
|
43
|
-
if (getCurrentScope()) onScopeDispose(() => clearTimeout(timer));
|
|
44
|
-
async function copy(value) {
|
|
45
|
-
clearTimeout(timer);
|
|
46
|
-
copied.value = false;
|
|
47
|
-
failed.value = false;
|
|
48
|
-
try {
|
|
49
|
-
copied.value = await writeClipboard(value);
|
|
50
|
-
} catch {
|
|
51
|
-
copied.value = false;
|
|
52
|
-
}
|
|
53
|
-
failed.value = !copied.value;
|
|
54
|
-
timer = setTimeout(() => {
|
|
55
|
-
copied.value = false;
|
|
56
|
-
failed.value = false;
|
|
57
|
-
}, toValue(options.duration) ?? 2e3);
|
|
58
|
-
return copied.value;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
copy,
|
|
62
|
-
copied: readonly(copied),
|
|
63
|
-
failed: readonly(failed)
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export { useCopy as t };
|