@commentkit/comment-kit 1.0.0-beta.2 → 1.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +2 -4
  3. package/dist/npm/chunks/{Guest-CKoV6pEK.js → Guest-CdfnuD8T.js} +46 -46
  4. package/dist/npm/chunks/{MarkupEditor-DAo4qppg.js → MarkupEditor-Clb17Tse.js} +2 -2
  5. package/dist/npm/chunks/Panel-CgvEbZXr.js +438 -0
  6. package/dist/npm/chunks/{Shortcuts-CHMcrjAM.js → Shortcuts-3AOERWBh.js} +2 -2
  7. package/dist/npm/chunks/ThreadCard-DuGKe-gE.js +817 -0
  8. package/dist/npm/chunks/{ar-D3SPpN1T.js → ar-BVQ4ToG2.js} +66 -39
  9. package/dist/npm/chunks/art-Bn9_ANNS.js +155 -0
  10. package/dist/npm/chunks/{client-D1NizpDK.js → client-CS5oL_LQ.js} +14 -21
  11. package/dist/npm/chunks/{de-C8eC6c6f.js → de-CamSq76K.js} +53 -29
  12. package/dist/npm/chunks/{es-Bczf42tm.js → es-BBIlcnsU.js} +52 -28
  13. package/dist/npm/chunks/{extension--it1LAj-.js → extension-CLm_T7Vj.js} +1 -1
  14. package/dist/npm/chunks/{extension-XfuRGu2o.js → extension-DWHHer7j.js} +1 -1
  15. package/dist/npm/chunks/{format-Bw_tNOh9.js → format-CP2xZaec.js} +2 -2
  16. package/dist/npm/chunks/{fr-BaQw-v2e.js → fr-BXsff0Zz.js} +64 -40
  17. package/dist/npm/chunks/{hi-BamV-yXv.js → hi-y-APBuxh.js} +60 -36
  18. package/dist/npm/chunks/{it-DC14_EjN.js → it-C5MH_Ktv.js} +53 -29
  19. package/dist/npm/chunks/{ja-B1mmTN7Y.js → ja-s1JJld2J.js} +57 -33
  20. package/dist/npm/chunks/live-CkVrNM1-.js +34 -0
  21. package/dist/npm/chunks/mount-VmnAiANB.js +1507 -0
  22. package/dist/npm/chunks/{nl-BfhqUsmX.js → nl-CFzRMEfl.js} +62 -38
  23. package/dist/npm/chunks/{pt-BR-CEPu4W5U.js → pt-BR-DE_r-5UM.js} +53 -29
  24. package/dist/npm/chunks/{report-Dh4fxd4J.js → report-DoDVi1qT.js} +5 -4
  25. package/dist/npm/chunks/{src-DujplxfI.js → src-DG8ehgE9.js} +96 -64
  26. package/dist/npm/chunks/{zh-CN-kgqjYwHQ.js → zh-CN--gibO2l7.js} +53 -29
  27. package/dist/npm/element.js +2 -2
  28. package/dist/npm/headless.js +1 -1
  29. package/dist/npm/index.js +2 -2
  30. package/dist/npm/react.js +1 -1
  31. package/dist/npm/svelte.js +1 -1
  32. package/dist/npm/types/anchor/index.d.ts +0 -1
  33. package/dist/npm/types/core/auth.d.ts +0 -2
  34. package/dist/npm/types/core/client.d.ts +7 -6
  35. package/dist/npm/types/core/types.d.ts +19 -0
  36. package/dist/npm/vue.js +1 -1
  37. package/package.json +2 -3
  38. package/dist/npm/chunks/Panel-BRBDHlGg.js +0 -399
  39. package/dist/npm/chunks/ThreadCard-D8FzIxbs.js +0 -570
  40. package/dist/npm/chunks/mount-5fFig0k6.js +0 -1447
@@ -1,4 +1,4 @@
1
- import { c as e, t } from "./client-D1NizpDK.js";
1
+ import { c as e, t } from "./client-CS5oL_LQ.js";
2
2
  //#region src/activation.ts
3
3
  var n = "commentkit:active", r = "data-commentkit-extension";
4
4
  function i() {
@@ -10,11 +10,11 @@ function a(e = location.origin) {
10
10
  }
11
11
  function o(e, t = !0) {
12
12
  if (!t || a() || i()) return !0;
13
- let n = new URLSearchParams(location.search);
14
- if (n.has("ck") || n.has("ck_thread") || n.has("ck_code")) return !0;
13
+ let r = new URLSearchParams(location.search);
14
+ if (r.has("ck") || r.has("ck_thread") || r.has("ck_code")) return !0;
15
15
  try {
16
16
  let t = `commentkit:v1:${e}`;
17
- return !!localStorage.getItem(t) || !!sessionStorage.getItem(t) || localStorage.getItem("commentkit:active") === "1";
17
+ return !!localStorage.getItem(t) || !!sessionStorage.getItem(t) || localStorage.getItem(n) === "1";
18
18
  } catch {
19
19
  return !1;
20
20
  }
@@ -165,7 +165,7 @@ var S = {
165
165
  tool_arrow: "Arrow",
166
166
  tool_rect: "Box",
167
167
  tool_pen: "Pen",
168
- tool_blur: "Hide",
168
+ tool_blur: "Blur",
169
169
  tool_text: "Text",
170
170
  markupTextPrompt: "What should the note say?",
171
171
  undo: "Undo",
@@ -190,6 +190,9 @@ var S = {
190
190
  notifications: "Notifications",
191
191
  nothingHere: "No feedback on this page yet.",
192
192
  nothingHereHint: "Click Comment, then click anything on the page.",
193
+ nothingAnywhere: "No feedback on this site yet.",
194
+ noMatch: "No feedback matches your search or filters.",
195
+ clearFilters: "Clear filters",
193
196
  allCaughtUp: "You're all caught up.",
194
197
  search: "Search feedback",
195
198
  detached: "We can't find this spot on the page anymore. It may have changed since the comment was left.",
@@ -226,17 +229,17 @@ var S = {
226
229
  edited: "edited",
227
230
  save: "Save",
228
231
  saving: "Saving…",
229
- mute: "Stop notifications",
230
- unmute: "Notify me",
232
+ mute: "Turn off notifications",
233
+ unmute: "Turn on notifications",
231
234
  muted: "You won't get emails about {ref} anymore.",
232
235
  followed: "We'll email you about {ref} again.",
233
236
  unassigned: "Unassigned",
234
- readOnly: "Feedback is read-only right now because the workspace plan has ended. You can still read everything.",
237
+ readOnly: "Feedback is read-only right now because your team's subscription has ended. You can still read everything.",
235
238
  readOnlyGuest: "New feedback is paused on this site right now. You can still read everything.",
236
- paused: "Feedback is paused on this site right now. Please check back later.",
239
+ paused: "Feedback is paused on this site right now. Check back later.",
237
240
  offline: "You're offline. We'll keep your draft until you're back.",
238
241
  offlineSend: "You're offline. Your comment is saved here; send it when you're back online.",
239
- errorGeneric: "Something went wrong. Please try again.",
242
+ errorGeneric: "That didn't work. Check your connection and try again.",
240
243
  loadFailed: "We couldn't load the feedback. Check your connection and try again.",
241
244
  sendFailed: "Your comment wasn't sent yet. It's still here, so you can try again.",
242
245
  savedHere: "Your comment is saved on this device.",
@@ -251,22 +254,23 @@ var S = {
251
254
  markAllRead: "Mark all as read",
252
255
  messageCount: "{n} messages",
253
256
  messageCount_one: "{n} message",
254
- kind_mention: "mentioned you",
255
- kind_reply: "replied",
256
- kind_assigned: "assigned you",
257
- kind_ready_for_review: "asked you to check a fix",
258
- kind_reopened: "reopened",
259
- kind_resolved: "resolved",
260
- kind_closed: "closed",
261
- kind_new_feedback: "left feedback",
262
- kind_due_soon: "reminds you this is due soon",
263
- kind_overdue: "reminds you this is overdue",
264
- kind_agent_request: "wants your approval",
265
- branchFilter: "Which branch to show",
266
- thisBranch: "This branch ({branch})",
267
- allBranches: "All branches",
268
- onBranch: "on {branch}",
269
- leftOnBranch: "Left on {branch}{commit}",
257
+ kind_mention: "{actor} mentioned you",
258
+ kind_reply: "{actor} replied",
259
+ kind_assigned: "{actor} assigned you",
260
+ kind_ready_for_review: "{actor} asked you to check a fix",
261
+ kind_reopened: "{actor} reopened",
262
+ kind_resolved: "{actor} resolved",
263
+ kind_closed: "{actor} closed",
264
+ kind_new_feedback: "{actor} left feedback",
265
+ kind_due_soon: "{actor} reminds you this is due soon",
266
+ kind_overdue: "{actor} reminds you this is overdue",
267
+ kind_agent_request: "{actor} wants your approval",
268
+ personName: "{name}",
269
+ branchFilter: "Which version of the site to show",
270
+ thisBranch: "This version ({branch})",
271
+ allBranches: "All versions",
272
+ onBranch: "on version {branch}",
273
+ leftOnBranch: "Left on version {branch}{commit}",
270
274
  welcomeTitle: "Leave feedback on {project}",
271
275
  welcomeBody: "Click Comment, then click the spot that should change. No account needed.",
272
276
  welcomeBodyTouch: "Tap Comment, then tap the spot that should change. No account needed.",
@@ -287,20 +291,21 @@ var S = {
287
291
  peopleHere: "{n} people here",
288
292
  peopleHere_one: "{n} person here",
289
293
  markupTextAdd: "Add note",
290
- includeDiagnostics: "Include browser errors to help the developer",
294
+ includeDiagnostics: "Include technical details to help the developer",
291
295
  filters: "Filters",
292
296
  assignedToMe: "Assigned to me",
293
297
  assigneeFilter: "Assigned to",
294
298
  anyone: "Anyone",
295
299
  labelFilter: "Label",
296
300
  anyLabel: "Any label",
297
- fileNotAllowed: "{name} can't be attached. Images, PDFs, text, video and Office files work.",
301
+ fileNotAllowed: "{name} can't be attached. You can attach images, PDFs, text, video and Office files.",
298
302
  fileTooBig: "{name} is too big to attach. The limit is {size}.",
299
303
  tooManyFiles: "You can attach up to {n} files.",
304
+ tooManyFiles_one: "You can attach up to {n} file.",
300
305
  removeFile: "Remove {name}",
301
306
  threadNotFound: "This feedback was deleted, or you no longer have access to it.",
302
307
  readOnlyShort: "Read-only: you can read feedback, but not add to it right now.",
303
- guestExplain: "We'll email you a 6-digit code. Your comment is published as soon as you enter it.",
308
+ guestExplain: "We'll email you a 6-digit code. Your comment is published as soon as you enter the code.",
304
309
  guestName: "Your name",
305
310
  guestEmail: "Your email",
306
311
  guestIntro: "Your name and email, so the team can reply. No account needed.",
@@ -313,7 +318,7 @@ var S = {
313
318
  verifyPublish: "Publish comment",
314
319
  verifyResend: "Send a new code",
315
320
  verifyResent: "We sent a new code. It can take a minute to arrive.",
316
- verifyWait: "Please wait a minute before asking for another code.",
321
+ verifyWait: "Wait a minute before asking for another code.",
317
322
  verifyWrong: "That code isn't right. Check the email, or send a new code.",
318
323
  verifyDifferent: "Use a different email",
319
324
  verifyExpired: "This code can no longer be used. Your comment is still saved on this device.",
@@ -322,7 +327,26 @@ var S = {
322
327
  writeAgain: "Write it again",
323
328
  pendingNote: "Your comment is waiting for the code we emailed to {email}.",
324
329
  enterCode: "Enter code",
325
- feedbackRef: "Feedback {ref}"
330
+ feedbackRef: "Feedback {ref}",
331
+ networkError: "We couldn't reach CommentKit. Check your connection: your text is saved here, so you can try again.",
332
+ noAccess: "You don't have access to feedback on this site. Ask the team to invite you again.",
333
+ originNotAllowed: "Feedback can't be sent from this web address yet. Ask the team to add it to the project.",
334
+ forbidden: "You don't have permission to do that.",
335
+ tooFast: "That was a lot at once. Wait a moment, then try again.",
336
+ sentWithoutScreenshot: "Sent, but without the screenshot: it couldn't be uploaded.",
337
+ sentWithoutFiles: "Sent, but some files couldn't be attached. You can add them in a reply.",
338
+ replyFailed: "Your reply wasn't sent yet. It's still here, so you can try again.",
339
+ taskDetails: "Task details",
340
+ priority: "Priority",
341
+ priority_none: "No priority",
342
+ priority_low: "Low",
343
+ priority_medium: "Medium",
344
+ priority_high: "High",
345
+ priority_urgent: "Urgent",
346
+ dueDate: "Due date",
347
+ dueOn: "Due {date}",
348
+ labels: "Labels",
349
+ noLabels: "No labels"
326
350
  }, C = [
327
351
  "en",
328
352
  "es",
@@ -336,16 +360,16 @@ var S = {
336
360
  "hi",
337
361
  "ar"
338
362
  ], w = {
339
- es: () => import("./es-Bczf42tm.js"),
340
- fr: () => import("./fr-BaQw-v2e.js"),
341
- de: () => import("./de-C8eC6c6f.js"),
342
- "pt-BR": () => import("./pt-BR-CEPu4W5U.js"),
343
- it: () => import("./it-DC14_EjN.js"),
344
- nl: () => import("./nl-BfhqUsmX.js"),
345
- ja: () => import("./ja-B1mmTN7Y.js"),
346
- "zh-CN": () => import("./zh-CN-kgqjYwHQ.js"),
347
- hi: () => import("./hi-BamV-yXv.js"),
348
- ar: () => import("./ar-D3SPpN1T.js")
363
+ es: () => import("./es-BBIlcnsU.js"),
364
+ fr: () => import("./fr-BXsff0Zz.js"),
365
+ de: () => import("./de-CamSq76K.js"),
366
+ "pt-BR": () => import("./pt-BR-DE_r-5UM.js"),
367
+ it: () => import("./it-C5MH_Ktv.js"),
368
+ nl: () => import("./nl-CFzRMEfl.js"),
369
+ ja: () => import("./ja-s1JJld2J.js"),
370
+ "zh-CN": () => import("./zh-CN--gibO2l7.js"),
371
+ hi: () => import("./hi-y-APBuxh.js"),
372
+ ar: () => import("./ar-BVQ4ToG2.js")
349
373
  }, T = /^(ar|he|iw|fa|ur|ps|yi|ckb|sd|ug|dv)(-|$)/i, E = "en", D = S, O = Promise.resolve();
350
374
  function k(e) {
351
375
  let t = (e ?? "").trim().replace(/_/g, "-").toLowerCase();
@@ -376,12 +400,20 @@ function M() {
376
400
  return E;
377
401
  }
378
402
  function N(e, t) {
379
- return e.replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? ""));
403
+ let n = T.test(E);
404
+ return e.replace(/\{(\w+)\}/g, (e, r) => {
405
+ let i = String(t[r] ?? "");
406
+ return n && i ? `\u2068${i}\u2069` : i;
407
+ });
380
408
  }
381
409
  function P(e, t = {}) {
382
410
  return N(D[e] ?? S[e], t);
383
411
  }
384
- function F(e, t, n = {}) {
412
+ function F(e, t) {
413
+ let [n = "", r = ""] = (D[e] ?? S[e]).split(`{${t}}`);
414
+ return [n, r];
415
+ }
416
+ function I(e, t, n = {}) {
385
417
  let r = "other", i = String(t);
386
418
  try {
387
419
  r = new Intl.PluralRules(E).select(t), i = new Intl.NumberFormat(E).format(t);
@@ -392,12 +424,12 @@ function F(e, t, n = {}) {
392
424
  n: i
393
425
  });
394
426
  }
395
- function I() {
427
+ function L() {
396
428
  if (T.test(E)) return "rtl";
397
429
  let e = document.documentElement.dir || document.body?.dir;
398
430
  return e === "rtl" || e === "ltr" ? e : T.test(document.documentElement.lang || "") ? "rtl" : "ltr";
399
431
  }
400
- function L(e, t = Date.now()) {
432
+ function R(e, t = Date.now()) {
401
433
  let n = new Date(e).getTime();
402
434
  if (!Number.isFinite(n)) return "";
403
435
  let r = Math.max(0, (t - n) / 1e3);
@@ -412,8 +444,8 @@ function L(e, t = Date.now()) {
412
444
  }
413
445
  //#endregion
414
446
  //#region src/index.ts
415
- var R = null;
416
- function z() {
447
+ var z = null;
448
+ function B() {
417
449
  let e = (e) => typeof e == "string" && e.trim() ? e.trim().slice(0, 255) : null;
418
450
  try {
419
451
  let t = typeof __COMMENTKIT_BUILD__ < "u" ? __COMMENTKIT_BUILD__ : globalThis.__COMMENTKIT_BUILD__;
@@ -433,22 +465,22 @@ function z() {
433
465
  };
434
466
  }
435
467
  }
436
- function B(e) {
437
- if (R) return R;
438
- if (typeof window > "u") return U();
468
+ function V(e) {
469
+ if (z) return z;
470
+ if (typeof window > "u") return W();
439
471
  try {
440
- return V(e);
472
+ return H(e);
441
473
  } catch (e) {
442
- return console.warn("[CommentKit] The widget could not start.", e), U();
474
+ return console.warn("[CommentKit] The widget could not start.", e), W();
443
475
  }
444
476
  }
445
- function V(n) {
446
- if (!n?.project || !/^pk_(live|test)_[a-z0-9]{20,40}$/.test(n.project)) return console.warn("[CommentKit] init() needs your publishable project key (pk_live_… or pk_test_…). Find it in your CommentKit project under Setup."), U();
447
- let r = z(), a = {
477
+ function H(n) {
478
+ if (!n?.project || !/^pk_(live|test)_[a-z0-9]{20,40}$/.test(n.project)) return console.warn("[CommentKit] init() needs your publishable project key (pk_live_… or pk_test_…). Find it in your CommentKit project under Setup."), W();
479
+ let r = B(), a = {
448
480
  ...n,
449
481
  branch: n.branch || r.branch,
450
482
  commit: n.commit || r.commit
451
- }, l = j(a.locale), u = new t(a), d = null, f = null, p = null, h = null, g = H(), _ = () => {
483
+ }, l = j(a.locale), u = new t(a), d = null, f = null, p = null, h = null, g = U(), _ = () => {
452
484
  let e = Date.now(), t = () => {
453
485
  document.visibilityState === "hidden" || Date.now() - e < 15e3 || (e = Date.now(), u.loadConfig().then((e) => !e.enabled && !g && y(), () => void 0));
454
486
  }, n = setInterval(t, 6e4);
@@ -459,11 +491,11 @@ function V(n) {
459
491
  try {
460
492
  let e = await u.loadConfig();
461
493
  if (!e.enabled && !g) return;
462
- await u.auth.completeRedirect().catch(() => !1), i() && await import("./extension-XfuRGu2o.js").then((e) => e.extensionHandoff(u.auth)).catch(() => !1), await u.loadSession().catch(() => null), f = m({
494
+ await u.auth.completeRedirect().catch(() => !1), i() && await import("./extension-DWHHer7j.js").then((e) => e.extensionHandoff(u.auth)).catch(() => !1), await u.loadSession().catch(() => null), f = m({
463
495
  console: e.features.console_capture,
464
496
  network: e.features.network_capture
465
497
  });
466
- let [{ mountWidget: t }] = await Promise.all([import("./mount-5fFig0k6.js").then((e) => e.t), l]);
498
+ let [{ mountWidget: t }] = await Promise.all([import("./mount-VmnAiANB.js").then((e) => e.t), l]);
467
499
  d = t(u, y), h = _(), u.emit("ready", { session: u.state.get().session });
468
500
  } catch (t) {
469
501
  let n = t instanceof e;
@@ -476,7 +508,7 @@ function V(n) {
476
508
  }, b = c(() => {
477
509
  d ? (y(), s(!1)) : (s(!0), v());
478
510
  });
479
- return o(a.project, a.hideOnProduction ?? !0) && v(), R = {
511
+ return o(a.project, a.hideOnProduction ?? !0) && v(), z = {
480
512
  client: u,
481
513
  show: v,
482
514
  hide: y,
@@ -486,11 +518,11 @@ function V(n) {
486
518
  session: () => u.state.get().session,
487
519
  on: (e, t) => u.on(e, t),
488
520
  destroy() {
489
- y(), b(), u.destroy(), R = null;
521
+ y(), b(), u.destroy(), z = null;
490
522
  }
491
- }, R;
523
+ }, z;
492
524
  }
493
- function H() {
525
+ function U() {
494
526
  let e = new URLSearchParams(location.search);
495
527
  if (e.has("ck") || e.has("ck_thread")) return !0;
496
528
  try {
@@ -499,7 +531,7 @@ function H() {
499
531
  return !1;
500
532
  }
501
533
  }
502
- function U() {
534
+ function W() {
503
535
  let e = async () => void 0;
504
536
  return {
505
537
  client: void 0,
@@ -514,4 +546,4 @@ function U() {
514
546
  };
515
547
  }
516
548
  //#endregion
517
- export { P as a, b as c, L as i, y as l, M as n, I as o, F as r, h as s, B as t, i as u };
549
+ export { R as a, h as c, i as d, I as i, b as l, F as n, P as o, M as r, L as s, V as t, y as u };
@@ -14,7 +14,7 @@ var e = {
14
14
  modeBarTouch: "轻点任意位置评论 · 照常滚动 · 先选中文字可引用",
15
15
  commentOnPage: "评论整个页面",
16
16
  commentFocused: "评论选中的部分",
17
- attach: "添加附件",
17
+ attach: "附加文件",
18
18
  screenshot: "截图",
19
19
  screenshotIncluded: "会自动附上你当前看到的画面截图。",
20
20
  screenshotRemove: "不附截图",
@@ -24,7 +24,7 @@ var e = {
24
24
  tool_arrow: "箭头",
25
25
  tool_rect: "方框",
26
26
  tool_pen: "画笔",
27
- tool_blur: "遮挡",
27
+ tool_blur: "模糊",
28
28
  tool_text: "文字",
29
29
  markupTextPrompt: "备注写什么?",
30
30
  undo: "撤销",
@@ -34,7 +34,7 @@ var e = {
34
34
  color_blue: "蓝色",
35
35
  color_black: "黑色",
36
36
  capturing: "正在截图…",
37
- uploadFailed: "文件没能添加。你仍然可以发送评论。",
37
+ uploadFailed: "文件没能附加。你仍然可以发送评论。",
38
38
  signInToSend: "最后一步:告诉我们你是谁",
39
39
  signInExplain: "我们会打开一个小窗口,请你确认邮箱。在这台设备上只需要做一次。",
40
40
  signIn: "继续",
@@ -49,6 +49,9 @@ var e = {
49
49
  notifications: "通知",
50
50
  nothingHere: "这个页面还没有反馈。",
51
51
  nothingHereHint: "点击“评论”,然后点击页面上的任意位置。",
52
+ nothingAnywhere: "这个网站还没有反馈。",
53
+ noMatch: "没有符合搜索或筛选条件的反馈。",
54
+ clearFilters: "清除筛选",
52
55
  allCaughtUp: "没有新消息了。",
53
56
  search: "搜索反馈",
54
57
  detached: "页面上已经找不到这个位置了。评论之后页面可能有改动。",
@@ -76,13 +79,13 @@ var e = {
76
79
  edit: "编辑",
77
80
  edited: "已编辑",
78
81
  save: "保存",
79
- mute: "不再通知",
80
- unmute: "通知我",
82
+ mute: "关闭通知",
83
+ unmute: "开启通知",
81
84
  unassigned: "未指派",
82
- readOnly: "工作区的套餐已到期,反馈目前只能查看。你仍然可以阅读所有内容。",
85
+ readOnly: "你的团队订阅已到期,反馈目前只能查看。你仍然可以阅读所有内容。",
83
86
  offline: "你已离线。草稿会一直保留,直到你恢复联网。",
84
87
  offlineSend: "你已离线。评论已保存在这里,恢复联网后再发送即可。",
85
- errorGeneric: "出了点问题,请重试。",
88
+ errorGeneric: "操作没有成功。请检查网络后重试。",
86
89
  loadFailed: "反馈加载失败。请检查网络后重试。",
87
90
  sendFailed: "评论还没发出去。内容还在,可以再试一次。",
88
91
  retry: "重试",
@@ -95,22 +98,23 @@ var e = {
95
98
  markAllRead: "全部标为已读",
96
99
  messageCount: "{n} 条消息",
97
100
  messageCount_one: "{n} 条消息",
98
- kind_mention: "提到了你",
99
- kind_reply: "回复了",
100
- kind_assigned: "指派给了你",
101
- kind_ready_for_review: "请你确认一个修复",
102
- kind_reopened: "重新打开了",
103
- kind_resolved: "解决了",
104
- kind_closed: "关闭了",
105
- kind_new_feedback: "提交了反馈",
106
- kind_due_soon: "提醒你:快到期了",
107
- kind_overdue: "提醒你:已经逾期",
108
- kind_agent_request: "等待你的批准",
109
- branchFilter: "显示哪个分支",
110
- thisBranch: "当前分支({branch})",
111
- allBranches: "所有分支",
112
- onBranch: "在 {branch}",
113
- leftOnBranch: "留在 {branch}{commit}",
101
+ kind_mention: "{actor} 提到了你",
102
+ kind_reply: "{actor} 回复了",
103
+ kind_assigned: "{actor} 指派给了你",
104
+ kind_ready_for_review: "{actor} 请你确认一个修复",
105
+ kind_reopened: "{actor} 重新打开了",
106
+ kind_resolved: "{actor} 解决了",
107
+ kind_closed: "{actor} 关闭了",
108
+ kind_new_feedback: "{actor} 提交了反馈",
109
+ kind_due_soon: "{actor} 提醒你:快到期了",
110
+ kind_overdue: "{actor} 提醒你:已经逾期",
111
+ kind_agent_request: "{actor} 等待你的批准",
112
+ personName: "{name}",
113
+ branchFilter: "显示网站的哪个版本",
114
+ thisBranch: "当前版本({branch})",
115
+ allBranches: "所有版本",
116
+ onBranch: "版本 {branch}",
117
+ leftOnBranch: "在版本 {branch}{commit} 上留下",
114
118
  welcomeTitle: "为 {project} 提反馈",
115
119
  welcomeBody: "点击“评论”,再点击需要修改的位置。无需注册账号。",
116
120
  gotIt: "知道了",
@@ -127,10 +131,10 @@ var e = {
127
131
  shortcutHelp: "显示此列表",
128
132
  deleteReplyConfirm: "要为所有人删除这条回复吗?",
129
133
  replyDeleted: "回复已删除",
130
- peopleHere: "{n} 人在线",
131
- peopleHere_one: "{n} 人在线",
134
+ peopleHere: "{n} 人正在查看",
135
+ peopleHere_one: "{n} 人正在查看",
132
136
  markupTextAdd: "添加备注",
133
- includeDiagnostics: "附上浏览器错误,帮助开发者排查",
137
+ includeDiagnostics: "附上技术细节,帮助开发者排查",
134
138
  filters: "筛选",
135
139
  assignedToMe: "指派给我",
136
140
  assigneeFilter: "指派给",
@@ -140,10 +144,11 @@ var e = {
140
144
  fileNotAllowed: "无法附加 {name}。可以附加图片、PDF、文本、视频和 Office 文件。",
141
145
  fileTooBig: "{name} 太大,无法附加。上限为 {size}。",
142
146
  tooManyFiles: "最多可以附加 {n} 个文件。",
147
+ tooManyFiles_one: "最多可以附加 {n} 个文件。",
143
148
  removeFile: "移除 {name}",
144
149
  threadNotFound: "这条反馈已被删除,或者你已无权查看。",
145
150
  readOnlyShort: "只读:你可以查看反馈,但目前无法添加。",
146
- guestExplain: "我们会通过邮件发送一个 6 位验证码。输入后你的评论会立即发布。",
151
+ guestExplain: "我们会通过邮件发送一个 6 位验证码。输入验证码后,你的评论会立即发布。",
147
152
  guestName: "你的姓名",
148
153
  guestEmail: "你的邮箱",
149
154
  shareExpired: "此客户链接已过期。请向团队索取新链接。",
@@ -172,7 +177,7 @@ var e = {
172
177
  savedHere: "你的评论已保存在这台设备上。",
173
178
  saving: "正在保存…",
174
179
  statusFilter: "状态",
175
- resolvedToast: "已解决 {ref}。",
180
+ resolvedToast: "{ref} 已解决。",
176
181
  guestIntro: "留下你的姓名和邮箱,方便团队回复你。无需注册账号。",
177
182
  guestNameMissing: "请填写姓名,让团队知道是谁写的。",
178
183
  guestEmailInvalid: "请检查邮箱地址,例如 name@company.com。",
@@ -181,7 +186,26 @@ var e = {
181
186
  writeAgain: "重新填写",
182
187
  pendingNote: "你的评论正在等待我们发送到 {email} 的验证码。",
183
188
  enterCode: "输入验证码",
184
- feedbackRef: "反馈 {ref}"
189
+ feedbackRef: "反馈 {ref}",
190
+ networkError: "无法连接到 CommentKit。请检查网络连接:你的文字已保存在这里,可以再试一次。",
191
+ noAccess: "你无权查看此网站上的反馈。请让团队重新邀请你。",
192
+ originNotAllowed: "暂时无法从这个网址发送反馈。请让团队把它添加到项目中。",
193
+ forbidden: "你没有权限执行此操作。",
194
+ tooFast: "操作太频繁了。请稍等片刻再试。",
195
+ sentWithoutScreenshot: "已发送,但没有附上截图:截图未能上传。",
196
+ sentWithoutFiles: "已发送,但有些文件没能附加。你可以在回复中再附加。",
197
+ replyFailed: "你的回复还没有发送。内容仍在这里,可以再试一次。",
198
+ taskDetails: "任务详情",
199
+ priority: "优先级",
200
+ priority_none: "无优先级",
201
+ priority_low: "低",
202
+ priority_medium: "中",
203
+ priority_high: "高",
204
+ priority_urgent: "紧急",
205
+ dueDate: "截止日期",
206
+ dueOn: "截止 {date}",
207
+ labels: "标签",
208
+ noLabels: "无标签"
185
209
  };
186
210
  //#endregion
187
211
  export { e as default };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./chunks/src-DujplxfI.js";
2
- import { l as t } from "./chunks/client-D1NizpDK.js";
1
+ import { t as e } from "./chunks/src-DG8ehgE9.js";
2
+ import { l as t } from "./chunks/client-CS5oL_LQ.js";
3
3
  //#region src/element.ts
4
4
  var n = class extends HTMLElement {
5
5
  constructor(...e) {
@@ -1,3 +1,3 @@
1
- import { c as e, i as t, n, r, s as i, t as a } from "./chunks/client-D1NizpDK.js";
1
+ import { c as e, i as t, n, r, s as i, t as a } from "./chunks/client-CS5oL_LQ.js";
2
2
  import { i as o, r as s, t as c } from "./chunks/anchor-DT-Ynhh1.js";
3
3
  export { i as ApiClient, t as AuthManager, a as CommentKitClient, e as CommentKitError, n as SDK_VERSION, c as createAnchor, r as currentPageUrl, s as resolveAnchor, o as stableSelector };
package/dist/npm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./chunks/src-DujplxfI.js";
2
- import { c as t, n } from "./chunks/client-D1NizpDK.js";
1
+ import { t as e } from "./chunks/src-DG8ehgE9.js";
2
+ import { c as t, n } from "./chunks/client-CS5oL_LQ.js";
3
3
  export { t as CommentKitError, n as SDK_VERSION, e as init };
package/dist/npm/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./chunks/src-DujplxfI.js";
2
+ import { t as e } from "./chunks/src-DG8ehgE9.js";
3
3
  import { useEffect as t } from "react";
4
4
  //#region src/adapters/react.tsx
5
5
  function n(n) {
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/src-DujplxfI.js";
1
+ import { t as e } from "./chunks/src-DG8ehgE9.js";
2
2
  //#region src/adapters/svelte.ts
3
3
  function t(t, n) {
4
4
  let r = null;
@@ -42,7 +42,6 @@ export interface AnchorInput {
42
42
  }
43
43
  export declare function createAnchor(input: AnchorInput): Anchor;
44
44
  export declare function stableSelector(el: Element): string | null;
45
- export declare function xpathOf(el: Element): string | null;
46
45
  export declare function fingerprint(el: Element): string | null;
47
46
  export declare function resolveAnchor(anchor: Anchor, root?: ParentNode): ResolvedAnchor;
48
47
  /** Dice coefficient on character bigrams: 1 = identical, 0 = nothing in common. */
@@ -10,8 +10,6 @@ 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
- /** In-app browsers (WhatsApp, Instagram, Slack…) open "popups" in the same view, so use a full-page redirect there. */
14
- export declare function prefersRedirect(ua?: string): boolean;
15
13
  /**
16
14
  * Widget sign-in: a popup on the CommentKit domain (credentials never touch
17
15
  * this page), PKCE, short-lived access tokens and a rotating refresh token.
@@ -1,10 +1,10 @@
1
1
  import { ApiClient } from "./api.js";
2
2
  import { AuthManager, type SignInResult } from "./auth.js";
3
+ import type { FeedbackPing } from "./types.js";
3
4
  import { type Store } from "./store.js";
4
5
  import type { Anchor, Attachment, CaptureInput, CommentKitEvents, CommentKitOptions, InboxItem, Label, Message, Page, Person, Session, Thread, ThreadPriority, ThreadStatus, WidgetConfig } from "./types.js";
5
6
  import { CommentKitError } from "./types.js";
6
7
  export declare const SDK_VERSION: string;
7
- export declare const DEFAULT_ENDPOINT = "https://commentkit.dev";
8
8
  export interface ClientState {
9
9
  config: WidgetConfig | null;
10
10
  session: Session | null;
@@ -35,6 +35,7 @@ export declare class CommentKitClient {
35
35
  private realtime;
36
36
  private readonly endpoint;
37
37
  private configRead;
38
+ private reportNonce;
38
39
  constructor(options: CommentKitOptions);
39
40
  /** The widget's own crash, sent to CommentKit with the SDK version (see core/report.ts). */
40
41
  reportCrash(error: unknown, kind?: "crash" | "start"): void;
@@ -71,10 +72,13 @@ export declare class CommentKitClient {
71
72
  /** The same key for every attempt at this one comment, so a lost response never creates it twice. */
72
73
  idempotencyKey?: string;
73
74
  }): Promise<Thread>;
75
+ /** Reviewers may only resolve or reopen; priority, assignee, due date and labels are for members who can triage. */
74
76
  updateThread(id: string, changes: {
75
77
  status?: ThreadStatus;
76
78
  priority?: ThreadPriority;
77
79
  assignee_id?: number | null;
80
+ due_at?: string | null;
81
+ label_ids?: number[];
78
82
  }): Promise<Thread>;
79
83
  deleteThread(id: string): Promise<void>;
80
84
  messages(threadId: string, cursor?: string): Promise<Page<Message>>;
@@ -82,6 +86,7 @@ export declare class CommentKitClient {
82
86
  replyTo?: string | null;
83
87
  attachmentIds?: string[];
84
88
  mentionIds?: number[];
89
+ idempotencyKey?: string;
85
90
  }): Promise<Message>;
86
91
  editMessage(id: string, body: string): Promise<Message>;
87
92
  deleteMessage(id: string): Promise<void>;
@@ -100,11 +105,7 @@ export declare class CommentKitClient {
100
105
  all?: boolean;
101
106
  }): Promise<void>;
102
107
  upload(file: Blob, name: string, kind?: "screenshot" | "file"): Promise<Attachment>;
103
- connectRealtime(onChange: (event: {
104
- type: string;
105
- thread_id: string;
106
- actor: string | null;
107
- }) => void): Promise<void>;
108
+ connectRealtime(onChange: (event: FeedbackPing) => void): Promise<void>;
108
109
  refreshThread(id: string): Promise<void>;
109
110
  private upsert;
110
111
  destroy(): void;
@@ -153,6 +153,19 @@ export interface Thread {
153
153
  created_at: string;
154
154
  updated_at: string;
155
155
  }
156
+ /**
157
+ * A realtime change ping. Ids only: the widget fetches the thread again over HTTP. `actor` (and `by`, on
158
+ * newer servers) say who made the change ("user:1", "guest:9"); `page_path` says which page the thread is
159
+ * on. Any of them can be missing on older servers.
160
+ */
161
+ export interface FeedbackPing {
162
+ type: string;
163
+ thread_id: string;
164
+ message_id?: string | null;
165
+ actor?: string | null;
166
+ by?: string | null;
167
+ page_path?: string | null;
168
+ }
156
169
  export interface Capabilities {
157
170
  comment: boolean;
158
171
  triage: boolean;
@@ -169,6 +182,8 @@ export interface Session {
169
182
  };
170
183
  environment: Environment;
171
184
  capabilities: Capabilities;
185
+ /** Opaque key that live-update pings carry in `by` when this person made the change. */
186
+ realtime_key?: string;
172
187
  }
173
188
  export interface WidgetConfig {
174
189
  project: {
@@ -200,6 +215,10 @@ export interface WidgetConfig {
200
215
  limits: {
201
216
  max_upload_bytes: number;
202
217
  };
218
+ /** First read of a page only: proves a real widget load when reporting the widget's own crash. */
219
+ reporting?: {
220
+ nonce?: string;
221
+ };
203
222
  /**
204
223
  * remember: keep people signed in on this device after the tab closes (true, the default when absent),
205
224
  * or only for this tab (false: the refresh token lives in sessionStorage).
package/dist/npm/vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/src-DujplxfI.js";
1
+ import { t as e } from "./chunks/src-DG8ehgE9.js";
2
2
  import { defineComponent as t, onBeforeUnmount as n, onMounted as r } from "vue";
3
3
  //#region src/adapters/vue.ts
4
4
  function i(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commentkit/comment-kit",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.1",
4
4
  "description": "Figma-style comments for any website. Clients pin feedback with an automatic screenshot; developers see it on localhost and hand it to their AI agent.",
5
5
  "keywords": [
6
6
  "comments",
@@ -63,8 +63,7 @@
63
63
  ],
64
64
  "publishConfig": {
65
65
  "access": "public",
66
- "registry": "https://registry.npmjs.org/",
67
- "tag": "beta"
66
+ "registry": "https://registry.npmjs.org/"
68
67
  },
69
68
  "scripts": {
70
69
  "build": "npm run build:npm && npm run build:cdn && npm run build:types && node scripts/check-dist.mjs",