@commentkit/comment-kit 1.6.0 → 2.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 (136) hide show
  1. package/CHANGELOG.md +281 -597
  2. package/README.md +334 -154
  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 +725 -0
  10. package/dist/node/cli/format.js +54 -0
  11. package/dist/node/cli/init.js +372 -0
  12. package/dist/node/cli/main.js +519 -0
  13. package/dist/node/cli/mcp.js +114 -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/endpoint.js +26 -0
  29. package/dist/node/shared/format.js +63 -0
  30. package/dist/node/types/astro.d.ts +11 -0
  31. package/dist/node/types/next.d.ts +34 -0
  32. package/dist/node/types/options.d.ts +59 -0
  33. package/dist/node/types/vite.d.ts +11 -0
  34. package/dist/node/types/webpack-loader.d.ts +22 -0
  35. package/dist/node/types/webpack.d.ts +27 -0
  36. package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
  37. package/dist/npm/chunks/AgentSend-DxRJIYiz.js +68 -0
  38. package/dist/npm/chunks/Checklist-CnlfeSbc.js +282 -0
  39. package/dist/npm/chunks/Composer-B1bBVszY.js +725 -0
  40. package/dist/npm/chunks/Guest-vvNPz8h-.js +267 -0
  41. package/dist/npm/chunks/MarkupEditor-VCOXh9d2.js +338 -0
  42. package/dist/npm/chunks/Panel-F37vIL1K.js +1206 -0
  43. package/dist/npm/chunks/Settings-BGoZS2iV.js +231 -0
  44. package/dist/npm/chunks/Shortcuts-B2OMvczr.js +62 -0
  45. package/dist/npm/chunks/StyleEditor-CJ_d8Huf.js +46 -0
  46. package/dist/npm/chunks/StylePanel-yQzHHlY7.js +199 -0
  47. package/dist/npm/chunks/TaskFields-fmy6_HtK.js +289 -0
  48. package/dist/npm/chunks/ThreadCard-D51slKST.js +1113 -0
  49. package/dist/npm/chunks/Viewer-BOBadqmC.js +111 -0
  50. package/dist/npm/chunks/{agent-BDMQtOzH.js → agent-C1OQzBAm.js} +9 -9
  51. package/dist/npm/chunks/{anchor-BsradQhn.js → anchor-BsQNVkHj.js} +108 -85
  52. package/dist/npm/chunks/{ar-8tPch6W4.js → ar-CAJ3XT8e.js} +69 -19
  53. package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
  54. package/dist/npm/chunks/{client-EFTWxHbJ.js → client-kNAo2TTG.js} +282 -290
  55. package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
  56. package/dist/npm/chunks/context-B8UAzve0.js +20 -0
  57. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  58. package/dist/npm/chunks/{de-C63897uD.js → de-Dl18G48t.js} +60 -18
  59. package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
  60. package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
  61. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  62. package/dist/npm/chunks/{es-CI2bSpvB.js → es-Dxk79lS9.js} +60 -18
  63. package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
  64. package/dist/npm/chunks/{extension-BST6LH1q.js → extension-E81hWyiT.js} +20 -12
  65. package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
  66. package/dist/npm/chunks/{fr-rsVe-Lqk.js → fr-8BebGKYD.js} +118 -76
  67. package/dist/npm/chunks/{hi-cvwbSaWP.js → hi-BIN6Yy_p.js} +61 -19
  68. package/dist/npm/chunks/{i18n-C4v0M-6z.js → i18n-DOBt8e9U.js} +91 -56
  69. package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
  70. package/dist/npm/chunks/{it-C8tnV0BF.js → it-Cr6EwpPQ.js} +79 -37
  71. package/dist/npm/chunks/{ja-BWxDfC2f.js → ja-Iy3s5aur.js} +58 -16
  72. package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
  73. package/dist/npm/chunks/live-CelVeZfP.js +85 -0
  74. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  75. package/dist/npm/chunks/{nl-DNQ6eCht.js → nl-B84WHqqe.js} +61 -19
  76. package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
  77. package/dist/npm/chunks/{pick-CLyOdjnD.js → pick-yTyqtxN0.js} +45 -44
  78. package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
  79. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  80. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  81. package/dist/npm/chunks/{pt-BR-CkG7vpU2.js → pt-BR-DOkdlfoe.js} +60 -18
  82. package/dist/npm/chunks/{realtime-DIo-Wth4.js → realtime-C79zF50C.js} +14 -12
  83. package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
  84. package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
  85. package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
  86. package/dist/npm/chunks/{source-CS7C6wJA.js → source-pXVve2Cx.js} +1 -1
  87. package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
  88. package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
  89. package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
  90. package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
  91. package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
  92. package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
  93. package/dist/npm/chunks/{zh-CN-BKuZOLBE.js → zh-CN-Z5fQCb7G.js} +59 -17
  94. package/dist/npm/element.js +58 -21
  95. package/dist/npm/headless.js +7 -3
  96. package/dist/npm/index.js +3 -3
  97. package/dist/npm/react.js +18 -11
  98. package/dist/npm/svelte.js +28 -12
  99. package/dist/npm/types/adapters/react.d.ts +4 -1
  100. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  101. package/dist/npm/types/adapters/vue.d.ts +35 -2
  102. package/dist/npm/types/anchor/index.d.ts +19 -0
  103. package/dist/npm/types/capture/privacy.d.ts +14 -0
  104. package/dist/npm/types/core/api.d.ts +20 -1
  105. package/dist/npm/types/core/auth.d.ts +40 -21
  106. package/dist/npm/types/core/client.d.ts +60 -4
  107. package/dist/npm/types/core/page-key.d.ts +42 -0
  108. package/dist/npm/types/core/types.d.ts +87 -4
  109. package/dist/npm/types/element.d.ts +17 -7
  110. package/dist/npm/types/headless.d.ts +2 -1
  111. package/dist/npm/types/index.d.ts +16 -6
  112. package/dist/npm/vue.js +44 -9
  113. package/package.json +88 -14
  114. package/dist/npm/chunks/AgentSend-2JPDseOo.js +0 -63
  115. package/dist/npm/chunks/Checklist-BpDXQebo.js +0 -257
  116. package/dist/npm/chunks/Composer-CAyj-c8e.js +0 -677
  117. package/dist/npm/chunks/Guest-ZdFmTcXI.js +0 -187
  118. package/dist/npm/chunks/MarkupEditor-BFplZwFy.js +0 -332
  119. package/dist/npm/chunks/Panel-BhZ4XRDR.js +0 -861
  120. package/dist/npm/chunks/Settings-SPG9EHUZ.js +0 -204
  121. package/dist/npm/chunks/Shortcuts-C28HVDw6.js +0 -58
  122. package/dist/npm/chunks/StyleEditor-ByZMtq10.js +0 -43
  123. package/dist/npm/chunks/StylePanel-Iwhce2tE.js +0 -197
  124. package/dist/npm/chunks/TaskFields-BsP_fVJg.js +0 -273
  125. package/dist/npm/chunks/ThreadCard-BzVZdDCb.js +0 -1030
  126. package/dist/npm/chunks/Viewer-CqtGrdD8.js +0 -108
  127. package/dist/npm/chunks/card-bits-Bna-g3Py.js +0 -124
  128. package/dist/npm/chunks/confetti-DTKpwF3O.js +0 -40
  129. package/dist/npm/chunks/drafts-akdBsOd0.js +0 -50
  130. package/dist/npm/chunks/extension-D-V3utTm.js +0 -53
  131. package/dist/npm/chunks/live-BCpJVBeN.js +0 -33
  132. package/dist/npm/chunks/report-BBrT3r89.js +0 -27
  133. package/dist/npm/chunks/src-C4FsVoUp.js +0 -148
  134. package/dist/npm/chunks/start-i9M-r3aH.js +0 -1800
  135. package/dist/npm/chunks/upload-DSv7EyBD.js +0 -41
  136. package/dist/npm/chunks/uploads-I01kdqQF.js +0 -1103
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commentkit/comment-kit",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
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",
@@ -11,7 +11,12 @@
11
11
  "bug reporting",
12
12
  "screenshot",
13
13
  "mcp",
14
- "ai agent"
14
+ "ai agent",
15
+ "vite-plugin",
16
+ "webpack-plugin",
17
+ "nextjs",
18
+ "astro-integration",
19
+ "cli"
15
20
  ],
16
21
  "homepage": "https://commentkit.dev",
17
22
  "license": "SEE LICENSE IN LICENSE",
@@ -22,40 +27,79 @@
22
27
  },
23
28
  "type": "module",
24
29
  "sideEffects": [
25
- "./dist/npm/element.js"
30
+ "./dist/npm/element.js",
31
+ "./dist/node/browser.js"
26
32
  ],
33
+ "bin": {
34
+ "commentkit": "dist/node/cli/bin.js"
35
+ },
27
36
  "main": "./dist/npm/index.js",
28
37
  "module": "./dist/npm/index.js",
29
38
  "types": "./dist/npm/types/index.d.ts",
30
39
  "exports": {
31
40
  ".": {
32
41
  "types": "./dist/npm/types/index.d.ts",
33
- "import": "./dist/npm/index.js"
42
+ "import": "./dist/npm/index.js",
43
+ "default": "./dist/npm/index.js"
34
44
  },
35
45
  "./react": {
36
46
  "types": "./dist/npm/types/adapters/react.d.ts",
37
- "import": "./dist/npm/react.js"
47
+ "import": "./dist/npm/react.js",
48
+ "default": "./dist/npm/react.js"
38
49
  },
39
50
  "./vue": {
40
51
  "types": "./dist/npm/types/adapters/vue.d.ts",
41
- "import": "./dist/npm/vue.js"
52
+ "import": "./dist/npm/vue.js",
53
+ "default": "./dist/npm/vue.js"
42
54
  },
43
55
  "./svelte": {
44
56
  "types": "./dist/npm/types/adapters/svelte.d.ts",
45
- "import": "./dist/npm/svelte.js"
57
+ "import": "./dist/npm/svelte.js",
58
+ "default": "./dist/npm/svelte.js"
46
59
  },
47
60
  "./element": {
48
61
  "types": "./dist/npm/types/element.d.ts",
49
- "import": "./dist/npm/element.js"
62
+ "import": "./dist/npm/element.js",
63
+ "default": "./dist/npm/element.js"
50
64
  },
51
65
  "./headless": {
52
66
  "types": "./dist/npm/types/headless.d.ts",
53
- "import": "./dist/npm/headless.js"
67
+ "import": "./dist/npm/headless.js",
68
+ "default": "./dist/npm/headless.js"
69
+ },
70
+ "./vite": {
71
+ "types": "./dist/node/types/vite.d.ts",
72
+ "browser": "./dist/node/browser.js",
73
+ "import": "./dist/node/plugins/vite.js",
74
+ "default": "./dist/node/plugins/vite.js"
75
+ },
76
+ "./next": {
77
+ "types": "./dist/node/types/next.d.ts",
78
+ "browser": "./dist/node/browser.js",
79
+ "import": "./dist/node/plugins/next.js",
80
+ "default": "./dist/node/plugins/next.js"
81
+ },
82
+ "./webpack": {
83
+ "types": "./dist/node/types/webpack.d.ts",
84
+ "browser": "./dist/node/browser.js",
85
+ "import": "./dist/node/plugins/webpack.js",
86
+ "default": "./dist/node/plugins/webpack.js"
87
+ },
88
+ "./webpack/loader": {
89
+ "browser": "./dist/node/browser.js",
90
+ "default": "./dist/node/plugins/webpack-loader.cjs"
91
+ },
92
+ "./astro": {
93
+ "types": "./dist/node/types/astro.d.ts",
94
+ "browser": "./dist/node/browser.js",
95
+ "import": "./dist/node/plugins/astro.js",
96
+ "default": "./dist/node/plugins/astro.js"
54
97
  },
55
98
  "./package.json": "./package.json"
56
99
  },
57
100
  "files": [
58
101
  "dist/npm",
102
+ "dist/node",
59
103
  "README.md",
60
104
  "CHANGELOG.md",
61
105
  "LICENSE",
@@ -66,11 +110,18 @@
66
110
  "registry": "https://registry.npmjs.org/"
67
111
  },
68
112
  "scripts": {
69
- "build": "npm run build:npm && npm run build:cdn && npm run build:types && node scripts/check-dist.mjs",
113
+ "build": "npm run build:npm && npm run build:cdn && npm run build:types && npm run build:node && node scripts/check-dist.mjs",
70
114
  "build:npm": "vp build",
71
115
  "build:cdn": "CK_BUILD=cdn vp build && CK_BUILD=loader vp build",
72
116
  "build:types": "rm -rf dist/npm/types && tsc -p tsconfig.build.json && node scripts/prune-types.mjs",
73
- "test": "vp test run",
117
+ "build:node": "npm run build:plugins && npm run build:cli",
118
+ "build:plugins": "vp build --config vite.node.config.ts && node scripts/finish-node-build.mjs && rm -rf dist/node/types && tsc -p tsconfig.plugins.json && node scripts/prune-types.mjs node",
119
+ "build:cli": "rm -rf dist/node/cli dist/node/shared && tsc -p tsconfig.cli.json",
120
+ "test": "vp test run && npm run test:node",
121
+ "test:browser": "vp test run",
122
+ "test:node": "npm run build:node && vp test run --config plugins/vitest.config.ts && node --test cli/test/*.test.mjs",
123
+ "test:plugins": "npm run build:plugins && vp test run --config plugins/vitest.config.ts",
124
+ "test:cli": "npm run build:cli && node --test cli/test/*.test.mjs",
74
125
  "test:watch": "vp test watch",
75
126
  "test:coverage": "vp test run --coverage",
76
127
  "test:e2e": "playwright test",
@@ -78,23 +129,33 @@
78
129
  "test:host-matrix": "node scripts/host-matrix.mjs",
79
130
  "test:wordpress": "node scripts/wordpress-check.mjs",
80
131
  "test:wordpress:real": "node e2e/wordpress-real/run.mjs",
81
- "typecheck": "tsc -p tsconfig.json",
132
+ "typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.node.json",
133
+ "typecheck:e2e": "tsc -p tsconfig.e2e.json",
82
134
  "check": "npm run typecheck && npm run test && npm run build",
83
135
  "prepublishOnly": "npm run check && node scripts/check-pack.mjs",
84
136
  "ci": "bash scripts/ci.sh",
85
137
  "contract:sync": "bash scripts/contract-sync.sh",
86
138
  "changeset": "changeset",
87
- "version": "changeset version",
139
+ "version": "changeset version && node mcp/scripts/sync-server-json.mjs",
88
140
  "release:status": "changeset status --verbose"
89
141
  },
90
142
  "devDependencies": {
143
+ "@astrojs/compiler": "4.0.0",
91
144
  "@axe-core/playwright": "4.14.0",
145
+ "@babel/parser": "8.0.10",
92
146
  "@changesets/cli": "3.0.3",
147
+ "@jridgewell/trace-mapping": "0.3.31",
93
148
  "@playwright/test": "1.64.1",
149
+ "@sveltejs/vite-plugin-svelte": "7.3.1",
150
+ "@types/node": "26.6.6",
94
151
  "@types/react": "19.3.0",
152
+ "@vitejs/plugin-react": "6.1.2",
153
+ "@vitejs/plugin-vue": "6.0.10",
95
154
  "@vitest/coverage-v8": "5.0.5",
155
+ "astro": "7.4.4",
96
156
  "html2canvas-pro": "2.6.0",
97
157
  "jsdom": "30.1.3",
158
+ "magic-string": "1.4.5",
98
159
  "preact": "11.1.0",
99
160
  "pusher-js": "8.6.0",
100
161
  "react": "19.3.1",
@@ -105,22 +166,35 @@
105
166
  "vite-plus": "1.4.0",
106
167
  "vitest": "5.0.5",
107
168
  "vue": "3.5.44",
169
+ "webpack": "5.112.2",
108
170
  "yaml": "2.9.1"
109
171
  },
110
172
  "peerDependencies": {
173
+ "astro": ">=4",
111
174
  "react": ">=18",
112
175
  "svelte": ">=4",
113
- "vue": ">=3"
176
+ "vite": ">=5",
177
+ "vue": ">=3",
178
+ "webpack": ">=5"
114
179
  },
115
180
  "peerDependenciesMeta": {
181
+ "astro": {
182
+ "optional": true
183
+ },
116
184
  "react": {
117
185
  "optional": true
118
186
  },
119
187
  "svelte": {
120
188
  "optional": true
121
189
  },
190
+ "vite": {
191
+ "optional": true
192
+ },
122
193
  "vue": {
123
194
  "optional": true
195
+ },
196
+ "webpack": {
197
+ "optional": true
124
198
  }
125
199
  },
126
200
  "overrides": {
@@ -1,63 +0,0 @@
1
- import { i as e, l as t, m as n, s as r, u as i } from "./i18n-C4v0M-6z.js";
2
- import { n as a, t as o } from "./agent-BDMQtOzH.js";
3
- import { b as s } from "./start-i9M-r3aH.js";
4
- // src/ui/AgentSend.tsx
5
- var c = {
6
- cursor: "Cursor",
7
- claude: "Claude Code",
8
- codex: "Codex"
9
- }, l = "commentkit:agent";
10
- function u({ client: u, threads: d, onDone: f, onError: p, onClose: m }) {
11
- let [h, g] = n(null), _ = d.slice(0, 25);
12
- i(() => {
13
- let e = !0;
14
- return Promise.all(_.map((e) => u.allMessages(e.id).then((t) => ({
15
- thread: e,
16
- messages: t
17
- })))).then((t) => e && g(t), (t) => e && (p(t), m())), () => void (e = !1);
18
- }, []);
19
- let v = "copy";
20
- try {
21
- v = localStorage.getItem(l) ?? "copy";
22
- } catch {}
23
- let y = [
24
- "cursor",
25
- "claude",
26
- "codex",
27
- "copy"
28
- ], b = [v, ...y.filter((e) => e !== v)].filter((e) => y.includes(e)), x = (t) => {
29
- if (!h) return;
30
- let n = a(h);
31
- navigator.clipboard?.writeText(n).catch(() => void 0);
32
- try {
33
- localStorage.setItem(l, t);
34
- } catch {}
35
- if (t === "copy") return f(e("agentCopied", h.length));
36
- let { url: i, complete: s } = o(t, h, n, u.state.get().session?.repository ?? null), d = document.createElement("a");
37
- d.href = i, d.rel = "noopener noreferrer", d.click(), f(r(s ? "agentOpened" : "agentOpenedShort", { agent: c[t] }));
38
- };
39
- return /* @__PURE__ */ t("div", {
40
- class: "ck-menu ck-agent-menu",
41
- role: "menu",
42
- "aria-label": r("sendToAgent"),
43
- ref: s,
44
- onKeyDown: (e) => e.key === "Escape" && (e.stopPropagation(), m()),
45
- children: [
46
- /* @__PURE__ */ t("div", {
47
- class: "ck-menu-head",
48
- children: h ? e("agentReady", h.length) : r("agentPreparing")
49
- }),
50
- b.map((e) => /* @__PURE__ */ t("button", {
51
- role: "menuitem",
52
- disabled: !h,
53
- onClick: () => x(e),
54
- children: e === "copy" ? r("copyPrompt") : r("openIn", { agent: c[e] })
55
- })),
56
- d.length > 25 ? /* @__PURE__ */ t("p", {
57
- class: "ck-muted ck-agent-note",
58
- children: r("agentFirstOnly", { max: 25 })
59
- }) : null
60
- ]
61
- });
62
- }
63
- export { u as AgentSend };
@@ -1,257 +0,0 @@
1
- import { _ as e, f as t, i as n, l as r, m as i, s as a } from "./i18n-C4v0M-6z.js";
2
- import { f as o, v as s } from "./start-i9M-r3aH.js";
3
- // src/ui/art.tsx
4
- var c = "M31.5 4.8C17.3 4.4 7 15.2 7 29c0 13 8.5 21.2 20.9 23 1.6.2 2.1 1.2 2.1 2.5v6.9c0 1.7 1.2 2.1 2.5.9 5.7-4.9 16-13.6 21.1-22.1 3.5-5.8 4.7-11.8 3.2-18.1C54.3 11.5 44.7 4.6 31.5 4.8Z", l = (e, t, n, i) => /* @__PURE__ */ r("path", {
5
- class: i,
6
- d: c,
7
- transform: `translate(${e} ${t}) scale(${n})`
8
- }), u = {
9
- caughtUp: () => /* @__PURE__ */ r(e, { children: [
10
- /* @__PURE__ */ r("path", {
11
- class: "ck-art-w",
12
- d: "M28 50l8-20h48l8 20v18H28z"
13
- }),
14
- /* @__PURE__ */ r("path", {
15
- class: "ck-art-line",
16
- d: "M28 50h19l4 6h18l4-6h19"
17
- }),
18
- l(44, 4, .5, "ck-art-a"),
19
- /* @__PURE__ */ r("path", {
20
- class: "ck-art-tick",
21
- d: "M53 19l5 5 9-10"
22
- })
23
- ] }),
24
- noFeedback: () => /* @__PURE__ */ r(e, { children: [
25
- /* @__PURE__ */ r("rect", {
26
- class: "ck-art-w",
27
- x: "22",
28
- y: "18",
29
- width: "70",
30
- height: "52",
31
- rx: "7"
32
- }),
33
- /* @__PURE__ */ r("path", {
34
- class: "ck-art-line",
35
- d: "M22 29h70"
36
- }),
37
- /* @__PURE__ */ r("circle", {
38
- class: "ck-art-dot",
39
- cx: "29",
40
- cy: "23.5",
41
- r: "1.6"
42
- }),
43
- /* @__PURE__ */ r("circle", {
44
- class: "ck-art-dot",
45
- cx: "35",
46
- cy: "23.5",
47
- r: "1.6"
48
- }),
49
- /* @__PURE__ */ r("rect", {
50
- class: "ck-art-m",
51
- x: "30",
52
- y: "37",
53
- width: "34",
54
- height: "5",
55
- rx: "2.5"
56
- }),
57
- /* @__PURE__ */ r("rect", {
58
- class: "ck-art-m",
59
- x: "30",
60
- y: "47",
61
- width: "46",
62
- height: "5",
63
- rx: "2.5"
64
- }),
65
- /* @__PURE__ */ r("rect", {
66
- class: "ck-art-m",
67
- x: "30",
68
- y: "57",
69
- width: "26",
70
- height: "5",
71
- rx: "2.5"
72
- }),
73
- l(70, 6, .46, "ck-art-a"),
74
- /* @__PURE__ */ r("path", {
75
- class: "ck-art-tick",
76
- d: "M84.5 14v9M80 18.5h9"
77
- })
78
- ] }),
79
- noMatch: () => /* @__PURE__ */ r(e, { children: [
80
- /* @__PURE__ */ r("rect", {
81
- class: "ck-art-m",
82
- x: "22",
83
- y: "22",
84
- width: "52",
85
- height: "6",
86
- rx: "3"
87
- }),
88
- /* @__PURE__ */ r("rect", {
89
- class: "ck-art-m",
90
- x: "22",
91
- y: "36",
92
- width: "40",
93
- height: "6",
94
- rx: "3"
95
- }),
96
- /* @__PURE__ */ r("rect", {
97
- class: "ck-art-m",
98
- x: "22",
99
- y: "50",
100
- width: "46",
101
- height: "6",
102
- rx: "3"
103
- }),
104
- /* @__PURE__ */ r("circle", {
105
- class: "ck-art-w",
106
- cx: "76",
107
- cy: "42",
108
- r: "15"
109
- }),
110
- /* @__PURE__ */ r("path", {
111
- class: "ck-art-line ck-art-bold",
112
- d: "M87 53l11 11"
113
- }),
114
- /* @__PURE__ */ r("path", {
115
- class: "ck-art-line",
116
- d: "M70 42h12"
117
- })
118
- ] }),
119
- error: () => /* @__PURE__ */ r(e, { children: [
120
- l(36, 6, .75, "ck-art-m"),
121
- /* @__PURE__ */ r("path", {
122
- class: "ck-art-line ck-art-bold",
123
- d: "M60 18v14"
124
- }),
125
- /* @__PURE__ */ r("circle", {
126
- class: "ck-art-ink",
127
- cx: "60",
128
- cy: "40",
129
- r: "2.4"
130
- }),
131
- /* @__PURE__ */ r("path", {
132
- class: "ck-art-spark",
133
- d: "M24 22l6 4M22 36h7M96 22l-6 4M98 36h-7"
134
- })
135
- ] }),
136
- gone: () => /* @__PURE__ */ r(e, { children: l(36, 6, .75, "ck-art-ghost") })
137
- };
138
- function d({ name: e }) {
139
- return /* @__PURE__ */ r("svg", {
140
- class: "ck-art",
141
- viewBox: "0 0 120 80",
142
- width: "120",
143
- height: "80",
144
- "aria-hidden": "true",
145
- focusable: "false",
146
- children: [/* @__PURE__ */ r("ellipse", {
147
- class: "ck-art-shadow",
148
- cx: "60",
149
- cy: "74",
150
- rx: "34",
151
- ry: "3.5"
152
- }), u[e]()]
153
- });
154
- }
155
- // src/ui/Checklist.tsx
156
- function f({ client: e, thread: n, editable: c, onChange: l, onError: u }) {
157
- let [d, f] = i(!1), [p, m] = i(""), [h, g] = i(!1), _ = n.checklist ?? [], v = _.filter((e) => e.done).length, y = t(n);
158
- y.current = n;
159
- let b = (e) => l(y.current = {
160
- ...y.current,
161
- checklist: e(y.current.checklist ?? [])
162
- }), x = () => {
163
- let t = p.trim();
164
- t && !h && (g(!0), m(""), e.addChecklistItem(n.id, t).then((e) => b((t) => [...t, e]), (e) => {
165
- m(t), u(e);
166
- }).finally(() => g(!1)));
167
- }, S = (t) => {
168
- let n = {
169
- ...t,
170
- done: !t.done
171
- }, r = (e) => b((n) => n.map((n) => n.id === t.id ? e : n));
172
- r(n), e.updateChecklistItem(t.id, { done: n.done }).catch((e) => {
173
- r(t), u(e);
174
- });
175
- }, C = (t) => {
176
- let n = _.indexOf(t);
177
- b((e) => e.filter((e) => e.id !== t.id)), e.deleteChecklistItem(t.id).catch((e) => {
178
- b((e) => e.some((e) => e.id === t.id) ? e : [
179
- ...e.slice(0, n),
180
- t,
181
- ...e.slice(n)
182
- ]), u(e);
183
- });
184
- };
185
- return !_.length && !c ? null : /* @__PURE__ */ r("div", {
186
- class: "ck-extra",
187
- children: [
188
- _.length ? /* @__PURE__ */ r("div", {
189
- class: "ck-checklist",
190
- role: "group",
191
- "aria-label": a("checklist"),
192
- children: [/* @__PURE__ */ r("div", {
193
- class: "ck-checklist-head",
194
- children: [/* @__PURE__ */ r("span", {
195
- class: "ck-muted",
196
- children: a("checklistProgress", {
197
- n: v,
198
- total: _.length
199
- })
200
- }), /* @__PURE__ */ r("span", {
201
- class: "ck-checklist-bar",
202
- "aria-hidden": "true",
203
- children: /* @__PURE__ */ r("span", { style: { width: `${Math.round(v / _.length * 100)}%` } })
204
- })]
205
- }), /* @__PURE__ */ r("ul", { children: _.map((e) => /* @__PURE__ */ r("li", {
206
- "data-done": e.done || void 0,
207
- children: [/* @__PURE__ */ r("label", {
208
- class: "ck-check",
209
- children: [/* @__PURE__ */ r("input", {
210
- type: "checkbox",
211
- checked: e.done,
212
- disabled: !c,
213
- onChange: () => S(e)
214
- }), /* @__PURE__ */ r("bdi", { children: e.body })]
215
- }), c ? /* @__PURE__ */ r("button", {
216
- class: "ck-ghost ck-ghost-sm",
217
- "aria-label": a("removeItem", { item: e.body }),
218
- onClick: () => C(e),
219
- children: /* @__PURE__ */ r(o, {
220
- name: "close",
221
- size: 12
222
- })
223
- }) : null]
224
- })) })]
225
- }) : null,
226
- c && (d || _.length) ? /* @__PURE__ */ r("div", {
227
- class: "ck-checklist-add",
228
- children: /* @__PURE__ */ r("input", {
229
- class: "ck-input",
230
- maxLength: 300,
231
- placeholder: a("checklistAdd"),
232
- "aria-label": a("checklistAdd"),
233
- value: p,
234
- disabled: h,
235
- ref: d && !_.length ? s : void 0,
236
- onInput: (e) => m(e.target.value),
237
- onKeyDown: (e) => {
238
- e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), x()) : e.key === "Escape" && !_.length && f(!1);
239
- }
240
- })
241
- }) : null,
242
- c && !_.length && !d ? /* @__PURE__ */ r("div", {
243
- class: "ck-extra-add",
244
- children: /* @__PURE__ */ r("button", {
245
- class: "ck-ghost ck-ghost-sm",
246
- onClick: () => f(!0),
247
- children: ["+ ", a("addChecklist")]
248
- })
249
- }) : null
250
- ]
251
- });
252
- }
253
- function p(e) {
254
- let t = e.checklist ?? [];
255
- return t.length ? n("checklistShort", t.length, { done: t.filter((e) => e.done).length }) : null;
256
- }
257
- export { p as n, d as r, f as t };