@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.
Files changed (137) hide show
  1. package/CHANGELOG.md +298 -590
  2. package/README.md +421 -145
  3. package/SECURITY.md +47 -46
  4. package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
  5. package/dist/node/browser.js +17 -0
  6. package/dist/node/cli/api.js +226 -0
  7. package/dist/node/cli/bin.js +18 -0
  8. package/dist/node/cli/credentials.js +268 -0
  9. package/dist/node/cli/doctor.js +789 -0
  10. package/dist/node/cli/format.js +54 -0
  11. package/dist/node/cli/init.js +686 -0
  12. package/dist/node/cli/main.js +537 -0
  13. package/dist/node/cli/mcp.js +295 -0
  14. package/dist/node/cli/open.js +20 -0
  15. package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
  16. package/dist/node/plugins/astro.js +26 -0
  17. package/dist/node/plugins/git-BIXLbL3f.js +92 -0
  18. package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
  19. package/dist/node/plugins/next.js +48 -0
  20. package/dist/node/plugins/options-THop1K92.js +71 -0
  21. package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
  22. package/dist/node/plugins/vite-BdAYUW10.js +74 -0
  23. package/dist/node/plugins/vite.js +1 -0
  24. package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
  25. package/dist/node/plugins/webpack-loader.cjs +21 -0
  26. package/dist/node/plugins/webpack-loader.js +18 -0
  27. package/dist/node/plugins/webpack.js +1 -0
  28. package/dist/node/shared/dashboard-places.js +33 -0
  29. package/dist/node/shared/endpoint.js +26 -0
  30. package/dist/node/shared/format.js +63 -0
  31. package/dist/node/types/astro.d.ts +11 -0
  32. package/dist/node/types/next.d.ts +34 -0
  33. package/dist/node/types/options.d.ts +59 -0
  34. package/dist/node/types/vite.d.ts +11 -0
  35. package/dist/node/types/webpack-loader.d.ts +22 -0
  36. package/dist/node/types/webpack.d.ts +27 -0
  37. package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
  38. package/dist/npm/chunks/AgentSend-DOy3jhyF.js +68 -0
  39. package/dist/npm/chunks/Checklist-CW_SwMpS.js +282 -0
  40. package/dist/npm/chunks/Composer-Bveq5QrK.js +727 -0
  41. package/dist/npm/chunks/Guest-7hcN765o.js +270 -0
  42. package/dist/npm/chunks/MarkupEditor-6bJGpWGO.js +345 -0
  43. package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
  44. package/dist/npm/chunks/Settings-CB5eEKnf.js +231 -0
  45. package/dist/npm/chunks/Shortcuts-eAyjJ89P.js +62 -0
  46. package/dist/npm/chunks/StyleEditor-CZTdAA5c.js +46 -0
  47. package/dist/npm/chunks/StylePanel-B4pHQUL9.js +199 -0
  48. package/dist/npm/chunks/TaskFields-C8BX0Sgg.js +289 -0
  49. package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
  50. package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
  51. package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-MTQHr9ei.js} +9 -9
  52. package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
  53. package/dist/npm/chunks/{ar-8tPch6W4.js → ar-L5cQ-NPe.js} +71 -19
  54. package/dist/npm/chunks/card-bits-CTdrkYn8.js +53 -0
  55. package/dist/npm/chunks/{client-EFTWxHbJ.js → client-7eVxvg5j.js} +282 -290
  56. package/dist/npm/chunks/confetti-BIs5s14P.js +49 -0
  57. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  58. package/dist/npm/chunks/context-Cf6khm7A.js +20 -0
  59. package/dist/npm/chunks/{de-C63897uD.js → de-D0C-v6tP.js} +62 -18
  60. package/dist/npm/chunks/dialog-DvdIkCW0.js +3 -0
  61. package/dist/npm/chunks/dpop-0A76OPa9.js +96 -0
  62. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  63. package/dist/npm/chunks/{es-CI2bSpvB.js → es-Bw4Dj9tN.js} +62 -18
  64. package/dist/npm/chunks/extension-DFVOvciD.js +62 -0
  65. package/dist/npm/chunks/{extension-BST6LH1q.js → extension-SmoH5AA4.js} +20 -12
  66. package/dist/npm/chunks/files-4lV9YQIX.js +114 -0
  67. package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-TkuQaIAa.js} +120 -76
  68. package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-DXSH2U8d.js} +63 -19
  69. package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-aVSu9TcJ.js} +136 -92
  70. package/dist/npm/chunks/identify-BGYh2dVo.js +106 -0
  71. package/dist/npm/chunks/{it-C8tnV0BF.js → it-CiWA_bch.js} +81 -37
  72. package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-C-QmR3yz.js} +60 -16
  73. package/dist/npm/chunks/late-words-80_VWt8S.js +14 -0
  74. package/dist/npm/chunks/live-BExWHzQ7.js +85 -0
  75. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  76. package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-CEmZRqjX.js} +63 -19
  77. package/dist/npm/chunks/page-key-HSY3Lze5.js +62 -0
  78. package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-B3sR7jtS.js} +45 -44
  79. package/dist/npm/chunks/pkce-CfZhiNBi.js +8 -0
  80. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  81. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  82. package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-b-a8sxO8.js} +62 -18
  83. package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
  84. package/dist/npm/chunks/report-DaVuoRYS.js +44 -0
  85. package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
  86. package/dist/npm/chunks/signin-BOWr_WCo.js +75 -0
  87. package/dist/npm/chunks/{source-CS7C6wJA.js → source-mk3rGBBQ.js} +1 -1
  88. package/dist/npm/chunks/src-C8rZFyL_.js +215 -0
  89. package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
  90. package/dist/npm/chunks/states-b9Bv3Ci7.js +3 -0
  91. package/dist/npm/chunks/upload-B2mkgMeJ.js +42 -0
  92. package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
  93. package/dist/npm/chunks/wrap-DW6EFbVQ.js +69 -0
  94. package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-JTscW8u8.js} +61 -17
  95. package/dist/npm/element.js +58 -21
  96. package/dist/npm/headless.js +7 -3
  97. package/dist/npm/index.js +3 -3
  98. package/dist/npm/react.js +18 -11
  99. package/dist/npm/svelte.js +28 -12
  100. package/dist/npm/types/adapters/react.d.ts +4 -1
  101. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  102. package/dist/npm/types/adapters/vue.d.ts +35 -2
  103. package/dist/npm/types/anchor/index.d.ts +19 -0
  104. package/dist/npm/types/capture/privacy.d.ts +14 -0
  105. package/dist/npm/types/core/api.d.ts +20 -1
  106. package/dist/npm/types/core/auth.d.ts +40 -21
  107. package/dist/npm/types/core/client.d.ts +60 -4
  108. package/dist/npm/types/core/page-key.d.ts +42 -0
  109. package/dist/npm/types/core/types.d.ts +87 -4
  110. package/dist/npm/types/element.d.ts +17 -7
  111. package/dist/npm/types/headless.d.ts +2 -1
  112. package/dist/npm/types/index.d.ts +16 -6
  113. package/dist/npm/vue.js +44 -9
  114. package/package.json +90 -14
  115. package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
  116. package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
  117. package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
  118. package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
  119. package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
  120. package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
  121. package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
  122. package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
  123. package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
  124. package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
  125. package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
  126. package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
  127. package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
  128. package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
  129. package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
  130. package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
  131. package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
  132. package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
  133. package/dist/npm/chunks/report-BBrT3r89.js +0 -27
  134. package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
  135. package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
  136. package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
  137. package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
@@ -1,204 +0,0 @@
1
- import { a as e } from "./client-EFTWxHbJ.js";
2
- import { _ as t, f as n, l as r, m as i, n as a, s as o, u as s } from "./i18n-C4v0M-6z.js";
3
- import { C as c, a as l, f as u, l as d, n as f } from "./start-i9M-r3aH.js";
4
- // src/ui/Settings.tsx
5
- f(".ck-settings{width:min(380px,100vw - 24px)}.ck-settings .ck-card-body{gap:16px;display:grid}.ck-account{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);align-items:center;gap:12px;padding:12px;display:flex}.ck-account .ck-avatar{width:40px;height:40px;font-size:14px}.ck-account>div{gap:1px;min-width:0;font-size:12.5px;display:grid}.ck-account .ck-muted{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ck-setting h3{letter-spacing:.02em;text-transform:uppercase;color:var(--ck-text-muted);margin:0 0 8px;font-size:12px;font-weight:650}.ck-setting-hint{margin:6px 0 0;font-size:12px}.ck-segment{background:var(--ck-bg-muted);border-radius:10px;grid-template-columns:repeat(3,1fr);gap:2px;padding:3px;display:grid}.ck-segment button{height:30px;color:var(--ck-text-muted);background:0 0;border:0;border-radius:8px;font-size:13px;font-weight:600;transition:background-color .12s,color .12s,box-shadow .12s}.ck-segment button[aria-checked=true]{background:var(--ck-bg);color:var(--ck-text);box-shadow:var(--ck-shadow-sm)}.ck-setting-links{border-top:1px solid var(--ck-hairline);gap:2px;padding-top:8px;display:grid}.ck-setting-links a,.ck-setting-links button{border-radius:var(--ck-radius-sm);width:100%;color:var(--ck-text);text-align:start;background:0 0;border:0;align-items:center;gap:10px;padding:8px 10px;font-size:13.5px;text-decoration:none;display:flex}.ck-setting-links svg{color:var(--ck-text-muted);flex:none}.ck-setting-links .ck-danger{color:var(--ck-danger)}.ck-setting-links .ck-danger svg{color:currentColor}@media (hover:hover){.ck-setting-links a:hover,.ck-setting-links button:hover{background:var(--ck-bg-hover)}.ck-segment button:hover{color:var(--ck-text)}}@media (pointer:coarse){.ck-segment button{height:40px}.ck-setting-links a,.ck-setting-links button{min-height:44px}}.ck-team{gap:2px;margin:0;padding:0;list-style:none;display:grid}.ck-team li{align-items:center;gap:8px;padding:4px 0;font-size:13px;display:flex}.ck-team-face{display:inline-flex;position:relative}.ck-team-face .ck-avatar{width:24px;height:24px;font-size:10px}.ck-online{background:var(--ck-success);width:8px;height:8px;box-shadow:0 0 0 2px var(--ck-bg);border-radius:50%;position:absolute;bottom:-1px}.ck-online:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:-1px}.ck-online:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){right:-1px}.ck-online:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:-1px}.ck-online:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){left:-1px}.ck-team-role{margin-inline-start:auto;font-size:12px}.ck-meter{background:var(--ck-bg-muted);height:6px;box-shadow:inset 0 0 0 1px var(--ck-hairline);border-radius:3px;overflow:hidden}.ck-meter>span{background:var(--ck-accent);height:100%;transition:width .3s var(--ck-ease);border-radius:3px;display:block}.ck-meter>span[data-high]{background:var(--ck-warning)}");
6
- var p = [
7
- ["auto", "themeSystem"],
8
- ["light", "themeLight"],
9
- ["dark", "themeDark"]
10
- ];
11
- function m({ client: a, onClose: f, onShortcuts: m, onHide: g, onSignOut: _ }) {
12
- let v = l(a.state, (e) => e.session), y = l(a.state, (e) => e.theme ?? a.options.theme ?? e.config?.appearance?.theme ?? "auto"), b = n(null), x = l(a.state, (e) => e.team), S = v?.role === "admin" || v?.role === "member", [C, w] = i(null), [T, E] = i(null);
13
- s(() => {
14
- S && (a.people().then((e) => w(e.filter((e) => e.role && e.role !== "reviewer")), () => w([])), a.usage().then(E, () => E(null)));
15
- }, [S]), s(() => {
16
- let e = b.current?.getRootNode()?.activeElement ?? document.activeElement;
17
- return b.current?.focus({ preventScroll: !0 }), () => {
18
- e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
19
- };
20
- }, []);
21
- let D = (t) => {
22
- e(t), a.state.set({ theme: t });
23
- }, O = c(v?.dashboard_url), k = C?.find((e) => e.id === v?.person.id)?.role, A = v ? o(`role_${k === "owner" ? "owner" : v.role}`) : "";
24
- return /* @__PURE__ */ r("div", {
25
- class: "ck-scrim",
26
- "data-commentkit-ui": !0,
27
- onClick: (e) => e.target === e.currentTarget && f(),
28
- children: /* @__PURE__ */ r("div", {
29
- class: "ck-card ck-dialog ck-settings",
30
- role: "dialog",
31
- "aria-modal": "true",
32
- "aria-labelledby": "ck-settings-title",
33
- onKeyDown: (e) => {
34
- e.stopPropagation(), e.key === "Escape" && f();
35
- },
36
- children: [/* @__PURE__ */ r("div", {
37
- class: "ck-card-head",
38
- children: [/* @__PURE__ */ r("h2", {
39
- class: "ck-card-title",
40
- id: "ck-settings-title",
41
- children: o("settings")
42
- }), /* @__PURE__ */ r("button", {
43
- class: "ck-ghost",
44
- ref: b,
45
- "aria-label": o("close"),
46
- onClick: f,
47
- children: /* @__PURE__ */ r(u, { name: "close" })
48
- })]
49
- }), /* @__PURE__ */ r("div", {
50
- class: "ck-card-body",
51
- children: [
52
- v ? /* @__PURE__ */ r("section", {
53
- class: "ck-account",
54
- "aria-label": o("account"),
55
- children: [/* @__PURE__ */ r(d, { person: v.person }), /* @__PURE__ */ r("div", { children: [
56
- /* @__PURE__ */ r("bdi", {
57
- class: "ck-msg-name",
58
- children: v.person.name
59
- }),
60
- v.email ? /* @__PURE__ */ r("div", {
61
- class: "ck-muted",
62
- children: /* @__PURE__ */ r("bdi", { children: v.email })
63
- }) : null,
64
- /* @__PURE__ */ r("div", {
65
- class: "ck-muted",
66
- children: [
67
- /* @__PURE__ */ r("bdi", { children: v.project.name }),
68
- " · ",
69
- A
70
- ]
71
- })
72
- ] })]
73
- }) : null,
74
- /* @__PURE__ */ r("section", {
75
- class: "ck-setting",
76
- children: [
77
- /* @__PURE__ */ r("h3", {
78
- id: "ck-theme-label",
79
- children: o("appearance")
80
- }),
81
- /* @__PURE__ */ r("div", {
82
- class: "ck-segment",
83
- role: "radiogroup",
84
- "aria-labelledby": "ck-theme-label",
85
- children: p.map(([e, t]) => /* @__PURE__ */ r("button", {
86
- role: "radio",
87
- "aria-checked": y === e,
88
- onClick: () => D(e),
89
- children: o(t)
90
- }))
91
- }),
92
- /* @__PURE__ */ r("p", {
93
- class: "ck-muted ck-setting-hint",
94
- children: o("appearanceHint")
95
- })
96
- ]
97
- }),
98
- S && C?.length ? /* @__PURE__ */ r("section", {
99
- class: "ck-setting",
100
- children: [/* @__PURE__ */ r("h3", { children: o("team") }), /* @__PURE__ */ r("ul", {
101
- class: "ck-team",
102
- children: C.map((e) => /* @__PURE__ */ r("li", { children: [
103
- /* @__PURE__ */ r("span", {
104
- class: "ck-team-face",
105
- children: [/* @__PURE__ */ r(d, { person: e }), x.some((t) => t.id === e.id) ? /* @__PURE__ */ r("span", {
106
- class: "ck-online",
107
- "aria-label": o("online")
108
- }) : null]
109
- }),
110
- /* @__PURE__ */ r("bdi", { children: e.name }),
111
- e.id === v?.person.id ? /* @__PURE__ */ r("span", {
112
- class: "ck-muted",
113
- children: [
114
- "(",
115
- o("you"),
116
- ")"
117
- ]
118
- }) : null,
119
- /* @__PURE__ */ r("span", {
120
- class: "ck-muted ck-team-role",
121
- children: o(`role_${e.role === "owner" ? "owner" : e.role === "admin" ? "admin" : "member"}`)
122
- })
123
- ] }))
124
- })]
125
- }) : null,
126
- S && T ? /* @__PURE__ */ r("section", {
127
- class: "ck-setting",
128
- children: [/* @__PURE__ */ r("h3", { children: o("storage") }), T.limit_bytes ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
129
- class: "ck-meter",
130
- role: "meter",
131
- "aria-valuemin": 0,
132
- "aria-valuemax": T.limit_bytes,
133
- "aria-valuenow": T.used_bytes,
134
- "aria-label": o("storage"),
135
- children: /* @__PURE__ */ r("span", {
136
- style: { width: `${Math.min(100, Math.round(T.used_bytes / T.limit_bytes * 100))}%` },
137
- "data-high": T.used_bytes / T.limit_bytes > .85 || void 0
138
- })
139
- }), /* @__PURE__ */ r("p", {
140
- class: "ck-muted ck-setting-hint",
141
- children: o("storageUsed", {
142
- used: h(T.used_bytes),
143
- limit: h(T.limit_bytes)
144
- })
145
- })] }) : /* @__PURE__ */ r("p", {
146
- class: "ck-muted ck-setting-hint",
147
- children: o("storageUsedOnly", { used: h(T.used_bytes) })
148
- })]
149
- }) : null,
150
- /* @__PURE__ */ r("nav", {
151
- class: "ck-setting-links",
152
- "aria-label": o("settings"),
153
- children: [
154
- O ? /* @__PURE__ */ r("a", {
155
- href: O,
156
- target: "_blank",
157
- rel: "noopener noreferrer",
158
- children: [/* @__PURE__ */ r(u, {
159
- name: "link",
160
- size: 15
161
- }), o("openDashboard")]
162
- }) : null,
163
- m ? /* @__PURE__ */ r("button", {
164
- onClick: () => (f(), m()),
165
- children: [/* @__PURE__ */ r(u, {
166
- name: "info",
167
- size: 15
168
- }), o("shortcutsTitle")]
169
- }) : null,
170
- /* @__PURE__ */ r("button", {
171
- onClick: g,
172
- children: [/* @__PURE__ */ r(u, {
173
- name: "close",
174
- size: 15
175
- }), o("hideWidget")]
176
- }),
177
- v ? /* @__PURE__ */ r("button", {
178
- class: "ck-danger",
179
- onClick: () => (f(), _()),
180
- children: [/* @__PURE__ */ r(u, {
181
- name: "user",
182
- size: 15
183
- }), o("signOut")]
184
- }) : null
185
- ]
186
- })
187
- ]
188
- })]
189
- })
190
- });
191
- }
192
- function h(e) {
193
- let [t, n] = e >= 1e9 ? [e / 1e9, "gigabyte"] : e >= 1e6 ? [e / 1e6, "megabyte"] : [e / 1e3, "kilobyte"];
194
- try {
195
- return new Intl.NumberFormat(a(), {
196
- style: "unit",
197
- unit: n,
198
- maximumFractionDigits: +(t < 10)
199
- }).format(t);
200
- } catch {
201
- return `${t.toFixed(1)} ${n === "gigabyte" ? "GB" : n === "megabyte" ? "MB" : "KB"}`;
202
- }
203
- }
204
- export { m as Settings };
@@ -1,58 +0,0 @@
1
- import { f as e, l as t, s as n, u as r } from "./i18n-C4v0M-6z.js";
2
- import { f as i, n as a } from "./start-i9M-r3aH.js";
3
- // src/ui/Shortcuts.tsx
4
- a(".ck-keys{gap:10px;margin:0;display:grid}.ck-keys div{grid-template-columns:minmax(96px,auto) 1fr;align-items:baseline;gap:12px;display:grid}.ck-keys dd{color:var(--ck-text-muted);margin:0}");
5
- var o = [
6
- ["C", "shortcutComment"],
7
- ["J / K", "shortcutNext"],
8
- ["E", "shortcutResolve"],
9
- ["Esc", "shortcutClose"],
10
- ["Enter", "shortcutSend"],
11
- ["Shift + Enter", "shortcutNewLine"],
12
- ["⌘ / Ctrl + B · I · E", "shortcutFormat"],
13
- ["⌘ / Ctrl + Shift + K", "shortcutToggle"],
14
- ["?", "shortcutHelp"]
15
- ];
16
- function s({ onClose: a }) {
17
- let s = e(null);
18
- return r(() => {
19
- let e = s.current?.getRootNode()?.activeElement ?? document.activeElement;
20
- return s.current?.focus({ preventScroll: !0 }), () => {
21
- e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
22
- };
23
- }, []), /* @__PURE__ */ t("div", {
24
- class: "ck-scrim",
25
- "data-commentkit-ui": !0,
26
- onClick: (e) => e.target === e.currentTarget && a(),
27
- children: /* @__PURE__ */ t("div", {
28
- class: "ck-card ck-dialog",
29
- role: "dialog",
30
- "aria-modal": "true",
31
- "aria-labelledby": "ck-shortcuts-title",
32
- onKeyDown: (e) => {
33
- e.stopPropagation(), e.key === "Escape" || e.key === "?" ? (e.preventDefault(), a()) : e.key === "Tab" && (e.preventDefault(), s.current?.focus());
34
- },
35
- children: [/* @__PURE__ */ t("div", {
36
- class: "ck-card-head",
37
- children: [/* @__PURE__ */ t("h2", {
38
- class: "ck-card-title",
39
- id: "ck-shortcuts-title",
40
- children: n("shortcutsTitle")
41
- }), /* @__PURE__ */ t("button", {
42
- class: "ck-ghost",
43
- ref: s,
44
- "aria-label": n("close"),
45
- onClick: a,
46
- children: /* @__PURE__ */ t(i, { name: "close" })
47
- })]
48
- }), /* @__PURE__ */ t("dl", {
49
- class: "ck-card-body ck-keys",
50
- children: o.map(([e, r]) => /* @__PURE__ */ t("div", { children: [/* @__PURE__ */ t("dt", { children: /* @__PURE__ */ t("kbd", {
51
- dir: "ltr",
52
- children: e
53
- }) }), /* @__PURE__ */ t("dd", { children: n(r) })] }))
54
- })]
55
- })
56
- });
57
- }
58
- export { s as Shortcuts };
@@ -1,43 +0,0 @@
1
- import { d as e, f as t, l as n, m as r, s as i } from "./i18n-C4v0M-6z.js";
2
- import { a, i as o, o as s } from "./uploads-I01kdqQF.js";
3
- import { StylePanel as c } from "./StylePanel-Iwhce2tE.js";
4
- // src/ui/StyleEditor.tsx
5
- function l({ client: l, thread: u, element: d, onSaved: f, onClose: p, onError: m }) {
6
- let [h] = r(() => {
7
- let e = s(d);
8
- for (let t of a(u.style_changes)) t.from && (e[t.property] = t.from);
9
- return e;
10
- }), [g, _] = r(() => a(u.style_changes)), [v, y] = r(!1), b = t(null);
11
- e(() => {
12
- let e = new o(d);
13
- return b.current = e, () => e.revert();
14
- }, [d]), e(() => b.current?.apply(g), [g]);
15
- let x = async () => {
16
- y(!0);
17
- try {
18
- f(await l.updateThread(u.id, { style_changes: a(g) })), p();
19
- } catch (e) {
20
- y(!1), m(e);
21
- }
22
- };
23
- return /* @__PURE__ */ n(c, {
24
- base: h,
25
- changes: g,
26
- onChange: _,
27
- onClose: p,
28
- actions: /* @__PURE__ */ n("span", {
29
- class: "ck-style-actions",
30
- children: [/* @__PURE__ */ n("button", {
31
- class: "ck-ghost ck-ghost-sm",
32
- onClick: p,
33
- children: i("cancel")
34
- }), /* @__PURE__ */ n("button", {
35
- class: "ck-btn ck-primary ck-style-done",
36
- disabled: v,
37
- onClick: () => void x(),
38
- children: i("save")
39
- })]
40
- })
41
- });
42
- }
43
- export { l as StyleEditor };
@@ -1,197 +0,0 @@
1
- import { _ as e, l as t, m as n, s as r, u as i } from "./i18n-C4v0M-6z.js";
2
- import { r as a, s as o } from "./uploads-I01kdqQF.js";
3
- import { n as s } from "./start-i9M-r3aH.js";
4
- // src/ui/StylePanel.tsx
5
- s(".ck-style-panel{border-radius:var(--ck-radius-md);background:var(--ck-bg-muted);box-shadow:0 0 0 1px var(--ck-hairline);margin-top:8px;padding:8px 10px 10px}.ck-style-head{justify-content:space-between;align-items:center;gap:8px;font-size:13px;display:flex}.ck-style-done{height:26px;padding:0 10px;font-size:12px}.ck-style-actions{align-items:center;gap:4px;display:flex}.ck-style-hint{margin:4px 0 6px;font-size:12px;line-height:1.4}.ck-style-rows{overscroll-behavior:contain;gap:2px;max-height:236px;margin-inline-start:-4px;margin-inline-end:-4px;padding-inline-start:4px;padding-inline-end:4px;display:grid;overflow:auto}.ck-style-row{border-radius:var(--ck-radius-sm);grid-template-columns:minmax(96px,40%) 1fr;align-items:center;column-gap:8px;min-height:30px;padding:2px 4px;display:grid}.ck-style-row[data-changed]{background:color-mix(in srgb, var(--ck-accent) 10%, transparent)}.ck-style-row .ck-error{grid-column:2}.ck-style-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ck-text-muted);font-size:12px;overflow:hidden}.ck-style-name code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11.5px}.ck-style-row[data-changed] .ck-style-name{color:var(--ck-text)}.ck-style-control{align-items:center;gap:2px;min-width:0;display:flex}.ck-style-control .ck-style-input{flex:1;width:auto;min-width:0;height:26px;padding:0 7px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}.ck-style-control .ck-style-input[aria-invalid=true]{border-color:var(--ck-danger)}.ck-style-control .ck-ghost{flex:none;place-items:center;width:22px;height:22px;min-height:0;padding:0;font-size:14px;line-height:1;display:grid}.ck-style-steps{flex:none;display:flex}.ck-style-swatch{width:18px;height:18px;box-shadow:inset 0 0 0 1px var(--ck-hairline), 0 0 0 1px var(--ck-border);border-radius:50%;flex:none;margin-inline-end:4px}@media (pointer:coarse){.ck-style-control .ck-style-input{height:32px;font-size:16px}.ck-style-control .ck-ghost{width:30px;height:30px}}");
6
- function c({ base: e, changes: n, onChange: i, onClose: o, actions: s }) {
7
- let c = (t, r) => {
8
- let a = n.filter((e) => e.property !== t);
9
- if (r !== null && r === e[t]) return i(a);
10
- let o = {
11
- property: t,
12
- from: e[t] || null,
13
- to: r
14
- }, s = n.findIndex((e) => e.property === t);
15
- i(s === -1 ? [...n, o] : n.map((e, t) => t === s ? o : e));
16
- };
17
- return /* @__PURE__ */ t("div", {
18
- class: "ck-style-panel",
19
- role: "group",
20
- "aria-label": r("adjustStyle"),
21
- onKeyDown: (e) => {
22
- e.stopPropagation(), e.key === "Escape" && o();
23
- },
24
- children: [
25
- /* @__PURE__ */ t("div", {
26
- class: "ck-style-head",
27
- children: [/* @__PURE__ */ t("strong", { children: r("adjustStyle") }), s ?? /* @__PURE__ */ t("button", {
28
- class: "ck-btn ck-style-done",
29
- onClick: o,
30
- children: r("styleDone")
31
- })]
32
- }),
33
- /* @__PURE__ */ t("p", {
34
- class: "ck-muted ck-style-hint",
35
- children: r("adjustStyleHint")
36
- }),
37
- /* @__PURE__ */ t("div", {
38
- class: "ck-style-rows",
39
- children: a.map(({ property: r, kind: a, options: o }) => {
40
- let s = n.find((e) => e.property === r);
41
- return /* @__PURE__ */ t(l, {
42
- property: r,
43
- kind: a,
44
- options: o,
45
- base: e[r] ?? "",
46
- value: s ? s.to : e[r] ?? "",
47
- changed: !!s,
48
- onSet: (e) => c(r, e),
49
- onReset: () => i(n.filter((e) => e.property !== r))
50
- }, r);
51
- })
52
- })
53
- ]
54
- });
55
- }
56
- function l({ property: a, kind: s, options: c, base: l, value: f, changed: p, onSet: m, onReset: h }) {
57
- let [g, _] = n(f ?? ""), [v, y] = n(!1);
58
- i(() => {
59
- _(f ?? ""), y(!1);
60
- }, [f]);
61
- let b = `ck-style-${a}`, x = (e) => {
62
- let t = e.trim();
63
- _(e);
64
- let n = t !== "" && o(t);
65
- y(t !== "" && !n), n && m(t);
66
- }, S = (e, t = !1) => {
67
- let n = s === "choice" ? d(c ?? [], f ?? l, e) : u(a, f ?? l, e * (t ? 10 : 1));
68
- n !== null && m(n);
69
- };
70
- return /* @__PURE__ */ t("div", {
71
- class: "ck-style-row",
72
- "data-changed": p || void 0,
73
- children: [
74
- /* @__PURE__ */ t("label", {
75
- for: b,
76
- class: "ck-style-name",
77
- children: /* @__PURE__ */ t("code", { children: a })
78
- }),
79
- /* @__PURE__ */ t("div", {
80
- class: "ck-style-control",
81
- children: [
82
- /* @__PURE__ */ t(e, { children: [
83
- s === "color" ? /* @__PURE__ */ t("span", {
84
- class: "ck-style-swatch",
85
- "aria-hidden": "true",
86
- style: { backgroundColor: f ?? l ?? "transparent" }
87
- }) : null,
88
- /* @__PURE__ */ t("input", {
89
- id: b,
90
- class: "ck-input ck-style-input",
91
- type: "text",
92
- spellcheck: !1,
93
- autoComplete: "off",
94
- maxLength: 120,
95
- value: g,
96
- placeholder: f === null ? r("styleRemoved") : "",
97
- "aria-invalid": v,
98
- "aria-describedby": v ? `${b}-error` : void 0,
99
- onInput: (e) => x(e.target.value),
100
- onKeyDown: (e) => {
101
- s !== "color" && s !== "box" && (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), S(e.key === "ArrowUp" ? 1 : -1, e.shiftKey));
102
- }
103
- }),
104
- s === "length" || s === "number" ? /* @__PURE__ */ t("span", {
105
- class: "ck-style-steps",
106
- children: [/* @__PURE__ */ t("button", {
107
- class: "ck-ghost ck-ghost-sm",
108
- "aria-label": r("styleDecrease", { property: a }),
109
- onClick: () => S(-1),
110
- children: "−"
111
- }), /* @__PURE__ */ t("button", {
112
- class: "ck-ghost ck-ghost-sm",
113
- "aria-label": r("styleIncrease", { property: a }),
114
- onClick: () => S(1),
115
- children: "+"
116
- })]
117
- }) : s === "choice" ? /* @__PURE__ */ t("span", {
118
- class: "ck-style-steps",
119
- children: [/* @__PURE__ */ t("button", {
120
- class: "ck-ghost ck-ghost-sm",
121
- "aria-label": r("stylePrevious", { property: a }),
122
- onClick: () => S(-1),
123
- children: "‹"
124
- }), /* @__PURE__ */ t("button", {
125
- class: "ck-ghost ck-ghost-sm",
126
- "aria-label": r("styleNext", { property: a }),
127
- onClick: () => S(1),
128
- children: "›"
129
- })]
130
- }) : null
131
- ] }),
132
- p ? /* @__PURE__ */ t("button", {
133
- class: "ck-ghost ck-ghost-sm",
134
- "aria-label": r("styleReset", { property: a }),
135
- title: r("styleReset", { property: a }),
136
- onClick: h,
137
- children: /* @__PURE__ */ t("svg", {
138
- width: "13",
139
- height: "13",
140
- viewBox: "0 0 24 24",
141
- fill: "none",
142
- stroke: "currentColor",
143
- "stroke-width": "2.2",
144
- "stroke-linecap": "round",
145
- "stroke-linejoin": "round",
146
- "aria-hidden": "true",
147
- children: /* @__PURE__ */ t("path", { d: "M4 9h11a5 5 0 0 1 0 10H9M8 5L4 9l4 4" })
148
- })
149
- }) : null,
150
- f === null ? null : /* @__PURE__ */ t("button", {
151
- class: "ck-ghost ck-ghost-sm",
152
- "aria-label": r("styleRemoveValue", { property: a }),
153
- title: r("styleRemoveValue", { property: a }),
154
- onClick: () => m(null),
155
- children: /* @__PURE__ */ t("svg", {
156
- width: "12",
157
- height: "12",
158
- viewBox: "0 0 24 24",
159
- fill: "none",
160
- stroke: "currentColor",
161
- "stroke-width": "2.2",
162
- "stroke-linecap": "round",
163
- "aria-hidden": "true",
164
- children: /* @__PURE__ */ t("path", { d: "M6 6l12 12M18 6L6 18" })
165
- })
166
- })
167
- ]
168
- }),
169
- v ? /* @__PURE__ */ t("span", {
170
- class: "ck-error",
171
- id: `${b}-error`,
172
- role: "alert",
173
- children: r("styleInvalid")
174
- }) : null
175
- ]
176
- });
177
- }
178
- function u(e, t, n) {
179
- let r = t === "normal" || t === "" ? e === "font-weight" ? "400" : e === "letter-spacing" ? "0px" : null : t === "bold" ? "700" : t, i = r ? /^(-?\d*\.?\d+)([a-z%]*)$/i.exec(r) : null;
180
- if (!i) return null;
181
- let [, a, o = ""] = i, s = e === "opacity" ? .05 : e === "font-weight" ? 100 : /^r?em$/i.test(o) || e === "line-height" && o === "" ? .05 : 1, c = Number(a) + n * s;
182
- return e === "opacity" && (c = Math.min(1, Math.max(0, c))), e === "font-weight" && (c = Math.min(900, Math.max(100, c))), [
183
- "font-size",
184
- "border-width",
185
- "border-radius",
186
- "width",
187
- "height",
188
- "gap",
189
- "line-height"
190
- ].includes(e) && (c = Math.max(0, c)), `${Math.round(c * 100) / 100}${o}`;
191
- }
192
- function d(e, t, n) {
193
- if (!e.length) return null;
194
- let r = e.indexOf(t);
195
- return r === -1 ? n === 1 ? e[0] : e[e.length - 1] : e[(r + n + e.length) % e.length];
196
- }
197
- export { c as StylePanel };