@commentkit/comment-kit 1.6.0 → 2.0.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/CHANGELOG.md +298 -590
- package/README.md +421 -145
- package/SECURITY.md +47 -46
- package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
- package/dist/node/browser.js +17 -0
- package/dist/node/cli/api.js +226 -0
- package/dist/node/cli/bin.js +18 -0
- package/dist/node/cli/credentials.js +268 -0
- package/dist/node/cli/doctor.js +789 -0
- package/dist/node/cli/format.js +54 -0
- package/dist/node/cli/init.js +686 -0
- package/dist/node/cli/main.js +537 -0
- package/dist/node/cli/mcp.js +295 -0
- package/dist/node/cli/open.js +20 -0
- package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
- package/dist/node/plugins/astro.js +26 -0
- package/dist/node/plugins/git-BIXLbL3f.js +92 -0
- package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
- package/dist/node/plugins/next.js +48 -0
- package/dist/node/plugins/options-THop1K92.js +71 -0
- package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
- package/dist/node/plugins/vite-BdAYUW10.js +74 -0
- package/dist/node/plugins/vite.js +1 -0
- package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
- package/dist/node/plugins/webpack-loader.cjs +21 -0
- package/dist/node/plugins/webpack-loader.js +18 -0
- package/dist/node/plugins/webpack.js +1 -0
- package/dist/node/shared/dashboard-places.js +33 -0
- package/dist/node/shared/endpoint.js +26 -0
- package/dist/node/shared/format.js +63 -0
- package/dist/node/types/astro.d.ts +11 -0
- package/dist/node/types/next.d.ts +34 -0
- package/dist/node/types/options.d.ts +59 -0
- package/dist/node/types/vite.d.ts +11 -0
- package/dist/node/types/webpack-loader.d.ts +22 -0
- package/dist/node/types/webpack.d.ts +27 -0
- package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
- package/dist/npm/chunks/AgentSend-DOy3jhyF.js +68 -0
- package/dist/npm/chunks/Checklist-CW_SwMpS.js +282 -0
- package/dist/npm/chunks/Composer-Bveq5QrK.js +727 -0
- package/dist/npm/chunks/Guest-7hcN765o.js +270 -0
- package/dist/npm/chunks/MarkupEditor-6bJGpWGO.js +345 -0
- package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
- package/dist/npm/chunks/Settings-CB5eEKnf.js +231 -0
- package/dist/npm/chunks/Shortcuts-eAyjJ89P.js +62 -0
- package/dist/npm/chunks/StyleEditor-CZTdAA5c.js +46 -0
- package/dist/npm/chunks/StylePanel-B4pHQUL9.js +199 -0
- package/dist/npm/chunks/TaskFields-C8BX0Sgg.js +289 -0
- package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
- package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
- package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-MTQHr9ei.js} +9 -9
- package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
- package/dist/npm/chunks/{ar-8tPch6W4.js → ar-L5cQ-NPe.js} +71 -19
- package/dist/npm/chunks/card-bits-CTdrkYn8.js +53 -0
- package/dist/npm/chunks/{client-EFTWxHbJ.js → client-7eVxvg5j.js} +282 -290
- package/dist/npm/chunks/confetti-BIs5s14P.js +49 -0
- package/dist/npm/chunks/context-BuMl7A07.js +48 -0
- package/dist/npm/chunks/context-Cf6khm7A.js +20 -0
- package/dist/npm/chunks/{de-C63897uD.js → de-D0C-v6tP.js} +62 -18
- package/dist/npm/chunks/dialog-DvdIkCW0.js +3 -0
- package/dist/npm/chunks/dpop-0A76OPa9.js +96 -0
- package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
- package/dist/npm/chunks/{es-CI2bSpvB.js → es-Bw4Dj9tN.js} +62 -18
- package/dist/npm/chunks/extension-DFVOvciD.js +62 -0
- package/dist/npm/chunks/{extension-BST6LH1q.js → extension-SmoH5AA4.js} +20 -12
- package/dist/npm/chunks/files-4lV9YQIX.js +114 -0
- package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-TkuQaIAa.js} +120 -76
- package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-DXSH2U8d.js} +63 -19
- package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-aVSu9TcJ.js} +136 -92
- package/dist/npm/chunks/identify-BGYh2dVo.js +106 -0
- package/dist/npm/chunks/{it-C8tnV0BF.js → it-CiWA_bch.js} +81 -37
- package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-C-QmR3yz.js} +60 -16
- package/dist/npm/chunks/late-words-80_VWt8S.js +14 -0
- package/dist/npm/chunks/live-BExWHzQ7.js +85 -0
- package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
- package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-CEmZRqjX.js} +63 -19
- package/dist/npm/chunks/page-key-HSY3Lze5.js +62 -0
- package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-B3sR7jtS.js} +45 -44
- package/dist/npm/chunks/pkce-CfZhiNBi.js +8 -0
- package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
- package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
- package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-b-a8sxO8.js} +62 -18
- package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
- package/dist/npm/chunks/report-DaVuoRYS.js +44 -0
- package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
- package/dist/npm/chunks/signin-BOWr_WCo.js +75 -0
- package/dist/npm/chunks/{source-CS7C6wJA.js → source-mk3rGBBQ.js} +1 -1
- package/dist/npm/chunks/src-C8rZFyL_.js +215 -0
- package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
- package/dist/npm/chunks/states-b9Bv3Ci7.js +3 -0
- package/dist/npm/chunks/upload-B2mkgMeJ.js +42 -0
- package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
- package/dist/npm/chunks/wrap-DW6EFbVQ.js +69 -0
- package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-JTscW8u8.js} +61 -17
- package/dist/npm/element.js +58 -21
- package/dist/npm/headless.js +7 -3
- package/dist/npm/index.js +3 -3
- package/dist/npm/react.js +18 -11
- package/dist/npm/svelte.js +28 -12
- package/dist/npm/types/adapters/react.d.ts +4 -1
- package/dist/npm/types/adapters/svelte.d.ts +4 -1
- package/dist/npm/types/adapters/vue.d.ts +35 -2
- package/dist/npm/types/anchor/index.d.ts +19 -0
- package/dist/npm/types/capture/privacy.d.ts +14 -0
- package/dist/npm/types/core/api.d.ts +20 -1
- package/dist/npm/types/core/auth.d.ts +40 -21
- package/dist/npm/types/core/client.d.ts +60 -4
- package/dist/npm/types/core/page-key.d.ts +42 -0
- package/dist/npm/types/core/types.d.ts +87 -4
- package/dist/npm/types/element.d.ts +17 -7
- package/dist/npm/types/headless.d.ts +2 -1
- package/dist/npm/types/index.d.ts +16 -6
- package/dist/npm/vue.js +44 -9
- package/package.json +90 -14
- package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
- package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
- package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
- package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
- package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
- package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
- package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
- package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
- package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
- package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
- package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
- package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
- package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
- package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
- package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
- package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
- package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
- package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
- package/dist/npm/chunks/report-BBrT3r89.js +0 -27
- package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
- package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
- package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
- package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { I as e, L as t, P as n, z as r } from "./start-CV4j78_q.js";
|
|
2
|
+
// src/capture/wrap.ts
|
|
3
|
+
var i = 20, a = 200;
|
|
4
|
+
function o(e) {
|
|
5
|
+
try {
|
|
6
|
+
if (e instanceof Error) return `${e.name}: ${e.message}`.slice(0, 1e3);
|
|
7
|
+
if (typeof e == "string") return e.slice(0, 1e3);
|
|
8
|
+
if (!e || typeof e != "object") return String(e);
|
|
9
|
+
let t = Array.isArray(e), n = t ? Array.from({ length: Math.min(e.length, i) }, (e, t) => t) : Object.keys(e).slice(0, i), r = t ? [] : {};
|
|
10
|
+
for (let t of n) {
|
|
11
|
+
let n = e[t];
|
|
12
|
+
r[t] = typeof n == "string" ? n.slice(0, a) : typeof n == "bigint" ? String(n) : n && typeof n == "object" ? Array.isArray(n) ? "[Array]" : "[Object]" : n;
|
|
13
|
+
}
|
|
14
|
+
return JSON.stringify(r).slice(0, 500);
|
|
15
|
+
} catch {
|
|
16
|
+
return "[unreadable]";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function s(t, i) {
|
|
20
|
+
try {
|
|
21
|
+
e(n, {
|
|
22
|
+
level: t,
|
|
23
|
+
message: r(i()),
|
|
24
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
25
|
+
});
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
function c(e) {
|
|
29
|
+
let n = [], r = !0, a = (e, t, r) => {
|
|
30
|
+
let i = e[t], a = r(i);
|
|
31
|
+
e[t] = a, n.push(() => {
|
|
32
|
+
e[t] === a && (e[t] = i);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
if (e.console) {
|
|
36
|
+
for (let e of ["error", "warn"]) a(console, e, (t) => (...n) => {
|
|
37
|
+
r && s(e, () => n.slice(0, i).map(o).join(" ")), t.apply(console, n);
|
|
38
|
+
});
|
|
39
|
+
let e = (e) => s("error", () => e.message || o(e.error)), t = (e) => s("error", () => `Unhandled promise rejection: ${o(e.reason)}`);
|
|
40
|
+
addEventListener("error", e), addEventListener("unhandledrejection", t), n.push(() => removeEventListener("error", e), () => removeEventListener("unhandledrejection", t));
|
|
41
|
+
}
|
|
42
|
+
if (e.network && typeof fetch == "function" && a(window, "fetch", (e) => async (...n) => {
|
|
43
|
+
if (!r) return e(...n);
|
|
44
|
+
let i = performance.now(), a = (n[1]?.method ?? (n[0] instanceof Request ? n[0].method : "GET")).toUpperCase(), o = n[0] instanceof Request ? n[0].url : String(n[0]);
|
|
45
|
+
try {
|
|
46
|
+
let r = await e(...n);
|
|
47
|
+
return r.status >= 400 && t(a, o, r.status, i), r;
|
|
48
|
+
} catch (e) {
|
|
49
|
+
throw t(a, o, 0, i), e;
|
|
50
|
+
}
|
|
51
|
+
}), e.network && typeof XMLHttpRequest == "function") {
|
|
52
|
+
let e = /* @__PURE__ */ new WeakMap();
|
|
53
|
+
a(XMLHttpRequest.prototype, "open", (t) => function(n, i, ...a) {
|
|
54
|
+
return r && e.set(this, {
|
|
55
|
+
method: String(n).toUpperCase(),
|
|
56
|
+
url: String(i)
|
|
57
|
+
}), t.call(this, n, i, ...a);
|
|
58
|
+
}), a(XMLHttpRequest.prototype, "send", (n) => function(i) {
|
|
59
|
+
let a = e.get(this), o = performance.now();
|
|
60
|
+
return a && this.addEventListener("loadend", () => {
|
|
61
|
+
r && (this.status >= 400 || this.status === 0) && t(a.method, a.url, this.status, o);
|
|
62
|
+
}, { once: !0 }), n.call(this, i);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return () => {
|
|
66
|
+
r = !1, n.forEach((e) => e());
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export { c as wrap };
|
|
@@ -17,7 +17,7 @@ var e = {
|
|
|
17
17
|
attach: "附加文件",
|
|
18
18
|
screenshot: "截图",
|
|
19
19
|
screenshotIncluded: "会自动附上你当前看到的画面截图。",
|
|
20
|
-
screenshotRemove: "
|
|
20
|
+
screenshotRemove: "移除截图",
|
|
21
21
|
screenshotAdd: "附上截图",
|
|
22
22
|
markup: "在截图上标注",
|
|
23
23
|
markupDone: "标注完成",
|
|
@@ -25,7 +25,7 @@ var e = {
|
|
|
25
25
|
tool_arrow: "箭头",
|
|
26
26
|
tool_rect: "方框",
|
|
27
27
|
tool_pen: "画笔",
|
|
28
|
-
tool_blur: "
|
|
28
|
+
tool_blur: "马赛克",
|
|
29
29
|
tool_text: "文字",
|
|
30
30
|
markupTextPrompt: "备注写什么?",
|
|
31
31
|
undo: "撤销",
|
|
@@ -41,8 +41,9 @@ var e = {
|
|
|
41
41
|
signIn: "继续",
|
|
42
42
|
signInMember: "登录",
|
|
43
43
|
signOut: "退出登录",
|
|
44
|
-
popupBlocked: "
|
|
44
|
+
popupBlocked: "浏览器拦截了登录窗口。请重试,或允许本网站弹出窗口。",
|
|
45
45
|
signInCancelled: "登录窗口在完成前被关闭了。你的评论还在。",
|
|
46
|
+
insecureContext: "只有在安全地址(https)上才能登录。请向网站团队索取此页面的 https 链接。",
|
|
46
47
|
sent: "已发送!团队已收到通知。",
|
|
47
48
|
sentGuest: "已发送!有人回复时我们会发邮件告诉你。",
|
|
48
49
|
thisPage: "当前页面",
|
|
@@ -50,6 +51,7 @@ var e = {
|
|
|
50
51
|
notifications: "通知",
|
|
51
52
|
nothingHere: "这个页面还没有反馈。",
|
|
52
53
|
nothingHereHint: "点击“评论”,然后点击页面上的任意位置。",
|
|
54
|
+
nothingHereHintTouch: "轻点“评论”,然后轻点页面上的任意位置。",
|
|
53
55
|
nothingAnywhere: "这个网站还没有反馈。",
|
|
54
56
|
noMatch: "没有符合搜索或筛选条件的反馈。",
|
|
55
57
|
clearFilters: "清除筛选",
|
|
@@ -67,7 +69,7 @@ var e = {
|
|
|
67
69
|
reopen: "重新打开",
|
|
68
70
|
markInProgress: "开始处理",
|
|
69
71
|
markInReview: "请求确认",
|
|
70
|
-
closeThread: "
|
|
72
|
+
closeThread: "不修复,直接关闭",
|
|
71
73
|
reviewAsk: "团队认为已经修好了。你看可以吗?",
|
|
72
74
|
looksGood: "可以了 — 解决",
|
|
73
75
|
notYet: "还不行 — 回复",
|
|
@@ -92,6 +94,7 @@ var e = {
|
|
|
92
94
|
delete: "删除",
|
|
93
95
|
edit: "编辑",
|
|
94
96
|
edited: "已编辑",
|
|
97
|
+
teamOnly: "仅团队可见",
|
|
95
98
|
save: "保存",
|
|
96
99
|
mute: "关闭通知",
|
|
97
100
|
unmute: "开启通知",
|
|
@@ -105,7 +108,7 @@ var e = {
|
|
|
105
108
|
retry: "重试",
|
|
106
109
|
loadingThread: "正在加载对话…",
|
|
107
110
|
readOnlyReply: "你可以查看这段对话,但目前无法回复。",
|
|
108
|
-
noReplyAccess: "
|
|
111
|
+
noReplyAccess: "你可以查看这段对话,但没有回复权限。",
|
|
109
112
|
notOnPage: "当前页面上找不到",
|
|
110
113
|
more: "更多",
|
|
111
114
|
allStatuses: "全部",
|
|
@@ -148,6 +151,8 @@ var e = {
|
|
|
148
151
|
peopleHere_one: "{n} 人正在查看",
|
|
149
152
|
markupTextAdd: "添加备注",
|
|
150
153
|
includeDiagnostics: "附上技术细节,帮助开发者排查",
|
|
154
|
+
diagnosticsSee: "查看包含的内容",
|
|
155
|
+
diagnosticsEmpty: "此页面还没有记录任何内容。",
|
|
151
156
|
filters: "筛选",
|
|
152
157
|
assignedToMe: "指派给我",
|
|
153
158
|
assigneeFilter: "指派给",
|
|
@@ -164,10 +169,10 @@ var e = {
|
|
|
164
169
|
guestExplain: "我们会通过邮件发送一个 6 位验证码。输入验证码后,你的评论会立即发布。",
|
|
165
170
|
guestName: "你的姓名",
|
|
166
171
|
guestEmail: "你的邮箱",
|
|
167
|
-
shareExpired: "
|
|
172
|
+
shareExpired: "此审阅链接已过期。请向团队索取新链接。",
|
|
168
173
|
verifyTitle: "请查看邮箱",
|
|
169
174
|
verifyBody: "输入 6 位验证码即可发布你的评论。验证码已发送至 {email}。",
|
|
170
|
-
verifyLookFor: "请查找来自 CommentKit
|
|
175
|
+
verifyLookFor: "请查找来自 CommentKit 的邮件:“你在 {website} 的验证码”。如果没有收到,请检查垃圾邮件。",
|
|
171
176
|
signInLinkTitle: "欢迎回到 {project}",
|
|
172
177
|
signInLinkBody: "继续即可查看反馈并回复。我们会通过邮件发送一个 6 位验证码,确认是你本人。",
|
|
173
178
|
notNow: "以后再说",
|
|
@@ -176,6 +181,16 @@ var e = {
|
|
|
176
181
|
verifyResend: "重新发送验证码",
|
|
177
182
|
verifyResent: "新的验证码已发送,可能需要一分钟才能收到。",
|
|
178
183
|
verifyWait: "请等待一分钟后再索取新的验证码。",
|
|
184
|
+
guestCodesPaused: "该网站今天发送的验证码过多。请明天再试,或向团队寻求帮助。",
|
|
185
|
+
notLive: "请选择套餐,才能在正式上线的网站上使用评论。",
|
|
186
|
+
fileImagesOnly: "此网站只接受图片。",
|
|
187
|
+
tooBig: "内容太大,无法发送。请缩短评论,或换一个更小的文件。",
|
|
188
|
+
finishTitle: "发送你的评论?",
|
|
189
|
+
finishBody: "你打开了验证码邮件中的链接。点击按钮,即可发布你在这个网站上写的评论。",
|
|
190
|
+
finishSend: "发送我的评论",
|
|
191
|
+
finishExpired: "这个链接已失效。验证码邮件中的链接只能使用一次,有效期 10 分钟。如果你的评论仍在等待,请在你写评论的页面输入验证码。",
|
|
192
|
+
closeCardHint: "按 × 关闭,或在外部双击。",
|
|
193
|
+
closeCardHintTouch: "点按 × 关闭,或在外部连点两下。",
|
|
179
194
|
verifyWrong: "验证码不正确。请检查邮件,或重新发送验证码。",
|
|
180
195
|
verifyDifferent: "使用其他邮箱",
|
|
181
196
|
verifyExpired: "此验证码已无法使用。你的评论仍保存在这台设备上。",
|
|
@@ -197,11 +212,12 @@ var e = {
|
|
|
197
212
|
resolvedToast: "{ref} 已解决。",
|
|
198
213
|
undoTooLate: "已无法撤销。如仍需处理,请重新打开 {ref}。",
|
|
199
214
|
guestIntro: "留下你的姓名和邮箱,方便团队回复你。无需注册账号。",
|
|
200
|
-
guestPrivacy: "
|
|
215
|
+
guestPrivacy: "你的姓名、邮箱、评论、截图和基本的浏览器信息会发送给运营本网站的团队,以及为该团队提供此评论工具的 CommentKit。",
|
|
201
216
|
guestPrivacyLink: "隐私声明",
|
|
217
|
+
guestPrivacySite: "{website} 的隐私声明",
|
|
202
218
|
guestNameMissing: "请填写姓名,让团队知道是谁写的。",
|
|
203
219
|
guestEmailInvalid: "请检查邮箱地址,例如 name@company.com。",
|
|
204
|
-
verifyLinkExpired: "
|
|
220
|
+
verifyLinkExpired: "此审阅链接已过期。请向发送链接的人索取新链接。你的评论已保存在这台设备上。",
|
|
205
221
|
verifyRemoved: "团队已移除你对此网站的访问权限。请让他们重新添加你。",
|
|
206
222
|
writeAgain: "重新填写",
|
|
207
223
|
pendingNote: "你的评论正在等待我们发送到 {email} 的验证码。",
|
|
@@ -211,12 +227,13 @@ var e = {
|
|
|
211
227
|
serverError: "CommentKit 出了点问题。请稍后重试。",
|
|
212
228
|
noAccess: "你无权查看此网站上的反馈。请让团队重新邀请你。",
|
|
213
229
|
originNotAllowed: "暂时无法从这个网址发送反馈。请让团队把它添加到项目中。",
|
|
214
|
-
forbidden: "
|
|
230
|
+
forbidden: "你没有权限执行此操作。如有需要,请联系团队。",
|
|
215
231
|
tooFast: "操作太频繁了。请稍等片刻再试。",
|
|
216
232
|
sentWithoutScreenshot: "已发送,但没有附上截图:截图未能上传。",
|
|
217
233
|
sentWithoutFiles: "已发送,但有些文件没能附加。你可以在回复中再附加。",
|
|
218
234
|
replyFailed: "你的回复还没有发送。内容仍在这里,可以再试一次。",
|
|
219
235
|
taskDetails: "任务详情",
|
|
236
|
+
taskDetailsSet: "已添加任务详情",
|
|
220
237
|
priority: "优先级",
|
|
221
238
|
priority_none: "无优先级",
|
|
222
239
|
priority_low: "低",
|
|
@@ -235,9 +252,9 @@ var e = {
|
|
|
235
252
|
formatCode: "代码",
|
|
236
253
|
reopenedToast: "{ref} 已重新打开。",
|
|
237
254
|
editedToast: "评论已更新。",
|
|
238
|
-
editConflict: "
|
|
255
|
+
editConflict: "刚刚有人编辑了此内容。现在显示的是对方的版本,请重新修改。",
|
|
239
256
|
threadDeleted: "{ref} 已删除。",
|
|
240
|
-
detailCreated: "
|
|
257
|
+
detailCreated: "发布时间",
|
|
241
258
|
detailResolved: "解决时间",
|
|
242
259
|
detailPage: "页面",
|
|
243
260
|
detailBrowser: "浏览器",
|
|
@@ -263,8 +280,9 @@ var e = {
|
|
|
263
280
|
results_one: "{n} 个结果",
|
|
264
281
|
results: "{n} 个结果",
|
|
265
282
|
resultsMore: "{n}+ 个结果",
|
|
283
|
+
firstPageThreads: "显示此页面上的前 {n} 条评论",
|
|
266
284
|
showMore: "显示更多",
|
|
267
|
-
livePaused: "
|
|
285
|
+
livePaused: "连接已断开。重新连接后会显示新的反馈。",
|
|
268
286
|
clearSearch: "清除搜索",
|
|
269
287
|
filtersOn_one: "已启用 {n} 个筛选条件",
|
|
270
288
|
filtersOn: "已启用 {n} 个筛选条件",
|
|
@@ -297,6 +315,7 @@ var e = {
|
|
|
297
315
|
nextImage: "下一张图片",
|
|
298
316
|
attachments: "附件",
|
|
299
317
|
openImage: "打开 {name}",
|
|
318
|
+
openImageMore: "打开 {name} 及另外 {n} 张",
|
|
300
319
|
uploading: "正在上传 {name}",
|
|
301
320
|
retryUpload: "重新上传 {name}",
|
|
302
321
|
uploadFailedShort: "这个文件没有上传成功。",
|
|
@@ -316,7 +335,7 @@ var e = {
|
|
|
316
335
|
checklist: "清单",
|
|
317
336
|
description: "描述",
|
|
318
337
|
checklistProgress: "已完成 {n}/{total}",
|
|
319
|
-
checklistAdd: "
|
|
338
|
+
checklistAdd: "添加一项",
|
|
320
339
|
removeItem: "移除 {item}",
|
|
321
340
|
addChecklist: "添加清单",
|
|
322
341
|
checklistShort_one: "已完成 {done}/{n}",
|
|
@@ -337,8 +356,8 @@ var e = {
|
|
|
337
356
|
previousThread: "上一条",
|
|
338
357
|
nextThread: "下一条",
|
|
339
358
|
showOnPage: "在页面上显示",
|
|
340
|
-
doubleClickHint: "
|
|
341
|
-
spot_element: "
|
|
359
|
+
doubleClickHint: "按 Esc 或双击页面即可关闭收件箱。",
|
|
360
|
+
spot_element: "在页面某处",
|
|
342
361
|
spot_region: "在某个区域上",
|
|
343
362
|
spot_text: "在选中的文字上",
|
|
344
363
|
spot_page: "在整个页面上",
|
|
@@ -361,6 +380,31 @@ var e = {
|
|
|
361
380
|
styleDone: "完成",
|
|
362
381
|
stylePrevious: "{property} 的上一个值",
|
|
363
382
|
styleNext: "{property} 的下一个值",
|
|
364
|
-
styleEdit: "编辑建议的样式更改"
|
|
383
|
+
styleEdit: "编辑建议的样式更改",
|
|
384
|
+
shortcutsSetting: "单键快捷键",
|
|
385
|
+
shortcutsSettingHint: "使用 C、J、K、E 和 ? 键可评论、在评论之间切换并解决评论。如果它们干扰屏幕阅读器或其他工具,请关闭此项。",
|
|
386
|
+
movePin: "移动标记",
|
|
387
|
+
movePinHint: "点击此评论的新位置,或按 Tab 移到该处后按 Enter · 按 Esc 取消",
|
|
388
|
+
movePinHintTouch: "轻点此评论的新位置",
|
|
389
|
+
unread: "未读",
|
|
390
|
+
otherKind: "{actor} 更新了此内容",
|
|
391
|
+
unitKB: "{n} KB",
|
|
392
|
+
unitMB: "{n} MB",
|
|
393
|
+
unitGB: "{n} GB",
|
|
394
|
+
signOff: "页面审批",
|
|
395
|
+
signOffAsk: "对这个页面满意吗?",
|
|
396
|
+
signOffApprove: "批准此页面",
|
|
397
|
+
signOffAgain: "再次批准",
|
|
398
|
+
signOffNote: "添加备注(可选)",
|
|
399
|
+
signOffDone: "已批准。团队已收到通知。",
|
|
400
|
+
signOffMine: "你已于 {date} 批准此页面。",
|
|
401
|
+
signOffBy: "{name} 已批准",
|
|
402
|
+
signOffByMore: "{name} 和另外 {n} 人已批准",
|
|
403
|
+
signOffByMore_one: "{name} 和另外 {n} 人已批准",
|
|
404
|
+
signOffNewFeedback: "批准之后又收到了新的反馈。",
|
|
405
|
+
signOffNewCommit: "批准之后此页面已有改动。",
|
|
406
|
+
signOffOpen: "此页面还有 {n} 条评论未解决。你仍然可以批准。",
|
|
407
|
+
signOffOpen_one: "此页面还有 {n} 条评论未解决。你仍然可以批准。",
|
|
408
|
+
signOffWithdraw: "撤回批准"
|
|
365
409
|
};
|
|
366
410
|
export { e as default };
|
package/dist/npm/element.js
CHANGED
|
@@ -1,33 +1,70 @@
|
|
|
1
|
-
import { t as e } from "./chunks/src-
|
|
1
|
+
import { t as e } from "./chunks/src-C8rZFyL_.js";
|
|
2
2
|
// src/element.ts
|
|
3
|
-
var t, n =
|
|
3
|
+
var t, n = [
|
|
4
|
+
"screenshots",
|
|
5
|
+
"markup",
|
|
6
|
+
"text",
|
|
7
|
+
"attachments",
|
|
8
|
+
"style",
|
|
9
|
+
"checklist"
|
|
10
|
+
], r = [
|
|
11
|
+
"project",
|
|
12
|
+
"branch",
|
|
13
|
+
"commit",
|
|
14
|
+
"endpoint",
|
|
15
|
+
"locale",
|
|
16
|
+
"theme",
|
|
17
|
+
"position",
|
|
18
|
+
"auth",
|
|
19
|
+
"deployment-url",
|
|
20
|
+
"hide-on-production",
|
|
21
|
+
"shortcuts",
|
|
22
|
+
"toggle-shortcut",
|
|
23
|
+
"privacy",
|
|
24
|
+
"redact",
|
|
25
|
+
"tools-off"
|
|
26
|
+
], i = typeof HTMLElement > "u" ? class {} : HTMLElement, a = class extends i {
|
|
4
27
|
constructor(...e) {
|
|
5
|
-
super(...e), this.kit = null;
|
|
28
|
+
super(...e), this.kit = null, this.started = "";
|
|
6
29
|
}
|
|
7
30
|
attributeChangedCallback(e, t, n) {
|
|
8
|
-
t !== n && this.isConnected &&
|
|
31
|
+
t !== n && this.isConnected && this.connectedCallback();
|
|
9
32
|
}
|
|
10
33
|
connectedCallback() {
|
|
11
34
|
try {
|
|
12
|
-
let t = this.getAttribute("project");
|
|
13
|
-
if (!
|
|
14
|
-
this.kit = e(
|
|
15
|
-
project: t,
|
|
16
|
-
branch: this.getAttribute("branch"),
|
|
17
|
-
commit: this.getAttribute("commit"),
|
|
18
|
-
endpoint: this.getAttribute("endpoint") ?? void 0,
|
|
19
|
-
locale: this.getAttribute("locale") ?? void 0,
|
|
20
|
-
theme: this.getAttribute("theme") ?? void 0,
|
|
21
|
-
position: this.getAttribute("position") ?? void 0,
|
|
22
|
-
auth: this.getAttribute("auth") ?? void 0,
|
|
23
|
-
deploymentUrl: this.getAttribute("deployment-url"),
|
|
24
|
-
hideOnProduction: this.getAttribute("hide-on-production") !== "false",
|
|
25
|
-
shortcuts: this.getAttribute("shortcuts") !== "false"
|
|
26
|
-
});
|
|
35
|
+
let t = this.getAttribute("project"), n = t ? this.options(t) : null, r = JSON.stringify(n);
|
|
36
|
+
if (this.kit && r === this.started || (this.disconnectedCallback(), !n)) return;
|
|
37
|
+
this.started = r, this.kit = e(n);
|
|
27
38
|
} catch (e) {
|
|
28
39
|
console.warn("[CommentKit] The widget could not start.", e);
|
|
29
40
|
}
|
|
30
41
|
}
|
|
42
|
+
options(e) {
|
|
43
|
+
let t = this.getAttribute("redact")?.trim(), r = (this.getAttribute("tools-off") ?? "").split(/\s+/).filter((e) => n.includes(e));
|
|
44
|
+
return {
|
|
45
|
+
project: e,
|
|
46
|
+
branch: this.getAttribute("branch"),
|
|
47
|
+
commit: this.getAttribute("commit"),
|
|
48
|
+
endpoint: this.getAttribute("endpoint") ?? void 0,
|
|
49
|
+
locale: this.getAttribute("locale") ?? void 0,
|
|
50
|
+
theme: this.getAttribute("theme") ?? void 0,
|
|
51
|
+
position: this.getAttribute("position") ?? void 0,
|
|
52
|
+
auth: this.getAttribute("auth") ?? void 0,
|
|
53
|
+
deploymentUrl: this.getAttribute("deployment-url"),
|
|
54
|
+
hideOnProduction: this.getAttribute("hide-on-production") !== "false",
|
|
55
|
+
shortcuts: this.getAttribute("shortcuts") !== "false",
|
|
56
|
+
toggleShortcut: this.getAttribute("toggle-shortcut") !== "false",
|
|
57
|
+
privacy: this.getAttribute("privacy") === "strict" ? "strict" : void 0,
|
|
58
|
+
redact: t ? [t] : void 0,
|
|
59
|
+
tools: r.length ? Object.fromEntries(r.map((e) => [e, !1])) : void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
identify(e) {
|
|
63
|
+
return this.kit?.identify(e) ?? Promise.resolve(!1);
|
|
64
|
+
}
|
|
65
|
+
signOut() {
|
|
66
|
+
return this.kit?.signOut() ?? Promise.resolve();
|
|
67
|
+
}
|
|
31
68
|
disconnectedCallback() {
|
|
32
69
|
try {
|
|
33
70
|
this.kit?.destroy();
|
|
@@ -35,5 +72,5 @@ var t, n = class extends HTMLElement {
|
|
|
35
72
|
this.kit = null;
|
|
36
73
|
}
|
|
37
74
|
};
|
|
38
|
-
t =
|
|
39
|
-
export {
|
|
75
|
+
t = a, t.observedAttributes = r, typeof customElements < "u" && !customElements.get("comment-kit") && customElements.define("comment-kit", a);
|
|
76
|
+
export { a as CommentKitElement };
|
package/dist/npm/headless.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { h as e, i as t, l as n, m as r, o as i, r as a, t as o, v as s } from "./chunks/client-7eVxvg5j.js";
|
|
2
|
+
import { i as c } from "./chunks/privacy-BWUGlHw5.js";
|
|
3
|
+
import { c as l, s as u, t as d } from "./chunks/anchor-BsQNVkHj.js";
|
|
4
|
+
import { n as f } from "./chunks/context-BuMl7A07.js";
|
|
5
|
+
import { n as p, t as m } from "./chunks/page-key-HSY3Lze5.js";
|
|
6
|
+
f(), n(p);
|
|
7
|
+
export { e as ApiClient, r as AuthManager, o as CommentKitClient, s as CommentKitError, a as EDIT_CONFLICT, t as SDK_VERSION, c as configurePrivacy, d as createAnchor, i as currentPageUrl, m as pageKey, u as resolveAnchor, l as stableSelector };
|
package/dist/npm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./chunks/src-
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { t as e } from "./chunks/src-C8rZFyL_.js";
|
|
2
|
+
import { i as t, v as n } from "./chunks/client-7eVxvg5j.js";
|
|
3
|
+
export { n as CommentKitError, t as SDK_VERSION, e as init };
|
package/dist/npm/react.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./chunks/src-
|
|
3
|
-
import { useEffect as t } from "react";
|
|
2
|
+
import { t as e } from "./chunks/src-C8rZFyL_.js";
|
|
3
|
+
import { useEffect as t, useRef as n } from "react";
|
|
4
4
|
// src/adapters/react.tsx
|
|
5
|
-
function
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = n(null), a = n(r.identity);
|
|
6
7
|
return t(() => {
|
|
7
8
|
try {
|
|
8
|
-
|
|
9
|
+
a.current = r.identity;
|
|
10
|
+
let t = i.current = e(r);
|
|
9
11
|
return () => {
|
|
10
12
|
try {
|
|
11
|
-
t.destroy();
|
|
13
|
+
i.current === t && (i.current = null), t.destroy();
|
|
12
14
|
} catch {}
|
|
13
15
|
};
|
|
14
16
|
} catch (e) {
|
|
@@ -16,10 +18,15 @@ function n(n) {
|
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
20
|
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
r.project,
|
|
22
|
+
r.branch,
|
|
23
|
+
r.commit,
|
|
24
|
+
r.endpoint,
|
|
25
|
+
r.privacy,
|
|
26
|
+
r.toggleShortcut
|
|
27
|
+
]), t(() => {
|
|
28
|
+
let e = r.identity;
|
|
29
|
+
e !== a.current && (a.current = e, typeof e == "string" && e && i.current?.identify(e));
|
|
30
|
+
}, [r.identity]), null;
|
|
24
31
|
}
|
|
25
|
-
export {
|
|
32
|
+
export { r as CommentKit, r as default, e as init };
|
package/dist/npm/svelte.js
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import { t as e } from "./chunks/src-
|
|
1
|
+
import { t as e } from "./chunks/src-C8rZFyL_.js";
|
|
2
2
|
// src/adapters/svelte.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
var t = (e) => JSON.stringify([
|
|
4
|
+
e?.project,
|
|
5
|
+
e?.branch,
|
|
6
|
+
e?.commit,
|
|
7
|
+
e?.endpoint,
|
|
8
|
+
e?.privacy,
|
|
9
|
+
e?.toggleShortcut
|
|
10
|
+
]);
|
|
11
|
+
function n(n, r) {
|
|
12
|
+
let i = null, a = t(r), o = r?.identity, s = (t) => {
|
|
11
13
|
try {
|
|
12
|
-
|
|
14
|
+
i = e(t);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.warn("[CommentKit] The widget could not start.", e);
|
|
17
|
+
}
|
|
18
|
+
}, c = () => {
|
|
19
|
+
try {
|
|
20
|
+
i?.destroy();
|
|
13
21
|
} catch {}
|
|
14
|
-
|
|
22
|
+
i = null;
|
|
23
|
+
};
|
|
24
|
+
return s(r), {
|
|
25
|
+
update: (e) => {
|
|
26
|
+
let n = t(e), r = e?.identity, l = r !== o;
|
|
27
|
+
o = r, n === a ? l && typeof r == "string" && r && i?.identify(r) : (a = n, c(), s(e));
|
|
28
|
+
},
|
|
29
|
+
destroy: c
|
|
30
|
+
};
|
|
15
31
|
}
|
|
16
|
-
export {
|
|
32
|
+
export { n as commentkit, e as init };
|
|
@@ -4,7 +4,10 @@ import { init, type CommentKitOptions } from "../index.js";
|
|
|
4
4
|
* <CommentKit project="pk_live_…" branch={process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF} />
|
|
5
5
|
* Renders nothing itself; the widget lives in its own Shadow DOM.
|
|
6
6
|
* Never throws into your app: a failure is one console warning.
|
|
7
|
-
*
|
|
7
|
+
* Every init() option is a prop (privacy="strict", toggleShortcut={false}, redact, tools…), read when it
|
|
8
|
+
* mounts; changing project, branch, commit, endpoint, privacy or toggleShortcut restarts it.
|
|
9
|
+
* `identity` signs your site's user in (a token from your server, or a function fetching one); a new token
|
|
10
|
+
* string later (another user logged in) signs that user in without a restart.
|
|
8
11
|
*/
|
|
9
12
|
export declare function CommentKit(props: CommentKitOptions): null;
|
|
10
13
|
export default CommentKit;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { init, type CommentKitOptions } from "../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Svelte / SvelteKit: <svelte:body use:commentkit={{ project: "pk_live_…" }} />
|
|
4
|
-
* or call init() inside onMount
|
|
4
|
+
* or call init() inside onMount; every init() option works (privacy, toggleShortcut, redact, identity…). Never
|
|
5
|
+
* throws into your app. Changing project, branch, commit, endpoint, privacy or toggleShortcut restarts it; a new
|
|
6
|
+
* `identity` token string signs that user in without a restart.
|
|
5
7
|
*/
|
|
6
8
|
export declare function commentkit(_node: HTMLElement, options: CommentKitOptions): {
|
|
9
|
+
update: (next: CommentKitOptions) => void;
|
|
7
10
|
destroy: () => void;
|
|
8
11
|
};
|
|
9
12
|
export { init };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type App, type PropType } from "vue";
|
|
2
2
|
import { init, type CommentKitOptions } from "../index.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* <CommentKit project="pk_live_…" /> — or app.use(CommentKitPlugin, { project }).
|
|
5
|
+
* `:identity` signs your site's user in (a token from your server, or a function fetching one); a new
|
|
6
|
+
* token string later signs that user in without a restart.
|
|
7
|
+
*/
|
|
4
8
|
export declare const CommentKit: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
9
|
project: {
|
|
6
10
|
type: StringConstructor;
|
|
@@ -38,6 +42,10 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
38
42
|
type: PropType<string[]>;
|
|
39
43
|
default: undefined;
|
|
40
44
|
};
|
|
45
|
+
privacy: {
|
|
46
|
+
type: PropType<CommentKitOptions["privacy"]>;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
41
49
|
locale: {
|
|
42
50
|
type: StringConstructor;
|
|
43
51
|
default: undefined;
|
|
@@ -50,10 +58,18 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
50
58
|
type: BooleanConstructor;
|
|
51
59
|
default: undefined;
|
|
52
60
|
};
|
|
61
|
+
toggleShortcut: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: undefined;
|
|
64
|
+
};
|
|
53
65
|
tools: {
|
|
54
66
|
type: PropType<CommentKitOptions["tools"]>;
|
|
55
67
|
default: undefined;
|
|
56
68
|
};
|
|
69
|
+
identity: {
|
|
70
|
+
type: PropType<CommentKitOptions["identity"]>;
|
|
71
|
+
default: undefined;
|
|
72
|
+
};
|
|
57
73
|
}>, () => null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
74
|
project: {
|
|
59
75
|
type: StringConstructor;
|
|
@@ -91,6 +107,10 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
91
107
|
type: PropType<string[]>;
|
|
92
108
|
default: undefined;
|
|
93
109
|
};
|
|
110
|
+
privacy: {
|
|
111
|
+
type: PropType<CommentKitOptions["privacy"]>;
|
|
112
|
+
default: undefined;
|
|
113
|
+
};
|
|
94
114
|
locale: {
|
|
95
115
|
type: StringConstructor;
|
|
96
116
|
default: undefined;
|
|
@@ -103,10 +123,18 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
103
123
|
type: BooleanConstructor;
|
|
104
124
|
default: undefined;
|
|
105
125
|
};
|
|
126
|
+
toggleShortcut: {
|
|
127
|
+
type: BooleanConstructor;
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
106
130
|
tools: {
|
|
107
131
|
type: PropType<CommentKitOptions["tools"]>;
|
|
108
132
|
default: undefined;
|
|
109
133
|
};
|
|
134
|
+
identity: {
|
|
135
|
+
type: PropType<CommentKitOptions["identity"]>;
|
|
136
|
+
default: undefined;
|
|
137
|
+
};
|
|
110
138
|
}>> & Readonly<{}>, {
|
|
111
139
|
branch: string | null;
|
|
112
140
|
commit: string | null;
|
|
@@ -116,17 +144,22 @@ export declare const CommentKit: import("vue").DefineComponent<import("vue").Ext
|
|
|
116
144
|
theme: "auto" | "dark" | "light" | undefined;
|
|
117
145
|
position: import("../index.js").Position | undefined;
|
|
118
146
|
redact: string[];
|
|
147
|
+
privacy: "standard" | "strict" | undefined;
|
|
119
148
|
locale: string;
|
|
120
149
|
auth: "auto" | "popup" | "redirect" | undefined;
|
|
121
150
|
shortcuts: boolean;
|
|
151
|
+
toggleShortcut: boolean;
|
|
122
152
|
tools: {
|
|
123
153
|
screenshots?: boolean;
|
|
124
154
|
markup?: boolean;
|
|
125
155
|
text?: boolean;
|
|
126
156
|
attachments?: boolean;
|
|
157
|
+
style?: boolean;
|
|
158
|
+
checklist?: boolean;
|
|
127
159
|
} | undefined;
|
|
160
|
+
identity: import("../index.js").IdentitySource | undefined;
|
|
128
161
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
129
162
|
export declare const CommentKitPlugin: {
|
|
130
|
-
install(
|
|
163
|
+
install(app: App, options: CommentKitOptions): void;
|
|
131
164
|
};
|
|
132
165
|
export { init };
|
|
@@ -52,7 +52,26 @@ export interface AnchorInput {
|
|
|
52
52
|
export declare function rectOf(node: Node, r?: DOMRect): DOMRect;
|
|
53
53
|
export declare function createAnchor(input: AnchorInput): Anchor;
|
|
54
54
|
export declare function stableSelector(el: Element): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Set by ./context (a lazy chunk that comes with comment mode and pins): fingerprints that leave out redacted
|
|
57
|
+
* text and form values and add the neighbours' context after SEP. Until it arrives, the plain fingerprint.
|
|
58
|
+
*/
|
|
59
|
+
export declare const ext: {
|
|
60
|
+
fp?: (el: Element) => string | null;
|
|
61
|
+
quote?: (el: Element, quote: string | null) => string | null;
|
|
62
|
+
/** A search starts (true) or ends: what is redacted on the page can be worked out once for it. */
|
|
63
|
+
pass?: (on: boolean) => void;
|
|
64
|
+
};
|
|
65
|
+
/** Between a fingerprint and its (optional, newer) neighbour context. Older fingerprints have none. */
|
|
66
|
+
export declare const SEP = "\u241E";
|
|
55
67
|
export declare function fingerprint(el: Element): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* The element's first MAX_TEXT characters of text, normalized: what its textContent gives, but read only
|
|
70
|
+
* that far (a page wrapper's textContent is the whole page, and resolving compares thousands of elements).
|
|
71
|
+
* Elements `skip` says yes to are left out, with everything in them.
|
|
72
|
+
*/
|
|
73
|
+
export declare function textOf(el: Element, skip?: (el: Element) => boolean): string;
|
|
74
|
+
export declare function normalize(text: string): string;
|
|
56
75
|
export interface Found {
|
|
57
76
|
element: Element;
|
|
58
77
|
state: AnchorState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PRIVATE_CAPTURE_SELECTOR: string;
|
|
2
|
+
/** Form controls: what someone typed or chose. Never in anchors; in strict mode never in screenshots either. */
|
|
3
|
+
export declare const FORM_CONTROLS = "input,textarea,select";
|
|
4
|
+
/** Strict mode: every form control and every editable region. */
|
|
5
|
+
export declare const STRICT = "input,textarea,select,[contenteditable]:not([contenteditable=\"false\" i])";
|
|
6
|
+
/** Called with `[...config.privacy.redact_selectors, ...options.redact]` and the stricter of `config.privacy.mode` and `options.privacy` (ui/privacy.ts). Invalid selectors are left out. */
|
|
7
|
+
export declare function configurePrivacy(redact?: string[], privacy?: "standard" | "strict"): void;
|
|
8
|
+
/** Strict mode: set by the dashboard or init({ privacy: "strict" }) (via configurePrivacy), or passed for one capture. */
|
|
9
|
+
export declare const isStrict: (privacy?: "standard" | "strict") => boolean;
|
|
10
|
+
/** Everything private: the built-in policy, strict mode's form controls and editable regions, and `extra` selectors. */
|
|
11
|
+
export declare function privateSelector(extra?: string[], strict?: boolean): string;
|
|
12
|
+
/** Is the element (or anything around it, out through shadow roots) private? Fails closed. */
|
|
13
|
+
export declare function isCaptureRedacted(element: Element, selector?: string): boolean;
|
|
14
|
+
export declare function isValidSelector(selector: string): boolean;
|