@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
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { B as e, I as t, L as n, V as r, m as i, z as a } from "./button-By0hGrJK.js";
|
|
2
|
+
import { n as o } from "./useValueChanged-DQXLia-2.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
var c = "data-valid", l = "data-invalid", u = {
|
|
5
|
+
badInput: !1,
|
|
6
|
+
customError: !1,
|
|
7
|
+
patternMismatch: !1,
|
|
8
|
+
rangeOverflow: !1,
|
|
9
|
+
rangeUnderflow: !1,
|
|
10
|
+
stepMismatch: !1,
|
|
11
|
+
tooLong: !1,
|
|
12
|
+
tooShort: !1,
|
|
13
|
+
typeMismatch: !1,
|
|
14
|
+
valid: null,
|
|
15
|
+
valueMissing: !1
|
|
16
|
+
}, d = {
|
|
17
|
+
disabled: !1,
|
|
18
|
+
valid: null,
|
|
19
|
+
touched: !1,
|
|
20
|
+
dirty: !1,
|
|
21
|
+
filled: !1,
|
|
22
|
+
focused: !1
|
|
23
|
+
}, f = { valid(e) {
|
|
24
|
+
return e === null ? null : e ? { [c]: "" } : { [l]: "" };
|
|
25
|
+
} }, p = {
|
|
26
|
+
invalid: void 0,
|
|
27
|
+
name: void 0,
|
|
28
|
+
validityData: {
|
|
29
|
+
state: u,
|
|
30
|
+
errors: [],
|
|
31
|
+
error: "",
|
|
32
|
+
value: "",
|
|
33
|
+
initialValue: null
|
|
34
|
+
},
|
|
35
|
+
setValidityData: e,
|
|
36
|
+
disabled: void 0,
|
|
37
|
+
setTouched: e,
|
|
38
|
+
setDirty: e,
|
|
39
|
+
setFilled: e,
|
|
40
|
+
setFocused: e,
|
|
41
|
+
focusOwnerRef: { current: void 0 },
|
|
42
|
+
validationMode: "onSubmit",
|
|
43
|
+
shouldValidateOnChange: () => !1,
|
|
44
|
+
state: d,
|
|
45
|
+
registerFieldControl: e,
|
|
46
|
+
validation: {
|
|
47
|
+
getValidationProps: (e, t = a) => t,
|
|
48
|
+
inputRef: { current: null },
|
|
49
|
+
registeredInputs: /* @__PURE__ */ new Map(),
|
|
50
|
+
registerInput: e,
|
|
51
|
+
getInputControl: () => null,
|
|
52
|
+
commit: async () => {},
|
|
53
|
+
change: e
|
|
54
|
+
}
|
|
55
|
+
}, m = /*#__PURE__*/ s.createContext(p);
|
|
56
|
+
process.env.NODE_ENV !== "production" && (m.displayName = "FieldRootContext");
|
|
57
|
+
function h(n = !0) {
|
|
58
|
+
let r = s.useContext(m);
|
|
59
|
+
if (r.setValidityData === e && !n) throw Error(process.env.NODE_ENV === "production" ? t(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
|
|
60
|
+
return r;
|
|
61
|
+
}
|
|
62
|
+
function g(e, t, r) {
|
|
63
|
+
let { setFocused: a, focusOwnerRef: o } = h(), s = i((t) => {
|
|
64
|
+
(t ? !e : o.current === s) && (o.current = t && s, r?.(t), a(t));
|
|
65
|
+
});
|
|
66
|
+
return n(() => {
|
|
67
|
+
let e = t.current;
|
|
68
|
+
return e?.getRootNode()?.activeElement === e && s(!0), () => s(!1);
|
|
69
|
+
}, [
|
|
70
|
+
e,
|
|
71
|
+
t,
|
|
72
|
+
s
|
|
73
|
+
]), s;
|
|
74
|
+
}
|
|
75
|
+
function _(e, t, i, a, o = !0, s) {
|
|
76
|
+
let { registerFieldControl: c } = h(), l = r(() => Symbol());
|
|
77
|
+
n(() => {
|
|
78
|
+
let n = l.current;
|
|
79
|
+
o ? c(n, {
|
|
80
|
+
controlRef: e,
|
|
81
|
+
getValue: a,
|
|
82
|
+
id: t,
|
|
83
|
+
name: s,
|
|
84
|
+
value: i
|
|
85
|
+
}) : c(n, void 0);
|
|
86
|
+
}, [
|
|
87
|
+
e,
|
|
88
|
+
o,
|
|
89
|
+
a,
|
|
90
|
+
t,
|
|
91
|
+
s,
|
|
92
|
+
c,
|
|
93
|
+
l,
|
|
94
|
+
i
|
|
95
|
+
]), n(() => {
|
|
96
|
+
let e = l.current;
|
|
97
|
+
return () => {
|
|
98
|
+
c(e, void 0);
|
|
99
|
+
};
|
|
100
|
+
}, [c, l]);
|
|
101
|
+
}
|
|
102
|
+
var v = /*#__PURE__*/ s.createContext({
|
|
103
|
+
elementRef: { current: null },
|
|
104
|
+
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
105
|
+
errors: {},
|
|
106
|
+
clearErrors: e,
|
|
107
|
+
validationMode: "onSubmit",
|
|
108
|
+
submitCountRef: { current: 0 }
|
|
109
|
+
});
|
|
110
|
+
process.env.NODE_ENV !== "production" && (v.displayName = "FormContext");
|
|
111
|
+
function y() {
|
|
112
|
+
return s.useContext(v);
|
|
113
|
+
}
|
|
114
|
+
var b = /*#__PURE__*/ s.createContext({
|
|
115
|
+
controlId: void 0,
|
|
116
|
+
registerControlId: e,
|
|
117
|
+
resetControlId: e,
|
|
118
|
+
labelId: void 0,
|
|
119
|
+
setLabelId: e,
|
|
120
|
+
messageIds: [],
|
|
121
|
+
setMessageIds: e,
|
|
122
|
+
getDescriptionProps: (e) => e
|
|
123
|
+
});
|
|
124
|
+
process.env.NODE_ENV !== "production" && (b.displayName = "LabelableContext");
|
|
125
|
+
function x() {
|
|
126
|
+
return s.useContext(b);
|
|
127
|
+
}
|
|
128
|
+
function S(t = {}) {
|
|
129
|
+
let { id: a, enabled: c = !0 } = t, { controlId: l, registerControlId: u, resetControlId: d } = x(), f = o(), p = r(() => Symbol()), m = s.useRef(!1), h = s.useRef(!1), g = i(() => {
|
|
130
|
+
m.current && u !== e && (m.current = !1, u(p.current, void 0));
|
|
131
|
+
});
|
|
132
|
+
return n(() => {
|
|
133
|
+
if (!c || u === e) {
|
|
134
|
+
g();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let t;
|
|
138
|
+
if (a !== void 0) h.current = !0, t = a;
|
|
139
|
+
else if (h.current) t = f;
|
|
140
|
+
else {
|
|
141
|
+
d();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
t === void 0 ? g() : (m.current = !0, u(p.current, t));
|
|
145
|
+
}, [
|
|
146
|
+
a,
|
|
147
|
+
c,
|
|
148
|
+
u,
|
|
149
|
+
d,
|
|
150
|
+
f,
|
|
151
|
+
p,
|
|
152
|
+
g
|
|
153
|
+
]), n(() => g, [g]), (c ? l : void 0) ?? a ?? f;
|
|
154
|
+
}
|
|
155
|
+
export { g as a, _ as i, x as n, h as o, y as r, f as s, S as t };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { L as e, R as t, V as n, h as r, m as i, z as a } from "./button-By0hGrJK.js";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
function s(e) {
|
|
4
|
+
o.useEffect(e, t);
|
|
5
|
+
}
|
|
6
|
+
var c = 0, l = class e {
|
|
7
|
+
static create() {
|
|
8
|
+
return new e();
|
|
9
|
+
}
|
|
10
|
+
currentId = c;
|
|
11
|
+
start(e, t) {
|
|
12
|
+
this.clear(), this.currentId = setTimeout(() => {
|
|
13
|
+
this.currentId = c, t();
|
|
14
|
+
}, e);
|
|
15
|
+
}
|
|
16
|
+
isStarted() {
|
|
17
|
+
return this.currentId !== c;
|
|
18
|
+
}
|
|
19
|
+
clear = () => {
|
|
20
|
+
this.currentId !== c && (clearTimeout(this.currentId), this.currentId = c);
|
|
21
|
+
};
|
|
22
|
+
disposeEffect = () => this.clear;
|
|
23
|
+
};
|
|
24
|
+
function u() {
|
|
25
|
+
let e = n(l.create).current;
|
|
26
|
+
return s(e.disposeEffect), e;
|
|
27
|
+
}
|
|
28
|
+
function d(e, t, n, r) {
|
|
29
|
+
let i = !1, o = !1, s = r ?? a;
|
|
30
|
+
return {
|
|
31
|
+
reason: e,
|
|
32
|
+
event: t ?? new Event("base-ui"),
|
|
33
|
+
cancel() {
|
|
34
|
+
i = !0;
|
|
35
|
+
},
|
|
36
|
+
allowPropagation() {
|
|
37
|
+
o = !0;
|
|
38
|
+
},
|
|
39
|
+
get isCanceled() {
|
|
40
|
+
return i;
|
|
41
|
+
},
|
|
42
|
+
get isPropagationAllowed() {
|
|
43
|
+
return o;
|
|
44
|
+
},
|
|
45
|
+
trigger: n,
|
|
46
|
+
...s
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function f(e, t, n) {
|
|
50
|
+
let r = n ?? a;
|
|
51
|
+
return {
|
|
52
|
+
reason: e,
|
|
53
|
+
event: t ?? new Event("base-ui"),
|
|
54
|
+
...r
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var p = "none", m = "trigger-press", h = "trigger-hover", g = "trigger-focus", _ = "outside-press", v = "item-press", y = "close-press", b = "track-press", x = "input-change", S = "focus-out", C = "escape-key", w = "list-navigation", T = "keyboard", E = "pointer", D = "drag", O = "cancel-open", k = "sibling-open", A = "disabled", j = "missing", M = "initial", N = "imperative-action", P = "window-resize";
|
|
58
|
+
function F() {
|
|
59
|
+
let [, e] = o.useState({});
|
|
60
|
+
return o.useCallback(() => {
|
|
61
|
+
e({});
|
|
62
|
+
}, []);
|
|
63
|
+
}
|
|
64
|
+
var I = 0;
|
|
65
|
+
function L(e, t = "mui") {
|
|
66
|
+
let n = o.useRef(void 0), r = F(), i = e ?? n.current;
|
|
67
|
+
return o.useEffect(() => {
|
|
68
|
+
n.current ?? (I += 1, n.current = `${t}-${I}`, e ?? r());
|
|
69
|
+
}, [
|
|
70
|
+
e,
|
|
71
|
+
t,
|
|
72
|
+
r
|
|
73
|
+
]), i;
|
|
74
|
+
}
|
|
75
|
+
var R = r.useId;
|
|
76
|
+
function z(e, t) {
|
|
77
|
+
if (R !== void 0) {
|
|
78
|
+
let n = R();
|
|
79
|
+
return e ?? (t ? `${t}-${n}` : n);
|
|
80
|
+
}
|
|
81
|
+
return L(e, t);
|
|
82
|
+
}
|
|
83
|
+
function B(e) {
|
|
84
|
+
return z(e, "base-ui");
|
|
85
|
+
}
|
|
86
|
+
function V(t, n) {
|
|
87
|
+
let r = o.useRef(t), a = i(n);
|
|
88
|
+
e(() => {
|
|
89
|
+
r.current !== t && a(r.current), r.current = t;
|
|
90
|
+
}, [t, a]);
|
|
91
|
+
}
|
|
92
|
+
export { u as A, g as C, d as D, P as E, f as O, b as S, m as T, j as _, O as a, E as b, D as c, N as d, M as f, w as g, T as h, F as i, s as j, l as k, C as l, v as m, B as n, y as o, x as p, z as r, A as s, V as t, S as u, p as v, h as w, k as x, _ as y };
|
|
@@ -37,35 +37,9 @@ function c(e, t = 254) {
|
|
|
37
37
|
let r = n.indexOf("@");
|
|
38
38
|
return r > 0 && r === n.lastIndexOf("@") && r < n.length - 1 && !/\s/.test(n);
|
|
39
39
|
}
|
|
40
|
-
var l = new Set(/* @__PURE__ */ "exe.dll.bat.cmd.com.msi.scr.pif.cpl.sh.bash.zsh.ps1.py.rb.pl.php.jar.js.mjs.cjs.html.htm.xhtml.svg.swf.wasm".split("."));
|
|
40
|
+
var l = /* @__PURE__ */ new Set(/* @__PURE__ */ "exe.dll.bat.cmd.com.msi.scr.pif.cpl.sh.bash.zsh.ps1.py.rb.pl.php.jar.js.mjs.cjs.html.htm.xhtml.svg.swf.wasm".split("."));
|
|
41
41
|
function u(e) {
|
|
42
42
|
let t = e.lastIndexOf("."), n = t >= 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
43
43
|
return l.has(n);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
ID: 256,
|
|
47
|
-
CONTENT: 1e4,
|
|
48
|
-
REPLY_CONTENT: 5e3,
|
|
49
|
-
NAME: 500,
|
|
50
|
-
EMAIL: 254,
|
|
51
|
-
PAGE: 2e3,
|
|
52
|
-
SELECTOR: 2048,
|
|
53
|
-
EMOJI: 32,
|
|
54
|
-
COLOR: 128,
|
|
55
|
-
DRAWING_PATH_DATA: 5e4,
|
|
56
|
-
DRAWING_TEXT: 5e3,
|
|
57
|
-
DRAWING_TYPE: 20,
|
|
58
|
-
DRAWING_PATHS: 1e3,
|
|
59
|
-
TEXT_SELECTION: 2e4,
|
|
60
|
-
DESCRIPTION: 1e4,
|
|
61
|
-
ASSIGNEES: 100,
|
|
62
|
-
CHECKLIST_ITEMS: 100,
|
|
63
|
-
CHECKLIST_LABEL: 500,
|
|
64
|
-
ONLINE_USERS: 500,
|
|
65
|
-
RENDERED_CURSORS: 24,
|
|
66
|
-
CURSOR_EMITS_PER_SEC: 240,
|
|
67
|
-
REACTION_COUNT: 1e6,
|
|
68
|
-
PENDING_MUTATIONS: 1e3,
|
|
69
|
-
RETRY_DELAY: 3e4
|
|
70
|
-
});
|
|
71
|
-
export { r as a, s as c, c as d, t as i, o as l, u as n, i as o, e as r, n as s, d as t, a as u };
|
|
45
|
+
export { i as a, o as c, r as i, a as l, e as n, n as o, t as r, s, u as t, c as u };
|
|
@@ -1,160 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function a(e) {
|
|
23
|
-
return i(e) && e >= 0 && e <= 100;
|
|
24
|
-
}
|
|
25
|
-
function o(e, n) {
|
|
26
|
-
return typeof e == "string" && e.trim().length > 0 && e.length <= n && !t(e);
|
|
27
|
-
}
|
|
28
|
-
function s(e, n) {
|
|
29
|
-
return e === void 0 || typeof e == "string" && e.length <= n && !t(e);
|
|
30
|
-
}
|
|
31
|
-
function c(e, t) {
|
|
32
|
-
return typeof e == "string" && e.trim().length > 0 && e.length <= t && !n(e);
|
|
33
|
-
}
|
|
34
|
-
function l(e, t = 254) {
|
|
35
|
-
if (!o(e, t)) return !1;
|
|
36
|
-
let n = e.trim();
|
|
37
|
-
if (n !== e) return !1;
|
|
38
|
-
let r = n.indexOf("@");
|
|
39
|
-
return r > 0 && r === n.lastIndexOf("@") && r < n.length - 1 && !/\s/.test(n);
|
|
40
|
-
}
|
|
41
|
-
var u = new Set(/* @__PURE__ */ "exe.dll.bat.cmd.com.msi.scr.pif.cpl.sh.bash.zsh.ps1.py.rb.pl.php.jar.js.mjs.cjs.html.htm.xhtml.svg.swf.wasm".split("."));
|
|
42
|
-
function d(e) {
|
|
43
|
-
let t = e.lastIndexOf("."), n = t >= 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
44
|
-
return u.has(n);
|
|
45
|
-
}
|
|
46
|
-
var f = Object.freeze({
|
|
47
|
-
ID: 256,
|
|
48
|
-
CONTENT: 1e4,
|
|
49
|
-
REPLY_CONTENT: 5e3,
|
|
50
|
-
NAME: 500,
|
|
51
|
-
EMAIL: 254,
|
|
52
|
-
PAGE: 2e3,
|
|
53
|
-
SELECTOR: 2048,
|
|
54
|
-
EMOJI: 32,
|
|
55
|
-
COLOR: 128,
|
|
56
|
-
DRAWING_PATH_DATA: 5e4,
|
|
57
|
-
DRAWING_TEXT: 5e3,
|
|
58
|
-
DRAWING_TYPE: 20,
|
|
59
|
-
DRAWING_PATHS: 1e3,
|
|
60
|
-
TEXT_SELECTION: 2e4,
|
|
61
|
-
DESCRIPTION: 1e4,
|
|
62
|
-
ASSIGNEES: 100,
|
|
63
|
-
CHECKLIST_ITEMS: 100,
|
|
64
|
-
CHECKLIST_LABEL: 500,
|
|
65
|
-
ONLINE_USERS: 500,
|
|
66
|
-
RENDERED_CURSORS: 24,
|
|
67
|
-
CURSOR_EMITS_PER_SEC: 240,
|
|
68
|
-
REACTION_COUNT: 1e6,
|
|
69
|
-
PENDING_MUTATIONS: 1e3,
|
|
70
|
-
RETRY_DELAY: 3e4
|
|
71
|
-
}), p = null;
|
|
72
|
-
function m() {
|
|
73
|
-
return p ||= import("./pusher-CizoY5NA.js").then((t) => /* @__PURE__ */ e(t.default, 1)).then((e) => e.default ?? e), p;
|
|
1
|
+
import { c as e, i as t, l as n, o as r, s as i, u as a } from "./validation-C7QG8j7Z.js";
|
|
2
|
+
import { i as o } from "./comment-kit-core-D0kY00St.js";
|
|
3
|
+
var s = Object.create, c = Object.defineProperty, l = Object.getOwnPropertyDescriptor, u = Object.getOwnPropertyNames, d = Object.getPrototypeOf, f = Object.prototype.hasOwnProperty, p = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), m = (e, t) => {
|
|
4
|
+
let n = {};
|
|
5
|
+
for (var r in e) c(n, r, {
|
|
6
|
+
get: e[r],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return t || c(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
10
|
+
}, h = (e, t, n, r) => {
|
|
11
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = u(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !f.call(e, s) && s !== n && c(e, s, {
|
|
12
|
+
get: ((e) => t[e]).bind(null, s),
|
|
13
|
+
enumerable: !(r = l(t, s)) || r.enumerable
|
|
14
|
+
});
|
|
15
|
+
return e;
|
|
16
|
+
}, g = (e, t, n) => (n = e == null ? {} : s(d(e)), h(t || !e || !e.__esModule || !f.call(e, "default") ? c(n, "default", {
|
|
17
|
+
value: e,
|
|
18
|
+
enumerable: !0
|
|
19
|
+
}) : n, e)), _ = null;
|
|
20
|
+
function v() {
|
|
21
|
+
return _ ||= import("./pusher-BEl7Qn-8.js").then((e) => /* @__PURE__ */ g(e.default, 1)).then((e) => e.default ?? e), _;
|
|
74
22
|
}
|
|
75
|
-
var
|
|
23
|
+
var y = o.ID, b = o.NAME, x = o.EMAIL, S = o.PAGE, C = o.COLOR, w = o.DRAWING_PATH_DATA, T = o.DRAWING_TEXT, E = o.ONLINE_USERS, D = {
|
|
76
24
|
id: "unknown",
|
|
77
25
|
name: "Unknown",
|
|
78
26
|
email: "unknown@example.invalid"
|
|
79
|
-
},
|
|
27
|
+
}, O = /* @__PURE__ */ new Set([
|
|
80
28
|
"client-cursor_move",
|
|
81
29
|
"client-cursor_leave",
|
|
82
30
|
"client-drawing_stroke"
|
|
83
|
-
]),
|
|
31
|
+
]), k = /* @__PURE__ */ new Set([
|
|
84
32
|
"path",
|
|
85
33
|
"line",
|
|
86
34
|
"rectangle",
|
|
87
35
|
"circle",
|
|
88
36
|
"text"
|
|
89
37
|
]);
|
|
90
|
-
function
|
|
91
|
-
return
|
|
38
|
+
function A(e) {
|
|
39
|
+
return n(e, y);
|
|
92
40
|
}
|
|
93
|
-
function
|
|
94
|
-
return r(
|
|
41
|
+
function j(t) {
|
|
42
|
+
return r(t) ? A(t.id) && n(t.name, b) && a(t.email) && e(t.avatar, S) : !1;
|
|
95
43
|
}
|
|
96
|
-
function
|
|
97
|
-
return r(e) ?
|
|
44
|
+
function M(e) {
|
|
45
|
+
return r(e) ? A(e.id) && i(e.content, o.CONTENT) && A(e.userId) && r(e.position) && t(e.position.x) && t(e.position.y) && j(e.author) : !1;
|
|
98
46
|
}
|
|
99
|
-
function
|
|
100
|
-
return r(e) ?
|
|
47
|
+
function N(e) {
|
|
48
|
+
return r(e) ? A(e.id) && i(e.content, o.CONTENT) && j(e.author) : !1;
|
|
101
49
|
}
|
|
102
|
-
function
|
|
103
|
-
return r(e) ?
|
|
50
|
+
function P(e) {
|
|
51
|
+
return r(e) ? t(e.x) && e.x >= 0 && e.x <= 100 && t(e.y) && e.y >= 0 && e.y <= 100 && n(e.page, S) : !1;
|
|
104
52
|
}
|
|
105
|
-
function
|
|
106
|
-
return !r(
|
|
53
|
+
function F(i) {
|
|
54
|
+
return !r(i) || !n(i.type, 20) || !k.has(i.type) || !n(i.stroke, C) || !t(i.strokeWidth) || i.strokeWidth <= 0 || i.strokeWidth > 100 || !n(i.fill, C) ? !1 : e(i.d, w) && e(i.text, T) && (i.x === void 0 || t(i.x)) && (i.y === void 0 || t(i.y)) && (i.width === void 0 || t(i.width)) && (i.height === void 0 || t(i.height));
|
|
107
55
|
}
|
|
108
|
-
function
|
|
56
|
+
function I(e) {
|
|
109
57
|
return {
|
|
110
|
-
id: e.id.slice(0,
|
|
111
|
-
name: e.name.slice(0,
|
|
112
|
-
email: e.email.slice(0,
|
|
113
|
-
...e.avatar ? { avatar: e.avatar.slice(0,
|
|
114
|
-
...e.organizationId ? { organizationId: e.organizationId.slice(0,
|
|
58
|
+
id: e.id.slice(0, y),
|
|
59
|
+
name: e.name.slice(0, b),
|
|
60
|
+
email: e.email.slice(0, x),
|
|
61
|
+
...e.avatar ? { avatar: e.avatar.slice(0, S) } : {},
|
|
62
|
+
...e.organizationId ? { organizationId: e.organizationId.slice(0, y) } : {}
|
|
115
63
|
};
|
|
116
64
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
65
|
+
function L(e) {
|
|
66
|
+
return n(e, S) ? e : "";
|
|
119
67
|
}
|
|
120
|
-
function
|
|
68
|
+
function R(e) {
|
|
121
69
|
let t = e.toLowerCase().replace(/^\[|\]$/g, "");
|
|
122
70
|
return t === "localhost" || t === "127.0.0.1" || t === "::1";
|
|
123
71
|
}
|
|
124
|
-
function
|
|
125
|
-
return
|
|
72
|
+
function z(e) {
|
|
73
|
+
return n(e, 253) && (e === "localhost" || /^[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(e));
|
|
126
74
|
}
|
|
127
|
-
function
|
|
128
|
-
return { ...
|
|
75
|
+
function B() {
|
|
76
|
+
return { ...D };
|
|
129
77
|
}
|
|
130
|
-
function
|
|
78
|
+
function V(e) {
|
|
131
79
|
let t = String(e.projectId).trim();
|
|
132
|
-
if (!
|
|
133
|
-
let
|
|
80
|
+
if (!A(t) || !/^[\w.-]+$/.test(t)) throw Error("Invalid WebSocket projectId");
|
|
81
|
+
let r;
|
|
134
82
|
try {
|
|
135
|
-
|
|
83
|
+
r = new URL(e.authEndpoint);
|
|
136
84
|
} catch {
|
|
137
85
|
throw Error("Invalid WebSocket auth endpoint");
|
|
138
86
|
}
|
|
139
|
-
if (
|
|
140
|
-
if (!
|
|
141
|
-
if (!
|
|
142
|
-
if (!
|
|
143
|
-
if (e.userEmail && !
|
|
144
|
-
if (e.userInfo && !
|
|
87
|
+
if (r.protocol !== "https:" && !(r.protocol === "http:" && R(r.hostname))) throw Error("Invalid WebSocket auth endpoint");
|
|
88
|
+
if (!n(e.key, 256)) throw Error("Invalid WebSocket key");
|
|
89
|
+
if (!z(e.wsHost)) throw Error("Invalid WebSocket host");
|
|
90
|
+
if (!n(e.apiKey, 512)) throw Error("Invalid WebSocket API key");
|
|
91
|
+
if (e.userEmail && !a(e.userEmail)) throw Error("Invalid WebSocket user email");
|
|
92
|
+
if (e.userInfo && !j(e.userInfo)) throw Error("Invalid WebSocket user info");
|
|
145
93
|
return {
|
|
146
94
|
...e,
|
|
147
95
|
projectId: t,
|
|
148
|
-
authEndpoint:
|
|
149
|
-
userInfo: e.userInfo ?
|
|
96
|
+
authEndpoint: r.toString(),
|
|
97
|
+
userInfo: e.userInfo ? I(e.userInfo) : void 0
|
|
150
98
|
};
|
|
151
99
|
}
|
|
152
|
-
var
|
|
100
|
+
var H = class e {
|
|
153
101
|
static {
|
|
154
102
|
this.MAX_LISTENERS_PER_EVENT = 100;
|
|
155
103
|
}
|
|
156
104
|
constructor(e) {
|
|
157
|
-
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 =
|
|
105
|
+
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 = V(e);
|
|
158
106
|
}
|
|
159
107
|
on(t, n) {
|
|
160
108
|
let r = this.listeners.get(t);
|
|
@@ -178,7 +126,7 @@ var R = class e {
|
|
|
178
126
|
}
|
|
179
127
|
async openConnection() {
|
|
180
128
|
if (this.pusher || this.destroyed) return;
|
|
181
|
-
let e = await
|
|
129
|
+
let e = await v();
|
|
182
130
|
if (this.destroyed) return;
|
|
183
131
|
let t = { "X-API-Key": this.config.apiKey };
|
|
184
132
|
this.config.userEmail && (t["X-User-Email"] = this.config.userEmail), this.pusher = new e(this.config.key, {
|
|
@@ -218,13 +166,7 @@ var R = class e {
|
|
|
218
166
|
}), this.subscribeToChannel();
|
|
219
167
|
}
|
|
220
168
|
reconnect() {
|
|
221
|
-
|
|
222
|
-
if (!this.pusher) {
|
|
223
|
-
this.connect();
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
this.pusher.connect();
|
|
227
|
-
}
|
|
169
|
+
this.destroyed || (this.pusher ? this.pusher.connect() : this.connect());
|
|
228
170
|
}
|
|
229
171
|
disconnect() {
|
|
230
172
|
this.presenceChannel &&= (this.pusher?.unsubscribe(`presence-project.${this.config.projectId}`), null), this.pusher &&= (this.pusher.disconnect(), null), this.onlineUsers.clear();
|
|
@@ -240,64 +182,64 @@ var R = class e {
|
|
|
240
182
|
let e = `presence-project.${this.config.projectId}`;
|
|
241
183
|
this.presenceChannel = this.pusher.subscribe(e), this.presenceChannel.bind("pusher:subscription_succeeded", (e) => {
|
|
242
184
|
this.onlineUsers.clear(), e.each((e) => {
|
|
243
|
-
if (this.onlineUsers.size >=
|
|
185
|
+
if (this.onlineUsers.size >= E) return;
|
|
244
186
|
let t = this.memberToUser(e);
|
|
245
187
|
t && this.onlineUsers.set(t.id, t);
|
|
246
188
|
}), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
247
189
|
}), this.presenceChannel.bind("pusher:member_added", (e) => {
|
|
248
190
|
let t = this.memberToUser(e);
|
|
249
191
|
if (t) {
|
|
250
|
-
if (!this.onlineUsers.has(t.id) && this.onlineUsers.size >=
|
|
192
|
+
if (!this.onlineUsers.has(t.id) && this.onlineUsers.size >= E) return;
|
|
251
193
|
this.onlineUsers.set(t.id, t), this.emit("user:joined", t), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
252
194
|
}
|
|
253
195
|
}), this.presenceChannel.bind("pusher:member_removed", (e) => {
|
|
254
|
-
if (!
|
|
196
|
+
if (!A(e.id)) return;
|
|
255
197
|
let t = e.id;
|
|
256
198
|
this.onlineUsers.delete(t), this.emit("user:left", { userId: t }), this.emit("presence:update", { users: this.getOnlineUsers() });
|
|
257
199
|
}), this.presenceChannel.bind("pusher:subscription_error", (e) => {
|
|
258
200
|
console.error("[CommentKit WS] Channel subscription error:", e);
|
|
259
|
-
let t =
|
|
201
|
+
let t = n(e.type, 80) ? e.type : "unknown";
|
|
260
202
|
this.emit("error", /* @__PURE__ */ Error(`Channel subscription failed: ${t}`));
|
|
261
203
|
});
|
|
262
204
|
let t = (e, t) => {
|
|
263
205
|
this.presenceChannel?.bind(e, t), this.presenceChannel?.bind(`.${e}`, t);
|
|
264
206
|
};
|
|
265
207
|
t("comment_created", (e) => {
|
|
266
|
-
|
|
208
|
+
M(e) && this.emit("comment:created", e);
|
|
267
209
|
}), t("comment_updated", (e) => {
|
|
268
|
-
|
|
210
|
+
M(e) && this.emit("comment:updated", e);
|
|
269
211
|
}), t("comment_deleted", (e) => {
|
|
270
212
|
let t = e;
|
|
271
|
-
r(t) &&
|
|
213
|
+
r(t) && A(t.id) && this.emit("comment:deleted", { id: t.id });
|
|
272
214
|
}), t("comment_resolved", (e) => {
|
|
273
|
-
|
|
215
|
+
M(e) && this.emit("comment:resolved", e);
|
|
274
216
|
}), t("comment_completed", (e) => {
|
|
275
|
-
|
|
217
|
+
M(e) && this.emit("comment:completed", e);
|
|
276
218
|
}), t("reply_added", (e) => {
|
|
277
219
|
let t = e;
|
|
278
|
-
r(t) &&
|
|
220
|
+
r(t) && A(t.commentId) && N(t.reply) && this.emit("reply:added", {
|
|
279
221
|
commentId: t.commentId,
|
|
280
222
|
reply: t.reply
|
|
281
223
|
});
|
|
282
224
|
}), t("reaction_added", (e) => {
|
|
283
225
|
let t = e;
|
|
284
|
-
r(t) &&
|
|
226
|
+
r(t) && A(t.commentId) && n(t.emoji, 32) && A(t.userId) && this.emit("reaction:added", {
|
|
285
227
|
commentId: t.commentId,
|
|
286
|
-
...
|
|
228
|
+
...A(t.replyId) ? { replyId: t.replyId } : {},
|
|
287
229
|
emoji: t.emoji,
|
|
288
230
|
userId: t.userId
|
|
289
231
|
});
|
|
290
232
|
}), t("reaction_removed", (e) => {
|
|
291
233
|
let t = e;
|
|
292
|
-
r(t) &&
|
|
234
|
+
r(t) && A(t.commentId) && n(t.emoji, 32) && A(t.userId) && this.emit("reaction:removed", {
|
|
293
235
|
commentId: t.commentId,
|
|
294
|
-
...
|
|
236
|
+
...A(t.replyId) ? { replyId: t.replyId } : {},
|
|
295
237
|
emoji: t.emoji,
|
|
296
238
|
userId: t.userId
|
|
297
239
|
});
|
|
298
240
|
}), this.presenceChannel.bind("client-cursor_move", (e) => {
|
|
299
|
-
if (
|
|
300
|
-
let t = e, n =
|
|
241
|
+
if (P(e)) {
|
|
242
|
+
let t = e, n = j(t.user) ? t.user : B();
|
|
301
243
|
this.emit("cursor:move", {
|
|
302
244
|
...e,
|
|
303
245
|
user: n
|
|
@@ -305,17 +247,17 @@ var R = class e {
|
|
|
305
247
|
}
|
|
306
248
|
}), this.presenceChannel.bind("client-cursor_leave", (e) => {
|
|
307
249
|
let t = e;
|
|
308
|
-
r(t) &&
|
|
250
|
+
r(t) && A(t.userId) && this.emit("cursor:leave", { userId: t.userId });
|
|
309
251
|
}), this.presenceChannel.bind("client-drawing_stroke", (e) => {
|
|
310
252
|
let t = e;
|
|
311
|
-
r(t) &&
|
|
253
|
+
r(t) && A(t.userId) && F(t.path) && this.emit("drawing:stroke", {
|
|
312
254
|
userId: t.userId,
|
|
313
255
|
path: t.path
|
|
314
256
|
});
|
|
315
257
|
});
|
|
316
258
|
}
|
|
317
259
|
memberToUser(e) {
|
|
318
|
-
if (!
|
|
260
|
+
if (!A(e.id)) return null;
|
|
319
261
|
let t = e.info;
|
|
320
262
|
if (!t) return null;
|
|
321
263
|
let n = t.email == null || t.email === "" ? `${String(e.id)}@presence.invalid` : t.email, r = {
|
|
@@ -324,32 +266,32 @@ var R = class e {
|
|
|
324
266
|
email: n,
|
|
325
267
|
avatar: t.avatar
|
|
326
268
|
};
|
|
327
|
-
return
|
|
269
|
+
return j(r) ? I(r) : null;
|
|
328
270
|
}
|
|
329
271
|
sendCursorMove(e, t, n) {
|
|
330
272
|
if (!Number.isFinite(e) || !Number.isFinite(t)) return;
|
|
331
|
-
let r =
|
|
273
|
+
let r = L(n);
|
|
332
274
|
if (!r) return;
|
|
333
275
|
let i = Math.max(0, Math.min(100, e)), a = Math.max(0, Math.min(100, t)), o = Date.now();
|
|
334
276
|
o - this.lastCursorUpdate < this.cursorThrottle || (this.lastCursorUpdate = o, this.triggerClientEvent("client-cursor_move", {
|
|
335
277
|
x: i,
|
|
336
278
|
y: a,
|
|
337
279
|
page: r,
|
|
338
|
-
user: this.config.userInfo ||
|
|
280
|
+
user: this.config.userInfo || B()
|
|
339
281
|
}));
|
|
340
282
|
}
|
|
341
283
|
sendCursorLeave() {
|
|
342
284
|
this.triggerClientEvent("client-cursor_leave", { userId: this.config.userInfo?.id || "unknown" });
|
|
343
285
|
}
|
|
344
286
|
sendDrawingStroke(e) {
|
|
345
|
-
|
|
287
|
+
F(e) && this.triggerClientEvent("client-drawing_stroke", {
|
|
346
288
|
userId: this.config.userInfo?.id || "unknown",
|
|
347
289
|
path: e
|
|
348
290
|
});
|
|
349
291
|
}
|
|
350
292
|
requestPresence() {}
|
|
351
293
|
triggerClientEvent(e, t) {
|
|
352
|
-
if (
|
|
294
|
+
if (O.has(e) && this.presenceChannel) try {
|
|
353
295
|
this.presenceChannel.trigger(e, t);
|
|
354
296
|
} catch {}
|
|
355
297
|
}
|
|
@@ -357,4 +299,4 @@ var R = class e {
|
|
|
357
299
|
this.destroyed = !0, this.disconnect(), this.listeners.clear();
|
|
358
300
|
}
|
|
359
301
|
};
|
|
360
|
-
export {
|
|
302
|
+
export { p as n, m as r, H as t };
|