@commentkit/comment-kit 0.6.8 → 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.
Files changed (330) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +73 -45
  3. package/dist/angular.es.js +47 -3411
  4. package/dist/comment-kit.es.js +13 -3184
  5. package/dist/demo.es.js +395 -0
  6. package/dist/headless.es.js +4 -0
  7. package/dist/preact.es.js +79 -3443
  8. package/dist/qwik.es.js +79 -3443
  9. package/dist/react.es.js +80 -28447
  10. package/dist/shared/ShadowRootContext-Bv-4aElu.js +13 -0
  11. package/dist/shared/annotation-toolbar-pX17NLmJ.js +1104 -0
  12. package/dist/shared/bridge-DRE03N9X.js +174 -0
  13. package/dist/shared/button-By0hGrJK.js +505 -0
  14. package/dist/shared/button-group-CHfMRXyA.js +93 -0
  15. package/dist/shared/clamp-CcFVX0vC.js +55 -0
  16. package/dist/shared/comment-drawing-canvas-CYu5SwRf.js +126 -0
  17. package/dist/shared/comment-image-lightbox-0VdAs2iT.js +178 -0
  18. package/dist/shared/comment-kit-core-D0kY00St.js +3083 -0
  19. package/dist/shared/comment-kit-ui-D2j2gvnm.js +16685 -0
  20. package/dist/shared/comment-screenshot-annotator-BuojwviY.js +137 -0
  21. package/dist/shared/comment-screenshot-overlay-BZX0Vcb8.js +144 -0
  22. package/dist/shared/createReactComponent-BZHeRbD0.js +45 -0
  23. package/dist/shared/dev-export-panel-BLngcr5q.js +208 -0
  24. package/dist/shared/dev-grab-pDAfH2lr.js +203 -0
  25. package/dist/{core/dom-x9svfpMk.js → shared/dom-Bhf4WFtY.js} +2 -2
  26. package/dist/shared/element-selector-CtFzgHvq.js +852 -0
  27. package/dist/shared/errors-Bu5ajEmB.js +22 -0
  28. package/dist/shared/icons-BSHCWYO1.js +267 -0
  29. package/dist/shared/local-demo-context-BohlYbHt.js +6 -0
  30. package/dist/shared/mount-ui-CVivB_eQ.js +193 -0
  31. package/dist/{angular/pusher-Vs-W-c8I.js → shared/pusher-BEl7Qn-8.js} +93 -127
  32. package/dist/{core/realtime-C3_O7gi2.js → shared/realtime-BG_t_ze7.js} +75 -72
  33. package/dist/shared/resolveAriaLabelledBy-CIKpnjNJ.js +669 -0
  34. package/dist/shared/separator-DusFNTs-.js +3915 -0
  35. package/dist/shared/shadow-root-CmYXiSRR.js +135 -0
  36. package/dist/shared/styles-D_FEJZ9G.js +2 -0
  37. package/dist/shared/useLabelableId-DGbfdMi_.js +155 -0
  38. package/dist/shared/useValueChanged-DQXLia-2.js +92 -0
  39. package/dist/{angular/limits-AEqOBweE.js → shared/validation-C7QG8j7Z.js} +2 -28
  40. package/dist/{core/websocket-manager-D1_TEuy_.js → shared/websocket-manager-BTRqNTB7.js} +90 -148
  41. package/dist/solid.es.js +63 -3427
  42. package/dist/svelte.es.js +78 -3442
  43. package/dist/types/adapters/bridge.d.ts +1 -1
  44. package/dist/types/angular/index.d.ts +2 -2
  45. package/dist/types/core/comment-kit-core.d.ts +10 -1
  46. package/dist/types/core/local-demo.d.ts +59 -0
  47. package/dist/types/demo.d.ts +17 -0
  48. package/dist/types/headless.d.ts +8 -0
  49. package/dist/types/index.d.ts +14 -16
  50. package/dist/vue.es.js +80 -3443
  51. package/package.json +55 -37
  52. package/dist/angular/chunk-Cyg4N8Ue.js +0 -11
  53. package/dist/angular/comment-kit-ui-D-LUFD6n.js +0 -24898
  54. package/dist/angular/dom-Cx1nMbdI.js +0 -104
  55. package/dist/angular/mount-ui-C9PJ5aK_.js +0 -72
  56. package/dist/angular/realtime-VrKV0lPI.js +0 -567
  57. package/dist/angular/shadow-root-yMOaW9pk.js +0 -93
  58. package/dist/angular/styles-CMz7-p8x.js +0 -2
  59. package/dist/angular/widget-theme-CYPYAwhR.js +0 -24
  60. package/dist/comment-kit.css +0 -2
  61. package/dist/core/chunk-t7YoJN_i.js +0 -11
  62. package/dist/core/comment-kit-ui-Ct4E18do.js +0 -24898
  63. package/dist/core/error-boundary-CN_BGsYl.js +0 -21
  64. package/dist/core/mount-ui-Bfnuuesk.js +0 -72
  65. package/dist/core/pusher-CizoY5NA.js +0 -2504
  66. package/dist/core/shadow-root-DAtdjHG2.js +0 -93
  67. package/dist/core/styles-ClRoB6ro.js +0 -2
  68. package/dist/core/widget-theme-BWDYr7VR.js +0 -24
  69. package/dist/preact/chunk-CZ0PdaaN.js +0 -11
  70. package/dist/preact/comment-kit-ui-DEzn7J_P.js +0 -24898
  71. package/dist/preact/dom-_ULpq7rg.js +0 -104
  72. package/dist/preact/error-boundary-B4-Bfy3g.js +0 -21
  73. package/dist/preact/limits-C3ZEKcL_.js +0 -71
  74. package/dist/preact/mount-ui-Dx8en--W.js +0 -72
  75. package/dist/preact/pusher-BP4kCufH.js +0 -2504
  76. package/dist/preact/realtime-COin_nJF.js +0 -567
  77. package/dist/preact/shadow-root-D-NcwruG.js +0 -93
  78. package/dist/preact/styles-D6i7be5-.js +0 -2
  79. package/dist/preact/widget-theme-B7Z2pbaA.js +0 -24
  80. package/dist/qwik/chunk-CKKKzG2Q.js +0 -11
  81. package/dist/qwik/comment-kit-ui-Dvwee2tw.js +0 -24898
  82. package/dist/qwik/dom-Dm3gzBBJ.js +0 -104
  83. package/dist/qwik/error-boundary-C4hlYQwS.js +0 -21
  84. package/dist/qwik/limits-DK35yjGY.js +0 -71
  85. package/dist/qwik/mount-ui-DSAwNk_d.js +0 -72
  86. package/dist/qwik/pusher-B1KgC4iB.js +0 -2504
  87. package/dist/qwik/realtime-DhfcBrwF.js +0 -567
  88. package/dist/qwik/shadow-root-PkjcnvPe.js +0 -93
  89. package/dist/qwik/styles-DmEmq5Lh.js +0 -2
  90. package/dist/qwik/widget-theme-lbPF3I0A.js +0 -24
  91. package/dist/react/chunk--MHYZ-zp.js +0 -12
  92. package/dist/react/limits-CpprSem3.js +0 -175
  93. package/dist/react/pusher-3dki8s2l.js +0 -2505
  94. package/dist/react/realtime-DGqScuox.js +0 -567
  95. package/dist/solid/chunk-B2NCWFvW.js +0 -11
  96. package/dist/solid/comment-kit-ui-ACW8BpEm.js +0 -24898
  97. package/dist/solid/dom-DqDH-Gml.js +0 -104
  98. package/dist/solid/error-boundary-9mimpbZA.js +0 -21
  99. package/dist/solid/limits-B_69IbLl.js +0 -71
  100. package/dist/solid/mount-ui-Dq1wj_tx.js +0 -72
  101. package/dist/solid/pusher-_RVNpj1f.js +0 -2504
  102. package/dist/solid/realtime-DbUJK4gU.js +0 -567
  103. package/dist/solid/shadow-root-CssU3bQb.js +0 -93
  104. package/dist/solid/styles-DbueS9xx.js +0 -2
  105. package/dist/solid/widget-theme-B4DJ14fI.js +0 -24
  106. package/dist/svelte/chunk-Pi70BKld.js +0 -11
  107. package/dist/svelte/comment-kit-ui-Cx4u1g77.js +0 -24898
  108. package/dist/svelte/dom-MyTrWzy_.js +0 -104
  109. package/dist/svelte/error-boundary-C3GWI_IX.js +0 -21
  110. package/dist/svelte/limits-CURF22v3.js +0 -71
  111. package/dist/svelte/mount-ui-CBoNGLNS.js +0 -72
  112. package/dist/svelte/pusher-DN1BiUDw.js +0 -2504
  113. package/dist/svelte/realtime-M1CJbCBA.js +0 -567
  114. package/dist/svelte/shadow-root-DG8inbf6.js +0 -93
  115. package/dist/svelte/styles-BK_MaUpD.js +0 -2
  116. package/dist/svelte/widget-theme-CkfJNysI.js +0 -24
  117. package/dist/types/adapters/errors.d.ts +0 -3
  118. package/dist/types/core/auth.d.ts +0 -18
  119. package/dist/types/core/comments.d.ts +0 -43
  120. package/dist/types/core/dev-grab.d.ts +0 -14
  121. package/dist/types/core/keyboard.d.ts +0 -12
  122. package/dist/types/core/limits.d.ts +0 -52
  123. package/dist/types/core/offline-queue.d.ts +0 -23
  124. package/dist/types/core/realtime.d.ts +0 -9
  125. package/dist/types/core/screenshot.d.ts +0 -12
  126. package/dist/types/core/session.d.ts +0 -9
  127. package/dist/types/core/source-resolver.d.ts +0 -19
  128. package/dist/types/core/state.d.ts +0 -24
  129. package/dist/types/react/comment-kit-ui.d.ts +0 -9
  130. package/dist/types/react/comments/comment-flow.d.ts +0 -8
  131. package/dist/types/react/comments/outcomes.d.ts +0 -28
  132. package/dist/types/react/comments/pin-geometry.d.ts +0 -12
  133. package/dist/types/react/comments/view-model.d.ts +0 -66
  134. package/dist/types/react/components/annotation-toolbar.d.ts +0 -36
  135. package/dist/types/react/components/build-panel-shared-props.d.ts +0 -25
  136. package/dist/types/react/components/comment-actions.d.ts +0 -19
  137. package/dist/types/react/components/comment-body.d.ts +0 -8
  138. package/dist/types/react/components/comment-branch-filter.d.ts +0 -15
  139. package/dist/types/react/components/comment-composer-actions.d.ts +0 -26
  140. package/dist/types/react/components/comment-composer-extras-fields.d.ts +0 -32
  141. package/dist/types/react/components/comment-composer-extras-toolbar.d.ts +0 -9
  142. package/dist/types/react/components/comment-composer-extras.d.ts +0 -10
  143. package/dist/types/react/components/comment-composer-extras.state.d.ts +0 -24
  144. package/dist/types/react/components/comment-composer-hook.d.ts +0 -1
  145. package/dist/types/react/components/comment-composer-media.d.ts +0 -17
  146. package/dist/types/react/components/comment-composer.d.ts +0 -4
  147. package/dist/types/react/components/comment-composer.types.d.ts +0 -41
  148. package/dist/types/react/components/comment-composer.utils.d.ts +0 -3
  149. package/dist/types/react/components/comment-connection-alert.d.ts +0 -7
  150. package/dist/types/react/components/comment-cursor-layer.d.ts +0 -14
  151. package/dist/types/react/components/comment-custom-cursor.d.ts +0 -14
  152. package/dist/types/react/components/comment-drawing-canvas.d.ts +0 -10
  153. package/dist/types/react/components/comment-emoji-picker.d.ts +0 -12
  154. package/dist/types/react/components/comment-error-banner.d.ts +0 -8
  155. package/dist/types/react/components/comment-extension-banner.d.ts +0 -8
  156. package/dist/types/react/components/comment-fab-tools.d.ts +0 -37
  157. package/dist/types/react/components/comment-fab.d.ts +0 -34
  158. package/dist/types/react/components/comment-filter-assignee.d.ts +0 -9
  159. package/dist/types/react/components/comment-filter-bar.d.ts +0 -27
  160. package/dist/types/react/components/comment-filter-popover.d.ts +0 -20
  161. package/dist/types/react/components/comment-format-toolbar.constants.d.ts +0 -34
  162. package/dist/types/react/components/comment-format-toolbar.d.ts +0 -6
  163. package/dist/types/react/components/comment-header.d.ts +0 -34
  164. package/dist/types/react/components/comment-highlight-layer.d.ts +0 -11
  165. package/dist/types/react/components/comment-highlight-marker.d.ts +0 -9
  166. package/dist/types/react/components/comment-image-lightbox.d.ts +0 -10
  167. package/dist/types/react/components/comment-images.d.ts +0 -7
  168. package/dist/types/react/components/comment-item.d.ts +0 -26
  169. package/dist/types/react/components/comment-keyboard-shortcuts.d.ts +0 -7
  170. package/dist/types/react/components/comment-kit-overlays.d.ts +0 -15
  171. package/dist/types/react/components/comment-kit.d.ts +0 -12
  172. package/dist/types/react/components/comment-list-filters.d.ts +0 -14
  173. package/dist/types/react/components/comment-login-modal.d.ts +0 -20
  174. package/dist/types/react/components/comment-marker-layer-composer.d.ts +0 -21
  175. package/dist/types/react/components/comment-marker-layer.d.ts +0 -27
  176. package/dist/types/react/components/comment-marker-popover.d.ts +0 -12
  177. package/dist/types/react/components/comment-marker.d.ts +0 -15
  178. package/dist/types/react/components/comment-member-list.d.ts +0 -10
  179. package/dist/types/react/components/comment-mode-bar.d.ts +0 -15
  180. package/dist/types/react/components/comment-online-users.d.ts +0 -8
  181. package/dist/types/react/components/comment-page-ref.d.ts +0 -9
  182. package/dist/types/react/components/comment-panel-header.d.ts +0 -22
  183. package/dist/types/react/components/comment-panel-mobile.d.ts +0 -9
  184. package/dist/types/react/components/comment-panel-utils.d.ts +0 -6
  185. package/dist/types/react/components/comment-panel-view-body.d.ts +0 -23
  186. package/dist/types/react/components/comment-panel.d.ts +0 -37
  187. package/dist/types/react/components/comment-quoted-text.d.ts +0 -9
  188. package/dist/types/react/components/comment-reactions.d.ts +0 -11
  189. package/dist/types/react/components/comment-remote-cursor.d.ts +0 -11
  190. package/dist/types/react/components/comment-screenshot-annotator.d.ts +0 -11
  191. package/dist/types/react/components/comment-screenshot-overlay.d.ts +0 -10
  192. package/dist/types/react/components/comment-search-bar.d.ts +0 -7
  193. package/dist/types/react/components/comment-settings-view.d.ts +0 -20
  194. package/dist/types/react/components/comment-skeletons.d.ts +0 -9
  195. package/dist/types/react/components/comment-thread-detail-badges.d.ts +0 -16
  196. package/dist/types/react/components/comment-thread-detail-meta.d.ts +0 -9
  197. package/dist/types/react/components/comment-thread-detail-replies.d.ts +0 -13
  198. package/dist/types/react/components/comment-thread-detail.d.ts +0 -13
  199. package/dist/types/react/components/comment-thread-footer.d.ts +0 -12
  200. package/dist/types/react/components/comment-thread-list-item.d.ts +0 -15
  201. package/dist/types/react/components/comment-thread-list.d.ts +0 -16
  202. package/dist/types/react/components/comment-user-avatar-tooltip.d.ts +0 -12
  203. package/dist/types/react/components/comment-users-context.d.ts +0 -15
  204. package/dist/types/react/components/comment-utils.d.ts +0 -20
  205. package/dist/types/react/components/comment.d.ts +0 -26
  206. package/dist/types/react/components/constants.d.ts +0 -50
  207. package/dist/types/react/components/dev-export-panel.d.ts +0 -10
  208. package/dist/types/react/components/drawing-path-renderer.d.ts +0 -10
  209. package/dist/types/react/components/element-selector.d.ts +0 -11
  210. package/dist/types/react/components/live-region.d.ts +0 -16
  211. package/dist/types/react/components/screenshot-capture.d.ts +0 -17
  212. package/dist/types/react/components/status-indicator.d.ts +0 -43
  213. package/dist/types/react/components/ui.d.ts +0 -44
  214. package/dist/types/react/components/use-comment-composer.d.ts +0 -28
  215. package/dist/types/react/error-boundary.d.ts +0 -25
  216. package/dist/types/react/hooks/use-comment-fab-drag.d.ts +0 -21
  217. package/dist/types/react/hooks/use-comment-hash-link.d.ts +0 -20
  218. package/dist/types/react/hooks/use-comment-kit-filters.d.ts +0 -19
  219. package/dist/types/react/hooks/use-comment-kit-keyboard.d.ts +0 -11
  220. package/dist/types/react/hooks/use-comment-kit-prop-sync.d.ts +0 -12
  221. package/dist/types/react/hooks/use-comment-marker-drag.d.ts +0 -23
  222. package/dist/types/react/hooks/use-comment-panel-navigation.d.ts +0 -21
  223. package/dist/types/react/hooks/use-comment-realtime.d.ts +0 -6
  224. package/dist/types/react/hooks/use-comment-thread-actions.d.ts +0 -15
  225. package/dist/types/react/hooks/use-connection-retry.d.ts +0 -9
  226. package/dist/types/react/hooks/use-drawing.d.ts +0 -32
  227. package/dist/types/react/hooks/use-extension-conflicts.d.ts +0 -13
  228. package/dist/types/react/hooks/use-filtered-threads.d.ts +0 -7
  229. package/dist/types/react/hooks/use-marker-layer.d.ts +0 -19
  230. package/dist/types/react/hooks/use-screenshot.d.ts +0 -18
  231. package/dist/types/react/hooks/use-text-selection.d.ts +0 -17
  232. package/dist/types/react/hooks/use-websocket.d.ts +0 -9
  233. package/dist/types/react/is-local-host.d.ts +0 -2
  234. package/dist/types/react/mount-ui.d.ts +0 -19
  235. package/dist/types/react/shadow-root.d.ts +0 -23
  236. package/dist/types/react/shims/use-sync-external-store-with-selector.d.ts +0 -4
  237. package/dist/types/react/shims/use-sync-external-store.d.ts +0 -1
  238. package/dist/types/react/ui/lib/ShadowRootContext.d.ts +0 -10
  239. package/dist/types/react/ui/lib/cn.d.ts +0 -12
  240. package/dist/types/react/ui/lib/widget-theme.d.ts +0 -7
  241. package/dist/types/react/ui/primitives/alert/alert.d.ts +0 -8
  242. package/dist/types/react/ui/primitives/alert/index.d.ts +0 -1
  243. package/dist/types/react/ui/primitives/alert-dialog/alert-dialog.d.ts +0 -23
  244. package/dist/types/react/ui/primitives/alert-dialog/index.d.ts +0 -1
  245. package/dist/types/react/ui/primitives/avatar/avatar.d.ts +0 -10
  246. package/dist/types/react/ui/primitives/avatar/index.d.ts +0 -1
  247. package/dist/types/react/ui/primitives/badge/badge.d.ts +0 -5
  248. package/dist/types/react/ui/primitives/badge/index.d.ts +0 -1
  249. package/dist/types/react/ui/primitives/breadcrumb/breadcrumb.d.ts +0 -10
  250. package/dist/types/react/ui/primitives/breadcrumb/index.d.ts +0 -1
  251. package/dist/types/react/ui/primitives/button/button.d.ts +0 -6
  252. package/dist/types/react/ui/primitives/button/index.d.ts +0 -1
  253. package/dist/types/react/ui/primitives/button-group/button-group.d.ts +0 -9
  254. package/dist/types/react/ui/primitives/button-group/index.d.ts +0 -1
  255. package/dist/types/react/ui/primitives/card/card.d.ts +0 -11
  256. package/dist/types/react/ui/primitives/card/index.d.ts +0 -1
  257. package/dist/types/react/ui/primitives/checkbox/checkbox.d.ts +0 -3
  258. package/dist/types/react/ui/primitives/checkbox/index.d.ts +0 -1
  259. package/dist/types/react/ui/primitives/dialog/dialog.d.ts +0 -17
  260. package/dist/types/react/ui/primitives/dialog/index.d.ts +0 -1
  261. package/dist/types/react/ui/primitives/dropdown-menu/dropdown-menu.d.ts +0 -29
  262. package/dist/types/react/ui/primitives/dropdown-menu/index.d.ts +0 -1
  263. package/dist/types/react/ui/primitives/empty/empty.d.ts +0 -10
  264. package/dist/types/react/ui/primitives/empty/index.d.ts +0 -1
  265. package/dist/types/react/ui/primitives/field/field.d.ts +0 -22
  266. package/dist/types/react/ui/primitives/field/index.d.ts +0 -1
  267. package/dist/types/react/ui/primitives/hover-card/hover-card.d.ts +0 -6
  268. package/dist/types/react/ui/primitives/hover-card/index.d.ts +0 -1
  269. package/dist/types/react/ui/primitives/input/index.d.ts +0 -1
  270. package/dist/types/react/ui/primitives/input/input.d.ts +0 -3
  271. package/dist/types/react/ui/primitives/input-group/index.d.ts +0 -1
  272. package/dist/types/react/ui/primitives/input-group/input-group.d.ts +0 -16
  273. package/dist/types/react/ui/primitives/input-otp/index.d.ts +0 -1
  274. package/dist/types/react/ui/primitives/input-otp/input-otp.d.ts +0 -11
  275. package/dist/types/react/ui/primitives/kbd/index.d.ts +0 -1
  276. package/dist/types/react/ui/primitives/kbd/kbd.d.ts +0 -4
  277. package/dist/types/react/ui/primitives/label/index.d.ts +0 -1
  278. package/dist/types/react/ui/primitives/label/label.d.ts +0 -3
  279. package/dist/types/react/ui/primitives/native-select/index.d.ts +0 -1
  280. package/dist/types/react/ui/primitives/native-select/native-select.d.ts +0 -7
  281. package/dist/types/react/ui/primitives/popover/index.d.ts +0 -1
  282. package/dist/types/react/ui/primitives/popover/popover.d.ts +0 -9
  283. package/dist/types/react/ui/primitives/preview/component-preview.d.ts +0 -8
  284. package/dist/types/react/ui/primitives/progress/index.d.ts +0 -1
  285. package/dist/types/react/ui/primitives/progress/progress.d.ts +0 -7
  286. package/dist/types/react/ui/primitives/radio-group/index.d.ts +0 -1
  287. package/dist/types/react/ui/primitives/radio-group/radio-group.d.ts +0 -6
  288. package/dist/types/react/ui/primitives/scroll-area/index.d.ts +0 -1
  289. package/dist/types/react/ui/primitives/scroll-area/scroll-area.d.ts +0 -6
  290. package/dist/types/react/ui/primitives/select/index.d.ts +0 -1
  291. package/dist/types/react/ui/primitives/select/select.d.ts +0 -15
  292. package/dist/types/react/ui/primitives/separator/index.d.ts +0 -1
  293. package/dist/types/react/ui/primitives/separator/separator.d.ts +0 -3
  294. package/dist/types/react/ui/primitives/sheet/index.d.ts +0 -1
  295. package/dist/types/react/ui/primitives/sheet/sheet.d.ts +0 -14
  296. package/dist/types/react/ui/primitives/skeleton/index.d.ts +0 -1
  297. package/dist/types/react/ui/primitives/skeleton/skeleton.d.ts +0 -3
  298. package/dist/types/react/ui/primitives/slider/index.d.ts +0 -1
  299. package/dist/types/react/ui/primitives/slider/slider.d.ts +0 -7
  300. package/dist/types/react/ui/primitives/sonner/index.d.ts +0 -1
  301. package/dist/types/react/ui/primitives/sonner/sonner.d.ts +0 -4
  302. package/dist/types/react/ui/primitives/spinner/index.d.ts +0 -1
  303. package/dist/types/react/ui/primitives/spinner/spinner.d.ts +0 -3
  304. package/dist/types/react/ui/primitives/switch/index.d.ts +0 -1
  305. package/dist/types/react/ui/primitives/switch/switch.d.ts +0 -5
  306. package/dist/types/react/ui/primitives/tabs/index.d.ts +0 -1
  307. package/dist/types/react/ui/primitives/tabs/tabs.d.ts +0 -8
  308. package/dist/types/react/ui/primitives/textarea/index.d.ts +0 -1
  309. package/dist/types/react/ui/primitives/textarea/textarea.d.ts +0 -3
  310. package/dist/types/react/ui/primitives/toggle/index.d.ts +0 -1
  311. package/dist/types/react/ui/primitives/toggle/toggle.d.ts +0 -7
  312. package/dist/types/react/ui/primitives/toggle-group/index.d.ts +0 -1
  313. package/dist/types/react/ui/primitives/toggle-group/toggle-group.d.ts +0 -14
  314. package/dist/types/react/ui/primitives/tooltip/index.d.ts +0 -1
  315. package/dist/types/react/ui/primitives/tooltip/tooltip.d.ts +0 -7
  316. package/dist/types/utils/freeze-animations.d.ts +0 -8
  317. package/dist/types/utils/text.d.ts +0 -9
  318. package/dist/types/utils/validation.d.ts +0 -10
  319. package/dist/vue/chunk-DHrubWSL.js +0 -11
  320. package/dist/vue/comment-kit-ui-C3zijClM.js +0 -24898
  321. package/dist/vue/dom-C7krZAR8.js +0 -104
  322. package/dist/vue/error-boundary-DW6uGR8U.js +0 -21
  323. package/dist/vue/limits-B6csdQeI.js +0 -71
  324. package/dist/vue/mount-ui-18BnLwCO.js +0 -72
  325. package/dist/vue/pusher-cmjNbW6a.js +0 -2504
  326. package/dist/vue/realtime-B0B5cE-E.js +0 -567
  327. package/dist/vue/shadow-root-zwd_wUIP.js +0 -93
  328. package/dist/vue/styles-B0NAkbKu.js +0 -2
  329. package/dist/vue/widget-theme-D7Vkagk7.js +0 -24
  330. /package/dist/{angular/error-boundary-CxhCm8iF.js → shared/error-boundary-D3PD74vI.js} +0 -0
@@ -1,567 +0,0 @@
1
- "use client";
2
- import { n as e } from "./chunk--MHYZ-zp.js";
3
- import { _ as t, a as n, d as r, f as i, g as a, h as o, m as s, p as c, t as l } from "./limits-CpprSem3.js";
4
- var u = null;
5
- function d() {
6
- return u ||= import("./pusher-3dki8s2l.js").then((t) => /* @__PURE__ */ e(t.default, 1)).then((e) => e.default ?? e), u;
7
- }
8
- var f = l.ID, p = l.NAME, m = l.EMAIL, h = l.PAGE, g = l.COLOR, ee = l.DRAWING_PATH_DATA, te = l.DRAWING_TEXT, _ = l.ONLINE_USERS, v = {
9
- id: "unknown",
10
- name: "Unknown",
11
- email: "unknown@example.invalid"
12
- }, y = new Set([
13
- "client-cursor_move",
14
- "client-cursor_leave",
15
- "client-drawing_stroke"
16
- ]), ne = new Set([
17
- "path",
18
- "line",
19
- "rectangle",
20
- "circle",
21
- "text"
22
- ]);
23
- function b(e) {
24
- return a(e, f);
25
- }
26
- function x(e) {
27
- return c(e) ? b(e.id) && a(e.name, p) && t(e.email) && o(e.avatar, h) : !1;
28
- }
29
- function S(e) {
30
- return c(e) ? b(e.id) && s(e.content, l.CONTENT) && b(e.userId) && c(e.position) && r(e.position.x) && r(e.position.y) && x(e.author) : !1;
31
- }
32
- function C(e) {
33
- return c(e) ? b(e.id) && s(e.content, l.CONTENT) && x(e.author) : !1;
34
- }
35
- function re(e) {
36
- return c(e) ? r(e.x) && e.x >= 0 && e.x <= 100 && r(e.y) && e.y >= 0 && e.y <= 100 && a(e.page, h) : !1;
37
- }
38
- function w(e) {
39
- return !c(e) || !a(e.type, 20) || !ne.has(e.type) || !a(e.stroke, g) || !r(e.strokeWidth) || e.strokeWidth <= 0 || e.strokeWidth > 100 || !a(e.fill, g) ? !1 : o(e.d, ee) && o(e.text, te) && (e.x === void 0 || r(e.x)) && (e.y === void 0 || r(e.y)) && (e.width === void 0 || r(e.width)) && (e.height === void 0 || r(e.height));
40
- }
41
- function T(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 ie(e) {
51
- return a(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 a(e, 253) && (e === "localhost" || /^[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?$/.test(e));
59
- }
60
- function O() {
61
- return { ...v };
62
- }
63
- function k(e) {
64
- let n = String(e.projectId).trim();
65
- if (!b(n) || !/^[\w.-]+$/.test(n)) throw Error("Invalid WebSocket projectId");
66
- let r;
67
- try {
68
- r = new URL(e.authEndpoint);
69
- } catch {
70
- throw Error("Invalid WebSocket auth endpoint");
71
- }
72
- if (r.protocol !== "https:" && !(r.protocol === "http:" && E(r.hostname))) throw Error("Invalid WebSocket auth endpoint");
73
- if (!a(e.key, 256)) throw Error("Invalid WebSocket key");
74
- if (!D(e.wsHost)) throw Error("Invalid WebSocket host");
75
- if (!a(e.apiKey, 512)) throw Error("Invalid WebSocket API key");
76
- if (e.userEmail && !t(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: n,
81
- authEndpoint: r.toString(),
82
- userInfo: e.userInfo ? T(e.userInfo) : void 0
83
- };
84
- }
85
- var A = 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 = k(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 = a(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
- c(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
- c(t) && b(t.commentId) && C(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
- c(t) && b(t.commentId) && a(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
- c(t) && b(t.commentId) && a(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 (re(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
- c(t) && b(t.userId) && this.emit("cursor:leave", { userId: t.userId });
242
- }), this.presenceChannel.bind("client-drawing_stroke", (e) => {
243
- let t = e;
244
- c(t) && b(t.userId) && w(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) ? T(r) : null;
261
- }
262
- sendCursorMove(e, t, n) {
263
- if (!Number.isFinite(e) || !Number.isFinite(t)) return;
264
- let r = ie(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
- w(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 (y.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
- }, j = l.ID, M = l.CONTENT, ae = l.NAME, oe = l.EMAIL, N = l.PAGE, se = l.EMOJI, P = l.ONLINE_USERS, F = l.REACTION_COUNT, I = 33, L = 1e3, R = l.CURSOR_EMITS_PER_SEC;
293
- function z(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), P) : l.RENDERED_CURSORS
299
- };
300
- }
301
- var B = new Set([
302
- "pin",
303
- "highlight",
304
- "drawing"
305
- ]), V = new Set([
306
- "open",
307
- "resolved",
308
- "complete"
309
- ]), H = new Set([
310
- "low",
311
- "medium",
312
- "high",
313
- "urgent"
314
- ]), U = new Set([
315
- "path",
316
- "line",
317
- "rectangle",
318
- "circle",
319
- "text"
320
- ]);
321
- function W(e, t) {
322
- return s(e, t);
323
- }
324
- function G(e) {
325
- return W(e, j);
326
- }
327
- function ce(e) {
328
- if (!W(e, oe)) 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 K(e) {
333
- return c(e) && G(e.id) && W(e.name, ae) && ce(e.email) && o(e.avatar, N) && o(e.organizationId, j);
334
- }
335
- function q(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 le(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 >= P) break;
349
- if (!K(r)) continue;
350
- let e = q(r);
351
- n.has(e.id) || (n.add(e.id), t.push(e));
352
- }
353
- return t;
354
- }
355
- function ue(e) {
356
- return c(e) ? i(e.x) && i(e.y) : !1;
357
- }
358
- function de(e) {
359
- return c(e) && W(e.url, N) && W(e.path, N) && W(e.title, N);
360
- }
361
- function fe(e) {
362
- return c(e) && X(e.emoji) && Number.isInteger(e.count) && e.count >= 0 && e.count <= F && 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(fe) }
369
- };
370
- }
371
- function J(e) {
372
- return !c(e) || !G(e.id) || !B.has(e.type) || !W(e.content, M) || !ue(e.position) || !V.has(e.status) || !H.has(e.priority) || !K(e.author) || !G(e.userId) || !W(e.createdAt, N) || !W(e.updatedAt, N) || !de(e.page) || !Array.isArray(e.replies) || !Array.isArray(e.attachments) ? null : pe(structuredClone(e));
373
- }
374
- function Y(e) {
375
- return !c(e) || !G(e.id) || !W(e.content, M) || !K(e.author) || !W(e.createdAt, N) ? null : structuredClone(e);
376
- }
377
- function me(e) {
378
- return !c(e) || !K(e.user) || !r(e.x) || e.x < 0 || e.x > 100 || !r(e.y) || e.y < 0 || e.y > 100 || !W(e.page, N) ? null : {
379
- x: e.x,
380
- y: e.y,
381
- page: e.page.trim(),
382
- user: q(e.user)
383
- };
384
- }
385
- function he(e) {
386
- return c(e) ? W(e.type, l.DRAWING_TYPE) && U.has(e.type) && W(e.stroke, l.COLOR) && r(e.strokeWidth) && e.strokeWidth >= 0 && W(e.fill, l.COLOR) && o(e.d, l.DRAWING_PATH_DATA) && o(e.text, l.DRAWING_TEXT) && (e.x === void 0 || r(e.x)) && (e.y === void 0 || r(e.y)) && (e.width === void 0 || r(e.width)) && (e.height === void 0 || r(e.height)) : !1;
387
- }
388
- function X(e) {
389
- return W(e, se);
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 r = e.config.baseUrl || "https://api.commentkit.dev/api", i = e.getState().currentUser, a = z(e);
413
- try {
414
- t.wsManager = new A({
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: `${r}/broadcasting/auth`,
423
- userEmail: i?.email,
424
- userInfo: i ? {
425
- id: i.id,
426
- name: i.name,
427
- email: i.email
428
- } : void 0
429
- });
430
- } catch (t) {
431
- e.setState({ connectionStatus: "error" }), e.handleError(t);
432
- return;
433
- }
434
- let o = t.wsUnsubscribers, s = t.wsManager;
435
- o.push(s.on("connected", () => {
436
- Z(t, s) && (e.setState({ connectionStatus: "connected" }), t.wsManager?.requestPresence());
437
- })), o.push(s.on("disconnected", () => {
438
- Z(t, s) && e.setState({ connectionStatus: "disconnected" });
439
- })), o.push(s.on("reconnecting", () => {
440
- Z(t, s) && e.setState({ connectionStatus: "connecting" });
441
- })), o.push(s.on("error", () => {
442
- Z(t, s) && e.setState({ connectionStatus: "error" });
443
- })), o.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
- })), o.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
- })), o.push(s.on("comment:created", (r) => {
452
- if (!Z(t, s)) return;
453
- let i = J(r);
454
- i && i.page.path === n().path && (e.getState().comments.find((e) => e.id === i.id) || (e.setState({ comments: [...e.getState().comments, i] }), e.emit("comment:created", i)));
455
- })), o.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
- })), o.push(s.on("comment:deleted", (n) => {
460
- if (!Z(t, s) || !c(n) || !G(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
- })), o.push(s.on("reply:added", (n) => {
467
- if (!Z(t, s) || !c(n) || !G(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 o = a.find((e) => e.id === i);
476
- o && e.emit("comment:updated", o);
477
- }));
478
- let l = (e, t, n) => {
479
- let r = (e ?? []).filter((e) => X(e.emoji) && Number.isInteger(e.count) && e.count >= 0 && e.count <= F), 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, F),
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 <= F).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) || !c(n) || !G(n.commentId) || !X(n.emoji) || !G(n.userId)) return;
502
- let i = n.commentId.trim(), a = G(n.replyId) ? n.replyId.trim() : null, o = 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, o, l)
506
- } : {
507
- ...e,
508
- replies: e.replies.map((e) => e.id === a ? {
509
- ...e,
510
- reactions: r(e.reactions, o, l)
511
- } : e)
512
- } : e) });
513
- };
514
- o.push(s.on("reaction:added", (e) => d(e, l))), o.push(s.on("reaction:removed", (e) => d(e, u)));
515
- let f = /* @__PURE__ */ new Map(), p = 0, m = 0;
516
- o.push(s.on("cursor:move", (n) => {
517
- if (!Z(t, s) || !a.cursors) return;
518
- let r = me(n);
519
- if (!r) return;
520
- let i = Date.now(), o = r.user.id, c = f.get(o);
521
- if (c === void 0 && f.size >= a.maxRenderedCursors) {
522
- let e, t = Infinity;
523
- for (let [n, r] of f) r < t && (t = r, e = n);
524
- if (e !== void 0 && i - t >= I) f.delete(e);
525
- else return;
526
- }
527
- c !== void 0 && i - c < I || (i - p >= L && (p = i, m = 0), !(m >= R) && (m++, f.set(o, i), e.emit("cursor:move", r)));
528
- })), o.push(s.on("cursor:leave", (n) => {
529
- !Z(t, s) || !c(n) || !G(n.userId) || (f.delete(n.userId.trim()), e.emit("cursor:leave", { userId: n.userId.trim() }));
530
- })), o.push(s.on("user:joined", (n) => {
531
- !Z(t, s) || !K(n) || e.emit("user:joined", q(n));
532
- })), o.push(s.on("user:left", (n) => {
533
- !Z(t, s) || !c(n) || !G(n.userId) || e.emit("user:left", { userId: n.userId.trim() });
534
- })), o.push(s.on("presence:update", (n) => {
535
- if (!Z(t, s) || !a.presence || !c(n)) return;
536
- let r = le(n.users);
537
- if (!r) return;
538
- let i = { users: r };
539
- e.setState({ onlineUsers: r }), e.emit("presence:update", i);
540
- })), o.push(s.on("drawing:stroke", (n) => {
541
- !Z(t, s) || !c(n) || !G(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" || a.cursors && (t.mouseMoveHandler = (r) => {
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, r.clientX / window.innerWidth * 100)), i = Math.max(0, Math.min(100, r.clientY / window.innerHeight * 100));
560
- t.wsManager.sendCursorMove(e, i, n().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,11 +0,0 @@
1
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
2
- if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
3
- get: ((e) => i[e]).bind(null, d),
4
- enumerable: !(s = n(i, d)) || s.enumerable
5
- });
6
- return e;
7
- }, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
8
- value: n,
9
- enumerable: !0
10
- }) : a, n));
11
- export { c as n, o as t };