@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
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./chunk-Cyg4N8Ue.js";
|
|
2
|
-
import { a as t, c as n, d as r, l as i, o as a, s as o, t as s, u as c } from "./limits-AEqOBweE.js";
|
|
3
|
-
import { i as l } from "./dom-Cx1nMbdI.js";
|
|
4
|
-
var u = null;
|
|
5
|
-
function d() {
|
|
6
|
-
return u ||= import("./pusher-Vs-W-c8I.js").then((t) => /* @__PURE__ */ e(t.default, 1)).then((e) => e.default ?? e), u;
|
|
7
|
-
}
|
|
8
|
-
var f = s.ID, p = s.NAME, m = s.EMAIL, h = s.PAGE, g = s.COLOR, ee = s.DRAWING_PATH_DATA, te = s.DRAWING_TEXT, _ = s.ONLINE_USERS, ne = {
|
|
9
|
-
id: "unknown",
|
|
10
|
-
name: "Unknown",
|
|
11
|
-
email: "unknown@example.invalid"
|
|
12
|
-
}, v = new Set([
|
|
13
|
-
"client-cursor_move",
|
|
14
|
-
"client-cursor_leave",
|
|
15
|
-
"client-drawing_stroke"
|
|
16
|
-
]), y = new Set([
|
|
17
|
-
"path",
|
|
18
|
-
"line",
|
|
19
|
-
"rectangle",
|
|
20
|
-
"circle",
|
|
21
|
-
"text"
|
|
22
|
-
]);
|
|
23
|
-
function b(e) {
|
|
24
|
-
return c(e, f);
|
|
25
|
-
}
|
|
26
|
-
function x(e) {
|
|
27
|
-
return o(e) ? b(e.id) && c(e.name, p) && r(e.email) && i(e.avatar, h) : !1;
|
|
28
|
-
}
|
|
29
|
-
function S(e) {
|
|
30
|
-
return o(e) ? b(e.id) && n(e.content, s.CONTENT) && b(e.userId) && o(e.position) && t(e.position.x) && t(e.position.y) && x(e.author) : !1;
|
|
31
|
-
}
|
|
32
|
-
function re(e) {
|
|
33
|
-
return o(e) ? b(e.id) && n(e.content, s.CONTENT) && x(e.author) : !1;
|
|
34
|
-
}
|
|
35
|
-
function ie(e) {
|
|
36
|
-
return o(e) ? t(e.x) && e.x >= 0 && e.x <= 100 && t(e.y) && e.y >= 0 && e.y <= 100 && c(e.page, h) : !1;
|
|
37
|
-
}
|
|
38
|
-
function C(e) {
|
|
39
|
-
return !o(e) || !c(e.type, 20) || !y.has(e.type) || !c(e.stroke, g) || !t(e.strokeWidth) || e.strokeWidth <= 0 || e.strokeWidth > 100 || !c(e.fill, g) ? !1 : i(e.d, ee) && i(e.text, te) && (e.x === void 0 || t(e.x)) && (e.y === void 0 || t(e.y)) && (e.width === void 0 || t(e.width)) && (e.height === void 0 || t(e.height));
|
|
40
|
-
}
|
|
41
|
-
function w(e) {
|
|
42
|
-
return {
|
|
43
|
-
id: e.id.slice(0, f),
|
|
44
|
-
name: e.name.slice(0, p),
|
|
45
|
-
email: e.email.slice(0, m),
|
|
46
|
-
...e.avatar ? { avatar: e.avatar.slice(0, h) } : {},
|
|
47
|
-
...e.organizationId ? { organizationId: e.organizationId.slice(0, f) } : {}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function T(e) {
|
|
51
|
-
return c(e, h) ? e : "";
|
|
52
|
-
}
|
|
53
|
-
function E(e) {
|
|
54
|
-
let t = e.toLowerCase().replace(/^\[|\]$/g, "");
|
|
55
|
-
return t === "localhost" || t === "127.0.0.1" || t === "::1";
|
|
56
|
-
}
|
|
57
|
-
function D(e) {
|
|
58
|
-
return c(e, 253) && (e === "localhost" || /^[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(e));
|
|
59
|
-
}
|
|
60
|
-
function O() {
|
|
61
|
-
return { ...ne };
|
|
62
|
-
}
|
|
63
|
-
function ae(e) {
|
|
64
|
-
let t = String(e.projectId).trim();
|
|
65
|
-
if (!b(t) || !/^[\w.-]+$/.test(t)) throw Error("Invalid WebSocket projectId");
|
|
66
|
-
let n;
|
|
67
|
-
try {
|
|
68
|
-
n = new URL(e.authEndpoint);
|
|
69
|
-
} catch {
|
|
70
|
-
throw Error("Invalid WebSocket auth endpoint");
|
|
71
|
-
}
|
|
72
|
-
if (n.protocol !== "https:" && !(n.protocol === "http:" && E(n.hostname))) throw Error("Invalid WebSocket auth endpoint");
|
|
73
|
-
if (!c(e.key, 256)) throw Error("Invalid WebSocket key");
|
|
74
|
-
if (!D(e.wsHost)) throw Error("Invalid WebSocket host");
|
|
75
|
-
if (!c(e.apiKey, 512)) throw Error("Invalid WebSocket API key");
|
|
76
|
-
if (e.userEmail && !r(e.userEmail)) throw Error("Invalid WebSocket user email");
|
|
77
|
-
if (e.userInfo && !x(e.userInfo)) throw Error("Invalid WebSocket user info");
|
|
78
|
-
return {
|
|
79
|
-
...e,
|
|
80
|
-
projectId: t,
|
|
81
|
-
authEndpoint: n.toString(),
|
|
82
|
-
userInfo: e.userInfo ? w(e.userInfo) : void 0
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
var oe = class e {
|
|
86
|
-
static {
|
|
87
|
-
this.MAX_LISTENERS_PER_EVENT = 100;
|
|
88
|
-
}
|
|
89
|
-
constructor(e) {
|
|
90
|
-
this.listeners = /* @__PURE__ */ new Map(), this.pusher = null, this.presenceChannel = null, this.onlineUsers = /* @__PURE__ */ new Map(), this.lastCursorUpdate = 0, this.cursorThrottle = 50, this.reconnectAttempts = 0, this.connecting = null, this.destroyed = !1, this.config = ae(e);
|
|
91
|
-
}
|
|
92
|
-
on(t, n) {
|
|
93
|
-
let r = this.listeners.get(t);
|
|
94
|
-
return r || (r = /* @__PURE__ */ new Set(), this.listeners.set(t, r)), r.size >= e.MAX_LISTENERS_PER_EVENT && console.warn(`[CommentKit WS] Max listeners (${e.MAX_LISTENERS_PER_EVENT}) reached for '${t}' — possible memory leak`), r.add(n), () => {
|
|
95
|
-
let e = this.listeners.get(t);
|
|
96
|
-
e?.delete(n), e?.size === 0 && this.listeners.delete(t);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
emit(e, t) {
|
|
100
|
-
let n = this.listeners.get(e);
|
|
101
|
-
if (n) for (let r of Array.from(n)) try {
|
|
102
|
-
r(t);
|
|
103
|
-
} catch (t) {
|
|
104
|
-
console.error(`[CommentKit WS] Error in '${e}' listener:`, t);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
async connect() {
|
|
108
|
-
if (!(this.pusher || this.destroyed)) return this.connecting ||= this.openConnection().finally(() => {
|
|
109
|
-
this.connecting = null;
|
|
110
|
-
}), this.connecting;
|
|
111
|
-
}
|
|
112
|
-
async openConnection() {
|
|
113
|
-
if (this.pusher || this.destroyed) return;
|
|
114
|
-
let e = await d();
|
|
115
|
-
if (this.destroyed) return;
|
|
116
|
-
let t = { "X-API-Key": this.config.apiKey };
|
|
117
|
-
this.config.userEmail && (t["X-User-Email"] = this.config.userEmail), this.pusher = new e(this.config.key, {
|
|
118
|
-
cluster: "",
|
|
119
|
-
wsHost: this.config.wsHost,
|
|
120
|
-
wsPort: this.config.wsPort ?? 443,
|
|
121
|
-
wssPort: this.config.wsPort ?? 443,
|
|
122
|
-
forceTLS: this.config.forceTLS ?? !0,
|
|
123
|
-
enabledTransports: this.config.forceTLS === !1 ? ["ws", "wss"] : ["wss"],
|
|
124
|
-
disableStats: !0,
|
|
125
|
-
channelAuthorization: {
|
|
126
|
-
transport: "ajax",
|
|
127
|
-
endpoint: this.config.authEndpoint,
|
|
128
|
-
headers: t,
|
|
129
|
-
params: this.config.userInfo ? {
|
|
130
|
-
user_id: this.config.userInfo.id,
|
|
131
|
-
user_name: this.config.userInfo.name,
|
|
132
|
-
user_email: this.config.userInfo.email
|
|
133
|
-
} : {}
|
|
134
|
-
}
|
|
135
|
-
}), this.pusher.connection.bind("connected", () => {
|
|
136
|
-
this.reconnectAttempts = 0, this.emit("connected", void 0);
|
|
137
|
-
}), this.pusher.connection.bind("disconnected", () => {
|
|
138
|
-
this.emit("disconnected", {
|
|
139
|
-
code: 1e3,
|
|
140
|
-
reason: "Disconnected"
|
|
141
|
-
});
|
|
142
|
-
}), this.pusher.connection.bind("connecting", () => {
|
|
143
|
-
this.reconnectAttempts > 0 && this.emit("reconnecting", {
|
|
144
|
-
attempt: this.reconnectAttempts,
|
|
145
|
-
maxAttempts: 5
|
|
146
|
-
});
|
|
147
|
-
}), this.pusher.connection.bind("unavailable", () => {
|
|
148
|
-
this.reconnectAttempts++, this.emit("error", /* @__PURE__ */ Error("WebSocket connection unavailable"));
|
|
149
|
-
}), this.pusher.connection.bind("failed", () => {
|
|
150
|
-
this.emit("error", /* @__PURE__ */ Error("WebSocket connection failed"));
|
|
151
|
-
}), this.subscribeToChannel();
|
|
152
|
-
}
|
|
153
|
-
reconnect() {
|
|
154
|
-
if (!this.destroyed) {
|
|
155
|
-
if (!this.pusher) {
|
|
156
|
-
this.connect();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
this.pusher.connect();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
disconnect() {
|
|
163
|
-
this.presenceChannel &&= (this.pusher?.unsubscribe(`presence-project.${this.config.projectId}`), null), this.pusher &&= (this.pusher.disconnect(), null), this.onlineUsers.clear();
|
|
164
|
-
}
|
|
165
|
-
isConnected() {
|
|
166
|
-
return this.pusher?.connection.state === "connected";
|
|
167
|
-
}
|
|
168
|
-
getOnlineUsers() {
|
|
169
|
-
return Array.from(this.onlineUsers.values());
|
|
170
|
-
}
|
|
171
|
-
subscribeToChannel() {
|
|
172
|
-
if (!this.pusher) return;
|
|
173
|
-
let e = `presence-project.${this.config.projectId}`;
|
|
174
|
-
this.presenceChannel = this.pusher.subscribe(e), this.presenceChannel.bind("pusher:subscription_succeeded", (e) => {
|
|
175
|
-
this.onlineUsers.clear(), e.each((e) => {
|
|
176
|
-
if (this.onlineUsers.size >= _) return;
|
|
177
|
-
let t = this.memberToUser(e);
|
|
178
|
-
t && this.onlineUsers.set(t.id, t);
|
|
179
|
-
}), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
180
|
-
}), this.presenceChannel.bind("pusher:member_added", (e) => {
|
|
181
|
-
let t = this.memberToUser(e);
|
|
182
|
-
if (t) {
|
|
183
|
-
if (!this.onlineUsers.has(t.id) && this.onlineUsers.size >= _) return;
|
|
184
|
-
this.onlineUsers.set(t.id, t), this.emit("user:joined", t), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
185
|
-
}
|
|
186
|
-
}), this.presenceChannel.bind("pusher:member_removed", (e) => {
|
|
187
|
-
if (!b(e.id)) return;
|
|
188
|
-
let t = e.id;
|
|
189
|
-
this.onlineUsers.delete(t), this.emit("user:left", { userId: t }), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
190
|
-
}), this.presenceChannel.bind("pusher:subscription_error", (e) => {
|
|
191
|
-
console.error("[CommentKit WS] Channel subscription error:", e);
|
|
192
|
-
let t = c(e.type, 80) ? e.type : "unknown";
|
|
193
|
-
this.emit("error", /* @__PURE__ */ Error(`Channel subscription failed: ${t}`));
|
|
194
|
-
});
|
|
195
|
-
let t = (e, t) => {
|
|
196
|
-
this.presenceChannel?.bind(e, t), this.presenceChannel?.bind(`.${e}`, t);
|
|
197
|
-
};
|
|
198
|
-
t("comment_created", (e) => {
|
|
199
|
-
S(e) && this.emit("comment:created", e);
|
|
200
|
-
}), t("comment_updated", (e) => {
|
|
201
|
-
S(e) && this.emit("comment:updated", e);
|
|
202
|
-
}), t("comment_deleted", (e) => {
|
|
203
|
-
let t = e;
|
|
204
|
-
o(t) && b(t.id) && this.emit("comment:deleted", { id: t.id });
|
|
205
|
-
}), t("comment_resolved", (e) => {
|
|
206
|
-
S(e) && this.emit("comment:resolved", e);
|
|
207
|
-
}), t("comment_completed", (e) => {
|
|
208
|
-
S(e) && this.emit("comment:completed", e);
|
|
209
|
-
}), t("reply_added", (e) => {
|
|
210
|
-
let t = e;
|
|
211
|
-
o(t) && b(t.commentId) && re(t.reply) && this.emit("reply:added", {
|
|
212
|
-
commentId: t.commentId,
|
|
213
|
-
reply: t.reply
|
|
214
|
-
});
|
|
215
|
-
}), t("reaction_added", (e) => {
|
|
216
|
-
let t = e;
|
|
217
|
-
o(t) && b(t.commentId) && c(t.emoji, 32) && b(t.userId) && this.emit("reaction:added", {
|
|
218
|
-
commentId: t.commentId,
|
|
219
|
-
...b(t.replyId) ? { replyId: t.replyId } : {},
|
|
220
|
-
emoji: t.emoji,
|
|
221
|
-
userId: t.userId
|
|
222
|
-
});
|
|
223
|
-
}), t("reaction_removed", (e) => {
|
|
224
|
-
let t = e;
|
|
225
|
-
o(t) && b(t.commentId) && c(t.emoji, 32) && b(t.userId) && this.emit("reaction:removed", {
|
|
226
|
-
commentId: t.commentId,
|
|
227
|
-
...b(t.replyId) ? { replyId: t.replyId } : {},
|
|
228
|
-
emoji: t.emoji,
|
|
229
|
-
userId: t.userId
|
|
230
|
-
});
|
|
231
|
-
}), this.presenceChannel.bind("client-cursor_move", (e) => {
|
|
232
|
-
if (ie(e)) {
|
|
233
|
-
let t = e, n = x(t.user) ? t.user : O();
|
|
234
|
-
this.emit("cursor:move", {
|
|
235
|
-
...e,
|
|
236
|
-
user: n
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}), this.presenceChannel.bind("client-cursor_leave", (e) => {
|
|
240
|
-
let t = e;
|
|
241
|
-
o(t) && b(t.userId) && this.emit("cursor:leave", { userId: t.userId });
|
|
242
|
-
}), this.presenceChannel.bind("client-drawing_stroke", (e) => {
|
|
243
|
-
let t = e;
|
|
244
|
-
o(t) && b(t.userId) && C(t.path) && this.emit("drawing:stroke", {
|
|
245
|
-
userId: t.userId,
|
|
246
|
-
path: t.path
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
memberToUser(e) {
|
|
251
|
-
if (!b(e.id)) return null;
|
|
252
|
-
let t = e.info;
|
|
253
|
-
if (!t) return null;
|
|
254
|
-
let n = t.email == null || t.email === "" ? `${String(e.id)}@presence.invalid` : t.email, r = {
|
|
255
|
-
id: String(e.id),
|
|
256
|
-
name: t.name || "Anonymous",
|
|
257
|
-
email: n,
|
|
258
|
-
avatar: t.avatar
|
|
259
|
-
};
|
|
260
|
-
return x(r) ? w(r) : null;
|
|
261
|
-
}
|
|
262
|
-
sendCursorMove(e, t, n) {
|
|
263
|
-
if (!Number.isFinite(e) || !Number.isFinite(t)) return;
|
|
264
|
-
let r = T(n);
|
|
265
|
-
if (!r) return;
|
|
266
|
-
let i = Math.max(0, Math.min(100, e)), a = Math.max(0, Math.min(100, t)), o = Date.now();
|
|
267
|
-
o - this.lastCursorUpdate < this.cursorThrottle || (this.lastCursorUpdate = o, this.triggerClientEvent("client-cursor_move", {
|
|
268
|
-
x: i,
|
|
269
|
-
y: a,
|
|
270
|
-
page: r,
|
|
271
|
-
user: this.config.userInfo || O()
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
sendCursorLeave() {
|
|
275
|
-
this.triggerClientEvent("client-cursor_leave", { userId: this.config.userInfo?.id || "unknown" });
|
|
276
|
-
}
|
|
277
|
-
sendDrawingStroke(e) {
|
|
278
|
-
C(e) && this.triggerClientEvent("client-drawing_stroke", {
|
|
279
|
-
userId: this.config.userInfo?.id || "unknown",
|
|
280
|
-
path: e
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
requestPresence() {}
|
|
284
|
-
triggerClientEvent(e, t) {
|
|
285
|
-
if (v.has(e) && this.presenceChannel) try {
|
|
286
|
-
this.presenceChannel.trigger(e, t);
|
|
287
|
-
} catch {}
|
|
288
|
-
}
|
|
289
|
-
destroy() {
|
|
290
|
-
this.destroyed = !0, this.disconnect(), this.listeners.clear();
|
|
291
|
-
}
|
|
292
|
-
}, k = s.ID, A = s.CONTENT, se = s.NAME, ce = s.EMAIL, j = s.PAGE, M = s.EMOJI, N = s.ONLINE_USERS, P = s.REACTION_COUNT, F = 33, I = 1e3, L = s.CURSOR_EMITS_PER_SEC;
|
|
293
|
-
function R(e) {
|
|
294
|
-
let t = e.config.realtime, n = t?.maxRenderedCursors;
|
|
295
|
-
return {
|
|
296
|
-
cursors: t?.cursors !== !1,
|
|
297
|
-
presence: t?.presence !== !1,
|
|
298
|
-
maxRenderedCursors: typeof n == "number" && Number.isFinite(n) && n >= 0 ? Math.min(Math.floor(n), N) : s.RENDERED_CURSORS
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
var z = new Set([
|
|
302
|
-
"pin",
|
|
303
|
-
"highlight",
|
|
304
|
-
"drawing"
|
|
305
|
-
]), B = new Set([
|
|
306
|
-
"open",
|
|
307
|
-
"resolved",
|
|
308
|
-
"complete"
|
|
309
|
-
]), V = new Set([
|
|
310
|
-
"low",
|
|
311
|
-
"medium",
|
|
312
|
-
"high",
|
|
313
|
-
"urgent"
|
|
314
|
-
]), H = new Set([
|
|
315
|
-
"path",
|
|
316
|
-
"line",
|
|
317
|
-
"rectangle",
|
|
318
|
-
"circle",
|
|
319
|
-
"text"
|
|
320
|
-
]);
|
|
321
|
-
function U(e, t) {
|
|
322
|
-
return n(e, t);
|
|
323
|
-
}
|
|
324
|
-
function W(e) {
|
|
325
|
-
return U(e, k);
|
|
326
|
-
}
|
|
327
|
-
function le(e) {
|
|
328
|
-
if (!U(e, ce)) return !1;
|
|
329
|
-
let t = e.trim(), n = t.indexOf("@");
|
|
330
|
-
return n > 0 && n === t.lastIndexOf("@") && n < t.length - 1 && !/\s/.test(t);
|
|
331
|
-
}
|
|
332
|
-
function G(e) {
|
|
333
|
-
return o(e) && W(e.id) && U(e.name, se) && le(e.email) && i(e.avatar, j) && i(e.organizationId, k);
|
|
334
|
-
}
|
|
335
|
-
function K(e) {
|
|
336
|
-
return {
|
|
337
|
-
id: e.id.trim(),
|
|
338
|
-
name: e.name.trim(),
|
|
339
|
-
email: e.email.trim(),
|
|
340
|
-
...e.avatar ? { avatar: e.avatar.trim() } : {},
|
|
341
|
-
...e.organizationId ? { organizationId: e.organizationId.trim() } : {}
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
function ue(e) {
|
|
345
|
-
if (!Array.isArray(e)) return null;
|
|
346
|
-
let t = [], n = /* @__PURE__ */ new Set();
|
|
347
|
-
for (let r of e) {
|
|
348
|
-
if (t.length >= N) break;
|
|
349
|
-
if (!G(r)) continue;
|
|
350
|
-
let e = K(r);
|
|
351
|
-
n.has(e.id) || (n.add(e.id), t.push(e));
|
|
352
|
-
}
|
|
353
|
-
return t;
|
|
354
|
-
}
|
|
355
|
-
function de(e) {
|
|
356
|
-
return o(e) ? a(e.x) && a(e.y) : !1;
|
|
357
|
-
}
|
|
358
|
-
function fe(e) {
|
|
359
|
-
return o(e) && U(e.url, j) && U(e.path, j) && U(e.title, j);
|
|
360
|
-
}
|
|
361
|
-
function q(e) {
|
|
362
|
-
return o(e) && X(e.emoji) && Number.isInteger(e.count) && e.count >= 0 && e.count <= P && typeof e.reacted == "boolean";
|
|
363
|
-
}
|
|
364
|
-
function pe(e) {
|
|
365
|
-
return {
|
|
366
|
-
...e,
|
|
367
|
-
replies: Array.isArray(e.replies) ? e.replies.filter((e) => Y(e) !== null) : [],
|
|
368
|
-
...e.reactions === void 0 ? {} : { reactions: (e.reactions ?? []).filter(q) }
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
function J(e) {
|
|
372
|
-
return !o(e) || !W(e.id) || !z.has(e.type) || !U(e.content, A) || !de(e.position) || !B.has(e.status) || !V.has(e.priority) || !G(e.author) || !W(e.userId) || !U(e.createdAt, j) || !U(e.updatedAt, j) || !fe(e.page) || !Array.isArray(e.replies) || !Array.isArray(e.attachments) ? null : pe(structuredClone(e));
|
|
373
|
-
}
|
|
374
|
-
function Y(e) {
|
|
375
|
-
return !o(e) || !W(e.id) || !U(e.content, A) || !G(e.author) || !U(e.createdAt, j) ? null : structuredClone(e);
|
|
376
|
-
}
|
|
377
|
-
function me(e) {
|
|
378
|
-
return !o(e) || !G(e.user) || !t(e.x) || e.x < 0 || e.x > 100 || !t(e.y) || e.y < 0 || e.y > 100 || !U(e.page, j) ? null : {
|
|
379
|
-
x: e.x,
|
|
380
|
-
y: e.y,
|
|
381
|
-
page: e.page.trim(),
|
|
382
|
-
user: K(e.user)
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
function he(e) {
|
|
386
|
-
return o(e) ? U(e.type, s.DRAWING_TYPE) && H.has(e.type) && U(e.stroke, s.COLOR) && t(e.strokeWidth) && e.strokeWidth >= 0 && U(e.fill, s.COLOR) && i(e.d, s.DRAWING_PATH_DATA) && i(e.text, s.DRAWING_TEXT) && (e.x === void 0 || t(e.x)) && (e.y === void 0 || t(e.y)) && (e.width === void 0 || t(e.width)) && (e.height === void 0 || t(e.height)) : !1;
|
|
387
|
-
}
|
|
388
|
-
function X(e) {
|
|
389
|
-
return U(e, M);
|
|
390
|
-
}
|
|
391
|
-
function ge(e) {
|
|
392
|
-
try {
|
|
393
|
-
e();
|
|
394
|
-
} catch {}
|
|
395
|
-
}
|
|
396
|
-
function Z(e, t) {
|
|
397
|
-
return e.wsManager === t;
|
|
398
|
-
}
|
|
399
|
-
function Q(e, t) {
|
|
400
|
-
e.setState({ comments: e.getState().comments.map((e) => e.id === t.id ? t : e) });
|
|
401
|
-
}
|
|
402
|
-
function _e(e, t) {
|
|
403
|
-
if (e.config.features?.realtime === !1 || !e.config.reverb?.host || !e.config.reverb?.key) return;
|
|
404
|
-
if (t.wsManager) {
|
|
405
|
-
for (let e of t.wsUnsubscribers) ge(e);
|
|
406
|
-
t.wsUnsubscribers = [], $(t);
|
|
407
|
-
try {
|
|
408
|
-
t.wsManager.destroy();
|
|
409
|
-
} catch {}
|
|
410
|
-
t.wsManager = null;
|
|
411
|
-
}
|
|
412
|
-
let n = e.config.baseUrl || "https://api.commentkit.dev/api", r = e.getState().currentUser, i = R(e);
|
|
413
|
-
try {
|
|
414
|
-
t.wsManager = new oe({
|
|
415
|
-
key: e.config.reverb.key,
|
|
416
|
-
wsHost: e.config.reverb.host,
|
|
417
|
-
wsPort: e.config.reverb.port ?? 443,
|
|
418
|
-
forceTLS: (e.config.reverb.scheme ?? "wss") === "wss",
|
|
419
|
-
/* v8 ignore next -- projectId always provided in config */
|
|
420
|
-
projectId: e.config.projectId || "",
|
|
421
|
-
apiKey: e.config.apiKey,
|
|
422
|
-
authEndpoint: `${n}/broadcasting/auth`,
|
|
423
|
-
userEmail: r?.email,
|
|
424
|
-
userInfo: r ? {
|
|
425
|
-
id: r.id,
|
|
426
|
-
name: r.name,
|
|
427
|
-
email: r.email
|
|
428
|
-
} : void 0
|
|
429
|
-
});
|
|
430
|
-
} catch (t) {
|
|
431
|
-
e.setState({ connectionStatus: "error" }), e.handleError(t);
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
let a = t.wsUnsubscribers, s = t.wsManager;
|
|
435
|
-
a.push(s.on("connected", () => {
|
|
436
|
-
Z(t, s) && (e.setState({ connectionStatus: "connected" }), t.wsManager?.requestPresence());
|
|
437
|
-
})), a.push(s.on("disconnected", () => {
|
|
438
|
-
Z(t, s) && e.setState({ connectionStatus: "disconnected" });
|
|
439
|
-
})), a.push(s.on("reconnecting", () => {
|
|
440
|
-
Z(t, s) && e.setState({ connectionStatus: "connecting" });
|
|
441
|
-
})), a.push(s.on("error", () => {
|
|
442
|
-
Z(t, s) && e.setState({ connectionStatus: "error" });
|
|
443
|
-
})), a.push(s.on("comment:resolved", (n) => {
|
|
444
|
-
if (!Z(t, s)) return;
|
|
445
|
-
let r = J(n);
|
|
446
|
-
r && (Q(e, r), e.emit("comment:resolved", r));
|
|
447
|
-
})), a.push(s.on("comment:completed", (n) => {
|
|
448
|
-
if (!Z(t, s)) return;
|
|
449
|
-
let r = J(n);
|
|
450
|
-
r && (Q(e, r), e.emit("comment:completed", r));
|
|
451
|
-
})), a.push(s.on("comment:created", (n) => {
|
|
452
|
-
if (!Z(t, s)) return;
|
|
453
|
-
let r = J(n);
|
|
454
|
-
r && r.page.path === l().path && (e.getState().comments.find((e) => e.id === r.id) || (e.setState({ comments: [...e.getState().comments, r] }), e.emit("comment:created", r)));
|
|
455
|
-
})), a.push(s.on("comment:updated", (n) => {
|
|
456
|
-
if (!Z(t, s)) return;
|
|
457
|
-
let r = J(n);
|
|
458
|
-
r && (Q(e, r), e.emit("comment:updated", r));
|
|
459
|
-
})), a.push(s.on("comment:deleted", (n) => {
|
|
460
|
-
if (!Z(t, s) || !o(n) || !W(n.id)) return;
|
|
461
|
-
let r = n.id.trim();
|
|
462
|
-
e.setState({
|
|
463
|
-
comments: e.getState().comments.filter((e) => e.id !== r),
|
|
464
|
-
selectedComment: e.getState().selectedComment?.id === r ? null : e.getState().selectedComment
|
|
465
|
-
}), e.emit("comment:deleted", { id: r });
|
|
466
|
-
})), a.push(s.on("reply:added", (n) => {
|
|
467
|
-
if (!Z(t, s) || !o(n) || !W(n.commentId)) return;
|
|
468
|
-
let r = Y(n.reply);
|
|
469
|
-
if (!r) return;
|
|
470
|
-
let i = n.commentId.trim(), a = e.getState().comments.map((e) => e.id !== i || e.replies.some((e) => e.id === r.id) ? e : {
|
|
471
|
-
...e,
|
|
472
|
-
replies: [...e.replies, r]
|
|
473
|
-
});
|
|
474
|
-
e.setState({ comments: a });
|
|
475
|
-
let c = a.find((e) => e.id === i);
|
|
476
|
-
c && e.emit("comment:updated", c);
|
|
477
|
-
}));
|
|
478
|
-
let c = (e, t, n) => {
|
|
479
|
-
let r = (e ?? []).filter((e) => X(e.emoji) && Number.isInteger(e.count) && e.count >= 0 && e.count <= P), i = r.findIndex((e) => e.emoji === t);
|
|
480
|
-
if (i !== -1) {
|
|
481
|
-
let e = r[i];
|
|
482
|
-
r[i] = n ? {
|
|
483
|
-
...e,
|
|
484
|
-
reacted: !0
|
|
485
|
-
} : {
|
|
486
|
-
...e,
|
|
487
|
-
count: Math.min(e.count + 1, P),
|
|
488
|
-
reacted: e.reacted
|
|
489
|
-
};
|
|
490
|
-
} else r.push({
|
|
491
|
-
emoji: t,
|
|
492
|
-
count: 1,
|
|
493
|
-
reacted: n
|
|
494
|
-
});
|
|
495
|
-
return r;
|
|
496
|
-
}, u = (e, t, n) => (e ?? []).filter((e) => X(e.emoji) && Number.isInteger(e.count) && e.count > 0 && e.count <= P).map((e) => e.emoji === t ? {
|
|
497
|
-
...e,
|
|
498
|
-
count: n ? e.count : e.count - 1,
|
|
499
|
-
reacted: n ? !1 : e.reacted
|
|
500
|
-
} : e).filter((e) => e.count > 0), d = (n, r) => {
|
|
501
|
-
if (!Z(t, s) || !o(n) || !W(n.commentId) || !X(n.emoji) || !W(n.userId)) return;
|
|
502
|
-
let i = n.commentId.trim(), a = W(n.replyId) ? n.replyId.trim() : null, c = n.emoji.trim(), l = n.userId.trim() === e.getState().currentUser?.id;
|
|
503
|
-
e.setState({ comments: e.getState().comments.map((e) => e.id === i ? a === null ? {
|
|
504
|
-
...e,
|
|
505
|
-
reactions: r(e.reactions, c, l)
|
|
506
|
-
} : {
|
|
507
|
-
...e,
|
|
508
|
-
replies: e.replies.map((e) => e.id === a ? {
|
|
509
|
-
...e,
|
|
510
|
-
reactions: r(e.reactions, c, l)
|
|
511
|
-
} : e)
|
|
512
|
-
} : e) });
|
|
513
|
-
};
|
|
514
|
-
a.push(s.on("reaction:added", (e) => d(e, c))), a.push(s.on("reaction:removed", (e) => d(e, u)));
|
|
515
|
-
let f = /* @__PURE__ */ new Map(), p = 0, m = 0;
|
|
516
|
-
a.push(s.on("cursor:move", (n) => {
|
|
517
|
-
if (!Z(t, s) || !i.cursors) return;
|
|
518
|
-
let r = me(n);
|
|
519
|
-
if (!r) return;
|
|
520
|
-
let a = Date.now(), o = r.user.id, c = f.get(o);
|
|
521
|
-
if (c === void 0 && f.size >= i.maxRenderedCursors) {
|
|
522
|
-
let e, t = Infinity;
|
|
523
|
-
for (let [n, r] of f) r < t && (t = r, e = n);
|
|
524
|
-
if (e !== void 0 && a - t >= F) f.delete(e);
|
|
525
|
-
else return;
|
|
526
|
-
}
|
|
527
|
-
c !== void 0 && a - c < F || (a - p >= I && (p = a, m = 0), !(m >= L) && (m++, f.set(o, a), e.emit("cursor:move", r)));
|
|
528
|
-
})), a.push(s.on("cursor:leave", (n) => {
|
|
529
|
-
!Z(t, s) || !o(n) || !W(n.userId) || (f.delete(n.userId.trim()), e.emit("cursor:leave", { userId: n.userId.trim() }));
|
|
530
|
-
})), a.push(s.on("user:joined", (n) => {
|
|
531
|
-
!Z(t, s) || !G(n) || e.emit("user:joined", K(n));
|
|
532
|
-
})), a.push(s.on("user:left", (n) => {
|
|
533
|
-
!Z(t, s) || !o(n) || !W(n.userId) || e.emit("user:left", { userId: n.userId.trim() });
|
|
534
|
-
})), a.push(s.on("presence:update", (n) => {
|
|
535
|
-
if (!Z(t, s) || !i.presence || !o(n)) return;
|
|
536
|
-
let r = ue(n.users);
|
|
537
|
-
if (!r) return;
|
|
538
|
-
let a = { users: r };
|
|
539
|
-
e.setState({ onlineUsers: r }), e.emit("presence:update", a);
|
|
540
|
-
})), a.push(s.on("drawing:stroke", (n) => {
|
|
541
|
-
!Z(t, s) || !o(n) || !W(n.userId) || !he(n.path) || e.emit("drawing:stroke", {
|
|
542
|
-
userId: n.userId.trim(),
|
|
543
|
-
path: structuredClone(n.path)
|
|
544
|
-
});
|
|
545
|
-
}));
|
|
546
|
-
try {
|
|
547
|
-
e.setState({ connectionStatus: "connecting" });
|
|
548
|
-
let t = s.connect();
|
|
549
|
-
t && typeof t.catch == "function" && t.catch((t) => {
|
|
550
|
-
e.setState({ connectionStatus: "error" }), e.handleError(t);
|
|
551
|
-
});
|
|
552
|
-
} catch (t) {
|
|
553
|
-
e.setState({ connectionStatus: "error" }), e.handleError(t);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
typeof document > "u" || typeof window > "u" || i.cursors && (t.mouseMoveHandler = (n) => {
|
|
557
|
-
if (e.getState().isOverlayVisible && t.wsManager?.isConnected()) {
|
|
558
|
-
if (window.innerWidth <= 0 || window.innerHeight <= 0) return;
|
|
559
|
-
let e = Math.max(0, Math.min(100, n.clientX / window.innerWidth * 100)), r = Math.max(0, Math.min(100, n.clientY / window.innerHeight * 100));
|
|
560
|
-
t.wsManager.sendCursorMove(e, r, l().url);
|
|
561
|
-
}
|
|
562
|
-
}, document.addEventListener("mousemove", t.mouseMoveHandler));
|
|
563
|
-
}
|
|
564
|
-
function $(e) {
|
|
565
|
-
typeof window < "u" && typeof document < "u" && e.mouseMoveHandler && (document.removeEventListener("mousemove", e.mouseMoveHandler), e.mouseMoveHandler = null);
|
|
566
|
-
}
|
|
567
|
-
export { _e as initializeWebSocket, $ as removeMouseMoveListener };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, t as n } from "./widget-theme-CYPYAwhR.js";
|
|
2
|
-
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
|
-
import { createPortal as c } from "react-dom";
|
|
4
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
5
|
-
var f = "https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap";
|
|
6
|
-
function p() {
|
|
7
|
-
if (typeof document > "u" || document.querySelector("link[data-commentkit-font]") || getComputedStyle(document.documentElement).getPropertyValue("--font-geist-sans").trim()) return;
|
|
8
|
-
if (!document.querySelector("link[href=\"https://fonts.googleapis.com\"]")) {
|
|
9
|
-
let e = document.createElement("link");
|
|
10
|
-
e.rel = "preconnect", e.href = "https://fonts.googleapis.com", document.head.appendChild(e);
|
|
11
|
-
let t = document.createElement("link");
|
|
12
|
-
t.rel = "preconnect", t.href = "https://fonts.gstatic.com", t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
13
|
-
}
|
|
14
|
-
let e = document.createElement("link");
|
|
15
|
-
e.rel = "stylesheet", e.href = f, e.setAttribute("data-commentkit-font", "geist"), document.head.appendChild(e);
|
|
16
|
-
}
|
|
17
|
-
var m = ({ children: f, styles: m, config: h }) => {
|
|
18
|
-
let g = o(null), [_, v] = s(null), [y, b] = s(null), [x, S] = s(!1), C = h?.ui?.loadRemoteFonts === !0;
|
|
19
|
-
i(() => {
|
|
20
|
-
let e = g.current;
|
|
21
|
-
e && (e.shadowRoot ? v(e.shadowRoot) : v(e.attachShadow({ mode: "open" })));
|
|
22
|
-
}, []), i(() => {
|
|
23
|
-
C && p();
|
|
24
|
-
}, [C]), i(() => {
|
|
25
|
-
let e = document.documentElement, r = window.matchMedia("(prefers-color-scheme: dark)"), i = () => {
|
|
26
|
-
let t = n();
|
|
27
|
-
if (t) {
|
|
28
|
-
S(t === "dark");
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
let i = e.classList.contains("dark"), a = e.classList.contains("light");
|
|
32
|
-
S(i ? !0 : a ? !1 : r.matches);
|
|
33
|
-
};
|
|
34
|
-
i();
|
|
35
|
-
let a = new MutationObserver(i);
|
|
36
|
-
a.observe(e, {
|
|
37
|
-
attributes: !0,
|
|
38
|
-
attributeFilter: ["class"]
|
|
39
|
-
}), r.addEventListener("change", i);
|
|
40
|
-
let o = t(i);
|
|
41
|
-
return () => {
|
|
42
|
-
o(), a.disconnect(), r.removeEventListener("change", i);
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
|
-
let w = r(() => {
|
|
46
|
-
/* v8 ignore start -- SSR guard unreachable in jsdom */
|
|
47
|
-
if (typeof window > "u") return "";
|
|
48
|
-
/* v8 ignore stop */
|
|
49
|
-
let e = getComputedStyle(document.documentElement), t = e.getPropertyValue("--font-geist-sans").trim(), n = e.getPropertyValue("--font-geist-mono").trim();
|
|
50
|
-
if (!t && !n) return "";
|
|
51
|
-
let r = [];
|
|
52
|
-
return t && r.push(`--font-sans: ${t}, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`), n && r.push(`--font-mono: ${n}, "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`), `:host { ${r.join("; ")}; }`;
|
|
53
|
-
}, []), [T, E] = s(() => w());
|
|
54
|
-
i(() => {
|
|
55
|
-
let e = !1, t = () => {
|
|
56
|
-
if (e) return;
|
|
57
|
-
let t = w();
|
|
58
|
-
E((e) => e === t ? e : t);
|
|
59
|
-
};
|
|
60
|
-
typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(t).catch(() => void 0);
|
|
61
|
-
let n = setTimeout(t, 2e3);
|
|
62
|
-
return () => {
|
|
63
|
-
e = !0, clearTimeout(n);
|
|
64
|
-
};
|
|
65
|
-
}, [w]);
|
|
66
|
-
let D = a(() => m + "\n" + T, [m, T]);
|
|
67
|
-
return /* @__PURE__ */ u("div", {
|
|
68
|
-
ref: g,
|
|
69
|
-
"data-commentkit-host": !0,
|
|
70
|
-
"data-ck-dark": x || void 0,
|
|
71
|
-
style: {
|
|
72
|
-
position: "fixed",
|
|
73
|
-
top: 0,
|
|
74
|
-
left: 0,
|
|
75
|
-
width: 0,
|
|
76
|
-
height: 0,
|
|
77
|
-
overflow: "visible",
|
|
78
|
-
zIndex: 2147483647,
|
|
79
|
-
pointerEvents: "none"
|
|
80
|
-
},
|
|
81
|
-
children: _ && c(/* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("style", { children: D }), /* @__PURE__ */ u(e.Provider, {
|
|
82
|
-
value: y,
|
|
83
|
-
children: /* @__PURE__ */ u("div", {
|
|
84
|
-
ref: b,
|
|
85
|
-
className: "ck-root",
|
|
86
|
-
"data-commentkit-ui": !0,
|
|
87
|
-
"data-theme": x ? "dark" : "light",
|
|
88
|
-
children: y ? f : null
|
|
89
|
-
})
|
|
90
|
-
})] }), _)
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
export { m as ShadowContainer };
|