@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.
- package/CHANGELOG.md +281 -582
- package/README.md +334 -154
- package/SECURITY.md +47 -46
- package/dist/node/THIRD_PARTY_NOTICES.txt +56 -0
- package/dist/node/browser.js +17 -0
- package/dist/node/cli/api.js +226 -0
- package/dist/node/cli/bin.js +18 -0
- package/dist/node/cli/credentials.js +268 -0
- package/dist/node/cli/doctor.js +725 -0
- package/dist/node/cli/format.js +54 -0
- package/dist/node/cli/init.js +372 -0
- package/dist/node/cli/main.js +519 -0
- package/dist/node/cli/mcp.js +114 -0
- package/dist/node/cli/open.js +20 -0
- package/dist/node/plugins/astro-B5y1Gtbf.js +31 -0
- package/dist/node/plugins/astro.js +26 -0
- package/dist/node/plugins/git-BIXLbL3f.js +92 -0
- package/dist/node/plugins/jsx-Bg4BdSph.js +7958 -0
- package/dist/node/plugins/next.js +48 -0
- package/dist/node/plugins/options-THop1K92.js +71 -0
- package/dist/node/plugins/transform-CKiAuSbk.js +1155 -0
- package/dist/node/plugins/vite-BdAYUW10.js +74 -0
- package/dist/node/plugins/vite.js +1 -0
- package/dist/node/plugins/webpack-R2U2DLlY.js +35 -0
- package/dist/node/plugins/webpack-loader.cjs +21 -0
- package/dist/node/plugins/webpack-loader.js +18 -0
- package/dist/node/plugins/webpack.js +1 -0
- package/dist/node/shared/endpoint.js +26 -0
- package/dist/node/shared/format.js +63 -0
- package/dist/node/types/astro.d.ts +11 -0
- package/dist/node/types/next.d.ts +34 -0
- package/dist/node/types/options.d.ts +59 -0
- package/dist/node/types/vite.d.ts +11 -0
- package/dist/node/types/webpack-loader.d.ts +22 -0
- package/dist/node/types/webpack.d.ts +27 -0
- package/dist/npm/THIRD_PARTY_NOTICES.txt +6 -6
- package/dist/npm/chunks/AgentSend-DxRJIYiz.js +68 -0
- package/dist/npm/chunks/Checklist-CnlfeSbc.js +282 -0
- package/dist/npm/chunks/Composer-B1bBVszY.js +725 -0
- package/dist/npm/chunks/Guest-vvNPz8h-.js +267 -0
- package/dist/npm/chunks/MarkupEditor-VCOXh9d2.js +338 -0
- package/dist/npm/chunks/Panel-F37vIL1K.js +1206 -0
- package/dist/npm/chunks/Settings-BGoZS2iV.js +231 -0
- package/dist/npm/chunks/Shortcuts-B2OMvczr.js +62 -0
- package/dist/npm/chunks/StyleEditor-CJ_d8Huf.js +46 -0
- package/dist/npm/chunks/StylePanel-yQzHHlY7.js +199 -0
- package/dist/npm/chunks/TaskFields-fmy6_HtK.js +289 -0
- package/dist/npm/chunks/ThreadCard-D51slKST.js +1113 -0
- package/dist/npm/chunks/Viewer-BOBadqmC.js +111 -0
- package/dist/npm/chunks/{agent-CqDO3JMA.js → agent-C1OQzBAm.js} +20 -21
- package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsQNVkHj.js} +109 -87
- package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-CAJ3XT8e.js} +73 -20
- package/dist/npm/chunks/card-bits-CAnzrqx3.js +53 -0
- package/dist/npm/chunks/{client-dZeNdizE.js → client-kNAo2TTG.js} +292 -285
- package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
- package/dist/npm/chunks/confetti-CkBdSu19.js +49 -0
- package/dist/npm/chunks/context-B8UAzve0.js +20 -0
- package/dist/npm/chunks/context-BuMl7A07.js +48 -0
- package/dist/npm/chunks/{de-CcPi8xdC.js → de-Dl18G48t.js} +64 -19
- package/dist/npm/chunks/dialog-GO04oC3D.js +3 -0
- package/dist/npm/chunks/dpop-U48QIQd7.js +96 -0
- package/dist/npm/chunks/drafts-B0ctr1g9.js +21 -0
- package/dist/npm/chunks/{es-DXgkjDCG.js → es-Dxk79lS9.js} +64 -19
- package/dist/npm/chunks/extension-CKFpPWmi.js +62 -0
- package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-E81hWyiT.js} +21 -14
- package/dist/npm/chunks/files-DyD5BZgp.js +114 -0
- package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-8BebGKYD.js} +121 -76
- package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-BIN6Yy_p.js} +65 -20
- package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
- package/dist/npm/chunks/i18n-DOBt8e9U.js +936 -0
- package/dist/npm/chunks/identify-CN-3xzqL.js +106 -0
- package/dist/npm/chunks/{it-DKiSCkiD.js → it-Cr6EwpPQ.js} +83 -38
- package/dist/npm/chunks/{ja-BI1WagDg.js → ja-Iy3s5aur.js} +62 -17
- package/dist/npm/chunks/late-words-B2bmZceJ.js +12 -0
- package/dist/npm/chunks/live-CelVeZfP.js +85 -0
- package/dist/npm/chunks/locale-D8Q4Q2Nt.js +26 -0
- package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
- package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-B84WHqqe.js} +65 -20
- package/dist/npm/chunks/page-key-DepmJzC1.js +62 -0
- package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-yTyqtxN0.js} +46 -46
- package/dist/npm/chunks/pkce-ChKGSW_4.js +8 -0
- package/dist/npm/chunks/placement-BF_HOUDD.js +74 -0
- package/dist/npm/chunks/privacy-BWUGlHw5.js +57 -0
- package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-DOkdlfoe.js} +64 -19
- package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-C79zF50C.js} +16 -15
- package/dist/npm/chunks/report-CrIqQZDI.js +44 -0
- package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
- package/dist/npm/chunks/show-BgVC8gWY.js +97 -0
- package/dist/npm/chunks/signin-Dd1rb2BP.js +75 -0
- package/dist/npm/chunks/{source-BQS2_xfB.js → source-pXVve2Cx.js} +2 -3
- package/dist/npm/chunks/src-BTMy4Gyc.js +208 -0
- package/dist/npm/chunks/start-DtVlpt7p.js +1878 -0
- package/dist/npm/chunks/states-sfTbjZz8.js +3 -0
- package/dist/npm/chunks/upload-MgPYqPyE.js +42 -0
- package/dist/npm/chunks/uploads-D49mywwz.js +1146 -0
- package/dist/npm/chunks/wrap-Bl0gbnFa.js +69 -0
- package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-Z5fQCb7G.js} +63 -18
- package/dist/npm/element.js +59 -23
- package/dist/npm/headless.js +7 -3
- package/dist/npm/index.js +3 -3
- package/dist/npm/react.js +19 -13
- package/dist/npm/svelte.js +29 -14
- package/dist/npm/types/adapters/react.d.ts +4 -1
- package/dist/npm/types/adapters/svelte.d.ts +4 -1
- package/dist/npm/types/adapters/vue.d.ts +35 -2
- package/dist/npm/types/anchor/index.d.ts +19 -0
- package/dist/npm/types/capture/privacy.d.ts +14 -0
- package/dist/npm/types/core/api.d.ts +20 -1
- package/dist/npm/types/core/auth.d.ts +47 -14
- package/dist/npm/types/core/client.d.ts +60 -4
- package/dist/npm/types/core/page-key.d.ts +42 -0
- package/dist/npm/types/core/types.d.ts +87 -4
- package/dist/npm/types/element.d.ts +17 -7
- package/dist/npm/types/headless.d.ts +2 -1
- package/dist/npm/types/index.d.ts +16 -6
- package/dist/npm/vue.js +45 -11
- package/package.json +95 -21
- package/dist/npm/chunks/AgentSend-DjFZSC0S.js +0 -64
- package/dist/npm/chunks/Checklist-BEz4IZdT.js +0 -259
- package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
- package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
- package/dist/npm/chunks/MarkupEditor-CPH4yKx4.js +0 -334
- package/dist/npm/chunks/Panel-DSoUAlbQ.js +0 -863
- package/dist/npm/chunks/Settings-C_qV4n7J.js +0 -206
- package/dist/npm/chunks/Shortcuts-ChnaribX.js +0 -60
- package/dist/npm/chunks/StyleEditor-DqZd6C5o.js +0 -44
- package/dist/npm/chunks/StylePanel-DMC3riYK.js +0 -199
- package/dist/npm/chunks/TaskFields-BfjjllMx.js +0 -272
- package/dist/npm/chunks/ThreadCard-DmKAelSL.js +0 -1026
- package/dist/npm/chunks/Viewer-mw69qSI5.js +0 -110
- package/dist/npm/chunks/card-bits-C7bIk5KX.js +0 -126
- package/dist/npm/chunks/confetti-DKeKR7-6.js +0 -41
- package/dist/npm/chunks/drafts-CpQdHhcK.js +0 -51
- package/dist/npm/chunks/extension-Gvei3opb.js +0 -54
- package/dist/npm/chunks/i18n-DAJGndZ2.js +0 -904
- package/dist/npm/chunks/live-MvvBdoGd.js +0 -34
- package/dist/npm/chunks/report-DoDVi1qT.js +0 -28
- package/dist/npm/chunks/src-C_oUnL0i.js +0 -150
- package/dist/npm/chunks/start-C5-rebEU.js +0 -1783
- package/dist/npm/chunks/upload-CzPAjktW.js +0 -42
- package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { a as e } from "./client-dZeNdizE.js";
|
|
2
|
-
import { f as t, l as n, m as r, n as i, s as a, u as o, v as s } from "./i18n-DAJGndZ2.js";
|
|
3
|
-
import { a as c, b as l, d as u, l as d, n as f } from "./start-C5-rebEU.js";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/ui/Settings.tsx
|
|
6
|
-
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)}");
|
|
7
|
-
var p = [
|
|
8
|
-
["auto", "themeSystem"],
|
|
9
|
-
["light", "themeLight"],
|
|
10
|
-
["dark", "themeDark"]
|
|
11
|
-
];
|
|
12
|
-
function m({ client: i, onClose: f, onShortcuts: m, onHide: g, onSignOut: _ }) {
|
|
13
|
-
let v = c(i.state, (e) => e.session), y = c(i.state, (e) => e.theme ?? i.options.theme ?? e.config?.appearance?.theme ?? "auto"), b = t(null), x = c(i.state, (e) => e.team), S = v?.role === "admin" || v?.role === "member", [C, w] = r(null), [T, E] = r(null);
|
|
14
|
-
o(() => {
|
|
15
|
-
S && (i.people().then((e) => w(e.filter((e) => e.role && e.role !== "reviewer")), () => w([])), i.usage().then(E, () => E(null)));
|
|
16
|
-
}, [S]), o(() => {
|
|
17
|
-
let e = b.current?.getRootNode()?.activeElement ?? document.activeElement;
|
|
18
|
-
return b.current?.focus({ preventScroll: !0 }), () => {
|
|
19
|
-
e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
|
|
20
|
-
};
|
|
21
|
-
}, []);
|
|
22
|
-
let D = (t) => {
|
|
23
|
-
e(t), i.state.set({ theme: t });
|
|
24
|
-
}, O = l(v?.dashboard_url), k = C?.find((e) => e.id === v?.person.id)?.role, A = v ? a(`role_${k === "owner" ? "owner" : v.role}`) : "";
|
|
25
|
-
return /* @__PURE__ */ n("div", {
|
|
26
|
-
class: "ck-scrim",
|
|
27
|
-
"data-commentkit-ui": !0,
|
|
28
|
-
onClick: (e) => e.target === e.currentTarget && f(),
|
|
29
|
-
children: /* @__PURE__ */ n("div", {
|
|
30
|
-
class: "ck-card ck-dialog ck-settings",
|
|
31
|
-
role: "dialog",
|
|
32
|
-
"aria-modal": "true",
|
|
33
|
-
"aria-labelledby": "ck-settings-title",
|
|
34
|
-
onKeyDown: (e) => {
|
|
35
|
-
e.stopPropagation(), e.key === "Escape" && f();
|
|
36
|
-
},
|
|
37
|
-
children: [/* @__PURE__ */ n("div", {
|
|
38
|
-
class: "ck-card-head",
|
|
39
|
-
children: [/* @__PURE__ */ n("h2", {
|
|
40
|
-
class: "ck-card-title",
|
|
41
|
-
id: "ck-settings-title",
|
|
42
|
-
children: a("settings")
|
|
43
|
-
}), /* @__PURE__ */ n("button", {
|
|
44
|
-
class: "ck-ghost",
|
|
45
|
-
ref: b,
|
|
46
|
-
"aria-label": a("close"),
|
|
47
|
-
onClick: f,
|
|
48
|
-
children: /* @__PURE__ */ n(u, { name: "close" })
|
|
49
|
-
})]
|
|
50
|
-
}), /* @__PURE__ */ n("div", {
|
|
51
|
-
class: "ck-card-body",
|
|
52
|
-
children: [
|
|
53
|
-
v ? /* @__PURE__ */ n("section", {
|
|
54
|
-
class: "ck-account",
|
|
55
|
-
"aria-label": a("account"),
|
|
56
|
-
children: [/* @__PURE__ */ n(d, { person: v.person }), /* @__PURE__ */ n("div", { children: [
|
|
57
|
-
/* @__PURE__ */ n("bdi", {
|
|
58
|
-
class: "ck-msg-name",
|
|
59
|
-
children: v.person.name
|
|
60
|
-
}),
|
|
61
|
-
v.email ? /* @__PURE__ */ n("div", {
|
|
62
|
-
class: "ck-muted",
|
|
63
|
-
children: /* @__PURE__ */ n("bdi", { children: v.email })
|
|
64
|
-
}) : null,
|
|
65
|
-
/* @__PURE__ */ n("div", {
|
|
66
|
-
class: "ck-muted",
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ n("bdi", { children: v.project.name }),
|
|
69
|
-
" · ",
|
|
70
|
-
A
|
|
71
|
-
]
|
|
72
|
-
})
|
|
73
|
-
] })]
|
|
74
|
-
}) : null,
|
|
75
|
-
/* @__PURE__ */ n("section", {
|
|
76
|
-
class: "ck-setting",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ n("h3", {
|
|
79
|
-
id: "ck-theme-label",
|
|
80
|
-
children: a("appearance")
|
|
81
|
-
}),
|
|
82
|
-
/* @__PURE__ */ n("div", {
|
|
83
|
-
class: "ck-segment",
|
|
84
|
-
role: "radiogroup",
|
|
85
|
-
"aria-labelledby": "ck-theme-label",
|
|
86
|
-
children: p.map(([e, t]) => /* @__PURE__ */ n("button", {
|
|
87
|
-
role: "radio",
|
|
88
|
-
"aria-checked": y === e,
|
|
89
|
-
onClick: () => D(e),
|
|
90
|
-
children: a(t)
|
|
91
|
-
}))
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ n("p", {
|
|
94
|
-
class: "ck-muted ck-setting-hint",
|
|
95
|
-
children: a("appearanceHint")
|
|
96
|
-
})
|
|
97
|
-
]
|
|
98
|
-
}),
|
|
99
|
-
S && C?.length ? /* @__PURE__ */ n("section", {
|
|
100
|
-
class: "ck-setting",
|
|
101
|
-
children: [/* @__PURE__ */ n("h3", { children: a("team") }), /* @__PURE__ */ n("ul", {
|
|
102
|
-
class: "ck-team",
|
|
103
|
-
children: C.map((e) => /* @__PURE__ */ n("li", { children: [
|
|
104
|
-
/* @__PURE__ */ n("span", {
|
|
105
|
-
class: "ck-team-face",
|
|
106
|
-
children: [/* @__PURE__ */ n(d, { person: e }), x.some((t) => t.id === e.id) ? /* @__PURE__ */ n("span", {
|
|
107
|
-
class: "ck-online",
|
|
108
|
-
"aria-label": a("online")
|
|
109
|
-
}) : null]
|
|
110
|
-
}),
|
|
111
|
-
/* @__PURE__ */ n("bdi", { children: e.name }),
|
|
112
|
-
e.id === v?.person.id ? /* @__PURE__ */ n("span", {
|
|
113
|
-
class: "ck-muted",
|
|
114
|
-
children: [
|
|
115
|
-
"(",
|
|
116
|
-
a("you"),
|
|
117
|
-
")"
|
|
118
|
-
]
|
|
119
|
-
}) : null,
|
|
120
|
-
/* @__PURE__ */ n("span", {
|
|
121
|
-
class: "ck-muted ck-team-role",
|
|
122
|
-
children: a(`role_${e.role === "owner" ? "owner" : e.role === "admin" ? "admin" : "member"}`)
|
|
123
|
-
})
|
|
124
|
-
] }))
|
|
125
|
-
})]
|
|
126
|
-
}) : null,
|
|
127
|
-
S && T ? /* @__PURE__ */ n("section", {
|
|
128
|
-
class: "ck-setting",
|
|
129
|
-
children: [/* @__PURE__ */ n("h3", { children: a("storage") }), T.limit_bytes ? /* @__PURE__ */ n(s, { children: [/* @__PURE__ */ n("div", {
|
|
130
|
-
class: "ck-meter",
|
|
131
|
-
role: "meter",
|
|
132
|
-
"aria-valuemin": 0,
|
|
133
|
-
"aria-valuemax": T.limit_bytes,
|
|
134
|
-
"aria-valuenow": T.used_bytes,
|
|
135
|
-
"aria-label": a("storage"),
|
|
136
|
-
children: /* @__PURE__ */ n("span", {
|
|
137
|
-
style: { width: `${Math.min(100, Math.round(T.used_bytes / T.limit_bytes * 100))}%` },
|
|
138
|
-
"data-high": T.used_bytes / T.limit_bytes > .85 || void 0
|
|
139
|
-
})
|
|
140
|
-
}), /* @__PURE__ */ n("p", {
|
|
141
|
-
class: "ck-muted ck-setting-hint",
|
|
142
|
-
children: a("storageUsed", {
|
|
143
|
-
used: h(T.used_bytes),
|
|
144
|
-
limit: h(T.limit_bytes)
|
|
145
|
-
})
|
|
146
|
-
})] }) : /* @__PURE__ */ n("p", {
|
|
147
|
-
class: "ck-muted ck-setting-hint",
|
|
148
|
-
children: a("storageUsedOnly", { used: h(T.used_bytes) })
|
|
149
|
-
})]
|
|
150
|
-
}) : null,
|
|
151
|
-
/* @__PURE__ */ n("nav", {
|
|
152
|
-
class: "ck-setting-links",
|
|
153
|
-
"aria-label": a("settings"),
|
|
154
|
-
children: [
|
|
155
|
-
O ? /* @__PURE__ */ n("a", {
|
|
156
|
-
href: O,
|
|
157
|
-
target: "_blank",
|
|
158
|
-
rel: "noopener noreferrer",
|
|
159
|
-
children: [/* @__PURE__ */ n(u, {
|
|
160
|
-
name: "link",
|
|
161
|
-
size: 15
|
|
162
|
-
}), a("openDashboard")]
|
|
163
|
-
}) : null,
|
|
164
|
-
m ? /* @__PURE__ */ n("button", {
|
|
165
|
-
onClick: () => (f(), m()),
|
|
166
|
-
children: [/* @__PURE__ */ n(u, {
|
|
167
|
-
name: "info",
|
|
168
|
-
size: 15
|
|
169
|
-
}), a("shortcutsTitle")]
|
|
170
|
-
}) : null,
|
|
171
|
-
/* @__PURE__ */ n("button", {
|
|
172
|
-
onClick: g,
|
|
173
|
-
children: [/* @__PURE__ */ n(u, {
|
|
174
|
-
name: "close",
|
|
175
|
-
size: 15
|
|
176
|
-
}), a("hideWidget")]
|
|
177
|
-
}),
|
|
178
|
-
v ? /* @__PURE__ */ n("button", {
|
|
179
|
-
class: "ck-danger",
|
|
180
|
-
onClick: () => (f(), _()),
|
|
181
|
-
children: [/* @__PURE__ */ n(u, {
|
|
182
|
-
name: "user",
|
|
183
|
-
size: 15
|
|
184
|
-
}), a("signOut")]
|
|
185
|
-
}) : null
|
|
186
|
-
]
|
|
187
|
-
})
|
|
188
|
-
]
|
|
189
|
-
})]
|
|
190
|
-
})
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function h(e) {
|
|
194
|
-
let [t, n] = e >= 1e9 ? [e / 1e9, "gigabyte"] : e >= 1e6 ? [e / 1e6, "megabyte"] : [e / 1e3, "kilobyte"];
|
|
195
|
-
try {
|
|
196
|
-
return new Intl.NumberFormat(i(), {
|
|
197
|
-
style: "unit",
|
|
198
|
-
unit: n,
|
|
199
|
-
maximumFractionDigits: +(t < 10)
|
|
200
|
-
}).format(t);
|
|
201
|
-
} catch {
|
|
202
|
-
return `${t.toFixed(1)} ${n === "gigabyte" ? "GB" : n === "megabyte" ? "MB" : "KB"}`;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
//#endregion
|
|
206
|
-
export { m as Settings };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { f as e, l as t, s as n, u as r } from "./i18n-DAJGndZ2.js";
|
|
2
|
-
import { d as i, n as a } from "./start-C5-rebEU.js";
|
|
3
|
-
//#endregion
|
|
4
|
-
//#region src/ui/Shortcuts.tsx
|
|
5
|
-
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}");
|
|
6
|
-
var o = [
|
|
7
|
-
["C", "shortcutComment"],
|
|
8
|
-
["J / K", "shortcutNext"],
|
|
9
|
-
["E", "shortcutResolve"],
|
|
10
|
-
["Esc", "shortcutClose"],
|
|
11
|
-
["Enter", "shortcutSend"],
|
|
12
|
-
["Shift + Enter", "shortcutNewLine"],
|
|
13
|
-
["⌘ / Ctrl + B · I · E", "shortcutFormat"],
|
|
14
|
-
["⌘ / Ctrl + Shift + K", "shortcutToggle"],
|
|
15
|
-
["?", "shortcutHelp"]
|
|
16
|
-
];
|
|
17
|
-
function s({ onClose: a }) {
|
|
18
|
-
let s = e(null);
|
|
19
|
-
return r(() => {
|
|
20
|
-
let e = s.current?.getRootNode()?.activeElement ?? document.activeElement;
|
|
21
|
-
return s.current?.focus({ preventScroll: !0 }), () => {
|
|
22
|
-
e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
|
|
23
|
-
};
|
|
24
|
-
}, []), /* @__PURE__ */ t("div", {
|
|
25
|
-
class: "ck-scrim",
|
|
26
|
-
"data-commentkit-ui": !0,
|
|
27
|
-
onClick: (e) => e.target === e.currentTarget && a(),
|
|
28
|
-
children: /* @__PURE__ */ t("div", {
|
|
29
|
-
class: "ck-card ck-dialog",
|
|
30
|
-
role: "dialog",
|
|
31
|
-
"aria-modal": "true",
|
|
32
|
-
"aria-labelledby": "ck-shortcuts-title",
|
|
33
|
-
onKeyDown: (e) => {
|
|
34
|
-
e.stopPropagation(), e.key === "Escape" || e.key === "?" ? (e.preventDefault(), a()) : e.key === "Tab" && (e.preventDefault(), s.current?.focus());
|
|
35
|
-
},
|
|
36
|
-
children: [/* @__PURE__ */ t("div", {
|
|
37
|
-
class: "ck-card-head",
|
|
38
|
-
children: [/* @__PURE__ */ t("h2", {
|
|
39
|
-
class: "ck-card-title",
|
|
40
|
-
id: "ck-shortcuts-title",
|
|
41
|
-
children: n("shortcutsTitle")
|
|
42
|
-
}), /* @__PURE__ */ t("button", {
|
|
43
|
-
class: "ck-ghost",
|
|
44
|
-
ref: s,
|
|
45
|
-
"aria-label": n("close"),
|
|
46
|
-
onClick: a,
|
|
47
|
-
children: /* @__PURE__ */ t(i, { name: "close" })
|
|
48
|
-
})]
|
|
49
|
-
}), /* @__PURE__ */ t("dl", {
|
|
50
|
-
class: "ck-card-body ck-keys",
|
|
51
|
-
children: o.map(([e, r]) => /* @__PURE__ */ t("div", { children: [/* @__PURE__ */ t("dt", { children: /* @__PURE__ */ t("kbd", {
|
|
52
|
-
dir: "ltr",
|
|
53
|
-
children: e
|
|
54
|
-
}) }), /* @__PURE__ */ t("dd", { children: n(r) })] }))
|
|
55
|
-
})]
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
|
-
export { s as Shortcuts };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { d as e, f as t, l as n, m as r, s as i } from "./i18n-DAJGndZ2.js";
|
|
2
|
-
import { a, i as o, o as s } from "./uploads-tpLjiJdH.js";
|
|
3
|
-
import { StylePanel as c } from "./StylePanel-DMC3riYK.js";
|
|
4
|
-
//#region 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
|
-
//#endregion
|
|
44
|
-
export { l as StyleEditor };
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { l as e, m as t, s as n, u as r, v as i } from "./i18n-DAJGndZ2.js";
|
|
2
|
-
import { r as a, s as o } from "./uploads-tpLjiJdH.js";
|
|
3
|
-
import { n as s } from "./start-C5-rebEU.js";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/ui/StylePanel.tsx
|
|
6
|
-
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}}");
|
|
7
|
-
function c({ base: t, changes: r, onChange: i, onClose: o, actions: s }) {
|
|
8
|
-
let c = (e, n) => {
|
|
9
|
-
let a = r.filter((t) => t.property !== e);
|
|
10
|
-
if (n !== null && n === t[e]) return i(a);
|
|
11
|
-
let o = {
|
|
12
|
-
property: e,
|
|
13
|
-
from: t[e] || null,
|
|
14
|
-
to: n
|
|
15
|
-
}, s = r.findIndex((t) => t.property === e);
|
|
16
|
-
i(s === -1 ? [...r, o] : r.map((e, t) => t === s ? o : e));
|
|
17
|
-
};
|
|
18
|
-
return /* @__PURE__ */ e("div", {
|
|
19
|
-
class: "ck-style-panel",
|
|
20
|
-
role: "group",
|
|
21
|
-
"aria-label": n("adjustStyle"),
|
|
22
|
-
onKeyDown: (e) => {
|
|
23
|
-
e.stopPropagation(), e.key === "Escape" && o();
|
|
24
|
-
},
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ e("div", {
|
|
27
|
-
class: "ck-style-head",
|
|
28
|
-
children: [/* @__PURE__ */ e("strong", { children: n("adjustStyle") }), s ?? /* @__PURE__ */ e("button", {
|
|
29
|
-
class: "ck-btn ck-style-done",
|
|
30
|
-
onClick: o,
|
|
31
|
-
children: n("styleDone")
|
|
32
|
-
})]
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ e("p", {
|
|
35
|
-
class: "ck-muted ck-style-hint",
|
|
36
|
-
children: n("adjustStyleHint")
|
|
37
|
-
}),
|
|
38
|
-
/* @__PURE__ */ e("div", {
|
|
39
|
-
class: "ck-style-rows",
|
|
40
|
-
children: a.map(({ property: n, kind: a, options: o }) => {
|
|
41
|
-
let s = r.find((e) => e.property === n);
|
|
42
|
-
return /* @__PURE__ */ e(l, {
|
|
43
|
-
property: n,
|
|
44
|
-
kind: a,
|
|
45
|
-
options: o,
|
|
46
|
-
base: t[n] ?? "",
|
|
47
|
-
value: s ? s.to : t[n] ?? "",
|
|
48
|
-
changed: !!s,
|
|
49
|
-
onSet: (e) => c(n, e),
|
|
50
|
-
onReset: () => i(r.filter((e) => e.property !== n))
|
|
51
|
-
}, n);
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
function l({ property: a, kind: s, options: c, base: l, value: f, changed: p, onSet: m, onReset: h }) {
|
|
58
|
-
let [g, _] = t(f ?? ""), [v, y] = t(!1);
|
|
59
|
-
r(() => {
|
|
60
|
-
_(f ?? ""), y(!1);
|
|
61
|
-
}, [f]);
|
|
62
|
-
let b = `ck-style-${a}`, x = (e) => {
|
|
63
|
-
let t = e.trim();
|
|
64
|
-
_(e);
|
|
65
|
-
let n = t !== "" && o(t);
|
|
66
|
-
y(t !== "" && !n), n && m(t);
|
|
67
|
-
}, S = (e, t = !1) => {
|
|
68
|
-
let n = s === "choice" ? d(c ?? [], f ?? l, e) : u(a, f ?? l, e * (t ? 10 : 1));
|
|
69
|
-
n !== null && m(n);
|
|
70
|
-
};
|
|
71
|
-
return /* @__PURE__ */ e("div", {
|
|
72
|
-
class: "ck-style-row",
|
|
73
|
-
"data-changed": p || void 0,
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ e("label", {
|
|
76
|
-
for: b,
|
|
77
|
-
class: "ck-style-name",
|
|
78
|
-
children: /* @__PURE__ */ e("code", { children: a })
|
|
79
|
-
}),
|
|
80
|
-
/* @__PURE__ */ e("div", {
|
|
81
|
-
class: "ck-style-control",
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ e(i, { children: [
|
|
84
|
-
s === "color" ? /* @__PURE__ */ e("span", {
|
|
85
|
-
class: "ck-style-swatch",
|
|
86
|
-
"aria-hidden": "true",
|
|
87
|
-
style: { backgroundColor: f ?? l ?? "transparent" }
|
|
88
|
-
}) : null,
|
|
89
|
-
/* @__PURE__ */ e("input", {
|
|
90
|
-
id: b,
|
|
91
|
-
class: "ck-input ck-style-input",
|
|
92
|
-
type: "text",
|
|
93
|
-
spellcheck: !1,
|
|
94
|
-
autoComplete: "off",
|
|
95
|
-
maxLength: 120,
|
|
96
|
-
value: g,
|
|
97
|
-
placeholder: f === null ? n("styleRemoved") : "",
|
|
98
|
-
"aria-invalid": v,
|
|
99
|
-
"aria-describedby": v ? `${b}-error` : void 0,
|
|
100
|
-
onInput: (e) => x(e.target.value),
|
|
101
|
-
onKeyDown: (e) => {
|
|
102
|
-
s !== "color" && s !== "box" && (e.key === "ArrowUp" || e.key === "ArrowDown") && (e.preventDefault(), S(e.key === "ArrowUp" ? 1 : -1, e.shiftKey));
|
|
103
|
-
}
|
|
104
|
-
}),
|
|
105
|
-
s === "length" || s === "number" ? /* @__PURE__ */ e("span", {
|
|
106
|
-
class: "ck-style-steps",
|
|
107
|
-
children: [/* @__PURE__ */ e("button", {
|
|
108
|
-
class: "ck-ghost ck-ghost-sm",
|
|
109
|
-
"aria-label": n("styleDecrease", { property: a }),
|
|
110
|
-
onClick: () => S(-1),
|
|
111
|
-
children: "−"
|
|
112
|
-
}), /* @__PURE__ */ e("button", {
|
|
113
|
-
class: "ck-ghost ck-ghost-sm",
|
|
114
|
-
"aria-label": n("styleIncrease", { property: a }),
|
|
115
|
-
onClick: () => S(1),
|
|
116
|
-
children: "+"
|
|
117
|
-
})]
|
|
118
|
-
}) : s === "choice" ? /* @__PURE__ */ e("span", {
|
|
119
|
-
class: "ck-style-steps",
|
|
120
|
-
children: [/* @__PURE__ */ e("button", {
|
|
121
|
-
class: "ck-ghost ck-ghost-sm",
|
|
122
|
-
"aria-label": n("stylePrevious", { property: a }),
|
|
123
|
-
onClick: () => S(-1),
|
|
124
|
-
children: "‹"
|
|
125
|
-
}), /* @__PURE__ */ e("button", {
|
|
126
|
-
class: "ck-ghost ck-ghost-sm",
|
|
127
|
-
"aria-label": n("styleNext", { property: a }),
|
|
128
|
-
onClick: () => S(1),
|
|
129
|
-
children: "›"
|
|
130
|
-
})]
|
|
131
|
-
}) : null
|
|
132
|
-
] }),
|
|
133
|
-
p ? /* @__PURE__ */ e("button", {
|
|
134
|
-
class: "ck-ghost ck-ghost-sm",
|
|
135
|
-
"aria-label": n("styleReset", { property: a }),
|
|
136
|
-
title: n("styleReset", { property: a }),
|
|
137
|
-
onClick: h,
|
|
138
|
-
children: /* @__PURE__ */ e("svg", {
|
|
139
|
-
width: "13",
|
|
140
|
-
height: "13",
|
|
141
|
-
viewBox: "0 0 24 24",
|
|
142
|
-
fill: "none",
|
|
143
|
-
stroke: "currentColor",
|
|
144
|
-
"stroke-width": "2.2",
|
|
145
|
-
"stroke-linecap": "round",
|
|
146
|
-
"stroke-linejoin": "round",
|
|
147
|
-
"aria-hidden": "true",
|
|
148
|
-
children: /* @__PURE__ */ e("path", { d: "M4 9h11a5 5 0 0 1 0 10H9M8 5L4 9l4 4" })
|
|
149
|
-
})
|
|
150
|
-
}) : null,
|
|
151
|
-
f === null ? null : /* @__PURE__ */ e("button", {
|
|
152
|
-
class: "ck-ghost ck-ghost-sm",
|
|
153
|
-
"aria-label": n("styleRemoveValue", { property: a }),
|
|
154
|
-
title: n("styleRemoveValue", { property: a }),
|
|
155
|
-
onClick: () => m(null),
|
|
156
|
-
children: /* @__PURE__ */ e("svg", {
|
|
157
|
-
width: "12",
|
|
158
|
-
height: "12",
|
|
159
|
-
viewBox: "0 0 24 24",
|
|
160
|
-
fill: "none",
|
|
161
|
-
stroke: "currentColor",
|
|
162
|
-
"stroke-width": "2.2",
|
|
163
|
-
"stroke-linecap": "round",
|
|
164
|
-
"aria-hidden": "true",
|
|
165
|
-
children: /* @__PURE__ */ e("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
166
|
-
})
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
}),
|
|
170
|
-
v ? /* @__PURE__ */ e("span", {
|
|
171
|
-
class: "ck-error",
|
|
172
|
-
id: `${b}-error`,
|
|
173
|
-
role: "alert",
|
|
174
|
-
children: n("styleInvalid")
|
|
175
|
-
}) : null
|
|
176
|
-
]
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
function u(e, t, n) {
|
|
180
|
-
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;
|
|
181
|
-
if (!i) return null;
|
|
182
|
-
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;
|
|
183
|
-
return e === "opacity" && (c = Math.min(1, Math.max(0, c))), e === "font-weight" && (c = Math.min(900, Math.max(100, c))), [
|
|
184
|
-
"font-size",
|
|
185
|
-
"border-width",
|
|
186
|
-
"border-radius",
|
|
187
|
-
"width",
|
|
188
|
-
"height",
|
|
189
|
-
"gap",
|
|
190
|
-
"line-height"
|
|
191
|
-
].includes(e) && (c = Math.max(0, c)), `${Math.round(c * 100) / 100}${o}`;
|
|
192
|
-
}
|
|
193
|
-
function d(e, t, n) {
|
|
194
|
-
if (!e.length) return null;
|
|
195
|
-
let r = e.indexOf(t);
|
|
196
|
-
return r === -1 ? n === 1 ? e[0] : e[e.length - 1] : e[(r + n + e.length) % e.length];
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
export { c as StylePanel };
|