@commentkit/comment-kit 0.7.6 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +108 -762
- package/SECURITY.md +19 -14
- package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
- package/dist/npm/chunks/client-D1vrh_5G.js +590 -0
- package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
- package/dist/npm/chunks/html2canvas-_mjSRP3G.js +4011 -0
- package/dist/npm/chunks/mount-Ce1MZrcm.js +2485 -0
- package/dist/{shared/pusher-BUaiCkDJ.js → npm/chunks/pusher-DRKlokR8.js} +224 -222
- package/dist/npm/chunks/realtime-5SvAvTUU.js +23 -0
- package/dist/npm/chunks/rolldown-runtime-VHNaYcLd.js +13 -0
- package/dist/npm/chunks/src-DJjfvVsa.js +330 -0
- package/dist/npm/element.js +24 -0
- package/dist/npm/headless.js +3 -0
- package/dist/npm/index.js +3 -0
- package/dist/npm/react.js +17 -0
- package/dist/npm/svelte.js +8 -0
- package/dist/npm/types/adapters/react.d.ts +9 -0
- package/dist/npm/types/adapters/svelte.d.ts +9 -0
- package/dist/npm/types/adapters/vue.d.ts +46 -0
- package/dist/npm/types/anchor/index.d.ts +49 -0
- package/dist/npm/types/core/api.d.ts +29 -0
- package/dist/npm/types/core/auth.d.ts +48 -0
- package/dist/npm/types/core/client.d.ts +100 -0
- package/dist/npm/types/core/store.d.ts +7 -0
- package/dist/npm/types/core/types.d.ts +278 -0
- package/dist/npm/types/element.d.ts +10 -0
- package/dist/npm/types/headless.d.ts +7 -0
- package/dist/npm/types/index.d.ts +30 -0
- package/dist/npm/vue.js +32 -0
- package/package.json +65 -173
- package/dist/THIRD_PARTY_NOTICES.txt +0 -284
- package/dist/angular.es.js +0 -321
- package/dist/comment-kit.es.js +0 -218
- package/dist/demo.es.js +0 -483
- package/dist/headless.es.js +0 -4
- package/dist/preact.es.js +0 -117
- package/dist/qwik.es.js +0 -1
- package/dist/qwik.qwik.mjs +0 -114
- package/dist/react.es.js +0 -98
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
- package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
- package/dist/shared/annotation-toolbar-RSrb0Nku.js +0 -1086
- package/dist/shared/attachment-refresh-CSTYwRW-.js +0 -94
- package/dist/shared/bridge-CJoGYngu.js +0 -177
- package/dist/shared/button-D4GHW6oZ.js +0 -474
- package/dist/shared/button-group-BVR7iT-S.js +0 -91
- package/dist/shared/capture-privacy-DUROnio5.js +0 -77
- package/dist/shared/comment-drawing-canvas-DbuXP54N.js +0 -124
- package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
- package/dist/shared/comment-image-lightbox-zlIGEVA-.js +0 -190
- package/dist/shared/comment-images-content-aYbJb79_.js +0 -214
- package/dist/shared/comment-kit-core-B0k7XsMz.js +0 -3680
- package/dist/shared/comment-kit-ui-BXLJcZYQ.js +0 -19391
- package/dist/shared/comment-screenshot-annotator-ChWwYJzO.js +0 -151
- package/dist/shared/comment-screenshot-overlay-Bufg3rHz.js +0 -205
- package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
- package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
- package/dist/shared/dev-export-panel-DAZenvgD.js +0 -207
- package/dist/shared/dev-grab-O8q25zar.js +0 -197
- package/dist/shared/dist-D9A5k-N4.js +0 -617
- package/dist/shared/dom-Bhf4WFtY.js +0 -223
- package/dist/shared/element-selector-CYkwzfEr.js +0 -902
- package/dist/shared/error-boundary-D3PD74vI.js +0 -21
- package/dist/shared/errors-Bu5ajEmB.js +0 -22
- package/dist/shared/icons-nzMOLzrm.js +0 -266
- package/dist/shared/input-UPtAj0M6.js +0 -111
- package/dist/shared/mount-ui-BKaWBhKq.js +0 -208
- package/dist/shared/realtime-C0Z8dXXH.js +0 -334
- package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
- package/dist/shared/request-activity-DQrAUwfA.js +0 -11
- package/dist/shared/screenshot-B-ZfFItT.js +0 -199
- package/dist/shared/separator-UhJb0Row.js +0 -3955
- package/dist/shared/shadow-root-Cd3SLHyj.js +0 -133
- package/dist/shared/styles-CnYsLS2f.js +0 -2
- package/dist/shared/text-B4HHZNaa.js +0 -23
- package/dist/shared/token-session-DplW5QDx.js +0 -25
- package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
- package/dist/shared/useRender-Uxk1OPK-.js +0 -5
- package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
- package/dist/shared/validation-3wbbbuX0.js +0 -70
- package/dist/shared/websocket-manager-798cRDyL.js +0 -381
- package/dist/solid.es.js +0 -98
- package/dist/svelte.es.js +0 -130
- package/dist/types/adapters/bridge.d.ts +0 -122
- package/dist/types/angular/index.d.ts +0 -145
- package/dist/types/core/agent-context.d.ts +0 -17
- package/dist/types/core/api-client.d.ts +0 -155
- package/dist/types/core/comment-kit-core.d.ts +0 -254
- package/dist/types/core/local-demo.d.ts +0 -60
- package/dist/types/core/types.d.ts +0 -770
- package/dist/types/core/websocket-manager.d.ts +0 -125
- package/dist/types/core/write-access.d.ts +0 -11
- package/dist/types/demo.d.ts +0 -17
- package/dist/types/headless.d.ts +0 -8
- package/dist/types/index.d.ts +0 -87
- package/dist/types/preact/index.d.ts +0 -25
- package/dist/types/qwik/index.d.ts +0 -73
- package/dist/types/react/client.d.ts +0 -31
- package/dist/types/react/index.d.ts +0 -4
- package/dist/types/solid/index.d.ts +0 -37
- package/dist/types/svelte/index.d.ts +0 -55
- package/dist/types/utils/dom.d.ts +0 -59
- package/dist/types/utils/event-emitter.d.ts +0 -11
- package/dist/types/vue/index.d.ts +0 -87
- package/dist/vue.es.js +0 -148
- package/docs/api-reference.md +0 -405
- package/docs/local-demo.md +0 -60
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { s as e } from "./validation-3wbbbuX0.js";
|
|
2
|
-
import { n as t } from "./dist-D9A5k-N4.js";
|
|
3
|
-
import { t as n } from "./button-D4GHW6oZ.js";
|
|
4
|
-
import { L as r } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
5
|
-
import * as i from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
function s(e) {
|
|
8
|
-
try {
|
|
9
|
-
let t = new URL(e, "https://commentkit.dev"), n = t.searchParams.get("expires");
|
|
10
|
-
return t.searchParams.has("signature") && /^\d{1,12}$/.test(n ?? "") && Number(n) * 1e3 <= Date.now() + 3e4;
|
|
11
|
-
} catch {
|
|
12
|
-
return !1;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function c(t) {
|
|
16
|
-
return e(t, !0) ? new URL(t, window.location.href).href : null;
|
|
17
|
-
}
|
|
18
|
-
function l(e) {
|
|
19
|
-
let n = i.useContext(r), a = i.useRef(e);
|
|
20
|
-
a.current = e;
|
|
21
|
-
let o = i.useRef(!0), l = i.useRef(null), u = i.useRef(null), d = i.useRef(null), [f, p] = i.useState(null), [m, h] = i.useState(!1), [g, _] = i.useState(!1), [v, y] = i.useState(0);
|
|
22
|
-
i.useEffect(() => (o.current = !0, () => {
|
|
23
|
-
o.current = !1;
|
|
24
|
-
}), []);
|
|
25
|
-
let b = !!(e && f === e.url), x = async () => {
|
|
26
|
-
if (!e || !n) return null;
|
|
27
|
-
if (l.current && u.current === e.id) return l.current;
|
|
28
|
-
let t = e.id, r = {};
|
|
29
|
-
d.current = r, u.current = t, _(!0), h(!1);
|
|
30
|
-
let i = (async () => {
|
|
31
|
-
try {
|
|
32
|
-
let e = await Promise.resolve().then(() => n(t)), r = e ? c(e) : null;
|
|
33
|
-
return !o.current || a.current?.id !== t ? null : r ? (p(null), y((e) => e + 1), r) : (p(a.current.url), h(!0), null);
|
|
34
|
-
} catch {
|
|
35
|
-
return o.current && a.current?.id === t && (p(a.current.url), h(!0)), null;
|
|
36
|
-
} finally {
|
|
37
|
-
d.current === r && (l.current = null, o.current && _(!1));
|
|
38
|
-
}
|
|
39
|
-
})();
|
|
40
|
-
return l.current = i, i;
|
|
41
|
-
}, S = async () => e ? b || s(e.url) ? x() : c(e.url) : null;
|
|
42
|
-
return {
|
|
43
|
-
failed: b,
|
|
44
|
-
refreshFailed: m,
|
|
45
|
-
loading: g,
|
|
46
|
-
attempt: v,
|
|
47
|
-
refresh: x,
|
|
48
|
-
resolve: S,
|
|
49
|
-
download: async (n) => {
|
|
50
|
-
if (!e) return;
|
|
51
|
-
let r = b || s(e.url), i = r ? window.open("about:blank", "_blank") : null;
|
|
52
|
-
i && (i.opener = null);
|
|
53
|
-
let a = await S();
|
|
54
|
-
if (!a) {
|
|
55
|
-
i?.close(), t.error("Could not refresh the attachment. Try again.");
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (i) {
|
|
59
|
-
try {
|
|
60
|
-
!i.closed && i.location.href === "about:blank" && i.location.replace(a);
|
|
61
|
-
} catch {}
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (r) {
|
|
65
|
-
t.info("Link refreshed. Select Download again to open it.");
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
let o = document.createElement("a");
|
|
69
|
-
o.href = a, o.download = n, o.target = "_blank", o.rel = "noopener noreferrer", o.click();
|
|
70
|
-
},
|
|
71
|
-
canRefresh: !!n,
|
|
72
|
-
onError: () => {
|
|
73
|
-
e && p(e.url);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function u({ link: e, compact: t = !1 }) {
|
|
78
|
-
return /* @__PURE__ */ o("div", {
|
|
79
|
-
className: `ck-attachment-error${t ? " ck-attachment-error-compact" : ""}`,
|
|
80
|
-
role: "status",
|
|
81
|
-
onClick: (e) => e.stopPropagation(),
|
|
82
|
-
children: [/* @__PURE__ */ a("p", { children: e.refreshFailed ? t ? "Could not refresh." : "Could not refresh this preview. Try again." : t ? "Preview unavailable." : "Preview unavailable. The link may have expired." }), e.canRefresh ? /* @__PURE__ */ a(n, {
|
|
83
|
-
variant: "outline",
|
|
84
|
-
size: "sm",
|
|
85
|
-
disabled: e.loading,
|
|
86
|
-
"aria-label": "Refresh preview",
|
|
87
|
-
onClick: () => {
|
|
88
|
-
e.refresh();
|
|
89
|
-
},
|
|
90
|
-
children: e.loading ? t ? "…" : "Refreshing…" : t ? "Refresh" : "Refresh preview"
|
|
91
|
-
}) : null]
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
export { s as n, l as r, u as t };
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
var e = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
function t(t) {
|
|
3
|
-
e.get(t)?.();
|
|
4
|
-
}
|
|
5
|
-
function n(t, n) {
|
|
6
|
-
let r = (e) => {
|
|
7
|
-
try {
|
|
8
|
-
n?.(e);
|
|
9
|
-
} catch {}
|
|
10
|
-
}, i = [], a = () => {
|
|
11
|
-
let e = t();
|
|
12
|
-
if (!e || i.length === 0) return;
|
|
13
|
-
let n = i.splice(0, i.length);
|
|
14
|
-
for (let t of n) if (!t.cancelled) try {
|
|
15
|
-
t.unsubscribe = t.attach(e);
|
|
16
|
-
} catch (e) {
|
|
17
|
-
r(e);
|
|
18
|
-
}
|
|
19
|
-
}, o = (e, n) => {
|
|
20
|
-
let r = t();
|
|
21
|
-
if (r) return a(), e(r);
|
|
22
|
-
let o = {
|
|
23
|
-
attach: e,
|
|
24
|
-
unsubscribe: null,
|
|
25
|
-
cancelled: !1,
|
|
26
|
-
meta: n
|
|
27
|
-
};
|
|
28
|
-
return i.push(o), () => {
|
|
29
|
-
o.cancelled = !0, o.unsubscribe?.(), o.unsubscribe = null;
|
|
30
|
-
let e = i.indexOf(o);
|
|
31
|
-
e !== -1 && i.splice(e, 1);
|
|
32
|
-
};
|
|
33
|
-
}, s = () => /* @__PURE__ */ Error("CommentKit is not initialized yet — wait for the adapter's mount lifecycle before calling mutations"), c = async (e) => {
|
|
34
|
-
let n = t();
|
|
35
|
-
if (!n) {
|
|
36
|
-
let e = s();
|
|
37
|
-
throw r(e), e;
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
return await e(n);
|
|
41
|
-
} catch (e) {
|
|
42
|
-
throw r(e), e;
|
|
43
|
-
}
|
|
44
|
-
}, l = async (e, n) => {
|
|
45
|
-
let i = t();
|
|
46
|
-
if (!i) return n;
|
|
47
|
-
try {
|
|
48
|
-
return await e(i);
|
|
49
|
-
} catch (e) {
|
|
50
|
-
throw r(e), e;
|
|
51
|
-
}
|
|
52
|
-
}, u = (e) => {
|
|
53
|
-
let n = t();
|
|
54
|
-
if (n) {
|
|
55
|
-
a();
|
|
56
|
-
try {
|
|
57
|
-
e(n);
|
|
58
|
-
} catch (e) {
|
|
59
|
-
throw r(e), e;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, d = (e, n) => {
|
|
63
|
-
let i = t();
|
|
64
|
-
if (!i) return n;
|
|
65
|
-
try {
|
|
66
|
-
return e(i);
|
|
67
|
-
} catch (e) {
|
|
68
|
-
throw r(e), e;
|
|
69
|
-
}
|
|
70
|
-
}, f = {
|
|
71
|
-
validateInvite: (e) => c((t) => t.validateInvite(e)),
|
|
72
|
-
login: (e) => c((t) => t.login(e)),
|
|
73
|
-
verifyOtp: (e) => c((t) => t.verifyOtp(e)),
|
|
74
|
-
cancelOtp: () => u((e) => e.cancelOtp()),
|
|
75
|
-
resendOtp: () => c((e) => e.resendOtp()),
|
|
76
|
-
logout: () => u((e) => e.logout()),
|
|
77
|
-
toggleLoginModal: () => u((e) => e.toggleLoginModal()),
|
|
78
|
-
toggleOverlay: () => u((e) => e.toggleOverlay()),
|
|
79
|
-
toggleSidebar: () => u((e) => e.toggleSidebar()),
|
|
80
|
-
setTool: (e) => u((t) => t.setTool(e)),
|
|
81
|
-
toggleShortcutsOverlay: () => u((e) => e.toggleShortcutsOverlay()),
|
|
82
|
-
setPanelView: (e) => u((t) => t.setPanelView(e)),
|
|
83
|
-
loadMoreComments: () => c((e) => e.loadMoreComments()),
|
|
84
|
-
reloadComments: () => c((e) => e.reloadComments()),
|
|
85
|
-
setBranch: (e) => c((t) => t.setBranch(e)),
|
|
86
|
-
reloadProjectContext: () => c((e) => e.reloadProjectContext()),
|
|
87
|
-
getProjectMembers: () => l((e) => e.getProjectMembers(), []),
|
|
88
|
-
createComment: (e, t, n, r, i, a, o) => c((s) => s.createComment(e, t, n, r, i, a, o)),
|
|
89
|
-
updateComment: (e, t) => c((n) => n.updateComment(e, t)),
|
|
90
|
-
deleteComment: (e) => c((t) => t.deleteComment(e)),
|
|
91
|
-
resolveComment: (e) => c((t) => t.resolveComment(e)),
|
|
92
|
-
unresolveComment: (e) => c((t) => t.unresolveComment(e)),
|
|
93
|
-
completeComment: (e) => c((t) => t.completeComment(e)),
|
|
94
|
-
selectComment: (e) => u((t) => t.selectComment(e)),
|
|
95
|
-
addReply: (e, t, n) => c((r) => r.addReply(e, t, ...n ? [n] : [])),
|
|
96
|
-
updateReply: (e, t, n, r) => c((i) => i.updateReply(e, t, n, ...r ? [r] : [])),
|
|
97
|
-
deleteReply: (e, t) => c((n) => n.deleteReply(e, t)),
|
|
98
|
-
reactToComment: (e, t, n) => c((r) => r.reactToComment(e, t, ...n ? [n] : [])),
|
|
99
|
-
updateCommentPosition: (e, t, n) => c((r) => r.updateCommentPosition(e, t, n)),
|
|
100
|
-
createHighlight: (e, t) => c((n) => n.createHighlight(e, t)),
|
|
101
|
-
createDrawing: (e, t, n) => c((r) => r.createDrawing(e, t, n)),
|
|
102
|
-
setActiveDrawing: (e) => u((t) => t.setActiveDrawing(e)),
|
|
103
|
-
sendDrawingStroke: (e) => u((t) => t.sendDrawingStroke(e)),
|
|
104
|
-
captureScreenshot: (e) => l((t) => t.captureScreenshot(e), null),
|
|
105
|
-
uploadScreenshot: (e, t, n) => l((r) => r.uploadScreenshot(e, t, n), null),
|
|
106
|
-
setActiveScreenshot: (e) => u((t) => t.setActiveScreenshot(e)),
|
|
107
|
-
uploadFiles: (e, t) => l((n) => n.uploadFiles(e, t), []),
|
|
108
|
-
markThreadSeen: (e) => u((t) => t.markThreadSeen(e)),
|
|
109
|
-
isThreadNew: (e) => d((t) => t.isThreadNew(e), !0),
|
|
110
|
-
markAllActivitiesRead: () => u((e) => e.markAllActivitiesRead()),
|
|
111
|
-
getUnreadActivityCount: () => d((e) => e.getUnreadActivityCount(), 0),
|
|
112
|
-
getPendingMutationCount: () => d((e) => e.getPendingMutationCount(), 0),
|
|
113
|
-
getOnlineUsers: () => d((e) => e.getOnlineUsers(), []),
|
|
114
|
-
getAgentContext: (e) => d((t) => t.getAgentContext(e), {
|
|
115
|
-
version: 1,
|
|
116
|
-
generatedAt: "",
|
|
117
|
-
instructions: "",
|
|
118
|
-
page: {
|
|
119
|
-
url: "",
|
|
120
|
-
path: "",
|
|
121
|
-
title: ""
|
|
122
|
-
},
|
|
123
|
-
comments: [],
|
|
124
|
-
sourceResolved: !1
|
|
125
|
-
}),
|
|
126
|
-
getAgentContextAsync: (e) => l((t) => t.getAgentContextAsync(e), {
|
|
127
|
-
version: 1,
|
|
128
|
-
generatedAt: "",
|
|
129
|
-
instructions: "",
|
|
130
|
-
page: {
|
|
131
|
-
url: "",
|
|
132
|
-
path: "",
|
|
133
|
-
title: ""
|
|
134
|
-
},
|
|
135
|
-
comments: [],
|
|
136
|
-
sourceResolved: !1
|
|
137
|
-
}),
|
|
138
|
-
formatAgentContext: (e) => d((t) => t.formatAgentContext(e), ""),
|
|
139
|
-
formatAgentContextAsync: (e) => l((t) => t.formatAgentContextAsync(e), ""),
|
|
140
|
-
copyAgentContext: (e) => l((t) => t.copyAgentContext(e), ""),
|
|
141
|
-
grabElement: (e, t) => l((n) => n.grabElement(e, t), null),
|
|
142
|
-
grabElements: (e, t) => l((n) => n.grabElements(e, t), null),
|
|
143
|
-
onSlice: (e, t) => o((n) => n.onSlice(e, t)),
|
|
144
|
-
select: (e, t) => o((n) => n.select(e, t)),
|
|
145
|
-
on: (e, t) => o((n) => n.on(e, t), {
|
|
146
|
-
event: e,
|
|
147
|
-
listener: t
|
|
148
|
-
}),
|
|
149
|
-
off: (e, t) => {
|
|
150
|
-
for (let n = i.length - 1; n >= 0; n--) {
|
|
151
|
-
let r = i[n]?.meta;
|
|
152
|
-
r && r.event === e && r.listener === t && i.splice(n, 1);
|
|
153
|
-
}
|
|
154
|
-
u((n) => n.off(e, t));
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
return e.set(f, a), f;
|
|
158
|
-
}
|
|
159
|
-
var r = {
|
|
160
|
-
isAuthenticated: (e) => e?.isAuthenticated ?? !1,
|
|
161
|
-
isOverlayVisible: (e) => e?.isOverlayVisible ?? !1,
|
|
162
|
-
isSidebarVisible: (e) => e?.isSidebarVisible ?? !1,
|
|
163
|
-
currentUser: (e) => e?.currentUser ?? null,
|
|
164
|
-
comments: (e) => e?.comments ?? [],
|
|
165
|
-
activeTool: (e) => e?.activeTool ?? null,
|
|
166
|
-
otpStep: (e) => e?.otpStep ?? "idle",
|
|
167
|
-
otpEmail: (e) => e?.otpEmail ?? null,
|
|
168
|
-
pendingMutationCount: (e) => e?.pendingMutations?.length ?? 0,
|
|
169
|
-
isOnline: (e) => e?.isOnline ?? !0,
|
|
170
|
-
selectedComment: (e) => e?.selectedComment ?? null,
|
|
171
|
-
connectionStatus: (e) => e?.connectionStatus ?? "disconnected",
|
|
172
|
-
panelView: (e) => e?.panelView ?? "list",
|
|
173
|
-
isShortcutsOverlayVisible: (e) => e?.isShortcutsOverlayVisible ?? !1,
|
|
174
|
-
activeDrawing: (e) => e?.activeDrawing ?? null,
|
|
175
|
-
activeScreenshot: (e) => e?.activeScreenshot ?? null
|
|
176
|
-
};
|
|
177
|
-
export { n, t as r, r as t };
|