@commentkit/comment-kit 0.6.7 → 0.6.9
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 +43 -0
- package/README.md +73 -45
- package/dist/angular.es.js +47 -3411
- package/dist/comment-kit.es.js +13 -3184
- package/dist/demo.es.js +395 -0
- package/dist/headless.es.js +4 -0
- package/dist/preact.es.js +79 -3443
- package/dist/qwik.es.js +79 -3443
- package/dist/react.es.js +80 -28447
- package/dist/shared/ShadowRootContext-Bv-4aElu.js +13 -0
- package/dist/shared/annotation-toolbar-pX17NLmJ.js +1104 -0
- package/dist/shared/bridge-DRE03N9X.js +174 -0
- package/dist/shared/button-By0hGrJK.js +505 -0
- package/dist/shared/button-group-CHfMRXyA.js +93 -0
- package/dist/shared/clamp-CcFVX0vC.js +55 -0
- package/dist/shared/comment-drawing-canvas-CYu5SwRf.js +126 -0
- package/dist/shared/comment-image-lightbox-0VdAs2iT.js +178 -0
- package/dist/shared/comment-kit-core-D0kY00St.js +3083 -0
- package/dist/shared/comment-kit-ui-D2j2gvnm.js +16685 -0
- package/dist/shared/comment-screenshot-annotator-BuojwviY.js +137 -0
- package/dist/shared/comment-screenshot-overlay-BZX0Vcb8.js +144 -0
- package/dist/shared/createReactComponent-BZHeRbD0.js +45 -0
- package/dist/shared/dev-export-panel-BLngcr5q.js +208 -0
- package/dist/shared/dev-grab-pDAfH2lr.js +203 -0
- package/dist/{core/dom-x9svfpMk.js → shared/dom-Bhf4WFtY.js} +2 -2
- package/dist/shared/element-selector-CtFzgHvq.js +852 -0
- package/dist/shared/errors-Bu5ajEmB.js +22 -0
- package/dist/shared/icons-BSHCWYO1.js +267 -0
- package/dist/shared/local-demo-context-BohlYbHt.js +6 -0
- package/dist/shared/mount-ui-CVivB_eQ.js +193 -0
- package/dist/{angular/pusher-Vs-W-c8I.js → shared/pusher-BEl7Qn-8.js} +93 -127
- package/dist/{core/realtime-C3_O7gi2.js → shared/realtime-BG_t_ze7.js} +75 -72
- package/dist/shared/resolveAriaLabelledBy-CIKpnjNJ.js +669 -0
- package/dist/shared/separator-DusFNTs-.js +3915 -0
- package/dist/shared/shadow-root-CmYXiSRR.js +135 -0
- package/dist/shared/styles-D_FEJZ9G.js +2 -0
- package/dist/shared/useLabelableId-DGbfdMi_.js +155 -0
- package/dist/shared/useValueChanged-DQXLia-2.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-BTRqNTB7.js} +90 -148
- package/dist/solid.es.js +63 -3427
- package/dist/svelte.es.js +78 -3442
- package/dist/types/adapters/bridge.d.ts +1 -1
- package/dist/types/angular/index.d.ts +2 -2
- package/dist/types/core/comment-kit-core.d.ts +10 -1
- package/dist/types/core/local-demo.d.ts +59 -0
- package/dist/types/demo.d.ts +17 -0
- package/dist/types/headless.d.ts +8 -0
- package/dist/types/index.d.ts +14 -16
- package/dist/vue.es.js +80 -3443
- package/package.json +55 -37
- package/dist/angular/chunk-Cyg4N8Ue.js +0 -11
- package/dist/angular/comment-kit-ui-ClsgTVKj.js +0 -24898
- package/dist/angular/dom-Cx1nMbdI.js +0 -104
- package/dist/angular/mount-ui-EPLnH0YJ.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-BTYGcSK-.js +0 -24898
- package/dist/core/error-boundary-CN_BGsYl.js +0 -21
- package/dist/core/mount-ui-B6jipL2Z.js +0 -72
- package/dist/core/pusher-CizoY5NA.js +0 -2504
- 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-nhY36fa4.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-Dri-RQe3.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-B2oSKreb.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-DkvDtcft.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-B7GeN0T8.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-CTFITRP7.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-CKmdu0gr.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-N1vul-tl.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-MfED5JLH.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-C85XBX4V.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
package/dist/demo.es.js
ADDED
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { o as e, r as t } from "./shared/validation-C7QG8j7Z.js";
|
|
2
|
+
import { p as n, t as r } from "./shared/comment-kit-core-D0kY00St.js";
|
|
3
|
+
var i = 864e5, a = 512e3, o = 50, s = 20, c = "commentkit:demo:", l = {
|
|
4
|
+
id: "local-demo-you",
|
|
5
|
+
name: "You",
|
|
6
|
+
email: "you@demo.invalid"
|
|
7
|
+
};
|
|
8
|
+
function u(e, n, r = !1) {
|
|
9
|
+
return typeof e == "string" && (r || e.trim().length > 0) && e.length <= n && !t(e);
|
|
10
|
+
}
|
|
11
|
+
function d(e) {
|
|
12
|
+
return typeof e == "string" && e.length <= 40 && Number.isFinite(Date.parse(e));
|
|
13
|
+
}
|
|
14
|
+
function f(e) {
|
|
15
|
+
return typeof e == "string" && /^[a-zA-Z0-9_-]{1,128}$/.test(e);
|
|
16
|
+
}
|
|
17
|
+
function p(t) {
|
|
18
|
+
return e(t) && typeof t.x == "number" && Number.isFinite(t.x) && t.x >= 0 && t.x <= 100 && typeof t.y == "number" && Number.isFinite(t.y) && t.y >= 0 && t.y <= 100 && (t.element === void 0 || u(t.element, 2048)) && (t.xpath === void 0 || u(t.xpath, 2048));
|
|
19
|
+
}
|
|
20
|
+
function m(t) {
|
|
21
|
+
return !e(t) || !f(t.id) || !u(t.content, 5e3) || !d(t.createdAt) ? null : {
|
|
22
|
+
id: t.id,
|
|
23
|
+
content: t.content,
|
|
24
|
+
createdAt: t.createdAt,
|
|
25
|
+
author: { ...l },
|
|
26
|
+
...t.isEdited === !0 ? { isEdited: !0 } : {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function h(t) {
|
|
30
|
+
if (!e(t) || !f(t.id) || t.type !== "pin" || !u(t.content, 1e4) || !p(t.position) || ![
|
|
31
|
+
"open",
|
|
32
|
+
"resolved",
|
|
33
|
+
"complete"
|
|
34
|
+
].includes(t.status) || ![
|
|
35
|
+
"low",
|
|
36
|
+
"medium",
|
|
37
|
+
"high",
|
|
38
|
+
"urgent"
|
|
39
|
+
].includes(t.priority) || !d(t.createdAt) || !d(t.updatedAt) || !e(t.page) || !u(t.page.url, 2e3) || !u(t.page.path, 2e3) || !u(t.page.title, 2e3, !0) || !Array.isArray(t.replies) || t.replies.length > s || t.description !== void 0 && !u(t.description, 1e4, !0)) return null;
|
|
40
|
+
let n;
|
|
41
|
+
try {
|
|
42
|
+
if (n = new URL(t.page.url), n.origin !== window.location.origin || n.username || n.password || n.pathname + n.search !== t.page.path) return null;
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
let r = t.replies.map(m);
|
|
47
|
+
if (r.some((e) => !e) || new Set(r.map((e) => e.id)).size !== r.length) return null;
|
|
48
|
+
let i = [];
|
|
49
|
+
if (t.checklist !== void 0) {
|
|
50
|
+
if (!Array.isArray(t.checklist) || t.checklist.length > 25) return null;
|
|
51
|
+
for (let n of t.checklist) {
|
|
52
|
+
if (!e(n) || !u(n.id, 256) || !u(n.label, 500) || typeof n.done != "boolean") return null;
|
|
53
|
+
i.push({
|
|
54
|
+
id: n.id,
|
|
55
|
+
label: n.label,
|
|
56
|
+
done: n.done
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
let a = [];
|
|
61
|
+
if (t.reactions !== void 0) {
|
|
62
|
+
if (!Array.isArray(t.reactions) || t.reactions.length > 20) return null;
|
|
63
|
+
for (let n of t.reactions) {
|
|
64
|
+
if (!e(n) || !u(n.emoji, 32) || typeof n.reacted != "boolean") return null;
|
|
65
|
+
n.reacted && a.push({
|
|
66
|
+
emoji: n.emoji,
|
|
67
|
+
count: 1,
|
|
68
|
+
reacted: !0
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
id: t.id,
|
|
74
|
+
type: "pin",
|
|
75
|
+
content: t.content,
|
|
76
|
+
position: {
|
|
77
|
+
x: t.position.x,
|
|
78
|
+
y: t.position.y,
|
|
79
|
+
...t.position.element ? { element: t.position.element } : {},
|
|
80
|
+
...t.position.xpath ? { xpath: t.position.xpath } : {}
|
|
81
|
+
},
|
|
82
|
+
status: t.status,
|
|
83
|
+
priority: t.priority,
|
|
84
|
+
author: { ...l },
|
|
85
|
+
userId: l.id,
|
|
86
|
+
createdAt: t.createdAt,
|
|
87
|
+
updatedAt: t.updatedAt,
|
|
88
|
+
page: {
|
|
89
|
+
url: n.href,
|
|
90
|
+
path: t.page.path,
|
|
91
|
+
title: t.page.title
|
|
92
|
+
},
|
|
93
|
+
replies: r,
|
|
94
|
+
attachments: [],
|
|
95
|
+
checklist: i,
|
|
96
|
+
reactions: a,
|
|
97
|
+
assignees: Array.isArray(t.assignees) && t.assignees.some((t) => e(t) && t.id === l.id) ? [{ ...l }] : [],
|
|
98
|
+
...t.description === void 0 ? {} : { description: t.description },
|
|
99
|
+
...t.isEdited === !0 ? { isEdited: !0 } : {}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function g() {
|
|
103
|
+
let e = Date.now();
|
|
104
|
+
return {
|
|
105
|
+
version: 1,
|
|
106
|
+
createdAt: e,
|
|
107
|
+
expiresAt: e + i,
|
|
108
|
+
comments: []
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
var _ = class {
|
|
112
|
+
constructor(e = {}) {
|
|
113
|
+
this.user = { ...l }, this.storage = null, this.data = g(), this.timer = null, this.destroyed = !1, this.expiryNotified = !1, this.revision = 0, this.listeners = /* @__PURE__ */ new Set(), this.lastSerialized = null, this.onFocus = () => {
|
|
114
|
+
this.sync();
|
|
115
|
+
}, this.onStorage = (e) => {
|
|
116
|
+
(e.key === this.storageKey || e.key === null) && (e.newValue === null ? (this.expiryNotified = !1, this.data.comments = [], this.data.expiresAt = Math.min(this.data.expiresAt, Date.now()), this.lastSerialized = null, this.notify("expired")) : this.sync());
|
|
117
|
+
}, this.client = {
|
|
118
|
+
setProject() {},
|
|
119
|
+
setUserEmail() {},
|
|
120
|
+
setAuthToken() {},
|
|
121
|
+
setEnvironment() {},
|
|
122
|
+
setOnAuthExpired() {},
|
|
123
|
+
validateApiKey: async () => this.unavailable(),
|
|
124
|
+
requestOtp: async () => this.unavailable(),
|
|
125
|
+
verifyOtp: async () => this.unavailable(),
|
|
126
|
+
validateInvite: async () => this.unavailable(),
|
|
127
|
+
getComments: async (e, t = "all") => {
|
|
128
|
+
this.sync();
|
|
129
|
+
let n = this.getComments().filter((n) => (!e || n.page.path === e) && (t === "all" || n.status === t));
|
|
130
|
+
return {
|
|
131
|
+
comments: n,
|
|
132
|
+
pagination: {
|
|
133
|
+
total: n.length,
|
|
134
|
+
hasMore: !1,
|
|
135
|
+
page: 1,
|
|
136
|
+
limit: o
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
createComment: async (e, t, n, r, i = "medium", a, o, s) => {
|
|
141
|
+
if (e !== "pin" || s?.attachmentIds?.length) return this.unavailable();
|
|
142
|
+
let c = (/* @__PURE__ */ new Date()).toISOString(), u = `demo-${crypto.randomUUID()}`;
|
|
143
|
+
return this.write((a) => a.push({
|
|
144
|
+
id: u,
|
|
145
|
+
type: e,
|
|
146
|
+
content: t,
|
|
147
|
+
position: n,
|
|
148
|
+
page: r,
|
|
149
|
+
priority: i,
|
|
150
|
+
status: "open",
|
|
151
|
+
author: { ...l },
|
|
152
|
+
userId: l.id,
|
|
153
|
+
createdAt: c,
|
|
154
|
+
updatedAt: c,
|
|
155
|
+
replies: [],
|
|
156
|
+
attachments: [],
|
|
157
|
+
description: s?.description,
|
|
158
|
+
checklist: s?.checklist,
|
|
159
|
+
assignees: s?.assignees
|
|
160
|
+
})), this.getComments().find((e) => e.id === u);
|
|
161
|
+
},
|
|
162
|
+
updateComment: async (e, t) => t.attachmentIds?.length || t.drawingData || t.textSelection ? this.unavailable() : this.modify(e, (e) => Object.assign(e, t, { isEdited: !0 })),
|
|
163
|
+
deleteComment: async (e) => {
|
|
164
|
+
this.write((t) => {
|
|
165
|
+
let n = t.indexOf(this.find(t, e));
|
|
166
|
+
t.splice(n, 1);
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
addReply: async (e, t) => {
|
|
170
|
+
let n = {
|
|
171
|
+
id: `reply-${crypto.randomUUID()}`,
|
|
172
|
+
content: t,
|
|
173
|
+
author: { ...l },
|
|
174
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
175
|
+
};
|
|
176
|
+
return this.modify(e, (e) => e.replies.push(n)), structuredClone(n);
|
|
177
|
+
},
|
|
178
|
+
updateReply: async (e, t, r) => this.modify(e, (e) => {
|
|
179
|
+
let i = e.replies.find((e) => e.id === t);
|
|
180
|
+
if (!i) throw new n("not_found", "This demo reply no longer exists.", 404);
|
|
181
|
+
i.content = r, i.isEdited = !0;
|
|
182
|
+
}).replies.find((e) => e.id === t),
|
|
183
|
+
deleteReply: async (e, t) => {
|
|
184
|
+
this.modify(e, (e) => {
|
|
185
|
+
e.replies = e.replies.filter((e) => e.id !== t);
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
resolveComment: async (e) => this.modify(e, (e) => {
|
|
189
|
+
e.status = "resolved";
|
|
190
|
+
}),
|
|
191
|
+
unresolveComment: async (e) => this.modify(e, (e) => {
|
|
192
|
+
e.status = "open";
|
|
193
|
+
}),
|
|
194
|
+
markComplete: async (e) => this.modify(e, (e) => {
|
|
195
|
+
e.status = "complete";
|
|
196
|
+
}),
|
|
197
|
+
addReaction: async (e, t) => {
|
|
198
|
+
this.modify(e, (e) => {
|
|
199
|
+
e.reactions = [...(e.reactions ?? []).filter((e) => e.emoji !== t), {
|
|
200
|
+
emoji: t,
|
|
201
|
+
count: 1,
|
|
202
|
+
reacted: !0
|
|
203
|
+
}];
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
removeReaction: async (e, t) => {
|
|
207
|
+
this.modify(e, (e) => {
|
|
208
|
+
e.reactions = (e.reactions ?? []).filter((e) => e.emoji !== t);
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
updatePosition: async (e, t) => this.modify(e, (e) => {
|
|
212
|
+
e.position = t;
|
|
213
|
+
}),
|
|
214
|
+
createHighlight: async () => this.unavailable(),
|
|
215
|
+
createDrawing: async () => this.unavailable(),
|
|
216
|
+
uploadFile: async () => this.unavailable(),
|
|
217
|
+
uploadScreenshot: async () => this.unavailable(),
|
|
218
|
+
uploadFiles: async () => this.unavailable(),
|
|
219
|
+
getProjectMembers: async () => [{ ...l }]
|
|
220
|
+
};
|
|
221
|
+
let t = e.storageKey ?? "website-v1";
|
|
222
|
+
if (!/^[a-zA-Z0-9:_-]{1,160}$/.test(t)) throw Error("Invalid demo storage key");
|
|
223
|
+
this.storageKey = c + t;
|
|
224
|
+
try {
|
|
225
|
+
this.storage = window.localStorage;
|
|
226
|
+
} catch {}
|
|
227
|
+
this.hydrate(), this.data.expiresAt <= Date.now() && (this.data = g()), this.persist(), this.armExpiry(), window.addEventListener("focus", this.onFocus), document.addEventListener("visibilitychange", this.onFocus), window.addEventListener("storage", this.onStorage);
|
|
228
|
+
}
|
|
229
|
+
hydrate() {
|
|
230
|
+
if (this.storage) try {
|
|
231
|
+
let t = this.storage.getItem(this.storageKey);
|
|
232
|
+
if (t === this.lastSerialized) return;
|
|
233
|
+
let n = this.lastSerialized !== null;
|
|
234
|
+
if (this.lastSerialized = t, !t) {
|
|
235
|
+
n && (this.data.comments = [], this.data.expiresAt = Math.min(this.data.expiresAt, Date.now()));
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (t.length > a) throw Error("Oversized demo");
|
|
239
|
+
let r = JSON.parse(t);
|
|
240
|
+
if (!e(r) || r.version !== 1 || typeof r.createdAt != "number" || !Number.isSafeInteger(r.createdAt) || r.createdAt > Date.now() || r.expiresAt !== r.createdAt + 864e5 || !Array.isArray(r.comments) || r.comments.length > o) throw Error("Invalid demo");
|
|
241
|
+
let i = r.comments.map(h);
|
|
242
|
+
if (i.some((e) => !e) || new Set(i.map((e) => e.id)).size !== i.length) throw Error("Invalid comments");
|
|
243
|
+
this.data = {
|
|
244
|
+
version: 1,
|
|
245
|
+
createdAt: r.createdAt,
|
|
246
|
+
expiresAt: r.expiresAt,
|
|
247
|
+
comments: i
|
|
248
|
+
};
|
|
249
|
+
} catch {
|
|
250
|
+
try {
|
|
251
|
+
this.storage.removeItem(this.storageKey);
|
|
252
|
+
} catch {
|
|
253
|
+
this.storage = null;
|
|
254
|
+
}
|
|
255
|
+
this.lastSerialized = null, this.data = g();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
persist() {
|
|
259
|
+
let e = JSON.stringify(this.data);
|
|
260
|
+
if (e.length > a) throw new n("demo_full", "This demo is full. Reset it to start again.", 413);
|
|
261
|
+
if (this.storage) try {
|
|
262
|
+
this.storage.setItem(this.storageKey, e), this.lastSerialized = e;
|
|
263
|
+
} catch {
|
|
264
|
+
try {
|
|
265
|
+
this.storage.removeItem(this.storageKey);
|
|
266
|
+
} catch {}
|
|
267
|
+
this.storage = null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
armExpiry() {
|
|
271
|
+
this.timer && clearTimeout(this.timer), !this.destroyed && (this.timer = setTimeout(() => {
|
|
272
|
+
this.timer = null, this.checkExpiry();
|
|
273
|
+
}, Math.max(0, this.data.expiresAt - Date.now())));
|
|
274
|
+
}
|
|
275
|
+
sync() {
|
|
276
|
+
if (this.destroyed) return;
|
|
277
|
+
let e = this.lastSerialized;
|
|
278
|
+
this.hydrate(), !this.checkExpiry() && e !== this.lastSerialized && (this.armExpiry(), this.notify("storage"));
|
|
279
|
+
}
|
|
280
|
+
checkExpiry() {
|
|
281
|
+
if (this.destroyed || this.data.expiresAt > Date.now()) return this.destroyed;
|
|
282
|
+
if (!this.expiryNotified) {
|
|
283
|
+
if (this.expiryNotified = !0, this.data.comments = [], this.storage) try {
|
|
284
|
+
this.storage.removeItem(this.storageKey);
|
|
285
|
+
} catch {
|
|
286
|
+
this.storage = null;
|
|
287
|
+
}
|
|
288
|
+
this.lastSerialized = null, this.notify("expired");
|
|
289
|
+
}
|
|
290
|
+
return !0;
|
|
291
|
+
}
|
|
292
|
+
getSession() {
|
|
293
|
+
return this.checkExpiry(), {
|
|
294
|
+
expiresAt: this.data.expiresAt,
|
|
295
|
+
persistence: this.storage ? "localStorage" : "memory",
|
|
296
|
+
commentCount: this.data.comments.length,
|
|
297
|
+
expired: this.data.expiresAt <= Date.now()
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
getComments() {
|
|
301
|
+
return this.checkExpiry(), structuredClone(this.data.comments);
|
|
302
|
+
}
|
|
303
|
+
subscribe(e) {
|
|
304
|
+
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
305
|
+
}
|
|
306
|
+
refresh() {
|
|
307
|
+
this.sync();
|
|
308
|
+
}
|
|
309
|
+
getRevision() {
|
|
310
|
+
return this.revision;
|
|
311
|
+
}
|
|
312
|
+
notify(e) {
|
|
313
|
+
e !== "persist" && (this.revision += 1);
|
|
314
|
+
for (let t of this.listeners) try {
|
|
315
|
+
t(e);
|
|
316
|
+
} catch {}
|
|
317
|
+
}
|
|
318
|
+
reset() {
|
|
319
|
+
this.destroyed || (this.expiryNotified = !1, this.data = g(), this.persist(), this.armExpiry(), this.notify("reset"));
|
|
320
|
+
}
|
|
321
|
+
activate() {
|
|
322
|
+
this.checkExpiry() && this.reset();
|
|
323
|
+
}
|
|
324
|
+
write(e) {
|
|
325
|
+
if (this.sync(), this.checkExpiry()) throw new n("demo_expired", "Your demo has expired. Start a new demo to continue.", 410);
|
|
326
|
+
let t = structuredClone(this.data.comments);
|
|
327
|
+
if (e(t), t.length > o) throw new n("demo_full", "This demo holds up to 50 comments. Reset it to start again.", 413);
|
|
328
|
+
let r = t.map(h);
|
|
329
|
+
if (r.some((e) => !e)) throw new n("invalid_demo_data", "The demo comment is invalid or exceeds its limit.", 400);
|
|
330
|
+
let i = {
|
|
331
|
+
...this.data,
|
|
332
|
+
comments: r
|
|
333
|
+
};
|
|
334
|
+
if (JSON.stringify(i).length > a) throw new n("demo_full", "This demo is full. Reset it to start again.", 413);
|
|
335
|
+
this.data = i, this.persist(), this.notify("persist");
|
|
336
|
+
}
|
|
337
|
+
find(e, t) {
|
|
338
|
+
let r = e.find((e) => e.id === t);
|
|
339
|
+
if (!r) throw new n("not_found", "This demo comment no longer exists.", 404);
|
|
340
|
+
return r;
|
|
341
|
+
}
|
|
342
|
+
modify(e, t) {
|
|
343
|
+
return this.write((n) => {
|
|
344
|
+
let r = this.find(n, e);
|
|
345
|
+
t(r), r.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
346
|
+
}), this.getComments().find((t) => t.id === e);
|
|
347
|
+
}
|
|
348
|
+
unavailable() {
|
|
349
|
+
throw new n("demo_unavailable", "This action is unavailable in the private browser demo.", 400);
|
|
350
|
+
}
|
|
351
|
+
destroy() {
|
|
352
|
+
this.destroyed = !0, this.timer && clearTimeout(this.timer), this.listeners.clear(), window.removeEventListener("focus", this.onFocus), document.removeEventListener("visibilitychange", this.onFocus), window.removeEventListener("storage", this.onStorage);
|
|
353
|
+
}
|
|
354
|
+
}, v = !1;
|
|
355
|
+
async function y(e = {}) {
|
|
356
|
+
if (typeof window > "u" || typeof document > "u") throw Error("The CommentKit demo requires a browser");
|
|
357
|
+
if (v || document.querySelector("[data-commentkit], [data-commentkit-host]")) throw Error("Destroy the existing CommentKit widget before starting a demo");
|
|
358
|
+
let t = new _(e);
|
|
359
|
+
v = !0;
|
|
360
|
+
let n = new r({
|
|
361
|
+
apiKey: "",
|
|
362
|
+
ui: {
|
|
363
|
+
...e.ui,
|
|
364
|
+
loadRemoteFonts: !1
|
|
365
|
+
}
|
|
366
|
+
}, t), i;
|
|
367
|
+
try {
|
|
368
|
+
let { mountCommentKitUI: e } = await import("./shared/mount-ui-CVivB_eQ.js").then((e) => e.n);
|
|
369
|
+
i = await e(n);
|
|
370
|
+
} catch (e) {
|
|
371
|
+
throw n.destroy(), v = !1, e;
|
|
372
|
+
}
|
|
373
|
+
let a = !1, o = {
|
|
374
|
+
start() {
|
|
375
|
+
a || n.startLocalDemo();
|
|
376
|
+
},
|
|
377
|
+
reset() {
|
|
378
|
+
a || (t.reset(), n.startLocalDemo());
|
|
379
|
+
},
|
|
380
|
+
destroy() {
|
|
381
|
+
a || (a = !0, i.unmount(), n.destroy(), v = !1);
|
|
382
|
+
},
|
|
383
|
+
getSession() {
|
|
384
|
+
return t.getSession();
|
|
385
|
+
},
|
|
386
|
+
getCore() {
|
|
387
|
+
return n;
|
|
388
|
+
},
|
|
389
|
+
onSessionChange(e) {
|
|
390
|
+
return t.subscribe(() => e(t.getSession()));
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
return o.start(), o;
|
|
394
|
+
}
|
|
395
|
+
export { y as createCommentKitDemo };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { t as e } from "./shared/websocket-manager-BTRqNTB7.js";
|
|
2
|
+
import { a as t, c as n, f as r, g as i, h as a, l as o, m as s, n as c, t as l } from "./shared/comment-kit-core-D0kY00St.js";
|
|
3
|
+
import { a as u, c as d, d as f, f as p, i as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./shared/dom-Bhf4WFtY.js";
|
|
4
|
+
export { r as ApiClient, l as CommentKitCore, t as EventEmitter, c as SDK_VERSION, e as WebSocketManager, n as createAgentContext, S as debounce, _ as findElement, o as formatAgentContext, s as formatMention, b as generateId, m as generateSelector, u as generateXPath, v as getCurrentPage, x as getElementBounds, d as getSelectionRange, h as getSelectionText, C as isElementVisible, f as isInteractiveElement, a as parseMentions, p as percentageToViewport, i as stripMentionMarkup, y as throttle, g as viewportToPercentage };
|