@commentkit/comment-kit 0.7.7 → 1.0.0-beta.2

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 (129) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +172 -732
  3. package/SECURITY.md +24 -14
  4. package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
  5. package/dist/npm/chunks/Guest-CKoV6pEK.js +157 -0
  6. package/dist/npm/chunks/MarkupEditor-DAo4qppg.js +199 -0
  7. package/dist/npm/chunks/Panel-BRBDHlGg.js +399 -0
  8. package/dist/npm/chunks/Shortcuts-CHMcrjAM.js +56 -0
  9. package/dist/npm/chunks/ThreadCard-D8FzIxbs.js +570 -0
  10. package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
  11. package/dist/npm/chunks/ar-D3SPpN1T.js +195 -0
  12. package/dist/npm/chunks/client-D1NizpDK.js +627 -0
  13. package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
  14. package/dist/npm/chunks/de-C8eC6c6f.js +187 -0
  15. package/dist/npm/chunks/es-Bczf42tm.js +187 -0
  16. package/dist/npm/chunks/extension--it1LAj-.js +54 -0
  17. package/dist/npm/chunks/extension-XfuRGu2o.js +26 -0
  18. package/dist/npm/chunks/format-Bw_tNOh9.js +524 -0
  19. package/dist/npm/chunks/fr-BaQw-v2e.js +187 -0
  20. package/dist/npm/chunks/hi-BamV-yXv.js +187 -0
  21. package/dist/npm/chunks/html2canvas-DfGb8yka.js +4024 -0
  22. package/dist/npm/chunks/it-DC14_EjN.js +187 -0
  23. package/dist/npm/chunks/ja-B1mmTN7Y.js +187 -0
  24. package/dist/npm/chunks/mount-5fFig0k6.js +1447 -0
  25. package/dist/npm/chunks/nl-BfhqUsmX.js +187 -0
  26. package/dist/npm/chunks/privacy-DLhezjyi.js +30 -0
  27. package/dist/npm/chunks/pt-BR-CEPu4W5U.js +187 -0
  28. package/dist/{shared/pusher-CnhQgAvF.js → npm/chunks/pusher-BSsQoE1K.js} +224 -222
  29. package/dist/npm/chunks/realtime-CBRW9BB3.js +34 -0
  30. package/dist/npm/chunks/report-Dh4fxd4J.js +27 -0
  31. package/dist/npm/chunks/rolldown-runtime-Y_bBpyJl.js +20 -0
  32. package/dist/npm/chunks/src-DujplxfI.js +517 -0
  33. package/dist/npm/chunks/zh-CN-kgqjYwHQ.js +187 -0
  34. package/dist/npm/element.js +41 -0
  35. package/dist/npm/headless.js +3 -0
  36. package/dist/npm/index.js +3 -0
  37. package/dist/npm/react.js +26 -0
  38. package/dist/npm/svelte.js +17 -0
  39. package/dist/npm/types/adapters/react.d.ts +11 -0
  40. package/dist/npm/types/adapters/svelte.d.ts +9 -0
  41. package/dist/npm/types/adapters/vue.d.ts +118 -0
  42. package/dist/npm/types/anchor/index.d.ts +49 -0
  43. package/dist/npm/types/core/api.d.ts +31 -0
  44. package/dist/npm/types/core/auth.d.ts +87 -0
  45. package/dist/npm/types/core/client.d.ts +114 -0
  46. package/dist/npm/types/core/store.d.ts +7 -0
  47. package/dist/npm/types/core/types.d.ts +303 -0
  48. package/dist/npm/types/element.d.ts +13 -0
  49. package/dist/npm/types/headless.d.ts +7 -0
  50. package/dist/npm/types/index.d.ts +32 -0
  51. package/dist/npm/vue.js +71 -0
  52. package/package.json +71 -173
  53. package/dist/THIRD_PARTY_NOTICES.txt +0 -284
  54. package/dist/angular.es.js +0 -321
  55. package/dist/comment-kit.es.js +0 -218
  56. package/dist/demo.es.js +0 -483
  57. package/dist/headless.es.js +0 -4
  58. package/dist/preact.es.js +0 -117
  59. package/dist/qwik.es.js +0 -1
  60. package/dist/qwik.qwik.mjs +0 -114
  61. package/dist/react.es.js +0 -98
  62. package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
  63. package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
  64. package/dist/shared/annotation-toolbar-zeiCmKIr.js +0 -1086
  65. package/dist/shared/attachment-refresh-DAacLaRu.js +0 -94
  66. package/dist/shared/bridge-CJoGYngu.js +0 -177
  67. package/dist/shared/button-D4GHW6oZ.js +0 -474
  68. package/dist/shared/button-group-BVR7iT-S.js +0 -91
  69. package/dist/shared/capture-privacy-CiOrcAlt.js +0 -101
  70. package/dist/shared/comment-drawing-canvas-Btc12IsS.js +0 -124
  71. package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
  72. package/dist/shared/comment-image-lightbox--QpbcAtH.js +0 -190
  73. package/dist/shared/comment-images-content-C_r4SHM-.js +0 -214
  74. package/dist/shared/comment-kit-core-CmLUFujd.js +0 -3682
  75. package/dist/shared/comment-kit-ui-BHwYuSIi.js +0 -19391
  76. package/dist/shared/comment-screenshot-annotator-zJZyO-XM.js +0 -151
  77. package/dist/shared/comment-screenshot-overlay-CoKTYB0J.js +0 -205
  78. package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
  79. package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
  80. package/dist/shared/dev-export-panel-Cnt6oCZU.js +0 -207
  81. package/dist/shared/dev-grab-B85jo9AS.js +0 -197
  82. package/dist/shared/dist-D9A5k-N4.js +0 -617
  83. package/dist/shared/dom-Bhf4WFtY.js +0 -223
  84. package/dist/shared/element-selector-Cng84xC7.js +0 -902
  85. package/dist/shared/error-boundary-D3PD74vI.js +0 -21
  86. package/dist/shared/errors-Bu5ajEmB.js +0 -22
  87. package/dist/shared/icons-nzMOLzrm.js +0 -266
  88. package/dist/shared/input-UPtAj0M6.js +0 -111
  89. package/dist/shared/mount-ui-Dz7FB_Ak.js +0 -208
  90. package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
  91. package/dist/shared/realtime-yGLX4wMK.js +0 -334
  92. package/dist/shared/request-activity-DQrAUwfA.js +0 -11
  93. package/dist/shared/screenshot-B5-hwpmt.js +0 -199
  94. package/dist/shared/separator-UhJb0Row.js +0 -3955
  95. package/dist/shared/shadow-root-B58ZI2yz.js +0 -133
  96. package/dist/shared/styles-CnYsLS2f.js +0 -2
  97. package/dist/shared/text-B4HHZNaa.js +0 -23
  98. package/dist/shared/token-session-D92MYbNu.js +0 -25
  99. package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
  100. package/dist/shared/useRender-Uxk1OPK-.js +0 -5
  101. package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
  102. package/dist/shared/validation-3wbbbuX0.js +0 -70
  103. package/dist/shared/websocket-manager-KhH4hL0Q.js +0 -381
  104. package/dist/solid.es.js +0 -98
  105. package/dist/svelte.es.js +0 -130
  106. package/dist/types/adapters/bridge.d.ts +0 -122
  107. package/dist/types/angular/index.d.ts +0 -145
  108. package/dist/types/core/agent-context.d.ts +0 -17
  109. package/dist/types/core/api-client.d.ts +0 -155
  110. package/dist/types/core/comment-kit-core.d.ts +0 -254
  111. package/dist/types/core/local-demo.d.ts +0 -60
  112. package/dist/types/core/types.d.ts +0 -770
  113. package/dist/types/core/websocket-manager.d.ts +0 -125
  114. package/dist/types/core/write-access.d.ts +0 -11
  115. package/dist/types/demo.d.ts +0 -17
  116. package/dist/types/headless.d.ts +0 -8
  117. package/dist/types/index.d.ts +0 -87
  118. package/dist/types/preact/index.d.ts +0 -25
  119. package/dist/types/qwik/index.d.ts +0 -73
  120. package/dist/types/react/client.d.ts +0 -31
  121. package/dist/types/react/index.d.ts +0 -4
  122. package/dist/types/solid/index.d.ts +0 -37
  123. package/dist/types/svelte/index.d.ts +0 -55
  124. package/dist/types/utils/dom.d.ts +0 -59
  125. package/dist/types/utils/event-emitter.d.ts +0 -11
  126. package/dist/types/vue/index.d.ts +0 -87
  127. package/dist/vue.es.js +0 -148
  128. package/docs/api-reference.md +0 -405
  129. package/docs/local-demo.md +0 -60
@@ -0,0 +1,399 @@
1
+ import { a as e, i as t, r as n } from "./src-DujplxfI.js";
2
+ import { r } from "./client-D1NizpDK.js";
3
+ import { r as i } from "./anchor-DT-Ynhh1.js";
4
+ import { d as a, f as o, h as s, i as ee, l as c, n as l, p as u, s as d, u as f, y as p } from "./format-Bw_tNOh9.js";
5
+ import { c as te, l as m, n as ne, s as h } from "./mount-5fFig0k6.js";
6
+ //#region src/ui/Panel.tsx
7
+ function g({ client: g, side: y, onClose: x, onOpen: ie }) {
8
+ let S = m(g.state, (e) => e.threads), C = m(g.state, (e) => e.unread), w = m(g.state, (e) => e.allBranches), T = m(g.state, (e) => e.here), E = m(g.state, (e) => e.session), ae = m(g.state, (e) => e.config?.read_only ?? !1), D = g.options.branch, oe = te(), [O, k] = s(C > 0 ? "inbox" : "page"), [A, j] = s({ state: "loading" }), [M, N] = s({ state: "loading" }), [P, F] = s(""), [I, se] = s("active"), [L, R] = s(0), [z, B] = s(""), [V, H] = s(null), [U, W] = s(!1), [G, ce] = s({
9
+ people: [],
10
+ labels: []
11
+ }), K = u(null), q = u(null);
12
+ o(() => q.current?.querySelector("[aria-selected=true]")?.focus({ preventScroll: !0 }), []);
13
+ let J = !!(P || z || V), Y = !!E && E.role !== "guest";
14
+ o(() => {
15
+ if (O === "inbox" || O === "page" && !J) return;
16
+ j({ state: "loading" });
17
+ let e = setTimeout(() => {
18
+ g.listThreads({
19
+ q: P || void 0,
20
+ status: O === "page" ? "active" : I,
21
+ branch: g.branchFilter(),
22
+ page_url: O === "page" ? r() : void 0,
23
+ assignee: z || void 0,
24
+ label: V ?? void 0
25
+ }).then((e) => j({
26
+ state: "ready",
27
+ data: e.data.filter((e) => re(e, z, V, E))
28
+ }), () => j({ state: "error" }));
29
+ }, P ? 250 : 0);
30
+ return () => clearTimeout(e);
31
+ }, [
32
+ O,
33
+ P,
34
+ I,
35
+ L,
36
+ w,
37
+ z,
38
+ V,
39
+ J
40
+ ]), o(() => {
41
+ !U || G.people.length || G.labels.length || Promise.all([g.people().catch(() => []), g.labels().catch(() => [])]).then(([e, t]) => ce({
42
+ people: e.filter((e) => e.assignable && e.id !== null),
43
+ labels: t
44
+ }));
45
+ }, [U]), o(() => {
46
+ O === "inbox" && g.inbox().then((e) => N({
47
+ state: "ready",
48
+ data: e
49
+ }), () => N({ state: "error" }));
50
+ }, [
51
+ O,
52
+ C,
53
+ L
54
+ ]);
55
+ let X = (e) => ne("page" in e ? e.page.url : e.page_url, "page" in e ? e.id : e.thread_id, ie), Z = (e) => h(e, ".ck-item", !0), Q = () => R((e) => e + 1), $ = O === "page" && !J ? {
56
+ state: "ready",
57
+ data: S
58
+ } : A, le = [
59
+ [
60
+ "page",
61
+ "thisPage",
62
+ S.length
63
+ ],
64
+ [
65
+ "all",
66
+ "allPages",
67
+ null
68
+ ],
69
+ [
70
+ "inbox",
71
+ "notifications",
72
+ C || null
73
+ ]
74
+ ];
75
+ return /* @__PURE__ */ a("aside", {
76
+ class: "ck-panel",
77
+ "data-side": y,
78
+ "aria-label": e("inbox"),
79
+ "data-commentkit-ui": !0,
80
+ onKeyDown: (e) => e.key === "Escape" && x(),
81
+ children: [
82
+ /* @__PURE__ */ a("div", {
83
+ class: "ck-card-head",
84
+ children: [
85
+ /* @__PURE__ */ a("span", {
86
+ class: "ck-card-title",
87
+ children: e("inbox")
88
+ }),
89
+ T > 1 ? /* @__PURE__ */ a("span", {
90
+ class: "ck-here",
91
+ role: "status",
92
+ children: [/* @__PURE__ */ a("span", {
93
+ "aria-hidden": "true",
94
+ class: "ck-dot"
95
+ }), n("peopleHere", T)]
96
+ }) : null,
97
+ /* @__PURE__ */ a("button", {
98
+ class: "ck-ghost",
99
+ onClick: x,
100
+ "aria-label": e("close"),
101
+ children: /* @__PURE__ */ a(l, { name: "close" })
102
+ })
103
+ ]
104
+ }),
105
+ /* @__PURE__ */ a("div", {
106
+ class: "ck-tabs",
107
+ role: "tablist",
108
+ ref: q,
109
+ onKeyDown: (e) => h(e, "[role=tab]"),
110
+ children: le.map(([t, n, r]) => /* @__PURE__ */ a("button", {
111
+ role: "tab",
112
+ id: `ck-tab-${t}`,
113
+ "aria-controls": "ck-tabpanel",
114
+ class: "ck-tab",
115
+ "aria-selected": O === t,
116
+ tabIndex: O === t ? 0 : -1,
117
+ onClick: () => k(t),
118
+ onFocus: () => k(t),
119
+ children: [
120
+ e(n),
121
+ " ",
122
+ r ? /* @__PURE__ */ a("span", {
123
+ class: "ck-count",
124
+ children: r
125
+ }) : null
126
+ ]
127
+ }))
128
+ }),
129
+ oe ? null : /* @__PURE__ */ a("div", {
130
+ class: "ck-note",
131
+ "data-tone": "warning",
132
+ role: "status",
133
+ children: e("offline")
134
+ }),
135
+ ae ? /* @__PURE__ */ a("div", {
136
+ class: "ck-note ck-pad-x",
137
+ role: "status",
138
+ children: e("readOnlyShort")
139
+ }) : null,
140
+ D && O !== "inbox" ? /* @__PURE__ */ a("div", {
141
+ class: "ck-branchbar",
142
+ role: "group",
143
+ "aria-label": e("branchFilter"),
144
+ children: [/* @__PURE__ */ a("button", {
145
+ class: "ck-chip",
146
+ "aria-pressed": !w,
147
+ onClick: () => void g.setAllBranches(!1).catch(() => void 0),
148
+ title: D,
149
+ children: e("thisBranch", { branch: b(D) })
150
+ }), /* @__PURE__ */ a("button", {
151
+ class: "ck-chip",
152
+ "aria-pressed": w,
153
+ onClick: () => void g.setAllBranches(!0).catch(() => void 0),
154
+ children: e("allBranches")
155
+ })]
156
+ }) : null,
157
+ O === "inbox" ? null : /* @__PURE__ */ a(p, { children: [
158
+ /* @__PURE__ */ a("div", {
159
+ class: "ck-filters",
160
+ children: [/* @__PURE__ */ a("input", {
161
+ class: "ck-input",
162
+ type: "search",
163
+ "aria-label": e("search"),
164
+ placeholder: e("search"),
165
+ value: P,
166
+ onInput: (e) => F(e.target.value),
167
+ onKeyDown: (e) => e.stopPropagation()
168
+ }), O === "all" ? /* @__PURE__ */ a("select", {
169
+ class: "ck-input",
170
+ "aria-label": e("statusFilter"),
171
+ value: I,
172
+ onChange: (e) => se(e.target.value),
173
+ children: [
174
+ /* @__PURE__ */ a("option", {
175
+ value: "active",
176
+ children: e("status_open")
177
+ }),
178
+ /* @__PURE__ */ a("option", {
179
+ value: "in_review",
180
+ children: e("status_in_review")
181
+ }),
182
+ /* @__PURE__ */ a("option", {
183
+ value: "resolved,closed",
184
+ children: e("status_resolved")
185
+ }),
186
+ /* @__PURE__ */ a("option", {
187
+ value: "all",
188
+ children: e("allStatuses")
189
+ })
190
+ ]
191
+ }) : null]
192
+ }),
193
+ /* @__PURE__ */ a("div", {
194
+ class: "ck-branchbar",
195
+ children: [Y ? /* @__PURE__ */ a("button", {
196
+ class: "ck-chip",
197
+ "aria-pressed": z === "me",
198
+ onClick: () => B(z === "me" ? "" : "me"),
199
+ children: e("assignedToMe")
200
+ }) : null, /* @__PURE__ */ a("button", {
201
+ class: "ck-chip",
202
+ "aria-expanded": U,
203
+ "aria-controls": "ck-more-filters",
204
+ onClick: () => W(!U),
205
+ children: [e("filters"), z || V ? " •" : ""]
206
+ })]
207
+ }),
208
+ U ? /* @__PURE__ */ a("div", {
209
+ class: "ck-filters",
210
+ id: "ck-more-filters",
211
+ children: [Y ? /* @__PURE__ */ a("select", {
212
+ class: "ck-input",
213
+ "aria-label": e("assigneeFilter"),
214
+ value: z,
215
+ onChange: (e) => B(e.target.value),
216
+ children: [
217
+ /* @__PURE__ */ a("option", {
218
+ value: "",
219
+ children: e("anyone")
220
+ }),
221
+ /* @__PURE__ */ a("option", {
222
+ value: "me",
223
+ children: e("assignedToMe")
224
+ }),
225
+ /* @__PURE__ */ a("option", {
226
+ value: "none",
227
+ children: e("unassigned")
228
+ }),
229
+ G.people.map((e) => /* @__PURE__ */ a("option", {
230
+ value: String(e.id),
231
+ children: e.name
232
+ }))
233
+ ]
234
+ }) : null, /* @__PURE__ */ a("select", {
235
+ class: "ck-input",
236
+ "aria-label": e("labelFilter"),
237
+ value: V === null ? "" : String(V),
238
+ onChange: (e) => {
239
+ let t = e.target.value;
240
+ H(t ? Number(t) : null);
241
+ },
242
+ children: [/* @__PURE__ */ a("option", {
243
+ value: "",
244
+ children: e("anyLabel")
245
+ }), G.labels.map((e) => /* @__PURE__ */ a("option", {
246
+ value: String(e.id),
247
+ children: e.name
248
+ }))]
249
+ })]
250
+ }) : null
251
+ ] }),
252
+ /* @__PURE__ */ a("div", {
253
+ class: "ck-card-body",
254
+ id: "ck-tabpanel",
255
+ role: "tabpanel",
256
+ "aria-labelledby": `ck-tab-${O}`,
257
+ style: { padding: 0 },
258
+ "aria-busy": (O === "inbox" ? M : $).state === "loading",
259
+ children: O === "inbox" ? /* @__PURE__ */ a(_, {
260
+ load: M,
261
+ onRetry: Q,
262
+ empty: /* @__PURE__ */ a("strong", { children: e("allCaughtUp") }),
263
+ children: (n) => /* @__PURE__ */ a(p, { children: [/* @__PURE__ */ a("ul", {
264
+ class: "ck-list",
265
+ ref: K,
266
+ onKeyDown: Z,
267
+ children: n.map((e) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("button", {
268
+ class: "ck-item",
269
+ "data-unread": !e.read,
270
+ onClick: () => X(e),
271
+ children: [/* @__PURE__ */ a("div", {
272
+ class: "ck-item-top",
273
+ children: [
274
+ /* @__PURE__ */ a("strong", { children: /* @__PURE__ */ a("bdi", { children: e.actor.name }) }),
275
+ " ",
276
+ v(e.kind),
277
+ e.reference ? ` · ${e.reference}` : "",
278
+ /* @__PURE__ */ a("span", { class: "ck-spacer" }),
279
+ t(e.created_at)
280
+ ]
281
+ }), e.excerpt ? /* @__PURE__ */ a("div", {
282
+ class: "ck-item-text",
283
+ children: e.excerpt
284
+ }) : null]
285
+ }) }))
286
+ }), C ? /* @__PURE__ */ a("div", {
287
+ class: "ck-pad",
288
+ children: /* @__PURE__ */ a("button", {
289
+ class: "ck-btn",
290
+ onClick: () => void g.markRead({ all: !0 }).then(Q),
291
+ children: e("markAllRead")
292
+ })
293
+ }) : null] })
294
+ }) : /* @__PURE__ */ a(_, {
295
+ load: $,
296
+ onRetry: Q,
297
+ empty: /* @__PURE__ */ a(p, { children: [/* @__PURE__ */ a("strong", { children: e("nothingHere") }), e("nothingHereHint")] }),
298
+ children: (r) => /* @__PURE__ */ a("ul", {
299
+ class: "ck-list",
300
+ ref: K,
301
+ onKeyDown: Z,
302
+ children: r.map((r) => {
303
+ let o = O === "page" && i(r.anchor).state === "detached", s = o ? c(r.capture?.screenshot?.thumbnail_url, "image") : null;
304
+ return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("button", {
305
+ class: "ck-item",
306
+ onClick: () => X(r),
307
+ children: [
308
+ /* @__PURE__ */ a("div", {
309
+ class: "ck-item-top",
310
+ children: [
311
+ /* @__PURE__ */ a("strong", { children: r.reference }),
312
+ /* @__PURE__ */ a(ee, { status: r.status }),
313
+ d(r) ? /* @__PURE__ */ a("span", {
314
+ class: "ck-badge-soft",
315
+ title: `${e(`screen_${f(r.breakpoint)}`)} (${r.breakpoint}px)`,
316
+ children: e(`size_${f(r.breakpoint)}`)
317
+ }) : null,
318
+ o ? /* @__PURE__ */ a("span", {
319
+ class: "ck-badge-soft",
320
+ title: e("detached"),
321
+ children: e("notOnPage")
322
+ }) : null,
323
+ /* @__PURE__ */ a("span", { class: "ck-spacer" }),
324
+ t(r.last_activity_at)
325
+ ]
326
+ }),
327
+ /* @__PURE__ */ a("div", {
328
+ class: "ck-item-text",
329
+ children: r.first_message?.body
330
+ }),
331
+ s ? /* @__PURE__ */ a("img", {
332
+ class: "ck-item-shot",
333
+ src: s,
334
+ alt: e("screenshot"),
335
+ loading: "lazy"
336
+ }) : null,
337
+ /* @__PURE__ */ a("div", {
338
+ class: "ck-muted",
339
+ children: [
340
+ /* @__PURE__ */ a("bdi", { children: r.author.name }),
341
+ O === "all" ? /* @__PURE__ */ a(p, { children: [" · ", /* @__PURE__ */ a("bdi", { children: r.page.title || r.page.path })] }) : "",
342
+ " · ",
343
+ n("messageCount", r.message_count),
344
+ w && r.page.branch && r.page.branch !== D ? ` · ${e("onBranch", { branch: b(r.page.branch) })}` : ""
345
+ ]
346
+ })
347
+ ]
348
+ }) });
349
+ })
350
+ })
351
+ })
352
+ })
353
+ ]
354
+ });
355
+ }
356
+ function _({ load: t, onRetry: n, empty: r, children: i }) {
357
+ return t.state === "loading" ? /* @__PURE__ */ a("div", {
358
+ class: "ck-empty",
359
+ role: "status",
360
+ children: e("loadingEarlier")
361
+ }) : t.state === "error" ? /* @__PURE__ */ a("div", {
362
+ class: "ck-empty",
363
+ role: "alert",
364
+ children: [e("loadFailed"), /* @__PURE__ */ a("button", {
365
+ class: "ck-btn",
366
+ onClick: n,
367
+ children: e("retry")
368
+ })]
369
+ }) : t.data.length ? /* @__PURE__ */ a(p, { children: i(t.data) }) : /* @__PURE__ */ a("div", {
370
+ class: "ck-empty",
371
+ children: r
372
+ });
373
+ }
374
+ function v(t) {
375
+ let n = `kind_${t}`;
376
+ return /^kind_[a-z_]+$/.test(n) && n in y ? e(n) : t.replace(/_/g, " ");
377
+ }
378
+ var y = {
379
+ kind_mention: !0,
380
+ kind_reply: !0,
381
+ kind_assigned: !0,
382
+ kind_ready_for_review: !0,
383
+ kind_reopened: !0,
384
+ kind_resolved: !0,
385
+ kind_closed: !0,
386
+ kind_new_feedback: !0,
387
+ kind_due_soon: !0,
388
+ kind_overdue: !0,
389
+ kind_agent_request: !0
390
+ };
391
+ function b(e) {
392
+ return e.length > 28 ? `${e.slice(0, 27)}…` : e;
393
+ }
394
+ function re(e, t, n, r) {
395
+ let i = e.assignee;
396
+ 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;
397
+ }
398
+ //#endregion
399
+ export { g as Panel };
@@ -0,0 +1,56 @@
1
+ import { a as e } from "./src-DujplxfI.js";
2
+ import { d as t, f as n, n as r, p as i } from "./format-Bw_tNOh9.js";
3
+ //#region src/ui/Shortcuts.tsx
4
+ var a = [
5
+ ["C", "shortcutComment"],
6
+ ["J / K", "shortcutNext"],
7
+ ["E", "shortcutResolve"],
8
+ ["Esc", "shortcutClose"],
9
+ ["⌘ / Ctrl + Enter", "shortcutSend"],
10
+ ["⌘ / Ctrl + Shift + K", "shortcutToggle"],
11
+ ["?", "shortcutHelp"]
12
+ ];
13
+ function o({ onClose: o }) {
14
+ let s = i(null);
15
+ return n(() => {
16
+ let e = s.current?.getRootNode()?.activeElement ?? document.activeElement;
17
+ return s.current?.focus({ preventScroll: !0 }), () => {
18
+ e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
19
+ };
20
+ }, []), /* @__PURE__ */ t("div", {
21
+ class: "ck-scrim",
22
+ "data-commentkit-ui": !0,
23
+ onClick: (e) => e.target === e.currentTarget && o(),
24
+ children: /* @__PURE__ */ t("div", {
25
+ class: "ck-card ck-dialog",
26
+ role: "dialog",
27
+ "aria-modal": "true",
28
+ "aria-labelledby": "ck-shortcuts-title",
29
+ onKeyDown: (e) => {
30
+ e.stopPropagation(), e.key === "Escape" || e.key === "?" ? (e.preventDefault(), o()) : e.key === "Tab" && (e.preventDefault(), s.current?.focus());
31
+ },
32
+ children: [/* @__PURE__ */ t("div", {
33
+ class: "ck-card-head",
34
+ children: [/* @__PURE__ */ t("h2", {
35
+ class: "ck-card-title",
36
+ id: "ck-shortcuts-title",
37
+ children: e("shortcutsTitle")
38
+ }), /* @__PURE__ */ t("button", {
39
+ class: "ck-ghost",
40
+ ref: s,
41
+ "aria-label": e("close"),
42
+ onClick: o,
43
+ children: /* @__PURE__ */ t(r, { name: "close" })
44
+ })]
45
+ }), /* @__PURE__ */ t("dl", {
46
+ class: "ck-card-body ck-keys",
47
+ children: a.map(([n, r]) => /* @__PURE__ */ t("div", { children: [/* @__PURE__ */ t("dt", { children: /* @__PURE__ */ t("kbd", {
48
+ dir: "ltr",
49
+ children: n
50
+ }) }), /* @__PURE__ */ t("dd", { children: e(r) })] }))
51
+ })]
52
+ })
53
+ });
54
+ }
55
+ //#endregion
56
+ export { o as Shortcuts };