@commentkit/comment-kit 0.7.4 → 0.7.6
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/CHANGELOG.md +26 -0
- package/README.md +3 -3
- package/SECURITY.md +1 -1
- package/dist/angular.es.js +2 -2
- package/dist/comment-kit.es.js +3 -3
- package/dist/demo.es.js +24 -15
- package/dist/headless.es.js +2 -2
- package/dist/preact.es.js +2 -2
- package/dist/qwik.qwik.mjs +2 -2
- package/dist/react.es.js +2 -2
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +11 -0
- package/dist/shared/annotation-toolbar-RSrb0Nku.js +1086 -0
- package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-CSTYwRW-.js} +3 -3
- package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
- package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
- package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-DbuXP54N.js} +2 -2
- package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
- package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-zlIGEVA-.js} +7 -7
- package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-aYbJb79_.js} +38 -38
- package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-B0k7XsMz.js} +742 -746
- package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BXLJcZYQ.js} +5310 -5718
- package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-ChWwYJzO.js} +2 -2
- package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-Bufg3rHz.js} +6 -6
- package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-DAZenvgD.js} +6 -6
- package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-O8q25zar.js} +48 -47
- package/dist/shared/dist-D9A5k-N4.js +617 -0
- package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-CYkwzfEr.js} +349 -347
- package/dist/shared/input-UPtAj0M6.js +111 -0
- package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-BKaWBhKq.js} +4 -4
- package/dist/shared/{pusher-D4M5K6Dk.js → pusher-BUaiCkDJ.js} +1 -1
- package/dist/shared/{realtime-BTqYEy8s.js → realtime-C0Z8dXXH.js} +41 -28
- package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
- package/dist/shared/screenshot-B-ZfFItT.js +199 -0
- package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
- package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-Cd3SLHyj.js} +3 -5
- package/dist/shared/{token-session-D0Y_HZw0.js → token-session-DplW5QDx.js} +2 -2
- package/dist/shared/useLabelableId-8n0QmH8N.js +154 -0
- package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
- package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
- package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-798cRDyL.js} +2 -2
- package/dist/solid.es.js +2 -2
- package/dist/svelte.es.js +2 -2
- package/dist/types/core/api-client.d.ts +19 -9
- package/dist/types/core/comment-kit-core.d.ts +8 -4
- package/dist/types/core/types.d.ts +49 -9
- package/dist/types/core/write-access.d.ts +2 -0
- package/dist/vue.es.js +2 -2
- package/docs/api-reference.md +30 -18
- package/package.json +1 -1
- package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
- package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
- package/dist/shared/dist-De294MVF.js +0 -623
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as e, r as t } from "./mount-ui-
|
|
2
|
-
import { i as n, n as r, t as i } from "./ShadowRootContext-
|
|
1
|
+
import { o as e, r as t } from "./mount-ui-BKaWBhKq.js";
|
|
2
|
+
import { i as n, n as r, t as i } from "./ShadowRootContext-DD6a0QaI.js";
|
|
3
3
|
import * as a from "react";
|
|
4
4
|
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
5
5
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
@@ -10,9 +10,7 @@ var h = function(e) {
|
|
|
10
10
|
value: r,
|
|
11
11
|
children: e.children
|
|
12
12
|
});
|
|
13
|
-
};
|
|
14
|
-
process.env.NODE_ENV !== "production" && (h.displayName = "DirectionProvider");
|
|
15
|
-
var g = "https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap";
|
|
13
|
+
}, g = "https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap";
|
|
16
14
|
function _() {
|
|
17
15
|
/* v8 ignore stop */
|
|
18
16
|
if (typeof document > "u" || document.querySelector("link[data-commentkit-font]")) return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as e } from "./validation-3wbbbuX0.js";
|
|
2
|
-
import { _ as t, a as n, i as r, o as i } from "./comment-kit-core-
|
|
2
|
+
import { _ as t, a as n, i as r, o as i } from "./comment-kit-core-B0k7XsMz.js";
|
|
3
3
|
async function a(a, o, s, c) {
|
|
4
4
|
if (!s()) return !1;
|
|
5
5
|
if (!e(o, 4096)) throw Error("Invalid member session token");
|
|
@@ -8,7 +8,7 @@ async function a(a, o, s, c) {
|
|
|
8
8
|
let d = await u.verifySession();
|
|
9
9
|
if (!s()) return !1;
|
|
10
10
|
if (d.success !== !0 || d.verified !== !0 || !n(d.user) || !r(d.project) || d.project.id !== a.config.projectId) throw Error("Member session could not be verified");
|
|
11
|
-
return a.apiClient.setAuthToken(l), a.apiClient.setUserEmail(d.user.email), c && i(a.config.projectId, {
|
|
11
|
+
return a.apiClient.setAuthToken(l), a.apiClient.setUserEmail(d.user.email), a.config.inviteToken = void 0, c && i(a.config.projectId, {
|
|
12
12
|
token: l,
|
|
13
13
|
email: d.user.email,
|
|
14
14
|
user: d.user
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { F as e, L as t, P as n, R as r, f as i, z as a } from "./button-D4GHW6oZ.js";
|
|
2
|
+
import { n as o } from "./useValueChanged-DKq5cMot.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
var c = "data-valid", l = "data-invalid", u = {
|
|
5
|
+
badInput: !1,
|
|
6
|
+
customError: !1,
|
|
7
|
+
patternMismatch: !1,
|
|
8
|
+
rangeOverflow: !1,
|
|
9
|
+
rangeUnderflow: !1,
|
|
10
|
+
stepMismatch: !1,
|
|
11
|
+
tooLong: !1,
|
|
12
|
+
tooShort: !1,
|
|
13
|
+
typeMismatch: !1,
|
|
14
|
+
valid: null,
|
|
15
|
+
valueMissing: !1
|
|
16
|
+
}, d = {
|
|
17
|
+
valid: null,
|
|
18
|
+
touched: !1,
|
|
19
|
+
dirty: !1,
|
|
20
|
+
filled: !1,
|
|
21
|
+
focused: !1
|
|
22
|
+
}, f = {
|
|
23
|
+
disabled: !1,
|
|
24
|
+
...d
|
|
25
|
+
}, p = { valid(e) {
|
|
26
|
+
return e === null ? null : e ? { [c]: "" } : { [l]: "" };
|
|
27
|
+
} }, m = {
|
|
28
|
+
invalid: void 0,
|
|
29
|
+
name: void 0,
|
|
30
|
+
validityData: {
|
|
31
|
+
state: u,
|
|
32
|
+
errors: [],
|
|
33
|
+
error: "",
|
|
34
|
+
value: "",
|
|
35
|
+
initialValue: null
|
|
36
|
+
},
|
|
37
|
+
setValidityData: r,
|
|
38
|
+
disabled: void 0,
|
|
39
|
+
setTouched: r,
|
|
40
|
+
setDirty: r,
|
|
41
|
+
setFilled: r,
|
|
42
|
+
setFocused: r,
|
|
43
|
+
focusOwnerRef: { current: void 0 },
|
|
44
|
+
validationMode: "onSubmit",
|
|
45
|
+
shouldValidateOnChange: () => !1,
|
|
46
|
+
state: f,
|
|
47
|
+
registerFieldControl: r,
|
|
48
|
+
validation: {
|
|
49
|
+
getValidationProps: (e, n = t) => n,
|
|
50
|
+
inputRef: { current: null },
|
|
51
|
+
registeredInputs: /* @__PURE__ */ new Map(),
|
|
52
|
+
registerInput: r,
|
|
53
|
+
getInputControl: () => null,
|
|
54
|
+
commit: async () => {},
|
|
55
|
+
change: r
|
|
56
|
+
}
|
|
57
|
+
}, h = /*#__PURE__*/ s.createContext(m);
|
|
58
|
+
function g(e = !0) {
|
|
59
|
+
let t = s.useContext(h);
|
|
60
|
+
if (t.setValidityData === r && !e) throw Error(n(28));
|
|
61
|
+
return t;
|
|
62
|
+
}
|
|
63
|
+
function _(t, n, r) {
|
|
64
|
+
let { setFocused: a, focusOwnerRef: o } = g(), s = i((e) => {
|
|
65
|
+
(e ? !t : o.current === s) && (o.current = e && s, r?.(e), a(e));
|
|
66
|
+
});
|
|
67
|
+
return e(() => {
|
|
68
|
+
let e = n.current;
|
|
69
|
+
return e?.getRootNode()?.activeElement === e && s(!0), () => s(!1);
|
|
70
|
+
}, [
|
|
71
|
+
t,
|
|
72
|
+
n,
|
|
73
|
+
s
|
|
74
|
+
]), s;
|
|
75
|
+
}
|
|
76
|
+
function v(t, n, r, i, o = !0, s) {
|
|
77
|
+
let { registerFieldControl: c } = g(), l = a(() => Symbol());
|
|
78
|
+
e(() => {
|
|
79
|
+
let e = l.current;
|
|
80
|
+
o ? c(e, {
|
|
81
|
+
controlRef: t,
|
|
82
|
+
getValue: i,
|
|
83
|
+
id: n,
|
|
84
|
+
name: s,
|
|
85
|
+
value: r
|
|
86
|
+
}) : c(e, void 0);
|
|
87
|
+
}, [
|
|
88
|
+
t,
|
|
89
|
+
o,
|
|
90
|
+
i,
|
|
91
|
+
n,
|
|
92
|
+
s,
|
|
93
|
+
c,
|
|
94
|
+
l,
|
|
95
|
+
r
|
|
96
|
+
]), e(() => {
|
|
97
|
+
let e = l.current;
|
|
98
|
+
return () => {
|
|
99
|
+
c(e, void 0);
|
|
100
|
+
};
|
|
101
|
+
}, [c, l]);
|
|
102
|
+
}
|
|
103
|
+
var y = /*#__PURE__*/ s.createContext({
|
|
104
|
+
elementRef: { current: null },
|
|
105
|
+
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
106
|
+
errors: {},
|
|
107
|
+
clearErrors: r,
|
|
108
|
+
validationMode: "onSubmit",
|
|
109
|
+
submitCountRef: { current: 0 }
|
|
110
|
+
});
|
|
111
|
+
function b() {
|
|
112
|
+
return s.useContext(y);
|
|
113
|
+
}
|
|
114
|
+
var x = /*#__PURE__*/ s.createContext({
|
|
115
|
+
controlId: void 0,
|
|
116
|
+
registerControlId: r,
|
|
117
|
+
resetControlId: r,
|
|
118
|
+
labelId: void 0,
|
|
119
|
+
setLabelId: r,
|
|
120
|
+
messageIds: [],
|
|
121
|
+
setMessageIds: r,
|
|
122
|
+
getDescriptionProps: (e) => e
|
|
123
|
+
});
|
|
124
|
+
function S() {
|
|
125
|
+
return s.useContext(x);
|
|
126
|
+
}
|
|
127
|
+
function C(t = {}) {
|
|
128
|
+
let { id: n, enabled: c = !0 } = t, { controlId: l, registerControlId: u, resetControlId: d } = S(), f = o(), p = a(() => Symbol()), m = s.useRef(!1), h = s.useRef(!1), g = i(() => {
|
|
129
|
+
m.current && u !== r && (m.current = !1, u(p.current, void 0));
|
|
130
|
+
});
|
|
131
|
+
return e(() => {
|
|
132
|
+
if (!c || u === r) {
|
|
133
|
+
g();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
let e;
|
|
137
|
+
if (n !== void 0) h.current = !0, e = n;
|
|
138
|
+
else if (h.current) e = f;
|
|
139
|
+
else {
|
|
140
|
+
d();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
e === void 0 ? g() : (m.current = !0, u(p.current, e));
|
|
144
|
+
}, [
|
|
145
|
+
n,
|
|
146
|
+
c,
|
|
147
|
+
u,
|
|
148
|
+
d,
|
|
149
|
+
f,
|
|
150
|
+
p,
|
|
151
|
+
g
|
|
152
|
+
]), e(() => g, [g]), (c ? l : void 0) ?? n ?? f;
|
|
153
|
+
}
|
|
154
|
+
export { _ as a, g as c, v as i, d as l, S as n, m as o, b as r, h as s, C as t, p as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as e, I as t, L as n, f as r, p as i, z as a } from "./button-D4GHW6oZ.js";
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
function s(e) {
|
|
4
4
|
o.useEffect(e, t);
|
|
@@ -22,36 +22,36 @@ var c = 0, l = class e {
|
|
|
22
22
|
disposeEffect = () => this.clear;
|
|
23
23
|
};
|
|
24
24
|
function u() {
|
|
25
|
-
let e =
|
|
25
|
+
let e = a(l.create).current;
|
|
26
26
|
return s(e.disposeEffect), e;
|
|
27
27
|
}
|
|
28
|
-
function d(e, t,
|
|
29
|
-
let
|
|
28
|
+
function d(e, t, r, i) {
|
|
29
|
+
let a = !1, o = !1, s = i ?? n;
|
|
30
30
|
return {
|
|
31
31
|
reason: e,
|
|
32
32
|
event: t ?? new Event("base-ui"),
|
|
33
33
|
cancel() {
|
|
34
|
-
|
|
34
|
+
a = !0;
|
|
35
35
|
},
|
|
36
36
|
allowPropagation() {
|
|
37
37
|
o = !0;
|
|
38
38
|
},
|
|
39
39
|
get isCanceled() {
|
|
40
|
-
return
|
|
40
|
+
return a;
|
|
41
41
|
},
|
|
42
42
|
get isPropagationAllowed() {
|
|
43
43
|
return o;
|
|
44
44
|
},
|
|
45
|
-
trigger:
|
|
45
|
+
trigger: r,
|
|
46
46
|
...s
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function f(e, t,
|
|
50
|
-
let
|
|
49
|
+
function f(e, t, r) {
|
|
50
|
+
let i = r ?? n;
|
|
51
51
|
return {
|
|
52
52
|
reason: e,
|
|
53
53
|
event: t ?? new Event("base-ui"),
|
|
54
|
-
...
|
|
54
|
+
...i
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
var p = "none", m = "trigger-press", h = "trigger-hover", g = "trigger-focus", _ = "outside-press", v = "item-press", y = "close-press", b = "clear-press", x = "chip-remove-press", S = "track-press", C = "input-change", w = "input-clear", T = "input-press", E = "focus-out", D = "escape-key", O = "list-navigation", k = "keyboard", A = "pointer", j = "drag", M = "cancel-open", N = "sibling-open", P = "disabled", F = "missing", I = "initial", L = "imperative-action", R = "window-resize";
|
|
@@ -72,7 +72,7 @@ function V(e, t = "mui") {
|
|
|
72
72
|
r
|
|
73
73
|
]), i;
|
|
74
74
|
}
|
|
75
|
-
var H =
|
|
75
|
+
var H = i.useId;
|
|
76
76
|
function U(e, t) {
|
|
77
77
|
if (H !== void 0) {
|
|
78
78
|
let n = H();
|
|
@@ -84,9 +84,9 @@ function W(e) {
|
|
|
84
84
|
return U(e, "base-ui");
|
|
85
85
|
}
|
|
86
86
|
function G(t, n) {
|
|
87
|
-
let
|
|
87
|
+
let i = o.useRef(t), a = r(n);
|
|
88
88
|
e(() => {
|
|
89
|
-
|
|
89
|
+
i.current !== t && a(i.current), i.current = t;
|
|
90
90
|
}, [t, a]);
|
|
91
91
|
}
|
|
92
92
|
export { R as A, _ as C, g as D, S as E, s as F, f as M, l as N, h as O, u as P, p as S, N as T, T as _, M as a, O as b, y as c, D as d, E as f, w as g, C as h, z as i, d as j, m as k, P as l, I as m, W as n, x as o, L as p, U as r, b as s, G as t, j as u, v, A as w, F as x, k as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as e, f as t, i as n, l as r, o as i, p as a } from "./validation-3wbbbuX0.js";
|
|
2
|
-
import { s as o } from "./comment-kit-core-
|
|
2
|
+
import { s as o } from "./comment-kit-core-B0k7XsMz.js";
|
|
3
3
|
import { i as s } from "./text-B4HHZNaa.js";
|
|
4
4
|
var c = Object.create, l = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = Object.getOwnPropertyNames, f = Object.getPrototypeOf, p = Object.prototype.hasOwnProperty, m = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), h = (e, t) => {
|
|
5
5
|
let n = {};
|
|
@@ -57,7 +57,7 @@ function S(e) {
|
|
|
57
57
|
}
|
|
58
58
|
var C = null;
|
|
59
59
|
function w() {
|
|
60
|
-
return C ||= import("./pusher-
|
|
60
|
+
return C ||= import("./pusher-BUaiCkDJ.js").then((e) => /* @__PURE__ */ _(e.default, 1)).then((e) => e.default ?? e), C;
|
|
61
61
|
}
|
|
62
62
|
var T = o.ID, E = o.NAME, D = o.EMAIL, O = o.PAGE, k = o.COLOR, A = o.DRAWING_PATH_DATA, j = o.DRAWING_TEXT, M = o.ONLINE_USERS, N = {
|
|
63
63
|
id: "unknown",
|
package/dist/solid.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./shared/comment-kit-core-
|
|
1
|
+
import { t as e } from "./shared/comment-kit-core-B0k7XsMz.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
|
|
3
3
|
import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
|
|
4
4
|
import { createMemo as o, createSignal as s, onCleanup as c, onMount as l } from "solid-js";
|
|
@@ -24,7 +24,7 @@ function u(u) {
|
|
|
24
24
|
}
|
|
25
25
|
}, K = async (e) => {
|
|
26
26
|
try {
|
|
27
|
-
let { mountCommentKitUI: t } = await import("./shared/mount-ui-
|
|
27
|
+
let { mountCommentKitUI: t } = await import("./shared/mount-ui-BKaWBhKq.js").then((e) => e.n);
|
|
28
28
|
if (w || x !== e) return;
|
|
29
29
|
let n = await t(e);
|
|
30
30
|
if (w || x !== e) {
|
package/dist/svelte.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./shared/comment-kit-core-
|
|
1
|
+
import { t as e } from "./shared/comment-kit-core-B0k7XsMz.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
|
|
3
3
|
import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
|
|
4
4
|
import { onDestroy as o } from "svelte";
|
|
@@ -23,7 +23,7 @@ function d(o) {
|
|
|
23
23
|
} catch {}
|
|
24
24
|
}, B = async (e) => {
|
|
25
25
|
try {
|
|
26
|
-
let { mountCommentKitUI: t } = await import("./shared/mount-ui-
|
|
26
|
+
let { mountCommentKitUI: t } = await import("./shared/mount-ui-BKaWBhKq.js").then((e) => e.n);
|
|
27
27
|
if (I || c(d) !== e) return;
|
|
28
28
|
let n = await t(e);
|
|
29
29
|
if (I || c(d) !== e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthResponse, Comment, CommentEnvironment, CommentCreateOptions, CommentDeviceInfo, ProjectContext, ReplyOptions, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, SessionVerificationResponse, Position, ResolvedConfig, TextSelection, User } from "./types";
|
|
1
|
+
import type { AuthResponse, Comment, CommentQuery, PaginationInfo, CommentEnvironment, CommentCreateOptions, CommentDeviceInfo, ProjectContext, ReplyOptions, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, SessionVerificationResponse, Position, ResolvedConfig, TextSelection, User } from "./types";
|
|
2
2
|
export declare class ApiClient {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private apiKey;
|
|
@@ -7,6 +7,8 @@ export declare class ApiClient {
|
|
|
7
7
|
private userEmail;
|
|
8
8
|
private authToken;
|
|
9
9
|
private authRevision;
|
|
10
|
+
private pendingInvite;
|
|
11
|
+
private inviteRevision;
|
|
10
12
|
private environment;
|
|
11
13
|
private onAuthExpired;
|
|
12
14
|
constructor(config: ResolvedConfig);
|
|
@@ -32,17 +34,20 @@ export declare class ApiClient {
|
|
|
32
34
|
}>;
|
|
33
35
|
requestOtp(email: string): Promise<OtpResponse>;
|
|
34
36
|
verifyOtp(email: string, otp: string): Promise<OtpVerifyResponse>;
|
|
37
|
+
verifyMfa(challenge: string, code: string): Promise<OtpVerifyResponse>;
|
|
35
38
|
validateInvite(token: string, email: string): Promise<InviteValidationResponse>;
|
|
36
|
-
getComments(pagePath?: string, status?: "open" | "resolved" | "all", page?: number, limit?: number, environment?: CommentEnvironment, branch?: string | null
|
|
39
|
+
getComments(pagePath?: string, status?: "open" | "resolved" | "complete" | "all", page?: number, limit?: number, environment?: CommentEnvironment, branch?: string | null, options?: CommentQuery & {
|
|
40
|
+
cursor?: string | null;
|
|
41
|
+
view?: "summary";
|
|
42
|
+
pagination?: "cursor";
|
|
43
|
+
}): Promise<{
|
|
37
44
|
comments: Comment[];
|
|
38
|
-
pagination:
|
|
39
|
-
total: number;
|
|
40
|
-
hasMore: boolean;
|
|
41
|
-
page: number;
|
|
42
|
-
limit: number;
|
|
43
|
-
};
|
|
45
|
+
pagination: PaginationInfo;
|
|
44
46
|
}>;
|
|
45
|
-
getComment(commentId: string
|
|
47
|
+
getComment(commentId: string, options?: {
|
|
48
|
+
repliesLimit?: number;
|
|
49
|
+
repliesBefore?: string;
|
|
50
|
+
}): Promise<Comment>;
|
|
46
51
|
/**
|
|
47
52
|
* Build an Idempotency-Key header from a client-supplied key. The backend
|
|
48
53
|
* dedups retried creates/replies on this key, so an offline-queue replay (or
|
|
@@ -57,6 +62,10 @@ export declare class ApiClient {
|
|
|
57
62
|
}, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions, idempotencyKey?: string): Promise<Comment>;
|
|
58
63
|
updateComment(commentId: string, updates: Partial<Pick<Comment, "content" | "status" | "priority" | "description" | "assignees" | "checklist" | "textSelection" | "drawingData" | "mentions"> & {
|
|
59
64
|
attachmentIds?: Array<string | number>;
|
|
65
|
+
checklistPatch?: {
|
|
66
|
+
id: string;
|
|
67
|
+
done: boolean;
|
|
68
|
+
};
|
|
60
69
|
}>): Promise<Comment>;
|
|
61
70
|
deleteComment(commentId: string): Promise<void>;
|
|
62
71
|
addReply(commentId: string, content: string, idempotencyKey?: string, options?: ReplyOptions): Promise<Comment["replies"][0]>;
|
|
@@ -99,6 +108,7 @@ export declare class ApiClient {
|
|
|
99
108
|
}>;
|
|
100
109
|
uploadScreenshot(file: File, metadata: {
|
|
101
110
|
content: string;
|
|
111
|
+
idempotencyKey?: string;
|
|
102
112
|
position: Position;
|
|
103
113
|
page: {
|
|
104
114
|
url: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CommentWriteAccess } from "./write-access";
|
|
2
2
|
import { EventEmitter } from "../utils/event-emitter";
|
|
3
3
|
import type { LocalDemoStore } from "./local-demo";
|
|
4
|
-
import type { AgentContextExport, AgentContextOptions, Comment, CommentCreateOptions, ReplyOptions, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice, TextSelection, ToolType, Unsubscribe, User } from "./types";
|
|
4
|
+
import type { AgentContextExport, AgentContextOptions, Comment, CommentUpdate, CommentQuery, CommentCreateOptions, ReplyOptions, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice, TextSelection, ToolType, Unsubscribe, User } from "./types";
|
|
5
5
|
/**
|
|
6
6
|
* Current SDK version — compared against the backend's sdkLatestVersion on
|
|
7
7
|
* init. Injected from package.json at build time (vite `define`) so it can't
|
|
@@ -101,8 +101,8 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
101
101
|
getConfig(): Readonly<CommentKitConfig>;
|
|
102
102
|
/**
|
|
103
103
|
* Validate a member invite token + email against the backend.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
104
|
+
* Validation prepares the invitation challenge; OTP and enrolled MFA must
|
|
105
|
+
* still complete before the backend grants access.
|
|
106
106
|
*/
|
|
107
107
|
validateInvite(email: string): Promise<void>;
|
|
108
108
|
/**
|
|
@@ -150,6 +150,8 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
150
150
|
* `loadMoreComments`, which paginates forward and no-ops once everything is
|
|
151
151
|
* loaded, this refreshes existing data — e.g. to pick up remote edits.
|
|
152
152
|
*/
|
|
153
|
+
setCommentQuery(query: CommentQuery): Promise<void>;
|
|
154
|
+
loadEarlierReplies(): Promise<void>;
|
|
153
155
|
reloadComments(): Promise<void>;
|
|
154
156
|
/** @internal Refresh signed attachment links without discarding pagination or local edits. */
|
|
155
157
|
refreshAttachmentUrl(attachmentId: string): Promise<string | null>;
|
|
@@ -159,11 +161,12 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
159
161
|
/** Upload drafts before creating their record. Reuse successful uploads if saving is retried. */
|
|
160
162
|
uploadDraftFiles(files: File[]): Promise<string[]>;
|
|
161
163
|
createComment(type: "pin" | "highlight" | "drawing", content: string, position: Position, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions): Promise<void>;
|
|
162
|
-
updateComment(commentId: string, updates:
|
|
164
|
+
updateComment(commentId: string, updates: CommentUpdate): Promise<void>;
|
|
163
165
|
deleteComment(commentId: string): Promise<void>;
|
|
164
166
|
addReply(commentId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
165
167
|
updateReply(commentId: string, replyId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
166
168
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
169
|
+
private requireThreadStatus;
|
|
167
170
|
resolveComment(commentId: string): Promise<void>;
|
|
168
171
|
unresolveComment(commentId: string): Promise<void>;
|
|
169
172
|
selectComment(comment: Comment | null): void;
|
|
@@ -214,6 +217,7 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
214
217
|
* For source-resolved output (file:line:col + component stack), use
|
|
215
218
|
* `getAgentContextAsync` instead, which awaits source resolution when available.
|
|
216
219
|
*/
|
|
220
|
+
private requireAgentExport;
|
|
217
221
|
getAgentContext(options?: AgentContextOptions): AgentContextExport;
|
|
218
222
|
/**
|
|
219
223
|
* Same as `getAgentContext` but also resolves each comment's element to a
|
|
@@ -99,6 +99,7 @@ export interface AgentCommentContext {
|
|
|
99
99
|
attachments?: AgentAttachmentReference[];
|
|
100
100
|
/** Credential-free screenshot URL, when one is available. */
|
|
101
101
|
screenshotUrl?: string;
|
|
102
|
+
repliesCount?: number;
|
|
102
103
|
replies: Array<{
|
|
103
104
|
id: string;
|
|
104
105
|
content: string;
|
|
@@ -189,7 +190,7 @@ export interface Organization {
|
|
|
189
190
|
slug: string;
|
|
190
191
|
owner: User;
|
|
191
192
|
members: OrganizationMember[];
|
|
192
|
-
plan: "none" | "pro" | "ltd";
|
|
193
|
+
plan: "none" | "pro" | "ltd" | null;
|
|
193
194
|
createdAt: string;
|
|
194
195
|
updatedAt: string;
|
|
195
196
|
}
|
|
@@ -197,7 +198,7 @@ export interface Organization {
|
|
|
197
198
|
export interface OrganizationMember {
|
|
198
199
|
id: string;
|
|
199
200
|
user: User;
|
|
200
|
-
role: "owner" | "admin" | "member";
|
|
201
|
+
role: "owner" | "admin" | "member" | "reviewer";
|
|
201
202
|
joinedAt: string;
|
|
202
203
|
}
|
|
203
204
|
export interface Project {
|
|
@@ -243,16 +244,16 @@ export interface ProjectContext {
|
|
|
243
244
|
organization: {
|
|
244
245
|
id: string;
|
|
245
246
|
name: string;
|
|
246
|
-
plan: "none" | "pro" | "ltd";
|
|
247
|
+
plan: "none" | "pro" | "ltd" | null;
|
|
247
248
|
};
|
|
248
249
|
members: Array<User & {
|
|
249
|
-
role: "owner" | "admin" | "member";
|
|
250
|
+
role: "owner" | "admin" | "member" | "reviewer";
|
|
250
251
|
}>;
|
|
251
252
|
usage: {
|
|
252
253
|
used: number;
|
|
253
254
|
limit: number | null;
|
|
254
255
|
label: string;
|
|
255
|
-
};
|
|
256
|
+
} | null;
|
|
256
257
|
branches: Array<{
|
|
257
258
|
name: string;
|
|
258
259
|
}>;
|
|
@@ -260,6 +261,11 @@ export interface ProjectContext {
|
|
|
260
261
|
canManageComments: boolean;
|
|
261
262
|
canInvite: boolean;
|
|
262
263
|
canWriteComments?: boolean;
|
|
264
|
+
canTriage?: boolean;
|
|
265
|
+
canComplete?: boolean;
|
|
266
|
+
canExportAgentContext?: boolean;
|
|
267
|
+
canUseMcp?: boolean;
|
|
268
|
+
accessScope?: "workspace" | "project";
|
|
263
269
|
writeRestriction?: "plan_required" | "feature_disabled" | null;
|
|
264
270
|
};
|
|
265
271
|
}
|
|
@@ -340,10 +346,24 @@ export interface Comment {
|
|
|
340
346
|
checklist?: TaskChecklistItem[];
|
|
341
347
|
reactions?: CommentReaction[];
|
|
342
348
|
replies: Reply[];
|
|
349
|
+
repliesCount?: number;
|
|
350
|
+
detailLoaded?: boolean;
|
|
351
|
+
repliesPagination?: {
|
|
352
|
+
hasMore: boolean;
|
|
353
|
+
nextCursor: string | null;
|
|
354
|
+
};
|
|
343
355
|
attachments: Attachment[];
|
|
344
356
|
textSelection?: TextSelection;
|
|
345
357
|
drawingData?: DrawingData;
|
|
346
358
|
}
|
|
359
|
+
export type CommentUpdate = Partial<Comment> & {
|
|
360
|
+
attachmentIds?: Array<string | number>;
|
|
361
|
+
/** Change one task without replacing another reviewer's checklist state. */
|
|
362
|
+
checklistPatch?: {
|
|
363
|
+
id: string;
|
|
364
|
+
done: boolean;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
347
367
|
export interface Reply {
|
|
348
368
|
replyTo?: ReplyTarget & {
|
|
349
369
|
authorName: string;
|
|
@@ -423,13 +443,24 @@ export interface ActivityItem {
|
|
|
423
443
|
timestamp: string;
|
|
424
444
|
read?: boolean;
|
|
425
445
|
}
|
|
426
|
-
export type OtpStep = "idle" | "requesting" | "verifying";
|
|
446
|
+
export type OtpStep = "idle" | "requesting" | "verifying" | "mfa";
|
|
427
447
|
export interface Mention {
|
|
428
448
|
userId: string;
|
|
429
449
|
name: string;
|
|
430
450
|
index?: number;
|
|
431
451
|
}
|
|
452
|
+
export interface CommentQuery {
|
|
453
|
+
pagePath?: string;
|
|
454
|
+
status?: StatusFilter;
|
|
455
|
+
priority?: PriorityFilter;
|
|
456
|
+
user?: "me";
|
|
457
|
+
assignee?: string;
|
|
458
|
+
search?: string;
|
|
459
|
+
sort?: "newest" | "oldest" | "priority";
|
|
460
|
+
excludeComplete?: boolean;
|
|
461
|
+
}
|
|
432
462
|
export interface PaginationInfo {
|
|
463
|
+
nextCursor?: string | null;
|
|
433
464
|
total: number;
|
|
434
465
|
hasMore: boolean;
|
|
435
466
|
page: number;
|
|
@@ -558,6 +589,8 @@ export interface CommentKitState {
|
|
|
558
589
|
projectContext?: ProjectContext | null;
|
|
559
590
|
activeBranch?: string | null;
|
|
560
591
|
comments: Comment[];
|
|
592
|
+
commentQuery?: CommentQuery;
|
|
593
|
+
loadingThreadId?: string | null;
|
|
561
594
|
activeTool: ToolType;
|
|
562
595
|
selectedComment: Comment | null;
|
|
563
596
|
activeComment: Comment | null;
|
|
@@ -572,6 +605,8 @@ export interface CommentKitState {
|
|
|
572
605
|
error: string | null;
|
|
573
606
|
otpStep: OtpStep;
|
|
574
607
|
otpEmail: string | null;
|
|
608
|
+
/** In-memory, short-lived second-factor challenge; never persisted. */
|
|
609
|
+
otpMfaChallenge: string | null;
|
|
575
610
|
pagination: PaginationInfo | null;
|
|
576
611
|
pendingMutations: QueuedMutation[];
|
|
577
612
|
isOnline: boolean;
|
|
@@ -593,9 +628,12 @@ export interface OtpResponse {
|
|
|
593
628
|
export interface OtpVerifyResponse {
|
|
594
629
|
success: boolean;
|
|
595
630
|
verified: boolean;
|
|
596
|
-
token
|
|
597
|
-
user
|
|
598
|
-
project
|
|
631
|
+
token?: string;
|
|
632
|
+
user?: User;
|
|
633
|
+
project?: Project;
|
|
634
|
+
mfaRequired?: boolean;
|
|
635
|
+
challenge?: string;
|
|
636
|
+
expiresIn?: number;
|
|
599
637
|
}
|
|
600
638
|
export interface SessionVerificationResponse {
|
|
601
639
|
success: boolean;
|
|
@@ -604,6 +642,8 @@ export interface SessionVerificationResponse {
|
|
|
604
642
|
project: Project;
|
|
605
643
|
}
|
|
606
644
|
export interface InviteValidationResponse {
|
|
645
|
+
accessScope?: "workspace" | "project";
|
|
646
|
+
invitationChallenge?: string | null;
|
|
607
647
|
success: boolean;
|
|
608
648
|
message: string;
|
|
609
649
|
user: User;
|
package/dist/vue.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./shared/comment-kit-core-
|
|
1
|
+
import { t as e } from "./shared/comment-kit-core-B0k7XsMz.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
|
|
3
3
|
import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
|
|
4
4
|
import { computed as o, h as s, onMounted as c, onUnmounted as l, shallowRef as u, watch as d } from "vue";
|
|
@@ -19,7 +19,7 @@ function f(s) {
|
|
|
19
19
|
} catch {}
|
|
20
20
|
}, V = async (e) => {
|
|
21
21
|
try {
|
|
22
|
-
let { mountCommentKitUI: t } = await import("./shared/mount-ui-
|
|
22
|
+
let { mountCommentKitUI: t } = await import("./shared/mount-ui-BKaWBhKq.js").then((e) => e.n);
|
|
23
23
|
if (L || _.value !== e) return;
|
|
24
24
|
let n = await t(e);
|
|
25
25
|
if (L || _.value !== e) {
|