@commentkit/comment-kit 0.7.7 → 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.
- package/CHANGELOG.md +24 -0
- package/README.md +108 -762
- package/SECURITY.md +19 -14
- package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
- package/dist/npm/chunks/client-D1vrh_5G.js +590 -0
- package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
- package/dist/npm/chunks/html2canvas-_mjSRP3G.js +4011 -0
- package/dist/npm/chunks/mount-Ce1MZrcm.js +2485 -0
- package/dist/{shared/pusher-CnhQgAvF.js → npm/chunks/pusher-DRKlokR8.js} +224 -222
- package/dist/npm/chunks/realtime-5SvAvTUU.js +23 -0
- package/dist/npm/chunks/rolldown-runtime-VHNaYcLd.js +13 -0
- package/dist/npm/chunks/src-DJjfvVsa.js +330 -0
- package/dist/npm/element.js +24 -0
- package/dist/npm/headless.js +3 -0
- package/dist/npm/index.js +3 -0
- package/dist/npm/react.js +17 -0
- package/dist/npm/svelte.js +8 -0
- package/dist/npm/types/adapters/react.d.ts +9 -0
- package/dist/npm/types/adapters/svelte.d.ts +9 -0
- package/dist/npm/types/adapters/vue.d.ts +46 -0
- package/dist/npm/types/anchor/index.d.ts +49 -0
- package/dist/npm/types/core/api.d.ts +29 -0
- package/dist/npm/types/core/auth.d.ts +48 -0
- package/dist/npm/types/core/client.d.ts +100 -0
- package/dist/npm/types/core/store.d.ts +7 -0
- package/dist/npm/types/core/types.d.ts +278 -0
- package/dist/npm/types/element.d.ts +10 -0
- package/dist/npm/types/headless.d.ts +7 -0
- package/dist/npm/types/index.d.ts +30 -0
- package/dist/npm/vue.js +32 -0
- package/package.json +65 -173
- package/dist/THIRD_PARTY_NOTICES.txt +0 -284
- package/dist/angular.es.js +0 -321
- package/dist/comment-kit.es.js +0 -218
- package/dist/demo.es.js +0 -483
- package/dist/headless.es.js +0 -4
- package/dist/preact.es.js +0 -117
- package/dist/qwik.es.js +0 -1
- package/dist/qwik.qwik.mjs +0 -114
- package/dist/react.es.js +0 -98
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
- package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
- package/dist/shared/annotation-toolbar-zeiCmKIr.js +0 -1086
- package/dist/shared/attachment-refresh-DAacLaRu.js +0 -94
- package/dist/shared/bridge-CJoGYngu.js +0 -177
- package/dist/shared/button-D4GHW6oZ.js +0 -474
- package/dist/shared/button-group-BVR7iT-S.js +0 -91
- package/dist/shared/capture-privacy-CiOrcAlt.js +0 -101
- package/dist/shared/comment-drawing-canvas-Btc12IsS.js +0 -124
- package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
- package/dist/shared/comment-image-lightbox--QpbcAtH.js +0 -190
- package/dist/shared/comment-images-content-C_r4SHM-.js +0 -214
- package/dist/shared/comment-kit-core-CmLUFujd.js +0 -3682
- package/dist/shared/comment-kit-ui-BHwYuSIi.js +0 -19391
- package/dist/shared/comment-screenshot-annotator-zJZyO-XM.js +0 -151
- package/dist/shared/comment-screenshot-overlay-CoKTYB0J.js +0 -205
- package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
- package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
- package/dist/shared/dev-export-panel-Cnt6oCZU.js +0 -207
- package/dist/shared/dev-grab-B85jo9AS.js +0 -197
- package/dist/shared/dist-D9A5k-N4.js +0 -617
- package/dist/shared/dom-Bhf4WFtY.js +0 -223
- package/dist/shared/element-selector-Cng84xC7.js +0 -902
- package/dist/shared/error-boundary-D3PD74vI.js +0 -21
- package/dist/shared/errors-Bu5ajEmB.js +0 -22
- package/dist/shared/icons-nzMOLzrm.js +0 -266
- package/dist/shared/input-UPtAj0M6.js +0 -111
- package/dist/shared/mount-ui-Dz7FB_Ak.js +0 -208
- package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
- package/dist/shared/realtime-yGLX4wMK.js +0 -334
- package/dist/shared/request-activity-DQrAUwfA.js +0 -11
- package/dist/shared/screenshot-B5-hwpmt.js +0 -199
- package/dist/shared/separator-UhJb0Row.js +0 -3955
- package/dist/shared/shadow-root-B58ZI2yz.js +0 -133
- package/dist/shared/styles-CnYsLS2f.js +0 -2
- package/dist/shared/text-B4HHZNaa.js +0 -23
- package/dist/shared/token-session-D92MYbNu.js +0 -25
- package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
- package/dist/shared/useRender-Uxk1OPK-.js +0 -5
- package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
- package/dist/shared/validation-3wbbbuX0.js +0 -70
- package/dist/shared/websocket-manager-KhH4hL0Q.js +0 -381
- package/dist/solid.es.js +0 -98
- package/dist/svelte.es.js +0 -130
- package/dist/types/adapters/bridge.d.ts +0 -122
- package/dist/types/angular/index.d.ts +0 -145
- package/dist/types/core/agent-context.d.ts +0 -17
- package/dist/types/core/api-client.d.ts +0 -155
- package/dist/types/core/comment-kit-core.d.ts +0 -254
- package/dist/types/core/local-demo.d.ts +0 -60
- package/dist/types/core/types.d.ts +0 -770
- package/dist/types/core/websocket-manager.d.ts +0 -125
- package/dist/types/core/write-access.d.ts +0 -11
- package/dist/types/demo.d.ts +0 -17
- package/dist/types/headless.d.ts +0 -8
- package/dist/types/index.d.ts +0 -87
- package/dist/types/preact/index.d.ts +0 -25
- package/dist/types/qwik/index.d.ts +0 -73
- package/dist/types/react/client.d.ts +0 -31
- package/dist/types/react/index.d.ts +0 -4
- package/dist/types/solid/index.d.ts +0 -37
- package/dist/types/svelte/index.d.ts +0 -55
- package/dist/types/utils/dom.d.ts +0 -59
- package/dist/types/utils/event-emitter.d.ts +0 -11
- package/dist/types/vue/index.d.ts +0 -87
- package/dist/vue.es.js +0 -148
- package/docs/api-reference.md +0 -405
- package/docs/local-demo.md +0 -60
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./annotation-toolbar-zeiCmKIr.js";
|
|
2
|
-
import { T as r, a as i, g as a, i as o } from "./comment-kit-ui-BHwYuSIi.js";
|
|
3
|
-
import * as s from "react";
|
|
4
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
|
-
var d = ".ck-annotation-toolbar{background-color:var(--background);width:100%;max-width:100%;box-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a, 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);border-radius:2rem;flex-wrap:wrap;justify-content:center;align-items:center;gap:.375rem .5rem;margin-inline:auto;padding:.375rem;display:flex}@media (width>=1024px){.ck-annotation-toolbar{width:fit-content}}.ck-annotation-separator.ck-separator[data-orientation=vertical]{height:1rem;display:none}@media (width>=1024px){.ck-annotation-separator.ck-separator[data-orientation=vertical]{display:block}}.ck-annotation-stroke{align-items:center;gap:.5rem;width:7rem;padding-inline:.25rem;display:flex}@media (width>=1024px){.ck-annotation-stroke{width:12rem}}.ck-annotation-slider{flex:auto;min-width:0}.ck-annotation-stroke-label{color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:.75rem;line-height:1rem}.ck-annotation-swatch{background-color:var(--ck-bg);width:.875rem;height:.875rem;box-shadow:0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);border-radius:999px}.ck-annotation-tooltip{align-items:center;gap:.375rem;display:inline-flex}.ck-annotation-save--disabled{opacity:.5}.ck-drawing-canvas{z-index:var(--z-ck-marker-layer);cursor:none;pointer-events:auto;flex-direction:column;padding-top:1rem;display:flex;position:fixed;inset:0}.ck-drawing-canvas-scrim{pointer-events:none;background-color:#0000004d;position:absolute;inset:0}@supports ((-webkit-backdrop-filter:blur(4px)) or (backdrop-filter:blur(4px))){.ck-drawing-canvas-scrim{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.ck-drawing-canvas-toolbar{z-index:1;cursor:auto;width:100%;min-width:0;margin-inline:auto;padding-inline:.75rem;position:relative}.ck-drawing-canvas-surface{z-index:0;touch-action:none;flex:auto;min-height:0;position:relative}.ck-drawing-canvas-error{border-radius:var(--radius-md);background:var(--background);width:max-content;max-width:calc(100vw - 1.5rem);color:var(--destructive);margin:.75rem auto;padding:.75rem;font-size:.875rem}";
|
|
6
|
-
function f(e) {
|
|
7
|
-
let t = e.currentTarget;
|
|
8
|
-
typeof t.hasPointerCapture == "function" && t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId);
|
|
9
|
-
}
|
|
10
|
-
var p = s.memo(function({ onSave: c, onCancel: d, remoteStrokes: p }) {
|
|
11
|
-
let m = t(), h = s.useRef(null), g = s.useRef(null), [_, v] = s.useState(!1), [y, b] = s.useState(null), x = s.useRef(!1), S = s.useCallback((e) => {
|
|
12
|
-
let t = h.current;
|
|
13
|
-
if (!t) return {
|
|
14
|
-
x: 0,
|
|
15
|
-
y: 0
|
|
16
|
-
};
|
|
17
|
-
let n = t.getBoundingClientRect();
|
|
18
|
-
if ("touches" in e && e.touches) {
|
|
19
|
-
let t = e.touches[0];
|
|
20
|
-
return t ? {
|
|
21
|
-
x: t.clientX - n.left,
|
|
22
|
-
y: t.clientY - n.top
|
|
23
|
-
} : {
|
|
24
|
-
x: 0,
|
|
25
|
-
y: 0
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
let r = e;
|
|
29
|
-
return {
|
|
30
|
-
x: r.clientX - n.left,
|
|
31
|
-
y: r.clientY - n.top
|
|
32
|
-
};
|
|
33
|
-
}, []), C = s.useCallback((e) => {
|
|
34
|
-
if (e.button !== 0 || g.current !== null || x.current) return;
|
|
35
|
-
g.current = e.pointerId;
|
|
36
|
-
try {
|
|
37
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
38
|
-
} catch {}
|
|
39
|
-
let t = S(e);
|
|
40
|
-
m.startPath(t.x, t.y);
|
|
41
|
-
}, [S, m]), w = s.useCallback((e) => {
|
|
42
|
-
if (!m.activePath || g.current !== e.pointerId) return;
|
|
43
|
-
let t = S(e);
|
|
44
|
-
m.addPoint(t.x, t.y);
|
|
45
|
-
}, [S, m]), T = s.useCallback((e) => {
|
|
46
|
-
g.current === e.pointerId && (g.current = null, f(e), m.endPath());
|
|
47
|
-
}, [m]), E = s.useCallback(() => {
|
|
48
|
-
if (m.paths.length === 0 || x.current) return;
|
|
49
|
-
let e = h.current, t = m.paths.flatMap((e) => {
|
|
50
|
-
let t = i(e);
|
|
51
|
-
return t ? [t] : [];
|
|
52
|
-
});
|
|
53
|
-
t.length !== 0 && (x.current = !0, v(!0), b(null), Promise.resolve().then(() => c({
|
|
54
|
-
type: "svg",
|
|
55
|
-
paths: t,
|
|
56
|
-
viewport: {
|
|
57
|
-
width: e?.clientWidth || window.innerWidth,
|
|
58
|
-
height: e?.clientHeight || window.innerHeight
|
|
59
|
-
}
|
|
60
|
-
})).catch(() => {
|
|
61
|
-
b("Could not save drawing. Your strokes are still here. Try again.");
|
|
62
|
-
}).finally(() => {
|
|
63
|
-
x.current = !1, v(!1);
|
|
64
|
-
}));
|
|
65
|
-
}, [m.paths, c]);
|
|
66
|
-
e(m.undo, m.redo, d);
|
|
67
|
-
let D = m.paths.flatMap((e) => {
|
|
68
|
-
let t = i(e);
|
|
69
|
-
return t ? [t] : [];
|
|
70
|
-
}), O = m.activePath ? i(m.activePath) : null, k = !!(p && p.length > 0);
|
|
71
|
-
return /* @__PURE__ */ u("div", {
|
|
72
|
-
"data-commentkit-ui": !0,
|
|
73
|
-
"data-slot": "comment-drawing-canvas",
|
|
74
|
-
className: "ck-drawing-canvas",
|
|
75
|
-
children: [
|
|
76
|
-
/* @__PURE__ */ l("div", {
|
|
77
|
-
"aria-hidden": "true",
|
|
78
|
-
className: "ck-drawing-canvas-scrim"
|
|
79
|
-
}),
|
|
80
|
-
/* @__PURE__ */ u("div", {
|
|
81
|
-
className: "ck-drawing-canvas-toolbar",
|
|
82
|
-
children: [/* @__PURE__ */ l(n, {
|
|
83
|
-
colors: r,
|
|
84
|
-
drawing: m,
|
|
85
|
-
onSave: E,
|
|
86
|
-
saveDisabled: m.paths.length === 0 || _,
|
|
87
|
-
onCancel: d
|
|
88
|
-
}), y ? /* @__PURE__ */ l("p", {
|
|
89
|
-
role: "alert",
|
|
90
|
-
className: "ck-drawing-canvas-error",
|
|
91
|
-
children: y
|
|
92
|
-
}) : null]
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ u("svg", {
|
|
95
|
-
ref: h,
|
|
96
|
-
role: "application",
|
|
97
|
-
"aria-label": "Drawing canvas",
|
|
98
|
-
className: "ck-drawing-canvas-surface",
|
|
99
|
-
onPointerDown: C,
|
|
100
|
-
onPointerMove: w,
|
|
101
|
-
onPointerUp: T,
|
|
102
|
-
onPointerCancel: (e) => {
|
|
103
|
-
g.current === e.pointerId && (g.current = null, f(e), m.cancelPath());
|
|
104
|
-
},
|
|
105
|
-
children: [
|
|
106
|
-
k && p ? p.map((e, t) => /* @__PURE__ */ l("g", {
|
|
107
|
-
opacity: .5,
|
|
108
|
-
children: /* @__PURE__ */ l(o, { path: e })
|
|
109
|
-
}, `remote-${String(t)}`)) : null,
|
|
110
|
-
D.map((e, t) => /* @__PURE__ */ l(o, { path: e }, `local-${String(t)}`)),
|
|
111
|
-
O ? /* @__PURE__ */ l(o, { path: O }) : null
|
|
112
|
-
]
|
|
113
|
-
}),
|
|
114
|
-
/* @__PURE__ */ l(a, { mode: "draw" })
|
|
115
|
-
]
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
function m(e) {
|
|
119
|
-
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("style", {
|
|
120
|
-
"data-ck-tool-styles": "drawing",
|
|
121
|
-
children: d
|
|
122
|
-
}), /* @__PURE__ */ l(p, { ...e })] });
|
|
123
|
-
}
|
|
124
|
-
export { m as CommentDrawingCanvas };
|