@vite-hub/ui 0.8.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.
Files changed (130) hide show
  1. package/README.md +66 -50
  2. package/dist/{Chat-CuSthJVg.js → Chat-DYQitDw8.js} +1 -1
  3. package/dist/{ChatMessage-CFQs0v4N.js → ChatMessage-DzjHnxMT.js} +1 -1
  4. package/dist/{CodeBlockTitle-DIu8Ef3V.js → CodeBlockTitle-DX13mCTi.js} +1 -1
  5. package/dist/{CommentRow-XY3FNp30.js → CommentRow-DLW77qch.js} +2 -2
  6. package/dist/{CopyButton-Bs6DT-Z8.js → CopyButton-D-g6PWc8.js} +3 -3
  7. package/dist/{Markdown-Da5t-931.js → Markdown-3-Tvy5Kl.js} +1 -1
  8. package/dist/{MarkdownCodeBlock-BWDLOWPO.js → MarkdownCodeBlock-CALGW0iw.js} +1 -1
  9. package/dist/{MessageParts-CyJLG34y.js → MessageParts-BGSctG7Z.js} +1 -1
  10. package/dist/{MorphText-B6MWdeIv.js → MorphText-DAHAswWX.js} +1 -1
  11. package/dist/{RollNumber-CnF52zJM.js → RollNumber-CkdLiy2i.js} +1 -1
  12. package/dist/{SwapIcon-CUIq1TU5.js → SwapIcon-Bjkk7WlZ.js} +1 -1
  13. package/dist/{agent-session-2j2gbGpp.js → agent-session-D291hyRk.js} +1 -1
  14. package/dist/{avatar-stack-CoLlsmwJ.js → avatar-stack-Bi4CJPuU.js} +1 -1
  15. package/dist/{chat-session-cxUzvwdj.js → chat-session-Bl-x4c9b.js} +1 -1
  16. package/dist/{code-block-BqOEVWPh.d.ts → code-block-Bp8y-XJp.d.ts} +1 -1
  17. package/dist/{comment-composer-D_mcH3Ts.js → comment-composer-BtYrIT5W.js} +14 -19
  18. package/dist/{comment-composer-CsVOvG9j.d.ts → comment-composer-PmERtNNb.d.ts} +6 -6
  19. package/dist/{comment-layer-C3xmg-0_.d.ts → comment-layer-BgQz1ixK.d.ts} +6 -6
  20. package/dist/{comment-layer-Ci6ipGi2.js → comment-layer-T8hN_7bN.js} +11 -12
  21. package/dist/{comment-panel-DxN21VoY.d.ts → comment-panel-Vo3m6rHB.d.ts} +8 -8
  22. package/dist/{comment-selection-bar-DZAtiRZ9.js → comment-selection-bar-BMFTtI3V.js} +2 -3
  23. package/dist/{comment-thread-BzOZVqF2.js → comment-thread-CAexk1r7.js} +78 -38
  24. package/dist/{comment-thread-BmsqcjVQ.d.ts → comment-thread-Cp9k80uv.d.ts} +53 -5
  25. package/dist/{comments-BU8cTt5o.d.ts → comments-BBNiQTxK.d.ts} +4 -4
  26. package/dist/{components-B_2Q0dJ3.js → components-D44u1fsy.js} +22 -47
  27. package/dist/{config-BDQYUjjp.js → config-7CiYbXk6.js} +8 -5
  28. package/dist/{config-JmsTI7gs.d.ts → config-BYLPA0Ts.d.ts} +8 -6
  29. package/dist/{drop-field-DeIvKoJs.js → drop-field-BkoJOWR9.js} +1 -1
  30. package/dist/{editor-hXea1i46.js → editor-CE_q2Yzb.js} +89 -49
  31. package/dist/{editor-BsOTjnnN.d.ts → editor-DZxaa6vs.d.ts} +8 -7
  32. package/dist/editor.d.ts +2 -2
  33. package/dist/editor.js +2 -2
  34. package/dist/{hold-to-delete-DazElJT2.js → hold-to-delete-pyrlKzk0.js} +1 -1
  35. package/dist/{hold-to-delete-D1Vy40w5.js → hold-to-delete-sscThmPW.js} +1 -1
  36. package/dist/icon-component-ofUeRW4L.js +4 -0
  37. package/dist/{index-CffOzibW.d.ts → index-BlQsW8ZZ.d.ts} +1 -1
  38. package/dist/index.d.ts +11 -18
  39. package/dist/index.js +23 -24
  40. package/dist/{markdown-_0HhbsOo.js → markdown-CqVyNG-h.js} +2 -2
  41. package/dist/markdown-editor.d.ts +1 -1
  42. package/dist/markdown-editor.js +4 -4
  43. package/dist/markdown.js +1 -1
  44. package/dist/motion/core.d.ts +1 -1
  45. package/dist/motion/core.js +4 -4
  46. package/dist/{motion-BhARaNBB.js → motion-C8P5yWaA.js} +1 -1
  47. package/dist/{motion-core-gfsTPLbh.d.ts → motion-core-BEwxN7Il.d.ts} +0 -2
  48. package/dist/{motion-core-JZZiPKEk.js → motion-core-pkL0M4Y1.js} +3 -46
  49. package/dist/{motion-list-9vD1hSS0.js → motion-list-DDVUyVYa.js} +1 -1
  50. package/dist/motion.d.ts +1 -1
  51. package/dist/motion.js +5 -5
  52. package/dist/nuxt.d.ts +2 -4
  53. package/dist/nuxt.js +1 -33
  54. package/dist/parts/components/agent-session.js +1 -1
  55. package/dist/parts/components/avatar-stack.js +1 -1
  56. package/dist/parts/components/chat-message.js +1 -1
  57. package/dist/parts/components/chat-session.js +1 -1
  58. package/dist/parts/components/chat.js +1 -1
  59. package/dist/parts/components/code-block.d.ts +1 -1
  60. package/dist/parts/components/code-block.js +1 -1
  61. package/dist/parts/components/comment-composer.d.ts +1 -1
  62. package/dist/parts/components/comment-composer.js +1 -1
  63. package/dist/parts/components/comment-layer.d.ts +1 -1
  64. package/dist/parts/components/comment-layer.js +1 -1
  65. package/dist/parts/components/comment-panel.d.ts +1 -1
  66. package/dist/parts/components/comment-panel.js +6 -7
  67. package/dist/parts/components/comment-selection-bar.js +1 -1
  68. package/dist/parts/components/comment-thread.d.ts +1 -1
  69. package/dist/parts/components/comment-thread.js +1 -1
  70. package/dist/parts/components/comments.d.ts +5 -5
  71. package/dist/parts/components/comments.js +4 -4
  72. package/dist/parts/components/copy-button.js +1 -1
  73. package/dist/parts/components/drop-field.js +1 -1
  74. package/dist/parts/components/hold-to-delete.js +1 -1
  75. package/dist/parts/components/markdown.js +1 -1
  76. package/dist/parts/components/message-parts.js +1 -1
  77. package/dist/parts/components/motion-list.d.ts +1 -1
  78. package/dist/parts/components/motion-list.js +1 -1
  79. package/dist/parts/components/motion.d.ts +2 -2
  80. package/dist/parts/components/motion.js +4 -4
  81. package/dist/parts/components/progress.js +1 -1
  82. package/dist/parts/components/prompt-input.d.ts +1 -1
  83. package/dist/parts/components/sync-status.js +1 -1
  84. package/dist/parts/playground/share.js +0 -1
  85. package/dist/parts/workspace/browser-support-notice.d.ts +2 -2
  86. package/dist/parts/workspace/browser-support-notice.js +4 -4
  87. package/dist/parts/workspace/codemirror.js +0 -4
  88. package/dist/parts/workspace/connect-panel.js +2 -3
  89. package/dist/parts/workspace/file-icons.js +0 -8
  90. package/dist/parts/workspace/runners/web-container.js +2 -2
  91. package/dist/parts/workspace/workspace-bar.d.ts +1 -1
  92. package/dist/parts/workspace/workspace-bar.js +2 -3
  93. package/dist/parts/workspace/workspace-boot-status.js +1 -1
  94. package/dist/parts/workspace/workspace-editor-head.js +2 -3
  95. package/dist/parts/workspace/workspace-examples.js +4 -5
  96. package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
  97. package/dist/parts/workspace/workspace-guide.d.ts +1 -1
  98. package/dist/parts/workspace/workspace-guide.js +3 -4
  99. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  100. package/dist/parts/workspace/workspace-preview.js +2 -4
  101. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  102. package/dist/parts/workspace/workspace-shell.js +2 -7
  103. package/dist/parts/workspace/workspace-sidebar.d.ts +3 -3
  104. package/dist/parts/workspace/workspace-sidebar.js +5 -6
  105. package/dist/parts/workspace/workspace-start.d.ts +1 -1
  106. package/dist/parts/workspace/workspace-start.js +2 -3
  107. package/dist/parts/workspace/workspace-steps.js +6 -7
  108. package/dist/parts/workspace/workspace-terminal.js +0 -6
  109. package/dist/parts/workspace/workspace.d.ts +5 -5
  110. package/dist/parts/workspace/workspace.js +15 -18
  111. package/dist/{progress-8P8RLYMy.js → progress-D7CyDkLW.js} +1 -1
  112. package/dist/{prompt-input-j4OFTF5p.d.ts → prompt-input-DZM3E6WP.d.ts} +2 -2
  113. package/dist/{ring-B0nZBnU0.js → ring-C5lNUEAG.js} +1 -1
  114. package/dist/runtime/nuxt-plugin.js +27 -1
  115. package/dist/{stand-ins-CuKM1UH1.js → stand-ins-C2oSoNwV.js} +29 -84
  116. package/dist/styles.css +27 -9
  117. package/dist/{sync-status-B29eG_n-.js → sync-status-D27Qt7mk.js} +1 -1
  118. package/dist/theme-focus-ring.css +1 -1
  119. package/dist/{tween-1W-LlKk9.js → tween-DGAmrS3r.js} +0 -2
  120. package/dist/{vue-BdA18K5-.js → vue-D70TZJhJ.js} +1 -1
  121. package/dist/{workspace-boot-status-CyGlJS06.js → workspace-boot-status-BDkpubHd.js} +0 -1
  122. package/dist/{workspace-shell-B4A7CINd.d.ts → workspace-shell-CwEQT_1s.d.ts} +1 -1
  123. package/dist/workspace.d.ts +1 -1
  124. package/dist/workspace.js +1 -1
  125. package/package.json +10 -15
  126. package/dist/nuxt-ui-D3Qda35W.js +0 -22
  127. package/dist/theme.css +0 -379
  128. package/dist/theme.d.ts +0 -410
  129. package/dist/theme.js +0 -290
  130. package/dist/ui-components-CKQAPI-W.js +0 -7
@@ -1,15 +1,15 @@
1
1
  import { a as useCommentsContext, i as useComments, n as draftPositionKey, o as commentThreadKey, r as provideComments } from "./comments-BaSrroRV.js";
2
2
  import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
3
- import { n as rowSlotScope, r as useCommentAttachments, t as CommentRow_default } from "./CommentRow-XY3FNp30.js";
3
+ import { n as rowSlotScope, r as useCommentAttachments, t as CommentRow_default } from "./CommentRow-DLW77qch.js";
4
4
  import { a as hasDirtyComposer, i as consumedPointerEvents, l as swallowNextClick, o as pathOf, r as commentThreadPortals, s as shakeDirtyComposers, u as useDocumentPointerDown } from "./comments-context-3js2YFl2.js";
5
- import { t as AvatarStack_default } from "./avatar-stack-CoLlsmwJ.js";
6
- import { n as useViteHubUIIcons } from "./config-BDQYUjjp.js";
7
- import { b as morphText, r as createMotionList } from "./motion-core-JZZiPKEk.js";
8
- import { a as excerpt, i as displayName, l as writerPerson, s as toPerson, t as CommentComposer } from "./comment-composer-D_mcH3Ts.js";
9
- import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
10
- import { i as deliveryAttributes, n as CommentThread, r as commentTitle } from "./comment-thread-BzOZVqF2.js";
11
- import { t as MotionList_default } from "./motion-list-9vD1hSS0.js";
12
- import { t as RollNumber_default } from "./RollNumber-CnF52zJM.js";
5
+ import { t as AvatarStack_default } from "./avatar-stack-Bi4CJPuU.js";
6
+ import { r as useViteHubUIIcons } from "./config-7CiYbXk6.js";
7
+ import { b as morphText, r as createMotionList } from "./motion-core-pkL0M4Y1.js";
8
+ import { a as excerpt, i as displayName, l as writerPerson, s as toPerson, t as CommentComposer } from "./comment-composer-BtYrIT5W.js";
9
+ import { r as ViteHubIcon } from "./stand-ins-C2oSoNwV.js";
10
+ import { i as deliveryAttributes, n as CommentThread, r as commentTitle } from "./comment-thread-CAexk1r7.js";
11
+ import { t as MotionList_default } from "./motion-list-DDVUyVYa.js";
12
+ import { t as RollNumber_default } from "./RollNumber-CkdLiy2i.js";
13
13
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, h, mergeProps, nextTick, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, watch, withCtx } from "vue";
14
14
  import { List, MessageCircle, SquarePen } from "@lucide/vue";
15
15
  // src/internal/comment-page-island.ts
@@ -44,7 +44,6 @@ const CommentPageIsland = defineComponent({
44
44
  },
45
45
  slots: Object,
46
46
  setup(props, { slots }) {
47
- const UIcon = useUIComponent("UIcon");
48
47
  const icons = useViteHubUIIcons();
49
48
  const state = props.comments;
50
49
  const root = ref();
@@ -210,7 +209,7 @@ const CommentPageIsland = defineComponent({
210
209
  max: null,
211
210
  people: people(),
212
211
  size: "sm"
213
- })) : h(UIcon, {
212
+ })) : h(ViteHubIcon, {
214
213
  "aria-hidden": "true",
215
214
  name: icons.value.commentPage
216
215
  }), h("span", {
@@ -717,7 +716,7 @@ const CommentLayer = defineComponent({
717
716
  nextTick(() => {
718
717
  const pins = layer.value?.querySelectorAll("[data-slot='comment-pin']") ?? [];
719
718
  restoring = true;
720
- ([...pins].find((pin) => pin.getAttribute("data-thread-id") === target) ?? layer.value?.querySelector("[data-slot='comment-toolbar-mode']"))?.focus();
719
+ ([...pins].find((pin) => pin.getAttribute("data-thread-id") === target) ?? layer.value?.querySelector(":is([data-part='comment-toolbar-mode'], [data-slot='comment-toolbar-mode'])"))?.focus();
721
720
  restoring = false;
722
721
  });
723
722
  }, { flush: "post" });
@@ -1,6 +1,6 @@
1
1
  import { s as CommentsState, t as CommentCan } from "./comments-ZfV6IZs8.js";
2
2
  import { u as CommentRowSlots } from "./types-CMU8Vmew.js";
3
- import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-BmsqcjVQ.js";
3
+ import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-Cp9k80uv.js";
4
4
  import { PropType, SlotsType, VNode } from "vue";
5
5
  import { CommentStatus, CommentSubject, CommentThread, CommentUser, CommentsClient } from "@vite-hub/comments/client";
6
6
  type CommentPanelVariant = "docked" | "floating";
@@ -88,7 +88,7 @@ declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractP
88
88
  };
89
89
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
90
90
  [key: string]: any;
91
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:thread" | "update:status")[], "select" | "update:thread" | "update:status", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
91
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:thread" | "update:status" | "select")[], "update:thread" | "update:status" | "select", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
92
92
  comments: {
93
93
  type: PropType<CommentsState>;
94
94
  };
@@ -156,18 +156,18 @@ declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractP
156
156
  type: PropType<CommentGroup>;
157
157
  };
158
158
  }>> & Readonly<{
159
- onSelect?: ((...args: any[]) => any) | undefined;
160
159
  "onUpdate:thread"?: ((...args: any[]) => any) | undefined;
161
160
  "onUpdate:status"?: ((...args: any[]) => any) | undefined;
161
+ onSelect?: ((...args: any[]) => any) | undefined;
162
162
  }>, {
163
+ variant: CommentPanelVariant;
164
+ thread: string | null;
163
165
  title: string;
164
- people: CommentUser[];
166
+ heading: boolean;
167
+ composer: boolean;
165
168
  readOnly: boolean;
166
169
  queueFiles: boolean;
167
- thread: string | null;
168
- variant: CommentPanelVariant;
169
170
  allowEmpty: boolean;
170
- composer: boolean;
171
- heading: boolean;
171
+ people: CommentUser[];
172
172
  }, SlotsType<CommentPanelSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
173
173
  export { CommentPanelVariant as a, CommentPanelSlots as i, CommentGroupSlotScope as n, CommentUpload as o, CommentPanel as r, CommentGroup as t };
@@ -1,4 +1,4 @@
1
- import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
1
+ import { a as ViteHubTooltip } from "./components-D44u1fsy.js";
2
2
  import { Fragment, cloneVNode, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, h, mergeProps, onErrorCaptured, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx, withModifiers } from "vue";
3
3
  import { MessageCircle, Pencil } from "@lucide/vue";
4
4
  // registry/comments/CommentSelectionBar.vue?vue&type=script&setup=true&lang.ts
@@ -89,7 +89,6 @@ const SelectionHint = defineComponent({
89
89
  }
90
90
  },
91
91
  setup(props, { slots }) {
92
- const Tooltip = useUIComponent("UTooltip");
93
92
  const failed = ref(false);
94
93
  let mounted = false;
95
94
  onErrorCaptured(() => {
@@ -100,7 +99,7 @@ const SelectionHint = defineComponent({
100
99
  return () => {
101
100
  const title = `${props.hint} (${props.shortcut})`;
102
101
  if (failed.value) return slots.default?.().map((node) => cloneVNode(node, { title }));
103
- return h(Tooltip, {
102
+ return h(ViteHubTooltip, {
104
103
  content: {
105
104
  side: props.side,
106
105
  sideOffset: 8
@@ -1,17 +1,18 @@
1
- import { t as RollNumber_default } from "./RollNumber-CnF52zJM.js";
1
+ import { t as RollNumber_default } from "./RollNumber-CkdLiy2i.js";
2
2
  import { i as consumedPointerEvents, l as swallowNextClick, n as injectComments, o as pathOf, r as commentThreadPortals, s as shakeDirtyComposers, u as useDocumentPointerDown } from "./comments-context-3js2YFl2.js";
3
- import { c as writerName, i as displayName, l as writerPerson, n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-D_mcH3Ts.js";
3
+ import { c as writerName, i as displayName, l as writerPerson, n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-BtYrIT5W.js";
4
4
  import { t as defaultCommentCan } from "./comments-BaSrroRV.js";
5
- import { n as useViteHubUIIcons } from "./config-BDQYUjjp.js";
6
- import { i as travel } from "./motion-core-JZZiPKEk.js";
7
- import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
5
+ import { r as useViteHubUIIcons } from "./config-7CiYbXk6.js";
6
+ import { i as travel } from "./motion-core-pkL0M4Y1.js";
7
+ import { r as ViteHubModal } from "./components-D44u1fsy.js";
8
8
  import { i as AttachmentContent_default, n as AttachmentMedia_default, r as AttachmentGroup_default, s as Attachment_default, t as AttachmentTitle_default } from "./AttachmentTitle-BWw0ck0T.js";
9
- import { t as AvatarStack_default } from "./avatar-stack-CoLlsmwJ.js";
10
- import { t as Markdown_default } from "./Markdown-Da5t-931.js";
9
+ import { t as AvatarStack_default } from "./avatar-stack-Bi4CJPuU.js";
10
+ import { t as Markdown_default } from "./Markdown-3-Tvy5Kl.js";
11
11
  import { i as Marker_default, r as MarkerContent_default } from "./marker-DNL6QR3L.js";
12
- import { t as MotionList_default } from "./motion-list-9vD1hSS0.js";
12
+ import { t as MotionList_default } from "./motion-list-DDVUyVYa.js";
13
13
  import { t as RelativeTime_default } from "./relative-time-BnJfjeEm.js";
14
- import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, provide, ref, watch } from "vue";
14
+ import { n as ViteHubButton, r as ViteHubIcon } from "./stand-ins-C2oSoNwV.js";
15
+ import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, provide, ref, shallowRef, watch } from "vue";
15
16
  // registry/comments/status.ts
16
17
  function messagesSinceResolved(thread) {
17
18
  const { resolvedAt } = thread;
@@ -33,7 +34,6 @@ function deliveryAttributes(delivery) {
33
34
  }
34
35
  // src/internal/image-gallery.ts
35
36
  const tileCount = 4;
36
- /** The box of `width` by `height` that covers `box`, centered on it: the picture with the shape it has full size. */
37
37
  function cover(box, width, height) {
38
38
  if (!width || !height || !box.width || !box.height) return box;
39
39
  const scale = Math.max(box.width / width, box.height / height);
@@ -59,8 +59,6 @@ const ImageGallery = defineComponent({
59
59
  type: Array
60
60
  } },
61
61
  setup(props) {
62
- const UModal = useUIComponent("UModal");
63
- const UButton = useUIComponent("UButton");
64
62
  const icons = useViteHubUIIcons();
65
63
  const current = ref(null);
66
64
  const closing = ref(false);
@@ -145,7 +143,7 @@ const ImageGallery = defineComponent({
145
143
  }), index === 3 && count > tileCount ? h("span", {
146
144
  "aria-hidden": "true",
147
145
  "data-slot": "comment-reply-image-more"
148
- }, `+${count - tileCount + 1}`) : null])), h(UModal, {
146
+ }, `+${count - tileCount + 1}`) : null])), h(ViteHubModal, {
149
147
  open: current.value !== null,
150
148
  title: shown.value?.name ?? "Image",
151
149
  transition: false,
@@ -173,7 +171,7 @@ const ImageGallery = defineComponent({
173
171
  title: shown.value?.name
174
172
  }, shown.value?.name),
175
173
  many ? h("span", { class: "vh-image-gallery__count" }, [h(RollNumber_default, { value: (current.value ?? 0) + 1 }), ` of ${count}`]) : null,
176
- h(UButton, {
174
+ h(ViteHubButton, {
177
175
  "aria-label": "Open original image",
178
176
  class: "vh-image-dialog__action",
179
177
  color: "neutral",
@@ -184,7 +182,7 @@ const ImageGallery = defineComponent({
184
182
  to: shown.value?.src,
185
183
  variant: "ghost"
186
184
  }),
187
- h(UButton, {
185
+ h(ViteHubButton, {
188
186
  "aria-label": "Close image preview",
189
187
  class: "vh-image-dialog__action",
190
188
  color: "neutral",
@@ -193,7 +191,7 @@ const ImageGallery = defineComponent({
193
191
  variant: "ghost"
194
192
  })
195
193
  ]), h("div", { class: "vh-image-gallery__stage" }, [
196
- many ? h(UButton, {
194
+ many ? h(ViteHubButton, {
197
195
  "aria-label": "Previous picture",
198
196
  class: "vh-image-gallery__step vh-image-gallery__step--previous rounded-full",
199
197
  color: "neutral",
@@ -212,7 +210,7 @@ const ImageGallery = defineComponent({
212
210
  ref: picture,
213
211
  src: active?.src
214
212
  }),
215
- many ? h(UButton, {
213
+ many ? h(ViteHubButton, {
216
214
  "aria-label": "Next picture",
217
215
  class: "vh-image-gallery__step vh-image-gallery__step--next rounded-full",
218
216
  color: "neutral",
@@ -241,15 +239,24 @@ function reason(error) {
241
239
  return error instanceof Error ? error.message : "That did not work. Try again.";
242
240
  }
243
241
  const fileName = (key) => key.split(/[/\\]/).at(-1) || key;
244
- function attachmentHref(value) {
242
+ function linkHref(value, protocols) {
245
243
  if (!value) return void 0;
246
244
  try {
247
- const { protocol } = new URL(value, "https://vitehub.invalid");
248
- return protocol === "http:" || protocol === "https:" || protocol === "blob:" ? value : void 0;
245
+ return protocols.includes(new URL(value, "https://vitehub.invalid").protocol) ? value : void 0;
249
246
  } catch {
250
247
  return;
251
248
  }
252
249
  }
250
+ function viaOf({ actor }, compact) {
251
+ if (!actor?.via) return null;
252
+ const href = compact ? void 0 : linkHref(actor.url, ["http:", "https:"]);
253
+ const text = `via ${actor.via}`;
254
+ return h("span", { "data-slot": "comment-reply-via" }, href ? h("a", {
255
+ href,
256
+ rel: "noreferrer",
257
+ target: "_blank"
258
+ }, text) : text);
259
+ }
253
260
  function attachmentList(message, url, icon, fileIcon) {
254
261
  if (message.attachments.length === 0) return null;
255
262
  const items = message.attachments.map((key) => {
@@ -257,7 +264,11 @@ function attachmentList(message, url, icon, fileIcon) {
257
264
  const link = typeof found === "string" ? { url: found } : found;
258
265
  const name = link?.name || fileName(key);
259
266
  const extension = /\.([a-z0-9]+)$/i.exec(name)?.[1]?.toLowerCase();
260
- const href = attachmentHref(link?.url);
267
+ const href = linkHref(link?.url, [
268
+ "http:",
269
+ "https:",
270
+ "blob:"
271
+ ]);
261
272
  return {
262
273
  href,
263
274
  image: href !== void 0 && (link?.type ? link.type.startsWith("image/") : extension === void 0 || imageExtensions.has(extension)),
@@ -329,8 +340,6 @@ const CommentReply = defineComponent({
329
340
  },
330
341
  slots: Object,
331
342
  setup(props, { slots }) {
332
- const UButton = useUIComponent("UButton");
333
- const UIcon = useUIComponent("UIcon");
334
343
  const icons = useViteHubUIIcons();
335
344
  const comments = injectComments();
336
345
  const editing = ref(false);
@@ -443,6 +452,7 @@ const CommentReply = defineComponent({
443
452
  "data-agent": message.actor ? "true" : void 0,
444
453
  "data-slot": "comment-reply-author"
445
454
  }, writerName(message)),
455
+ viaOf(message, props.compact),
446
456
  h(RelativeTime_default, {
447
457
  at: message.createdAt,
448
458
  "data-slot": "comment-reply-time"
@@ -475,7 +485,7 @@ const CommentReply = defineComponent({
475
485
  plugins: bodyPlugins.value,
476
486
  value: message.body
477
487
  }),
478
- editing.value || props.compact ? null : slots.attachments?.({ message }) ?? attachmentList(message, props.attachmentUrl, UIcon, icons.value.file),
488
+ editing.value || props.compact ? null : slots.attachments?.({ message }) ?? attachmentList(message, props.attachmentUrl, ViteHubIcon, icons.value.file),
479
489
  editing.value || props.compact || !slots.footer ? null : h("div", { "data-slot": "comment-reply-footer" }, slots.footer({ message })),
480
490
  !editing.value && message.delivery ? statusOf(message, message.delivery) : null,
481
491
  confirming.value ? h("div", {
@@ -484,14 +494,14 @@ const CommentReply = defineComponent({
484
494
  role: "group"
485
495
  }, [
486
496
  h("p", "Delete this comment and every reply to it?"),
487
- h(UButton, {
497
+ h(ViteHubButton, {
488
498
  color: "error",
489
499
  label: "Delete thread",
490
500
  loading: busy.value,
491
501
  onClick: remove,
492
502
  size: "xs"
493
503
  }),
494
- h(UButton, {
504
+ h(ViteHubButton, {
495
505
  color: "neutral",
496
506
  label: "Cancel",
497
507
  onClick: () => confirming.value = false,
@@ -503,14 +513,14 @@ const CommentReply = defineComponent({
503
513
  "data-slot": "comment-reply-error",
504
514
  role: "alert"
505
515
  }, error.value) : null
506
- ]), (canEdit() || canDelete()) && !editing.value && !confirming.value && !props.compact ? h("div", { "data-slot": "comment-reply-actions" }, [canEdit() ? h(UButton, {
516
+ ]), (canEdit() || canDelete()) && !editing.value && !confirming.value && !props.compact ? h("div", { "data-slot": "comment-reply-actions" }, [canEdit() ? h(ViteHubButton, {
507
517
  "aria-label": "Edit",
508
518
  color: "neutral",
509
519
  icon: icons.value.edit,
510
520
  onClick: startEdit,
511
521
  size: "xs",
512
522
  variant: "ghost"
513
- }) : null, canDelete() ? h(UButton, {
523
+ }) : null, canDelete() ? h(ViteHubButton, {
514
524
  "aria-label": "Delete",
515
525
  color: "neutral",
516
526
  icon: icons.value.delete,
@@ -521,7 +531,6 @@ const CommentReply = defineComponent({
521
531
  };
522
532
  }
523
533
  });
524
- /** "Resolved by Ana", or "Resolved by Claude (Ana)" when her agent did, as a line across the thread. */
525
534
  const resolvedMarker = (thread) => h(Marker_default, {
526
535
  key: "resolved",
527
536
  variant: "separator"
@@ -529,6 +538,16 @@ const resolvedMarker = (thread) => h(Marker_default, {
529
538
  author: thread.resolvedBy,
530
539
  ...thread.resolvedActor ? { actor: thread.resolvedActor } : {}
531
540
  })}` : ""}`));
541
+ function draftModel(bound, start, update) {
542
+ const local = shallowRef(start);
543
+ return computed({
544
+ get: () => bound() ?? local.value,
545
+ set: (value) => {
546
+ local.value = value;
547
+ update(value);
548
+ }
549
+ });
550
+ }
532
551
  const CommentThread = defineComponent({
533
552
  name: "CommentThread",
534
553
  props: {
@@ -593,6 +612,21 @@ const CommentThread = defineComponent({
593
612
  default: "md",
594
613
  type: String
595
614
  },
615
+ reply: { type: String },
616
+ defaultReply: {
617
+ default: "",
618
+ type: String
619
+ },
620
+ mentions: { type: Array },
621
+ defaultMentions: {
622
+ default: () => [],
623
+ type: Array
624
+ },
625
+ files: { type: Array },
626
+ defaultFiles: {
627
+ default: () => [],
628
+ type: Array
629
+ },
596
630
  /** Sends a reply. Gets `(body, mentions, files)`. */
597
631
  onReply: { type: Function },
598
632
  /** Saves an edited message. Gets `(messageId, body, mentions)`. */
@@ -602,16 +636,20 @@ const CommentThread = defineComponent({
602
636
  onResolve: { type: Function },
603
637
  onReopen: { type: Function }
604
638
  },
605
- emits: ["close"],
639
+ emits: [
640
+ "close",
641
+ "update:reply",
642
+ "update:mentions",
643
+ "update:files"
644
+ ],
606
645
  slots: Object,
607
646
  setup(props, { emit, expose, slots }) {
608
- const UButton = useUIComponent("UButton");
609
647
  const icons = useViteHubUIIcons();
610
648
  const comments = injectComments();
611
649
  const root = ref(null);
612
- const reply = ref("");
613
- const mentions = ref([]);
614
- const files = ref([]);
650
+ const reply = draftModel(() => props.reply, props.defaultReply, (value) => emit("update:reply", value));
651
+ const mentions = draftModel(() => props.mentions, props.defaultMentions, (value) => emit("update:mentions", value));
652
+ const files = draftModel(() => props.files, props.defaultFiles, (value) => emit("update:files", value));
615
653
  const sending = ref(false);
616
654
  const failure = ref();
617
655
  const composer = ref(null);
@@ -653,9 +691,11 @@ const CommentThread = defineComponent({
653
691
  const submitted = reply.value;
654
692
  const submittedMentions = mentions.value;
655
693
  const submittedFiles = files.value;
694
+ const mentionSnapshot = [...submittedMentions];
695
+ const fileSnapshot = [...submittedFiles];
656
696
  try {
657
697
  await props.onReply(submit.body, [...submit.mentions], [...submit.files]);
658
- if (reply.value === submitted && mentions.value === submittedMentions && files.value === submittedFiles) {
698
+ if (reply.value === submitted && mentions.value === submittedMentions && files.value === submittedFiles && submittedMentions.length === mentionSnapshot.length && mentionSnapshot.every((id, index) => id === submittedMentions[index]) && submittedFiles.length === fileSnapshot.length && fileSnapshot.every((file, index) => file === submittedFiles[index])) {
659
699
  reply.value = "";
660
700
  mentions.value = [];
661
701
  files.value = [];
@@ -732,7 +772,7 @@ const CommentThread = defineComponent({
732
772
  tabindex: -1
733
773
  }, [
734
774
  h("header", { "data-slot": "comment-thread-header" }, [
735
- back ? h(UButton, {
775
+ back ? h(ViteHubButton, {
736
776
  "aria-label": "Back to comments",
737
777
  color: "neutral",
738
778
  icon: icons.value.arrowLeft,
@@ -743,7 +783,7 @@ const CommentThread = defineComponent({
743
783
  h("span", { "data-slot": "comment-thread-title" }, commentHeading(thread)),
744
784
  h("span", { "data-slot": "comment-thread-spacer" }),
745
785
  slots.actions ? h("div", { "data-slot": "comment-thread-actions" }, slots.actions({ thread })) : null,
746
- !allowed("resolve") ? null : h(UButton, {
786
+ !allowed("resolve") ? null : h(ViteHubButton, {
747
787
  "aria-label": resolved ? "Reopen" : "Resolve",
748
788
  color: "neutral",
749
789
  icon: resolved ? icons.value.reopen : icons.value.check,
@@ -751,7 +791,7 @@ const CommentThread = defineComponent({
751
791
  size: "xs",
752
792
  variant: "ghost"
753
793
  }),
754
- back ? null : h(UButton, {
794
+ back ? null : h(ViteHubButton, {
755
795
  "aria-label": "Close",
756
796
  color: "neutral",
757
797
  icon: icons.value.close,
@@ -1,5 +1,5 @@
1
1
  import { t as CommentCan } from "./comments-ZfV6IZs8.js";
2
- import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-CsVOvG9j.js";
2
+ import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-PmERtNNb.js";
3
3
  import { PropType, SlotsType, VNode } from "vue";
4
4
  import { CommentDelivery, CommentMessage, CommentThread, CommentUser } from "@vite-hub/comments/client";
5
5
  declare function messagesSinceResolved(thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">): CommentMessage[];
@@ -169,8 +169,8 @@ declare const CommentReply: import("vue").DefineComponent<import("vue").ExtractP
169
169
  type: PropType<(messageId: string) => Done>;
170
170
  };
171
171
  }>> & Readonly<{}>, {
172
- size: CommentComposerSize;
173
172
  people: CommentUser[];
173
+ size: CommentComposerSize;
174
174
  editable: boolean;
175
175
  deletable: boolean;
176
176
  compact: boolean;
@@ -250,6 +250,27 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
250
250
  default: string;
251
251
  type: PropType<CommentComposerSize>;
252
252
  };
253
+ reply: {
254
+ type: StringConstructor;
255
+ };
256
+ defaultReply: {
257
+ default: string;
258
+ type: StringConstructor;
259
+ };
260
+ mentions: {
261
+ type: PropType<string[]>;
262
+ };
263
+ defaultMentions: {
264
+ default: () => never[];
265
+ type: PropType<string[]>;
266
+ };
267
+ files: {
268
+ type: PropType<File[]>;
269
+ };
270
+ defaultFiles: {
271
+ default: () => never[];
272
+ type: PropType<File[]>;
273
+ };
253
274
  /** Sends a reply. Gets `(body, mentions, files)`. */
254
275
  onReply: {
255
276
  type: PropType<(body: string, mentions: string[], files: File[]) => Done>;
@@ -270,7 +291,7 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
270
291
  };
271
292
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
272
293
  [key: string]: any;
273
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
294
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:reply" | "update:mentions" | "update:files")[], "close" | "update:reply" | "update:mentions" | "update:files", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
274
295
  thread: {
275
296
  required: true;
276
297
  type: PropType<CommentThread>;
@@ -344,6 +365,27 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
344
365
  default: string;
345
366
  type: PropType<CommentComposerSize>;
346
367
  };
368
+ reply: {
369
+ type: StringConstructor;
370
+ };
371
+ defaultReply: {
372
+ default: string;
373
+ type: StringConstructor;
374
+ };
375
+ mentions: {
376
+ type: PropType<string[]>;
377
+ };
378
+ defaultMentions: {
379
+ default: () => never[];
380
+ type: PropType<string[]>;
381
+ };
382
+ files: {
383
+ type: PropType<File[]>;
384
+ };
385
+ defaultFiles: {
386
+ default: () => never[];
387
+ type: PropType<File[]>;
388
+ };
347
389
  /** Sends a reply. Gets `(body, mentions, files)`. */
348
390
  onReply: {
349
391
  type: PropType<(body: string, mentions: string[], files: File[]) => Done>;
@@ -364,15 +406,21 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
364
406
  };
365
407
  }>> & Readonly<{
366
408
  onClose?: ((...args: any[]) => any) | undefined;
409
+ "onUpdate:reply"?: ((...args: any[]) => any) | undefined;
410
+ "onUpdate:mentions"?: ((...args: any[]) => any) | undefined;
411
+ "onUpdate:files"?: ((...args: any[]) => any) | undefined;
367
412
  }>, {
368
- size: CommentComposerSize;
369
- people: CommentUser[];
370
413
  readOnly: boolean;
414
+ people: CommentUser[];
371
415
  preview: boolean;
372
416
  busy: boolean;
373
417
  detached: boolean;
374
418
  attachments: boolean;
375
419
  navigation: "close" | "back";
376
420
  dismissible: boolean;
421
+ size: CommentComposerSize;
422
+ defaultReply: string;
423
+ defaultMentions: string[];
424
+ defaultFiles: File[];
377
425
  }, SlotsType<CommentThreadSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
378
426
  export { CommentReplySlots as a, CommentThreadSlotScope as c, repliedSinceResolved as d, CommentReplySlotScope as i, CommentThreadSlots as l, CommentAttachmentUrl as n, CommentStatusSlotScope as o, CommentReply as r, CommentThread$1 as s, CommentAttachmentLink as t, messagesSinceResolved as u };
@@ -1,7 +1,7 @@
1
- import "./comment-composer-CsVOvG9j.js";
2
- import "./comment-layer-C3xmg-0_.js";
3
- import "./comment-panel-DxN21VoY.js";
4
- import "./comment-thread-BmsqcjVQ.js";
1
+ import "./comment-composer-PmERtNNb.js";
2
+ import "./comment-layer-BgQz1ixK.js";
3
+ import "./comment-panel-Vo3m6rHB.js";
4
+ import "./comment-thread-Cp9k80uv.js";
5
5
  import { g as CommentToolbarSlots, h as CommentToolbarProps, i as CommentListSlots, o as CommentPinProps, r as CommentListProps, t as CommentFiltersProps } from "./types-CMU8Vmew.js";
6
6
  import { t as AvatarStackPerson } from "./types-CTk3aNb5.js";
7
7
  import "./comment-selection-bar-B_bchB2O.js";