@commentkit/comment-kit 1.5.1 → 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 (141) hide show
  1. package/CHANGELOG.md +281 -582
  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-CqDO3JMA.js → agent-C1OQzBAm.js} +20 -21
  51. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsQNVkHj.js} +109 -87
  52. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-CAJ3XT8e.js} +73 -20
  53. package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
  54. package/dist/npm/chunks/{client-dZeNdizE.js → client-kNAo2TTG.js} +292 -285
  55. package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
  56. package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
  57. package/dist/npm/chunks/context-B8UAzve0.js +20 -0
  58. package/dist/npm/chunks/context-BuMl7A07.js +48 -0
  59. package/dist/npm/chunks/{de-CcPi8xdC.js → de-Dl18G48t.js} +64 -19
  60. package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
  61. package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
  62. package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
  63. package/dist/npm/chunks/{es-DXgkjDCG.js → es-Dxk79lS9.js} +64 -19
  64. package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
  65. package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-E81hWyiT.js} +21 -14
  66. package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
  67. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-8BebGKYD.js} +121 -76
  68. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-BIN6Yy_p.js} +65 -20
  69. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  70. package/dist/npm/chunks/i18n-DOBt8e9U.js +936 -0
  71. package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
  72. package/dist/npm/chunks/{it-DKiSCkiD.js → it-Cr6EwpPQ.js} +83 -38
  73. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-Iy3s5aur.js} +62 -17
  74. package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
  75. package/dist/npm/chunks/live-CelVeZfP.js +85 -0
  76. package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
  77. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  78. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-B84WHqqe.js} +65 -20
  79. package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
  80. package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-yTyqtxN0.js} +46 -46
  81. package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
  82. package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
  83. package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
  84. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-DOkdlfoe.js} +64 -19
  85. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-C79zF50C.js} +16 -15
  86. package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
  87. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  88. package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
  89. package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
  90. package/dist/npm/chunks/{source-BQS2_xfB.js → source-pXVve2Cx.js} +2 -3
  91. package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
  92. package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
  93. package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
  94. package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
  95. package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
  96. package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
  97. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-Z5fQCb7G.js} +63 -18
  98. package/dist/npm/element.js +59 -23
  99. package/dist/npm/headless.js +7 -3
  100. package/dist/npm/index.js +3 -3
  101. package/dist/npm/react.js +19 -13
  102. package/dist/npm/svelte.js +29 -14
  103. package/dist/npm/types/adapters/react.d.ts +4 -1
  104. package/dist/npm/types/adapters/svelte.d.ts +4 -1
  105. package/dist/npm/types/adapters/vue.d.ts +35 -2
  106. package/dist/npm/types/anchor/index.d.ts +19 -0
  107. package/dist/npm/types/capture/privacy.d.ts +14 -0
  108. package/dist/npm/types/core/api.d.ts +20 -1
  109. package/dist/npm/types/core/auth.d.ts +47 -14
  110. package/dist/npm/types/core/client.d.ts +60 -4
  111. package/dist/npm/types/core/page-key.d.ts +42 -0
  112. package/dist/npm/types/core/types.d.ts +87 -4
  113. package/dist/npm/types/element.d.ts +17 -7
  114. package/dist/npm/types/headless.d.ts +2 -1
  115. package/dist/npm/types/index.d.ts +16 -6
  116. package/dist/npm/vue.js +45 -11
  117. package/package.json +95 -21
  118. package/dist/npm/chunks/AgentSend-DjFZSC0S.js +0 -64
  119. package/dist/npm/chunks/Checklist-BEz4IZdT.js +0 -259
  120. package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
  121. package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
  122. package/dist/npm/chunks/MarkupEditor-CPH4yKx4.js +0 -334
  123. package/dist/npm/chunks/Panel-DSoUAlbQ.js +0 -863
  124. package/dist/npm/chunks/Settings-C_qV4n7J.js +0 -206
  125. package/dist/npm/chunks/Shortcuts-ChnaribX.js +0 -60
  126. package/dist/npm/chunks/StyleEditor-DqZd6C5o.js +0 -44
  127. package/dist/npm/chunks/StylePanel-DMC3riYK.js +0 -199
  128. package/dist/npm/chunks/TaskFields-BfjjllMx.js +0 -272
  129. package/dist/npm/chunks/ThreadCard-DmKAelSL.js +0 -1026
  130. package/dist/npm/chunks/Viewer-mw69qSI5.js +0 -110
  131. package/dist/npm/chunks/card-bits-C7bIk5KX.js +0 -126
  132. package/dist/npm/chunks/confetti-DKeKR7-6.js +0 -41
  133. package/dist/npm/chunks/drafts-CpQdHhcK.js +0 -51
  134. package/dist/npm/chunks/extension-Gvei3opb.js +0 -54
  135. package/dist/npm/chunks/i18n-DAJGndZ2.js +0 -904
  136. package/dist/npm/chunks/live-MvvBdoGd.js +0 -34
  137. package/dist/npm/chunks/report-DoDVi1qT.js +0 -28
  138. package/dist/npm/chunks/src-C_oUnL0i.js +0 -150
  139. package/dist/npm/chunks/start-C5-rebEU.js +0 -1783
  140. package/dist/npm/chunks/upload-CzPAjktW.js +0 -42
  141. package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
@@ -1,110 +0,0 @@
1
- import { f as e, l as t, m as n, s as r, u as i, v as a } from "./i18n-DAJGndZ2.js";
2
- import { d as o, n as s } from "./start-C5-rebEU.js";
3
- //#endregion
4
- //#region src/ui/Viewer.tsx
5
- s(".ck-viewer{z-index:calc(var(--ck-z) + 3);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#0a0a0cd1;grid-template-rows:auto 1fr;place-items:center;padding:12px 56px 24px;animation:.16s ease-out ck-fade;display:grid;position:fixed;top:0;bottom:0;left:0;right:0}.ck-viewer-bar{color:#f2f1ec;justify-self:stretch;align-items:center;gap:4px;min-height:40px;display:flex}.ck-viewer-name{white-space:nowrap;text-overflow:ellipsis;flex:1;align-items:baseline;gap:10px;min-width:0;font-size:13px;font-weight:600;display:flex;overflow:hidden}.ck-viewer-count{color:#f2f1eca6;font-variant-numeric:tabular-nums;font-weight:500}.ck-viewer-btn,.ck-viewer-nav{color:#f2f1ec;background:#ffffff1a;border:0;border-radius:999px;place-items:center;width:36px;height:36px;padding:0;text-decoration:none;transition:background-color .12s,scale .15s ease-out;display:grid}.ck-viewer-btn:active,.ck-viewer-nav:active{scale:.96}.ck-viewer-img{object-fit:contain;border-radius:var(--ck-radius-md);outline:1px solid var(--ck-img-outline);outline-offset:-1px;max-width:100%;max-height:calc(100dvh - 96px);animation:ck-pop .18s var(--ck-ease);background:#fff;box-shadow:0 20px 60px #00000073}.ck-viewer-nav{width:40px;height:40px;position:absolute;top:50%;translate:0 -50%}.ck-viewer-nav[data-dir=prev]: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))){left:8px}.ck-viewer-nav[data-dir=prev]: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))){left:8px}.ck-viewer-nav[data-dir=prev]:-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:8px}.ck-viewer-nav[data-dir=prev]: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:8px}.ck-viewer-nav[data-dir=next]: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:8px}.ck-viewer-nav[data-dir=next]: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:8px}.ck-viewer-nav[data-dir=next]:-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:8px}.ck-viewer-nav[data-dir=next]: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:8px}.ck-viewer-nav[data-dir=prev] svg{scale:-1 1}.ck-root[dir=rtl] .ck-viewer-nav[data-dir=prev] svg{scale:1}.ck-root[dir=rtl] .ck-viewer-nav[data-dir=next] svg{scale:-1 1}.ck-viewer :focus-visible{outline-color:#fff}@media (hover:hover){.ck-viewer-btn:hover,.ck-viewer-nav:hover{background:#fff3}}@media (max-width:520px){.ck-viewer{padding:8px 8px 16px}.ck-viewer-nav{top:auto;bottom:16px;translate:none}}@media (pointer:coarse){.ck-viewer-btn,.ck-viewer-nav{width:44px;height:44px}}");
6
- var c = (e) => getComputedStyle(e).direction === "rtl";
7
- function l({ images: s, start: l = 0, onClose: u }) {
8
- let [d, f] = n(Math.min(Math.max(0, l), s.length - 1)), p = e(null), m = s[d], h = s.length > 1, g = (e) => f((t) => (t + e + s.length) % s.length);
9
- if (i(() => {
10
- let e = p.current?.getRootNode()?.activeElement ?? document.activeElement;
11
- return p.current?.focus({ preventScroll: !0 }), () => {
12
- e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
13
- };
14
- }, []), !m) return null;
15
- let _ = m.href ?? m.src;
16
- return /* @__PURE__ */ t("div", {
17
- class: "ck-viewer",
18
- role: "dialog",
19
- "aria-modal": "true",
20
- "aria-label": r("imageViewer"),
21
- "data-commentkit-ui": !0,
22
- onClick: (e) => e.target === e.currentTarget && u(),
23
- onKeyDown: (e) => {
24
- if (e.stopPropagation(), e.key === "Escape") u();
25
- else if (h && (e.key === "ArrowRight" || e.key === "ArrowLeft")) g(e.key === "ArrowRight" === c(e.currentTarget) ? -1 : 1);
26
- else if (e.key === "Tab") {
27
- let t = [...e.currentTarget.querySelectorAll("button, a[href]")], n = t.indexOf(e.currentTarget.getRootNode().activeElement);
28
- e.preventDefault(), t[(n + (e.shiftKey ? -1 : 1) + t.length) % t.length]?.focus();
29
- }
30
- },
31
- children: [
32
- /* @__PURE__ */ t("div", {
33
- class: "ck-viewer-bar",
34
- children: [
35
- /* @__PURE__ */ t("span", {
36
- class: "ck-viewer-name",
37
- children: [/* @__PURE__ */ t("bdi", { children: m.name }), h ? /* @__PURE__ */ t("span", {
38
- class: "ck-viewer-count",
39
- children: r("countOf", {
40
- n: d + 1,
41
- total: s.length
42
- })
43
- }) : null]
44
- }),
45
- /* @__PURE__ */ t("a", {
46
- class: "ck-viewer-btn",
47
- href: _,
48
- target: "_blank",
49
- rel: "noopener noreferrer",
50
- download: m.name,
51
- "aria-label": r("download"),
52
- title: r("download"),
53
- children: /* @__PURE__ */ t(o, {
54
- name: "down",
55
- size: 16
56
- })
57
- }),
58
- /* @__PURE__ */ t("a", {
59
- class: "ck-viewer-btn",
60
- href: _,
61
- target: "_blank",
62
- rel: "noopener noreferrer",
63
- "aria-label": r("openInTab"),
64
- title: r("openInTab"),
65
- children: /* @__PURE__ */ t(o, {
66
- name: "link",
67
- size: 16
68
- })
69
- }),
70
- /* @__PURE__ */ t("button", {
71
- class: "ck-viewer-btn",
72
- ref: p,
73
- "aria-label": r("close"),
74
- onClick: u,
75
- children: /* @__PURE__ */ t(o, {
76
- name: "close",
77
- size: 16
78
- })
79
- })
80
- ]
81
- }),
82
- /* @__PURE__ */ t("img", {
83
- class: "ck-viewer-img",
84
- src: m.src,
85
- alt: m.name
86
- }),
87
- h ? /* @__PURE__ */ t(a, { children: [/* @__PURE__ */ t("button", {
88
- class: "ck-viewer-nav",
89
- "data-dir": "prev",
90
- "aria-label": r("previousImage"),
91
- onClick: () => g(-1),
92
- children: /* @__PURE__ */ t(o, {
93
- name: "chevron",
94
- size: 18
95
- })
96
- }), /* @__PURE__ */ t("button", {
97
- class: "ck-viewer-nav",
98
- "data-dir": "next",
99
- "aria-label": r("nextImage"),
100
- onClick: () => g(1),
101
- children: /* @__PURE__ */ t(o, {
102
- name: "chevron",
103
- size: 18
104
- })
105
- })] }) : null
106
- ]
107
- });
108
- }
109
- //#endregion
110
- export { l as Viewer };
@@ -1,126 +0,0 @@
1
- import { p as e } from "./client-dZeNdizE.js";
2
- import { i as t, l as n, s as r, v as i } from "./i18n-DAJGndZ2.js";
3
- import { c as a, d as o } from "./start-C5-rebEU.js";
4
- //#region src/core/contract-lists.ts
5
- var s = [
6
- "👍",
7
- "❤️",
8
- "🎉",
9
- "👀",
10
- "✅",
11
- "🙏",
12
- "👎",
13
- "😄",
14
- "😍",
15
- "🤔",
16
- "😮",
17
- "😢",
18
- "🔥",
19
- "🚀",
20
- "💯",
21
- "👏",
22
- "🙌",
23
- "💡",
24
- "⚠️",
25
- "❌",
26
- "⭐",
27
- "🎨",
28
- "🐛",
29
- "✨"
30
- ], c = {
31
- png: "image/png",
32
- jpg: "image/jpeg",
33
- jpeg: "image/jpeg",
34
- webp: "image/webp",
35
- gif: "image/gif",
36
- pdf: "application/pdf",
37
- txt: "text/plain",
38
- csv: "text/csv",
39
- mp4: "video/mp4",
40
- webm: "video/webm",
41
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
42
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
43
- pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
44
- }, l = c, u = new Set(Object.values(c)), d = [...u, ...Object.keys(c).map((e) => `.${e}`)].join(",");
45
- function f(e, n, i) {
46
- let a = [...e], o = null;
47
- for (let e of n) {
48
- let n = u.has(e.type) ? e.type : e.type ? void 0 : l[e.name.split(".").pop()?.toLowerCase() ?? ""];
49
- n ? e.size > i ? o = r("fileTooBig", {
50
- name: e.name || "file",
51
- size: p(i)
52
- }) : a.length >= 10 ? o = t("tooManyFiles", 10) : a.push(n === e.type ? e : new File([e], e.name, {
53
- type: n,
54
- lastModified: e.lastModified
55
- })) : o = r("fileNotAllowed", { name: e.name || "file" });
56
- }
57
- return {
58
- files: a,
59
- problem: o
60
- };
61
- }
62
- function p(e) {
63
- return `${Math.max(1, Math.round(e / 1048576))} MB`;
64
- }
65
- function m(e) {
66
- return {
67
- onPaste: (t) => {
68
- let n = [...t.clipboardData?.files ?? []];
69
- n.length && (t.preventDefault(), e(n));
70
- },
71
- onDragOver: (e) => {
72
- e.dataTransfer?.types.includes("Files") && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
73
- },
74
- onDrop: (t) => {
75
- let n = [...t.dataTransfer?.files ?? []];
76
- n.length && (t.preventDefault(), e(n));
77
- }
78
- };
79
- }
80
- //#endregion
81
- //#region src/ui/card-bits.tsx
82
- function h(t, n, i, a) {
83
- return t.updateThread(n.id, { status: n.status }).catch((t) => (t instanceof e && t.status === 403 ? i({
84
- text: r("undoTooLate", { ref: n.reference }),
85
- tone: "error"
86
- }) : a(t), null));
87
- }
88
- function g(t) {
89
- return t instanceof e && (t.code === "widget_disabled" || t.code === "plan_required" || t.status >= 400 && t.status < 500 && t.status !== 408 && t.status !== 429) ? a(t) : null;
90
- }
91
- function _({ input: e, onFiles: t }) {
92
- return /* @__PURE__ */ n(i, { children: [/* @__PURE__ */ n("input", {
93
- ref: e,
94
- type: "file",
95
- multiple: !0,
96
- hidden: !0,
97
- accept: d,
98
- onChange: (e) => {
99
- let n = e.target;
100
- t(Array.from(n.files ?? [])), n.value = "";
101
- }
102
- }), /* @__PURE__ */ n("button", {
103
- class: "ck-ghost",
104
- onClick: () => e.current?.click(),
105
- "aria-label": r("attach"),
106
- title: r("attach"),
107
- children: /* @__PURE__ */ n(o, { name: "paperclip" })
108
- })] });
109
- }
110
- function v(e, t = {
111
- top: e.y,
112
- bottom: e.y
113
- }) {
114
- let n = Math.min(380, innerWidth - 24), r = e.x + 16, i = r + n > innerWidth - 12 && e.x - 16 - n >= 12 ? e.x - 16 - n : Math.min(Math.max(12, r), innerWidth - n - 12), a = innerHeight - (t.bottom + 16) - 12, o = t.top - 16 - 12, s = (e) => `min(560px, ${Math.max(240, Math.round(e))}px)`;
115
- return a >= 360 || a >= o ? {
116
- left: `${i}px`,
117
- top: `${Math.min(t.bottom + 16, innerHeight - 252)}px`,
118
- maxHeight: s(a)
119
- } : {
120
- left: `${i}px`,
121
- bottom: `${Math.max(12, innerHeight - t.top + 16)}px`,
122
- maxHeight: s(o)
123
- };
124
- }
125
- //#endregion
126
- export { f as a, h as i, g as n, m as o, v as r, s, _ as t };
@@ -1,41 +0,0 @@
1
- //#region src/ui/confetti.ts
2
- var e = [
3
- "#ff5733",
4
- "#ffcc00",
5
- "#34c759",
6
- "#007aff",
7
- "#af52de",
8
- "#ff2d92"
9
- ];
10
- function t(t) {
11
- if (!t || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
12
- let n = t.getRootNode(), r = n.host ? n.querySelector(".ck-root") : document.body;
13
- if (!r) return;
14
- let i = t.getBoundingClientRect(), a = document.createElement("canvas");
15
- a.className = "ck-confetti", a.setAttribute("aria-hidden", "true");
16
- let o = Math.min(2, devicePixelRatio || 1);
17
- a.width = innerWidth * o, a.height = innerHeight * o, r.appendChild(a);
18
- let s = a.getContext("2d");
19
- if (!s) return a.remove();
20
- s.scale(o, o);
21
- let c = i.left + i.width / 2, l = i.top + Math.min(i.height, 120), u = Array.from({ length: 40 }, (t, n) => {
22
- let r = -Math.PI / 2 + (Math.random() - .5) * 1.6, i = 5 + Math.random() * 5;
23
- return {
24
- x: c,
25
- y: l,
26
- vx: Math.cos(r) * i,
27
- vy: Math.sin(r) * i,
28
- size: 4 + Math.random() * 4,
29
- spin: Math.random() * 6,
30
- color: e[n % e.length]
31
- };
32
- }), d = performance.now(), f = (e) => {
33
- let t = e - d;
34
- s.clearRect(0, 0, innerWidth, innerHeight);
35
- for (let e of u) e.vy += .25, e.vx *= .99, e.x += e.vx, e.y += e.vy, s.save(), s.globalAlpha = Math.max(0, 1 - t / 900), s.translate(e.x, e.y), s.rotate(e.spin * t / 300), s.fillStyle = e.color, s.fillRect(-e.size / 2, -e.size / 4, e.size, e.size / 2), s.restore();
36
- t < 900 ? requestAnimationFrame(f) : a.remove();
37
- };
38
- requestAnimationFrame(f);
39
- }
40
- //#endregion
41
- export { t as celebrate };
@@ -1,51 +0,0 @@
1
- //#region src/ui/drafts.ts
2
- var e = "commentkit:draft:v2:", t = !1;
3
- function n(e) {
4
- let t = 2166136261, n = 16777619;
5
- for (let r = 0; r < e.length; r++) {
6
- let i = e.charCodeAt(r);
7
- t = Math.imul(t ^ i, 16777619), n = Math.imul(n ^ i, 2166136261);
8
- }
9
- return (t >>> 0).toString(36) + (n >>> 0).toString(36);
10
- }
11
- function r(t, ...r) {
12
- return `${e}${t}:${n(r.map((e) => e ?? "").join(""))}`;
13
- }
14
- function i(e, t = Date.now()) {
15
- s(t);
16
- try {
17
- let n = JSON.parse(localStorage.getItem(e) ?? "null");
18
- if (n && typeof n.text == "string" && typeof n.at == "number" && t - n.at < 6048e5) return n.text;
19
- localStorage.removeItem(e);
20
- } catch {}
21
- return "";
22
- }
23
- function a(e, t, n = Date.now()) {
24
- try {
25
- t.trim() ? localStorage.setItem(e, JSON.stringify({
26
- text: t.slice(0, 1e4),
27
- at: n
28
- })) : localStorage.removeItem(e);
29
- } catch {}
30
- }
31
- function o(e) {
32
- a(e, "");
33
- }
34
- function s(n = Date.now(), r = !1) {
35
- if (!t || r) {
36
- t = !0;
37
- try {
38
- for (let t = localStorage.length - 1; t >= 0; t--) {
39
- let r = localStorage.key(t);
40
- if (!r?.startsWith(e)) continue;
41
- let i = 0;
42
- try {
43
- i = Number(JSON.parse(localStorage.getItem(r) ?? "null")?.at) || 0;
44
- } catch {}
45
- n - i >= 6048e5 && localStorage.removeItem(r);
46
- }
47
- } catch {}
48
- }
49
- }
50
- //#endregion
51
- export { a as i, r as n, i as r, o as t };
@@ -1,54 +0,0 @@
1
- import { askExtension as e } from "./extension-BFkXOmX5.js";
2
- import { t } from "./Composer-D1wbmdjF.js";
3
- //#region src/capture/extension.ts
4
- var n = 8e6, r = "[data-commentkit-host]", i = "#d4d4d8";
5
- function a(e = []) {
6
- let n = [t, ...e].join(","), i = [], a = (e) => {
7
- let o;
8
- try {
9
- o = e.querySelectorAll(n);
10
- } catch {
11
- o = e.querySelectorAll(t);
12
- }
13
- for (let t of o) {
14
- if (t.closest(r) || e instanceof ShadowRoot && e.host.closest(r)) continue;
15
- let n = t.getBoundingClientRect();
16
- n.width <= 0 || n.height <= 0 || n.right <= 0 || n.bottom <= 0 || n.left >= innerWidth || n.top >= innerHeight || i.push({
17
- x: n.left,
18
- y: n.top,
19
- w: n.width,
20
- h: n.height
21
- });
22
- }
23
- for (let t of e.querySelectorAll("*")) t.shadowRoot && !t.matches(r) && a(t.shadowRoot);
24
- };
25
- return a(document), i;
26
- }
27
- async function o(t = []) {
28
- let o = innerWidth, l = innerHeight, u = a(t), d = [...document.querySelectorAll(r)], f = d.map((e) => [e.style.getPropertyValue("visibility"), e.style.getPropertyPriority("visibility")]);
29
- d.forEach((e) => e.style.setProperty("visibility", "hidden", "important"));
30
- let p;
31
- try {
32
- await s(), await s(), p = (await e("capture"))?.dataUrl;
33
- } finally {
34
- d.forEach((e, t) => e.style.setProperty("visibility", f[t][0], f[t][1]));
35
- }
36
- if (typeof p != "string" || !p.startsWith("data:image/")) throw Error("The extension returned no screenshot.");
37
- let m = await c(p), h = m.width / Math.max(1, o), g = Math.min(h, 2, Math.sqrt(n / Math.max(1, o * l))), _ = document.createElement("canvas");
38
- _.width = Math.round(o * g), _.height = Math.round(l * g);
39
- let v = _.getContext("2d");
40
- if (!v) throw Error("Canvas is not available.");
41
- v.drawImage(m, 0, 0, _.width, _.height), v.fillStyle = i;
42
- for (let e of u) v.fillRect(e.x * g, e.y * g, e.w * g, e.h * g);
43
- return _;
44
- }
45
- function s() {
46
- return new Promise((e) => requestAnimationFrame(() => e()));
47
- }
48
- function c(e) {
49
- let [t, n = ""] = e.split(",", 2), r = atob(n), i = new Uint8Array(r.length);
50
- for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
51
- return createImageBitmap(new Blob([i], { type: t.slice(5).split(";")[0] }));
52
- }
53
- //#endregion
54
- export { o as captureTab };