@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.
Files changed (112) hide show
  1. package/README.md +3 -3
  2. package/dist/{Chat-BZxkf3Tt.js → Chat-CuSthJVg.js} +1 -1
  3. package/dist/{ChatMessage-Blr5F-zi.js → ChatMessage-CFQs0v4N.js} +1 -1
  4. package/dist/{CodeBlockTitle-DYrYpc1U.js → CodeBlockTitle-DIu8Ef3V.js} +1 -1
  5. package/dist/{CommentRow-ViZ7r8nr.js → CommentRow-XY3FNp30.js} +2 -2
  6. package/dist/CopyButton-Bs6DT-Z8.js +188 -0
  7. package/dist/{Markdown-_w7feFzl.js → Markdown-Da5t-931.js} +1 -1
  8. package/dist/{MarkdownCodeBlock-B4j7x0H6.js → MarkdownCodeBlock-BWDLOWPO.js} +1 -1
  9. package/dist/{MessageParts-FVyYZNsn.js → MessageParts-CyJLG34y.js} +1 -1
  10. package/dist/{MorphText-CYTndbyp.js → MorphText-B6MWdeIv.js} +1 -1
  11. package/dist/{RollNumber-Bo2tzfAp.js → RollNumber-CnF52zJM.js} +1 -1
  12. package/dist/{motion-dPwxx3Wk.js → SwapIcon-CUIq1TU5.js} +2 -11
  13. package/dist/{agent-session-DhlTKCQG.js → agent-session-2j2gbGpp.js} +1 -1
  14. package/dist/{avatar-stack-nQErr0qn.js → avatar-stack-CoLlsmwJ.js} +1 -1
  15. package/dist/{chat-session-hjZRL6jY.js → chat-session-cxUzvwdj.js} +1 -1
  16. package/dist/{code-block-Bp8y-XJp.d.ts → code-block-BqOEVWPh.d.ts} +1 -1
  17. package/dist/{comment-composer-CIsbz-78.d.ts → comment-composer-CsVOvG9j.d.ts} +3 -3
  18. package/dist/{comment-composer-BUt6vbnr.js → comment-composer-D_mcH3Ts.js} +5 -5
  19. package/dist/{comment-layer-BlVNORgj.d.ts → comment-layer-C3xmg-0_.d.ts} +6 -6
  20. package/dist/{comment-layer-Ck2H24oJ.js → comment-layer-Ci6ipGi2.js} +9 -9
  21. package/dist/{comment-panel-Djx-KxVa.d.ts → comment-panel-DxN21VoY.d.ts} +9 -9
  22. package/dist/{comment-selection-bar-CbOEI98x.d.ts → comment-selection-bar-B_bchB2O.d.ts} +1 -1
  23. package/dist/{comment-selection-bar-CxPkJxVl.js → comment-selection-bar-DZAtiRZ9.js} +1 -2
  24. package/dist/{comment-thread-X6gYMNay.d.ts → comment-thread-BmsqcjVQ.d.ts} +4 -4
  25. package/dist/{comment-thread-C_Q4UDaV.js → comment-thread-BzOZVqF2.js} +8 -8
  26. package/dist/{comments-B1itauwb.d.ts → comments-BU8cTt5o.d.ts} +12 -14
  27. package/dist/{components-CM5mZe0a.js → components-B_2Q0dJ3.js} +2 -2
  28. package/dist/{config-CFwvNt4Y.js → config-BDQYUjjp.js} +3 -3
  29. package/dist/{drop-field-DKpYQ3tO.js → drop-field-DeIvKoJs.js} +1 -1
  30. package/dist/{editor-DJPUs1nt.js → editor-hXea1i46.js} +2 -2
  31. package/dist/editor.js +1 -1
  32. package/dist/{hold-to-delete-CcQbfiQx.js → hold-to-delete-D1Vy40w5.js} +30 -3
  33. package/dist/{hold-to-delete-cOPqQ9FJ.js → hold-to-delete-DazElJT2.js} +1 -1
  34. package/dist/{index-9Z6Gwtnf.d.ts → index-CffOzibW.d.ts} +1 -1
  35. package/dist/index.d.ts +32 -32
  36. package/dist/index.js +26 -26
  37. package/dist/{markdown-DDyOdYq_.js → markdown-_0HhbsOo.js} +2 -2
  38. package/dist/markdown-editor.js +1 -1
  39. package/dist/markdown.js +1 -1
  40. package/dist/motion/core.d.ts +1 -1
  41. package/dist/motion/core.js +4 -4
  42. package/dist/{motion-itHFtXwA.js → motion-BhARaNBB.js} +1 -1
  43. package/dist/{motion-core-BdTfxAhY.js → motion-core-JZZiPKEk.js} +57 -72
  44. package/dist/{motion-core-BfIefToe.d.ts → motion-core-gfsTPLbh.d.ts} +5 -1
  45. package/dist/{motion-list-BBbz93WT.js → motion-list-9vD1hSS0.js} +1 -1
  46. package/dist/motion.d.ts +1 -1
  47. package/dist/motion.js +5 -5
  48. package/dist/{nuxt-ui-CPdiTwwD.js → nuxt-ui-D3Qda35W.js} +1 -1
  49. package/dist/nuxt.js +0 -1
  50. package/dist/parts/components/agent-session.js +1 -1
  51. package/dist/parts/components/avatar-stack.js +1 -1
  52. package/dist/parts/components/chat-message.js +1 -1
  53. package/dist/parts/components/chat-session.js +1 -1
  54. package/dist/parts/components/chat.js +1 -1
  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 +1 -1
  61. package/dist/parts/components/comment-panel.d.ts +1 -1
  62. package/dist/parts/components/comment-panel.js +5 -5
  63. package/dist/parts/components/comment-selection-bar.d.ts +1 -1
  64. package/dist/parts/components/comment-selection-bar.js +1 -1
  65. package/dist/parts/components/comment-thread.d.ts +1 -1
  66. package/dist/parts/components/comment-thread.js +1 -1
  67. package/dist/parts/components/comments.d.ts +8 -8
  68. package/dist/parts/components/comments.js +5 -6
  69. package/dist/parts/components/copy-button.js +1 -3
  70. package/dist/parts/components/drop-field.js +1 -1
  71. package/dist/parts/components/hold-to-delete.js +1 -1
  72. package/dist/parts/components/markdown.js +1 -1
  73. package/dist/parts/components/message-parts.js +1 -1
  74. package/dist/parts/components/motion-list.d.ts +1 -1
  75. package/dist/parts/components/motion-list.js +1 -1
  76. package/dist/parts/components/motion.d.ts +2 -2
  77. package/dist/parts/components/motion.js +12 -3
  78. package/dist/parts/components/progress.js +1 -1
  79. package/dist/parts/components/sync-status.js +1 -1
  80. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  81. package/dist/parts/workspace/browser-support-notice.js +4 -4
  82. package/dist/parts/workspace/connect-panel.js +1 -1
  83. package/dist/parts/workspace/runners/web-container.js +1 -1
  84. package/dist/parts/workspace/workspace-bar.js +1 -1
  85. package/dist/parts/workspace/workspace-editor-head.js +1 -1
  86. package/dist/parts/workspace/workspace-examples.js +1 -1
  87. package/dist/parts/workspace/workspace-guide.d.ts +1 -1
  88. package/dist/parts/workspace/workspace-guide.js +1 -1
  89. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  90. package/dist/parts/workspace/workspace-preview.js +1 -1
  91. package/dist/parts/workspace/workspace-shell.js +1 -1
  92. package/dist/parts/workspace/workspace-sidebar.d.ts +2 -2
  93. package/dist/parts/workspace/workspace-sidebar.js +2 -2
  94. package/dist/parts/workspace/workspace-start.d.ts +1 -1
  95. package/dist/parts/workspace/workspace-start.js +1 -1
  96. package/dist/parts/workspace/workspace-steps.js +1 -1
  97. package/dist/parts/workspace/workspace.d.ts +2 -2
  98. package/dist/parts/workspace/workspace.js +3 -3
  99. package/dist/{progress-D_9sG648.js → progress-8P8RLYMy.js} +1 -1
  100. package/dist/{ring-DoL9jivj.js → ring-B0nZBnU0.js} +1 -1
  101. package/dist/runtime/nuxt-plugin.js +1 -1
  102. package/dist/styles.css +10 -12
  103. package/dist/{sync-status-BRroyOre.js → sync-status-B29eG_n-.js} +1 -1
  104. package/dist/{tween-lVMRCUEv.js → tween-1W-LlKk9.js} +5 -1
  105. package/dist/{types-BF_U0tgp.d.ts → types-CMU8Vmew.d.ts} +2 -5
  106. package/dist/{vue-DdYvDVOr.js → vue-BdA18K5-.js} +1 -1
  107. package/package.json +6 -9
  108. package/dist/CopyButton-Dtg_Oc9_.js +0 -115
  109. package/dist/announce-CJNXaYbT.js +0 -29
  110. package/dist/comment-send.css +0 -267
  111. package/dist/comments-BtD28xEn.js +0 -390
  112. 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 };