@commentkit/comment-kit 2.1.0 → 2.1.2

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 (66) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/npm/chunks/{AgentSend-pA7Ufvye.js → AgentSend-DhG61w_r.js} +3 -3
  3. package/dist/npm/chunks/{Checklist-Cn9skOYK.js → Checklist-C2q5KzWe.js} +9 -8
  4. package/dist/npm/chunks/{Composer-D7H-pzGa.js → Composer-Dj0YAYOR.js} +32 -31
  5. package/dist/npm/chunks/{DatePicker-Nta5a1xD.js → DatePicker-TshUaQHj.js} +3 -3
  6. package/dist/npm/chunks/{Guest-Bi7hlzhs.js → Guest-bAxvxjbL.js} +6 -5
  7. package/dist/npm/chunks/{MarkupEditor-WU3USeTk.js → MarkupEditor-DnViTOOC.js} +9 -8
  8. package/dist/npm/chunks/{Panel-DhAzbUbC.js → Panel-C3_NURrp.js} +287 -286
  9. package/dist/npm/chunks/{Settings-BmKqPX40.js → Settings-BM7pWbwd.js} +19 -18
  10. package/dist/npm/chunks/{Shortcuts-Bl-c0Sez.js → Shortcuts-CFDTnP5H.js} +6 -6
  11. package/dist/npm/chunks/SignInFirst-CeiPhLx0.js +36 -0
  12. package/dist/npm/chunks/{StyleEditor-D6fUnlwq.js → StyleEditor-BUZrhAY6.js} +4 -4
  13. package/dist/npm/chunks/{StylePanel-C-Gikxt1.js → StylePanel-CFp-U7qa.js} +3 -3
  14. package/dist/npm/chunks/TaskFields-C4GddJTi.js +652 -0
  15. package/dist/npm/chunks/{ThreadCard-d_3pUB5V.js → ThreadCard-CwClbMNh.js} +48 -47
  16. package/dist/npm/chunks/{Viewer-BULQsi9-.js → Viewer-oM3stPeq.js} +3 -3
  17. package/dist/npm/chunks/{agent-DHdhIJ3s.js → agent-DfUu5BAp.js} +12 -12
  18. package/dist/npm/chunks/{ar-B5UszrQp.js → ar-DtfC6tHi.js} +2 -0
  19. package/dist/npm/chunks/{card-bits-cV8GdFWX.js → card-bits-BXOCnmcQ.js} +5 -5
  20. package/dist/npm/chunks/{client-Cv8ddtuM.js → client-BqcfSisZ.js} +7 -7
  21. package/dist/npm/chunks/{confetti-B9zlyILU.js → confetti-CM1XHlrM.js} +1 -1
  22. package/dist/npm/chunks/{context-CsHnabaA.js → context-0MfEgoip.js} +1 -1
  23. package/dist/npm/chunks/{de-BE0Aaq8u.js → de-CSyX5Cz-.js} +2 -0
  24. package/dist/npm/chunks/{dpop-CwW9ifkq.js → dpop-CHzhM9ud.js} +1 -1
  25. package/dist/npm/chunks/{entrance-Bn_5M9uO.js → entrance-D7kmBxF3.js} +29 -29
  26. package/dist/npm/chunks/{es-BQviao4d.js → es-D7SAi7fz.js} +2 -0
  27. package/dist/npm/chunks/{extension-DXhz81XD.js → extension-PWW2UQD7.js} +1 -1
  28. package/dist/npm/chunks/{extension-CnQTDC1j.js → extension-TF7pIF_W.js} +2 -2
  29. package/dist/npm/chunks/{files-DLEr_wmh.js → files-BkHuRlcW.js} +2 -2
  30. package/dist/npm/chunks/{fr-C5gu6A06.js → fr-CIr2nUyu.js} +2 -0
  31. package/dist/npm/chunks/{hi-DXfQ5EvY.js → hi-BTocxOL5.js} +2 -0
  32. package/dist/npm/chunks/{i18n-Mgs9VOuk.js → i18n-CDw_D17c.js} +10 -10
  33. package/dist/npm/chunks/{icons-_C6ZWmBY.js → icons-BJLm_C0M.js} +1 -1
  34. package/dist/npm/chunks/{identify-BnQGJOa0.js → identify-CoQ4rxaI.js} +1 -1
  35. package/dist/npm/chunks/{it-BPHt13FV.js → it-DCExRo0r.js} +2 -0
  36. package/dist/npm/chunks/{ja-BkCqyKR0.js → ja-CgWpTdWi.js} +2 -0
  37. package/dist/npm/chunks/{late-words-D4Oo_yhJ.js → late-words-QnNheaDY.js} +2 -0
  38. package/dist/npm/chunks/{live-DXcxj_Af.js → live-HKWO5Tsg.js} +23 -21
  39. package/dist/npm/chunks/{nl-DZxdLLMU.js → nl-DhTQ8oJ_.js} +2 -0
  40. package/dist/npm/chunks/{page-key-UqAozdZi.js → page-key-z6o1r8Uu.js} +1 -1
  41. package/dist/npm/chunks/{pick-C20RVUas.js → pick-Bai3lMZX.js} +1 -1
  42. package/dist/npm/chunks/{pkce-BPvWoBrr.js → pkce-B6VU0dtv.js} +1 -1
  43. package/dist/npm/chunks/{pt-BR-lA9mJ05F.js → pt-BR-DrO6LV4n.js} +2 -0
  44. package/dist/npm/chunks/{report-BjUgUNnT.js → report-D-yxx5uK.js} +1 -1
  45. package/dist/npm/chunks/sheet-77GHVTpR.js +18 -0
  46. package/dist/npm/chunks/{show-BinoJyED.js → show-C3bJFyaD.js} +12 -10
  47. package/dist/npm/chunks/{signin-C2jjsxz9.js → signin-Bq2KYFLY.js} +3 -3
  48. package/dist/npm/chunks/{source-NuflODx3.js → source-W_nJm3Ym.js} +1 -1
  49. package/dist/npm/chunks/{src-9o2Ocq8d.js → src-BFu9DgRc.js} +57 -52
  50. package/dist/npm/chunks/{start-Cbx6rMrr.js → start-Dgw3mSp8.js} +524 -513
  51. package/dist/npm/chunks/{upload-C4NpM-jE.js → upload-b0nY04eW.js} +1 -1
  52. package/dist/npm/chunks/{uploads-CY4bDbaI.js → uploads-Df4mLJ9O.js} +199 -198
  53. package/dist/npm/chunks/waiting-BRtT3ZZT.js +54 -0
  54. package/dist/npm/chunks/wrap-BuWw3zAq.js +69 -0
  55. package/dist/npm/chunks/{zh-CN-yqaDHwBx.js → zh-CN-Bb8UzT1V.js} +2 -0
  56. package/dist/npm/element.js +1 -1
  57. package/dist/npm/headless.js +2 -2
  58. package/dist/npm/index.js +2 -2
  59. package/dist/npm/react.js +1 -1
  60. package/dist/npm/svelte.js +1 -1
  61. package/dist/npm/types/core/client.d.ts +2 -0
  62. package/dist/npm/vue.js +1 -1
  63. package/package.json +1 -1
  64. package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +0 -35
  65. package/dist/npm/chunks/TaskFields-CaKi523b.js +0 -617
  66. package/dist/npm/chunks/wrap-D-xTKIzj.js +0 -69
@@ -1,617 +0,0 @@
1
- import { n as e } from "./src-9o2Ocq8d.js";
2
- import { _ as t, c as n, d as r, m as i, n as a, p as o, u as s, v as c } from "./i18n-Mgs9VOuk.js";
3
- import { i as l, n as u, r as d, t as f } from "./icons-_C6ZWmBY.js";
4
- import { r as p } from "./context-CsHnabaA.js";
5
- import { C as m, I as h, M as g, c as _, x as v, y } from "./start-Cbx6rMrr.js";
6
- // src/ui/TaskFields.tsx
7
- _(".ck-card{--ck-p-urgent:#d2000f;--ck-p-high:#c02f00;--ck-p-medium:#af4800;--ck-p-low:#165af0}:host([data-theme=dark]) .ck-card{--ck-p-urgent:#ff6467;--ck-p-high:#ff8904;--ck-p-medium:#ffb900;--ck-p-low:#51a2ff}.ck-sr{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.ck-fields{border-bottom:1px solid var(--ck-hairline);flex-wrap:wrap;gap:4px;padding:6px 10px;display:flex}.ck-card>.ck-fields[data-read]{overscroll-behavior:contain;max-height:76px;overflow-y:auto}.ck-task-draft{border:0;margin:8px -6px 0;padding:0}.ck-fld{min-width:0;max-width:100%;position:relative}.ck-field-btn{border-radius:var(--ck-radius-sm);max-width:140px;height:28px;color:var(--ck-text-muted);font-size:var(--ck-fs-md);white-space:nowrap;transition:background-color var(--ck-fast), color var(--ck-fast), scale var(--ck-fast) ease-out;background:0 0;border:0;align-items:center;gap:6px;padding:0 6px;font-weight:500;line-height:16px;display:inline-flex;position:relative}.ck-field-btn[data-set]{color:var(--ck-text)}.ck-field-btn bdi{text-overflow:ellipsis;min-width:0;overflow:hidden}.ck-field-btn svg,.ck-fv svg{flex:none}.ck-fv{display:contents}.ck-field-btn[aria-expanded=true]{background:var(--ck-bg-hover)}button.ck-field-btn:active{scale:.96}.ck-field-btn-icon{flex:none;display:inline-flex}:-webkit-any(.ck-field-btn,.ck-field-btn-icon)[data-priority] svg{color:var(--ck-text-muted)}:is(.ck-field-btn,.ck-field-btn-icon)[data-priority] svg{color:var(--ck-text-muted)}:-webkit-any(.ck-field-btn,.ck-field-btn-icon)[data-priority=urgent] svg{color:var(--ck-p-urgent)}:is(.ck-field-btn,.ck-field-btn-icon)[data-priority=urgent] svg{color:var(--ck-p-urgent)}:-webkit-any(.ck-field-btn,.ck-field-btn-icon)[data-priority=high] svg{color:var(--ck-p-high)}:is(.ck-field-btn,.ck-field-btn-icon)[data-priority=high] svg{color:var(--ck-p-high)}:-webkit-any(.ck-field-btn,.ck-field-btn-icon)[data-priority=medium] svg{color:var(--ck-p-medium)}:is(.ck-field-btn,.ck-field-btn-icon)[data-priority=medium] svg{color:var(--ck-p-medium)}:-webkit-any(.ck-field-btn,.ck-field-btn-icon)[data-priority=low] svg{color:var(--ck-p-low)}:is(.ck-field-btn,.ck-field-btn-icon)[data-priority=low] svg{color:var(--ck-p-low)}.ck-field-btn[data-tone=overdue]{color:var(--ck-danger)}.ck-field-btn[data-tone=soon]{color:var(--ck-warning)}.ck-faces-sm{flex:none;display:inline-flex}.ck-faces-sm .ck-avatar{--ck-av:20px;background:var(--ck-bg-hover);color:var(--ck-text);box-shadow:0 0 0 2px var(--ck-bg);font-size:10px;font-weight:600}.ck-faces-sm .ck-avatar+.ck-avatar{margin-inline-start:-6px}.ck-av-none{border:1px dashed var(--ck-control);border-radius:50%;flex:none;width:20px;height:20px}.ck-dots{flex:none;gap:2px;display:inline-flex}.ck-swatch{border-radius:50%;flex:none;width:8px;height:8px}.ck-date-wait{width:242px;height:290px}.ck-task-menu{z-index:2;top:calc(100% + 4px);overscroll-behavior:contain;border-radius:var(--ck-radius-md);background:var(--ck-bg);min-width:192px;max-width:min(280px,100vw - 48px);max-height:280px;box-shadow:var(--ck-shadow);transform-origin:0 0;animation:ck-menu-in var(--ck-fast) var(--ck-ease);border:1px solid #0000;padding:4px;position:absolute;overflow:auto}.ck-task-menu: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:0}.ck-task-menu: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:0}.ck-task-menu:-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:0}.ck-task-menu: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:0}.ck-root[dir=rtl] .ck-task-menu,.ck-task-menu[data-flip]{transform-origin:100% 0}.ck-root[dir=rtl] .ck-task-menu[data-flip]{transform-origin:0 0}@keyframes ck-menu-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}}.ck-task-menu[data-wide]{width:288px;max-width:calc(100vw - 48px)}.ck-task-menu[role=dialog]{width:260px;max-width:calc(100vw - 48px);max-height:none;padding:8px;overflow:visible}.ck-menu-rows{display:grid}.ck-menu-row{border-radius:var(--ck-radius-sm);width:100%;min-height:32px;color:var(--ck-text);font-size:var(--ck-fs-md);text-align:start;transition:background-color var(--ck-fast);background:0 0;border:0;align-items:center;gap:8px;padding:0 8px;display:flex}.ck-menu-row:focus-visible{outline-offset:-2px}.ck-menu-row:focus{background:var(--ck-bg-hover)}.ck-menu-name,.ck-menu-two-line{overflow-wrap:anywhere;flex:1;min-width:0}.ck-menu-two-line{padding:6px 0;line-height:1.35;display:grid}.ck-menu-help{color:var(--ck-text-muted);font-size:var(--ck-fs-sm)}.ck-menu-check{opacity:0;flex:none;display:inline-flex}.ck-menu-row[aria-checked=true] .ck-menu-check{opacity:1}.ck-task-menu .ck-check{border-radius:var(--ck-radius-sm);min-height:32px;color:var(--ck-text);transition:background-color var(--ck-fast);align-items:center;margin:0;padding:4px 8px}.ck-task-menu .ck-check input{margin:0}.ck-task-menu .ck-check bdi{overflow-wrap:anywhere;min-width:0}.ck-task-menu .ck-check:has(input:focus-visible){background:var(--ck-bg-hover)}@media (hover:hover){button.ck-field-btn:hover,.ck-task-menu .ck-check:hover,.ck-menu-row:hover{background:var(--ck-bg-hover)}}@media (pointer:coarse){button.ck-field-btn:after{content:\"\";height:44px;position:absolute;top:50%;left:0;right:0;translate:0 -50%}.ck-task-menu .ck-check,.ck-menu-row{min-height:44px}}.ck-task-menu:has(.ck-people){flex-direction:column;width:240px;padding:0;display:flex;overflow:hidden}.ck-people{flex-direction:column;min-height:0;display:flex}.ck-people-find{border-bottom:1px solid var(--ck-hairline);color:var(--ck-text-muted);align-items:center;gap:8px;padding:0 12px;display:flex}.ck-people-search{min-width:0;height:32px;color:var(--ck-text);font-size:var(--ck-fs-md);background:0 0;border:0;flex:1;padding:0}.ck-root .ck-people-search:focus-visible{outline:none}.ck-people-list{overscroll-behavior:contain;max-height:248px;padding:4px;overflow:auto}.ck-person{border-radius:var(--ck-radius-sm);min-height:32px;color:var(--ck-text);font-size:var(--ck-fs-md);cursor:pointer;align-items:center;gap:8px;padding:0 8px;display:flex}.ck-person[data-active]{background:var(--ck-bg-hover)}.ck-person .ck-avatar{--ck-av:20px;background:var(--ck-bg-hover);color:var(--ck-text);font-size:9px;font-weight:600}.ck-person[data-active] .ck-avatar{background:var(--ck-bg)}.ck-person-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.ck-person[aria-selected=true] .ck-person-name{font-weight:500}.ck-person[aria-selected=true] .ck-menu-check{opacity:1}.ck-people-note{color:var(--ck-text-muted);font-size:var(--ck-fs-sm);text-wrap:pretty;padding:8px}@media (hover:hover){.ck-person:hover{background:var(--ck-bg-hover)}}@media (pointer:coarse){.ck-person{min-height:44px}.ck-people-search{height:44px;font-size:var(--ck-fs-lg)}}@media (max-width:520px){.ck-task-menu[role=dialog]{width:calc(100vw - 48px)}.ck-task-menu:has(.ck-people){width:calc(100vw - 48px)}.ck-people-list{max-height:min(280px,45dvh)}}.ck-card{--ck-st-open:#44403b;--ck-st-progress:#1447e6;--ck-st-review:#7008e7;--ck-st-resolved:#007a55;--ck-st-closed:#52525c}:host([data-theme=dark]) .ck-card{--ck-st-open:#d6d3d1;--ck-st-progress:#8ec5ff;--ck-st-review:#c4b4ff;--ck-st-resolved:#5ee9b5;--ck-st-closed:#9f9fa9}.ck-status-field,.ck-status-badge{--ck-st:var(--ck-st-open);min-width:0}:-webkit-any(.ck-status-field,.ck-status-badge)[data-status=in_progress]{--ck-st:var(--ck-st-progress)}:is(.ck-status-field,.ck-status-badge)[data-status=in_progress]{--ck-st:var(--ck-st-progress)}:-webkit-any(.ck-status-field,.ck-status-badge)[data-status=in_review]{--ck-st:var(--ck-st-review)}:is(.ck-status-field,.ck-status-badge)[data-status=in_review]{--ck-st:var(--ck-st-review)}:-webkit-any(.ck-status-field,.ck-status-badge)[data-status=resolved]{--ck-st:var(--ck-st-resolved)}:is(.ck-status-field,.ck-status-badge)[data-status=resolved]{--ck-st:var(--ck-st-resolved)}:-webkit-any(.ck-status-field,.ck-status-badge)[data-status=closed]{--ck-st:var(--ck-st-closed)}:is(.ck-status-field,.ck-status-badge)[data-status=closed]{--ck-st:var(--ck-st-closed)}.ck-status-field .ck-status-i{color:var(--ck-st)}.ck-status-field>.ck-fld .ck-field-btn{max-width:180px}.ck-status-badge{border-radius:var(--ck-radius-sm);background:var(--ck-bg-muted);background:color-mix(in srgb, var(--ck-st) 10%, var(--ck-bg));color:var(--ck-st);font-size:var(--ck-fs-sm);white-space:nowrap;align-items:center;gap:4px;padding:2px 6px;font-weight:500;display:inline-flex;overflow:hidden}.ck-status-badge>span{text-overflow:ellipsis;overflow:hidden}.ck-status-badge svg{flex:none}.ck-thread-head .ck-card-title{flex:0 auto}");
8
- var b = [
9
- "none",
10
- "low",
11
- "medium",
12
- "high",
13
- "urgent"
14
- ], x = /* @__PURE__ */ new WeakMap();
15
- function S(e) {
16
- let t = x.get(e);
17
- return t || (t = Promise.all([e.people().catch(() => []), e.labels().catch(() => [])]).then(([e, t]) => ({
18
- people: e.filter((e) => e.assignable && e.type === "user" && /^\d+$/.test(e.id ?? "")),
19
- labels: t
20
- })), x.set(e, t)), t;
21
- }
22
- function C(e) {
23
- return /^\d{4}-\d{2}-\d{2}/.exec(e ?? "")?.[0] ?? "";
24
- }
25
- function w(e) {
26
- let [t, n, r] = e.split("-").map(Number);
27
- try {
28
- return new Date(t, n - 1, r).toLocaleDateString(a(), {
29
- day: "numeric",
30
- month: "short",
31
- year: "numeric"
32
- });
33
- } catch {
34
- return e;
35
- }
36
- }
37
- var T = (e) => /^#[0-9a-f]{6}$/i.test(e) ? e : "transparent";
38
- function E(e, t = /* @__PURE__ */ new Date()) {
39
- let [n, r, i] = e.split("-").map(Number);
40
- return Math.round((new Date(n, r - 1, i).getTime() - new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime()) / 864e5);
41
- }
42
- function D(e, t = /* @__PURE__ */ new Date()) {
43
- let r = E(e, t);
44
- if (r === 0) return n("dueToday");
45
- if (r === 1) return n("tomorrow");
46
- if (r === -1) return n("dueYesterday");
47
- let [i, o, s] = e.split("-").map(Number);
48
- try {
49
- return new Date(i, o - 1, s).toLocaleDateString(a(), {
50
- month: "short",
51
- day: "numeric",
52
- ...i === t.getFullYear() ? {} : { year: "numeric" }
53
- });
54
- } catch {
55
- return e;
56
- }
57
- }
58
- function O(e, t) {
59
- if (!e || t === "resolved" || t === "closed") return;
60
- let n = E(e);
61
- return n < 0 ? "overdue" : n <= 2 ? "soon" : void 0;
62
- }
63
- var k = (e) => e.length > 1 ? `${e[0]} +${e.length - 1}` : e[0] ?? "";
64
- function A({ people: e }) {
65
- return e.length ? /* @__PURE__ */ s("span", {
66
- class: "ck-faces-sm",
67
- "aria-hidden": "true",
68
- children: e.slice(0, 3).map((e) => /* @__PURE__ */ s("span", {
69
- class: "ck-avatar",
70
- children: e.avatar_url && /^https:\/\//.test(e.avatar_url) ? /* @__PURE__ */ s("img", {
71
- src: e.avatar_url,
72
- alt: "",
73
- referrerPolicy: "no-referrer"
74
- }) : [...e.name][0]?.toUpperCase() ?? "?"
75
- }))
76
- }) : /* @__PURE__ */ s("span", {
77
- class: "ck-av-none",
78
- "aria-hidden": "true"
79
- });
80
- }
81
- function j({ labels: e }) {
82
- return e.length ? /* @__PURE__ */ s("span", {
83
- class: "ck-dots",
84
- "aria-hidden": "true",
85
- children: e.slice(0, 3).map((e) => /* @__PURE__ */ s("span", {
86
- class: "ck-swatch",
87
- style: { background: T(e.color) }
88
- }))
89
- }) : /* @__PURE__ */ s(u, {
90
- name: "tag",
91
- size: 14
92
- });
93
- }
94
- function M(e) {
95
- let t = n(`priority_${e}`);
96
- return {
97
- label: n("priority"),
98
- text: e === "none" ? n("priority") : t,
99
- spoken: t,
100
- set: e !== "none",
101
- icon: /* @__PURE__ */ s(u, {
102
- name: d[e],
103
- size: 14
104
- }),
105
- priority: e
106
- };
107
- }
108
- function N(e) {
109
- let t = e.map((e) => e.name);
110
- return {
111
- label: n("assignee"),
112
- text: t.length ? k(t) : n("assignee"),
113
- spoken: t.length ? t.join(", ") : n("unassigned"),
114
- set: !!t.length,
115
- icon: /* @__PURE__ */ s(A, { people: e })
116
- };
117
- }
118
- function P(e, t) {
119
- return {
120
- label: n("dueDate"),
121
- text: e ? D(e) : n("dueDate"),
122
- spoken: e ? w(e) : n("dueDate"),
123
- set: !!e,
124
- icon: /* @__PURE__ */ s(u, {
125
- name: "calendar",
126
- size: 14
127
- }),
128
- tone: O(e, t)
129
- };
130
- }
131
- function F(e) {
132
- let t = e.map((e) => e.name);
133
- return {
134
- label: n("labels"),
135
- text: t.length ? k(t) : n("labels"),
136
- spoken: t.length ? t.join(", ") : n("noLabels"),
137
- set: !!t.length,
138
- icon: /* @__PURE__ */ s(j, { labels: e })
139
- };
140
- }
141
- function I({ view: e }) {
142
- return /* @__PURE__ */ s("span", {
143
- class: "ck-field-btn",
144
- "data-set": "",
145
- "data-priority": e.priority,
146
- "data-tone": e.tone,
147
- title: `${e.label}: ${e.spoken}`,
148
- children: [/* @__PURE__ */ s("span", {
149
- class: "ck-fv",
150
- "aria-hidden": "true",
151
- children: [e.icon, /* @__PURE__ */ s("bdi", { children: e.text })]
152
- }), /* @__PURE__ */ s("span", {
153
- class: "ck-sr",
154
- children: `${e.label}: ${e.spoken}`
155
- })]
156
- });
157
- }
158
- function L({ thread: e, editable: i, onChange: a }, o) {
159
- let { client: c, reportError: l } = p(o), [u, d] = t(null), [f, m] = t(!1);
160
- r(() => {
161
- i && S(c).then(d);
162
- }, [i]);
163
- let h = e.labels ?? [], g = C(e.due_at), _ = e.assignees ?? (e.assignee ? [e.assignee] : []);
164
- if (!i) {
165
- let t = [
166
- e.priority === "none" ? null : M(e.priority),
167
- _.length ? N(_) : null,
168
- g ? P(g, e.status) : null,
169
- h.length ? F(h) : null
170
- ].filter((e) => !!e);
171
- return t.length ? /* @__PURE__ */ s("div", {
172
- class: "ck-task ck-fields",
173
- "data-read": !0,
174
- role: "group",
175
- "aria-label": n("taskDetails"),
176
- children: t.map((e) => /* @__PURE__ */ s(I, { view: e }))
177
- }) : null;
178
- }
179
- let v = (t, n = {}) => {
180
- if (f) return;
181
- let r = e;
182
- m(!0), a({
183
- ...e,
184
- ...n
185
- }), c.updateThread(e.id, t).then(a, (e) => {
186
- a(r), l(e);
187
- }).finally(() => m(!1));
188
- }, y = u?.people ?? [], b = [..._.filter((e) => !y.some((t) => t.id === e.id)), ...y], x = _.map((e) => Number(e.id)), w = (e, t) => {
189
- let n = t ? [...x.filter((t) => t !== Number(e.id)), Number(e.id)] : x.filter((t) => t !== Number(e.id)), r = n.map((e) => b.find((t) => Number(t.id) === e)).filter(Boolean);
190
- v({ assignee_ids: n }, {
191
- assignee: r[0] ?? null,
192
- assignees: r
193
- });
194
- }, E = new Set(h.map((e) => e.id)), D = (e, t) => {
195
- let n = [...E].filter((t) => t !== e).concat(t ? [e] : []), r = [...h, ...u?.labels ?? []];
196
- v({ label_ids: n }, { labels: n.map((e) => r.find((t) => t.id === e)).filter(Boolean) });
197
- };
198
- return /* @__PURE__ */ s("div", {
199
- class: "ck-task ck-fields",
200
- role: "group",
201
- "aria-label": n("taskDetails"),
202
- "aria-busy": f || void 0,
203
- children: [
204
- /* @__PURE__ */ s(Y, {
205
- view: M(e.priority),
206
- menu: !0,
207
- children: (t) => /* @__PURE__ */ s(B, {
208
- items: z(),
209
- value: e.priority,
210
- close: t,
211
- onPick: (e) => v({ priority: e }, { priority: e })
212
- })
213
- }),
214
- /* @__PURE__ */ s(Y, {
215
- view: N(_),
216
- keepOpen: !0,
217
- children: (e) => /* @__PURE__ */ s(W, {
218
- people: b,
219
- chosen: x,
220
- loading: !u,
221
- close: e,
222
- onToggle: w,
223
- onClear: () => v({ assignee_ids: [] }, {
224
- assignee: null,
225
- assignees: []
226
- })
227
- })
228
- }),
229
- /* @__PURE__ */ s(Y, {
230
- view: P(g, e.status),
231
- role: "dialog",
232
- children: (e) => /* @__PURE__ */ s(G, {
233
- value: g,
234
- onPick: (t) => {
235
- f || (e(), t !== (g || null) && v({ due_at: t }, { due_at: t }));
236
- }
237
- })
238
- }),
239
- u?.labels.length || h.length ? /* @__PURE__ */ s(Y, {
240
- view: F(h),
241
- keepOpen: !0,
242
- children: (u?.labels.length ? u.labels : h).map((e) => /* @__PURE__ */ s(X, {
243
- type: "checkbox",
244
- checked: E.has(e.id),
245
- busy: f,
246
- onPick: (t) => D(e.id, t),
247
- children: [/* @__PURE__ */ s("span", {
248
- class: "ck-swatch",
249
- style: { background: T(e.color) }
250
- }), /* @__PURE__ */ s("bdi", { children: e.name })]
251
- }))
252
- }) : null
253
- ]
254
- });
255
- }
256
- function R(e) {
257
- let t = e?.closest(".ck-card, .ck-panel")?.getBoundingClientRect();
258
- if (e && t) {
259
- let n = e.getBoundingClientRect();
260
- (getComputedStyle(e).direction === "rtl" ? n.left < t.left + 8 : n.right > t.right - 8) && e.setAttribute("data-flip", "");
261
- }
262
- g(e), e?.scrollIntoView({ block: "nearest" });
263
- }
264
- var z = () => b.map((e) => ({
265
- value: e,
266
- name: n(`priority_${e}`),
267
- icon: /* @__PURE__ */ s("span", {
268
- class: "ck-field-btn-icon",
269
- "data-priority": e,
270
- children: /* @__PURE__ */ s(u, {
271
- name: d[e],
272
- size: 14
273
- })
274
- })
275
- }));
276
- function B({ items: e, value: n, onPick: r, close: i }) {
277
- let [a] = t(() => (e) => e?.focus({ preventScroll: !0 })), o = e.findIndex((e) => e.value === n);
278
- return /* @__PURE__ */ s("div", {
279
- class: "ck-menu-rows",
280
- onKeyDown: (e) => {
281
- let t = [...e.currentTarget.querySelectorAll("[role=menuitemradio]")], n = t.indexOf(e.currentTarget.getRootNode().activeElement), r = -1;
282
- if (e.key === "ArrowDown") r = (n + 1) % t.length;
283
- else if (e.key === "ArrowUp") r = (n - 1 + t.length) % t.length;
284
- else if (e.key === "Home") r = 0;
285
- else if (e.key === "End") r = t.length - 1;
286
- else if (e.key.length === 1 && /\S/.test(e.key)) {
287
- let i = e.key.toLocaleLowerCase(), a = [...t.slice(n + 1), ...t.slice(0, n + 1)].find((e) => e.textContent.trim().toLocaleLowerCase().startsWith(i));
288
- r = a ? t.indexOf(a) : -1;
289
- } else return;
290
- e.preventDefault(), r >= 0 && t[r].focus();
291
- },
292
- children: e.map((e, t) => /* @__PURE__ */ s("button", {
293
- type: "button",
294
- role: "menuitemradio",
295
- class: "ck-menu-row",
296
- tabIndex: -1,
297
- "aria-checked": e.value === n,
298
- ref: t === Math.max(0, o) ? a : void 0,
299
- onClick: () => (r(e.value), i()),
300
- children: [
301
- e.icon,
302
- e.help ? /* @__PURE__ */ s("span", {
303
- class: "ck-menu-two-line",
304
- children: [/* @__PURE__ */ s("span", { children: e.name }), /* @__PURE__ */ s("span", {
305
- class: "ck-menu-help",
306
- children: e.help
307
- })]
308
- }) : /* @__PURE__ */ s("span", {
309
- class: "ck-menu-name",
310
- children: e.name
311
- }),
312
- /* @__PURE__ */ s("span", {
313
- class: "ck-menu-check",
314
- children: /* @__PURE__ */ s(u, { name: "check" })
315
- })
316
- ]
317
- }))
318
- });
319
- }
320
- var V = (e) => e.normalize("NFD").replace(/\p{M}/gu, "").toLocaleLowerCase();
321
- function H(e, t) {
322
- let n = V(t.trim());
323
- if (!n) return e;
324
- let r = [], i = [];
325
- for (let t of e) {
326
- let e = V(t.name);
327
- e.split(/[\s.\-_'’]+/).some((e) => e.startsWith(n)) || e.startsWith(n) ? r.push(t) : e.includes(n) && i.push(t);
328
- }
329
- return [...r, ...i];
330
- }
331
- var U = 100;
332
- function W({ people: e, chosen: r, loading: i, onToggle: a, onClear: l, close: d }) {
333
- let f = `ck-people-${o()}`, [p, h] = t(""), [g, _] = t(0), [v] = t(() => new Set(r)), y = H(c(() => [...e.filter((e) => v.has(Number(e.id))), ...e.filter((e) => !v.has(Number(e.id)))], [e]), p), b = y.slice(0, U), x = !p && r.length > 0, S = b.length + +!!x, C = S ? Math.min(g, S - 1) : -1, w = (e, t) => {
334
- if (x && e === 0) l();
335
- else {
336
- let t = b[e - +!!x];
337
- if (!t) return;
338
- a(t, !r.includes(Number(t.id)));
339
- }
340
- t || d();
341
- }, [T] = t(() => (e) => e?.focus({ preventScroll: !0 }));
342
- return /* @__PURE__ */ s("div", {
343
- class: "ck-people",
344
- children: [/* @__PURE__ */ s("div", {
345
- class: "ck-people-find",
346
- children: [/* @__PURE__ */ s(u, {
347
- name: "search",
348
- size: 14
349
- }), /* @__PURE__ */ s("input", {
350
- ref: T,
351
- class: "ck-people-search",
352
- type: "text",
353
- role: "combobox",
354
- "aria-expanded": "true",
355
- "aria-controls": f,
356
- "aria-autocomplete": "list",
357
- "aria-activedescendant": C >= 0 ? `${f}-${C}` : void 0,
358
- "aria-label": n("findTeammate"),
359
- placeholder: n("findTeammate"),
360
- autoComplete: "off",
361
- spellcheck: !1,
362
- enterKeyHint: "done",
363
- value: p,
364
- onInput: (e) => (h(e.target.value), _(0)),
365
- onKeyDown: (e) => {
366
- e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), S && _((C + (e.key === "ArrowDown" ? 1 : -1) + S) % S)) : e.key === "Enter" ? (e.preventDefault(), C >= 0 && w(C, !1)) : e.key !== "Escape" && e.key !== "Tab" && e.stopPropagation();
367
- }
368
- })]
369
- }), /* @__PURE__ */ s("div", {
370
- class: "ck-people-list",
371
- id: f,
372
- role: "listbox",
373
- "aria-multiselectable": "true",
374
- "aria-label": n("teamMembers"),
375
- ref: (e) => e?.querySelector("[data-active]")?.scrollIntoView({ block: "nearest" }),
376
- children: [
377
- x ? /* @__PURE__ */ s("div", {
378
- role: "option",
379
- id: `${f}-0`,
380
- class: "ck-person",
381
- "aria-selected": "false",
382
- "data-active": C === 0 || void 0,
383
- onMouseDown: (e) => e.preventDefault(),
384
- onClick: () => w(0, !0),
385
- children: [/* @__PURE__ */ s("span", {
386
- class: "ck-av-none",
387
- "aria-hidden": "true"
388
- }), /* @__PURE__ */ s("span", {
389
- class: "ck-person-name",
390
- children: n("unassignAll")
391
- })]
392
- }) : null,
393
- b.map((e, t) => {
394
- let n = t + +!!x, i = r.includes(Number(e.id));
395
- return /* @__PURE__ */ s("div", {
396
- role: "option",
397
- id: `${f}-${n}`,
398
- class: "ck-person",
399
- "aria-selected": i,
400
- "data-active": C === n || void 0,
401
- onMouseDown: (e) => e.preventDefault(),
402
- onClick: () => (_(n), w(n, !0)),
403
- children: [
404
- /* @__PURE__ */ s(m, { person: e }),
405
- /* @__PURE__ */ s("bdi", {
406
- class: "ck-person-name",
407
- title: e.name,
408
- children: e.name
409
- }),
410
- /* @__PURE__ */ s("span", {
411
- class: "ck-menu-check",
412
- children: /* @__PURE__ */ s(u, { name: "check" })
413
- })
414
- ]
415
- });
416
- }),
417
- i ? /* @__PURE__ */ s("div", {
418
- class: "ck-people-note",
419
- children: n("peopleLoading")
420
- }) : y.length ? null : /* @__PURE__ */ s("div", {
421
- class: "ck-people-note",
422
- children: n("peopleNone")
423
- }),
424
- y.length > U ? /* @__PURE__ */ s("div", {
425
- class: "ck-people-note",
426
- children: n("peopleMore", {
427
- shown: U,
428
- n: y.length
429
- })
430
- }) : null
431
- ]
432
- })]
433
- });
434
- }
435
- function G({ value: t, onPick: n }, r) {
436
- let { reportError: i } = p(r), a = y(!0, () => e(() => import("./DatePicker-Nta5a1xD.js")).then((e) => e.DatePicker), i);
437
- return a ? /* @__PURE__ */ s(a, {
438
- value: t,
439
- onPick: n
440
- }) : /* @__PURE__ */ s("div", {
441
- class: "ck-date-wait",
442
- "aria-busy": "true"
443
- });
444
- }
445
- var K = [
446
- "open",
447
- "in_progress",
448
- "in_review",
449
- "resolved",
450
- "closed"
451
- ], q = {
452
- open: "statusHelp_open",
453
- in_progress: "statusHelp_in_progress",
454
- in_review: "statusHelp_in_review",
455
- resolved: "statusHelp_resolved",
456
- closed: "statusHelp_closed"
457
- };
458
- function J({ status: e, editable: t, onPick: r }) {
459
- let i = h(e);
460
- if (!t) return /* @__PURE__ */ s("span", {
461
- class: "ck-status-badge",
462
- "data-status": e,
463
- title: i,
464
- children: [/* @__PURE__ */ s(l, {
465
- status: e,
466
- size: 12
467
- }), /* @__PURE__ */ s("span", { children: i })]
468
- });
469
- let a = {
470
- label: n("statusFilter"),
471
- text: i,
472
- spoken: i,
473
- set: !0,
474
- icon: /* @__PURE__ */ s(l, { status: e })
475
- };
476
- return /* @__PURE__ */ s("span", {
477
- class: "ck-status-field",
478
- "data-status": e,
479
- children: /* @__PURE__ */ s(Y, {
480
- view: a,
481
- menu: !0,
482
- wide: !0,
483
- children: (t) => /* @__PURE__ */ s(B, {
484
- items: K.map((e) => ({
485
- value: e,
486
- name: h(e),
487
- help: n(q[e]),
488
- icon: /* @__PURE__ */ s("span", {
489
- class: "ck-status-field",
490
- "data-status": e,
491
- children: /* @__PURE__ */ s(l, { status: e })
492
- })
493
- })),
494
- value: e,
495
- close: t,
496
- onPick: (t) => t !== e && r(t)
497
- })
498
- })
499
- });
500
- }
501
- function Y({ view: e, keepOpen: r = !1, menu: a = !1, wide: o = !1, role: c, children: l }) {
502
- let [u, d] = t(!1), f = i(null), p = i(null), m = () => {
503
- d(!1), p.current?.focus();
504
- };
505
- return v(u, f, () => d(!1)), /* @__PURE__ */ s("div", {
506
- class: u ? "ck-fld ck-pop" : "ck-fld",
507
- ref: f,
508
- onChange: () => !r && m(),
509
- onKeyDown: (e) => {
510
- u && (e.key === "Escape" ? (e.stopPropagation(), m()) : e.key === "Tab" && e.target !== p.current && d(!1));
511
- },
512
- children: [/* @__PURE__ */ s("button", {
513
- ref: p,
514
- type: "button",
515
- class: "ck-field-btn",
516
- "data-set": e.set ? "" : void 0,
517
- "data-priority": e.priority,
518
- "data-tone": e.tone,
519
- "aria-haspopup": "true",
520
- "aria-expanded": u,
521
- "aria-label": n("fieldChange", {
522
- field: e.label,
523
- value: e.spoken
524
- }),
525
- title: e.text,
526
- onClick: () => d(!u),
527
- children: [e.icon, /* @__PURE__ */ s("bdi", { children: e.text })]
528
- }), u ? /* @__PURE__ */ s("div", {
529
- class: "ck-task-menu",
530
- "data-wide": o || void 0,
531
- role: c ?? (a ? "menu" : "group"),
532
- "aria-label": e.label,
533
- ref: R,
534
- children: typeof l == "function" ? l(m) : l
535
- }) : null]
536
- });
537
- }
538
- function X({ type: e, name: t, checked: n, busy: r = !1, onPick: i, children: a }) {
539
- return /* @__PURE__ */ s("label", {
540
- class: "ck-check",
541
- children: [(() => {
542
- let a = {
543
- name: t,
544
- checked: n,
545
- onChange: (e) => {
546
- let t = e.target;
547
- if (r) return void (t.checked = n);
548
- i(t.checked);
549
- }
550
- };
551
- return e === "checkbox" ? /* @__PURE__ */ s(f, { ...a }) : /* @__PURE__ */ s("input", {
552
- type: "radio",
553
- ...a
554
- });
555
- })(), a]
556
- });
557
- }
558
- function Z({ client: e, value: i, onChange: a }) {
559
- let [o, c] = t(null);
560
- r(() => void S(e).then(c), []);
561
- let l = i.priority ?? "none", u = i.assignee_ids ?? [], d = u.map((e) => o?.people.find((t) => Number(t.id) === e)).filter((e) => !!e), f = new Set(i.label_ids ?? []), p = (o?.labels ?? []).filter((e) => f.has(e.id));
562
- return /* @__PURE__ */ s("div", {
563
- class: "ck-task ck-fields ck-task-draft",
564
- role: "group",
565
- "aria-label": n("taskDetails"),
566
- children: [
567
- /* @__PURE__ */ s(Y, {
568
- view: M(l),
569
- menu: !0,
570
- children: (e) => /* @__PURE__ */ s(B, {
571
- items: z(),
572
- value: l,
573
- close: e,
574
- onPick: (e) => a({
575
- ...i,
576
- priority: e
577
- })
578
- })
579
- }),
580
- /* @__PURE__ */ s(Y, {
581
- view: N(d),
582
- keepOpen: !0,
583
- children: (e) => /* @__PURE__ */ s(W, {
584
- people: o?.people ?? [],
585
- chosen: u,
586
- loading: !o,
587
- close: e,
588
- onToggle: (e, t) => a({
589
- ...i,
590
- assignee_ids: t ? [...u, Number(e.id)] : u.filter((t) => t !== Number(e.id))
591
- }),
592
- onClear: () => a({
593
- ...i,
594
- assignee_ids: []
595
- })
596
- })
597
- }),
598
- o?.labels.length ? /* @__PURE__ */ s(Y, {
599
- view: F(p),
600
- keepOpen: !0,
601
- children: o.labels.map((e) => /* @__PURE__ */ s(X, {
602
- type: "checkbox",
603
- checked: f.has(e.id),
604
- onPick: (t) => a({
605
- ...i,
606
- label_ids: [...f].filter((t) => t !== e.id).concat(t ? [e.id] : [])
607
- }),
608
- children: [/* @__PURE__ */ s("span", {
609
- class: "ck-swatch",
610
- style: { background: T(e.color) }
611
- }), /* @__PURE__ */ s("bdi", { children: e.name })]
612
- }))
613
- }) : null
614
- ]
615
- });
616
- }
617
- export { J as StatusField, Z as TaskDraft, L as TaskFields };
@@ -1,69 +0,0 @@
1
- import { B as e, H as t, L as n, z as r } from "./start-Cbx6rMrr.js";
2
- // src/capture/wrap.ts
3
- var i = 20, a = 200;
4
- function o(e) {
5
- try {
6
- if (e instanceof Error) return `${e.name}: ${e.message}`.slice(0, 1e3);
7
- if (typeof e == "string") return e.slice(0, 1e3);
8
- if (!e || typeof e != "object") return String(e);
9
- let t = Array.isArray(e), n = t ? Array.from({ length: Math.min(e.length, i) }, (e, t) => t) : Object.keys(e).slice(0, i), r = t ? [] : {};
10
- for (let t of n) {
11
- let n = e[t];
12
- r[t] = typeof n == "string" ? n.slice(0, a) : typeof n == "bigint" ? String(n) : n && typeof n == "object" ? Array.isArray(n) ? "[Array]" : "[Object]" : n;
13
- }
14
- return JSON.stringify(r).slice(0, 500);
15
- } catch {
16
- return "[unreadable]";
17
- }
18
- }
19
- function s(e, i) {
20
- try {
21
- r(n, {
22
- level: e,
23
- message: t(i()),
24
- at: (/* @__PURE__ */ new Date()).toISOString()
25
- });
26
- } catch {}
27
- }
28
- function c(t) {
29
- let n = [], r = !0, a = (e, t, r) => {
30
- let i = e[t], a = r(i);
31
- e[t] = a, n.push(() => {
32
- e[t] === a && (e[t] = i);
33
- });
34
- };
35
- if (t.console) {
36
- for (let e of ["error", "warn"]) a(console, e, (t) => (...n) => {
37
- r && s(e, () => n.slice(0, i).map(o).join(" ")), t.apply(console, n);
38
- });
39
- let e = (e) => s("error", () => e.message || o(e.error)), t = (e) => s("error", () => `Unhandled promise rejection: ${o(e.reason)}`);
40
- addEventListener("error", e), addEventListener("unhandledrejection", t), n.push(() => removeEventListener("error", e), () => removeEventListener("unhandledrejection", t));
41
- }
42
- if (t.network && typeof fetch == "function" && a(window, "fetch", (t) => async (...n) => {
43
- if (!r) return t(...n);
44
- let i = performance.now(), a = (n[1]?.method ?? (n[0] instanceof Request ? n[0].method : "GET")).toUpperCase(), o = n[0] instanceof Request ? n[0].url : String(n[0]);
45
- try {
46
- let r = await t(...n);
47
- return r.status >= 400 && e(a, o, r.status, i), r;
48
- } catch (t) {
49
- throw e(a, o, 0, i), t;
50
- }
51
- }), t.network && typeof XMLHttpRequest == "function") {
52
- let t = /* @__PURE__ */ new WeakMap();
53
- a(XMLHttpRequest.prototype, "open", (e) => function(n, i, ...a) {
54
- return r && t.set(this, {
55
- method: String(n).toUpperCase(),
56
- url: String(i)
57
- }), e.call(this, n, i, ...a);
58
- }), a(XMLHttpRequest.prototype, "send", (n) => function(i) {
59
- let a = t.get(this), o = performance.now();
60
- return a && this.addEventListener("loadend", () => {
61
- r && (this.status >= 400 || this.status === 0) && e(a.method, a.url, this.status, o);
62
- }, { once: !0 }), n.call(this, i);
63
- });
64
- }
65
- return () => {
66
- r = !1, n.forEach((e) => e());
67
- };
68
- }
69
- export { c as wrap };