@commentkit/comment-kit 0.7.6 → 1.0.0-beta.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 (109) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +108 -762
  3. package/SECURITY.md +19 -14
  4. package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
  5. package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
  6. package/dist/npm/chunks/client-D1vrh_5G.js +590 -0
  7. package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
  8. package/dist/npm/chunks/html2canvas-_mjSRP3G.js +4011 -0
  9. package/dist/npm/chunks/mount-Ce1MZrcm.js +2485 -0
  10. package/dist/{shared/pusher-BUaiCkDJ.js → npm/chunks/pusher-DRKlokR8.js} +224 -222
  11. package/dist/npm/chunks/realtime-5SvAvTUU.js +23 -0
  12. package/dist/npm/chunks/rolldown-runtime-VHNaYcLd.js +13 -0
  13. package/dist/npm/chunks/src-DJjfvVsa.js +330 -0
  14. package/dist/npm/element.js +24 -0
  15. package/dist/npm/headless.js +3 -0
  16. package/dist/npm/index.js +3 -0
  17. package/dist/npm/react.js +17 -0
  18. package/dist/npm/svelte.js +8 -0
  19. package/dist/npm/types/adapters/react.d.ts +9 -0
  20. package/dist/npm/types/adapters/svelte.d.ts +9 -0
  21. package/dist/npm/types/adapters/vue.d.ts +46 -0
  22. package/dist/npm/types/anchor/index.d.ts +49 -0
  23. package/dist/npm/types/core/api.d.ts +29 -0
  24. package/dist/npm/types/core/auth.d.ts +48 -0
  25. package/dist/npm/types/core/client.d.ts +100 -0
  26. package/dist/npm/types/core/store.d.ts +7 -0
  27. package/dist/npm/types/core/types.d.ts +278 -0
  28. package/dist/npm/types/element.d.ts +10 -0
  29. package/dist/npm/types/headless.d.ts +7 -0
  30. package/dist/npm/types/index.d.ts +30 -0
  31. package/dist/npm/vue.js +32 -0
  32. package/package.json +65 -173
  33. package/dist/THIRD_PARTY_NOTICES.txt +0 -284
  34. package/dist/angular.es.js +0 -321
  35. package/dist/comment-kit.es.js +0 -218
  36. package/dist/demo.es.js +0 -483
  37. package/dist/headless.es.js +0 -4
  38. package/dist/preact.es.js +0 -117
  39. package/dist/qwik.es.js +0 -1
  40. package/dist/qwik.qwik.mjs +0 -114
  41. package/dist/react.es.js +0 -98
  42. package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
  43. package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
  44. package/dist/shared/annotation-toolbar-RSrb0Nku.js +0 -1086
  45. package/dist/shared/attachment-refresh-CSTYwRW-.js +0 -94
  46. package/dist/shared/bridge-CJoGYngu.js +0 -177
  47. package/dist/shared/button-D4GHW6oZ.js +0 -474
  48. package/dist/shared/button-group-BVR7iT-S.js +0 -91
  49. package/dist/shared/capture-privacy-DUROnio5.js +0 -77
  50. package/dist/shared/comment-drawing-canvas-DbuXP54N.js +0 -124
  51. package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
  52. package/dist/shared/comment-image-lightbox-zlIGEVA-.js +0 -190
  53. package/dist/shared/comment-images-content-aYbJb79_.js +0 -214
  54. package/dist/shared/comment-kit-core-B0k7XsMz.js +0 -3680
  55. package/dist/shared/comment-kit-ui-BXLJcZYQ.js +0 -19391
  56. package/dist/shared/comment-screenshot-annotator-ChWwYJzO.js +0 -151
  57. package/dist/shared/comment-screenshot-overlay-Bufg3rHz.js +0 -205
  58. package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
  59. package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
  60. package/dist/shared/dev-export-panel-DAZenvgD.js +0 -207
  61. package/dist/shared/dev-grab-O8q25zar.js +0 -197
  62. package/dist/shared/dist-D9A5k-N4.js +0 -617
  63. package/dist/shared/dom-Bhf4WFtY.js +0 -223
  64. package/dist/shared/element-selector-CYkwzfEr.js +0 -902
  65. package/dist/shared/error-boundary-D3PD74vI.js +0 -21
  66. package/dist/shared/errors-Bu5ajEmB.js +0 -22
  67. package/dist/shared/icons-nzMOLzrm.js +0 -266
  68. package/dist/shared/input-UPtAj0M6.js +0 -111
  69. package/dist/shared/mount-ui-BKaWBhKq.js +0 -208
  70. package/dist/shared/realtime-C0Z8dXXH.js +0 -334
  71. package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
  72. package/dist/shared/request-activity-DQrAUwfA.js +0 -11
  73. package/dist/shared/screenshot-B-ZfFItT.js +0 -199
  74. package/dist/shared/separator-UhJb0Row.js +0 -3955
  75. package/dist/shared/shadow-root-Cd3SLHyj.js +0 -133
  76. package/dist/shared/styles-CnYsLS2f.js +0 -2
  77. package/dist/shared/text-B4HHZNaa.js +0 -23
  78. package/dist/shared/token-session-DplW5QDx.js +0 -25
  79. package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
  80. package/dist/shared/useRender-Uxk1OPK-.js +0 -5
  81. package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
  82. package/dist/shared/validation-3wbbbuX0.js +0 -70
  83. package/dist/shared/websocket-manager-798cRDyL.js +0 -381
  84. package/dist/solid.es.js +0 -98
  85. package/dist/svelte.es.js +0 -130
  86. package/dist/types/adapters/bridge.d.ts +0 -122
  87. package/dist/types/angular/index.d.ts +0 -145
  88. package/dist/types/core/agent-context.d.ts +0 -17
  89. package/dist/types/core/api-client.d.ts +0 -155
  90. package/dist/types/core/comment-kit-core.d.ts +0 -254
  91. package/dist/types/core/local-demo.d.ts +0 -60
  92. package/dist/types/core/types.d.ts +0 -770
  93. package/dist/types/core/websocket-manager.d.ts +0 -125
  94. package/dist/types/core/write-access.d.ts +0 -11
  95. package/dist/types/demo.d.ts +0 -17
  96. package/dist/types/headless.d.ts +0 -8
  97. package/dist/types/index.d.ts +0 -87
  98. package/dist/types/preact/index.d.ts +0 -25
  99. package/dist/types/qwik/index.d.ts +0 -73
  100. package/dist/types/react/client.d.ts +0 -31
  101. package/dist/types/react/index.d.ts +0 -4
  102. package/dist/types/solid/index.d.ts +0 -37
  103. package/dist/types/svelte/index.d.ts +0 -55
  104. package/dist/types/utils/dom.d.ts +0 -59
  105. package/dist/types/utils/event-emitter.d.ts +0 -11
  106. package/dist/types/vue/index.d.ts +0 -87
  107. package/dist/vue.es.js +0 -148
  108. package/docs/api-reference.md +0 -405
  109. package/docs/local-demo.md +0 -60
@@ -1,223 +0,0 @@
1
- var e = typeof window < "u", t = 1920, n = 1080, r = 1;
2
- function i(e) {
3
- if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
4
- let t = Array.from(e);
5
- return t.map((n, r) => {
6
- let i = n.codePointAt(0), a = r > 0 ? t[r - 1] : "";
7
- return i === 0 || i < 32 || i === 127 || r === 0 && /[0-9]/.test(n) || r === 1 && a === "-" && /[0-9]/.test(n) || r === 0 && n === "-" && e.length === 1 || !/[a-zA-Z0-9_-]/.test(n) ? `\\${i.toString(16)} ` : n;
8
- }).join("");
9
- }
10
- function a(e) {
11
- return e.includes("\"") ? e.includes("'") ? `concat(${e.split("\"").map((e) => `"${e}"`).join(", '\"', ")})` : `'${e}'` : `"${e}"`;
12
- }
13
- function o(e) {
14
- return Number.isFinite(e) ? e : 0;
15
- }
16
- function s(e, t) {
17
- return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
18
- }
19
- function c(r) {
20
- /* v8 ignore start -- SSR fallbacks unreachable in jsdom */
21
- let i = e ? s(window.innerWidth, t) : t, a = e ? s(window.innerHeight, n) : n;
22
- /* v8 ignore stop */
23
- return {
24
- width: s(r?.width, i),
25
- height: s(r?.height, a)
26
- };
27
- }
28
- function l() {
29
- let e = globalThis.crypto;
30
- if (typeof e?.randomUUID == "function") return e.randomUUID().replace(/-/g, "").slice(0, 12);
31
- if (typeof e?.getRandomValues == "function") {
32
- let t = /* @__PURE__ */ new Uint8Array(8);
33
- return e.getRandomValues(t), Array.from(t, (e) => e.toString(36).padStart(2, "0")).join("").slice(0, 12);
34
- }
35
- return Math.random().toString(36).slice(2, 14);
36
- }
37
- function u(e) {
38
- return Number.isFinite(e) && e > 0 ? e : 0;
39
- }
40
- var d = 8;
41
- function f(t) {
42
- if (t.id) return `#${i(t.id)}`;
43
- let n = e && typeof document < "u" && typeof document.querySelectorAll == "function", a = [], o = t;
44
- for (; o && o.nodeType === r && a.length < d;) {
45
- let e = o.nodeName.toLowerCase();
46
- if (o.className && typeof o.className == "string") {
47
- let t = o.className.split(/\s+/).filter(Boolean).find((e) => !e.startsWith("ck-"));
48
- t && (e += `.${i(t)}`);
49
- }
50
- if (o.parentElement) {
51
- let t = o.nodeName.toLowerCase(), n = Array.from(o.parentElement.children).filter((e) => e.nodeName.toLowerCase() === t);
52
- n.length > 1 && (e += `:nth-of-type(${n.indexOf(o) + 1})`);
53
- }
54
- if (a.unshift(e), n) {
55
- let e = a.join(" > ");
56
- try {
57
- if (document.querySelectorAll(e).length === 1) return e;
58
- } catch {}
59
- }
60
- o = o.parentElement;
61
- }
62
- return a.join(" > ");
63
- }
64
- function p(e) {
65
- if (e.id) return `//*[@id=${a(e.id)}]`;
66
- let t = [], n = e;
67
- for (; n && n.nodeType === r;) {
68
- let e = 1, r = n.previousElementSibling;
69
- for (; r;) r.nodeName === n.nodeName && e++, r = r.previousElementSibling;
70
- t.unshift(`${n.nodeName.toLowerCase()}[${e}]`), n = n.parentElement;
71
- }
72
- return "/" + t.join("/");
73
- }
74
- function m(t, n) {
75
- /* v8 ignore start -- SSR guard unreachable in jsdom */
76
- if (!e) return null;
77
- /* v8 ignore stop */
78
- if (typeof t == "string") try {
79
- let e = document.querySelector(t);
80
- if (e) return e;
81
- } catch {}
82
- if (typeof n == "string" && n) try {
83
- let e = document.evaluate(n, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
84
- return e?.nodeType === r ? e : null;
85
- } catch {}
86
- return null;
87
- }
88
- function h(e, t, n) {
89
- let { width: r, height: i } = c(n);
90
- return {
91
- x: o(e) / r * 100,
92
- y: o(t) / i * 100
93
- };
94
- }
95
- function g(e, t, n) {
96
- let { width: r, height: i } = c(n);
97
- return {
98
- x: o(e) / 100 * r,
99
- y: o(t) / 100 * i
100
- };
101
- }
102
- function _() {
103
- /* v8 ignore stop */
104
- return e ? {
105
- url: window.location.href,
106
- path: window.location.pathname + window.location.search,
107
- title: document.title,
108
- domain: window.location.hostname
109
- } : {
110
- url: "",
111
- path: "",
112
- title: "",
113
- domain: ""
114
- };
115
- }
116
- function v(t) {
117
- /* v8 ignore start -- SSR guard unreachable in jsdom */
118
- if (!e) return !1;
119
- /* v8 ignore stop */
120
- let n = t.getBoundingClientRect();
121
- return Number.isFinite(n.top) && Number.isFinite(n.left) && Number.isFinite(n.bottom) && Number.isFinite(n.right) && n.top >= 0 && n.left >= 0 && n.bottom <= window.innerHeight && n.right <= window.innerWidth;
122
- }
123
- function y(t) {
124
- let n = t.getBoundingClientRect(), r = e ? window.pageXOffset || document.documentElement.scrollLeft : 0, i = e ? window.pageYOffset || document.documentElement.scrollTop : 0;
125
- /* v8 ignore stop */
126
- return {
127
- top: n.top + i,
128
- left: n.left + r,
129
- width: n.width,
130
- height: n.height,
131
- bottom: n.bottom + i,
132
- right: n.right + r
133
- };
134
- }
135
- function b(e = "ck") {
136
- return `${e}_${Date.now().toString(36)}_${l()}`;
137
- }
138
- function x(e, t) {
139
- let n = null, r = u(t), i = (...t) => {
140
- n && clearTimeout(n), n = setTimeout(() => {
141
- n = null, e(...t);
142
- }, r);
143
- };
144
- return i.cancel = () => {
145
- n &&= (clearTimeout(n), null);
146
- }, i;
147
- }
148
- function S(e, t) {
149
- let n = !1, r = null, i = null, a = u(t), o = () => {
150
- i = setTimeout(() => {
151
- if (i = null, r) {
152
- let t = r;
153
- r = null, e(...t), o();
154
- } else n = !1;
155
- }, a);
156
- }, s = (...t) => {
157
- n ? r = t : (e(...t), n = !0, o());
158
- };
159
- return s.cancel = () => {
160
- i &&= (clearTimeout(i), null), n = !1, r = null;
161
- }, s;
162
- }
163
- var C = /* @__PURE__ */ new Set([
164
- "button",
165
- "link",
166
- "textbox",
167
- "checkbox",
168
- "radio",
169
- "switch",
170
- "slider",
171
- "spinbutton",
172
- "combobox",
173
- "listbox",
174
- "menu",
175
- "menubar",
176
- "menuitem",
177
- "menuitemcheckbox",
178
- "menuitemradio",
179
- "option",
180
- "tab",
181
- "treeitem",
182
- "searchbox",
183
- "gridcell"
184
- ]);
185
- function w(e) {
186
- if ([
187
- "A",
188
- "BUTTON",
189
- "INPUT",
190
- "SELECT",
191
- "TEXTAREA"
192
- ].includes(e.tagName)) return !0;
193
- let t = e.getAttribute("contenteditable");
194
- if (t !== null && t.toLowerCase() !== "false") return !0;
195
- let n = e.getAttribute("role");
196
- if (n && C.has(n.toLowerCase())) return !0;
197
- let r = e.getAttribute("tabindex");
198
- return !!(r !== null && Number.parseInt(r, 10) >= 0 || e.getAttribute("onclick"));
199
- }
200
- function T() {
201
- /* v8 ignore start -- SSR guard unreachable in jsdom */
202
- if (!e) return "";
203
- /* v8 ignore stop */
204
- let t = window.getSelection();
205
- return t ? t.toString().trim() : "";
206
- }
207
- function E() {
208
- /* v8 ignore start -- SSR guard unreachable in jsdom */
209
- if (!e) return null;
210
- /* v8 ignore stop */
211
- let t = window.getSelection();
212
- if (!t || t.rangeCount === 0) return null;
213
- let n = t.getRangeAt(0), i = n.commonAncestorContainer, a = i.nodeType === r ? i : i.parentElement;
214
- return a ? {
215
- text: t.toString(),
216
- startOffset: n.startOffset,
217
- endOffset: n.endOffset,
218
- element: f(a),
219
- xpath: p(a),
220
- range: n
221
- } : null;
222
- }
223
- export { p as a, E as c, w as d, g as f, f as i, T as l, h as m, m as n, _ as o, S as p, b as r, y as s, x as t, v as u };