@vite-hub/ui 0.6.0 → 0.6.1
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 +1 -1
- package/dist/{colors-BghReA9C-DEq4bhEP.js → colors-BghReA9C-A4M9YE0s.js} +1 -1
- package/dist/{comment-attachments-CMpYOJod.js → comment-attachments-DAzUbRmJ.js} +4 -0
- package/dist/{comment-composer-BI6CNJyO.d.ts → comment-composer-DmDM3XYP.d.ts} +1 -1
- package/dist/{comment-composer-BP-CJx7f.js → comment-composer-X7vJKh5b.js} +4 -4
- package/dist/comment-layer-KnnVfdRV.d.ts +130 -0
- package/dist/{comment-list-BJdZu0DS.d.ts → comment-list-ncwaCSVX.d.ts} +2 -2
- package/dist/{comment-panel-DISGe7yM.d.ts → comment-panel-DoLDOw3E.d.ts} +2 -42
- package/dist/{comment-pin-C5UeLPTa.d.ts → comment-pin-hBJFiSYW.d.ts} +1 -1
- package/dist/{comment-send-CH46zawK.js → comment-send-CUkL3TbZ.js} +1 -1
- package/dist/comment-status-nsCdrRk_.js +20 -0
- package/dist/{comment-thread-DSkWODKG.d.ts → comment-thread-DPV2kqA4.d.ts} +4 -8
- package/dist/{comment-thread-5h93DXds.js → comment-thread-jqPx6aJ8.js} +9 -9
- package/dist/{comments-D9dONfs9.js → comments-9MDSNm-9.js} +33 -40
- package/dist/{comments-CnG_c-_c.d.ts → comments-OWjNidkP.d.ts} +6 -5
- package/dist/{comments-context-CrjhleVA.js → comments-context-3js2YFl2.js} +2 -2
- package/dist/{config-xL4EBeXw.d.ts → config-COSdO-ay.d.ts} +2 -1
- package/dist/{config-BDvnaVUn.js → config-LRonN53j.js} +9 -3
- package/dist/{draw-DzSmD7uo-Cb7s9kxJ.js → draw-DzSmD7uo-BvtKi0oE.js} +2 -2
- package/dist/{editor-BuByBIkJ.js → editor-Dmk3k6f6.js} +1 -1
- package/dist/{effects-DEoFFycD.js → effects-C1zYpSpg.js} +2 -2
- package/dist/{format-Bc9m7-r0.js → format-CPipR1FP.js} +4 -23
- package/dist/headless.d.ts +2 -2
- package/dist/headless.js +1 -1
- package/dist/{image-preview-EqfPcFZ9.js → image-preview-BKVUtfwQ.js} +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +10 -9
- package/dist/{install-qNaj4OY4.js → install-C4LwcJda.js} +1 -1
- package/dist/{markdown-editor-3gY9MLvy.js → markdown-editor-D1irG9Xl.js} +45 -11
- package/dist/markdown-editor.js +1 -1
- package/dist/{markdown-renderer-BgsmNqv7.js → markdown-renderer-DMyYKeil.js} +13062 -12372
- package/dist/{message-scroller-a6qaYHno.d.ts → message-scroller-BZqS63IX.d.ts} +2 -2
- package/dist/motion/core.d.ts +1 -1
- package/dist/motion/core.js +4 -4
- package/dist/{motion-core-DNl7TR1T.d.ts → motion-core-Dh20n5Se.d.ts} +2 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +5 -5
- package/dist/nuxt.d.ts +1 -1
- package/dist/parts/components/agent-session.d.ts +46 -3
- package/dist/parts/components/agent-session.js +27 -7
- package/dist/parts/components/avatar-stack.js +1 -1
- package/dist/parts/components/chat.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 +20 -31
- package/dist/parts/components/comment-list.d.ts +1 -1
- package/dist/parts/components/comment-list.js +3 -2
- package/dist/parts/components/comment-panel.d.ts +1 -1
- package/dist/parts/components/comment-panel.js +32 -29
- package/dist/parts/components/comment-pin.d.ts +1 -1
- package/dist/parts/components/comment-selection-bar.js +1 -1
- package/dist/parts/components/comment-send.js +1 -1
- package/dist/parts/components/comment-thread.d.ts +2 -2
- package/dist/parts/components/comment-thread.js +3 -3
- package/dist/parts/components/comments.d.ts +6 -6
- package/dist/parts/components/comments.js +4 -4
- package/dist/parts/components/copy-button.js +2 -2
- package/dist/parts/components/markdown-editor.js +1 -1
- package/dist/parts/components/markdown-renderer.js +1 -1
- package/dist/parts/components/markdown.js +1 -1
- package/dist/parts/components/message-parts.js +1 -1
- package/dist/parts/components/motion.js +2 -2
- package/dist/parts/components/prompt-input.d.ts +2 -2
- package/dist/parts/components/prompt-input.js +2 -2
- package/dist/parts/components/trace-run.js +1 -1
- package/dist/parts/headless/comments.d.ts +1 -1
- package/dist/parts/headless/comments.js +1 -1
- package/dist/parts/headless/message-scroller.d.ts +1 -1
- package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
- package/dist/parts/workspace/browser-support-notice.js +1 -1
- package/dist/parts/workspace/workspace-boot-status.js +1 -1
- package/dist/parts/workspace/workspace-sidebar.d.ts +1 -1
- package/dist/parts/workspace/workspace-sidebar.js +1 -1
- package/dist/parts/workspace/workspace.d.ts +1 -1
- package/dist/parts/workspace/workspace.js +1 -1
- package/dist/{ring-BN4d8vtw.js → ring-GaJsg32c.js} +63 -12
- package/dist/runtime/nuxt-plugin.js +1 -1
- package/dist/{sankey-CAYwt82B-BAAk7WkJ.js → sankey-CAYwt82B-e6k34wtW.js} +3 -3
- package/dist/styles.css +13 -0
- package/dist/{text-BWzZFnGY.js → text-gacox6bp.js} +1 -1
- package/dist/{travel-CwVhU_GS.js → travel-BliEidau.js} +1 -1
- package/dist/vue-d2Td6uu2.js +6587 -0
- package/dist/{vue-Cs_HmYsp.js → vue-vUGpdMct.js} +1 -1
- package/dist/workspace.js +1 -1
- package/package.json +7 -7
- package/dist/comment-layer-Ba2DV4L7.d.ts +0 -174
- package/dist/vue-BlknIGIm.js +0 -2501
package/README.md
CHANGED
|
@@ -307,7 +307,7 @@ For everything else, use the component or the helper:
|
|
|
307
307
|
| `<MorphText :text="copied ? 'Copied' : 'Copy link'" />` | `morphText(element, text)` | A label outside a `UButton` |
|
|
308
308
|
| `<SwapIcon :name="icon" enter="draw" />` | `swapIcon(container, icon, { exit, enter })` | An icon that says what happened: `exit: "right"` for an arrow that leaves the way it points, `enter: "draw"` for a check or a spinner |
|
|
309
309
|
| `<RollNumber :value="count" />` | `rollNumber(element, value, format?)` | A count: only the changed digits roll, up when it grows, down when it shrinks |
|
|
310
|
-
| `<UButton v-ring="saved" />` | `ring(element)` | A finished action, such as saved or copied: a ring in the border color grows once and fades |
|
|
310
|
+
| `<UButton v-ring="saved" />` | `ring(element)` | A finished action, such as saved or copied: a ring in the border color grows once and fades. A button joined to others in a `UFieldGroup` rings the whole group |
|
|
311
311
|
|
|
312
312
|
`CopyButton` uses all of them. Each helper can be called again in the middle of its motion and continues from where it is. The element keeps the final text for screen readers the whole time and holds plain text again at the end. Under reduced motion a label, an icon, or a digit crossfades in 150ms, and there is no ring. Inside `data-motion="none"` the change happens at once.
|
|
313
313
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/comark-charts@0.
|
|
1
|
+
// ../../node_modules/.pnpm/comark-charts@0.14.3_@comark+html@0.9.2_katex@0.19.1_shiki@4.6.0__comark@0.9.2_katex@0._3dc1623b66c2ddc50c7ba6cd35e1abd0/node_modules/comark-charts/dist/colors-BghReA9C.mjs
|
|
2
2
|
/**
|
|
3
3
|
* The colors the SVG is drawn with. Each is the light theme's value of a CSS variable, so the SVG reads on its own,
|
|
4
4
|
* and the stylesheet swaps each one for its variable, which follows the page's theme and dark mode.
|
|
@@ -8,6 +8,10 @@ function useCommentAttachments(state, props) {
|
|
|
8
8
|
});
|
|
9
9
|
return {
|
|
10
10
|
enabled: computed(() => mode.value !== void 0),
|
|
11
|
+
queued(files) {
|
|
12
|
+
if (!state.outbox.enabled || mode.value === "upload" && files.length > 0) return void 0;
|
|
13
|
+
return mode.value === "queue" ? files : [];
|
|
14
|
+
},
|
|
11
15
|
async prepare(files) {
|
|
12
16
|
return {
|
|
13
17
|
files: mode.value === "queue" ? files : [],
|
|
@@ -229,10 +229,10 @@ declare const CommentComposer: import("vue").DefineComponent<import("vue").Extra
|
|
|
229
229
|
modelValue: string;
|
|
230
230
|
autofocus: boolean;
|
|
231
231
|
variant: CommentComposerVariant;
|
|
232
|
-
people: CommentUser[];
|
|
233
232
|
mentions: string[];
|
|
234
233
|
busy: boolean;
|
|
235
234
|
guard: boolean;
|
|
235
|
+
people: CommentUser[];
|
|
236
236
|
participants: string[];
|
|
237
237
|
attachments: boolean;
|
|
238
238
|
allowEmpty: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as shakeEventName, i as consumedPointerEvents, l as swallowNextClick, n as injectComments, o as pathOf, u as useDocumentPointerDown } from "./comments-context-
|
|
1
|
+
import { c as shakeEventName, i as consumedPointerEvents, l as swallowNextClick, n as injectComments, o as pathOf, u as useDocumentPointerDown } from "./comments-context-3js2YFl2.js";
|
|
2
2
|
import { i as toPerson, t as displayName } from "./comment-person-D_IyIjXo.js";
|
|
3
|
-
import { n as shake, t as travel } from "./travel-
|
|
3
|
+
import { n as shake, t as travel } from "./travel-BliEidau.js";
|
|
4
4
|
import { i as matchesAccept } from "./attachments-DgwoQZKY.js";
|
|
5
5
|
import { RollNumber } from "./parts/components/motion.js";
|
|
6
|
-
import { a as useViteHubUIIcons } from "./config-
|
|
6
|
+
import { a as useViteHubUIIcons } from "./config-LRonN53j.js";
|
|
7
7
|
import { t as createMotionList } from "./list-DUTAo0uC.js";
|
|
8
|
-
import { t as ImagePreview } from "./image-preview-
|
|
8
|
+
import { t as ImagePreview } from "./image-preview-BKVUtfwQ.js";
|
|
9
9
|
import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
|
|
10
10
|
import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentGroup, AttachmentMedia, AttachmentTitle } from "./parts/components/attachment.js";
|
|
11
11
|
import { AvatarStack } from "./parts/components/avatar-stack.js";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { s as CommentsState, t as CommentCan } from "./comments-OWjNidkP.js";
|
|
2
|
+
import { n as AvatarStackPerson } from "./avatar-stack-C0IKwj6g.js";
|
|
3
|
+
import { r as CommentComposerSize } from "./comment-composer-DmDM3XYP.js";
|
|
4
|
+
import { c as CommentUpload } from "./comment-panel-DoLDOw3E.js";
|
|
5
|
+
import { n as CommentAttachmentUrl } from "./comment-thread-DPV2kqA4.js";
|
|
6
|
+
import { PropType } from "vue";
|
|
7
|
+
import { CommentSubject, CommentUser, CommentsClient } from "@vite-hub/comments/client";
|
|
8
|
+
/** Where a thread opens: in a card beside its pin, or in a column of cards on the right edge of the screen. */
|
|
9
|
+
type CommentPlacement = "pin" | "margin";
|
|
10
|
+
declare const CommentLayer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
|
+
client: {
|
|
12
|
+
type: PropType<CommentsClient>;
|
|
13
|
+
};
|
|
14
|
+
subject: {
|
|
15
|
+
type: PropType<CommentSubject>;
|
|
16
|
+
};
|
|
17
|
+
user: {
|
|
18
|
+
type: PropType<CommentUser>;
|
|
19
|
+
};
|
|
20
|
+
comments: {
|
|
21
|
+
type: PropType<CommentsState>;
|
|
22
|
+
};
|
|
23
|
+
people: {
|
|
24
|
+
default: () => never[];
|
|
25
|
+
type: PropType<AvatarStackPerson[]>;
|
|
26
|
+
};
|
|
27
|
+
hotkey: {
|
|
28
|
+
default: string;
|
|
29
|
+
type: PropType<string | false>;
|
|
30
|
+
};
|
|
31
|
+
readOnly: {
|
|
32
|
+
default: boolean;
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
};
|
|
35
|
+
subjectUrl: {
|
|
36
|
+
type: PropType<(subject: CommentSubject) => string | undefined>;
|
|
37
|
+
};
|
|
38
|
+
navigate: {
|
|
39
|
+
type: PropType<(href: string) => void>;
|
|
40
|
+
};
|
|
41
|
+
can: {
|
|
42
|
+
type: PropType<CommentCan>;
|
|
43
|
+
};
|
|
44
|
+
upload: {
|
|
45
|
+
type: PropType<CommentUpload>;
|
|
46
|
+
};
|
|
47
|
+
queueFiles: {
|
|
48
|
+
default: boolean;
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
accept: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
attachmentUrl: {
|
|
55
|
+
type: PropType<CommentAttachmentUrl>;
|
|
56
|
+
};
|
|
57
|
+
placement: {
|
|
58
|
+
default: string;
|
|
59
|
+
type: PropType<CommentPlacement>;
|
|
60
|
+
};
|
|
61
|
+
size: {
|
|
62
|
+
default: string;
|
|
63
|
+
type: PropType<CommentComposerSize>;
|
|
64
|
+
};
|
|
65
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
|
+
client: {
|
|
69
|
+
type: PropType<CommentsClient>;
|
|
70
|
+
};
|
|
71
|
+
subject: {
|
|
72
|
+
type: PropType<CommentSubject>;
|
|
73
|
+
};
|
|
74
|
+
user: {
|
|
75
|
+
type: PropType<CommentUser>;
|
|
76
|
+
};
|
|
77
|
+
comments: {
|
|
78
|
+
type: PropType<CommentsState>;
|
|
79
|
+
};
|
|
80
|
+
people: {
|
|
81
|
+
default: () => never[];
|
|
82
|
+
type: PropType<AvatarStackPerson[]>;
|
|
83
|
+
};
|
|
84
|
+
hotkey: {
|
|
85
|
+
default: string;
|
|
86
|
+
type: PropType<string | false>;
|
|
87
|
+
};
|
|
88
|
+
readOnly: {
|
|
89
|
+
default: boolean;
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
};
|
|
92
|
+
subjectUrl: {
|
|
93
|
+
type: PropType<(subject: CommentSubject) => string | undefined>;
|
|
94
|
+
};
|
|
95
|
+
navigate: {
|
|
96
|
+
type: PropType<(href: string) => void>;
|
|
97
|
+
};
|
|
98
|
+
can: {
|
|
99
|
+
type: PropType<CommentCan>;
|
|
100
|
+
};
|
|
101
|
+
upload: {
|
|
102
|
+
type: PropType<CommentUpload>;
|
|
103
|
+
};
|
|
104
|
+
queueFiles: {
|
|
105
|
+
default: boolean;
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
};
|
|
108
|
+
accept: {
|
|
109
|
+
type: StringConstructor;
|
|
110
|
+
};
|
|
111
|
+
attachmentUrl: {
|
|
112
|
+
type: PropType<CommentAttachmentUrl>;
|
|
113
|
+
};
|
|
114
|
+
placement: {
|
|
115
|
+
default: string;
|
|
116
|
+
type: PropType<CommentPlacement>;
|
|
117
|
+
};
|
|
118
|
+
size: {
|
|
119
|
+
default: string;
|
|
120
|
+
type: PropType<CommentComposerSize>;
|
|
121
|
+
};
|
|
122
|
+
}>> & Readonly<{}>, {
|
|
123
|
+
size: CommentComposerSize;
|
|
124
|
+
people: AvatarStackPerson[];
|
|
125
|
+
hotkey: string | false;
|
|
126
|
+
readOnly: boolean;
|
|
127
|
+
queueFiles: boolean;
|
|
128
|
+
placement: CommentPlacement;
|
|
129
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
130
|
+
export { CommentPlacement as n, CommentLayer as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as CommentsState } from "./comments-
|
|
1
|
+
import { s as CommentsState } from "./comments-OWjNidkP.js";
|
|
2
2
|
import { n as AvatarStackPerson } from "./avatar-stack-C0IKwj6g.js";
|
|
3
|
-
import { s as CommentRowSlots } from "./comment-panel-
|
|
3
|
+
import { s as CommentRowSlots } from "./comment-panel-DoLDOw3E.js";
|
|
4
4
|
import { PropType, SlotsType } from "vue";
|
|
5
5
|
declare const CommentFilters: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
comments: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as CommentsState, t as CommentCan } from "./comments-
|
|
2
|
-
import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-
|
|
1
|
+
import { s as CommentsState, t as CommentCan } from "./comments-OWjNidkP.js";
|
|
2
|
+
import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-DPV2kqA4.js";
|
|
3
3
|
import { PropType, SlotsType, VNode } from "vue";
|
|
4
4
|
import { CommentStatus, CommentSubject, CommentThread, CommentUser, CommentsClient } from "@vite-hub/comments/client";
|
|
5
5
|
type CommentPanelVariant = "docked" | "floating";
|
|
@@ -31,162 +31,122 @@ type CommentPanelSlots = CommentThreadSlots & CommentRowSlots & {
|
|
|
31
31
|
/** Puts a thread under a heading of the list, such as `"From earlier versions"`. `undefined` keeps it in the first, unnamed group. */
|
|
32
32
|
type CommentGroup = (thread: CommentThread) => string | undefined;
|
|
33
33
|
declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
34
|
-
/** A state from `useComments()`. Defaults to the state of the nearest `CommentLayer` or `provideComments()`. */
|
|
35
34
|
comments: {
|
|
36
35
|
type: PropType<CommentsState>;
|
|
37
36
|
};
|
|
38
|
-
/** The client, for a panel that is not inside a `CommentLayer`. Give it with `subject`. */
|
|
39
37
|
client: {
|
|
40
38
|
type: PropType<CommentsClient>;
|
|
41
39
|
};
|
|
42
|
-
/** What the threads are about, with `client`. */
|
|
43
40
|
subject: {
|
|
44
41
|
type: PropType<CommentSubject>;
|
|
45
42
|
};
|
|
46
|
-
/** The signed-in user, with `client`. Defaults to the client's user. */
|
|
47
43
|
user: {
|
|
48
44
|
type: PropType<CommentUser>;
|
|
49
45
|
};
|
|
50
|
-
/** `docked` fills its container, such as a side column. `floating` is a card over the page. */
|
|
51
46
|
variant: {
|
|
52
47
|
default: string;
|
|
53
48
|
type: PropType<CommentPanelVariant>;
|
|
54
49
|
};
|
|
55
|
-
/** The id of the open thread. Use `v-model:thread`. `null` shows the list. */
|
|
56
50
|
thread: {
|
|
57
51
|
default: undefined;
|
|
58
52
|
type: PropType<string | null>;
|
|
59
53
|
};
|
|
60
|
-
/** Which threads the list shows. Use `v-model:status`. */
|
|
61
54
|
status: {
|
|
62
55
|
type: PropType<CommentStatus>;
|
|
63
56
|
};
|
|
64
|
-
/** The heading of the list. */
|
|
65
57
|
title: {
|
|
66
58
|
default: string;
|
|
67
59
|
type: StringConstructor;
|
|
68
60
|
};
|
|
69
|
-
/** Hide the page box and every reply, edit, delete, and status control. */
|
|
70
61
|
readOnly: {
|
|
71
62
|
default: boolean;
|
|
72
63
|
type: BooleanConstructor;
|
|
73
64
|
};
|
|
74
|
-
/** Turns attached files into attachment keys before the comment is saved or sent. */
|
|
75
65
|
upload: {
|
|
76
66
|
type: PropType<CommentUpload>;
|
|
77
67
|
};
|
|
78
|
-
/** Save raw files with outbox entries. Set only when the server accepts file uploads. `upload` takes precedence. */
|
|
79
68
|
queueFiles: {
|
|
80
69
|
default: boolean;
|
|
81
70
|
type: BooleanConstructor;
|
|
82
71
|
};
|
|
83
|
-
/** The file types that the boxes take, such as `image/*`. */
|
|
84
72
|
accept: {
|
|
85
73
|
type: StringConstructor;
|
|
86
74
|
};
|
|
87
|
-
/** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
|
|
88
75
|
attachmentUrl: {
|
|
89
76
|
type: PropType<CommentAttachmentUrl>;
|
|
90
77
|
};
|
|
91
|
-
/** Send a new page comment that has files and no text. */
|
|
92
78
|
allowEmpty: {
|
|
93
79
|
default: boolean;
|
|
94
80
|
type: BooleanConstructor;
|
|
95
81
|
};
|
|
96
|
-
/** People that messages may mention, on top of the people that the comments state knows. */
|
|
97
82
|
people: {
|
|
98
83
|
default: () => never[];
|
|
99
84
|
type: PropType<CommentUser[]>;
|
|
100
85
|
};
|
|
101
|
-
/** What the signed-in user may do in a thread. Defaults to the `can` of the comments state. */
|
|
102
86
|
can: {
|
|
103
87
|
type: PropType<CommentCan>;
|
|
104
88
|
};
|
|
105
|
-
/**
|
|
106
|
-
* Groups the rows under headings, in the order the groups first appear. Threads without a group come first. Without a
|
|
107
|
-
* group callback, a resolved thread that Open lists for a later reply goes under "Replied since resolved".
|
|
108
|
-
*/
|
|
109
89
|
group: {
|
|
110
90
|
type: PropType<CommentGroup>;
|
|
111
91
|
};
|
|
112
92
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
113
93
|
[key: string]: any;
|
|
114
94
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:thread" | "update:status")[], "select" | "update:thread" | "update:status", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
115
|
-
/** A state from `useComments()`. Defaults to the state of the nearest `CommentLayer` or `provideComments()`. */
|
|
116
95
|
comments: {
|
|
117
96
|
type: PropType<CommentsState>;
|
|
118
97
|
};
|
|
119
|
-
/** The client, for a panel that is not inside a `CommentLayer`. Give it with `subject`. */
|
|
120
98
|
client: {
|
|
121
99
|
type: PropType<CommentsClient>;
|
|
122
100
|
};
|
|
123
|
-
/** What the threads are about, with `client`. */
|
|
124
101
|
subject: {
|
|
125
102
|
type: PropType<CommentSubject>;
|
|
126
103
|
};
|
|
127
|
-
/** The signed-in user, with `client`. Defaults to the client's user. */
|
|
128
104
|
user: {
|
|
129
105
|
type: PropType<CommentUser>;
|
|
130
106
|
};
|
|
131
|
-
/** `docked` fills its container, such as a side column. `floating` is a card over the page. */
|
|
132
107
|
variant: {
|
|
133
108
|
default: string;
|
|
134
109
|
type: PropType<CommentPanelVariant>;
|
|
135
110
|
};
|
|
136
|
-
/** The id of the open thread. Use `v-model:thread`. `null` shows the list. */
|
|
137
111
|
thread: {
|
|
138
112
|
default: undefined;
|
|
139
113
|
type: PropType<string | null>;
|
|
140
114
|
};
|
|
141
|
-
/** Which threads the list shows. Use `v-model:status`. */
|
|
142
115
|
status: {
|
|
143
116
|
type: PropType<CommentStatus>;
|
|
144
117
|
};
|
|
145
|
-
/** The heading of the list. */
|
|
146
118
|
title: {
|
|
147
119
|
default: string;
|
|
148
120
|
type: StringConstructor;
|
|
149
121
|
};
|
|
150
|
-
/** Hide the page box and every reply, edit, delete, and status control. */
|
|
151
122
|
readOnly: {
|
|
152
123
|
default: boolean;
|
|
153
124
|
type: BooleanConstructor;
|
|
154
125
|
};
|
|
155
|
-
/** Turns attached files into attachment keys before the comment is saved or sent. */
|
|
156
126
|
upload: {
|
|
157
127
|
type: PropType<CommentUpload>;
|
|
158
128
|
};
|
|
159
|
-
/** Save raw files with outbox entries. Set only when the server accepts file uploads. `upload` takes precedence. */
|
|
160
129
|
queueFiles: {
|
|
161
130
|
default: boolean;
|
|
162
131
|
type: BooleanConstructor;
|
|
163
132
|
};
|
|
164
|
-
/** The file types that the boxes take, such as `image/*`. */
|
|
165
133
|
accept: {
|
|
166
134
|
type: StringConstructor;
|
|
167
135
|
};
|
|
168
|
-
/** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
|
|
169
136
|
attachmentUrl: {
|
|
170
137
|
type: PropType<CommentAttachmentUrl>;
|
|
171
138
|
};
|
|
172
|
-
/** Send a new page comment that has files and no text. */
|
|
173
139
|
allowEmpty: {
|
|
174
140
|
default: boolean;
|
|
175
141
|
type: BooleanConstructor;
|
|
176
142
|
};
|
|
177
|
-
/** People that messages may mention, on top of the people that the comments state knows. */
|
|
178
143
|
people: {
|
|
179
144
|
default: () => never[];
|
|
180
145
|
type: PropType<CommentUser[]>;
|
|
181
146
|
};
|
|
182
|
-
/** What the signed-in user may do in a thread. Defaults to the `can` of the comments state. */
|
|
183
147
|
can: {
|
|
184
148
|
type: PropType<CommentCan>;
|
|
185
149
|
};
|
|
186
|
-
/**
|
|
187
|
-
* Groups the rows under headings, in the order the groups first appear. Threads without a group come first. Without a
|
|
188
|
-
* group callback, a resolved thread that Open lists for a later reply goes under "Replied since resolved".
|
|
189
|
-
*/
|
|
190
150
|
group: {
|
|
191
151
|
type: PropType<CommentGroup>;
|
|
192
152
|
};
|
|
@@ -60,7 +60,7 @@ declare const CommentPin: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
60
60
|
onLeave?: ((...args: any[]) => any) | undefined;
|
|
61
61
|
}>, {
|
|
62
62
|
active: boolean;
|
|
63
|
-
status: CommentStatus;
|
|
64
63
|
draft: boolean;
|
|
64
|
+
status: CommentStatus;
|
|
65
65
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
66
|
export { CommentPin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as prepareAnnouncer, t as announce } from "./announce-B0DLwflT.js";
|
|
2
2
|
import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
|
|
3
|
-
import { o as motionSkipped } from "./ring-
|
|
3
|
+
import { o as motionSkipped } from "./ring-GaJsg32c.js";
|
|
4
4
|
import { r as createSpring } from "./opt-out-D66l60sg.js";
|
|
5
5
|
import { useCopy } from "./parts/components/copy-button.js";
|
|
6
6
|
import { defineComponent, h, nextTick, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, ref, shallowRef, watch } from "vue";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/internal/comment-status.ts
|
|
2
|
+
/** The messages written after the thread was resolved. Empty for an open thread. */
|
|
3
|
+
function messagesSinceResolved(thread) {
|
|
4
|
+
const { resolvedAt } = thread;
|
|
5
|
+
if (thread.status !== "resolved" || resolvedAt === void 0) return [];
|
|
6
|
+
return thread.messages.filter((message) => message.createdAt > resolvedAt);
|
|
7
|
+
}
|
|
8
|
+
const repliedSinceResolved = (thread) => messagesSinceResolved(thread).length > 0;
|
|
9
|
+
/** "Comment 3". A comment that waits in the outbox has no number yet. */
|
|
10
|
+
function commentTitle(thread) {
|
|
11
|
+
return thread.n ? `Comment ${thread.n}` : "Comment";
|
|
12
|
+
}
|
|
13
|
+
/** `data-pending` or `data-failed` for a thread, message, or row that the outbox holds. */
|
|
14
|
+
function deliveryAttributes(delivery) {
|
|
15
|
+
return {
|
|
16
|
+
"data-failed": delivery?.status === "failed" ? "true" : void 0,
|
|
17
|
+
"data-pending": delivery?.status === "pending" ? "true" : void 0
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export { repliedSinceResolved as i, deliveryAttributes as n, messagesSinceResolved as r, commentTitle as t };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { t as CommentCan } from "./comments-
|
|
2
|
-
import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-
|
|
1
|
+
import { t as CommentCan } from "./comments-OWjNidkP.js";
|
|
2
|
+
import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-DmDM3XYP.js";
|
|
3
3
|
import { PropType, SlotsType, VNode } from "vue";
|
|
4
4
|
import { CommentDelivery, CommentMessage, CommentThread, CommentUser } from "@vite-hub/comments/client";
|
|
5
5
|
/** The messages written after the thread was resolved. Empty for an open thread. */
|
|
6
6
|
declare function messagesSinceResolved(thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">): CommentMessage[];
|
|
7
|
-
/**
|
|
8
|
-
* Whether someone replied after the thread was resolved, such as an agent that says what it changed. The thread stays
|
|
9
|
-
* resolved, and lists show it with the open threads until someone resolves it again.
|
|
10
|
-
*/
|
|
11
7
|
declare const repliedSinceResolved: (thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">) => boolean;
|
|
12
8
|
type Done = Promise<unknown> | void;
|
|
13
9
|
/** An attachment as `attachmentUrl` describes it: its URL, and the file name and media type when the key does not say. */
|
|
@@ -369,11 +365,11 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
|
|
|
369
365
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
370
366
|
}>, {
|
|
371
367
|
size: CommentComposerSize;
|
|
372
|
-
|
|
368
|
+
preview: boolean;
|
|
373
369
|
busy: boolean;
|
|
370
|
+
people: CommentUser[];
|
|
374
371
|
attachments: boolean;
|
|
375
372
|
readOnly: boolean;
|
|
376
|
-
preview: boolean;
|
|
377
373
|
detached: boolean;
|
|
378
374
|
navigation: "close" | "back";
|
|
379
375
|
dismissible: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { RollNumber } from "./parts/components/motion.js";
|
|
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-
|
|
3
|
-
import { n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-
|
|
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 { n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-X7vJKh5b.js";
|
|
4
4
|
import { a as writerName, o as writerPerson, t as displayName } from "./comment-person-D_IyIjXo.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { n as deliveryAttributes, r as messagesSinceResolved, t as commentTitle } from "./comment-status-nsCdrRk_.js";
|
|
6
|
+
import { t as defaultCommentCan } from "./comments-9MDSNm-9.js";
|
|
7
|
+
import { a as useViteHubUIIcons } from "./config-LRonN53j.js";
|
|
8
|
+
import { t as travel } from "./travel-BliEidau.js";
|
|
8
9
|
import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
|
|
9
10
|
import { Attachment, AttachmentContent, AttachmentGroup, AttachmentMedia, AttachmentTitle } from "./parts/components/attachment.js";
|
|
10
11
|
import { AvatarStack } from "./parts/components/avatar-stack.js";
|
|
@@ -678,7 +679,6 @@ const CommentThread = defineComponent({
|
|
|
678
679
|
const { thread } = props;
|
|
679
680
|
const resolved = thread.status === "resolved";
|
|
680
681
|
const later = messagesSinceResolved(thread);
|
|
681
|
-
const resolvable = !resolved || later.length > 0;
|
|
682
682
|
const first = thread.messages[0];
|
|
683
683
|
const quote = thread.anchor.kind === "text" ? thread.anchor.exact : void 0;
|
|
684
684
|
if (props.preview) {
|
|
@@ -725,10 +725,10 @@ const CommentThread = defineComponent({
|
|
|
725
725
|
h("span", { "data-slot": "comment-thread-spacer" }),
|
|
726
726
|
slots.actions ? h("div", { "data-slot": "comment-thread-actions" }, slots.actions({ thread })) : null,
|
|
727
727
|
!allowed("resolve") ? null : h(UButton, {
|
|
728
|
-
"aria-label":
|
|
728
|
+
"aria-label": resolved ? "Reopen" : "Resolve",
|
|
729
729
|
color: "neutral",
|
|
730
|
-
icon:
|
|
731
|
-
onClick: () => void act(
|
|
730
|
+
icon: resolved ? icons.value.reopen : icons.value.check,
|
|
731
|
+
onClick: () => void act(resolved ? props.onReopen : props.onResolve),
|
|
732
732
|
size: "xs",
|
|
733
733
|
variant: "ghost"
|
|
734
734
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
|
|
2
2
|
import { createCommentVisibility } from "./parts/headless/comment-visibility.js";
|
|
3
|
-
import { a as hasDirtyComposer, n as injectComments, s as shakeDirtyComposers, t as commentsKey } from "./comments-context-
|
|
3
|
+
import { a as hasDirtyComposer, n as injectComments, s as shakeDirtyComposers, t as commentsKey } from "./comments-context-3js2YFl2.js";
|
|
4
4
|
import { computed, getCurrentInstance, isRef, onBeforeUnmount, onMounted, provide, reactive, ref, shallowRef, toRaw, toValue, watch } from "vue";
|
|
5
5
|
import { createAnchor, resolveAnchor } from "@vite-hub/comments/client";
|
|
6
6
|
// src/internal/comment-selection.ts
|
|
@@ -26,29 +26,6 @@ function useSelectedComment(threads, id) {
|
|
|
26
26
|
});
|
|
27
27
|
return computed(() => selection.value.thread);
|
|
28
28
|
}
|
|
29
|
-
// src/internal/comment-status.ts
|
|
30
|
-
/** The messages written after the thread was resolved. Empty for an open thread. */
|
|
31
|
-
function messagesSinceResolved(thread) {
|
|
32
|
-
const { resolvedAt } = thread;
|
|
33
|
-
if (thread.status !== "resolved" || resolvedAt === void 0) return [];
|
|
34
|
-
return thread.messages.filter((message) => message.createdAt > resolvedAt);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Whether someone replied after the thread was resolved, such as an agent that says what it changed. The thread stays
|
|
38
|
-
* resolved, and lists show it with the open threads until someone resolves it again.
|
|
39
|
-
*/
|
|
40
|
-
const repliedSinceResolved = (thread) => messagesSinceResolved(thread).length > 0;
|
|
41
|
-
/** "Comment 3". A comment that waits in the outbox has no number yet. */
|
|
42
|
-
function commentTitle(thread) {
|
|
43
|
-
return thread.n ? `Comment ${thread.n}` : "Comment";
|
|
44
|
-
}
|
|
45
|
-
/** `data-pending` or `data-failed` for a thread, message, or row that the outbox holds. */
|
|
46
|
-
function deliveryAttributes(delivery) {
|
|
47
|
-
return {
|
|
48
|
-
"data-failed": delivery?.status === "failed" ? "true" : void 0,
|
|
49
|
-
"data-pending": delivery?.status === "pending" ? "true" : void 0
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
29
|
// src/headless/comments.ts
|
|
53
30
|
/**
|
|
54
31
|
* The permissions that the parts assume without a `can` option: a signed-in user may reply to and resolve any thread,
|
|
@@ -63,6 +40,7 @@ function defaultCommentCan(user) {
|
|
|
63
40
|
}
|
|
64
41
|
const draftPositionKey = "draft";
|
|
65
42
|
const uiSelector = "[data-comments-ui]";
|
|
43
|
+
const draftComposerSelector = "[data-draft] [data-slot='comment-composer']";
|
|
66
44
|
function defaultIgnore(element) {
|
|
67
45
|
for (let node = element; node;) {
|
|
68
46
|
if (node.closest(uiSelector)) return true;
|
|
@@ -82,6 +60,7 @@ function samePosition(a, b) {
|
|
|
82
60
|
}
|
|
83
61
|
const editableSelector = "input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='combobox'], [role='searchbox']";
|
|
84
62
|
const isEditable = (path) => path.some((element) => element.matches(editableSelector));
|
|
63
|
+
const someFiles = (files) => files !== void 0 && (!Array.isArray(files) || files.length > 0);
|
|
85
64
|
function describeError(error) {
|
|
86
65
|
return error instanceof Error ? error.message : "The comment could not be sent. Try again.";
|
|
87
66
|
}
|
|
@@ -128,7 +107,7 @@ function useComments(options) {
|
|
|
128
107
|
const hoverId = ref(null);
|
|
129
108
|
const listOpen = ref(false);
|
|
130
109
|
const blocked = ref(0);
|
|
131
|
-
const isOpen = (thread) => thread.status === "open"
|
|
110
|
+
const isOpen = (thread) => thread.status === "open";
|
|
132
111
|
const passes = (thread) => {
|
|
133
112
|
if (!(filters.open && isOpen(thread) || filters.resolved && thread.status === "resolved")) return false;
|
|
134
113
|
return !filters.mine || thread.author.id === user.value?.id;
|
|
@@ -184,7 +163,7 @@ function useComments(options) {
|
|
|
184
163
|
const previous = positions.value;
|
|
185
164
|
if (!(next.size === previous.size && [...next].every(([key, position]) => samePosition(position, previous.get(key))))) positions.value = next;
|
|
186
165
|
}
|
|
187
|
-
const hasText = () => (draft.value?.body.trim().length ?? 0) > 0 || hasDirtyComposer(uiRoot());
|
|
166
|
+
const hasText = () => (draft.value?.body.trim().length ?? 0) > 0 || hasDirtyComposer(uiRoot(), draft.value ? void 0 : draftComposerSelector);
|
|
188
167
|
const block = (escape = false) => {
|
|
189
168
|
blocked.value++;
|
|
190
169
|
shakeDirtyComposers(uiRoot(), escape);
|
|
@@ -267,22 +246,36 @@ function useComments(options) {
|
|
|
267
246
|
async function send(sendOptions = {}) {
|
|
268
247
|
const current = draft.value;
|
|
269
248
|
const body = current?.body.trim() ?? "";
|
|
270
|
-
const files = sendOptions.files
|
|
271
|
-
|
|
249
|
+
const files = sendOptions.files;
|
|
250
|
+
const hasFiles = someFiles(files);
|
|
251
|
+
if (!current || current.busy || !body && current.attachments.length === 0 && !hasFiles) return void 0;
|
|
272
252
|
const submittedBody = current.body;
|
|
273
253
|
const mentions = [...current.mentions];
|
|
274
254
|
const attachments = [...current.attachments];
|
|
275
|
-
|
|
255
|
+
const input = {
|
|
256
|
+
subject: subject.value,
|
|
257
|
+
anchor: toRaw(current.anchor),
|
|
258
|
+
body,
|
|
259
|
+
mentions,
|
|
260
|
+
...attachments.length > 0 ? { attachments } : {},
|
|
261
|
+
...hasFiles ? { files } : {}
|
|
262
|
+
};
|
|
276
263
|
current.error = void 0;
|
|
264
|
+
if (client.outbox) {
|
|
265
|
+
draft.value = null;
|
|
266
|
+
try {
|
|
267
|
+
const thread = await client.create(input);
|
|
268
|
+
flash(thread.id);
|
|
269
|
+
return thread;
|
|
270
|
+
} catch (error) {
|
|
271
|
+
current.error = describeError(error);
|
|
272
|
+
if (!draft.value) draft.value = current;
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
current.busy = true;
|
|
277
277
|
try {
|
|
278
|
-
const thread = await client.create(
|
|
279
|
-
subject: subject.value,
|
|
280
|
-
anchor: toRaw(current.anchor),
|
|
281
|
-
body,
|
|
282
|
-
mentions,
|
|
283
|
-
...attachments.length > 0 ? { attachments } : {},
|
|
284
|
-
...files.length > 0 ? { files } : {}
|
|
285
|
-
});
|
|
278
|
+
const thread = await client.create(input);
|
|
286
279
|
current.busy = false;
|
|
287
280
|
flash(thread.id);
|
|
288
281
|
if (draft.value === current && current.body === submittedBody && current.mentions.length === mentions.length && current.mentions.every((id, index) => id === mentions[index])) draft.value = null;
|
|
@@ -542,7 +535,7 @@ function useComments(options) {
|
|
|
542
535
|
body,
|
|
543
536
|
mentions,
|
|
544
537
|
...attachments?.length ? { attachments } : {},
|
|
545
|
-
...files
|
|
538
|
+
...someFiles(files) ? { files } : {}
|
|
546
539
|
});
|
|
547
540
|
flash(thread.id);
|
|
548
541
|
return thread;
|
|
@@ -553,7 +546,7 @@ function useComments(options) {
|
|
|
553
546
|
body,
|
|
554
547
|
mentions,
|
|
555
548
|
...attachments?.length ? { attachments } : {},
|
|
556
|
-
...files
|
|
549
|
+
...someFiles(files) ? { files } : {}
|
|
557
550
|
});
|
|
558
551
|
flash(threadId);
|
|
559
552
|
return thread;
|
|
@@ -601,4 +594,4 @@ function useCommentsContext(state) {
|
|
|
601
594
|
if (!found) throw uiErrorDiagnostics.UI_R0002({ message: "Comment parts need a comments state. Put them inside CommentLayer, or pass the result of useComments() as the `comments` prop." });
|
|
602
595
|
return found;
|
|
603
596
|
}
|
|
604
|
-
export { useCommentsContext as a,
|
|
597
|
+
export { useCommentsContext as a, useComments as i, draftPositionKey as n, commentThreadKey as o, provideComments as r, useSelectedComment as s, defaultCommentCan as t };
|
|
@@ -154,11 +154,12 @@ interface CommentsState {
|
|
|
154
154
|
cancelDraft: () => void;
|
|
155
155
|
/**
|
|
156
156
|
* Sends the draft. Resolves with the new thread, or `undefined` when there is nothing to send or the send failed. With
|
|
157
|
-
* an outbox
|
|
158
|
-
*
|
|
157
|
+
* an outbox the draft closes at once and the comment shows as pending, so the next draft can start while it is saved
|
|
158
|
+
* and sent; a failure shows on that comment. Without one, the draft is `busy` until the server answers. `files` go
|
|
159
|
+
* with the comment; with an outbox they may be a promise, such as a screenshot that renders after Send.
|
|
159
160
|
*/
|
|
160
161
|
send: (options?: {
|
|
161
|
-
files?: Blob[]
|
|
162
|
+
files?: Blob[] | Promise<Blob[]>;
|
|
162
163
|
}) => Promise<CommentThread | undefined>;
|
|
163
164
|
open: (thread: CommentThread | string, options?: {
|
|
164
165
|
scroll?: boolean;
|
|
@@ -170,10 +171,10 @@ interface CommentsState {
|
|
|
170
171
|
body: string;
|
|
171
172
|
mentions?: string[];
|
|
172
173
|
attachments?: string[];
|
|
173
|
-
files?: Blob[]
|
|
174
|
+
files?: Blob[] | Promise<Blob[]>;
|
|
174
175
|
anchor?: CommentAnchor;
|
|
175
176
|
}) => Promise<CommentThread>;
|
|
176
|
-
reply: (threadId: string, body: string, mentions?: string[], attachments?: string[], files?: Blob[]) => Promise<CommentThread>;
|
|
177
|
+
reply: (threadId: string, body: string, mentions?: string[], attachments?: string[], files?: Blob[] | Promise<Blob[]>) => Promise<CommentThread>;
|
|
177
178
|
edit: (threadId: string, messageId: string, body: string, mentions?: string[]) => Promise<CommentThread>;
|
|
178
179
|
remove: (threadId: string, messageId?: string) => Promise<CommentThread | null>;
|
|
179
180
|
resolve: (threadId: string) => Promise<CommentThread>;
|