@commentkit/comment-kit 1.0.0 → 1.5.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 +133 -1
- package/README.md +12 -5
- package/SECURITY.md +3 -1
- package/dist/npm/THIRD_PARTY_NOTICES.txt +22 -23
- package/dist/npm/chunks/AgentSend-DyWxNQ0p.js +64 -0
- package/dist/npm/chunks/Checklist-VYkSl6Q9.js +259 -0
- package/dist/npm/chunks/Composer-CnsGQirF.js +679 -0
- package/dist/npm/chunks/Guest-DkIvY5zt.js +170 -0
- package/dist/npm/chunks/MarkupEditor-DxTI9nJH.js +334 -0
- package/dist/npm/chunks/Panel-riaMYxt-.js +863 -0
- package/dist/npm/chunks/Settings-CB4zxQAL.js +206 -0
- package/dist/npm/chunks/{Shortcuts-BSOKdMHt.js → Shortcuts-D1cbajg_.js} +21 -17
- package/dist/npm/chunks/StyleEditor-BtTv3I8_.js +44 -0
- package/dist/npm/chunks/StylePanel-BI-n5Me1.js +199 -0
- package/dist/npm/chunks/TaskFields-HwrD0FrH.js +272 -0
- package/dist/npm/chunks/ThreadCard-CjaC8BTa.js +1026 -0
- package/dist/npm/chunks/Viewer-BnWshSXb.js +110 -0
- package/dist/npm/chunks/agent-Cr6NB6We.js +146 -0
- package/dist/npm/chunks/anchor-OCQnjp_6.js +294 -0
- package/dist/npm/chunks/{ar-O7EPv0mI.js → ar-BQ9K9Oqf.js} +189 -8
- package/dist/npm/chunks/card-bits-CxteYiZ9.js +126 -0
- package/dist/npm/chunks/client-CJ1tpI62.js +754 -0
- package/dist/npm/chunks/colors-0Ied7PE2.js +101 -0
- package/dist/npm/chunks/confetti-DKeKR7-6.js +41 -0
- package/dist/npm/chunks/{de-PGyZVNHX.js → de-CcPi8xdC.js} +160 -8
- package/dist/npm/chunks/drafts-CpQdHhcK.js +51 -0
- package/dist/npm/chunks/{es-Bq1idl8M.js → es-DXgkjDCG.js} +160 -8
- package/dist/npm/chunks/extension-BIGfr4Gh.js +50 -0
- package/dist/npm/chunks/{extension-B7SelsS0.js → extension-DkDSW4qw.js} +2 -2
- package/dist/npm/chunks/{fr-BVB9GGco.js → fr-IjJaUbWh.js} +160 -8
- package/dist/npm/chunks/{hi-DyBvrjzQ.js → hi-BhKQK2MU.js} +160 -8
- package/dist/npm/chunks/html2canvas-pro.esm-lgs6tb4C.js +8378 -0
- package/dist/npm/chunks/i18n-DAJGndZ2.js +904 -0
- package/dist/npm/chunks/{it-BlMMMwZh.js → it-DKiSCkiD.js} +160 -8
- package/dist/npm/chunks/{ja-lAioBCJv.js → ja-BI1WagDg.js} +160 -8
- package/dist/npm/chunks/{live-YFyP1GnP.js → live-B-mo27Qq.js} +1 -1
- package/dist/npm/chunks/lock-C82sC17d.js +30 -0
- package/dist/npm/chunks/{nl-DR8mLHnn.js → nl-CJw3VUQ5.js} +160 -8
- package/dist/npm/chunks/pick-CYPkLLFJ.js +120 -0
- package/dist/npm/chunks/{pt-BR-D7j6aDPx.js → pt-BR-CjBolC5g.js} +160 -8
- package/dist/npm/chunks/{pusher-BSsQoE1K.js → realtime-D22tI_AS.js} +58 -4
- package/dist/npm/chunks/source-CTQmAh0Y.js +146 -0
- package/dist/npm/chunks/src-CgBEoWl0.js +150 -0
- package/dist/npm/chunks/start-DW9_DKmf.js +1783 -0
- package/dist/npm/chunks/upload-BmrpZE5G.js +42 -0
- package/dist/npm/chunks/uploads-CipONvCy.js +541 -0
- package/dist/npm/chunks/{zh-CN-tzYg9NPH.js → zh-CN-BrZGx2S0.js} +160 -8
- package/dist/npm/element.js +4 -5
- package/dist/npm/headless.js +3 -3
- package/dist/npm/index.js +2 -2
- package/dist/npm/react.js +1 -1
- package/dist/npm/svelte.js +1 -1
- package/dist/npm/types/adapters/vue.d.ts +14 -0
- package/dist/npm/types/anchor/index.d.ts +22 -1
- package/dist/npm/types/core/api.d.ts +3 -0
- package/dist/npm/types/core/auth.d.ts +11 -0
- package/dist/npm/types/core/client.d.ts +128 -6
- package/dist/npm/types/core/types.d.ts +78 -4
- package/dist/npm/types/headless.d.ts +1 -1
- package/dist/npm/types/index.d.ts +6 -1
- package/dist/npm/vue.js +5 -1
- package/package.json +7 -5
- package/dist/npm/chunks/Guest-VNoofLxw.js +0 -157
- package/dist/npm/chunks/MarkupEditor-DTXrS3DD.js +0 -199
- package/dist/npm/chunks/Panel-B88JYH52.js +0 -438
- package/dist/npm/chunks/ThreadCard-izybwXIC.js +0 -817
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +0 -270
- package/dist/npm/chunks/art-DK1JwPIo.js +0 -155
- package/dist/npm/chunks/client-Iegfv6ZC.js +0 -620
- package/dist/npm/chunks/colors-CX-IPjvb.js +0 -86
- package/dist/npm/chunks/extension-DSA8S8Qz.js +0 -26
- package/dist/npm/chunks/format-B5tJGtPC.js +0 -524
- package/dist/npm/chunks/html2canvas-DfGb8yka.js +0 -4024
- package/dist/npm/chunks/mount-Dx_8NhX3.js +0 -1484
- package/dist/npm/chunks/privacy-DLhezjyi.js +0 -30
- package/dist/npm/chunks/realtime-CBRW9BB3.js +0 -34
- package/dist/npm/chunks/src-C1Qp94nr.js +0 -549
|
@@ -10,7 +10,7 @@ var e = {
|
|
|
10
10
|
reply: "回复",
|
|
11
11
|
replyPlaceholder: "写下回复…",
|
|
12
12
|
composerPlaceholder: "这里需要怎么改?写得越具体越好。",
|
|
13
|
-
modeBar: "
|
|
13
|
+
modeBar: "点击即可评论 · 拖动可引用文字或框选区域 · 按 Esc 退出",
|
|
14
14
|
modeBarTouch: "轻点任意位置评论 · 照常滚动 · 先选中文字可引用",
|
|
15
15
|
commentOnPage: "评论整个页面",
|
|
16
16
|
commentFocused: "评论选中的部分",
|
|
@@ -21,6 +21,7 @@ var e = {
|
|
|
21
21
|
screenshotAdd: "附上截图",
|
|
22
22
|
markup: "在截图上标注",
|
|
23
23
|
markupDone: "标注完成",
|
|
24
|
+
markupEmpty: "请先画点什么",
|
|
24
25
|
tool_arrow: "箭头",
|
|
25
26
|
tool_rect: "方框",
|
|
26
27
|
tool_pen: "画笔",
|
|
@@ -32,8 +33,8 @@ var e = {
|
|
|
32
33
|
color_orange: "橙色",
|
|
33
34
|
color_green: "绿色",
|
|
34
35
|
color_blue: "蓝色",
|
|
35
|
-
color_black: "黑色",
|
|
36
36
|
capturing: "正在截图…",
|
|
37
|
+
capturingFailed: "无法截取此页面,但你的评论仍会标记位置。",
|
|
37
38
|
uploadFailed: "文件没能附加。你仍然可以发送评论。",
|
|
38
39
|
signInToSend: "最后一步:告诉我们你是谁",
|
|
39
40
|
signInExplain: "我们会打开一个小窗口,请你确认邮箱。在这台设备上只需要做一次。",
|
|
@@ -73,9 +74,22 @@ var e = {
|
|
|
73
74
|
copyLink: "复制链接",
|
|
74
75
|
copied: "已复制",
|
|
75
76
|
copyForAgent: "复制给 AI 助手",
|
|
77
|
+
sendToAgent: "发送给智能体",
|
|
78
|
+
selectedCount: "已选 {n} 条",
|
|
79
|
+
selectedCount_one: "已选 {n} 条",
|
|
80
|
+
agentPreparing: "正在获取对话…",
|
|
81
|
+
agentReady: "{n} 条评论已就绪",
|
|
82
|
+
agentReady_one: "1 条评论已就绪",
|
|
83
|
+
openIn: "在 {agent} 中打开",
|
|
84
|
+
copyPrompt: "复制提示词",
|
|
85
|
+
agentOpened: "正在打开 {agent} 并填好提示词,剪贴板中也有一份。",
|
|
86
|
+
agentOpenedShort: "正在用简短版本打开 {agent},完整提示词在剪贴板中。",
|
|
87
|
+
agentCopied: "已为你的智能体复制 {n} 条评论。",
|
|
88
|
+
agentCopied_one: "已为你的智能体复制 1 条评论。",
|
|
89
|
+
agentFirstOnly: "已包含前 {max} 条。",
|
|
90
|
+
selectThread: "选择 {ref}",
|
|
76
91
|
copiedForAgent: "已复制。粘贴到你的 AI 编程助手里即可。",
|
|
77
92
|
delete: "删除",
|
|
78
|
-
deleteConfirm: "要为所有人删除这条反馈吗?回复和截图也会一起删除。",
|
|
79
93
|
edit: "编辑",
|
|
80
94
|
edited: "已编辑",
|
|
81
95
|
save: "保存",
|
|
@@ -85,7 +99,7 @@ var e = {
|
|
|
85
99
|
readOnly: "你的团队订阅已到期,反馈目前只能查看。你仍然可以阅读所有内容。",
|
|
86
100
|
offline: "你已离线。草稿会一直保留,直到你恢复联网。",
|
|
87
101
|
offlineSend: "你已离线。评论已保存在这里,恢复联网后再发送即可。",
|
|
88
|
-
errorGeneric: "
|
|
102
|
+
errorGeneric: "操作没有成功。请检查网络后重试。",
|
|
89
103
|
loadFailed: "反馈加载失败。请检查网络后重试。",
|
|
90
104
|
sendFailed: "评论还没发出去。内容还在,可以再试一次。",
|
|
91
105
|
retry: "重试",
|
|
@@ -127,9 +141,8 @@ var e = {
|
|
|
127
141
|
shortcutResolve: "将打开的评论标记为已解决",
|
|
128
142
|
shortcutClose: "关闭或返回",
|
|
129
143
|
shortcutSend: "发送你写的内容",
|
|
130
|
-
shortcutToggle: "
|
|
144
|
+
shortcutToggle: "打开或关闭收件箱(也会重新显示已隐藏的 CommentKit)",
|
|
131
145
|
shortcutHelp: "显示此列表",
|
|
132
|
-
deleteReplyConfirm: "要为所有人删除这条回复吗?",
|
|
133
146
|
replyDeleted: "回复已删除",
|
|
134
147
|
peopleHere: "{n} 人正在查看",
|
|
135
148
|
peopleHere_one: "{n} 人正在查看",
|
|
@@ -178,7 +191,10 @@ var e = {
|
|
|
178
191
|
saving: "正在保存…",
|
|
179
192
|
statusFilter: "状态",
|
|
180
193
|
resolvedToast: "{ref} 已解决。",
|
|
194
|
+
undoTooLate: "已无法撤销。如仍需处理,请重新打开 {ref}。",
|
|
181
195
|
guestIntro: "留下你的姓名和邮箱,方便团队回复你。无需注册账号。",
|
|
196
|
+
guestPrivacy: "你的姓名、邮箱和评论会发送给运营本网站的团队,以及为该团队提供此评论工具的 CommentKit。",
|
|
197
|
+
guestPrivacyLink: "隐私声明",
|
|
182
198
|
guestNameMissing: "请填写姓名,让团队知道是谁写的。",
|
|
183
199
|
guestEmailInvalid: "请检查邮箱地址,例如 name@company.com。",
|
|
184
200
|
verifyLinkExpired: "此客户链接已过期。请向发送链接的人索取新链接。你的评论已保存在这台设备上。",
|
|
@@ -187,7 +203,8 @@ var e = {
|
|
|
187
203
|
pendingNote: "你的评论正在等待我们发送到 {email} 的验证码。",
|
|
188
204
|
enterCode: "输入验证码",
|
|
189
205
|
feedbackRef: "反馈 {ref}",
|
|
190
|
-
networkError: "无法连接到 CommentKit
|
|
206
|
+
networkError: "无法连接到 CommentKit。请检查网络连接后重试。",
|
|
207
|
+
serverError: "CommentKit 出了点问题。请稍后重试。",
|
|
191
208
|
noAccess: "你无权查看此网站上的反馈。请让团队重新邀请你。",
|
|
192
209
|
originNotAllowed: "暂时无法从这个网址发送反馈。请让团队把它添加到项目中。",
|
|
193
210
|
forbidden: "你没有权限执行此操作。",
|
|
@@ -205,7 +222,142 @@ var e = {
|
|
|
205
222
|
dueDate: "截止日期",
|
|
206
223
|
dueOn: "截止 {date}",
|
|
207
224
|
labels: "标签",
|
|
208
|
-
noLabels: "无标签"
|
|
225
|
+
noLabels: "无标签",
|
|
226
|
+
mentionList: "可以提及的人",
|
|
227
|
+
formatting: "格式",
|
|
228
|
+
formatBold: "粗体",
|
|
229
|
+
formatItalic: "斜体",
|
|
230
|
+
formatStrike: "删除线",
|
|
231
|
+
formatCode: "代码",
|
|
232
|
+
reopenedToast: "{ref} 已重新打开。",
|
|
233
|
+
editedToast: "评论已更新。",
|
|
234
|
+
editConflict: "刚刚有人修改了此内容,已刷新。",
|
|
235
|
+
threadDeleted: "{ref} 已删除。",
|
|
236
|
+
detailCreated: "留下时间",
|
|
237
|
+
detailResolved: "解决时间",
|
|
238
|
+
detailPage: "页面",
|
|
239
|
+
detailBrowser: "浏览器",
|
|
240
|
+
detailWindow: "窗口",
|
|
241
|
+
details: "信息",
|
|
242
|
+
quotedText: "选中的文字",
|
|
243
|
+
replyTo: "回复 {name}",
|
|
244
|
+
quoteReply: "引用回复",
|
|
245
|
+
copyText: "复制文字",
|
|
246
|
+
copiedText: "已复制这条消息。",
|
|
247
|
+
reactionLabel_one: "{n} 个回应:{emoji}",
|
|
248
|
+
reactionLabel: "{n} 个回应:{emoji}",
|
|
249
|
+
youReacted: "包括你",
|
|
250
|
+
noReplies: "还没有回复。来第一个回复吧。",
|
|
251
|
+
jumpToLatest: "跳到最新",
|
|
252
|
+
replyToReopen: "回复即可重新打开…",
|
|
253
|
+
quoteCancel: "不引用这条消息",
|
|
254
|
+
hideWidget: "隐藏 CommentKit",
|
|
255
|
+
hideWidgetHint: "按 {keys} 重新显示",
|
|
256
|
+
shortcutNewLine: "换行",
|
|
257
|
+
shortcutFormat: "粗体、斜体、代码(Shift + X:删除线)",
|
|
258
|
+
countOf: "{n} / {total}",
|
|
259
|
+
results_one: "{n} 个结果",
|
|
260
|
+
results: "{n} 个结果",
|
|
261
|
+
resultsMore: "{n}+ 个结果",
|
|
262
|
+
showMore: "显示更多",
|
|
263
|
+
livePaused: "实时更新已暂停。重新连接或刷新页面后会显示新的反馈。",
|
|
264
|
+
clearSearch: "清除搜索",
|
|
265
|
+
filtersOn_one: "已启用 {n} 个筛选条件",
|
|
266
|
+
filtersOn: "已启用 {n} 个筛选条件",
|
|
267
|
+
resetFilters: "重置",
|
|
268
|
+
sortBy: "排序方式",
|
|
269
|
+
sortRecent: "最近活动",
|
|
270
|
+
sortOldest: "最早的在前",
|
|
271
|
+
sortPriority: "优先级最高",
|
|
272
|
+
pinMoved: "{ref} 已移到这里。",
|
|
273
|
+
pinMovable: "标记,拖动可移动",
|
|
274
|
+
assign: "指派",
|
|
275
|
+
modeBarNoText: "点击任意位置评论 · 拖动可框选区域 · 按 Esc 退出",
|
|
276
|
+
modeBarTouchNoText: "轻点任意位置评论 · 照常滚动",
|
|
277
|
+
verifyResendIn: "{n} 秒后可获取新验证码",
|
|
278
|
+
tool_line: "直线",
|
|
279
|
+
tool_ellipse: "圆圈",
|
|
280
|
+
color_yellow: "黄色",
|
|
281
|
+
color_purple: "紫色",
|
|
282
|
+
color_pink: "粉色",
|
|
283
|
+
markupTools: "工具",
|
|
284
|
+
markupColors: "颜色",
|
|
285
|
+
markupSize: "线条粗细",
|
|
286
|
+
markupHistory: "历史",
|
|
287
|
+
redo: "重做",
|
|
288
|
+
clearAll: "全部清除",
|
|
289
|
+
imageViewer: "图片查看器",
|
|
290
|
+
download: "下载",
|
|
291
|
+
openInTab: "在新标签页中打开",
|
|
292
|
+
previousImage: "上一张图片",
|
|
293
|
+
nextImage: "下一张图片",
|
|
294
|
+
attachments: "附件",
|
|
295
|
+
openImage: "打开 {name}",
|
|
296
|
+
uploading: "正在上传 {name}",
|
|
297
|
+
retryUpload: "重新上传 {name}",
|
|
298
|
+
uploadFailedShort: "这个文件没有上传成功。",
|
|
299
|
+
moreReactions: "更多表情回应",
|
|
300
|
+
settings: "设置",
|
|
301
|
+
account: "你的账户",
|
|
302
|
+
appearance: "外观",
|
|
303
|
+
appearanceHint: "仅在这台设备上生效。",
|
|
304
|
+
themeSystem: "跟随系统",
|
|
305
|
+
themeLight: "浅色",
|
|
306
|
+
themeDark: "深色",
|
|
307
|
+
openDashboard: "打开控制台",
|
|
308
|
+
role_admin: "管理员",
|
|
309
|
+
role_member: "成员",
|
|
310
|
+
role_reviewer: "审阅者",
|
|
311
|
+
role_guest: "访客",
|
|
312
|
+
checklist: "清单",
|
|
313
|
+
description: "描述",
|
|
314
|
+
checklistProgress: "已完成 {n}/{total}",
|
|
315
|
+
checklistAdd: "添加一项,然后按 Enter",
|
|
316
|
+
removeItem: "移除 {item}",
|
|
317
|
+
addChecklist: "添加清单",
|
|
318
|
+
checklistShort_one: "已完成 {done}/{n}",
|
|
319
|
+
checklistShort: "已完成 {done}/{n}",
|
|
320
|
+
teamHere: "正在查看:{names}",
|
|
321
|
+
otherBranch: "其他版本…",
|
|
322
|
+
createdByMe: "我创建的",
|
|
323
|
+
anyPriority: "任意优先级",
|
|
324
|
+
priorityImportant: "紧急和高",
|
|
325
|
+
team: "团队",
|
|
326
|
+
online: "在线",
|
|
327
|
+
you: "你",
|
|
328
|
+
role_owner: "所有者",
|
|
329
|
+
storage: "存储空间",
|
|
330
|
+
storageUsed: "此项目已使用 {used},共 {limit}",
|
|
331
|
+
storageUsedOnly: "此项目已使用 {used}",
|
|
332
|
+
backToList: "返回列表",
|
|
333
|
+
previousThread: "上一条",
|
|
334
|
+
nextThread: "下一条",
|
|
335
|
+
showOnPage: "在页面上显示",
|
|
336
|
+
doubleClickHint: "在收件箱外双击即可关闭,或按 Esc。",
|
|
337
|
+
spot_element: "在某个元素上",
|
|
338
|
+
spot_region: "在某个区域上",
|
|
339
|
+
spot_text: "在选中的文字上",
|
|
340
|
+
spot_page: "在整个页面上",
|
|
341
|
+
resolveRef: "解决 {ref}",
|
|
342
|
+
copyLinkRef: "复制 {ref} 的链接",
|
|
343
|
+
moveToolbar: "移动工具栏(拖动或使用方向键)",
|
|
344
|
+
adjustStyle: "调整样式",
|
|
345
|
+
adjustStyleHint: "试试其他值:此面板打开时,效果会显示在页面上。网站本身不会改变。",
|
|
346
|
+
styleChanges: "样式修改",
|
|
347
|
+
styleSuggested: "建议的样式修改",
|
|
348
|
+
stylePreview: "在页面上预览",
|
|
349
|
+
styleRemoved: "移除",
|
|
350
|
+
styleNotSet: "未设置",
|
|
351
|
+
styleRemoveValue: "移除 {property}",
|
|
352
|
+
styleReset: "撤销对 {property} 的修改",
|
|
353
|
+
styleRemoveChange: "移除修改:{change}",
|
|
354
|
+
styleIncrease: "增大 {property}",
|
|
355
|
+
styleDecrease: "减小 {property}",
|
|
356
|
+
styleInvalid: "请使用简单的 CSS 值,例如 16px、bold 或 #1a73e8。",
|
|
357
|
+
styleDone: "完成",
|
|
358
|
+
stylePrevious: "{property} 的上一个值",
|
|
359
|
+
styleNext: "{property} 的下一个值",
|
|
360
|
+
styleEdit: "编辑建议的样式更改"
|
|
209
361
|
};
|
|
210
362
|
//#endregion
|
|
211
363
|
export { e as default };
|
package/dist/npm/element.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./chunks/src-
|
|
2
|
-
import { l as t } from "./chunks/client-Iegfv6ZC.js";
|
|
1
|
+
import { t as e } from "./chunks/src-CgBEoWl0.js";
|
|
3
2
|
//#region src/element.ts
|
|
4
|
-
var n = class extends HTMLElement {
|
|
3
|
+
var t, n = class extends HTMLElement {
|
|
5
4
|
constructor(...e) {
|
|
6
|
-
super(...e),
|
|
5
|
+
super(...e), this.kit = null;
|
|
7
6
|
}
|
|
8
7
|
attributeChangedCallback(e, t, n) {
|
|
9
8
|
t !== n && this.isConnected && (this.disconnectedCallback(), this.connectedCallback());
|
|
@@ -36,6 +35,6 @@ var n = class extends HTMLElement {
|
|
|
36
35
|
this.kit = null;
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
|
-
t
|
|
38
|
+
t = n, t.observedAttributes = ["project"], typeof customElements < "u" && !customElements.get("comment-kit") && customElements.define("comment-kit", n);
|
|
40
39
|
//#endregion
|
|
41
40
|
export { n as CommentKitElement };
|
package/dist/npm/headless.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { f as e, i as t, l as n, n as r, p as i, r as a, t as o } from "./chunks/client-CJ1tpI62.js";
|
|
2
|
+
import { a as s, o as c, t as l } from "./chunks/anchor-OCQnjp_6.js";
|
|
3
|
+
export { e as ApiClient, n as AuthManager, o as CommentKitClient, i as CommentKitError, r as EDIT_CONFLICT, a as SDK_VERSION, l as createAnchor, t as currentPageUrl, s as resolveAnchor, c as stableSelector };
|
package/dist/npm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./chunks/src-
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "./chunks/src-CgBEoWl0.js";
|
|
2
|
+
import { p as t, r as n } from "./chunks/client-CJ1tpI62.js";
|
|
3
3
|
export { t as CommentKitError, n as SDK_VERSION, e as init };
|
package/dist/npm/react.js
CHANGED
package/dist/npm/svelte.js
CHANGED
|
@@ -50,6 +50,10 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
50
50
|
type: BooleanConstructor;
|
|
51
51
|
default: undefined;
|
|
52
52
|
};
|
|
53
|
+
tools: {
|
|
54
|
+
type: PropType<CommentKitOptions["tools"]>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
53
57
|
}>, () => null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
58
|
project: {
|
|
55
59
|
type: StringConstructor;
|
|
@@ -99,6 +103,10 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
99
103
|
type: BooleanConstructor;
|
|
100
104
|
default: undefined;
|
|
101
105
|
};
|
|
106
|
+
tools: {
|
|
107
|
+
type: PropType<CommentKitOptions["tools"]>;
|
|
108
|
+
default: undefined;
|
|
109
|
+
};
|
|
102
110
|
}>> & Readonly<{}>, {
|
|
103
111
|
branch: string | null;
|
|
104
112
|
commit: string | null;
|
|
@@ -111,6 +119,12 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
111
119
|
locale: string;
|
|
112
120
|
auth: "auto" | "popup" | "redirect" | undefined;
|
|
113
121
|
shortcuts: boolean;
|
|
122
|
+
tools: {
|
|
123
|
+
screenshots?: boolean;
|
|
124
|
+
markup?: boolean;
|
|
125
|
+
text?: boolean;
|
|
126
|
+
attachments?: boolean;
|
|
127
|
+
} | undefined;
|
|
114
128
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
115
129
|
export declare const CommentKitPlugin: {
|
|
116
130
|
install(_app: App, options: CommentKitOptions): void;
|
|
@@ -39,10 +39,31 @@ export interface AnchorInput {
|
|
|
39
39
|
endY?: number;
|
|
40
40
|
/** Selected text for text comments. */
|
|
41
41
|
quote?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* More fields, read where the element is (src/anchor/pick.ts, lazy): shadow_path, frame(s), and in
|
|
44
|
+
* development builds source and component. Never a source when the element has data-ck-src.
|
|
45
|
+
*/
|
|
46
|
+
extra?: ((el: Element) => Partial<Anchor>) | null;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* A box (the element's own, or `r` measured in the node's document) in the top window's viewport,
|
|
50
|
+
* also inside same-origin iframes, nested too: each iframe's position and border are added.
|
|
51
|
+
*/
|
|
52
|
+
export declare function rectOf(node: Node, r?: DOMRect): DOMRect;
|
|
43
53
|
export declare function createAnchor(input: AnchorInput): Anchor;
|
|
44
54
|
export declare function stableSelector(el: Element): string | null;
|
|
45
55
|
export declare function fingerprint(el: Element): string | null;
|
|
46
|
-
export
|
|
56
|
+
export interface Found {
|
|
57
|
+
element: Element;
|
|
58
|
+
state: AnchorState;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Where the anchor is now. `known` skips the search with an element found earlier (the pins cache
|
|
62
|
+
* one per thread); null means "searched, nothing found". Offsets are kept inside the element's box,
|
|
63
|
+
* so a pin stays on its element at any width.
|
|
64
|
+
*/
|
|
65
|
+
export declare function resolveAnchor(anchor: Anchor, root?: ParentNode, known?: Found | null): ResolvedAnchor;
|
|
66
|
+
/** The element the anchor points at, searched inside its iframe and shadow roots. */
|
|
67
|
+
export declare function findElement(anchor: Anchor, root?: ParentNode): Found | null;
|
|
47
68
|
/** Dice coefficient on character bigrams: 1 = identical, 0 = nothing in common. */
|
|
48
69
|
export declare function similarity(a: string | null | undefined, b: string | null | undefined): number;
|
|
@@ -7,6 +7,8 @@ export interface ApiRequest {
|
|
|
7
7
|
/** Reuse this Idempotency-Key (a "Try again" after a failed attempt must send the same one). */
|
|
8
8
|
idempotencyKey?: string;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
|
+
/** Receives the answer's ETag (null when it has none), to send back as If-Match or If-None-Match. */
|
|
11
|
+
onETag?(etag: string | null): void;
|
|
10
12
|
/** Skip the Authorization header (public endpoints). */
|
|
11
13
|
anonymous?: boolean;
|
|
12
14
|
signal?: AbortSignal;
|
|
@@ -26,6 +28,7 @@ export declare class ApiClient {
|
|
|
26
28
|
private readonly tokens;
|
|
27
29
|
private readonly sdkVersion;
|
|
28
30
|
constructor(baseUrl: string, tokens: TokenProvider, sdkVersion: string);
|
|
31
|
+
/** The answer's JSON; undefined for 204, and for 304 (nothing changed since the `If-None-Match` sent). */
|
|
29
32
|
request<T>(path: string, options?: ApiRequest): Promise<T>;
|
|
30
33
|
url(path: string, query?: ApiRequest["query"]): string;
|
|
31
34
|
}
|
|
@@ -10,6 +10,8 @@ export interface Tokens {
|
|
|
10
10
|
}
|
|
11
11
|
export type SignInResult = "signed_in" | "popup_blocked" | "cancelled" | "failed" | "redirecting";
|
|
12
12
|
export type AuthMode = "auto" | "popup" | "redirect";
|
|
13
|
+
/** Token, exchange and revoke requests are aborted after this long; the storage lock's lease (lock.ts HOLD_MS) is longer. */
|
|
14
|
+
export declare const TOKEN_TIMEOUT_MS = 10000;
|
|
13
15
|
/**
|
|
14
16
|
* Widget sign-in: a popup on the CommentKit domain (credentials never touch
|
|
15
17
|
* this page), PKCE, short-lived access tokens and a rotating refresh token.
|
|
@@ -52,6 +54,11 @@ export declare class AuthManager {
|
|
|
52
54
|
private redirect;
|
|
53
55
|
signOut(): Promise<void>;
|
|
54
56
|
private awaitCode;
|
|
57
|
+
/**
|
|
58
|
+
* One refresh at a time across this site's tabs (they share the refresh token, and the server treats a
|
|
59
|
+
* second use of a rotated token as theft). The token is read again once the lock is held: another tab
|
|
60
|
+
* may have rotated it meanwhile.
|
|
61
|
+
*/
|
|
55
62
|
private refresh;
|
|
56
63
|
/**
|
|
57
64
|
* Applies the widget config's `auth`. `remember` is the project's "remember me" policy:
|
|
@@ -81,5 +88,9 @@ export declare class AuthManager {
|
|
|
81
88
|
private clear;
|
|
82
89
|
private readRefresh;
|
|
83
90
|
private emit;
|
|
91
|
+
/**
|
|
92
|
+
* Aborted after TOKEN_TIMEOUT_MS (body included): a request that never settles (captive portal,
|
|
93
|
+
* stalled proxy, sleep and resume) must not hold the cross-tab refresh lock, which every tab waits on.
|
|
94
|
+
*/
|
|
84
95
|
private post;
|
|
85
96
|
}
|
|
@@ -2,8 +2,14 @@ import { ApiClient } from "./api.js";
|
|
|
2
2
|
import { AuthManager, type SignInResult } from "./auth.js";
|
|
3
3
|
import type { FeedbackPing } from "./types.js";
|
|
4
4
|
import { type Store } from "./store.js";
|
|
5
|
-
import type { Anchor, Attachment, CaptureInput, CommentKitEvents, CommentKitOptions, InboxItem, Label, Message, Page, Person, Session, Thread, ThreadPriority, ThreadStatus, WidgetConfig } from "./types.js";
|
|
5
|
+
import type { Anchor, Attachment, CaptureInput, ChecklistItem, CommentKitEvents, CommentKitOptions, InboxItem, Label, Message, Page, Person, Session, StyleChange, Thread, TaskInput, ThreadPriority, ThreadStatus, WidgetConfig } from "./types.js";
|
|
6
6
|
import { CommentKitError } from "./types.js";
|
|
7
|
+
export interface LinkPreview {
|
|
8
|
+
url: string;
|
|
9
|
+
site: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
}
|
|
7
13
|
export declare const SDK_VERSION: string;
|
|
8
14
|
export interface ClientState {
|
|
9
15
|
config: WidgetConfig | null;
|
|
@@ -20,8 +26,21 @@ export interface ClientState {
|
|
|
20
26
|
here: number;
|
|
21
27
|
/** A thread someone asked to open (window.CommentKit.open, init().open): an id or a reference like CK-12. */
|
|
22
28
|
opening: string | null;
|
|
29
|
+
/** Something the page asked for (Cmd/Ctrl+Shift+K, `comment()`); `at` makes each request new. */
|
|
30
|
+
request: {
|
|
31
|
+
kind: "inbox" | "comment" | "stop";
|
|
32
|
+
at: number;
|
|
33
|
+
} | null;
|
|
34
|
+
/** Live updates: "on", "lost" (the connection dropped and is retrying) or "off" (not used here). */
|
|
35
|
+
live: "on" | "lost" | "off";
|
|
36
|
+
/** The reader's own theme choice on this device (Settings); null follows the site and dashboard. */
|
|
37
|
+
theme: "auto" | "light" | "dark" | null;
|
|
38
|
+
/** Team members here right now, by name: only filled in for team members (the team presence channel). */
|
|
39
|
+
team: Person[];
|
|
23
40
|
}
|
|
24
41
|
type Listener<K extends keyof CommentKitEvents> = (payload: CommentKitEvents[K]) => void;
|
|
42
|
+
/** The `code` of the error an edit gets when someone else changed the thread or message first (HTTP 412). */
|
|
43
|
+
export declare const EDIT_CONFLICT = "edit_conflict";
|
|
25
44
|
/**
|
|
26
45
|
* Everything the widget needs from the server, independent of any UI.
|
|
27
46
|
* Also usable headless (custom UIs, tests, browser extensions).
|
|
@@ -33,10 +52,23 @@ export declare class CommentKitClient {
|
|
|
33
52
|
readonly state: Store<ClientState>;
|
|
34
53
|
private listeners;
|
|
35
54
|
private realtime;
|
|
36
|
-
|
|
37
|
-
private
|
|
55
|
+
/** Whose connection `realtime` is (or is being opened for), and which attempt; see connectRealtime. */
|
|
56
|
+
private live;
|
|
57
|
+
private attempts;
|
|
58
|
+
private readonly offSession;
|
|
59
|
+
/** The CommentKit server this client talks to (no trailing slash). */
|
|
60
|
+
readonly endpoint: string;
|
|
61
|
+
private configTag;
|
|
62
|
+
/** Last known ETag per thread and per message, sent as If-Match with edits. */
|
|
63
|
+
private tags;
|
|
64
|
+
private previews;
|
|
38
65
|
private reportNonce;
|
|
66
|
+
private unreadKnown;
|
|
67
|
+
/** Conversations read by allMessages, page by page, so a refresh reads only what is new. */
|
|
68
|
+
private conversations;
|
|
39
69
|
constructor(options: CommentKitOptions);
|
|
70
|
+
/** Where CommentKit's own static files live (emoji images), on the same server as the API. */
|
|
71
|
+
get assets(): string;
|
|
40
72
|
/** The widget's own crash, sent to CommentKit with the SDK version (see core/report.ts). */
|
|
41
73
|
reportCrash(error: unknown, kind?: "crash" | "start"): void;
|
|
42
74
|
on<K extends keyof CommentKitEvents>(event: K, listener: Listener<K>): () => void;
|
|
@@ -61,34 +93,77 @@ export declare class CommentKitClient {
|
|
|
61
93
|
cursor?: string;
|
|
62
94
|
limit?: number;
|
|
63
95
|
sort?: string;
|
|
96
|
+
priority?: string;
|
|
97
|
+
author?: "me";
|
|
64
98
|
}): Promise<Page<Thread>>;
|
|
65
99
|
getThread(id: string): Promise<Thread>;
|
|
100
|
+
/** A thread request, remembering the thread's ETag for the next edit. */
|
|
101
|
+
private thread;
|
|
102
|
+
private tag;
|
|
66
103
|
createThread(input: {
|
|
67
104
|
anchor: Anchor;
|
|
68
105
|
body: string;
|
|
69
106
|
capture?: CaptureInput | null;
|
|
70
107
|
attachmentIds?: string[];
|
|
71
108
|
mentionIds?: number[];
|
|
109
|
+
/** Priority, assignee and labels from a team member, set in the same request. */
|
|
110
|
+
task?: TaskInput;
|
|
111
|
+
/** Extra detail and a checklist, from anyone who writes the comment. */
|
|
112
|
+
description?: string | null;
|
|
113
|
+
checklist?: string[];
|
|
114
|
+
/** Suggested style changes for the commented element (at most 20). */
|
|
115
|
+
styleChanges?: StyleChange[];
|
|
72
116
|
/** The same key for every attempt at this one comment, so a lost response never creates it twice. */
|
|
73
117
|
idempotencyKey?: string;
|
|
74
118
|
}): Promise<Thread>;
|
|
75
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* Reviewers may only resolve or reopen; priority, assignee, due date and labels are for members who can triage.
|
|
121
|
+
* Changing the text (`description`) only applies to the version last read here: when someone else changed
|
|
122
|
+
* the thread first it fails with code EDIT_CONFLICT (412), and the thread is read again.
|
|
123
|
+
*/
|
|
76
124
|
updateThread(id: string, changes: {
|
|
77
125
|
status?: ThreadStatus;
|
|
78
126
|
priority?: ThreadPriority;
|
|
79
127
|
assignee_id?: number | null;
|
|
128
|
+
assignee_ids?: number[];
|
|
129
|
+
description?: string | null;
|
|
80
130
|
due_at?: string | null;
|
|
81
131
|
label_ids?: number[];
|
|
132
|
+
anchor?: Anchor;
|
|
133
|
+
style_changes?: StyleChange[] | null;
|
|
82
134
|
}): Promise<Thread>;
|
|
83
135
|
deleteThread(id: string): Promise<void>;
|
|
136
|
+
/** One page of a conversation, oldest first (100 messages); `next_cursor` fetches the next page. */
|
|
84
137
|
messages(threadId: string, cursor?: string): Promise<Page<Message>>;
|
|
138
|
+
/**
|
|
139
|
+
* The whole conversation, oldest first: follows `next_cursor` for at most 20 pages (2,000 messages)
|
|
140
|
+
* per call. With `refresh` (a realtime ping for a card already open), pages read earlier are kept and
|
|
141
|
+
* only the last one is read again, then anything after it: new messages, and changes to the latest
|
|
142
|
+
* ones, cost one or two requests instead of the whole thread. A refresh also carries on past the
|
|
143
|
+
* 20-page cap, so on very long threads the newest messages arrive. A first read (refresh off), or a
|
|
144
|
+
* delete, edit or reaction made here on an earlier page, reads everything again.
|
|
145
|
+
*/
|
|
146
|
+
allMessages(threadId: string, options?: {
|
|
147
|
+
refresh?: boolean;
|
|
148
|
+
}): Promise<Message[]>;
|
|
149
|
+
/** A message changed here: forget the conversation holding it, so the next read is complete. */
|
|
150
|
+
private forgetConversationOf;
|
|
85
151
|
reply(threadId: string, body: string, options?: {
|
|
86
152
|
replyTo?: string | null;
|
|
87
153
|
attachmentIds?: string[];
|
|
88
154
|
mentionIds?: number[];
|
|
89
155
|
idempotencyKey?: string;
|
|
90
156
|
}): Promise<Message>;
|
|
91
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Edit your own message. `mentionIds` (everyone mentioned in the new text) notifies people newly
|
|
159
|
+
* mentioned; leave it out to keep the mentions as they were. Only applies to the version last read
|
|
160
|
+
* here: when it changed meanwhile it fails with code EDIT_CONFLICT (412).
|
|
161
|
+
*/
|
|
162
|
+
editMessage(id: string, body: string, options?: {
|
|
163
|
+
mentionIds?: number[];
|
|
164
|
+
}): Promise<Message>;
|
|
165
|
+
/** An edit; on a conflict the ETag is forgotten and `reload` (if any) reads the latest version. */
|
|
166
|
+
private edit;
|
|
92
167
|
deleteMessage(id: string): Promise<void>;
|
|
93
168
|
react(messageId: string, emoji: string, on: boolean): Promise<void>;
|
|
94
169
|
watch(threadId: string, on: boolean): Promise<{
|
|
@@ -97,19 +172,66 @@ export declare class CommentKitClient {
|
|
|
97
172
|
labels(): Promise<Label[]>;
|
|
98
173
|
people(): Promise<(Person & {
|
|
99
174
|
assignable: boolean;
|
|
175
|
+
role?: "owner" | "admin" | "member" | "reviewer";
|
|
100
176
|
})[]>;
|
|
177
|
+
addChecklistItem(threadId: string, body: string): Promise<ChecklistItem>;
|
|
178
|
+
updateChecklistItem(id: string, changes: {
|
|
179
|
+
body?: string;
|
|
180
|
+
done?: boolean;
|
|
181
|
+
}): Promise<ChecklistItem>;
|
|
182
|
+
deleteChecklistItem(id: string): Promise<void>;
|
|
183
|
+
/** Branches with open feedback (newer servers; older ones answer 404, which gives an empty list). */
|
|
184
|
+
branches(): Promise<never[] | {
|
|
185
|
+
name: string;
|
|
186
|
+
open: number;
|
|
187
|
+
}[]>;
|
|
188
|
+
/** Storage used and the limit per project, for the team. */
|
|
189
|
+
usage(): Promise<{
|
|
190
|
+
used_bytes: number;
|
|
191
|
+
limit_bytes: number | null;
|
|
192
|
+
}>;
|
|
193
|
+
/** A linked page's title and description, or null. Cached for this visit. */
|
|
194
|
+
linkPreview(url: string): Promise<LinkPreview | null>;
|
|
195
|
+
/** True once the server has said how many notifications are unread (state.unread is then real, not the initial 0). */
|
|
196
|
+
get inboxLoaded(): boolean;
|
|
101
197
|
inbox(): Promise<InboxItem[]>;
|
|
198
|
+
/**
|
|
199
|
+
* The latest notifications and, with the `next_cursor` of an earlier page, the ones before them.
|
|
200
|
+
* `next_cursor` is null when there are no more (servers that send one page only always say null),
|
|
201
|
+
* so `data.length` is how many are shown, not how many there are.
|
|
202
|
+
*/
|
|
203
|
+
inboxPage(cursor?: string): Promise<Page<InboxItem> & {
|
|
204
|
+
unread: number;
|
|
205
|
+
}>;
|
|
102
206
|
markRead(input: {
|
|
103
207
|
ids?: string[];
|
|
104
208
|
threadId?: string;
|
|
105
209
|
all?: boolean;
|
|
106
210
|
}): Promise<void>;
|
|
107
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Reserve, send and confirm one file. `onProgress` gets 0..1 while the bytes go up (that needs
|
|
213
|
+
* XMLHttpRequest: fetch can't report upload progress); `signal` cancels it.
|
|
214
|
+
*/
|
|
215
|
+
upload(file: Blob, name: string, kind?: "screenshot" | "file", options?: {
|
|
216
|
+
onProgress?(fraction: number): void;
|
|
217
|
+
signal?: AbortSignal;
|
|
218
|
+
}): Promise<Attachment>;
|
|
219
|
+
/**
|
|
220
|
+
* Opens the live connection for the signed-in person. Calling it again for the same person does
|
|
221
|
+
* nothing; for someone else (or after sign-out) the old connection is closed first, so a socket never
|
|
222
|
+
* stays on the previous person's inbox or team channels and there is never more than one.
|
|
223
|
+
*/
|
|
108
224
|
connectRealtime(onChange: (event: FeedbackPing) => void): Promise<void>;
|
|
225
|
+
/** Close the live connection (sign-out, another person, destroy). */
|
|
226
|
+
private disconnectRealtime;
|
|
227
|
+
/** Try the live connection again now, after it dropped. */
|
|
228
|
+
reconnectRealtime(): void;
|
|
109
229
|
refreshThread(id: string): Promise<void>;
|
|
110
230
|
private upsert;
|
|
111
231
|
destroy(): void;
|
|
112
232
|
}
|
|
233
|
+
/** Remember the reader's theme on this device (null forgets it). */
|
|
234
|
+
export declare function saveTheme(theme: ClientState["theme"]): void;
|
|
113
235
|
/** Page identity: origin + path + query + hash routes, without our own params. */
|
|
114
236
|
export declare function currentPageUrl(): string;
|
|
115
237
|
export {};
|