@commentkit/comment-kit 0.6.8 → 0.7.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 +71 -2
- package/LICENSE +18 -2
- package/README.md +198 -125
- package/SECURITY.md +48 -0
- package/dist/THIRD_PARTY_NOTICES.txt +284 -0
- package/dist/angular.es.js +68 -3419
- package/dist/comment-kit.es.js +33 -3192
- package/dist/demo.es.js +472 -0
- package/dist/headless.es.js +4 -0
- package/dist/preact.es.js +79 -3443
- package/dist/qwik.es.js +1 -3474
- package/dist/qwik.qwik.mjs +114 -0
- package/dist/react.es.js +80 -28447
- package/dist/shared/ShadowRootContext-Bv-4aElu.js +13 -0
- package/dist/shared/annotation-icons-Dh-bmNYK.js +172 -0
- package/dist/shared/annotation-toolbar-B9SxYqoF.js +1093 -0
- package/dist/shared/bridge-CJoGYngu.js +177 -0
- package/dist/shared/button-By0hGrJK.js +505 -0
- package/dist/shared/button-group-Cl9CrvvU.js +93 -0
- package/dist/shared/comment-drawing-canvas-Dzb5YoFw.js +124 -0
- package/dist/shared/comment-image-lightbox-BPYJT1sB.js +183 -0
- package/dist/shared/comment-kit-core-BaSuMzp9.js +3381 -0
- package/dist/shared/comment-kit-ui-CzfdAZs2.js +20181 -0
- package/dist/shared/comment-screenshot-annotator-C7X-_bm6.js +151 -0
- package/dist/shared/comment-screenshot-overlay-wIrZrcRy.js +206 -0
- package/dist/shared/comment-utils-BycYTSxA.js +602 -0
- package/dist/shared/createReactComponent-BZHeRbD0.js +45 -0
- package/dist/shared/dev-export-panel-FwFVdady.js +208 -0
- package/dist/shared/dev-grab-DDqg0LQf.js +203 -0
- package/dist/shared/dist-De294MVF.js +623 -0
- package/dist/{core/dom-x9svfpMk.js → shared/dom-Bhf4WFtY.js} +2 -2
- package/dist/shared/element-selector-BhJm-NSs.js +858 -0
- package/dist/shared/errors-Bu5ajEmB.js +22 -0
- package/dist/shared/icons-nzMOLzrm.js +266 -0
- package/dist/shared/mount-ui--ijs8pWT.js +193 -0
- package/dist/{angular/pusher-Vs-W-c8I.js → shared/pusher-ipHMJnO_.js} +93 -127
- package/dist/shared/realtime-Dk41VwKg.js +302 -0
- package/dist/shared/separator-XDBsaWyw.js +4021 -0
- package/dist/shared/shadow-root-C5v-T8lQ.js +135 -0
- package/dist/shared/styles-D3yMtaec.js +2 -0
- package/dist/shared/useValueChanged-CrzfD8l-.js +92 -0
- package/dist/{angular/limits-AEqOBweE.js → shared/validation-C7QG8j7Z.js} +2 -28
- package/dist/{core/websocket-manager-D1_TEuy_.js → shared/websocket-manager-DhLWh3Jr.js} +90 -148
- package/dist/solid.es.js +63 -3427
- package/dist/svelte.es.js +78 -3442
- package/dist/types/adapters/bridge.d.ts +10 -13
- package/dist/types/angular/index.d.ts +17 -7
- package/dist/types/core/api-client.d.ts +16 -17
- package/dist/types/core/comment-kit-core.d.ts +29 -12
- package/dist/types/core/local-demo.d.ts +60 -0
- package/dist/types/core/types.d.ts +68 -0
- package/dist/types/demo.d.ts +17 -0
- package/dist/types/headless.d.ts +8 -0
- package/dist/types/index.d.ts +22 -20
- package/dist/types/qwik/index.d.ts +4 -1
- package/dist/vue.es.js +80 -3443
- package/docs/api-reference.md +372 -0
- package/docs/local-demo.md +60 -0
- package/package.json +69 -41
- package/dist/angular/chunk-Cyg4N8Ue.js +0 -11
- package/dist/angular/comment-kit-ui-D-LUFD6n.js +0 -24898
- package/dist/angular/dom-Cx1nMbdI.js +0 -104
- package/dist/angular/mount-ui-C9PJ5aK_.js +0 -72
- package/dist/angular/realtime-VrKV0lPI.js +0 -567
- package/dist/angular/shadow-root-yMOaW9pk.js +0 -93
- package/dist/angular/styles-CMz7-p8x.js +0 -2
- package/dist/angular/widget-theme-CYPYAwhR.js +0 -24
- package/dist/comment-kit.css +0 -2
- package/dist/core/chunk-t7YoJN_i.js +0 -11
- package/dist/core/comment-kit-ui-Ct4E18do.js +0 -24898
- package/dist/core/error-boundary-CN_BGsYl.js +0 -21
- package/dist/core/mount-ui-Bfnuuesk.js +0 -72
- package/dist/core/pusher-CizoY5NA.js +0 -2504
- package/dist/core/realtime-C3_O7gi2.js +0 -278
- package/dist/core/shadow-root-DAtdjHG2.js +0 -93
- package/dist/core/styles-ClRoB6ro.js +0 -2
- package/dist/core/widget-theme-BWDYr7VR.js +0 -24
- package/dist/preact/chunk-CZ0PdaaN.js +0 -11
- package/dist/preact/comment-kit-ui-DEzn7J_P.js +0 -24898
- package/dist/preact/dom-_ULpq7rg.js +0 -104
- package/dist/preact/error-boundary-B4-Bfy3g.js +0 -21
- package/dist/preact/limits-C3ZEKcL_.js +0 -71
- package/dist/preact/mount-ui-Dx8en--W.js +0 -72
- package/dist/preact/pusher-BP4kCufH.js +0 -2504
- package/dist/preact/realtime-COin_nJF.js +0 -567
- package/dist/preact/shadow-root-D-NcwruG.js +0 -93
- package/dist/preact/styles-D6i7be5-.js +0 -2
- package/dist/preact/widget-theme-B7Z2pbaA.js +0 -24
- package/dist/qwik/chunk-CKKKzG2Q.js +0 -11
- package/dist/qwik/comment-kit-ui-Dvwee2tw.js +0 -24898
- package/dist/qwik/dom-Dm3gzBBJ.js +0 -104
- package/dist/qwik/error-boundary-C4hlYQwS.js +0 -21
- package/dist/qwik/limits-DK35yjGY.js +0 -71
- package/dist/qwik/mount-ui-DSAwNk_d.js +0 -72
- package/dist/qwik/pusher-B1KgC4iB.js +0 -2504
- package/dist/qwik/realtime-DhfcBrwF.js +0 -567
- package/dist/qwik/shadow-root-PkjcnvPe.js +0 -93
- package/dist/qwik/styles-DmEmq5Lh.js +0 -2
- package/dist/qwik/widget-theme-lbPF3I0A.js +0 -24
- package/dist/react/chunk--MHYZ-zp.js +0 -12
- package/dist/react/limits-CpprSem3.js +0 -175
- package/dist/react/pusher-3dki8s2l.js +0 -2505
- package/dist/react/realtime-DGqScuox.js +0 -567
- package/dist/solid/chunk-B2NCWFvW.js +0 -11
- package/dist/solid/comment-kit-ui-ACW8BpEm.js +0 -24898
- package/dist/solid/dom-DqDH-Gml.js +0 -104
- package/dist/solid/error-boundary-9mimpbZA.js +0 -21
- package/dist/solid/limits-B_69IbLl.js +0 -71
- package/dist/solid/mount-ui-Dq1wj_tx.js +0 -72
- package/dist/solid/pusher-_RVNpj1f.js +0 -2504
- package/dist/solid/realtime-DbUJK4gU.js +0 -567
- package/dist/solid/shadow-root-CssU3bQb.js +0 -93
- package/dist/solid/styles-DbueS9xx.js +0 -2
- package/dist/solid/widget-theme-B4DJ14fI.js +0 -24
- package/dist/svelte/chunk-Pi70BKld.js +0 -11
- package/dist/svelte/comment-kit-ui-Cx4u1g77.js +0 -24898
- package/dist/svelte/dom-MyTrWzy_.js +0 -104
- package/dist/svelte/error-boundary-C3GWI_IX.js +0 -21
- package/dist/svelte/limits-CURF22v3.js +0 -71
- package/dist/svelte/mount-ui-CBoNGLNS.js +0 -72
- package/dist/svelte/pusher-DN1BiUDw.js +0 -2504
- package/dist/svelte/realtime-M1CJbCBA.js +0 -567
- package/dist/svelte/shadow-root-DG8inbf6.js +0 -93
- package/dist/svelte/styles-BK_MaUpD.js +0 -2
- package/dist/svelte/widget-theme-CkfJNysI.js +0 -24
- package/dist/types/adapters/errors.d.ts +0 -3
- package/dist/types/core/auth.d.ts +0 -18
- package/dist/types/core/comments.d.ts +0 -43
- package/dist/types/core/dev-grab.d.ts +0 -14
- package/dist/types/core/keyboard.d.ts +0 -12
- package/dist/types/core/limits.d.ts +0 -52
- package/dist/types/core/offline-queue.d.ts +0 -23
- package/dist/types/core/realtime.d.ts +0 -9
- package/dist/types/core/screenshot.d.ts +0 -12
- package/dist/types/core/session.d.ts +0 -9
- package/dist/types/core/source-resolver.d.ts +0 -19
- package/dist/types/core/state.d.ts +0 -24
- package/dist/types/react/comment-kit-ui.d.ts +0 -9
- package/dist/types/react/comments/comment-flow.d.ts +0 -8
- package/dist/types/react/comments/outcomes.d.ts +0 -28
- package/dist/types/react/comments/pin-geometry.d.ts +0 -12
- package/dist/types/react/comments/view-model.d.ts +0 -66
- package/dist/types/react/components/annotation-toolbar.d.ts +0 -36
- package/dist/types/react/components/build-panel-shared-props.d.ts +0 -25
- package/dist/types/react/components/comment-actions.d.ts +0 -19
- package/dist/types/react/components/comment-body.d.ts +0 -8
- package/dist/types/react/components/comment-branch-filter.d.ts +0 -15
- package/dist/types/react/components/comment-composer-actions.d.ts +0 -26
- package/dist/types/react/components/comment-composer-extras-fields.d.ts +0 -32
- package/dist/types/react/components/comment-composer-extras-toolbar.d.ts +0 -9
- package/dist/types/react/components/comment-composer-extras.d.ts +0 -10
- package/dist/types/react/components/comment-composer-extras.state.d.ts +0 -24
- package/dist/types/react/components/comment-composer-hook.d.ts +0 -1
- package/dist/types/react/components/comment-composer-media.d.ts +0 -17
- package/dist/types/react/components/comment-composer.d.ts +0 -4
- package/dist/types/react/components/comment-composer.types.d.ts +0 -41
- package/dist/types/react/components/comment-composer.utils.d.ts +0 -3
- package/dist/types/react/components/comment-connection-alert.d.ts +0 -7
- package/dist/types/react/components/comment-cursor-layer.d.ts +0 -14
- package/dist/types/react/components/comment-custom-cursor.d.ts +0 -14
- package/dist/types/react/components/comment-drawing-canvas.d.ts +0 -10
- package/dist/types/react/components/comment-emoji-picker.d.ts +0 -12
- package/dist/types/react/components/comment-error-banner.d.ts +0 -8
- package/dist/types/react/components/comment-extension-banner.d.ts +0 -8
- package/dist/types/react/components/comment-fab-tools.d.ts +0 -37
- package/dist/types/react/components/comment-fab.d.ts +0 -34
- package/dist/types/react/components/comment-filter-assignee.d.ts +0 -9
- package/dist/types/react/components/comment-filter-bar.d.ts +0 -27
- package/dist/types/react/components/comment-filter-popover.d.ts +0 -20
- package/dist/types/react/components/comment-format-toolbar.constants.d.ts +0 -34
- package/dist/types/react/components/comment-format-toolbar.d.ts +0 -6
- package/dist/types/react/components/comment-header.d.ts +0 -34
- package/dist/types/react/components/comment-highlight-layer.d.ts +0 -11
- package/dist/types/react/components/comment-highlight-marker.d.ts +0 -9
- package/dist/types/react/components/comment-image-lightbox.d.ts +0 -10
- package/dist/types/react/components/comment-images.d.ts +0 -7
- package/dist/types/react/components/comment-item.d.ts +0 -26
- package/dist/types/react/components/comment-keyboard-shortcuts.d.ts +0 -7
- package/dist/types/react/components/comment-kit-overlays.d.ts +0 -15
- package/dist/types/react/components/comment-kit.d.ts +0 -12
- package/dist/types/react/components/comment-list-filters.d.ts +0 -14
- package/dist/types/react/components/comment-login-modal.d.ts +0 -20
- package/dist/types/react/components/comment-marker-layer-composer.d.ts +0 -21
- package/dist/types/react/components/comment-marker-layer.d.ts +0 -27
- package/dist/types/react/components/comment-marker-popover.d.ts +0 -12
- package/dist/types/react/components/comment-marker.d.ts +0 -15
- package/dist/types/react/components/comment-member-list.d.ts +0 -10
- package/dist/types/react/components/comment-mode-bar.d.ts +0 -15
- package/dist/types/react/components/comment-online-users.d.ts +0 -8
- package/dist/types/react/components/comment-page-ref.d.ts +0 -9
- package/dist/types/react/components/comment-panel-header.d.ts +0 -22
- package/dist/types/react/components/comment-panel-mobile.d.ts +0 -9
- package/dist/types/react/components/comment-panel-utils.d.ts +0 -6
- package/dist/types/react/components/comment-panel-view-body.d.ts +0 -23
- package/dist/types/react/components/comment-panel.d.ts +0 -37
- package/dist/types/react/components/comment-quoted-text.d.ts +0 -9
- package/dist/types/react/components/comment-reactions.d.ts +0 -11
- package/dist/types/react/components/comment-remote-cursor.d.ts +0 -11
- package/dist/types/react/components/comment-screenshot-annotator.d.ts +0 -11
- package/dist/types/react/components/comment-screenshot-overlay.d.ts +0 -10
- package/dist/types/react/components/comment-search-bar.d.ts +0 -7
- package/dist/types/react/components/comment-settings-view.d.ts +0 -20
- package/dist/types/react/components/comment-skeletons.d.ts +0 -9
- package/dist/types/react/components/comment-thread-detail-badges.d.ts +0 -16
- package/dist/types/react/components/comment-thread-detail-meta.d.ts +0 -9
- package/dist/types/react/components/comment-thread-detail-replies.d.ts +0 -13
- package/dist/types/react/components/comment-thread-detail.d.ts +0 -13
- package/dist/types/react/components/comment-thread-footer.d.ts +0 -12
- package/dist/types/react/components/comment-thread-list-item.d.ts +0 -15
- package/dist/types/react/components/comment-thread-list.d.ts +0 -16
- package/dist/types/react/components/comment-user-avatar-tooltip.d.ts +0 -12
- package/dist/types/react/components/comment-users-context.d.ts +0 -15
- package/dist/types/react/components/comment-utils.d.ts +0 -20
- package/dist/types/react/components/comment.d.ts +0 -26
- package/dist/types/react/components/constants.d.ts +0 -50
- package/dist/types/react/components/dev-export-panel.d.ts +0 -10
- package/dist/types/react/components/drawing-path-renderer.d.ts +0 -10
- package/dist/types/react/components/element-selector.d.ts +0 -11
- package/dist/types/react/components/live-region.d.ts +0 -16
- package/dist/types/react/components/screenshot-capture.d.ts +0 -17
- package/dist/types/react/components/status-indicator.d.ts +0 -43
- package/dist/types/react/components/ui.d.ts +0 -44
- package/dist/types/react/components/use-comment-composer.d.ts +0 -28
- package/dist/types/react/error-boundary.d.ts +0 -25
- package/dist/types/react/hooks/use-comment-fab-drag.d.ts +0 -21
- package/dist/types/react/hooks/use-comment-hash-link.d.ts +0 -20
- package/dist/types/react/hooks/use-comment-kit-filters.d.ts +0 -19
- package/dist/types/react/hooks/use-comment-kit-keyboard.d.ts +0 -11
- package/dist/types/react/hooks/use-comment-kit-prop-sync.d.ts +0 -12
- package/dist/types/react/hooks/use-comment-marker-drag.d.ts +0 -23
- package/dist/types/react/hooks/use-comment-panel-navigation.d.ts +0 -21
- package/dist/types/react/hooks/use-comment-realtime.d.ts +0 -6
- package/dist/types/react/hooks/use-comment-thread-actions.d.ts +0 -15
- package/dist/types/react/hooks/use-connection-retry.d.ts +0 -9
- package/dist/types/react/hooks/use-drawing.d.ts +0 -32
- package/dist/types/react/hooks/use-extension-conflicts.d.ts +0 -13
- package/dist/types/react/hooks/use-filtered-threads.d.ts +0 -7
- package/dist/types/react/hooks/use-marker-layer.d.ts +0 -19
- package/dist/types/react/hooks/use-screenshot.d.ts +0 -18
- package/dist/types/react/hooks/use-text-selection.d.ts +0 -17
- package/dist/types/react/hooks/use-websocket.d.ts +0 -9
- package/dist/types/react/is-local-host.d.ts +0 -2
- package/dist/types/react/mount-ui.d.ts +0 -19
- package/dist/types/react/shadow-root.d.ts +0 -23
- package/dist/types/react/shims/use-sync-external-store-with-selector.d.ts +0 -4
- package/dist/types/react/shims/use-sync-external-store.d.ts +0 -1
- package/dist/types/react/ui/lib/ShadowRootContext.d.ts +0 -10
- package/dist/types/react/ui/lib/cn.d.ts +0 -12
- package/dist/types/react/ui/lib/widget-theme.d.ts +0 -7
- package/dist/types/react/ui/primitives/alert/alert.d.ts +0 -8
- package/dist/types/react/ui/primitives/alert/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/alert-dialog/alert-dialog.d.ts +0 -23
- package/dist/types/react/ui/primitives/alert-dialog/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/avatar/avatar.d.ts +0 -10
- package/dist/types/react/ui/primitives/avatar/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/badge/badge.d.ts +0 -5
- package/dist/types/react/ui/primitives/badge/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/breadcrumb/breadcrumb.d.ts +0 -10
- package/dist/types/react/ui/primitives/breadcrumb/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/button/button.d.ts +0 -6
- package/dist/types/react/ui/primitives/button/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/button-group/button-group.d.ts +0 -9
- package/dist/types/react/ui/primitives/button-group/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/card/card.d.ts +0 -11
- package/dist/types/react/ui/primitives/card/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/checkbox/checkbox.d.ts +0 -3
- package/dist/types/react/ui/primitives/checkbox/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/dialog/dialog.d.ts +0 -17
- package/dist/types/react/ui/primitives/dialog/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/dropdown-menu/dropdown-menu.d.ts +0 -29
- package/dist/types/react/ui/primitives/dropdown-menu/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/empty/empty.d.ts +0 -10
- package/dist/types/react/ui/primitives/empty/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/field/field.d.ts +0 -22
- package/dist/types/react/ui/primitives/field/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/hover-card/hover-card.d.ts +0 -6
- package/dist/types/react/ui/primitives/hover-card/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/input/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/input/input.d.ts +0 -3
- package/dist/types/react/ui/primitives/input-group/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/input-group/input-group.d.ts +0 -16
- package/dist/types/react/ui/primitives/input-otp/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/input-otp/input-otp.d.ts +0 -11
- package/dist/types/react/ui/primitives/kbd/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/kbd/kbd.d.ts +0 -4
- package/dist/types/react/ui/primitives/label/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/label/label.d.ts +0 -3
- package/dist/types/react/ui/primitives/native-select/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/native-select/native-select.d.ts +0 -7
- package/dist/types/react/ui/primitives/popover/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/popover/popover.d.ts +0 -9
- package/dist/types/react/ui/primitives/preview/component-preview.d.ts +0 -8
- package/dist/types/react/ui/primitives/progress/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/progress/progress.d.ts +0 -7
- package/dist/types/react/ui/primitives/radio-group/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/radio-group/radio-group.d.ts +0 -6
- package/dist/types/react/ui/primitives/scroll-area/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/scroll-area/scroll-area.d.ts +0 -6
- package/dist/types/react/ui/primitives/select/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/select/select.d.ts +0 -15
- package/dist/types/react/ui/primitives/separator/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/separator/separator.d.ts +0 -3
- package/dist/types/react/ui/primitives/sheet/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/sheet/sheet.d.ts +0 -14
- package/dist/types/react/ui/primitives/skeleton/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/skeleton/skeleton.d.ts +0 -3
- package/dist/types/react/ui/primitives/slider/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/slider/slider.d.ts +0 -7
- package/dist/types/react/ui/primitives/sonner/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/sonner/sonner.d.ts +0 -4
- package/dist/types/react/ui/primitives/spinner/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/spinner/spinner.d.ts +0 -3
- package/dist/types/react/ui/primitives/switch/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/switch/switch.d.ts +0 -5
- package/dist/types/react/ui/primitives/tabs/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/tabs/tabs.d.ts +0 -8
- package/dist/types/react/ui/primitives/textarea/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/textarea/textarea.d.ts +0 -3
- package/dist/types/react/ui/primitives/toggle/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/toggle/toggle.d.ts +0 -7
- package/dist/types/react/ui/primitives/toggle-group/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/toggle-group/toggle-group.d.ts +0 -14
- package/dist/types/react/ui/primitives/tooltip/index.d.ts +0 -1
- package/dist/types/react/ui/primitives/tooltip/tooltip.d.ts +0 -7
- package/dist/types/utils/freeze-animations.d.ts +0 -8
- package/dist/types/utils/text.d.ts +0 -9
- package/dist/types/utils/validation.d.ts +0 -10
- package/dist/vue/chunk-DHrubWSL.js +0 -11
- package/dist/vue/comment-kit-ui-C3zijClM.js +0 -24898
- package/dist/vue/dom-C7krZAR8.js +0 -104
- package/dist/vue/error-boundary-DW6uGR8U.js +0 -21
- package/dist/vue/limits-B6csdQeI.js +0 -71
- package/dist/vue/mount-ui-18BnLwCO.js +0 -72
- package/dist/vue/pusher-cmjNbW6a.js +0 -2504
- package/dist/vue/realtime-B0B5cE-E.js +0 -567
- package/dist/vue/shadow-root-zwd_wUIP.js +0 -93
- package/dist/vue/styles-B0NAkbKu.js +0 -2
- package/dist/vue/widget-theme-D7Vkagk7.js +0 -24
- /package/dist/{angular/error-boundary-CxhCm8iF.js → shared/error-boundary-D3PD74vI.js} +0 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
Reference for the CommentKit engine and integration APIs. This file is included in the npm package alongside its public TypeScript declarations.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Core Methods
|
|
8
|
+
|
|
9
|
+
The tables describe `CommentKitCore`. The vanilla `CommentKit` instance delegates the integration methods and exposes the engine through `getCore()`. React exposes `core` from `useCommentKit()`; other adapters expose their core through a ref, store, signal or observable and delegate their documented action methods. For a low-level engine method such as `blockEscape()`, use that core handle. Headless consumers import `CommentKitCore` from `@commentkit/comment-kit/headless`.
|
|
10
|
+
|
|
11
|
+
Many action methods return `Promise<void>` and report validation or backend failures through the `error` event and `getState().error`. A resolved promise can also mean an offline mutation was queued. Custom interfaces should observe the relevant comment/offline events and state before declaring a save successful; upload and capture helpers can also reject or return `null`.
|
|
12
|
+
|
|
13
|
+
Qwik uses `useCommentKit` from `@commentkit/comment-kit/qwik` inside `component$`; the hook handles client mounting with `useVisibleTask$`. Destructure its `core` signal and use `core.value?.method()` inside Qwik event handlers rather than capturing plain bridge callbacks across an `onClick$` boundary. The deprecated `useCommentKit$` alias remains available for compatibility. The built-in Qwik widget requires React and ReactDOM, like the other UI adapters.
|
|
14
|
+
|
|
15
|
+
### Authentication
|
|
16
|
+
|
|
17
|
+
| Method | Returns | Description |
|
|
18
|
+
| ----------------------- | --------------- | ------------------------------------------------------------------ |
|
|
19
|
+
| `validateInvite(email)` | `Promise<void>` | Validate a member invite token + email, then auto-trigger OTP flow |
|
|
20
|
+
| `login(email)` | `Promise<void>` | Request OTP code sent to the given email |
|
|
21
|
+
| `verifyOtp(code)` | `Promise<void>` | Verify the OTP code and authenticate |
|
|
22
|
+
| `cancelOtp()` | `void` | Cancel the OTP flow and return to email entry |
|
|
23
|
+
| `resendOtp()` | `Promise<void>` | Resend OTP to the same email |
|
|
24
|
+
| `logout()` | `void` | Clear authentication and disconnect real-time |
|
|
25
|
+
|
|
26
|
+
### UI Controls
|
|
27
|
+
|
|
28
|
+
| Method | Returns | Description |
|
|
29
|
+
| -------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
30
|
+
| `toggleOverlay()` | `void` | Show or hide the comment overlay |
|
|
31
|
+
| `toggleSidebar()` | `void` | Show or hide the comment sidebar |
|
|
32
|
+
| `toggleLoginModal()` | `void` | Show or hide the login modal |
|
|
33
|
+
| `setTool(tool)` | `void` | Set the active tool. Pass `"comment"`, `"select"`, `"draw"`, `"highlight"`, `"screenshot"`, or `null` to deactivate |
|
|
34
|
+
| `toggleShortcutsOverlay()` | `void` | Show or hide the keyboard shortcuts overlay |
|
|
35
|
+
| `setPanelView(view)` | `void` | Set the sidebar panel view: `"list"`, `"detail"`, `"settings"`, `"activity"`, or `"dev-export"` (localhost only) |
|
|
36
|
+
| `blockEscape()` | `() => void` | Block the core's Escape chain while an overlay UI is open. Returns a release function. Used by built-in overlays (context menu); also available to custom UI |
|
|
37
|
+
|
|
38
|
+
### Comments
|
|
39
|
+
|
|
40
|
+
| Method | Returns | Description |
|
|
41
|
+
| ------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `createComment(type, content, position, priority?, textSelection?, drawingData?, options?)` | `Promise<void>` | Create a new comment with optimistic UI update. `type` is `"pin"`, `"highlight"`, or `"drawing"` |
|
|
43
|
+
| `createHighlight(textSelection, content)` | `Promise<void>` | Convenience wrapper around `createComment("highlight", …)` |
|
|
44
|
+
| `createDrawing(drawingData, position, content)` | `Promise<void>` | Convenience wrapper around `createComment("drawing", …)` |
|
|
45
|
+
| `updateComment(commentId, updates)` | `Promise<void>` | Update fields on an existing comment (content, status, priority, description, assignees, checklist, drawingData, textSelection) |
|
|
46
|
+
| `deleteComment(id)` | `Promise<void>` | Delete a comment (optimistic, rolls back on failure) |
|
|
47
|
+
| `resolveComment(id)` | `Promise<void>` | Mark a comment as resolved |
|
|
48
|
+
| `unresolveComment(id)` | `Promise<void>` | Reopen a resolved comment |
|
|
49
|
+
| `completeComment(id)` | `Promise<void>` | Mark a comment as complete |
|
|
50
|
+
| `selectComment(comment)` | `void` | Select a comment (pass `null` to deselect) |
|
|
51
|
+
| `addReply(commentId, content, options?)` | `Promise<void>` | Add a reply, optional draft attachment IDs, mentions and a quote target; a reply reopens a closed thread |
|
|
52
|
+
| `updateReply(commentId, replyId, content, options?)` | `Promise<void>` | Update reply content and optional attachment/mention metadata |
|
|
53
|
+
| `deleteReply(commentId, replyId)` | `Promise<void>` | Delete a reply |
|
|
54
|
+
| `reactToComment(commentId, emoji, replyId?)` | `Promise<void>` | Toggle a parent reaction, or a specific reply reaction when `replyId` is supplied |
|
|
55
|
+
| `updateCommentPosition(commentId, x, y)` | `Promise<void>` | Move a comment pin to new coordinates |
|
|
56
|
+
| `loadMoreComments()` | `Promise<void>` | Load the next page of comments (pagination) |
|
|
57
|
+
|
|
58
|
+
### Project context, branches and retrieval
|
|
59
|
+
|
|
60
|
+
| Method | Returns | Description |
|
|
61
|
+
| ------------------------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `reloadComments()` | `Promise<void>` | Replace loaded comments with the first page for the active project/branch. |
|
|
63
|
+
| `setBranch(branch)` | `Promise<void>` | Select a nonempty branch name or `null` for all branches; clear the current selection/list and load that branch’s first page. |
|
|
64
|
+
| `reloadProjectContext()` | `Promise<void>` | Refresh authenticated project, organization, member, usage, branch and permission context. |
|
|
65
|
+
|
|
66
|
+
Read `getState().projectContext`, `getState().activeBranch`, `getState().comments` and `getState().pagination` for the results. Context is null until an authenticated response is available. A missing context route on an older API is tolerated; it does not enable new server features. `loadMoreComments()` appends another page and becomes a no-op when there are no more pages.
|
|
67
|
+
|
|
68
|
+
The API fetches across project pages. The built-in **Page** tab filters loaded records to the current path; **All** includes other pages. A `#comment-ID` link retrieves its authorized target even beyond the first loaded page. The engine resolves this internally after authentication; do not call a private loader. Cross-page links retain the comment’s original page URL, and markers only target the current page’s DOM.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// With an authenticated core from your integration:
|
|
72
|
+
await core.setBranch("preview");
|
|
73
|
+
await core.loadMoreComments();
|
|
74
|
+
await core.reloadProjectContext();
|
|
75
|
+
const { projectContext, activeBranch, pagination } = core.getState();
|
|
76
|
+
|
|
77
|
+
await core.setBranch(null); // All branches, including older untagged comments.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Composer payloads and message identity
|
|
81
|
+
|
|
82
|
+
`CommentCreateOptions` carries `description`, `assignees`, `checklist`, `mentions`, `files`, preuploaded `attachmentIds`, `branch` and `deviceInfo`. It is the final argument of `createComment`. `ReplyOptions` carries `attachmentIds`, `mentions` and `replyTo`. These APIs require the matching backend deployment and migrations described in the [installation guide](../README.md#backend-upgrade-order).
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const attachmentIds = await core.uploadFiles([file]);
|
|
86
|
+
await core.addReply(threadId, "Here is the revised layout", {
|
|
87
|
+
attachmentIds,
|
|
88
|
+
replyTo: { type: "comment", id: threadId },
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Parent and reply IDs belong to separate namespaces.
|
|
92
|
+
await core.reactToComment(threadId, "👍", replyId);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A quote target is `{ type: "comment" | "reply", id: string }`. The backend validates that it belongs to the thread and returns the saved author/body snapshot; callers do not supply trusted author text. Temporary optimistic IDs are not valid persisted quote or reaction targets. Preserve successful upload IDs if your custom interface retries a failed save; the built-in composer does this automatically.
|
|
96
|
+
|
|
97
|
+
Comments expose canonical `createdAt`/`updatedAt` and optional `resolvedAt`/`completedAt` timestamps. Real workflow transitions set lifecycle dates, repeated transitions preserve them, and reopening or replying clears them. Legacy records can omit historical lifecycle dates. Format dates only for display; keep their canonical values for equality and ordering.
|
|
98
|
+
|
|
99
|
+
### Drawing / Screenshot / Files
|
|
100
|
+
|
|
101
|
+
| Method | Returns | Description |
|
|
102
|
+
| ------------------------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| `captureScreenshot(element?)` | `Promise<ScreenshotResult \| null>` | Capture a screenshot of the page or a specific element |
|
|
104
|
+
| `uploadScreenshot(screenshot, content, position)` | `Promise<Comment \| null>` | Upload a screenshot and create a comment |
|
|
105
|
+
| `setActiveScreenshot(screenshot)` | `void` | Set the currently-active screenshot (drives the screenshot composer UI) |
|
|
106
|
+
| `setActiveDrawing(drawing)` | `void` | Set the currently-active drawing (drives the drawing composer UI) |
|
|
107
|
+
| `sendDrawingStroke(path)` | `void` | Broadcast a drawing stroke to other connected users via the realtime channel |
|
|
108
|
+
| `uploadFiles(files, options?)` | `Promise<string[]>` | Upload supported attachment files and return IDs. Omit options for drafts, or use `{ commentId?, replyId? }` to attach directly to an authorized record |
|
|
109
|
+
|
|
110
|
+
### Agent Handoff
|
|
111
|
+
|
|
112
|
+
Pass stakeholder feedback or grabbed elements to your coding agent — Claude Desktop, Cursor, Codex, Continue, Zed AI, or any clipboard-aware tool.
|
|
113
|
+
|
|
114
|
+
| Method | Returns | Description |
|
|
115
|
+
| ----------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `getAgentContext(options?)` | `AgentContextExport` | Build a comments-only export (sync). Uses selector + XPath only |
|
|
117
|
+
| `getAgentContextAsync(options?)` | `Promise<AgentContextExport>` | Same as above but also resolves each comment's element to a source-file location when the optional source-resolver peer dep is installed |
|
|
118
|
+
| `formatAgentContext(options?)` | `string` | Build the sync export, then render it as Markdown |
|
|
119
|
+
| `formatAgentContextAsync(options?)` | `Promise<string>` | Build the async (source-enriched) export, then render it as Markdown |
|
|
120
|
+
| `copyAgentContext(options?)` | `Promise<string>` | Build the async export, format it as Markdown, and copy it to the clipboard. Emits `agent:context-copied` |
|
|
121
|
+
| `grabElement(element, options?)` | `Promise<DevGrabResult \| null>` | Capture an element: screenshot + source-resolved location + HTML + selector/XPath. Writes Markdown + `image/png` to the clipboard. Emits `agent:element-grabbed` |
|
|
122
|
+
| `grabElements(elements, options?)` | `Promise<DevGrabBundle \| null>` | Same as `grabElement` for an array. Inlines each screenshot as a Markdown data URL. Emits `agent:elements-grabbed` |
|
|
123
|
+
|
|
124
|
+
`AgentContextOptions`:
|
|
125
|
+
|
|
126
|
+
| Field | Type | Default | Description |
|
|
127
|
+
| ----------------- | ---------- | ----------- | ------------------------------------------------------------------------- |
|
|
128
|
+
| `includeResolved` | `boolean` | `false` | Include resolved + completed comments in the export |
|
|
129
|
+
| `currentPageOnly` | `boolean` | `false` | Include only comments anchored to the current page |
|
|
130
|
+
| `includeHtml` | `boolean` | `false` | Include a clipped `outerHTML` preview for each comment's resolved element |
|
|
131
|
+
| `commentIds` | `string[]` | `undefined` | Restrict the export to specific comment ids |
|
|
132
|
+
| `maxComments` | `number` | `200` | Hard cap on number of comments exported (max `500`) |
|
|
133
|
+
| `instructions` | `string` | (built-in) | Replace the leading instructions block sent to the agent |
|
|
134
|
+
|
|
135
|
+
### Utility
|
|
136
|
+
|
|
137
|
+
| Method | Returns | Description |
|
|
138
|
+
| --------------------------- | ---------------------------- | --------------------------------------------------------------------------------------- |
|
|
139
|
+
| `getState()` | `CommentKitState` | Get the current state snapshot (deep-cloned — safe to mutate) |
|
|
140
|
+
| `getFeatures()` | `object` | Get resolved feature flags |
|
|
141
|
+
| `getConfig()` | `Readonly<CommentKitConfig>` | Get a public configuration copy; internal project and realtime credentials are excluded |
|
|
142
|
+
| `getProjectMembers()` | `Promise<User[]>` | Fetch team members for @mention autocomplete |
|
|
143
|
+
| `getOnlineUsers()` | `User[]` | Get currently connected users |
|
|
144
|
+
| `getUnreadActivityCount()` | `number` | Get unread activity feed count |
|
|
145
|
+
| `getPendingMutationCount()` | `number` | Get queued offline mutations count |
|
|
146
|
+
| `markThreadSeen(threadId)` | `void` | Mark a thread as seen |
|
|
147
|
+
| `isThreadNew(threadId)` | `boolean` | Check if a thread is unseen |
|
|
148
|
+
| `markAllActivitiesRead()` | `void` | Mark all activities as read |
|
|
149
|
+
| `destroy()` | `void` | Clean up all listeners, timers, and WebSocket connections |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Events
|
|
154
|
+
|
|
155
|
+
Listen to SDK events for custom integrations.
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
// Subscribe
|
|
159
|
+
const unsub = ck.on("comment:created", (comment) => {
|
|
160
|
+
console.log("New comment:", comment);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Unsubscribe
|
|
164
|
+
unsub();
|
|
165
|
+
// or: ck.off("comment:created", handler);
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Comment Events
|
|
169
|
+
|
|
170
|
+
| Event | Payload | When |
|
|
171
|
+
| ------------------- | ------------------------------- | -------------------------------- |
|
|
172
|
+
| `comment:created` | `Comment` | A new comment was created |
|
|
173
|
+
| `comment:updated` | `Comment` | A comment was modified |
|
|
174
|
+
| `comment:deleted` | `{ id: string }` | A comment was deleted |
|
|
175
|
+
| `comment:resolved` | `Comment` | A comment was marked as resolved |
|
|
176
|
+
| `comment:completed` | `Comment` | A comment was marked as complete |
|
|
177
|
+
| `comment:reaction` | `{ commentId, emoji, comment }` | A reaction was toggled |
|
|
178
|
+
| `comment:position` | `{ commentId, position }` | A comment was repositioned |
|
|
179
|
+
|
|
180
|
+
### Auth Events
|
|
181
|
+
|
|
182
|
+
| Event | Payload | When |
|
|
183
|
+
| -------------------- | ----------------------- | ------------------------------- |
|
|
184
|
+
| `auth:login` | `User` | User authenticated successfully |
|
|
185
|
+
| `auth:logout` | `void` | User logged out |
|
|
186
|
+
| `auth:otp-requested` | `{ email, expiresIn? }` | OTP was sent to email |
|
|
187
|
+
| `auth:otp-verified` | `User` | OTP was verified successfully |
|
|
188
|
+
|
|
189
|
+
### UI Events
|
|
190
|
+
|
|
191
|
+
| Event | Payload | When |
|
|
192
|
+
| ------------------- | ----------------- | ----------------------------- |
|
|
193
|
+
| `tool:changed` | `ToolType` | Active tool changed |
|
|
194
|
+
| `overlay:toggled` | `boolean` | Overlay visibility changed |
|
|
195
|
+
| `sidebar:toggled` | `boolean` | Sidebar visibility changed |
|
|
196
|
+
| `shortcuts:toggled` | `boolean` | Shortcuts overlay toggled |
|
|
197
|
+
| `state:changed` | `CommentKitState` | Any state changed (catch-all) |
|
|
198
|
+
|
|
199
|
+
### Agent Events
|
|
200
|
+
|
|
201
|
+
| Event | Payload | When |
|
|
202
|
+
| ------------------------ | ----------------------------------------------------------- | ------------------------------------------------------- |
|
|
203
|
+
| `agent:context-copied` | `{ commentCount: number; sourceResolved?: boolean }` | Stakeholder-comment context was copied to the clipboard |
|
|
204
|
+
| `agent:element-grabbed` | `{ source: string \| null; componentName: string \| null }` | A single element was grabbed for the agent |
|
|
205
|
+
| `agent:elements-grabbed` | `{ count: number }` | A multi-element bundle was grabbed for the agent |
|
|
206
|
+
|
|
207
|
+
### SDK Events
|
|
208
|
+
|
|
209
|
+
| Event | Payload | When |
|
|
210
|
+
| -------------- | ------------------------------------- | ---------------------------------------------------- |
|
|
211
|
+
| `sdk:outdated` | `{ current: string; latest: string }` | The backend reports a newer SDK version is available |
|
|
212
|
+
| `error` | `ApiError` | An error was produced anywhere in the SDK |
|
|
213
|
+
|
|
214
|
+
### Real-Time Events
|
|
215
|
+
|
|
216
|
+
| Event | Payload | When |
|
|
217
|
+
| -------------------- | ------------------- | ---------------------------------- |
|
|
218
|
+
| `cursor:move` | `CursorPosition` | Another user moved their cursor |
|
|
219
|
+
| `cursor:leave` | `{ userId }` | A user's cursor left the page |
|
|
220
|
+
| `user:joined` | `User` | A user came online |
|
|
221
|
+
| `user:left` | `{ userId }` | A user went offline |
|
|
222
|
+
| `presence:update` | `{ users: User[] }` | Online users list changed |
|
|
223
|
+
| `connection:changed` | `ConnectionStatus` | WebSocket connection state changed |
|
|
224
|
+
| `drawing:stroke` | `{ userId, path }` | Another user drew a stroke |
|
|
225
|
+
|
|
226
|
+
### Offline Events
|
|
227
|
+
|
|
228
|
+
| Event | Payload | When |
|
|
229
|
+
| ------------------- | ----------------- | ------------------------------------------------------------------------------------------ |
|
|
230
|
+
| `offline:queued` | `QueuedMutation` | A mutation was queued for retry |
|
|
231
|
+
| `offline:retrying` | `{ id, attempt }` | A queued mutation is being retried |
|
|
232
|
+
| `offline:completed` | `{ id }` | A queued mutation succeeded |
|
|
233
|
+
| `offline:failed` | `{ id, error }` | A queued mutation was rejected, lost its authorized owner/dependency, or exhausted retries |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Selective Subscriptions
|
|
238
|
+
|
|
239
|
+
For performance-sensitive integrations, subscribe to specific state slices instead of the catch-all `state:changed` event.
|
|
240
|
+
|
|
241
|
+
### Slice Subscriptions
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
// Only fires when auth-related state changes
|
|
245
|
+
const unsub = ck.onSlice("auth", (state) => {
|
|
246
|
+
console.log("Auth changed:", state.isAuthenticated);
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Available slices:
|
|
251
|
+
|
|
252
|
+
| Slice | Keys |
|
|
253
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
254
|
+
| `auth` | `isAuthenticated`, `currentUser`, `project`, `projectContext`, `isLoginModalVisible`, `otpStep`, `otpEmail` |
|
|
255
|
+
| `ui` | `isOverlayVisible`, `isSidebarVisible`, `isShortcutsOverlayVisible`, `activeTool`, `isCommentModeActive`, `isDrawingModeActive`, `isHighlightModeActive`, `isScreenshotModeActive`, `selectedComment`, `activeComment`, `activeDrawing`, `activeScreenshot`, `panelView`, `activities`, `isLoading`, `error` |
|
|
256
|
+
| `comments` | `comments`, `pagination`, `seenThreadIds`, `activeBranch` |
|
|
257
|
+
| `realtime` | `onlineUsers`, `connectionStatus`, `pendingMutations`, `isOnline` |
|
|
258
|
+
|
|
259
|
+
### Selector Subscriptions
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
// Only fires when the selected value changes
|
|
263
|
+
const unsub = ck.select(
|
|
264
|
+
(state) => state.comments.length,
|
|
265
|
+
(count) => console.log(`Now have ${count} comments`),
|
|
266
|
+
);
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## TypeScript Types
|
|
272
|
+
|
|
273
|
+
Import shared protocol types from the headless entry. Framework entries also export selected integration types; their generated declarations are the source of truth:
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
import type {
|
|
277
|
+
// Core models
|
|
278
|
+
Comment,
|
|
279
|
+
CommentReaction,
|
|
280
|
+
Reply,
|
|
281
|
+
ReplyOptions,
|
|
282
|
+
ReplyTarget,
|
|
283
|
+
CommentCreateOptions,
|
|
284
|
+
CommentDeviceInfo,
|
|
285
|
+
ProjectContext,
|
|
286
|
+
User,
|
|
287
|
+
Position,
|
|
288
|
+
Attachment,
|
|
289
|
+
TextSelection,
|
|
290
|
+
DrawingData,
|
|
291
|
+
DrawingPath,
|
|
292
|
+
ScreenshotResult,
|
|
293
|
+
ScreenshotProvider,
|
|
294
|
+
ActivityItem,
|
|
295
|
+
Mention,
|
|
296
|
+
Organization,
|
|
297
|
+
OrganizationMember,
|
|
298
|
+
Project,
|
|
299
|
+
|
|
300
|
+
// Config + state
|
|
301
|
+
CommentKitConfig,
|
|
302
|
+
CommentKitState,
|
|
303
|
+
CommentKitEvents,
|
|
304
|
+
StateSlice,
|
|
305
|
+
PanelView,
|
|
306
|
+
ToolType,
|
|
307
|
+
CommentMode,
|
|
308
|
+
ConnectionStatus,
|
|
309
|
+
PaginationInfo,
|
|
310
|
+
CursorPosition,
|
|
311
|
+
DeviceInfo,
|
|
312
|
+
TaskStatus,
|
|
313
|
+
TaskChecklistItem,
|
|
314
|
+
|
|
315
|
+
// Auth
|
|
316
|
+
AuthResponse,
|
|
317
|
+
OtpStep,
|
|
318
|
+
OtpResponse,
|
|
319
|
+
OtpVerifyResponse,
|
|
320
|
+
InviteValidationResponse,
|
|
321
|
+
|
|
322
|
+
// Agent handoff
|
|
323
|
+
AgentContextOptions,
|
|
324
|
+
AgentContextExport,
|
|
325
|
+
AgentCommentContext,
|
|
326
|
+
AgentElementContext,
|
|
327
|
+
|
|
328
|
+
// Dev grab
|
|
329
|
+
DevGrabOptions,
|
|
330
|
+
DevGrabAttachment,
|
|
331
|
+
|
|
332
|
+
// Errors + events
|
|
333
|
+
ApiError,
|
|
334
|
+
EventListener,
|
|
335
|
+
Unsubscribe,
|
|
336
|
+
|
|
337
|
+
// Filters
|
|
338
|
+
CommentFilter,
|
|
339
|
+
StatusFilter,
|
|
340
|
+
PriorityFilter,
|
|
341
|
+
AssigneeFilter,
|
|
342
|
+
PageFilter,
|
|
343
|
+
UserFilter,
|
|
344
|
+
SortOrder,
|
|
345
|
+
} from "@commentkit/comment-kit/headless";
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Key Types
|
|
349
|
+
|
|
350
|
+
**`Comment`** — A comment thread with author, position, replies, reactions, attachments, and task metadata.
|
|
351
|
+
|
|
352
|
+
**`ProjectContext`** — Authenticated project/organization identity, members and roles, storage usage (`limit: null` for unlimited), branch names and `canManageComments`/`canInvite` capabilities.
|
|
353
|
+
|
|
354
|
+
**`ReplyOptions`** — Optional attachment IDs, mentions and a typed quote target for reply creation/editing.
|
|
355
|
+
|
|
356
|
+
**`User`** — A user with id, name, email, optional avatar, and optional organizationId.
|
|
357
|
+
|
|
358
|
+
**`CommentKitConfig`** — Configuration object passed to the SDK constructor. Includes `apiKey`, optional `baseUrl`, `branch`, `enabled`, `screenshotProvider`, `ui` (theme, position, activation) and realtime options.
|
|
359
|
+
|
|
360
|
+
**`CommentKitState`** — The full state tree. Includes auth, `projectContext`, `activeBranch`, UI, comments, realtime, offline queue, pagination and activities.
|
|
361
|
+
|
|
362
|
+
**`CommentKitEvents`** — Maps event names to their payload types for type-safe `on()`/`off()` calls.
|
|
363
|
+
|
|
364
|
+
**`ApiError`** — Structured error with `error` code, `message`, and HTTP `code`, plus an optional `details` object.
|
|
365
|
+
|
|
366
|
+
**`AgentContextExport`** — The bundle returned by `getAgentContext` / `getAgentContextAsync`. Versioned, includes per-comment element + source frames + replies plus a `sourceResolved` flag.
|
|
367
|
+
|
|
368
|
+
**`DevGrabResult`** — Result of `grabElement`. Element context, HTML, optional screenshot data URL, and the Markdown payload that hit the clipboard.
|
|
369
|
+
|
|
370
|
+
**`DevGrabBundle`** — Result of `grabElements`. An array of `DevGrabResult` plus one bundled Markdown payload.
|
|
371
|
+
|
|
372
|
+
See the installed [public protocol declarations](../dist/types/core/types.d.ts) for complete details. Result types that are not named exports can be inferred with `Awaited<ReturnType<CommentKitCore["grabElement"]>>` and the corresponding method name.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Private browser demo
|
|
2
|
+
|
|
3
|
+
`createCommentKitDemo` mounts the real CommentKit core and Shadow DOM UI with a
|
|
4
|
+
browser-local store. It is an explicit sandbox, separate from project API keys,
|
|
5
|
+
OTP sessions, backend data and the offline mutation queue.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const { createCommentKitDemo } = await import("@commentkit/comment-kit/demo");
|
|
9
|
+
const demo = await createCommentKitDemo({
|
|
10
|
+
storageKey: "website:v1", // Stored as commentkit:demo:website:v1
|
|
11
|
+
ui: { theme: "auto" },
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const unsubscribe = demo.onSessionChange((session) => {
|
|
15
|
+
console.log(session.expiresAt, session.persistence, session.commentCount);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Call from a visitor's explicit action.
|
|
19
|
+
await demo.getCore().copyAgentContext({ currentPageOnly: true });
|
|
20
|
+
|
|
21
|
+
// Clear only this demo and create a fresh 24-hour window.
|
|
22
|
+
demo.reset();
|
|
23
|
+
|
|
24
|
+
// Reopen pin mode after dismissing it.
|
|
25
|
+
demo.start();
|
|
26
|
+
|
|
27
|
+
// On navigation/unmount: retained demo data can be resumed before expiry.
|
|
28
|
+
unsubscribe();
|
|
29
|
+
demo.destroy();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The factory is asynchronous and rejects when a widget is already mounted. Call
|
|
33
|
+
it on demand, and destroy any instance that finishes loading after its host
|
|
34
|
+
component unmounts. The ordinary SDK constructor and framework adapters keep
|
|
35
|
+
their normal production behavior.
|
|
36
|
+
|
|
37
|
+
## Behavior
|
|
38
|
+
|
|
39
|
+
- Pins and element comments, replies, edits, deletions, resolution, reactions and
|
|
40
|
+
clipboard context use the normal core/UI paths with a local data client.
|
|
41
|
+
- The identity is explicitly local “You”; no account is created and no email is
|
|
42
|
+
sent. The internal `you@demo.invalid` identifier is never an address to contact.
|
|
43
|
+
- The expiration deadline is fixed at creation or Reset. Reads and edits do not
|
|
44
|
+
extend it. Expired data is rejected and cleared on access, visibility/focus,
|
|
45
|
+
writes and a timer while the page is open. Closed browsers cannot execute a
|
|
46
|
+
scheduled deletion; reopening checks expiration before hydration into the UI.
|
|
47
|
+
- Storage is scoped under `commentkit:demo:` and capped at 50 comments, 20 replies
|
|
48
|
+
per comment and 512,000 serialized characters. Stored records are validated
|
|
49
|
+
and reconstructed before use; external avatars, files and drawing data cannot
|
|
50
|
+
hydrate into the demo.
|
|
51
|
+
- If browser storage is unavailable, the sandbox uses memory for the current
|
|
52
|
+
page lifetime. Surface `persistence` so the visitor can see this limitation.
|
|
53
|
+
- File uploads, screenshot capture, drawing, highlighting, OTP, realtime and
|
|
54
|
+
network requests are unavailable. The demo does not prove cross-device
|
|
55
|
+
collaboration or live-to-localhost synchronization; explain those separately.
|
|
56
|
+
- `reset()` starts fresh; `destroy()` releases listeners, timers and UI without
|
|
57
|
+
deleting a still-valid demo. Production sessions and queues are untouched.
|
|
58
|
+
|
|
59
|
+
Suggested disclosure: “Private to this browser. Available for up to 24 hours.
|
|
60
|
+
Reset anytime.” If `persistence === "memory"`, explain that refresh clears it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commentkit/comment-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Figma-style collaborative commenting, drawing, and feedback tools for any website. Works with React, Vue, Svelte, Angular, and Vanilla JS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
"package.json",
|
|
27
27
|
"README.md",
|
|
28
28
|
"CHANGELOG.md",
|
|
29
|
-
"LICENSE"
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"SECURITY.md",
|
|
31
|
+
"docs/api-reference.md",
|
|
32
|
+
"docs/local-demo.md"
|
|
30
33
|
],
|
|
31
34
|
"type": "module",
|
|
32
35
|
"sideEffects": [
|
|
@@ -72,15 +75,27 @@
|
|
|
72
75
|
"types": "./dist/types/preact/index.d.ts",
|
|
73
76
|
"import": "./dist/preact.es.js"
|
|
74
77
|
},
|
|
75
|
-
"./package.json": "./package.json"
|
|
78
|
+
"./package.json": "./package.json",
|
|
79
|
+
"./headless": {
|
|
80
|
+
"types": "./dist/types/headless.d.ts",
|
|
81
|
+
"import": "./dist/headless.es.js"
|
|
82
|
+
},
|
|
83
|
+
"./demo": {
|
|
84
|
+
"types": "./dist/types/demo.d.ts",
|
|
85
|
+
"import": "./dist/demo.es.js"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public",
|
|
90
|
+
"registry": "https://registry.npmjs.org/"
|
|
76
91
|
},
|
|
77
92
|
"scripts": {
|
|
78
93
|
"dev": "vp dev",
|
|
79
|
-
"build": "vp run build:clean && vp run build:
|
|
80
|
-
"build:strip": "find dist -name '*.js' -exec perl -i -ne 'print unless m{^\\s*//#(region|endregion)\\b}' {} +",
|
|
94
|
+
"build": "vp run build:clean && vp run build:bundles && vp run build:types && vp run build:strip && vp run build:verify && vp run build:size",
|
|
95
|
+
"build:strip": "find dist \\( -name '*.js' -o -name '*.mjs' \\) -exec perl -i -ne 'print unless m{^\\s*//#(region|endregion)\\b}' {} +",
|
|
81
96
|
"build:verify": "node tools/verify-dist.mjs",
|
|
82
97
|
"build:clean": "rm -rf dist",
|
|
83
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
98
|
+
"build:types": "tsc -p tsconfig.types.json && node tools/prune-declarations.mjs",
|
|
84
99
|
"build:core": "BUILD_TARGET=core vp build",
|
|
85
100
|
"build:react": "BUILD_TARGET=react vp build",
|
|
86
101
|
"build:vue": "BUILD_TARGET=vue vp build",
|
|
@@ -89,7 +104,7 @@
|
|
|
89
104
|
"build:solid": "BUILD_TARGET=solid vp build",
|
|
90
105
|
"build:qwik": "BUILD_TARGET=qwik vp build",
|
|
91
106
|
"build:preact": "BUILD_TARGET=preact vp build",
|
|
92
|
-
"analyze": "ANALYZE=true BUILD_TARGET=
|
|
107
|
+
"analyze": "ANALYZE=true BUILD_TARGET=all vp build",
|
|
93
108
|
"preview": "vp preview",
|
|
94
109
|
"test": "vp test run",
|
|
95
110
|
"test:watch": "vp test watch",
|
|
@@ -104,49 +119,55 @@
|
|
|
104
119
|
"check:fix": "vp check --fix",
|
|
105
120
|
"lint": "vp lint",
|
|
106
121
|
"lint:fix": "vp lint --fix",
|
|
107
|
-
"lint:md": "npx --yes markdownlint-cli2@0.23.0 \"**/*.md\" \"#node_modules\" \"#mcp/node_modules\" \"#dist\"",
|
|
122
|
+
"lint:md": "npx --yes markdownlint-cli2@0.23.0 \"**/*.md\" \"#node_modules\" \"#mcp/node_modules\" \"#dist\" \"#test-results\" \"#playwright-report\" \"#coverage\"",
|
|
108
123
|
"fmt": "vp fmt --write",
|
|
109
124
|
"typecheck": "tsc --noEmit --noUnusedLocals false --noUnusedParameters false",
|
|
110
125
|
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
|
111
|
-
"prepublishOnly": "
|
|
126
|
+
"prepublishOnly": "npm run release:package",
|
|
112
127
|
"publish:beta": "npm publish --tag beta",
|
|
113
128
|
"publish:latest": "npm publish --tag latest",
|
|
114
129
|
"version:patch": "npm version patch",
|
|
115
130
|
"version:minor": "npm version minor",
|
|
116
|
-
"version:major": "npm version major"
|
|
131
|
+
"version:major": "npm version major",
|
|
132
|
+
"build:bundles": "BUILD_TARGET=all vp build",
|
|
133
|
+
"build:size": "node tools/check-size.mjs",
|
|
134
|
+
"test:consumers": "node tools/smoke-consumers.mjs --next",
|
|
135
|
+
"release:check": "npm run release:package && npm run test:e2e",
|
|
136
|
+
"release:package": "npm run check && npm run typecheck:test && npm run lint:md && npm run build && npm test && npm run test:consumers && npm audit --audit-level=high"
|
|
117
137
|
},
|
|
118
138
|
"devDependencies": {
|
|
119
|
-
"@angular/common": "^
|
|
120
|
-
"@angular/core": "^
|
|
121
|
-
"@base-ui/react": "
|
|
122
|
-
"@builder.io/qwik": "^1.
|
|
123
|
-
"@playwright/test": "^1.
|
|
124
|
-
"@tabler/icons-react": "^3.
|
|
125
|
-
"@testing-library/dom": "^10.4.
|
|
126
|
-
"@testing-library/react": "^16.3.
|
|
127
|
-
"@types/node": "^
|
|
128
|
-
"@types/react": "^19.
|
|
129
|
-
"@types/react-dom": "^19.
|
|
130
|
-
"@vitejs/plugin-react": "^6.
|
|
131
|
-
"@vitest/coverage-v8": "
|
|
132
|
-
"@vitest/ui": "
|
|
139
|
+
"@angular/common": "^22.2.3",
|
|
140
|
+
"@angular/core": "^22.2.3",
|
|
141
|
+
"@base-ui/react": "1.9.0",
|
|
142
|
+
"@builder.io/qwik": "^1.20.2",
|
|
143
|
+
"@playwright/test": "^1.64.1",
|
|
144
|
+
"@tabler/icons-react": "^3.49.0",
|
|
145
|
+
"@testing-library/dom": "^10.4.2",
|
|
146
|
+
"@testing-library/react": "^16.3.3",
|
|
147
|
+
"@types/node": "^26.6.5",
|
|
148
|
+
"@types/react": "^19.3.0",
|
|
149
|
+
"@types/react-dom": "^19.3.0",
|
|
150
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
151
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
152
|
+
"@vitest/ui": "5.0.5",
|
|
153
|
+
"es-module-lexer": "^3.0.4",
|
|
133
154
|
"html2canvas": "^1.4.1",
|
|
134
155
|
"input-otp": "^1.5.0",
|
|
135
|
-
"jsdom": "^
|
|
136
|
-
"preact": "^
|
|
137
|
-
"pusher-js": "^8.
|
|
138
|
-
"react": "^19.
|
|
139
|
-
"react-dom": "^19.
|
|
140
|
-
"rollup-plugin-visualizer": "^7.
|
|
156
|
+
"jsdom": "^30.1.3",
|
|
157
|
+
"preact": "^11.0.1",
|
|
158
|
+
"pusher-js": "^8.6.0",
|
|
159
|
+
"react": "^19.3.1",
|
|
160
|
+
"react-dom": "^19.3.1",
|
|
161
|
+
"rollup-plugin-visualizer": "^7.1.1",
|
|
141
162
|
"rxjs": "^7.8.2",
|
|
142
|
-
"solid-js": "^1.9.
|
|
143
|
-
"sonner": "^2.0.
|
|
144
|
-
"svelte": "^5.
|
|
145
|
-
"typescript": "^
|
|
146
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@
|
|
147
|
-
"vite-plus": "
|
|
148
|
-
"vitest": "
|
|
149
|
-
"vue": "^3.5.
|
|
163
|
+
"solid-js": "^1.9.17",
|
|
164
|
+
"sonner": "^2.0.8",
|
|
165
|
+
"svelte": "^5.57.2",
|
|
166
|
+
"typescript": "^7.0.2",
|
|
167
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
168
|
+
"vite-plus": "1.3.0",
|
|
169
|
+
"vitest": "5.0.5",
|
|
170
|
+
"vue": "^3.5.44"
|
|
150
171
|
},
|
|
151
172
|
"peerDependencies": {
|
|
152
173
|
"@angular/common": ">=17.0.0",
|
|
@@ -192,14 +213,21 @@
|
|
|
192
213
|
},
|
|
193
214
|
"preact": {
|
|
194
215
|
"optional": true
|
|
216
|
+
},
|
|
217
|
+
"react": {
|
|
218
|
+
"optional": true
|
|
219
|
+
},
|
|
220
|
+
"react-dom": {
|
|
221
|
+
"optional": true
|
|
195
222
|
}
|
|
196
223
|
},
|
|
197
224
|
"overrides": {
|
|
198
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@
|
|
199
|
-
"vitest": "
|
|
225
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
226
|
+
"vitest": "5.0.5"
|
|
200
227
|
},
|
|
201
228
|
"engines": {
|
|
202
229
|
"node": ">=18"
|
|
203
230
|
},
|
|
204
|
-
"packageManager": "npm@11.12.1"
|
|
231
|
+
"packageManager": "npm@11.12.1",
|
|
232
|
+
"qwik": "./dist/qwik.qwik.mjs"
|
|
205
233
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
|
|
2
|
-
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
3
|
-
get: ((e) => i[e]).bind(null, d),
|
|
4
|
-
enumerable: !(s = n(i, d)) || s.enumerable
|
|
5
|
-
});
|
|
6
|
-
return e;
|
|
7
|
-
}, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
|
|
8
|
-
value: n,
|
|
9
|
-
enumerable: !0
|
|
10
|
-
}) : a, n));
|
|
11
|
-
export { c as n, o as t };
|