@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
@@ -0,0 +1,31 @@
1
+ import { i as e, n as t, r as n } from "./transform-CKiAuSbk.js";
2
+ import { tagJsxAst as r } from "./jsx-Bg4BdSph.js";
3
+ // plugins/transform/astro.ts
4
+ function i(e, t, n) {
5
+ let { ast: i } = t.parse(e);
6
+ r(i.body, n);
7
+ }
8
+ function a(e) {
9
+ if (!/[^\x00-\x7f]/.test(e)) return (e) => e;
10
+ let t = [], n = 0;
11
+ for (let r = 0; r < e.length; r++) {
12
+ let i = e.codePointAt(r), a = i < 128 ? 1 : i < 2048 ? 2 : i < 65536 ? 3 : 4;
13
+ for (let e = 0; e < a; e++) t[n + e] = r;
14
+ n += a, i >= 65536 && r++;
15
+ }
16
+ return t[n] = e.length, (e) => t[e] ?? -1;
17
+ }
18
+ async function o(r, i, o) {
19
+ let { ast: s } = await i.parse(r, { position: !0 }), c = a(r), l = (r, i) => {
20
+ for (let a of r ?? []) {
21
+ let r = i;
22
+ if ((a.type === "element" || a.type === "custom-element") && a.name) {
23
+ let s = a.name, l = a.position ? c(a.position.start.offset) : -1, u = a.attributes?.some((e) => e.name === t);
24
+ !i && l >= 0 && !e.has(s) && !u && o.verify(l, s) && o.add(l, l + 1 + s.length), (n.has(s) || s === "head" || s === "script" || s === "style") && (r = !0);
25
+ } else if (a.type === "frontmatter") continue;
26
+ l(a.children, r);
27
+ }
28
+ };
29
+ l(s.children, !1);
30
+ }
31
+ export { o as tagAstroGo, i as tagAstroRust };
@@ -0,0 +1,26 @@
1
+ import { n as e } from "./git-BIXLbL3f.js";
2
+ import { n as t, r as n, t as r } from "./vite-BdAYUW10.js";
3
+ import { a as i } from "./options-THop1K92.js";
4
+ import { resolve as a } from "node:path";
5
+ import { fileURLToPath as o } from "node:url";
6
+ // plugins/astro.ts
7
+ function s(s = {}) {
8
+ return {
9
+ name: "@commentkit/comment-kit",
10
+ hooks: { "astro:config:setup": ({ command: c, config: l, updateConfig: u, injectScript: d }) => {
11
+ let f = o(l.root), p = a(f, s.root ?? ".");
12
+ if (u({ vite: { plugins: [r({
13
+ ...s,
14
+ root: p,
15
+ inject: void 0
16
+ })] } }), c === "dev" && s.inject) {
17
+ let r = i(s.buildInfo, !0) ? e({ cwd: p }) : {
18
+ branch: null,
19
+ commit: null
20
+ }, a = n(s.inject, r);
21
+ a && d("page", t(a));
22
+ }
23
+ } }
24
+ };
25
+ }
26
+ export { s as commentkit, s as default };
@@ -0,0 +1,92 @@
1
+ import { execFileSync as e } from "node:child_process";
2
+ // plugins/git.ts
3
+ var t = [
4
+ {
5
+ name: "commentkit",
6
+ branch: ["COMMENTKIT_BRANCH"],
7
+ commit: ["COMMENTKIT_COMMIT"]
8
+ },
9
+ {
10
+ name: "vercel",
11
+ branch: ["VERCEL_GIT_COMMIT_REF"],
12
+ commit: ["VERCEL_GIT_COMMIT_SHA"]
13
+ },
14
+ {
15
+ name: "netlify",
16
+ when: "NETLIFY",
17
+ branch: ["HEAD", "BRANCH"],
18
+ commit: ["COMMIT_REF"]
19
+ },
20
+ {
21
+ name: "cloudflare-pages",
22
+ branch: ["CF_PAGES_BRANCH"],
23
+ commit: ["CF_PAGES_COMMIT_SHA"]
24
+ },
25
+ {
26
+ name: "github-actions",
27
+ when: "GITHUB_ACTIONS",
28
+ branch: ["GITHUB_HEAD_REF", "GITHUB_REF_NAME"],
29
+ commit: ["GITHUB_SHA"]
30
+ },
31
+ {
32
+ name: "gitlab",
33
+ when: "GITLAB_CI",
34
+ branch: ["CI_MERGE_REQUEST_SOURCE_BRANCH_NAME", "CI_COMMIT_REF_NAME"],
35
+ commit: ["CI_COMMIT_SHA"]
36
+ },
37
+ {
38
+ name: "render",
39
+ branch: ["RENDER_GIT_BRANCH"],
40
+ commit: ["RENDER_GIT_COMMIT"]
41
+ }
42
+ ], n = (e, t) => {
43
+ for (let n of t) {
44
+ let t = e[n]?.trim();
45
+ if (t) return t;
46
+ }
47
+ return null;
48
+ };
49
+ function r(e) {
50
+ let t = e?.trim().replace(/^refs\/heads\//, "");
51
+ return !t || t === "HEAD" || t.length > 255 || !/^[A-Za-z0-9._/-]+$/.test(t) ? null : t;
52
+ }
53
+ function i(e) {
54
+ let t = e?.trim().toLowerCase();
55
+ return t && /^[0-9a-f]{7,64}$/.test(t) ? t : null;
56
+ }
57
+ function a(t, n) {
58
+ try {
59
+ return e("git", t, {
60
+ cwd: n,
61
+ encoding: "utf8",
62
+ stdio: [
63
+ "ignore",
64
+ "pipe",
65
+ "ignore"
66
+ ],
67
+ timeout: 3e3,
68
+ windowsHide: !0
69
+ }).trim() || null;
70
+ } catch {
71
+ return null;
72
+ }
73
+ }
74
+ function o(e = {}) {
75
+ let o = e.env ?? process.env, s = e.cwd ?? process.cwd(), c = null, l = null;
76
+ for (let e of t) if ((!e.when || o[e.when]) && (c ??= r(n(o, e.branch)), l ??= i(n(o, e.commit)), c && l)) break;
77
+ return e.git === !1 || c && l || (c ??= r(a([
78
+ "rev-parse",
79
+ "--abbrev-ref",
80
+ "HEAD"
81
+ ], s)), l ??= i(a(["rev-parse", "HEAD"], s))), {
82
+ branch: c,
83
+ commit: l
84
+ };
85
+ }
86
+ function s(e) {
87
+ return { __COMMENTKIT_BUILD__: JSON.stringify({
88
+ branch: e.branch,
89
+ commit: e.commit
90
+ }) };
91
+ }
92
+ export { o as n, s as t };