@box/threaded-annotations 1.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/LICENSE +379 -0
  2. package/README.md +57 -0
  3. package/dist/chunks/annotation-badge.js +49 -0
  4. package/dist/chunks/custom-placeholder.js +72 -0
  5. package/dist/chunks/delete-annotations-message-popover.js +46 -0
  6. package/dist/chunks/delete-confirmation-popover.js +59 -0
  7. package/dist/chunks/dist.js +1749 -0
  8. package/dist/chunks/mention-component.js +96 -0
  9. package/dist/chunks/message-editor.module.js +12 -0
  10. package/dist/chunks/message-editor2.module.js +27 -0
  11. package/dist/chunks/message-footer.js +42 -0
  12. package/dist/chunks/message-header.js +49 -0
  13. package/dist/chunks/messages-view.js +83 -0
  14. package/dist/chunks/mock-collaboration-props.js +19379 -0
  15. package/dist/chunks/resolved-state.js +55 -0
  16. package/dist/chunks/show-replies-button.js +60 -0
  17. package/dist/chunks/text-message.js +21 -0
  18. package/dist/chunks/threaded-annotations.js +71 -0
  19. package/dist/chunks/threaded-annotations2.js +68 -0
  20. package/dist/chunks/virtualized-messages.js +30 -0
  21. package/dist/esm/index.js +7 -0
  22. package/dist/esm/lib/components/mention-component/mention-component.js +2 -0
  23. package/dist/esm/lib/components/mention-component/mention-context.js +26 -0
  24. package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.js +23 -0
  25. package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/custom-mention.js +59 -0
  26. package/dist/esm/lib/components/message-editor/editor-extensions/custom-mention/useMentionState.js +24 -0
  27. package/dist/esm/lib/components/message-editor/editor-extensions/custom-paragraph.js +13 -0
  28. package/dist/esm/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder-utils.js +26 -0
  29. package/dist/esm/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder.js +2 -0
  30. package/dist/esm/lib/components/message-editor/error-message.js +17 -0
  31. package/dist/esm/lib/components/message-editor/hooks/useMessageEditor.js +68 -0
  32. package/dist/esm/lib/components/message-editor/hooks/useMessagePost.js +35 -0
  33. package/dist/esm/lib/components/message-editor/message-editor-actions.js +29 -0
  34. package/dist/esm/lib/components/message-editor/message-editor-context.js +7 -0
  35. package/dist/esm/lib/components/message-editor/message-editor.js +74 -0
  36. package/dist/esm/lib/components/message-editor/messages.js +44 -0
  37. package/dist/esm/lib/components/message-editor/utils/getMessageEditorState.js +9 -0
  38. package/dist/esm/lib/components/message-header/delete-annotations-message-popover.js +2 -0
  39. package/dist/esm/lib/components/message-header/message-header.js +2 -0
  40. package/dist/esm/lib/components/message-header/messages.js +32 -0
  41. package/dist/esm/lib/components/messages-view/consts.js +2 -0
  42. package/dist/esm/lib/components/messages-view/hooks/useAutoScroll.js +43 -0
  43. package/dist/esm/lib/components/messages-view/hooks/useShowMoreReplies.js +26 -0
  44. package/dist/esm/lib/components/messages-view/hooks/useVirtualizedMessages.js +17 -0
  45. package/dist/esm/lib/components/messages-view/messages-view.js +61 -0
  46. package/dist/esm/lib/components/messages-view/messages.js +12 -0
  47. package/dist/esm/lib/components/messages-view/virtualized-messages.js +2 -0
  48. package/dist/esm/lib/components/text-message/message-renderer.js +58 -0
  49. package/dist/esm/lib/components/text-message/text-message.js +2 -0
  50. package/dist/esm/lib/components/user-avatar/getInitials.js +5 -0
  51. package/dist/esm/lib/components/user-avatar/messages.js +12 -0
  52. package/dist/esm/lib/components/user-avatar/user-avatar.js +31 -0
  53. package/dist/esm/lib/components/v2/annotation-badge/annotation-badge.js +2 -0
  54. package/dist/esm/lib/components/v2/annotation-badge/index.js +2 -0
  55. package/dist/esm/lib/components/v2/annotation-badge/messages.js +6 -0
  56. package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.js +23 -0
  57. package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention.js +59 -0
  58. package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/mention-trigger-normalization.js +2 -0
  59. package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-mention/useMentionState.js +24 -0
  60. package/dist/esm/lib/components/v2/message-editor/editor-extensions/custom-paragraph.js +13 -0
  61. package/dist/esm/lib/components/v2/message-editor/hooks/useCharacterLimit.js +24 -0
  62. package/dist/esm/lib/components/v2/message-editor/hooks/useEditorContainerState.js +21 -0
  63. package/dist/esm/lib/components/v2/message-editor/hooks/useMentionUserSelection.js +22 -0
  64. package/dist/esm/lib/components/v2/message-editor/hooks/useMessageSubmit.js +24 -0
  65. package/dist/esm/lib/components/v2/message-editor/message-editor-context.js +19 -0
  66. package/dist/esm/lib/components/v2/message-editor/message-editor.js +159 -0
  67. package/dist/esm/lib/components/v2/message-editor/message-editor.types.js +4 -0
  68. package/dist/esm/lib/components/v2/message-editor/messages.js +44 -0
  69. package/dist/esm/lib/components/v2/message-editor/subcomponents/character-limit-counter.js +26 -0
  70. package/dist/esm/lib/components/v2/message-editor/subcomponents/edit-buttons.js +32 -0
  71. package/dist/esm/lib/components/v2/message-editor/subcomponents/error-message.js +22 -0
  72. package/dist/esm/lib/components/v2/message-editor/subcomponents/post-button.js +27 -0
  73. package/dist/esm/lib/components/v2/message-header/delete-confirmation-popover.js +2 -0
  74. package/dist/esm/lib/components/v2/message-header/message-header.js +74 -0
  75. package/dist/esm/lib/components/v2/message-header/message-options-menu.js +36 -0
  76. package/dist/esm/lib/components/v2/message-header/messages.js +44 -0
  77. package/dist/esm/lib/components/v2/messages-view/hooks/useAutoScroll.js +64 -0
  78. package/dist/esm/lib/components/v2/messages-view/messages-view.js +2 -0
  79. package/dist/esm/lib/components/v2/resolved-state/messages.js +12 -0
  80. package/dist/esm/lib/components/v2/resolved-state/resolved-state.js +2 -0
  81. package/dist/esm/lib/components/v2/show-replies-button/messages.js +12 -0
  82. package/dist/esm/lib/components/v2/show-replies-button/show-replies-button.js +2 -0
  83. package/dist/esm/lib/components/v2/text-message/messages.js +20 -0
  84. package/dist/esm/lib/components/v2/text-message/subcomponents/message-footer.js +2 -0
  85. package/dist/esm/lib/components/v2/text-message/subcomponents/message-renderer.js +60 -0
  86. package/dist/esm/lib/components/v2/text-message/text-message.js +57 -0
  87. package/dist/esm/lib/components/v2/user-avatar/getInitials.js +5 -0
  88. package/dist/esm/lib/components/v2/user-avatar/messages.js +12 -0
  89. package/dist/esm/lib/components/v2/user-avatar/user-avatar.js +35 -0
  90. package/dist/esm/lib/document-node-types.js +0 -0
  91. package/dist/esm/lib/messages.js +24 -0
  92. package/dist/esm/lib/threaded-annotations.js +2 -0
  93. package/dist/esm/lib/utils/getErrorMessage.js +2 -0
  94. package/dist/esm/lib/v2/constants.js +2 -0
  95. package/dist/esm/lib/v2/messages.js +6 -0
  96. package/dist/esm/lib/v2/test-utils/mocks/index.js +7 -0
  97. package/dist/esm/lib/v2/test-utils/mocks/mock-callbacks.js +15 -0
  98. package/dist/esm/lib/v2/test-utils/mocks/mock-collaboration-props.js +2 -0
  99. package/dist/esm/lib/v2/test-utils/mocks/mock-messages-long-strings.js +27 -0
  100. package/dist/esm/lib/v2/test-utils/mocks/mock-messages.js +198 -0
  101. package/dist/esm/lib/v2/test-utils/mocks/mock-users.js +86 -0
  102. package/dist/esm/lib/v2/test-utils/mocks/mock-utilities.js +9 -0
  103. package/dist/esm/lib/v2/threaded-annotations-context.js +49 -0
  104. package/dist/esm/lib/v2/threaded-annotations.js +3 -0
  105. package/dist/esm/lib/v2/types/annotation-badge-types.js +4 -0
  106. package/dist/esm/lib/v2/types/document-node-types.js +0 -0
  107. package/dist/esm/lib/v2/types/index.js +2 -0
  108. package/dist/esm/lib/v2/types/message-types.js +0 -0
  109. package/dist/esm/lib/v2/utils/build-mention-content.js +20 -0
  110. package/dist/esm/lib/v2/utils/serialize-mention-markup.js +12 -0
  111. package/dist/i18n/bn-IN.js +44 -0
  112. package/dist/i18n/bn-IN.properties +84 -0
  113. package/dist/i18n/da-DK.js +44 -0
  114. package/dist/i18n/da-DK.properties +84 -0
  115. package/dist/i18n/de-DE.js +44 -0
  116. package/dist/i18n/de-DE.properties +84 -0
  117. package/dist/i18n/en-AU.js +44 -0
  118. package/dist/i18n/en-AU.properties +84 -0
  119. package/dist/i18n/en-CA.js +44 -0
  120. package/dist/i18n/en-CA.properties +84 -0
  121. package/dist/i18n/en-GB.js +44 -0
  122. package/dist/i18n/en-GB.properties +84 -0
  123. package/dist/i18n/en-US.js +44 -0
  124. package/dist/i18n/en-US.properties +84 -0
  125. package/dist/i18n/en-x-pseudo.js +44 -0
  126. package/dist/i18n/en-x-pseudo.properties +84 -0
  127. package/dist/i18n/es-419.js +44 -0
  128. package/dist/i18n/es-419.properties +84 -0
  129. package/dist/i18n/es-ES.js +44 -0
  130. package/dist/i18n/es-ES.properties +84 -0
  131. package/dist/i18n/fi-FI.js +44 -0
  132. package/dist/i18n/fi-FI.properties +84 -0
  133. package/dist/i18n/fr-CA.js +44 -0
  134. package/dist/i18n/fr-CA.properties +84 -0
  135. package/dist/i18n/fr-FR.js +44 -0
  136. package/dist/i18n/fr-FR.properties +84 -0
  137. package/dist/i18n/hi-IN.js +44 -0
  138. package/dist/i18n/hi-IN.properties +84 -0
  139. package/dist/i18n/it-IT.js +44 -0
  140. package/dist/i18n/it-IT.properties +84 -0
  141. package/dist/i18n/ja-JP.js +44 -0
  142. package/dist/i18n/ja-JP.properties +84 -0
  143. package/dist/i18n/json/src/lib/components/message-editor/messages.json +1 -0
  144. package/dist/i18n/json/src/lib/components/message-header/messages.json +1 -0
  145. package/dist/i18n/json/src/lib/components/messages-view/messages.json +1 -0
  146. package/dist/i18n/json/src/lib/components/user-avatar/messages.json +1 -0
  147. package/dist/i18n/json/src/lib/components/v2/annotation-badge/messages.json +1 -0
  148. package/dist/i18n/json/src/lib/components/v2/message-editor/messages.json +1 -0
  149. package/dist/i18n/json/src/lib/components/v2/message-header/messages.json +1 -0
  150. package/dist/i18n/json/src/lib/components/v2/resolved-state/messages.json +1 -0
  151. package/dist/i18n/json/src/lib/components/v2/show-replies-button/messages.json +1 -0
  152. package/dist/i18n/json/src/lib/components/v2/text-message/messages.json +1 -0
  153. package/dist/i18n/json/src/lib/components/v2/user-avatar/messages.json +1 -0
  154. package/dist/i18n/json/src/lib/messages.json +1 -0
  155. package/dist/i18n/json/src/lib/v2/messages.json +1 -0
  156. package/dist/i18n/ko-KR.js +44 -0
  157. package/dist/i18n/ko-KR.properties +84 -0
  158. package/dist/i18n/nb-NO.js +44 -0
  159. package/dist/i18n/nb-NO.properties +84 -0
  160. package/dist/i18n/nl-NL.js +44 -0
  161. package/dist/i18n/nl-NL.properties +84 -0
  162. package/dist/i18n/pl-PL.js +44 -0
  163. package/dist/i18n/pl-PL.properties +84 -0
  164. package/dist/i18n/pt-BR.js +44 -0
  165. package/dist/i18n/pt-BR.properties +84 -0
  166. package/dist/i18n/ru-RU.js +44 -0
  167. package/dist/i18n/ru-RU.properties +84 -0
  168. package/dist/i18n/sv-SE.js +44 -0
  169. package/dist/i18n/sv-SE.properties +84 -0
  170. package/dist/i18n/tr-TR.js +44 -0
  171. package/dist/i18n/tr-TR.properties +84 -0
  172. package/dist/i18n/zh-CN.js +44 -0
  173. package/dist/i18n/zh-CN.properties +84 -0
  174. package/dist/i18n/zh-TW.js +44 -0
  175. package/dist/i18n/zh-TW.properties +84 -0
  176. package/dist/styles/annotation-badge.css +1 -0
  177. package/dist/styles/custom-placeholder.css +1 -0
  178. package/dist/styles/delete-annotations-message-popover.css +1 -0
  179. package/dist/styles/delete-confirmation-popover.css +1 -0
  180. package/dist/styles/mention-component.css +1 -0
  181. package/dist/styles/message-editor.css +1 -0
  182. package/dist/styles/message-editor2.css +1 -0
  183. package/dist/styles/message-footer.css +1 -0
  184. package/dist/styles/message-header.css +1 -0
  185. package/dist/styles/messages-view.css +1 -0
  186. package/dist/styles/resolved-state.css +1 -0
  187. package/dist/styles/show-replies-button.css +1 -0
  188. package/dist/styles/text-message.css +1 -0
  189. package/dist/styles/threaded-annotations.css +1 -0
  190. package/dist/styles/threaded-annotations2.css +1 -0
  191. package/dist/styles/virtualized-messages.css +1 -0
  192. package/dist/types/index.d.ts +9 -0
  193. package/dist/types/lib/components/mention-component/mention-component.d.ts +12 -0
  194. package/dist/types/lib/components/mention-component/mention-context.d.ts +31 -0
  195. package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.d.ts +15 -0
  196. package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/custom-mention.d.ts +1 -0
  197. package/dist/types/lib/components/message-editor/editor-extensions/custom-mention/useMentionState.d.ts +15 -0
  198. package/dist/types/lib/components/message-editor/editor-extensions/custom-paragraph.d.ts +1 -0
  199. package/dist/types/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder-utils.d.ts +38 -0
  200. package/dist/types/lib/components/message-editor/editor-extensions/custom-placeholder/custom-placeholder.d.ts +2 -0
  201. package/dist/types/lib/components/message-editor/error-message.d.ts +3 -0
  202. package/dist/types/lib/components/message-editor/hooks/useMessageEditor.d.ts +12 -0
  203. package/dist/types/lib/components/message-editor/hooks/useMessagePost.d.ts +18 -0
  204. package/dist/types/lib/components/message-editor/message-editor-actions.d.ts +9 -0
  205. package/dist/types/lib/components/message-editor/message-editor-context.d.ts +13 -0
  206. package/dist/types/lib/components/message-editor/message-editor.d.ts +36 -0
  207. package/dist/types/lib/components/message-editor/messages.d.ts +53 -0
  208. package/dist/types/lib/components/message-editor/stories/shared.d.ts +4 -0
  209. package/dist/types/lib/components/message-editor/stories/utils/mock-props.d.ts +4 -0
  210. package/dist/types/lib/components/message-editor/stories/utils/test-utils.d.ts +2 -0
  211. package/dist/types/lib/components/message-editor/utils/getMessageEditorState.d.ts +13 -0
  212. package/dist/types/lib/components/message-header/delete-annotations-message-popover.d.ts +11 -0
  213. package/dist/types/lib/components/message-header/message-header.d.ts +18 -0
  214. package/dist/types/lib/components/message-header/messages.d.ts +38 -0
  215. package/dist/types/lib/components/messages-view/consts.d.ts +4 -0
  216. package/dist/types/lib/components/messages-view/hooks/useAutoScroll.d.ts +9 -0
  217. package/dist/types/lib/components/messages-view/hooks/useShowMoreReplies.d.ts +10 -0
  218. package/dist/types/lib/components/messages-view/hooks/useVirtualizedMessages.d.ts +13 -0
  219. package/dist/types/lib/components/messages-view/messages-view.d.ts +20 -0
  220. package/dist/types/lib/components/messages-view/messages.d.ts +13 -0
  221. package/dist/types/lib/components/messages-view/virtualized-messages.d.ts +22 -0
  222. package/dist/types/lib/components/text-message/message-renderer.d.ts +6 -0
  223. package/dist/types/lib/components/text-message/stories/shared.d.ts +2 -0
  224. package/dist/types/lib/components/text-message/stories/utils/test-utils.d.ts +2 -0
  225. package/dist/types/lib/components/text-message/text-message.d.ts +17 -0
  226. package/dist/types/lib/components/text-message/types.d.ts +35 -0
  227. package/dist/types/lib/components/user-avatar/getInitials.d.ts +1 -0
  228. package/dist/types/lib/components/user-avatar/messages.d.ts +13 -0
  229. package/dist/types/lib/components/user-avatar/user-avatar.d.ts +10 -0
  230. package/dist/types/lib/components/v2/annotation-badge/annotation-badge.d.ts +7 -0
  231. package/dist/types/lib/components/v2/annotation-badge/index.d.ts +1 -0
  232. package/dist/types/lib/components/v2/annotation-badge/messages.d.ts +8 -0
  233. package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention-suggestions.d.ts +15 -0
  234. package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/custom-mention.d.ts +1 -0
  235. package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/mention-trigger-normalization.d.ts +5 -0
  236. package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-mention/useMentionState.d.ts +15 -0
  237. package/dist/types/lib/components/v2/message-editor/editor-extensions/custom-paragraph.d.ts +1 -0
  238. package/dist/types/lib/components/v2/message-editor/hooks/useCharacterLimit.d.ts +15 -0
  239. package/dist/types/lib/components/v2/message-editor/hooks/useEditorContainerState.d.ts +27 -0
  240. package/dist/types/lib/components/v2/message-editor/hooks/useMentionUserSelection.d.ts +5 -0
  241. package/dist/types/lib/components/v2/message-editor/hooks/useMessageSubmit.d.ts +13 -0
  242. package/dist/types/lib/components/v2/message-editor/message-editor-context.d.ts +12 -0
  243. package/dist/types/lib/components/v2/message-editor/message-editor.d.ts +3 -0
  244. package/dist/types/lib/components/v2/message-editor/message-editor.types.d.ts +69 -0
  245. package/dist/types/lib/components/v2/message-editor/messages.d.ts +53 -0
  246. package/dist/types/lib/components/v2/message-editor/stories/shared.d.ts +3 -0
  247. package/dist/types/lib/components/v2/message-editor/stories/utils/mock-props.d.ts +6 -0
  248. package/dist/types/lib/components/v2/message-editor/stories/utils/test-utils.d.ts +10 -0
  249. package/dist/types/lib/components/v2/message-editor/subcomponents/character-limit-counter.d.ts +7 -0
  250. package/dist/types/lib/components/v2/message-editor/subcomponents/edit-buttons.d.ts +11 -0
  251. package/dist/types/lib/components/v2/message-editor/subcomponents/error-message.d.ts +3 -0
  252. package/dist/types/lib/components/v2/message-editor/subcomponents/post-button.d.ts +11 -0
  253. package/dist/types/lib/components/v2/message-header/delete-confirmation-popover.d.ts +11 -0
  254. package/dist/types/lib/components/v2/message-header/message-header.d.ts +32 -0
  255. package/dist/types/lib/components/v2/message-header/message-options-menu.d.ts +12 -0
  256. package/dist/types/lib/components/v2/message-header/messages.d.ts +53 -0
  257. package/dist/types/lib/components/v2/message-header/stories/shared.d.ts +2 -0
  258. package/dist/types/lib/components/v2/message-header/stories/utils/test-utils.d.ts +1 -0
  259. package/dist/types/lib/components/v2/messages-view/hooks/useAutoScroll.d.ts +12 -0
  260. package/dist/types/lib/components/v2/messages-view/messages-view.d.ts +17 -0
  261. package/dist/types/lib/components/v2/messages-view/stories/shared.d.ts +7 -0
  262. package/dist/types/lib/components/v2/resolved-state/messages.d.ts +13 -0
  263. package/dist/types/lib/components/v2/resolved-state/resolved-state.d.ts +11 -0
  264. package/dist/types/lib/components/v2/resolved-state/stories/shared.d.ts +2 -0
  265. package/dist/types/lib/components/v2/show-replies-button/messages.d.ts +13 -0
  266. package/dist/types/lib/components/v2/show-replies-button/show-replies-button.d.ts +8 -0
  267. package/dist/types/lib/components/v2/text-message/messages.d.ts +23 -0
  268. package/dist/types/lib/components/v2/text-message/stories/shared.d.ts +2 -0
  269. package/dist/types/lib/components/v2/text-message/stories/utils/test-utils.d.ts +2 -0
  270. package/dist/types/lib/components/v2/text-message/subcomponents/message-footer.d.ts +10 -0
  271. package/dist/types/lib/components/v2/text-message/subcomponents/message-renderer.d.ts +6 -0
  272. package/dist/types/lib/components/v2/text-message/text-message.d.ts +26 -0
  273. package/dist/types/lib/components/v2/user-avatar/getInitials.d.ts +1 -0
  274. package/dist/types/lib/components/v2/user-avatar/messages.d.ts +13 -0
  275. package/dist/types/lib/components/v2/user-avatar/user-avatar.d.ts +12 -0
  276. package/dist/types/lib/document-node-types.d.ts +32 -0
  277. package/dist/types/lib/messages.d.ts +28 -0
  278. package/dist/types/lib/stories/mock/index.d.ts +5 -0
  279. package/dist/types/lib/stories/mock/mock-callbacks.d.ts +6 -0
  280. package/dist/types/lib/stories/mock/mock-messages-long-strings.d.ts +11 -0
  281. package/dist/types/lib/stories/mock/mock-messages.d.ts +8 -0
  282. package/dist/types/lib/stories/mock/mock-users.d.ts +56 -0
  283. package/dist/types/lib/stories/mock/mock-utilities.d.ts +6 -0
  284. package/dist/types/lib/stories/shared.d.ts +9 -0
  285. package/dist/types/lib/stories/utils/mock-collaboration-props.d.ts +13 -0
  286. package/dist/types/lib/stories/utils/mock-props.d.ts +20 -0
  287. package/dist/types/lib/stories/utils/mock-state.d.ts +8 -0
  288. package/dist/types/lib/stories/utils/shared/button-utils.d.ts +6 -0
  289. package/dist/types/lib/stories/utils/shared/index.d.ts +4 -0
  290. package/dist/types/lib/stories/utils/shared/interaction-utils.d.ts +4 -0
  291. package/dist/types/lib/stories/utils/shared/test-selectors.d.ts +7 -0
  292. package/dist/types/lib/stories/utils/shared/text-utils.d.ts +4 -0
  293. package/dist/types/lib/stories/utils/shared/verify-mention-elements.d.ts +2 -0
  294. package/dist/types/lib/stories/utils/test-utils.d.ts +3 -0
  295. package/dist/types/lib/threaded-annotations.d.ts +51 -0
  296. package/dist/types/lib/utils/getErrorMessage.d.ts +1 -0
  297. package/dist/types/lib/v2/constants.d.ts +8 -0
  298. package/dist/types/lib/v2/messages.d.ts +8 -0
  299. package/dist/types/lib/v2/stories/shared.d.ts +18 -0
  300. package/dist/types/lib/v2/test-utils/button-utils.d.ts +15 -0
  301. package/dist/types/lib/v2/test-utils/default-user-selector-props.d.ts +2 -0
  302. package/dist/types/lib/v2/test-utils/index.d.ts +7 -0
  303. package/dist/types/lib/v2/test-utils/interaction-utils.d.ts +9 -0
  304. package/dist/types/lib/v2/test-utils/mocks/index.d.ts +6 -0
  305. package/dist/types/lib/v2/test-utils/mocks/mock-callbacks.d.ts +8 -0
  306. package/dist/types/lib/v2/test-utils/mocks/mock-collaboration-props.d.ts +13 -0
  307. package/dist/types/lib/v2/test-utils/mocks/mock-messages-long-strings.d.ts +5 -0
  308. package/dist/types/lib/v2/test-utils/mocks/mock-messages.d.ts +10 -0
  309. package/dist/types/lib/v2/test-utils/mocks/mock-users.d.ts +55 -0
  310. package/dist/types/lib/v2/test-utils/mocks/mock-utilities.d.ts +6 -0
  311. package/dist/types/lib/v2/test-utils/test-selectors.d.ts +12 -0
  312. package/dist/types/lib/v2/test-utils/text-utils.d.ts +3 -0
  313. package/dist/types/lib/v2/test-utils/verify-mention-elements.d.ts +2 -0
  314. package/dist/types/lib/v2/threaded-annotations-context.d.ts +47 -0
  315. package/dist/types/lib/v2/threaded-annotations.d.ts +42 -0
  316. package/dist/types/lib/v2/types/annotation-badge-types.d.ts +23 -0
  317. package/dist/types/lib/v2/types/document-node-types.d.ts +32 -0
  318. package/dist/types/lib/v2/types/index.d.ts +3 -0
  319. package/dist/types/lib/v2/types/message-types.d.ts +33 -0
  320. package/dist/types/lib/v2/utils/build-mention-content.d.ts +3 -0
  321. package/dist/types/lib/v2/utils/serialize-mention-markup.d.ts +16 -0
  322. package/package.json +66 -0
@@ -0,0 +1,20 @@
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ annotationMessageAriaLabel: {
4
+ id: "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel",
5
+ defaultMessage: "Annotation message"
6
+ },
7
+ reply: {
8
+ id: "groupSharedFeatures.threadedAnnotations.reply",
9
+ defaultMessage: "Reply"
10
+ },
11
+ replyButtonAriaLabel: {
12
+ id: "groupSharedFeatures.threadedAnnotations.replyButtonAriaLabel",
13
+ defaultMessage: "Reply button"
14
+ },
15
+ textMessageAriaLabel: {
16
+ id: "groupSharedFeatures.threadedAnnotations.textMessageAriaLabel",
17
+ defaultMessage: "Message text"
18
+ }
19
+ });
20
+ export { t as default };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../../../../../chunks/message-footer.js";
2
+ export { e as MessageFooter };
@@ -0,0 +1,60 @@
1
+ import { t as e } from "../../../../../../chunks/mention-component.js";
2
+ import t from "../messages.js";
3
+ import { Text as n } from "@box/blueprint-web";
4
+ import { useIntl as r } from "react-intl";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ var a = ({ node: t, index: n, paragraphIndex: r }) => {
7
+ let a = `mention-${t.attrs.mentionedUserId}-${r}-${n}`;
8
+ return /* @__PURE__ */ i(e, {
9
+ authorId: t.attrs.authorId,
10
+ mentionedUserEmail: t.attrs.mentionedUserEmail,
11
+ mentionedUserId: t.attrs.mentionedUserId,
12
+ mentionedUserName: t.attrs.mentionedUserName,
13
+ mentionId: t.attrs.mentionId
14
+ }, a);
15
+ }, o = ({ node: e, index: r, paragraphIndex: a, intl: o }) => {
16
+ let s = `text-${e.text.substring(0, 20)}-${a}-${r}`;
17
+ return /* @__PURE__ */ i(n, {
18
+ "aria-label": o.formatMessage(t.textMessageAriaLabel),
19
+ as: "span",
20
+ color: "textOnLightDefault",
21
+ variant: "bodyDefault",
22
+ "data-no-expand": !0,
23
+ style: { cursor: "auto" },
24
+ children: e.text
25
+ }, s);
26
+ }, s = ({ content: e, paragraphIndex: t, intl: n }) => e.map((e, r) => {
27
+ switch (e.type) {
28
+ case "mention": return a({
29
+ node: e,
30
+ index: r,
31
+ paragraphIndex: t
32
+ });
33
+ case "text": return o({
34
+ node: e,
35
+ index: r,
36
+ paragraphIndex: t,
37
+ intl: n
38
+ });
39
+ default: return [];
40
+ }
41
+ }), c = ({ paragraph: e, index: t, intl: r }) => {
42
+ let a = e.content || [], o = `paragraph-${t}`;
43
+ return /* @__PURE__ */ i(n, {
44
+ as: "p",
45
+ variant: "bodyDefault",
46
+ children: a.length > 0 ? s({
47
+ content: a,
48
+ paragraphIndex: t,
49
+ intl: r
50
+ }) : /* @__PURE__ */ i("br", {})
51
+ }, o);
52
+ }, l = ({ messageObject: e }) => {
53
+ let t = r(), { content: n } = e;
54
+ return !n && n.length === 0 ? null : n.map((e, n) => c({
55
+ paragraph: e,
56
+ index: n,
57
+ intl: t
58
+ }));
59
+ };
60
+ export { l as MessageRenderer };
@@ -0,0 +1,57 @@
1
+ import { useThreadedAnnotationsContext as e } from "../../../v2/threaded-annotations-context.js";
2
+ import { t } from "../../../../../chunks/annotation-badge.js";
3
+ import { MessageHeader as n } from "../message-header/message-header.js";
4
+ import r from "./messages.js";
5
+ import { n as i, t as a } from "../../../../../chunks/message-footer.js";
6
+ import { MessageRenderer as o } from "./subcomponents/message-renderer.js";
7
+ import s from "clsx";
8
+ import { useIntl as c } from "react-intl";
9
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ var d = ({ id: d, author: f, message: p, createdAt: m, permissions: h, showThreadedIndicator: g = !0, isResolved: _ = !1, isFirstMessage: v = !1, onAvatarClick: y, onDelete: b, onThreadDelete: x, onEdit: S, onResolve: C, onUnresolve: w, annotationTarget: T, onAnnotationBadgeClick: E }) => {
11
+ let { canResolve: D, canEdit: O, canDelete: k } = h, A = c(), { dispatch: j, isReplyDisabled: M, isAnnotations: N } = e();
12
+ return /* @__PURE__ */ u("div", {
13
+ "aria-label": A.formatMessage(r.annotationMessageAriaLabel),
14
+ className: i.textMessage,
15
+ "data-message-wrapper": !0,
16
+ children: [/* @__PURE__ */ l(n, {
17
+ author: f,
18
+ canResolve: D,
19
+ isResolved: _,
20
+ canDelete: k,
21
+ canEdit: O,
22
+ isFirstMessage: v,
23
+ onAvatarClick: y,
24
+ onDelete: () => b(d),
25
+ onThreadDelete: x,
26
+ onEdit: S ? () => S(d) : void 0,
27
+ onResolve: C ? () => C(d) : void 0,
28
+ onUnresolve: w ? () => w(d) : void 0
29
+ }), /* @__PURE__ */ u("div", {
30
+ className: i.contentWrapper,
31
+ children: [/* @__PURE__ */ l("div", { className: s(i.threadedIndicator, !g && i.threadedIndicatorHidden) }), /* @__PURE__ */ u("div", {
32
+ className: i.messageContent,
33
+ children: [
34
+ T && !N && /* @__PURE__ */ l("div", {
35
+ className: i.annotationBadgeWrapper,
36
+ children: /* @__PURE__ */ l(t, {
37
+ annotationTarget: T,
38
+ onClick: () => E?.(d)
39
+ })
40
+ }),
41
+ /* @__PURE__ */ l("div", {
42
+ className: i.rendererWrapper,
43
+ children: /* @__PURE__ */ l(o, { messageObject: p })
44
+ }),
45
+ /* @__PURE__ */ l(a, {
46
+ createdAt: m,
47
+ onReply: M ? void 0 : () => j({
48
+ type: "REPLY",
49
+ author: f
50
+ })
51
+ })
52
+ ]
53
+ })]
54
+ })]
55
+ });
56
+ };
57
+ export { d as TextMessage };
@@ -0,0 +1,5 @@
1
+ var e = (e) => {
2
+ let t = e.replace(/[[({<]+.*[\])}>]+/g, "").trim();
3
+ return (t.slice(0, 1) + t.slice(t.lastIndexOf(" ") + 1, t.lastIndexOf(" ") + 2)).toUpperCase();
4
+ };
5
+ export { e as getInitials };
@@ -0,0 +1,12 @@
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ userAvatar: {
4
+ id: "groupSharedFeatures.threadedAnnotations.userAvatar",
5
+ defaultMessage: "User avatar"
6
+ },
7
+ userAvatarButtonAriaLabel: {
8
+ id: "groupSharedFeatures.threadedAnnotations.userAvatarButtonAriaLabel",
9
+ defaultMessage: "View user profile button"
10
+ }
11
+ });
12
+ export { t as default };
@@ -0,0 +1,35 @@
1
+ import { getInitials as e } from "./getInitials.js";
2
+ import t from "./messages.js";
3
+ import { Avatar as n, ButtonWrapper as r, IconBadge as i } from "@box/blueprint-web";
4
+ import { useIntl as a } from "react-intl";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ var s = ({ user: r, size: s = "medium" }) => {
7
+ let { name: c, isExternalUser: l, id: u, avatarUrl: d } = r, { formatMessage: f } = a(), p = e(c), m = /* @__PURE__ */ o(n, {
8
+ alt: f(t.userAvatar),
9
+ colorIndex: u,
10
+ size: s,
11
+ src: d,
12
+ text: p
13
+ });
14
+ return l ? /* @__PURE__ */ o(i, {
15
+ offset: {
16
+ right: -4,
17
+ bottom: -2
18
+ },
19
+ size: s,
20
+ variant: "collaborator-external",
21
+ children: m
22
+ }) : m;
23
+ }, c = ({ user: e, size: n, onClick: i }) => {
24
+ let { formatMessage: c } = a();
25
+ return /* @__PURE__ */ o(r, {
26
+ "aria-label": c(t.userAvatarButtonAriaLabel),
27
+ "data-no-expand": !0,
28
+ onClick: () => i(e.id),
29
+ children: /* @__PURE__ */ o(s, {
30
+ size: n,
31
+ user: e
32
+ })
33
+ });
34
+ };
35
+ export { s as UserAvatar, c as UserAvatarButton };
File without changes
@@ -0,0 +1,24 @@
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({
3
+ reply: {
4
+ id: "groupSharedFeatures.threadedAnnotations.reply",
5
+ defaultMessage: "Reply"
6
+ },
7
+ annotationMessageAriaLabel: {
8
+ id: "groupSharedFeatures.threadedAnnotations.annotationMessageAriaLabel",
9
+ defaultMessage: "Annotation message"
10
+ },
11
+ replyButtonAriaLabel: {
12
+ id: "groupSharedFeatures.threadedAnnotations.replyButtonAriaLabel",
13
+ defaultMessage: "Reply button"
14
+ },
15
+ textMentionAriaLabel: {
16
+ id: "groupSharedFeatures.threadedAnnotations.textMentionAriaLabel",
17
+ defaultMessage: "User mention"
18
+ },
19
+ textMessageAriaLabel: {
20
+ id: "groupSharedFeatures.threadedAnnotations.textMessageAriaLabel",
21
+ defaultMessage: "Message text"
22
+ }
23
+ });
24
+ export { t as default };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../chunks/threaded-annotations.js";
2
+ export { e as ThreadedAnnotations };
@@ -0,0 +1,2 @@
1
+ var e = (e) => e instanceof Error ? e.message : String(e);
2
+ export { e as getErrorMessage };
@@ -0,0 +1,2 @@
1
+ var e = { "data-threaded-annotations-portal": !0 };
2
+ export { e as THREADED_ANNOTATIONS_PORTAL };
@@ -0,0 +1,6 @@
1
+ import { defineMessages as e } from "react-intl";
2
+ var t = e({ threadedAnnotationsAriaLabel: {
3
+ id: "boxui.threadedAnnotations.threadedAnnotationsAriaLabel",
4
+ defaultMessage: "Threaded annotation"
5
+ } });
6
+ export { t as default };
@@ -0,0 +1,7 @@
1
+ import { MOCK_USERS as e, MOCK_USER_SELECTOR_USERS as t } from "./mock-users.js";
2
+ import { DEFAULT_PERMISSIONS as n, DEFAULT_ROOT_PERMISSIONS as r, MOCK_ANNOTATIONS_MESSAGE_CONTENT as i, MOCK_ANNOTATION_MESSAGES as a, MOCK_MESSAGE_CONTENT as o, MOCK_SINGLE_ANNOTATION_MESSAGE as s, createMockAnnotationMessage as c } from "./mock-messages.js";
3
+ import { createDocumentNode as l, createMockFetchAvatarUrls as u, createMockFetchUsers as d } from "./mock-utilities.js";
4
+ import { MOCK_CALLBACKS as f } from "./mock-callbacks.js";
5
+ import { t as p } from "../../../../../chunks/mock-collaboration-props.js";
6
+ import { createLongStringAnnotationMessage as m, createLongStringMessage as h, generateLongAlphabetString as g } from "./mock-messages-long-strings.js";
7
+ export { n as DEFAULT_PERMISSIONS, r as DEFAULT_ROOT_PERMISSIONS, i as MOCK_ANNOTATIONS_MESSAGE_CONTENT, a as MOCK_ANNOTATION_MESSAGES, f as MOCK_CALLBACKS, o as MOCK_MESSAGE_CONTENT, s as MOCK_SINGLE_ANNOTATION_MESSAGE, e as MOCK_USERS, t as MOCK_USER_SELECTOR_USERS, l as createDocumentNode, m as createLongStringAnnotationMessage, h as createLongStringMessage, c as createMockAnnotationMessage, p as createMockCollaborationPopoverProps, u as createMockFetchAvatarUrls, d as createMockFetchUsers, g as generateLongAlphabetString };
@@ -0,0 +1,15 @@
1
+ import { MOCK_USERS as e } from "./mock-users.js";
2
+ import { createMockAnnotationMessage as t } from "./mock-messages.js";
3
+ import { createDocumentNode as n } from "./mock-utilities.js";
4
+ import { v4 as r } from "uuid";
5
+ var i = {
6
+ onPost: async (i) => (await new Promise((e) => setTimeout(e, 1e3)), t(r(), n(i), e.TEST_USER)),
7
+ onPostWithError: async () => {
8
+ throw await new Promise((e) => setTimeout(e, 1e3)), Error("Error message from throw error");
9
+ },
10
+ onSave: async (i) => (await new Promise((e) => setTimeout(e, 1e3)), t(r(), n(i), e.TEST_USER)),
11
+ onSaveWithError: async () => {
12
+ throw await new Promise((e) => setTimeout(e, 1e3)), Error("Error message from save");
13
+ }
14
+ };
15
+ export { i as MOCK_CALLBACKS };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../../../../chunks/mock-collaboration-props.js";
2
+ export { e as createMockCollaborationPopoverProps };
@@ -0,0 +1,27 @@
1
+ import { DEFAULT_PERMISSIONS as e } from "./mock-messages.js";
2
+ var t = (e) => {
3
+ let t = "";
4
+ for (let n = 0; n < e; n += 1) t += "abcdefghijklmnopqrstuvwxyz"[n % 26];
5
+ return t;
6
+ }, n = (e) => ({
7
+ type: "doc",
8
+ content: [{
9
+ type: "paragraph",
10
+ content: [{
11
+ type: "text",
12
+ text: t(e)
13
+ }]
14
+ }]
15
+ }), r = (e, n) => ({
16
+ id: e,
17
+ name: t(n),
18
+ email: `user-${e}@example.com`,
19
+ isExternalUser: !1
20
+ }), i = (t, i, a, o) => ({
21
+ id: t,
22
+ message: n(i),
23
+ createdAt: 1752664303265,
24
+ author: r(o, a),
25
+ permissions: e
26
+ });
27
+ export { i as createLongStringAnnotationMessage, n as createLongStringMessage, t as generateLongAlphabetString };
@@ -0,0 +1,198 @@
1
+ import { MOCK_USERS as e } from "./mock-users.js";
2
+ var t = [
3
+ {
4
+ type: "doc",
5
+ content: [{
6
+ type: "paragraph",
7
+ content: [
8
+ {
9
+ type: "text",
10
+ text: "Hi "
11
+ },
12
+ {
13
+ type: "mention",
14
+ attrs: {
15
+ mentionedUserId: "12312312",
16
+ mentionedUserName: "David Thompson",
17
+ mentionedUserEmail: "david.thompson@example.com",
18
+ authorId: "1",
19
+ mentionId: "mention-1"
20
+ }
21
+ },
22
+ {
23
+ type: "text",
24
+ text: " would you like to join the meeting? "
25
+ },
26
+ {
27
+ type: "mention",
28
+ attrs: {
29
+ mentionedUserId: "2",
30
+ mentionedUserName: "Sarah Chen",
31
+ mentionedUserEmail: "sarah.chen@example.com",
32
+ authorId: "1",
33
+ mentionId: "mention-2"
34
+ }
35
+ },
36
+ {
37
+ type: "text",
38
+ text: " "
39
+ },
40
+ {
41
+ type: "mention",
42
+ attrs: {
43
+ mentionedUserId: "3",
44
+ mentionedUserName: "Alex Rodriguez",
45
+ mentionedUserEmail: "alex.rodriguez@example.com",
46
+ authorId: "1",
47
+ mentionId: "mention-3"
48
+ }
49
+ }
50
+ ]
51
+ }]
52
+ },
53
+ {
54
+ type: "doc",
55
+ content: [{
56
+ type: "paragraph",
57
+ content: [
58
+ {
59
+ type: "text",
60
+ text: "Thanks for the invitation! "
61
+ },
62
+ {
63
+ type: "mention",
64
+ attrs: {
65
+ mentionedUserId: "12312312",
66
+ mentionedUserName: "David Thompson",
67
+ mentionedUserEmail: "david.thompson@example.com",
68
+ authorId: "1",
69
+ mentionId: "mention-4"
70
+ }
71
+ },
72
+ {
73
+ type: "text",
74
+ text: " I'll be there."
75
+ }
76
+ ]
77
+ }]
78
+ },
79
+ {
80
+ type: "doc",
81
+ content: [{
82
+ type: "paragraph",
83
+ content: [{
84
+ type: "text",
85
+ text: "Great! Looking forward to collaborating with everyone on this project."
86
+ }]
87
+ }]
88
+ },
89
+ {
90
+ type: "doc",
91
+ content: [{
92
+ type: "paragraph",
93
+ content: [{
94
+ type: "mention",
95
+ attrs: {
96
+ mentionedUserId: "3",
97
+ mentionedUserName: "Alex Rodriguez",
98
+ mentionedUserEmail: "alex.rodriguez@example.com",
99
+ authorId: "4",
100
+ mentionId: "mention-5"
101
+ }
102
+ }, {
103
+ type: "text",
104
+ text: " can you share the latest design mockups? We should review them before the meeting."
105
+ }]
106
+ }]
107
+ },
108
+ {
109
+ type: "doc",
110
+ content: [{
111
+ type: "paragraph",
112
+ content: [{
113
+ type: "text",
114
+ text: "Sure! I'll upload them to the shared folder right now."
115
+ }]
116
+ }]
117
+ }
118
+ ], n = {
119
+ type: "doc",
120
+ content: [{
121
+ type: "paragraph",
122
+ content: [
123
+ {
124
+ type: "text",
125
+ text: "Hi "
126
+ },
127
+ {
128
+ type: "mention",
129
+ attrs: {
130
+ mentionedUserId: "1",
131
+ mentionedUserName: "David Thompson",
132
+ mentionedUserEmail: "david.thompson@example.com",
133
+ authorId: "1",
134
+ mentionId: "mention-6"
135
+ }
136
+ },
137
+ {
138
+ type: "text",
139
+ text: " would you like to join the meeting? "
140
+ }
141
+ ]
142
+ }, {
143
+ type: "paragraph",
144
+ content: [
145
+ {
146
+ type: "text",
147
+ text: " "
148
+ },
149
+ {
150
+ type: "mention",
151
+ attrs: {
152
+ mentionedUserId: "2",
153
+ mentionedUserName: "Sarah Chen",
154
+ mentionedUserEmail: "sarah.chen@example.com",
155
+ authorId: "1",
156
+ mentionId: "mention-7"
157
+ }
158
+ },
159
+ {
160
+ type: "text",
161
+ text: " "
162
+ },
163
+ {
164
+ type: "mention",
165
+ attrs: {
166
+ mentionedUserId: "3",
167
+ mentionedUserName: "Alex Rodriguez",
168
+ mentionedUserEmail: "alex.rodriguez@example.com",
169
+ authorId: "1",
170
+ mentionId: "mention-8"
171
+ }
172
+ }
173
+ ]
174
+ }]
175
+ }, r = {
176
+ canResolve: !1,
177
+ canEdit: !1,
178
+ canDelete: !0,
179
+ canReply: !0
180
+ }, i = {
181
+ canResolve: !0,
182
+ canEdit: !1,
183
+ canDelete: !0,
184
+ canReply: !0
185
+ }, a = (e, t, n, i = r) => ({
186
+ id: e,
187
+ message: t,
188
+ createdAt: 1752664303265,
189
+ author: n,
190
+ permissions: i
191
+ }), o = [
192
+ a("1", t[0], e.LIAM_FOSTER, i),
193
+ a("2", t[1], e.SARAH_CHEN),
194
+ a("3", t[2], e.ALEX_RODRIGUEZ),
195
+ a("4", t[3], e.EMMA_WILSON),
196
+ a("5", t[4], e.ALEX_RODRIGUEZ)
197
+ ], s = a("1", n, e.LIAM_FOSTER, i);
198
+ export { r as DEFAULT_PERMISSIONS, i as DEFAULT_ROOT_PERMISSIONS, n as MOCK_ANNOTATIONS_MESSAGE_CONTENT, o as MOCK_ANNOTATION_MESSAGES, t as MOCK_MESSAGE_CONTENT, s as MOCK_SINGLE_ANNOTATION_MESSAGE, a as createMockAnnotationMessage };
@@ -0,0 +1,86 @@
1
+ var e = {
2
+ LIAM_FOSTER: {
3
+ avatarUrl: "/img/avatar.svg",
4
+ email: "liam.foster@example.com",
5
+ id: 1,
6
+ name: "Liam Foster",
7
+ value: "Liam Foster",
8
+ isExternalUser: !1
9
+ },
10
+ SARAH_CHEN: {
11
+ email: "sarah.chen@example.com",
12
+ id: 2,
13
+ name: "Sarah Chen",
14
+ value: "Sarah Chen",
15
+ isExternalUser: !0
16
+ },
17
+ ALEX_RODRIGUEZ: {
18
+ email: "alex.rodriguez@example.com",
19
+ id: 3,
20
+ name: "Alex Rodriguez",
21
+ value: "Alex Rodriguez",
22
+ isExternalUser: !1
23
+ },
24
+ EMMA_WILSON: {
25
+ avatarUrl: "/img/avatar.svg",
26
+ email: "emma.wilson@external.com",
27
+ id: 4,
28
+ name: "Emma Wilson",
29
+ value: "Emma Wilson",
30
+ isExternalUser: !0
31
+ },
32
+ DAVID_THOMPSON: {
33
+ email: "david.thompson@example.com",
34
+ id: 12312312,
35
+ name: "David Thompson",
36
+ value: "David Thompson",
37
+ isExternalUser: !1
38
+ },
39
+ TEST_USER: {
40
+ id: 1213123,
41
+ name: "Test User",
42
+ email: "test@box.com",
43
+ isExternalUser: !1,
44
+ value: "Test User"
45
+ },
46
+ CURRENT_USER: {
47
+ email: "you@example.com",
48
+ id: 999,
49
+ name: "Test User",
50
+ value: "Test User",
51
+ isExternalUser: !1
52
+ }
53
+ }, t = [
54
+ {
55
+ email: "abc@box.com",
56
+ id: 12312312,
57
+ name: "A",
58
+ value: "A"
59
+ },
60
+ {
61
+ email: "def@box.com",
62
+ id: 2324432,
63
+ name: "B",
64
+ value: "B"
65
+ },
66
+ {
67
+ email: "test@email.com",
68
+ id: 343242323,
69
+ name: "Test User",
70
+ value: "Test User"
71
+ },
72
+ {
73
+ email: "bartholomew@box.com",
74
+ id: 41231423,
75
+ name: "Bartholomew Constantine",
76
+ value: "Bartholomew Constantine"
77
+ },
78
+ {
79
+ email: "lorem@box.com",
80
+ id: 5123123123,
81
+ name: "Lorem ipsum dolor sitamet",
82
+ value: "Lorem ipsum dolor sitamet",
83
+ isExternalUser: !0
84
+ }
85
+ ];
86
+ export { e as MOCK_USERS, t as MOCK_USER_SELECTOR_USERS };
@@ -0,0 +1,9 @@
1
+ import { MOCK_USER_SELECTOR_USERS as e } from "./mock-users.js";
2
+ var t = (e) => e ? e.type === "doc" && e.content ? e : {
3
+ type: "doc",
4
+ content: [e]
5
+ } : {
6
+ type: "doc",
7
+ content: []
8
+ }, n = (t = e) => async (e) => (await new Promise((e) => setTimeout(e, 100)), t.filter((t) => t.name.toLowerCase().includes(e.toLowerCase()) || t.email.toLowerCase().includes(e.toLowerCase())).slice(0, 5)), r = () => async () => (await new Promise((e) => setTimeout(e, 50)), {});
9
+ export { t as createDocumentNode, r as createMockFetchAvatarUrls, n as createMockFetchUsers };
@@ -0,0 +1,49 @@
1
+ import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
2
+ import { jsx as o } from "react/jsx-runtime";
3
+ var s = /* @__PURE__ */ function(e) {
4
+ return e.Collapsed = "collapsed", e.RepliesOnly = "repliesOnly", e.Composing = "composing", e;
5
+ }({}), c = /* @__PURE__ */ e(void 0), l = ({ children: e, defaultExpanded: n = !1, isReplyDisabled: l = !1, collapsed: u = !1, isAnnotations: d = !1 }) => {
6
+ let [f, p] = a(() => n ? l ? s.RepliesOnly : s.Composing : s.Collapsed), [m, h] = a(null);
7
+ r(() => {
8
+ l ? (p((e) => e === s.Composing ? s.Collapsed : e), h(null)) : p((e) => e === s.RepliesOnly ? s.Composing : e);
9
+ }, [l]), r(() => {
10
+ u && (p(s.Collapsed), h(null));
11
+ }, [u]);
12
+ let g = t((e) => {
13
+ switch (e.type) {
14
+ case "EXPAND":
15
+ p((e) => e === s.Collapsed ? l ? s.RepliesOnly : s.Composing : e);
16
+ break;
17
+ case "REPLY":
18
+ l || (h(e.author), p(s.Composing));
19
+ break;
20
+ case "COLLAPSE":
21
+ p(s.Collapsed), h(null);
22
+ break;
23
+ case "CLEAR_MENTION":
24
+ h(null);
25
+ break;
26
+ }
27
+ }, [l]), _ = i(() => ({
28
+ viewState: f,
29
+ replyMention: m,
30
+ isAnnotations: d,
31
+ isReplyDisabled: l,
32
+ dispatch: g
33
+ }), [
34
+ f,
35
+ m,
36
+ d,
37
+ l,
38
+ g
39
+ ]);
40
+ return /* @__PURE__ */ o(c.Provider, {
41
+ value: _,
42
+ children: e
43
+ });
44
+ }, u = () => {
45
+ let e = n(c);
46
+ if (e === void 0) throw Error("useThreadedAnnotationsContext must be used within ThreadedAnnotationsProvider");
47
+ return e;
48
+ };
49
+ export { s as ThreadViewState, l as ThreadedAnnotationsProvider, u as useThreadedAnnotationsContext };
@@ -0,0 +1,3 @@
1
+ import "../components/v2/message-editor/message-editor.js";
2
+ import { t as e } from "../../../chunks/threaded-annotations2.js";
3
+ export { e as ThreadedAnnotations };
@@ -0,0 +1,4 @@
1
+ var e = /* @__PURE__ */ function(e) {
2
+ return e.Drawing = "drawing", e.Frame = "frame", e.Highlight = "highlight", e.Point = "point", e.Region = "region", e;
3
+ }({});
4
+ export { e as AnnotationBadgeType };
File without changes
@@ -0,0 +1,2 @@
1
+ import { AnnotationBadgeType as e } from "./annotation-badge-types.js";
2
+ export { e as AnnotationBadgeType };
File without changes