@commentkit/comment-kit 1.0.0-beta.2 → 1.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -4
  3. package/dist/npm/chunks/{Guest-CKoV6pEK.js → Guest-VNoofLxw.js} +46 -46
  4. package/dist/npm/chunks/{MarkupEditor-DAo4qppg.js → MarkupEditor-DTXrS3DD.js} +2 -2
  5. package/dist/npm/chunks/Panel-B88JYH52.js +438 -0
  6. package/dist/npm/chunks/{Shortcuts-CHMcrjAM.js → Shortcuts-BSOKdMHt.js} +2 -2
  7. package/dist/npm/chunks/ThreadCard-izybwXIC.js +817 -0
  8. package/dist/npm/chunks/{ar-D3SPpN1T.js → ar-O7EPv0mI.js} +65 -38
  9. package/dist/npm/chunks/art-DK1JwPIo.js +155 -0
  10. package/dist/npm/chunks/{client-D1NizpDK.js → client-Iegfv6ZC.js} +14 -21
  11. package/dist/npm/chunks/{de-C8eC6c6f.js → de-PGyZVNHX.js} +52 -28
  12. package/dist/npm/chunks/{es-Bczf42tm.js → es-Bq1idl8M.js} +51 -27
  13. package/dist/npm/chunks/{extension--it1LAj-.js → extension-B7SelsS0.js} +1 -1
  14. package/dist/npm/chunks/{extension-XfuRGu2o.js → extension-DSA8S8Qz.js} +1 -1
  15. package/dist/npm/chunks/{format-Bw_tNOh9.js → format-B5tJGtPC.js} +2 -2
  16. package/dist/npm/chunks/{fr-BaQw-v2e.js → fr-BVB9GGco.js} +63 -39
  17. package/dist/npm/chunks/{hi-BamV-yXv.js → hi-DyBvrjzQ.js} +59 -35
  18. package/dist/npm/chunks/{it-DC14_EjN.js → it-BlMMMwZh.js} +52 -28
  19. package/dist/npm/chunks/{ja-B1mmTN7Y.js → ja-lAioBCJv.js} +56 -32
  20. package/dist/npm/chunks/live-YFyP1GnP.js +34 -0
  21. package/dist/npm/chunks/mount-Dx_8NhX3.js +1484 -0
  22. package/dist/npm/chunks/{nl-BfhqUsmX.js → nl-DR8mLHnn.js} +61 -37
  23. package/dist/npm/chunks/{pt-BR-CEPu4W5U.js → pt-BR-D7j6aDPx.js} +52 -28
  24. package/dist/npm/chunks/{report-Dh4fxd4J.js → report-DoDVi1qT.js} +5 -4
  25. package/dist/npm/chunks/{src-DujplxfI.js → src-C1Qp94nr.js} +93 -61
  26. package/dist/npm/chunks/{zh-CN-kgqjYwHQ.js → zh-CN-tzYg9NPH.js} +52 -28
  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 +1 -1
  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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 1.0.0 (2026-10-22)
6
+
7
+ First stable release. Installs with `npm install @commentkit/comment-kit`, no `@beta` needed.
8
+
9
+ - **Pins are the CommentKit mark:** a speech drop whose tip sits exactly on the spot, numbered in its head, coloured by status.
10
+ - **Comment mode glows:** a soft accent frame round the window shows you are commenting, not using the page.
11
+ - **Cleaner, more compact design:** one spacing and type scale, one "selected" style, one focus ring, muted disabled buttons, text boxes that grow with your text, a date chip instead of the browser's date field, and an inbox that never sits behind the launcher.
12
+ - **Illustrated empty states** (all caught up, nothing on this page, nothing matches with Clear filters, couldn't load, gone) and skeletons shaped like the content while it loads.
13
+ - **Errors stay where they happened:** a conversation that cannot load explains why in the card, with Close or Try again.
14
+ - **Translations reviewed** in all 10 languages, with plainer English (versions, not branches).
15
+ - **Security:** reviewer text in agent output stays inside the untrusted-content fence in every spelling; crash reports carry a one-time load proof for the CDN canary.
16
+
17
+ ## 1.0.0-beta.3 (2026-10-20)
18
+
19
+ - **Security:** the sign-in code only ever comes from the sign-in window's message; the widget never asks the server for it.
20
+ - **Task fields in the widget:** team members can set priority, assignee, due date and labels from a conversation. Reviewers see what is set.
21
+ - **Calmer live updates:** a change refetches only what is on this page or open, after a short random delay, and never your own change twice.
22
+ - **Plain, translated errors** for known problems; a failed screenshot upload or reply says exactly what happened and keeps your text.
23
+ - **Agent output:** every reviewer-written field stays inside the untrusted-content fence.
24
+
5
25
  ## 1.0.0-beta.2 (2026-10-20)
6
26
 
7
27
  - **Refreshed look.** One set of design tokens (radius, elevation, motion); surfaces get a hairline ring and soft layered shadows so they read on any site; the launcher is frosted glass; the inbox tabs are a segmented control; status pills are tinted per status; buttons, inputs, chips, menus, toasts and pins have hover, press and focus states; cards and menus open with a short pop (sheets slide up on phones), and everything is still off under reduced motion. Same layout, sizes and touch targets.
package/README.md CHANGED
@@ -21,11 +21,9 @@ Paste before `</body>`:
21
21
  ### npm
22
22
 
23
23
  ```bash
24
- npm install @commentkit/comment-kit@beta
24
+ npm install @commentkit/comment-kit
25
25
  ```
26
26
 
27
- While 1.0 is in beta, install with `@beta` (plain `npm install` and `^1` start working with 1.0.0).
28
-
29
27
  ```ts
30
28
  import { init } from "@commentkit/comment-kit";
31
29
 
@@ -247,7 +245,7 @@ To pin, use the exact version and its Subresource Integrity hash, so the browser
247
245
 
248
246
  The loader then loads the rest of the widget from the same pinned folder, which is immutable. A pinned version gets no fixes: move to a newer one on purpose, and check its changelog first.
249
247
 
250
- **npm**: from 1.0.0, `npm install @commentkit/comment-kit@^1` follows 1.x the same way as `/cdn/v1`; use an exact version (`--save-exact`) and your lockfile to pin. Prereleases are published under the `beta` tag and are never installed by `^1`; until 1.0.0 ships, use `@beta`.
248
+ **npm**: `npm install @commentkit/comment-kit@^1` follows 1.x the same way as `/cdn/v1`; use an exact version (`--save-exact`) and your lockfile to pin. Release candidates for a future major are published under the `next` tag and are never installed by `^1`. The full rules are in [docs/VERSIONING.md](docs/VERSIONING.md).
251
249
 
252
250
  **Support window**: each major version gets security fixes for 24 months after the next major version is released, and bug fixes until then. The end date of each major is announced in the [changelog](CHANGELOG.md) when its successor ships. Security fixes land in the latest minor of every supported major, so the moving channel and `^` ranges receive them automatically; pinned versions do not. See [SECURITY.md](SECURITY.md) to report a vulnerability.
253
251
 
@@ -1,9 +1,9 @@
1
- import { a as e } from "./src-DujplxfI.js";
2
- import { c as t } from "./client-D1NizpDK.js";
3
- import { d as n, f as r, h as i, n as a, p as o } from "./format-Bw_tNOh9.js";
4
- import { a as s } from "./mount-5fFig0k6.js";
1
+ import { o as e } from "./src-C1Qp94nr.js";
2
+ import { c as t } from "./client-Iegfv6ZC.js";
3
+ import { d as n, f as r, h as i, n as a, p as o } from "./format-B5tJGtPC.js";
4
+ import { o as s, p as c } from "./mount-Dx_8NhX3.js";
5
5
  //#region src/ui/Guest.tsx
6
- async function c(n, r) {
6
+ async function l(n, r) {
7
7
  try {
8
8
  let e = await n.api.request("/guest/start", {
9
9
  method: "POST",
@@ -22,40 +22,40 @@ async function c(n, r) {
22
22
  }), "started";
23
23
  } catch (n) {
24
24
  if (n instanceof t && n.code === "origin_not_allowed") return "popup";
25
- throw n instanceof t && n.errors?.share ? new t(422, "share_expired", e("shareExpired")) : n;
25
+ throw n instanceof t && (n.code === "share_expired" || n.status === 410 || n.errors?.share) ? new t(410, "share_expired", e("shareExpired")) : n;
26
26
  }
27
27
  }
28
- function l({ client: c, email: l, onDone: d, onDifferentEmail: f, onClose: p }) {
29
- let [m, h] = i(""), [g, _] = i(!1), [v, y] = i(null), [b, x] = i(null), S = o(null);
30
- r(() => S.current?.focus({ preventScroll: !0 }), []);
31
- let C = async () => {
32
- if (/^\d{6}$/.test(m) && !g) {
33
- _(!0), y(null);
28
+ function u({ client: l, email: u, onDone: f, onDifferentEmail: p, onClose: m }) {
29
+ let [h, g] = i(""), [_, v] = i(!1), [y, b] = i(null), [x, S] = i(null), C = o(null);
30
+ r(() => C.current?.focus({ preventScroll: !0 }), []);
31
+ let w = async () => {
32
+ if (/^\d{6}$/.test(h) && !_) {
33
+ v(!0), b(null);
34
34
  try {
35
- let e = await c.api.request("/guest/verify", {
35
+ let e = await l.api.request("/guest/verify", {
36
36
  method: "POST",
37
- body: { code: m }
37
+ body: { code: h }
38
38
  });
39
- c.auth.adopt(e), await c.loadSession().catch(() => null), d(e.published_thread_ids ?? []);
39
+ l.auth.adopt(e), await l.loadSession().catch(() => null), f(e.published_thread_ids ?? []);
40
40
  } catch (n) {
41
- if ((n instanceof t ? n.status : 0) === 422) return y({
41
+ if ((n instanceof t ? n.status : 0) === 422) return b({
42
42
  text: e("verifyWrong"),
43
43
  tone: "warning"
44
44
  });
45
- let r = u(n);
46
- r && (c.auth.setPending(null), x(r === "expired" ? "again" : "stop")), y({
47
- text: r ? e(r === "link" ? "verifyLinkExpired" : r === "removed" ? "verifyRemoved" : "verifyExpired") : n instanceof t ? n.message : e("errorGeneric"),
45
+ let r = d(n);
46
+ r && (l.auth.setPending(null), S(r === "expired" ? "again" : "stop")), b({
47
+ text: r ? e(r === "link" ? "verifyLinkExpired" : r === "removed" ? "verifyRemoved" : "verifyExpired") : c(n),
48
48
  tone: "warning"
49
49
  });
50
50
  } finally {
51
- _(!1);
51
+ v(!1);
52
52
  }
53
53
  }
54
- }, w = async () => {
54
+ }, T = async () => {
55
55
  try {
56
- await c.api.request("/guest/resend", { method: "POST" }), y({ text: e("verifyResent") });
56
+ await l.api.request("/guest/resend", { method: "POST" }), b({ text: e("verifyResent") });
57
57
  } catch (n) {
58
- y({
58
+ b({
59
59
  text: n instanceof t && n.status === 429 ? e("verifyWait") : e("errorGeneric"),
60
60
  tone: "warning"
61
61
  });
@@ -70,7 +70,7 @@ function l({ client: c, email: l, onDone: d, onDifferentEmail: f, onClose: p })
70
70
  role: "dialog",
71
71
  "aria-labelledby": "ck-verify-title",
72
72
  "data-commentkit-ui": !0,
73
- onKeyDown: (e) => e.key === "Escape" && p(),
73
+ onKeyDown: (e) => e.key === "Escape" && m(),
74
74
  children: [
75
75
  /* @__PURE__ */ n("div", {
76
76
  class: "ck-card-head",
@@ -81,7 +81,7 @@ function l({ client: c, email: l, onDone: d, onDifferentEmail: f, onClose: p })
81
81
  }), /* @__PURE__ */ n("button", {
82
82
  class: "ck-ghost",
83
83
  "aria-label": e("close"),
84
- onClick: p,
84
+ onClick: m,
85
85
  children: /* @__PURE__ */ n(a, { name: "close" })
86
86
  })]
87
87
  }),
@@ -90,40 +90,40 @@ function l({ client: c, email: l, onDone: d, onDifferentEmail: f, onClose: p })
90
90
  children: [
91
91
  /* @__PURE__ */ n("p", {
92
92
  class: "ck-verify-text",
93
- children: e("verifyBody", { email: l })
93
+ children: e("verifyBody", { email: u })
94
94
  }),
95
95
  /* @__PURE__ */ n("label", {
96
96
  class: "ck-field",
97
97
  children: [/* @__PURE__ */ n("span", { children: e("verifyCode") }), /* @__PURE__ */ n("input", {
98
- ref: S,
98
+ ref: C,
99
99
  class: "ck-input ck-code",
100
100
  inputMode: "numeric",
101
101
  autoComplete: "one-time-code",
102
102
  pattern: "[0-9]*",
103
103
  maxLength: 6,
104
- value: m,
105
- onInput: (e) => h(e.target.value.replace(/\D/g, "").slice(0, 6)),
104
+ value: h,
105
+ onInput: (e) => g(e.target.value.replace(/\D/g, "").slice(0, 6)),
106
106
  onKeyDown: (e) => {
107
- e.stopPropagation(), e.key === "Enter" && C(), e.key === "Escape" && p();
107
+ e.stopPropagation(), e.key === "Enter" && w(), e.key === "Escape" && m();
108
108
  }
109
109
  })]
110
110
  }),
111
- v ? /* @__PURE__ */ n("div", {
111
+ y ? /* @__PURE__ */ n("div", {
112
112
  class: "ck-note",
113
- role: v.tone ? "alert" : "status",
114
- "data-tone": v.tone,
115
- children: v.text
113
+ role: y.tone ? "alert" : "status",
114
+ "data-tone": y.tone,
115
+ children: y.text
116
116
  }) : null,
117
- b ? null : /* @__PURE__ */ n("div", {
117
+ x ? null : /* @__PURE__ */ n("div", {
118
118
  class: "ck-actions",
119
119
  children: [/* @__PURE__ */ n("button", {
120
120
  class: "ck-chip",
121
- onClick: () => void w(),
121
+ onClick: () => void T(),
122
122
  children: e("verifyResend")
123
123
  }), /* @__PURE__ */ n("button", {
124
124
  class: "ck-chip",
125
125
  onClick: () => {
126
- c.auth.setPending(null), f();
126
+ l.auth.setPending(null), p();
127
127
  },
128
128
  children: e("verifyDifferent")
129
129
  })]
@@ -132,26 +132,26 @@ function l({ client: c, email: l, onDone: d, onDifferentEmail: f, onClose: p })
132
132
  }),
133
133
  /* @__PURE__ */ n("div", {
134
134
  class: "ck-card-foot",
135
- children: [/* @__PURE__ */ n("span", { class: "ck-spacer" }), b === "again" ? /* @__PURE__ */ n("button", {
135
+ children: [/* @__PURE__ */ n("span", { class: "ck-spacer" }), x === "again" ? /* @__PURE__ */ n("button", {
136
136
  class: "ck-btn ck-primary",
137
- onClick: f,
137
+ onClick: p,
138
138
  children: e("writeAgain")
139
- }) : b === "stop" ? /* @__PURE__ */ n("button", {
139
+ }) : x === "stop" ? /* @__PURE__ */ n("button", {
140
140
  class: "ck-btn",
141
- onClick: p,
141
+ onClick: m,
142
142
  children: e("close")
143
143
  }) : /* @__PURE__ */ n("button", {
144
144
  class: "ck-btn ck-primary",
145
- disabled: g || m.length !== 6,
146
- onClick: () => void C(),
147
- children: e(g ? "sending" : "verifyPublish")
145
+ disabled: _ || h.length !== 6,
146
+ onClick: () => void w(),
147
+ children: e(_ ? "sending" : "verifyPublish")
148
148
  })]
149
149
  })
150
150
  ]
151
151
  });
152
152
  }
153
- function u(e) {
153
+ function d(e) {
154
154
  return e instanceof t ? e.code === "share_expired" || e.status === 410 ? "link" : e.code === "guest_removed" ? "removed" : e.status === 403 ? /\blink\b/i.test(e.message) ? "link" : "removed" : e.status === 409 || e.status === 401 ? "expired" : null : null;
155
155
  }
156
156
  //#endregion
157
- export { l as GuestVerify, c as startGuest };
157
+ export { u as GuestVerify, l as startGuest };
@@ -1,5 +1,5 @@
1
- import { a as e } from "./src-DujplxfI.js";
2
- import { a as t, d as n, f as r, h as i, p as a } from "./format-Bw_tNOh9.js";
1
+ import { o as e } from "./src-C1Qp94nr.js";
2
+ import { a as t, d as n, f as r, h as i, p as a } from "./format-B5tJGtPC.js";
3
3
  //#region src/ui/MarkupEditor.tsx
4
4
  var o = [
5
5
  "#ff3b30",
@@ -0,0 +1,438 @@
1
+ import { a as e, i as t, n, o as r } from "./src-C1Qp94nr.js";
2
+ import { r as i } from "./client-Iegfv6ZC.js";
3
+ import { r as a } from "./anchor-DT-Ynhh1.js";
4
+ import { d as o, f as s, h as c, i as ee, l as te, n as ne, p as l, s as re, u, y as d } from "./format-B5tJGtPC.js";
5
+ import { t as f } from "./art-DK1JwPIo.js";
6
+ import { c as p, l as m, n as h, u as g } from "./mount-Dx_8NhX3.js";
7
+ //#region src/ui/Panel.tsx
8
+ function _({ client: n, side: f, dock: _ = "bottom", onClose: y, onOpen: ae }) {
9
+ let S = g(n.state, (e) => e.threads), C = g(n.state, (e) => e.unread), w = g(n.state, (e) => e.allBranches), T = g(n.state, (e) => e.here), E = g(n.state, (e) => e.session), oe = g(n.state, (e) => e.config?.read_only ?? !1), D = n.options.branch, se = m(), [O, k] = c(C > 0 ? "inbox" : "page"), [ce, A] = c({ state: "loading" }), [j, M] = c({ state: "loading" }), [N, P] = c(""), [F, I] = c("active"), [L, le] = c(0), [R, z] = c(""), [B, V] = c(null), [H, U] = c(!1), [W, ue] = c({
10
+ people: [],
11
+ labels: []
12
+ }), G = l(null), K = l(null);
13
+ s(() => K.current?.querySelector("[aria-selected=true]")?.focus({ preventScroll: !0 }), []);
14
+ let q = !!(N || R || B), J = q || F !== "active", de = () => {
15
+ P(""), I("active"), z(""), V(null);
16
+ }, Y = !!E && E.role !== "guest";
17
+ s(() => {
18
+ if (O === "inbox" || O === "page" && !q) return;
19
+ A({ state: "loading" });
20
+ let e = setTimeout(() => {
21
+ n.listThreads({
22
+ q: N || void 0,
23
+ status: O === "page" ? "active" : F,
24
+ branch: n.branchFilter(),
25
+ page_url: O === "page" ? i() : void 0,
26
+ assignee: R || void 0,
27
+ label: B ?? void 0
28
+ }).then((e) => A({
29
+ state: "ready",
30
+ data: e.data.filter((e) => x(e, R, B, E))
31
+ }), () => A({ state: "error" }));
32
+ }, N ? 250 : 0);
33
+ return () => clearTimeout(e);
34
+ }, [
35
+ O,
36
+ N,
37
+ F,
38
+ L,
39
+ w,
40
+ R,
41
+ B,
42
+ q
43
+ ]), s(() => {
44
+ !H || W.people.length || W.labels.length || Promise.all([n.people().catch(() => []), n.labels().catch(() => [])]).then(([e, t]) => ue({
45
+ people: e.filter((e) => e.assignable && e.id !== null),
46
+ labels: t
47
+ }));
48
+ }, [H]), s(() => {
49
+ O === "inbox" && n.inbox().then((e) => M({
50
+ state: "ready",
51
+ data: e
52
+ }), () => M({ state: "error" }));
53
+ }, [
54
+ O,
55
+ C,
56
+ L
57
+ ]);
58
+ let X = (e) => h("page" in e ? e.page.url : e.page_url, "page" in e ? e.id : e.thread_id, ae), Z = (e) => p(e, ".ck-item", !0), Q = () => le((e) => e + 1), $ = O === "page" && !q ? {
59
+ state: "ready",
60
+ data: S
61
+ } : ce, fe = [
62
+ [
63
+ "page",
64
+ "thisPage",
65
+ S.length
66
+ ],
67
+ [
68
+ "all",
69
+ "allPages",
70
+ null
71
+ ],
72
+ [
73
+ "inbox",
74
+ "notifications",
75
+ C || null
76
+ ]
77
+ ];
78
+ return /* @__PURE__ */ o("aside", {
79
+ class: "ck-panel",
80
+ "data-side": f,
81
+ "data-dock": _,
82
+ "aria-label": r("inbox"),
83
+ "data-commentkit-ui": !0,
84
+ onKeyDown: (e) => e.key === "Escape" && y(),
85
+ children: [
86
+ /* @__PURE__ */ o("div", {
87
+ class: "ck-card-head",
88
+ children: [
89
+ /* @__PURE__ */ o("span", {
90
+ class: "ck-card-title",
91
+ children: r("inbox")
92
+ }),
93
+ T > 1 ? /* @__PURE__ */ o("span", {
94
+ class: "ck-here",
95
+ role: "status",
96
+ children: [/* @__PURE__ */ o("span", {
97
+ "aria-hidden": "true",
98
+ class: "ck-dot"
99
+ }), t("peopleHere", T)]
100
+ }) : null,
101
+ /* @__PURE__ */ o("button", {
102
+ class: "ck-ghost",
103
+ onClick: y,
104
+ "aria-label": r("close"),
105
+ children: /* @__PURE__ */ o(ne, { name: "close" })
106
+ })
107
+ ]
108
+ }),
109
+ /* @__PURE__ */ o("div", {
110
+ class: "ck-tabs",
111
+ role: "tablist",
112
+ ref: K,
113
+ onKeyDown: (e) => p(e, "[role=tab]"),
114
+ children: fe.map(([e, t, n]) => /* @__PURE__ */ o("button", {
115
+ role: "tab",
116
+ id: `ck-tab-${e}`,
117
+ "aria-controls": "ck-tabpanel",
118
+ class: "ck-tab",
119
+ "aria-selected": O === e,
120
+ tabIndex: O === e ? 0 : -1,
121
+ onClick: () => k(e),
122
+ onFocus: () => k(e),
123
+ children: [
124
+ r(t),
125
+ " ",
126
+ n ? /* @__PURE__ */ o("span", {
127
+ class: "ck-count",
128
+ children: n
129
+ }) : null
130
+ ]
131
+ }))
132
+ }),
133
+ se ? null : /* @__PURE__ */ o("div", {
134
+ class: "ck-note",
135
+ "data-tone": "warning",
136
+ role: "status",
137
+ children: r("offline")
138
+ }),
139
+ oe ? /* @__PURE__ */ o("div", {
140
+ class: "ck-note ck-pad-x",
141
+ role: "status",
142
+ children: r("readOnlyShort")
143
+ }) : null,
144
+ D && O !== "inbox" ? /* @__PURE__ */ o("div", {
145
+ class: "ck-branchbar",
146
+ role: "group",
147
+ "aria-label": r("branchFilter"),
148
+ children: [/* @__PURE__ */ o("button", {
149
+ class: "ck-chip",
150
+ "aria-pressed": !w,
151
+ onClick: () => void n.setAllBranches(!1).catch(() => void 0),
152
+ title: D,
153
+ children: r("thisBranch", { branch: b(D) })
154
+ }), /* @__PURE__ */ o("button", {
155
+ class: "ck-chip",
156
+ "aria-pressed": w,
157
+ onClick: () => void n.setAllBranches(!0).catch(() => void 0),
158
+ children: r("allBranches")
159
+ })]
160
+ }) : null,
161
+ O === "inbox" ? null : /* @__PURE__ */ o(d, { children: [
162
+ /* @__PURE__ */ o("div", {
163
+ class: "ck-filters",
164
+ children: [/* @__PURE__ */ o("input", {
165
+ class: "ck-input",
166
+ type: "search",
167
+ "aria-label": r("search"),
168
+ placeholder: r("search"),
169
+ value: N,
170
+ onInput: (e) => P(e.target.value),
171
+ onKeyDown: (e) => e.stopPropagation()
172
+ }), O === "all" ? /* @__PURE__ */ o("select", {
173
+ class: "ck-input",
174
+ "aria-label": r("statusFilter"),
175
+ value: F,
176
+ onChange: (e) => I(e.target.value),
177
+ children: [
178
+ /* @__PURE__ */ o("option", {
179
+ value: "active",
180
+ children: r("status_open")
181
+ }),
182
+ /* @__PURE__ */ o("option", {
183
+ value: "in_review",
184
+ children: r("status_in_review")
185
+ }),
186
+ /* @__PURE__ */ o("option", {
187
+ value: "resolved,closed",
188
+ children: r("status_resolved")
189
+ }),
190
+ /* @__PURE__ */ o("option", {
191
+ value: "all",
192
+ children: r("allStatuses")
193
+ })
194
+ ]
195
+ }) : null]
196
+ }),
197
+ /* @__PURE__ */ o("div", {
198
+ class: "ck-branchbar",
199
+ children: [Y ? /* @__PURE__ */ o("button", {
200
+ class: "ck-chip",
201
+ "aria-pressed": R === "me",
202
+ onClick: () => z(R === "me" ? "" : "me"),
203
+ children: r("assignedToMe")
204
+ }) : null, /* @__PURE__ */ o("button", {
205
+ class: "ck-chip",
206
+ "aria-expanded": H,
207
+ "aria-controls": "ck-more-filters",
208
+ onClick: () => U(!H),
209
+ children: [r("filters"), R || B ? " •" : ""]
210
+ })]
211
+ }),
212
+ H ? /* @__PURE__ */ o("div", {
213
+ class: "ck-filters",
214
+ id: "ck-more-filters",
215
+ children: [Y ? /* @__PURE__ */ o("select", {
216
+ class: "ck-input",
217
+ "aria-label": r("assigneeFilter"),
218
+ value: R,
219
+ onChange: (e) => z(e.target.value),
220
+ children: [
221
+ /* @__PURE__ */ o("option", {
222
+ value: "",
223
+ children: r("anyone")
224
+ }),
225
+ /* @__PURE__ */ o("option", {
226
+ value: "me",
227
+ children: r("assignedToMe")
228
+ }),
229
+ /* @__PURE__ */ o("option", {
230
+ value: "none",
231
+ children: r("unassigned")
232
+ }),
233
+ W.people.map((e) => /* @__PURE__ */ o("option", {
234
+ value: String(e.id),
235
+ children: e.name
236
+ }))
237
+ ]
238
+ }) : null, /* @__PURE__ */ o("select", {
239
+ class: "ck-input",
240
+ "aria-label": r("labelFilter"),
241
+ value: B === null ? "" : String(B),
242
+ onChange: (e) => {
243
+ let t = e.target.value;
244
+ V(t ? Number(t) : null);
245
+ },
246
+ children: [/* @__PURE__ */ o("option", {
247
+ value: "",
248
+ children: r("anyLabel")
249
+ }), W.labels.map((e) => /* @__PURE__ */ o("option", {
250
+ value: String(e.id),
251
+ children: e.name
252
+ }))]
253
+ })]
254
+ }) : null
255
+ ] }),
256
+ /* @__PURE__ */ o("div", {
257
+ class: "ck-card-body",
258
+ id: "ck-tabpanel",
259
+ role: "tabpanel",
260
+ "aria-labelledby": `ck-tab-${O}`,
261
+ style: { padding: 0 },
262
+ "aria-busy": (O === "inbox" ? j : $).state === "loading",
263
+ children: O === "inbox" ? /* @__PURE__ */ o(v, {
264
+ load: j,
265
+ onRetry: Q,
266
+ art: "caughtUp",
267
+ empty: /* @__PURE__ */ o("strong", { children: r("allCaughtUp") }),
268
+ children: (t) => /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ o("ul", {
269
+ class: "ck-list",
270
+ ref: G,
271
+ onKeyDown: Z,
272
+ children: t.map((t) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
273
+ class: "ck-item",
274
+ "data-unread": !t.read,
275
+ onClick: () => X(t),
276
+ children: [/* @__PURE__ */ o("div", {
277
+ class: "ck-item-top",
278
+ children: [/* @__PURE__ */ o("span", {
279
+ class: "ck-item-tags",
280
+ children: [/* @__PURE__ */ o(ie, { item: t }), t.reference ? ` · ${t.reference}` : ""]
281
+ }), /* @__PURE__ */ o("span", {
282
+ class: "ck-time",
283
+ children: e(t.created_at)
284
+ })]
285
+ }), t.excerpt ? /* @__PURE__ */ o("div", {
286
+ class: "ck-item-text",
287
+ children: t.excerpt
288
+ }) : null]
289
+ }) }))
290
+ }), C ? /* @__PURE__ */ o("div", {
291
+ class: "ck-pad",
292
+ children: /* @__PURE__ */ o("button", {
293
+ class: "ck-btn",
294
+ onClick: () => void n.markRead({ all: !0 }).then(Q),
295
+ children: r("markAllRead")
296
+ })
297
+ }) : null] })
298
+ }) : /* @__PURE__ */ o(v, {
299
+ load: $,
300
+ onRetry: Q,
301
+ art: J ? "noMatch" : "noFeedback",
302
+ empty: J ? /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ o("strong", { children: r("noMatch") }), /* @__PURE__ */ o("button", {
303
+ class: "ck-btn",
304
+ onClick: de,
305
+ children: r("clearFilters")
306
+ })] }) : /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ o("strong", { children: r(O === "all" ? "nothingAnywhere" : "nothingHere") }), /* @__PURE__ */ o("span", {
307
+ class: "ck-hint",
308
+ children: r("nothingHereHint")
309
+ })] }),
310
+ children: (n) => /* @__PURE__ */ o("ul", {
311
+ class: "ck-list",
312
+ ref: G,
313
+ onKeyDown: Z,
314
+ children: n.map((n) => {
315
+ let i = O === "page" && a(n.anchor).state === "detached", s = i ? te(n.capture?.screenshot?.thumbnail_url, "image") : null;
316
+ return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o("button", {
317
+ class: "ck-item",
318
+ "data-shot": s ? "true" : void 0,
319
+ onClick: () => X(n),
320
+ children: [/* @__PURE__ */ o("div", {
321
+ class: "ck-item-main",
322
+ children: [
323
+ /* @__PURE__ */ o("div", {
324
+ class: "ck-item-top",
325
+ children: [/* @__PURE__ */ o("span", {
326
+ class: "ck-item-tags",
327
+ children: [
328
+ /* @__PURE__ */ o("strong", { children: Y ? n.reference : r("feedbackRef", { ref: n.reference }) }),
329
+ /* @__PURE__ */ o(ee, { status: n.status }),
330
+ re(n) ? /* @__PURE__ */ o("span", {
331
+ class: "ck-tag",
332
+ title: `${r(`screen_${u(n.breakpoint)}`)} (${n.breakpoint}px)`,
333
+ children: r(`size_${u(n.breakpoint)}`)
334
+ }) : null,
335
+ i ? /* @__PURE__ */ o("span", {
336
+ class: "ck-badge-soft",
337
+ title: r("detached"),
338
+ children: r("notOnPage")
339
+ }) : null
340
+ ]
341
+ }), /* @__PURE__ */ o("span", {
342
+ class: "ck-time",
343
+ children: e(n.last_activity_at)
344
+ })]
345
+ }),
346
+ /* @__PURE__ */ o("div", {
347
+ class: "ck-item-text",
348
+ children: n.first_message?.body
349
+ }),
350
+ /* @__PURE__ */ o("div", {
351
+ class: "ck-muted ck-item-meta",
352
+ children: [
353
+ /* @__PURE__ */ o("bdi", { children: n.author.name }),
354
+ O === "all" ? /* @__PURE__ */ o(d, { children: [" · ", /* @__PURE__ */ o("bdi", { children: n.page.title || n.page.path })] }) : "",
355
+ " · ",
356
+ t("messageCount", n.message_count),
357
+ w && n.page.branch && n.page.branch !== D ? ` · ${r("onBranch", { branch: b(n.page.branch) })}` : ""
358
+ ]
359
+ })
360
+ ]
361
+ }), s ? /* @__PURE__ */ o("img", {
362
+ class: "ck-item-thumb",
363
+ src: s,
364
+ alt: r("screenshot"),
365
+ loading: "lazy"
366
+ }) : null]
367
+ }) });
368
+ })
369
+ })
370
+ })
371
+ })
372
+ ]
373
+ });
374
+ }
375
+ function v({ load: e, onRetry: t, art: n, empty: i, children: a }) {
376
+ return e.state === "loading" ? /* @__PURE__ */ o("div", {
377
+ class: "ck-loading",
378
+ role: "status",
379
+ "aria-label": r("loadingEarlier"),
380
+ children: [
381
+ 0,
382
+ 1,
383
+ 2
384
+ ].map(() => /* @__PURE__ */ o("div", {
385
+ class: "ck-loading-row",
386
+ children: [
387
+ /* @__PURE__ */ o("div", { class: "ck-skeleton" }),
388
+ /* @__PURE__ */ o("div", { class: "ck-skeleton" }),
389
+ /* @__PURE__ */ o("div", { class: "ck-skeleton" })
390
+ ]
391
+ }))
392
+ }) : e.state === "error" ? /* @__PURE__ */ o("div", {
393
+ class: "ck-empty",
394
+ role: "alert",
395
+ children: [
396
+ /* @__PURE__ */ o(f, { name: "error" }),
397
+ r("loadFailed"),
398
+ /* @__PURE__ */ o("button", {
399
+ class: "ck-btn",
400
+ onClick: t,
401
+ children: r("retry")
402
+ })
403
+ ]
404
+ }) : e.data.length ? /* @__PURE__ */ o(d, { children: a(e.data) }) : /* @__PURE__ */ o("div", {
405
+ class: "ck-empty",
406
+ children: [/* @__PURE__ */ o(f, { name: n }), i]
407
+ });
408
+ }
409
+ function ie({ item: e }) {
410
+ let t = `kind_${e.kind}`, [i, a] = /^kind_[a-z_]+$/.test(t) && t in y ? n(t, "actor") : ["", ` ${e.kind.replace(/_/g, " ")}`], { type: s, name: c } = e.actor;
411
+ return /* @__PURE__ */ o(d, { children: [
412
+ i,
413
+ /* @__PURE__ */ o("strong", { children: /* @__PURE__ */ o("bdi", { children: s === "agent" || s === "integration" || s === "system" ? c : r("personName", { name: c }) }) }),
414
+ a
415
+ ] });
416
+ }
417
+ var y = {
418
+ kind_mention: !0,
419
+ kind_reply: !0,
420
+ kind_assigned: !0,
421
+ kind_ready_for_review: !0,
422
+ kind_reopened: !0,
423
+ kind_resolved: !0,
424
+ kind_closed: !0,
425
+ kind_new_feedback: !0,
426
+ kind_due_soon: !0,
427
+ kind_overdue: !0,
428
+ kind_agent_request: !0
429
+ };
430
+ function b(e) {
431
+ return e.length > 28 ? `${e.slice(0, 27)}…` : e;
432
+ }
433
+ function x(e, t, n, r) {
434
+ let i = e.assignee;
435
+ return n !== null && e.labels && !e.labels.some((e) => e.id === n) ? !1 : t === "none" ? !i : t === "me" ? !!i && !!r && i.id === r.person.id && i.type === r.person.type : !t || i?.id === t;
436
+ }
437
+ //#endregion
438
+ export { _ as Panel };