@bikdotai/bik-component-library 0.0.804-beta.9 → 0.0.805-beta.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 (357) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  2. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  3. package/dist/cjs/components/avatar/Avatar.js +1 -1
  4. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  5. package/dist/cjs/components/avatar/Avatar.styled.js +3 -3
  6. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  7. package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
  8. package/dist/cjs/components/avatar/AvatarHelper.js.map +1 -1
  9. package/dist/cjs/components/bik-layout/BikSidebar.js.map +1 -1
  10. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js +2 -0
  11. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  12. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +2 -0
  13. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  14. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +294 -0
  15. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  16. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +2 -0
  17. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  18. package/dist/cjs/components/button/Button.js +1 -1
  19. package/dist/cjs/components/button/Button.js.map +1 -1
  20. package/dist/cjs/components/button/Button.styled.js +1 -1
  21. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  22. package/dist/cjs/components/button/themes.js +1 -1
  23. package/dist/cjs/components/button/themes.js.map +1 -1
  24. package/dist/cjs/components/country-code-picker/CountryCodePicker.js.map +1 -1
  25. package/dist/cjs/components/country-code-picker/CountryPicker.js.map +1 -1
  26. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  27. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  28. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  29. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  30. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  31. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  32. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +6 -5
  33. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  34. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  35. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  36. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  37. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +7 -7
  38. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  39. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  40. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  41. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +8 -4
  42. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  43. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  44. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  45. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  46. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  47. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  48. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  49. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  50. package/dist/cjs/components/dropdown-button/DropdownButton.style.js +10 -6
  51. package/dist/cjs/components/dropdown-button/DropdownButton.style.js.map +1 -1
  52. package/dist/cjs/components/dual-icon-button/DualIconButton.js +2 -0
  53. package/dist/cjs/components/dual-icon-button/DualIconButton.js.map +1 -0
  54. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +26 -0
  55. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  56. package/dist/cjs/components/fab-menu/FABMenu.js.map +1 -1
  57. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  58. package/dist/cjs/components/icon-button/IconButton.js.map +1 -1
  59. package/dist/cjs/components/icon-button/IconButton.styled.js +3 -3
  60. package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
  61. package/dist/cjs/components/icon-button/theme.js +1 -1
  62. package/dist/cjs/components/icon-button/theme.js.map +1 -1
  63. package/dist/cjs/components/input/Input.js +1 -1
  64. package/dist/cjs/components/input/Input.js.map +1 -1
  65. package/dist/cjs/components/input/Input.styled.js +1 -1
  66. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  67. package/dist/cjs/components/list-item/ListItem.js +1 -1
  68. package/dist/cjs/components/list-item/ListItem.js.map +1 -1
  69. package/dist/cjs/components/list-item/ListItem.styled.js +1 -1
  70. package/dist/cjs/components/list-item/ListItem.styled.js.map +1 -1
  71. package/dist/cjs/components/list-item/themes.js +1 -1
  72. package/dist/cjs/components/list-item/themes.js.map +1 -1
  73. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  74. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  75. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  76. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  77. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  78. package/dist/cjs/components/multi-level-dropdown/MenuList.js.map +1 -1
  79. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  80. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  81. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +33 -30
  82. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  83. package/dist/cjs/components/tag/Tag.js +1 -1
  84. package/dist/cjs/components/tag/Tag.js.map +1 -1
  85. package/dist/cjs/components/tag/Tag.styled.js +1 -1
  86. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  87. package/dist/cjs/components/tag/model.js.map +1 -1
  88. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  89. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  90. package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -1
  91. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  92. package/dist/cjs/constants/Theme.js +1 -1
  93. package/dist/cjs/constants/Theme.js.map +1 -1
  94. package/dist/cjs/editor/BikEditor.js +1 -1
  95. package/dist/cjs/editor/BikEditor.js.map +1 -1
  96. package/dist/cjs/editor/BikEditor.types.js.map +1 -1
  97. package/dist/cjs/editor/BikEditor.utils.js +1 -1
  98. package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
  99. package/dist/cjs/editor/extensions/buildExtensions.js +1 -1
  100. package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
  101. package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
  102. package/dist/cjs/editor/extensions/mention/MentionDropdown.js.map +1 -1
  103. package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
  104. package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
  105. package/dist/cjs/editor/extensions/slashCommand/SlashCommandExtension.js +1 -1
  106. package/dist/cjs/editor/extensions/slashCommand/SlashCommandExtension.js.map +1 -1
  107. package/dist/cjs/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
  108. package/dist/cjs/editor/extensions/slashCommand/SlashCommandMenu.js.map +1 -1
  109. package/dist/cjs/editor/extensions/suggestionPopup.js +2 -0
  110. package/dist/cjs/editor/extensions/suggestionPopup.js.map +1 -0
  111. package/dist/cjs/editor/floating/LinkBubbleMenu.js +1 -1
  112. package/dist/cjs/editor/floating/LinkBubbleMenu.js.map +1 -1
  113. package/dist/cjs/editor/toolbar/BikEditorToolbar.js +1 -1
  114. package/dist/cjs/editor/toolbar/BikEditorToolbar.js.map +1 -1
  115. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js +1 -1
  116. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  117. package/dist/cjs/index.js +1 -1
  118. package/dist/cjs/src/components/avatar/Avatar.d.ts +3 -2
  119. package/dist/cjs/src/components/avatar/AvatarHelper.d.ts +5 -4
  120. package/dist/cjs/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  121. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  122. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +13 -0
  123. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  124. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +3 -0
  125. package/dist/cjs/src/components/bik-layout/MockMenus.d.ts +0 -1
  126. package/dist/cjs/src/components/bik-layout/index.d.ts +2 -0
  127. package/dist/cjs/src/components/button/Button.styled.d.ts +1 -1
  128. package/dist/cjs/src/components/button/model.d.ts +3 -3
  129. package/dist/cjs/src/components/button/themes.d.ts +2 -2
  130. package/dist/cjs/src/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  131. package/dist/cjs/src/components/country-code-picker/CountryPicker.d.ts +1 -1
  132. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  133. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  134. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  135. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +1 -1
  136. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +1 -1
  137. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -1
  138. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +2 -1
  139. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -1
  140. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  141. package/dist/cjs/src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  142. package/dist/cjs/src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +2 -0
  143. package/dist/cjs/src/components/dropdown/hooks/useDropdown.d.ts +2 -0
  144. package/dist/cjs/src/components/dropdown/type.d.ts +2 -1
  145. package/dist/cjs/src/components/dropdown-button/DropdownButton.d.ts +3 -1
  146. package/dist/cjs/src/components/dropdown-button/DropdownButton.style.d.ts +9 -2
  147. package/dist/cjs/src/components/dual-icon-button/DualIconButton.d.ts +3 -0
  148. package/dist/cjs/src/components/dual-icon-button/DualIconButton.styled.d.ts +7 -0
  149. package/dist/cjs/src/components/dual-icon-button/index.d.ts +2 -0
  150. package/dist/cjs/src/components/dual-icon-button/model.d.ts +12 -0
  151. package/dist/cjs/src/components/fab-menu/FABMenu.d.ts +1 -1
  152. package/dist/cjs/src/components/icon-button/IconButton.styled.d.ts +3 -1
  153. package/dist/cjs/src/components/icon-button/model.d.ts +12 -1
  154. package/dist/cjs/src/components/input/Input.model.d.ts +2 -1
  155. package/dist/cjs/src/components/input/Input.styled.d.ts +16 -1
  156. package/dist/cjs/src/components/list-item/List.model.d.ts +1 -1
  157. package/dist/cjs/src/components/list-item/ListItem.styled.d.ts +1 -1
  158. package/dist/cjs/src/components/list-item/themes.d.ts +2 -2
  159. package/dist/cjs/src/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  160. package/dist/cjs/src/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  161. package/dist/cjs/src/components/multi-level-dropdown/MenuList.d.ts +1 -0
  162. package/dist/cjs/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  163. package/dist/cjs/src/components/multi-level-dropdown/type.d.ts +1 -0
  164. package/dist/cjs/src/components/tag/Tag.d.ts +1 -1
  165. package/dist/cjs/src/components/tag/Tag.stories.d.ts +5 -5
  166. package/dist/cjs/src/components/tag/Tag.styled.d.ts +3 -1
  167. package/dist/cjs/src/components/tag/model.d.ts +5 -1
  168. package/dist/cjs/src/components/whats-new/WhatsNew.d.ts +2 -0
  169. package/dist/cjs/src/components/whats-new/WhatsNew.types.d.ts +2 -0
  170. package/dist/cjs/src/constants/Theme.d.ts +6 -0
  171. package/dist/cjs/src/editor/BikEditor.types.d.ts +2 -2
  172. package/dist/cjs/src/editor/BikEditor.utils.d.ts +6 -4
  173. package/dist/cjs/src/editor/extensions/buildExtensions.d.ts +9 -3
  174. package/dist/cjs/src/editor/extensions/mention/MentionExtension.d.ts +6 -2
  175. package/dist/cjs/src/editor/extensions/slashCommand/SlashCommandExtension.d.ts +3 -1
  176. package/dist/cjs/src/editor/extensions/suggestionPopup.d.ts +13 -0
  177. package/dist/cjs/src/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  178. package/dist/cjs/src/index.d.ts +1 -0
  179. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  180. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  181. package/dist/esm/components/avatar/Avatar.js +1 -1
  182. package/dist/esm/components/avatar/Avatar.js.map +1 -1
  183. package/dist/esm/components/avatar/Avatar.styled.js +6 -6
  184. package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
  185. package/dist/esm/components/avatar/AvatarHelper.js +1 -1
  186. package/dist/esm/components/avatar/AvatarHelper.js.map +1 -1
  187. package/dist/esm/components/bik-layout/BikSidebar.js.map +1 -1
  188. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js +2 -0
  189. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  190. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +2 -0
  191. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  192. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +294 -0
  193. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  194. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +2 -0
  195. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  196. package/dist/esm/components/button/Button.js +1 -1
  197. package/dist/esm/components/button/Button.js.map +1 -1
  198. package/dist/esm/components/button/Button.styled.js +1 -1
  199. package/dist/esm/components/button/Button.styled.js.map +1 -1
  200. package/dist/esm/components/button/themes.js +1 -1
  201. package/dist/esm/components/button/themes.js.map +1 -1
  202. package/dist/esm/components/country-code-picker/CountryCodePicker.js.map +1 -1
  203. package/dist/esm/components/country-code-picker/CountryPicker.js.map +1 -1
  204. package/dist/esm/components/dropdown/Dropdown.js +1 -1
  205. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  206. package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
  207. package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
  208. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  209. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  210. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +3 -2
  211. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  212. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  213. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  214. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  215. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +1 -1
  216. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  217. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  218. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  219. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +6 -2
  220. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  221. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  222. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  223. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  224. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  225. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  226. package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
  227. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  228. package/dist/esm/components/dropdown-button/DropdownButton.style.js +8 -4
  229. package/dist/esm/components/dropdown-button/DropdownButton.style.js.map +1 -1
  230. package/dist/esm/components/dual-icon-button/DualIconButton.js +2 -0
  231. package/dist/esm/components/dual-icon-button/DualIconButton.js.map +1 -0
  232. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js +26 -0
  233. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  234. package/dist/esm/components/fab-menu/FABMenu.js.map +1 -1
  235. package/dist/esm/components/icon-button/IconButton.js +1 -1
  236. package/dist/esm/components/icon-button/IconButton.js.map +1 -1
  237. package/dist/esm/components/icon-button/IconButton.styled.js +1 -1
  238. package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
  239. package/dist/esm/components/icon-button/theme.js +1 -1
  240. package/dist/esm/components/icon-button/theme.js.map +1 -1
  241. package/dist/esm/components/input/Input.js +1 -1
  242. package/dist/esm/components/input/Input.js.map +1 -1
  243. package/dist/esm/components/input/Input.styled.js +1 -1
  244. package/dist/esm/components/input/Input.styled.js.map +1 -1
  245. package/dist/esm/components/list-item/ListItem.js +1 -1
  246. package/dist/esm/components/list-item/ListItem.js.map +1 -1
  247. package/dist/esm/components/list-item/ListItem.styled.js +1 -1
  248. package/dist/esm/components/list-item/ListItem.styled.js.map +1 -1
  249. package/dist/esm/components/list-item/themes.js +1 -1
  250. package/dist/esm/components/list-item/themes.js.map +1 -1
  251. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  252. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  253. package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
  254. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  255. package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
  256. package/dist/esm/components/multi-level-dropdown/MenuList.js.map +1 -1
  257. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  258. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  259. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +32 -29
  260. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  261. package/dist/esm/components/tag/Tag.js +1 -1
  262. package/dist/esm/components/tag/Tag.js.map +1 -1
  263. package/dist/esm/components/tag/Tag.styled.js +1 -1
  264. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  265. package/dist/esm/components/tag/model.js.map +1 -1
  266. package/dist/esm/components/whats-new/WhatsNew.js +1 -1
  267. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  268. package/dist/esm/components/whats-new/WhatsNewButton.js +1 -1
  269. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  270. package/dist/esm/constants/Theme.js +1 -1
  271. package/dist/esm/constants/Theme.js.map +1 -1
  272. package/dist/esm/editor/BikEditor.js +1 -1
  273. package/dist/esm/editor/BikEditor.js.map +1 -1
  274. package/dist/esm/editor/BikEditor.types.js.map +1 -1
  275. package/dist/esm/editor/BikEditor.utils.js +1 -1
  276. package/dist/esm/editor/BikEditor.utils.js.map +1 -1
  277. package/dist/esm/editor/extensions/buildExtensions.js +1 -1
  278. package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
  279. package/dist/esm/editor/extensions/mention/MentionDropdown.js +1 -1
  280. package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
  281. package/dist/esm/editor/extensions/mention/MentionExtension.js +1 -1
  282. package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
  283. package/dist/esm/editor/extensions/slashCommand/SlashCommandExtension.js +1 -1
  284. package/dist/esm/editor/extensions/slashCommand/SlashCommandExtension.js.map +1 -1
  285. package/dist/esm/editor/extensions/slashCommand/SlashCommandMenu.js +1 -1
  286. package/dist/esm/editor/extensions/slashCommand/SlashCommandMenu.js.map +1 -1
  287. package/dist/esm/editor/extensions/suggestionPopup.js +2 -0
  288. package/dist/esm/editor/extensions/suggestionPopup.js.map +1 -0
  289. package/dist/esm/editor/floating/LinkBubbleMenu.js +1 -1
  290. package/dist/esm/editor/floating/LinkBubbleMenu.js.map +1 -1
  291. package/dist/esm/editor/toolbar/BikEditorToolbar.js +1 -1
  292. package/dist/esm/editor/toolbar/BikEditorToolbar.js.map +1 -1
  293. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js +1 -1
  294. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  295. package/dist/esm/index.js +1 -1
  296. package/dist/esm/src/components/avatar/Avatar.d.ts +3 -2
  297. package/dist/esm/src/components/avatar/AvatarHelper.d.ts +5 -4
  298. package/dist/esm/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  299. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  300. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +13 -0
  301. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  302. package/dist/esm/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +3 -0
  303. package/dist/esm/src/components/bik-layout/MockMenus.d.ts +0 -1
  304. package/dist/esm/src/components/bik-layout/index.d.ts +2 -0
  305. package/dist/esm/src/components/button/Button.styled.d.ts +1 -1
  306. package/dist/esm/src/components/button/model.d.ts +3 -3
  307. package/dist/esm/src/components/button/themes.d.ts +2 -2
  308. package/dist/esm/src/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  309. package/dist/esm/src/components/country-code-picker/CountryPicker.d.ts +1 -1
  310. package/dist/esm/src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  311. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  312. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  313. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +1 -1
  314. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +1 -1
  315. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -1
  316. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +2 -1
  317. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -1
  318. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  319. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  320. package/dist/esm/src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +2 -0
  321. package/dist/esm/src/components/dropdown/hooks/useDropdown.d.ts +2 -0
  322. package/dist/esm/src/components/dropdown/type.d.ts +2 -1
  323. package/dist/esm/src/components/dropdown-button/DropdownButton.d.ts +3 -1
  324. package/dist/esm/src/components/dropdown-button/DropdownButton.style.d.ts +9 -2
  325. package/dist/esm/src/components/dual-icon-button/DualIconButton.d.ts +3 -0
  326. package/dist/esm/src/components/dual-icon-button/DualIconButton.styled.d.ts +7 -0
  327. package/dist/esm/src/components/dual-icon-button/index.d.ts +2 -0
  328. package/dist/esm/src/components/dual-icon-button/model.d.ts +12 -0
  329. package/dist/esm/src/components/fab-menu/FABMenu.d.ts +1 -1
  330. package/dist/esm/src/components/icon-button/IconButton.styled.d.ts +3 -1
  331. package/dist/esm/src/components/icon-button/model.d.ts +12 -1
  332. package/dist/esm/src/components/input/Input.model.d.ts +2 -1
  333. package/dist/esm/src/components/input/Input.styled.d.ts +16 -1
  334. package/dist/esm/src/components/list-item/List.model.d.ts +1 -1
  335. package/dist/esm/src/components/list-item/ListItem.styled.d.ts +1 -1
  336. package/dist/esm/src/components/list-item/themes.d.ts +2 -2
  337. package/dist/esm/src/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  338. package/dist/esm/src/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  339. package/dist/esm/src/components/multi-level-dropdown/MenuList.d.ts +1 -0
  340. package/dist/esm/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  341. package/dist/esm/src/components/multi-level-dropdown/type.d.ts +1 -0
  342. package/dist/esm/src/components/tag/Tag.d.ts +1 -1
  343. package/dist/esm/src/components/tag/Tag.stories.d.ts +5 -5
  344. package/dist/esm/src/components/tag/Tag.styled.d.ts +3 -1
  345. package/dist/esm/src/components/tag/model.d.ts +5 -1
  346. package/dist/esm/src/components/whats-new/WhatsNew.d.ts +2 -0
  347. package/dist/esm/src/components/whats-new/WhatsNew.types.d.ts +2 -0
  348. package/dist/esm/src/constants/Theme.d.ts +6 -0
  349. package/dist/esm/src/editor/BikEditor.types.d.ts +2 -2
  350. package/dist/esm/src/editor/BikEditor.utils.d.ts +6 -4
  351. package/dist/esm/src/editor/extensions/buildExtensions.d.ts +9 -3
  352. package/dist/esm/src/editor/extensions/mention/MentionExtension.d.ts +6 -2
  353. package/dist/esm/src/editor/extensions/slashCommand/SlashCommandExtension.d.ts +3 -1
  354. package/dist/esm/src/editor/extensions/suggestionPopup.d.ts +13 -0
  355. package/dist/esm/src/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  356. package/dist/esm/src/index.d.ts +1 -0
  357. package/package.json +1 -3
@@ -1 +1 @@
1
- {"version":3,"file":"MentionDropdown.js","sources":["../../../../../src/editor/extensions/mention/MentionDropdown.tsx"],"sourcesContent":["import React, {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport type {\n\tMentionDropdownRenderProps,\n\tMentionItem,\n} from '../../BikEditor.types';\nimport {\n\tDropdownContainer,\n\tDropdownItem,\n\tMentionAvatar,\n\tMentionAvatarFallback,\n\tMentionLabel,\n\tMentionPresenceDot,\n} from '../editorDropdown.styles';\n\ninterface Props {\n\titems: MentionItem[];\n\tquery: string;\n\tcommand: (item: MentionItem) => void;\n\t/** Custom per-row renderer. Receives the item and whether it is the active row. */\n\trenderItem?: (item: MentionItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Full custom dropdown renderer. Takes priority over renderItem.\n\t * The editor passes activeIndex and onSelect — you handle all the visual rendering.\n\t */\n\trenderDropdown?: (props: MentionDropdownRenderProps) => React.ReactNode;\n}\n\nexport const MentionDropdown = forwardRef<any, Props>(\n\t({ items, query, command, renderItem, renderDropdown }, ref) => {\n\t\tconst [selectedIndex, setSelectedIndex] = useState(0);\n\t\tconst containerRef = useRef<HTMLDivElement>(null);\n\n\t\tconst scrollToIndex = useCallback((index: number) => {\n\t\t\tconst container = containerRef.current;\n\t\t\tif (!container) return;\n\t\t\tconst item = container.children[index] as HTMLElement | undefined;\n\t\t\titem?.scrollIntoView({ block: 'nearest' });\n\t\t}, []);\n\n\t\tconst select = (i: number) => {\n\t\t\tif (items[i]) command(items[i]);\n\t\t};\n\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tonKeyDown: ({ event }: { event: KeyboardEvent }) => {\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + items.length - 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tselect(selectedIndex);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}));\n\n\t\tuseEffect(() => setSelectedIndex(0), [items]);\n\n\t\tif (!items.length) return null;\n\n\t\t// Full custom dropdown — editor still manages keyboard nav via selectedIndex\n\t\tif (renderDropdown) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{renderDropdown({\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tquery,\n\t\t\t\t\t\tactiveIndex: selectedIndex,\n\t\t\t\t\t\tonSelect: (item) => command(item),\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<DropdownContainer ref={containerRef}>\n\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t$isActive={i === selectedIndex}\n\t\t\t\t\t\tonMouseEnter={() => setSelectedIndex(i)}\n\t\t\t\t\t\tonClick={() => select(i)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderItem ? (\n\t\t\t\t\t\t\trenderItem(item, i === selectedIndex)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{item.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<MentionAvatar src={item.avatarUrl} alt=\"\" />\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<MentionAvatarFallback>\n\t\t\t\t\t\t\t\t\t\t{item.label.charAt(0).toUpperCase()}\n\t\t\t\t\t\t\t\t\t</MentionAvatarFallback>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<MentionLabel>{item.label}</MentionLabel>\n\t\t\t\t\t\t\t\t{item.isOnline !== undefined && (\n\t\t\t\t\t\t\t\t\t<MentionPresenceDot $online={item.isOnline} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t))}\n\t\t\t</DropdownContainer>\n\t\t);\n\t},\n);\nMentionDropdown.displayName = 'MentionDropdown';\n"],"names":["MentionDropdown","forwardRef","_ref","ref","items","query","command","renderItem","renderDropdown","selectedIndex","setSelectedIndex","useState","containerRef","useRef","scrollToIndex","useCallback","index","container","current","item","children","scrollIntoView","block","select","i","useImperativeHandle","onKeyDown","_ref2","event","key","prev","next","length","useEffect","_jsx","_Fragment","activeIndex","onSelect","DropdownContainer","Object","assign","map","DropdownItem","onMouseEnter","onClick","_jsxs","jsxs","avatarUrl","MentionAvatar","src","alt","jsx","MentionAvatarFallback","label","charAt","toUpperCase","MentionLabel","undefined","isOnline","MentionPresenceDot","$online","id","displayName"],"mappings":"mKAkCO,MAAMA,EAAkBC,EAAUA,YACxC,CAAAC,EAAwDC,KAAO,IAA9DC,MAAEA,EAAKC,MAAEA,EAAKC,QAAEA,EAAOC,WAAEA,EAAUC,eAAEA,GAAgBN,EACrD,MAAOO,EAAeC,GAAoBC,EAAQA,SAAC,GAC7CC,EAAeC,SAAuB,MAEtCC,EAAgBC,EAAWA,aAAEC,IAClC,MAAMC,EAAYL,EAAaM,QAC/B,IAAKD,EAAW,OAChB,MAAME,EAAOF,EAAUG,SAASJ,GAChCG,SAAAA,EAAME,eAAe,CAAEC,MAAO,WAAY,GACxC,IAEGC,EAAUC,IACXpB,EAAMoB,IAAIlB,EAAQF,EAAMoB,GAAG,EA+BhC,OA5BAC,EAAmBA,oBAACtB,GAAK,KAAO,CAC/BuB,UAAWC,IAAwC,IAAvCC,MAAEA,GAAiCD,EAC9C,MAAkB,YAAdC,EAAMC,KACTnB,GAAkBoB,IACjB,MAAMC,GAAQD,EAAO1B,EAAM4B,OAAS,GAAK5B,EAAM4B,OAE/C,OADAlB,EAAciB,GACPA,CAAI,KAEL,GAEU,cAAdH,EAAMC,KACTnB,GAAkBoB,IACjB,MAAMC,GAAQD,EAAO,GAAK1B,EAAM4B,OAEhC,OADAlB,EAAciB,GACPA,CAAI,KAEL,GAEU,UAAdH,EAAMC,MACTN,EAAOd,IACA,EAEI,MAIdwB,EAASA,WAAC,IAAMvB,EAAiB,IAAI,CAACN,IAEjCA,EAAM4B,OAGPxB,EAEF0B,EAAAA,IACEC,EAAAA,SAAA,CAAAf,SAAAZ,EAAe,CACfJ,QACAC,QACA+B,YAAa3B,EACb4B,SAAWlB,GAASb,EAAQa,OAO/Be,MAACI,EAAAA,kBAAiBC,OAAAC,OAAA,CAACrC,IAAKS,GACtB,CAAAQ,SAAAhB,EAAMqC,KAAI,CAACtB,EAAMK,IACjBU,MAACQ,EAAAA,sCAEWlB,IAAMf,EACjBkC,aAAcA,IAAMjC,EAAiBc,GACrCoB,QAASA,IAAMrB,EAAOC,IAAE,CAAAJ,SAEvBb,EACAA,EAAWY,EAAMK,IAAMf,GAEvBoC,EAAAC,KAAAX,WAAA,CAAAf,SAAA,CACED,EAAK4B,UACLb,EAAAA,IAACc,EAAAA,cAAc,CAAAC,IAAK9B,EAAK4B,UAAWG,IAAI,KAExChB,EAACiB,IAAAC,wBACC,CAAAhC,SAAAD,EAAKkC,MAAMC,OAAO,GAAGC,gBAGxBrB,EAAAiB,IAACK,eAAY,CAAApC,SAAED,EAAKkC,aACDI,IAAlBtC,EAAKuC,UACLxB,EAAAA,IAACyB,EAAAA,mBAA4B,CAAAC,QAAAzC,EAAKuC,gBAlBhCvC,EAAK0C,SApBY,IA4CL,IAIvB7D,EAAgB8D,YAAc"}
1
+ {"version":3,"file":"MentionDropdown.js","sources":["../../../../../src/editor/extensions/mention/MentionDropdown.tsx"],"sourcesContent":["import React, {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport type {\n\tMentionDropdownRenderProps,\n\tMentionItem,\n} from '../../BikEditor.types';\nimport {\n\tDropdownContainer,\n\tDropdownItem,\n\tMentionAvatar,\n\tMentionAvatarFallback,\n\tMentionLabel,\n\tMentionPresenceDot,\n} from '../editorDropdown.styles';\n\ninterface Props {\n\titems: MentionItem[];\n\tquery: string;\n\tcommand: (item: MentionItem) => void;\n\t/** Custom per-row renderer. Receives the item and whether it is the active row. */\n\trenderItem?: (item: MentionItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Full custom dropdown renderer. Takes priority over renderItem.\n\t * The editor passes activeIndex and onSelect — you handle all the visual rendering.\n\t */\n\trenderDropdown?: (props: MentionDropdownRenderProps) => React.ReactNode;\n}\n\nexport const MentionDropdown = forwardRef<any, Props>(\n\t({ items, query, command, renderItem, renderDropdown }, ref) => {\n\t\tconst [selectedIndex, setSelectedIndex] = useState(0);\n\t\tconst containerRef = useRef<HTMLDivElement>(null);\n\n\t\tconst scrollToIndex = useCallback((index: number) => {\n\t\t\tconst container = containerRef.current;\n\t\t\tif (!container) return;\n\t\t\tconst item = container.children[index] as HTMLElement | undefined;\n\t\t\titem?.scrollIntoView({ block: 'nearest' });\n\t\t}, []);\n\n\t\tconst select = (i: number) => {\n\t\t\tif (items[i]) command(items[i]);\n\t\t};\n\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tonKeyDown: ({ event }: { event: KeyboardEvent }) => {\n\t\t\t\tif (!items.length) return false;\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + items.length - 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tselect(selectedIndex);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}));\n\n\t\tuseEffect(() => setSelectedIndex(0), [items]);\n\n\t\tif (!items.length) return null;\n\n\t\t// Full custom dropdown — editor still manages keyboard nav via selectedIndex\n\t\tif (renderDropdown) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{renderDropdown({\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tquery,\n\t\t\t\t\t\tactiveIndex: selectedIndex,\n\t\t\t\t\t\tonSelect: (item) => command(item),\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<DropdownContainer ref={containerRef}>\n\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t$isActive={i === selectedIndex}\n\t\t\t\t\t\tonMouseEnter={() => setSelectedIndex(i)}\n\t\t\t\t\t\tonClick={() => select(i)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderItem ? (\n\t\t\t\t\t\t\trenderItem(item, i === selectedIndex)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{item.avatarUrl ? (\n\t\t\t\t\t\t\t\t\t<MentionAvatar src={item.avatarUrl} alt=\"\" />\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<MentionAvatarFallback>\n\t\t\t\t\t\t\t\t\t\t{item.label.charAt(0).toUpperCase()}\n\t\t\t\t\t\t\t\t\t</MentionAvatarFallback>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<MentionLabel>{item.label}</MentionLabel>\n\t\t\t\t\t\t\t\t{item.isOnline !== undefined && (\n\t\t\t\t\t\t\t\t\t<MentionPresenceDot $online={item.isOnline} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t))}\n\t\t\t</DropdownContainer>\n\t\t);\n\t},\n);\nMentionDropdown.displayName = 'MentionDropdown';\n"],"names":["MentionDropdown","forwardRef","_ref","ref","items","query","command","renderItem","renderDropdown","selectedIndex","setSelectedIndex","useState","containerRef","useRef","scrollToIndex","useCallback","index","container","current","item","children","scrollIntoView","block","select","i","useImperativeHandle","onKeyDown","_ref2","event","length","key","prev","next","useEffect","_jsx","_Fragment","activeIndex","onSelect","DropdownContainer","Object","assign","map","DropdownItem","onMouseEnter","onClick","_jsxs","jsxs","avatarUrl","MentionAvatar","src","alt","jsx","MentionAvatarFallback","label","charAt","toUpperCase","MentionLabel","undefined","isOnline","MentionPresenceDot","$online","id","displayName"],"mappings":"mKAkCO,MAAMA,EAAkBC,EAAUA,YACxC,CAAAC,EAAwDC,KAAO,IAA9DC,MAAEA,EAAKC,MAAEA,EAAKC,QAAEA,EAAOC,WAAEA,EAAUC,eAAEA,GAAgBN,EACrD,MAAOO,EAAeC,GAAoBC,EAAQA,SAAC,GAC7CC,EAAeC,SAAuB,MAEtCC,EAAgBC,EAAWA,aAAEC,IAClC,MAAMC,EAAYL,EAAaM,QAC/B,IAAKD,EAAW,OAChB,MAAME,EAAOF,EAAUG,SAASJ,GAChCG,SAAAA,EAAME,eAAe,CAAEC,MAAO,WAAY,GACxC,IAEGC,EAAUC,IACXpB,EAAMoB,IAAIlB,EAAQF,EAAMoB,GAAG,EAgChC,OA7BAC,EAAmBA,oBAACtB,GAAK,KAAO,CAC/BuB,UAAWC,IAAwC,IAAvCC,MAAEA,GAAiCD,EAC9C,QAAKvB,EAAMyB,SACO,YAAdD,EAAME,KACTpB,GAAkBqB,IACjB,MAAMC,GAAQD,EAAO3B,EAAMyB,OAAS,GAAKzB,EAAMyB,OAE/C,OADAf,EAAckB,GACPA,CAAI,KAEL,GAEU,cAAdJ,EAAME,KACTpB,GAAkBqB,IACjB,MAAMC,GAAQD,EAAO,GAAK3B,EAAMyB,OAEhC,OADAf,EAAckB,GACPA,CAAI,KAEL,GAEU,UAAdJ,EAAME,MACTP,EAAOd,IACA,GAEI,MAIdwB,EAASA,WAAC,IAAMvB,EAAiB,IAAI,CAACN,IAEjCA,EAAMyB,OAGPrB,EAEF0B,EAAAA,IACEC,EAAAA,SAAA,CAAAf,SAAAZ,EAAe,CACfJ,QACAC,QACA+B,YAAa3B,EACb4B,SAAWlB,GAASb,EAAQa,OAO/Be,MAACI,EAAAA,kBAAiBC,OAAAC,OAAA,CAACrC,IAAKS,GACtB,CAAAQ,SAAAhB,EAAMqC,KAAI,CAACtB,EAAMK,IACjBU,MAACQ,EAAAA,sCAEWlB,IAAMf,EACjBkC,aAAcA,IAAMjC,EAAiBc,GACrCoB,QAASA,IAAMrB,EAAOC,IAAE,CAAAJ,SAEvBb,EACAA,EAAWY,EAAMK,IAAMf,GAEvBoC,EAAAC,KAAAX,WAAA,CAAAf,SAAA,CACED,EAAK4B,UACLb,EAAAA,IAACc,EAAAA,cAAc,CAAAC,IAAK9B,EAAK4B,UAAWG,IAAI,KAExChB,EAACiB,IAAAC,wBACC,CAAAhC,SAAAD,EAAKkC,MAAMC,OAAO,GAAGC,gBAGxBrB,EAAAiB,IAACK,eAAY,CAAApC,SAAED,EAAKkC,aACDI,IAAlBtC,EAAKuC,UACLxB,EAAAA,IAACyB,EAAAA,mBAA4B,CAAAC,QAAAzC,EAAKuC,gBAlBhCvC,EAAK0C,SApBY,IA4CL,IAIvB7D,EAAgB8D,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),t=require("@tiptap/extension-mention"),n=require("@tiptap/react"),r=require("tippy.js"),o=require("./MentionDropdown.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t),a=i(r);function d(e){let t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return()=>{let e,i;return{onStart:s=>{e=new n.ReactRenderer(o.MentionDropdown,{props:Object.assign(Object.assign({},s),{renderItem:t,renderDropdown:r}),editor:s.editor}),i=a.default(document.body,{getReferenceClientRect:s.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:9999,arrow:!1,onMount:e=>{const t=e.popper.querySelector(".tippy-box");t&&(t.style.cssText="background:none;box-shadow:none;border:none;padding:0;border-radius:0;")}})},onUpdate:n=>{var o,s,a;e.updateProps(Object.assign(Object.assign({},n),{renderItem:t,renderDropdown:r})),(null===(o=n.items)||void 0===o?void 0:o.length)?null===(a=i[0])||void 0===a||a.setProps({getReferenceClientRect:n.clientRect}):null===(s=i[0])||void 0===s||s.hide()},onKeyDown:t=>{var n,r,o;return"Escape"===t.event.key?(null===(n=i[0])||void 0===n||n.hide(),!0):null!==(o=null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(t))&&void 0!==o&&o},onExit:()=>{var t;null===(t=i[0])||void 0===t||t.destroy(),e.destroy()}}}}exports.buildAgentMentionExtension=function(t,n,r,o){return s.default.extend({name:"mentionAgent"}).configure({HTMLAttributes:{class:"bik-mention bik-mention--agent"},renderText:e=>{let{options:t,node:n}=e;return`${t.suggestion.char}${n.attrs.label}`},renderHTML:t=>{let{options:n,node:r}=t;return["span",e.mergeAttributes(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"@",items:e=>{let{query:n}=e;return t.filter((e=>e.label.toLowerCase().includes(n.toLowerCase())))},command:e=>{let{editor:t,range:r,props:o}=e;t.chain().focus().deleteRange(r).insertContent({type:"mentionAgent",attrs:{id:o.id,label:o.label}}).run(),null==n||n(o,"@")},render:d(n,"@",r,o)}})},exports.buildTeamMentionExtension=function(t,n,r,o){return s.default.extend({name:"mentionTeam"}).configure({HTMLAttributes:{class:"bik-mention bik-mention--team"},renderText:e=>{let{options:t,node:n}=e;return`${t.suggestion.char}${n.attrs.label}`},renderHTML:t=>{let{options:n,node:r}=t;return["span",e.mergeAttributes(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"#",items:e=>{let{query:n}=e;return t.filter((e=>e.label.toLowerCase().includes(n.toLowerCase())))},command:e=>{let{editor:t,range:r,props:o}=e;t.chain().focus().deleteRange(r).insertContent({type:"mentionTeam",attrs:{id:o.id,label:o.label}}).run(),null==n||n(o,"#")},render:d(n,"#",r,o)}})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),t=require("@tiptap/extension-mention"),n=require("@tiptap/react"),r=require("../suggestionPopup.js"),o=require("./MentionDropdown.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t);function a(e){let t=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return()=>{let e,s;return{onStart:a=>{e=new n.ReactRenderer(o.MentionDropdown,{props:Object.assign(Object.assign({},a),{renderItem:t,renderDropdown:i}),editor:a.editor}),s=r.createSuggestionPopup(e.element,a.clientRect)},onUpdate:n=>{var r;e.updateProps(Object.assign(Object.assign({},n),{renderItem:t,renderDropdown:i})),(null===(r=n.items)||void 0===r?void 0:r.length)?(s.show(),s.updatePosition(n.clientRect)):s.hide()},onKeyDown:t=>{var n,r;return"Escape"===t.event.key?(s.hide(),!0):null!==(r=null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t))&&void 0!==r&&r},onExit:()=>{s.destroy(),e.destroy()}}}}exports.buildAgentMentionExtension=function(t,n,r,o){return s.default.extend({name:"mentionAgent"}).configure({HTMLAttributes:{class:"bik-mention bik-mention--agent"},renderText:e=>{let{options:t,node:n}=e;return`${t.suggestion.char}${n.attrs.label}`},renderHTML:t=>{let{options:n,node:r}=t;return["span",e.mergeAttributes(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"@",items:e=>{let{query:n}=e;return t.current.filter((e=>e.label.toLowerCase().includes(n.toLowerCase())))},command:e=>{let{editor:t,range:r,props:o}=e;t.chain().focus().deleteRange(r).insertContent({type:"mentionAgent",attrs:{id:o.id,label:o.label}}).run(),null==n||n(o,"@")},render:a(n,"@",r,o)}})},exports.buildTeamMentionExtension=function(t,n,r,o){return s.default.extend({name:"mentionTeam"}).configure({HTMLAttributes:{class:"bik-mention bik-mention--team"},renderText:e=>{let{options:t,node:n}=e;return`${t.suggestion.char}${n.attrs.label}`},renderHTML:t=>{let{options:n,node:r}=t;return["span",e.mergeAttributes(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"#",items:e=>{let{query:n}=e;return t.current.filter((e=>e.label.toLowerCase().includes(n.toLowerCase())))},command:e=>{let{editor:t,range:r,props:o}=e;t.chain().focus().deleteRange(r).insertContent({type:"mentionTeam",attrs:{id:o.id,label:o.label}}).run(),null==n||n(o,"#")},render:a(n,"#",r,o)}})};
2
2
  //# sourceMappingURL=MentionExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MentionExtension.js","sources":["../../../../../src/editor/extensions/mention/MentionExtension.ts"],"sourcesContent":["import { mergeAttributes } from '@tiptap/core';\nimport Mention from '@tiptap/extension-mention';\nimport { ReactRenderer } from '@tiptap/react';\nimport type { ReactNode } from 'react';\nimport tippy from 'tippy.js';\nimport type {\n\tMentionDropdownRenderProps,\n\tMentionItem,\n} from '../../BikEditor.types';\nimport { MentionDropdown } from './MentionDropdown';\n\nfunction buildRender(\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\tchar: '@' | '#' = '@',\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn () => {\n\t\tlet component: ReactRenderer;\n\t\tlet popup: any;\n\n\t\treturn {\n\t\t\tonStart: (props: any) => {\n\t\t\t\tcomponent = new ReactRenderer(MentionDropdown, {\n\t\t\t\t\tprops: { ...props, renderItem, renderDropdown },\n\t\t\t\t\teditor: props.editor,\n\t\t\t\t});\n\t\t\t\tpopup = tippy(document.body, {\n\t\t\t\t\tgetReferenceClientRect: props.clientRect,\n\t\t\t\t\tappendTo: () => document.body,\n\t\t\t\t\tcontent: component.element,\n\t\t\t\t\tshowOnCreate: true,\n\t\t\t\t\tinteractive: true,\n\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\tarrow: false,\n\t\t\t\t\t// tippy's default dark theme adds a visible box even when content\n\t\t\t\t\t// is empty. Strip it so our dropdown handles all visual styling.\n\t\t\t\t\tonMount: (instance) => {\n\t\t\t\t\t\tconst box =\n\t\t\t\t\t\t\tinstance.popper.querySelector<HTMLElement>('.tippy-box');\n\t\t\t\t\t\tif (box)\n\t\t\t\t\t\t\tbox.style.cssText =\n\t\t\t\t\t\t\t\t'background:none;box-shadow:none;border:none;padding:0;border-radius:0;';\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonUpdate: (props: any) => {\n\t\t\t\tcomponent.updateProps({ ...props, renderItem, renderDropdown });\n\t\t\t\tif (!props.items?.length) {\n\t\t\t\t\tpopup[0]?.hide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpopup[0]?.setProps({ getReferenceClientRect: props.clientRect });\n\t\t\t},\n\t\t\tonKeyDown: (props: any) => {\n\t\t\t\tif (props.event.key === 'Escape') {\n\t\t\t\t\tpopup[0]?.hide();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn (component.ref as any)?.onKeyDown(props) ?? false;\n\t\t\t},\n\t\t\tonExit: () => {\n\t\t\t\tpopup[0]?.destroy();\n\t\t\t\tcomponent.destroy();\n\t\t\t},\n\t\t};\n\t};\n}\n\nexport function buildAgentMentionExtension(\n\tagents: MentionItem[],\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn Mention.extend({ name: 'mentionAgent' }).configure({\n\t\tHTMLAttributes: { class: 'bik-mention bik-mention--agent' },\n\t\trenderText: ({ options, node }) =>\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\trenderHTML: ({ options, node }) => [\n\t\t\t'span',\n\t\t\tmergeAttributes(options.HTMLAttributes),\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\t],\n\t\tsuggestion: {\n\t\t\tchar: '@',\n\t\t\titems: ({ query }: { query: string }) =>\n\t\t\t\tagents.filter((a) =>\n\t\t\t\t\ta.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t),\n\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.deleteRange(range)\n\t\t\t\t\t.insertContent({\n\t\t\t\t\t\ttype: 'mentionAgent',\n\t\t\t\t\t\tattrs: { id: props.id, label: props.label },\n\t\t\t\t\t})\n\t\t\t\t\t.run();\n\t\t\t\tonSelect?.(props, '@');\n\t\t\t},\n\t\t\trender: buildRender(onSelect, '@', renderItem, renderDropdown),\n\t\t},\n\t});\n}\n\nexport function buildTeamMentionExtension(\n\tteams: MentionItem[],\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn Mention.extend({ name: 'mentionTeam' }).configure({\n\t\tHTMLAttributes: { class: 'bik-mention bik-mention--team' },\n\t\trenderText: ({ options, node }) =>\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\trenderHTML: ({ options, node }) => [\n\t\t\t'span',\n\t\t\tmergeAttributes(options.HTMLAttributes),\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\t],\n\t\tsuggestion: {\n\t\t\tchar: '#',\n\t\t\titems: ({ query }: { query: string }) =>\n\t\t\t\tteams.filter((t) =>\n\t\t\t\t\tt.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t),\n\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.deleteRange(range)\n\t\t\t\t\t.insertContent({\n\t\t\t\t\t\ttype: 'mentionTeam',\n\t\t\t\t\t\tattrs: { id: props.id, label: props.label },\n\t\t\t\t\t})\n\t\t\t\t\t.run();\n\t\t\t\tonSelect?.(props, '#');\n\t\t\t},\n\t\t\trender: buildRender(onSelect, '#', renderItem, renderDropdown),\n\t\t},\n\t});\n}\n"],"names":["buildRender","onSelect","renderItem","arguments","length","undefined","renderDropdown","component","popup","onStart","props","ReactRenderer","MentionDropdown","editor","tippy","document","body","getReferenceClientRect","clientRect","appendTo","content","element","showOnCreate","interactive","trigger","placement","zIndex","arrow","onMount","instance","box","popper","querySelector","style","cssText","onUpdate","updateProps","Object","assign","_a","items","_c","setProps","_b","hide","onKeyDown","event","key","ref","onExit","destroy","agents","Mention","extend","name","configure","HTMLAttributes","class","renderText","_ref","options","node","suggestion","char","attrs","renderHTML","_ref2","mergeAttributes","_ref3","query","filter","a","label","toLowerCase","includes","command","_ref4","range","chain","focus","deleteRange","insertContent","type","id","run","render","teams","_ref5","_ref6","_ref7","t","_ref8"],"mappings":"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"}
1
+ {"version":3,"file":"MentionExtension.js","sources":["../../../../../src/editor/extensions/mention/MentionExtension.ts"],"sourcesContent":["import { mergeAttributes } from '@tiptap/core';\nimport Mention from '@tiptap/extension-mention';\nimport { ReactRenderer } from '@tiptap/react';\nimport type { ReactNode } from 'react';\nimport type {\n\tMentionDropdownRenderProps,\n\tMentionItem,\n} from '../../BikEditor.types';\nimport {\n\tcreateSuggestionPopup,\n\ttype SuggestionPopup,\n} from '../suggestionPopup';\nimport { MentionDropdown } from './MentionDropdown';\n\nfunction buildRender(\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\tchar: '@' | '#' = '@',\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn () => {\n\t\tlet component: ReactRenderer;\n\t\tlet popup: SuggestionPopup;\n\n\t\treturn {\n\t\t\tonStart: (props: any) => {\n\t\t\t\tcomponent = new ReactRenderer(MentionDropdown, {\n\t\t\t\t\tprops: { ...props, renderItem, renderDropdown },\n\t\t\t\t\teditor: props.editor,\n\t\t\t\t});\n\t\t\t\tpopup = createSuggestionPopup(component.element, props.clientRect);\n\t\t\t},\n\t\t\tonUpdate: (props: any) => {\n\t\t\t\tcomponent.updateProps({ ...props, renderItem, renderDropdown });\n\t\t\t\tif (!props.items?.length) {\n\t\t\t\t\tpopup.hide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpopup.show();\n\t\t\t\tpopup.updatePosition(props.clientRect);\n\t\t\t},\n\t\t\tonKeyDown: (props: any) => {\n\t\t\t\tif (props.event.key === 'Escape') {\n\t\t\t\t\tpopup.hide();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn (component.ref as any)?.onKeyDown(props) ?? false;\n\t\t\t},\n\t\t\tonExit: () => {\n\t\t\t\tpopup.destroy();\n\t\t\t\tcomponent.destroy();\n\t\t\t},\n\t\t};\n\t};\n}\n\nexport function buildAgentMentionExtension(\n\tagentsRef: { current: MentionItem[] },\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn Mention.extend({ name: 'mentionAgent' }).configure({\n\t\tHTMLAttributes: { class: 'bik-mention bik-mention--agent' },\n\t\trenderText: ({ options, node }) =>\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\trenderHTML: ({ options, node }) => [\n\t\t\t'span',\n\t\t\tmergeAttributes(options.HTMLAttributes),\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\t],\n\t\tsuggestion: {\n\t\t\tchar: '@',\n\t\t\titems: ({ query }: { query: string }) =>\n\t\t\t\tagentsRef.current.filter((a) =>\n\t\t\t\t\ta.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t),\n\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.deleteRange(range)\n\t\t\t\t\t.insertContent({\n\t\t\t\t\t\ttype: 'mentionAgent',\n\t\t\t\t\t\tattrs: { id: props.id, label: props.label },\n\t\t\t\t\t})\n\t\t\t\t\t.run();\n\t\t\t\tonSelect?.(props, '@');\n\t\t\t},\n\t\t\trender: buildRender(onSelect, '@', renderItem, renderDropdown),\n\t\t},\n\t});\n}\n\nexport function buildTeamMentionExtension(\n\tteamsRef: { current: MentionItem[] },\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void,\n\trenderItem?: (item: MentionItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: MentionDropdownRenderProps) => ReactNode,\n) {\n\treturn Mention.extend({ name: 'mentionTeam' }).configure({\n\t\tHTMLAttributes: { class: 'bik-mention bik-mention--team' },\n\t\trenderText: ({ options, node }) =>\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\trenderHTML: ({ options, node }) => [\n\t\t\t'span',\n\t\t\tmergeAttributes(options.HTMLAttributes),\n\t\t\t`${options.suggestion.char}${node.attrs['label']}`,\n\t\t],\n\t\tsuggestion: {\n\t\t\tchar: '#',\n\t\t\titems: ({ query }: { query: string }) =>\n\t\t\t\tteamsRef.current.filter((t) =>\n\t\t\t\t\tt.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t),\n\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.deleteRange(range)\n\t\t\t\t\t.insertContent({\n\t\t\t\t\t\ttype: 'mentionTeam',\n\t\t\t\t\t\tattrs: { id: props.id, label: props.label },\n\t\t\t\t\t})\n\t\t\t\t\t.run();\n\t\t\t\tonSelect?.(props, '#');\n\t\t\t},\n\t\t\trender: buildRender(onSelect, '#', renderItem, renderDropdown),\n\t\t},\n\t});\n}\n"],"names":["buildRender","onSelect","renderItem","arguments","length","undefined","renderDropdown","component","popup","onStart","props","ReactRenderer","MentionDropdown","editor","createSuggestionPopup","element","clientRect","onUpdate","updateProps","Object","assign","_a","items","show","updatePosition","hide","onKeyDown","event","key","_b","ref","onExit","destroy","agentsRef","Mention","extend","name","configure","HTMLAttributes","class","renderText","_ref","options","node","suggestion","char","attrs","renderHTML","_ref2","mergeAttributes","_ref3","query","current","filter","a","label","toLowerCase","includes","command","_ref4","range","chain","focus","deleteRange","insertContent","type","id","run","render","teamsRef","_ref5","_ref6","_ref7","t","_ref8"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),t=require("@tiptap/react"),n=require("@tiptap/suggestion"),r=require("tippy.js"),o=require("./SlashCommandMenu.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=d(n),a=d(r);exports.buildSlashCommandExtension=function(n,r,d,s){return e.Extension.create({name:"slashCommand",addProseMirrorPlugins(){return[i.default({editor:this.editor,char:"/",items:e=>{let{query:t}=e;return n.filter((e=>e.label.toLowerCase().includes(t.toLowerCase()))).slice(0,20)},command:e=>{let{editor:t,range:n,props:o}=e;t.chain().focus().deleteRange(n).run(),null==r||r(o)},render:()=>{let e,n;return{onStart:r=>{e=new t.ReactRenderer(o.SlashCommandMenu,{props:Object.assign(Object.assign({},r),{renderItem:d,renderDropdown:s}),editor:r.editor}),n=a.default(document.body,{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:9999,arrow:!1,onMount:e=>{const t=e.popper.querySelector(".tippy-box");t&&(t.style.cssText="background:none;box-shadow:none;border:none;padding:0;border-radius:0;")}})},onUpdate:t=>{var r,o,i;e.updateProps(Object.assign(Object.assign({},t),{renderItem:d,renderDropdown:s})),(null===(r=t.items)||void 0===r?void 0:r.length)?null===(i=n[0])||void 0===i||i.setProps({getReferenceClientRect:t.clientRect}):null===(o=n[0])||void 0===o||o.hide()},onKeyDown:t=>{var r,o,d;return"Escape"===t.event.key?(null===(r=n[0])||void 0===r||r.hide(),!0):null!==(d=null===(o=e.ref)||void 0===o?void 0:o.onKeyDown(t))&&void 0!==d&&d},onExit:()=>{var t;null===(t=n[0])||void 0===t||t.destroy(),e.destroy()}}}})]}})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/@tiptap/core/dist/index.js"),r=require("@tiptap/react"),t=require("@tiptap/suggestion"),n=require("../suggestionPopup.js"),o=require("./SlashCommandMenu.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t);exports.buildSlashCommandExtension=function(t,i,d,a){return e.Extension.create({name:"slashCommand",addProseMirrorPlugins(){return[s.default({editor:this.editor,char:"/",items:e=>{let{query:r}=e;return t.current.filter((e=>e.label.toLowerCase().includes(r.toLowerCase()))).slice(0,20)},command:e=>{let{editor:r,range:t,props:n}=e;r.chain().focus().deleteRange(t).run(),null==i||i(n)},render:()=>{let e,t;return{onStart:i=>{e=new r.ReactRenderer(o.SlashCommandMenu,{props:Object.assign(Object.assign({},i),{renderItem:d,renderDropdown:a}),editor:i.editor}),t=n.createSuggestionPopup(e.element,i.clientRect)},onUpdate:r=>{var n;e.updateProps(Object.assign(Object.assign({},r),{renderItem:d,renderDropdown:a})),(null===(n=r.items)||void 0===n?void 0:n.length)?(t.show(),t.updatePosition(r.clientRect)):t.hide()},onKeyDown:r=>{var n,o;return"Escape"===r.event.key?(t.hide(),!0):null!==(o=null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(r))&&void 0!==o&&o},onExit:()=>{t.destroy(),e.destroy()}}}})]}})};
2
2
  //# sourceMappingURL=SlashCommandExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SlashCommandExtension.js","sources":["../../../../../src/editor/extensions/slashCommand/SlashCommandExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { ReactRenderer } from '@tiptap/react';\nimport Suggestion from '@tiptap/suggestion';\nimport type { ReactNode } from 'react';\nimport tippy from 'tippy.js';\nimport type {\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../../BikEditor.types';\nimport { SlashCommandMenu } from './SlashCommandMenu';\n\nexport function buildSlashCommandExtension(\n\tcommands: SlashCommandItem[],\n\tonSelect?: (command: SlashCommandItem) => void,\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => ReactNode,\n) {\n\treturn Extension.create({\n\t\tname: 'slashCommand',\n\t\taddProseMirrorPlugins() {\n\t\t\treturn [\n\t\t\t\tSuggestion({\n\t\t\t\t\teditor: this.editor,\n\t\t\t\t\tchar: '/',\n\t\t\t\t\titems: ({ query }: any) =>\n\t\t\t\t\t\tcommands\n\t\t\t\t\t\t\t.filter((c) =>\n\t\t\t\t\t\t\t\tc.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.slice(0, 20),\n\t\t\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\t\t\teditor.chain().focus().deleteRange(range).run();\n\t\t\t\t\t\tonSelect?.(props);\n\t\t\t\t\t},\n\t\t\t\t\trender: () => {\n\t\t\t\t\t\tlet component: ReactRenderer;\n\t\t\t\t\t\tlet popup: any;\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tonStart: (props: any) => {\n\t\t\t\t\t\t\t\tcomponent = new ReactRenderer(SlashCommandMenu, {\n\t\t\t\t\t\t\t\t\tprops: { ...props, renderItem, renderDropdown },\n\t\t\t\t\t\t\t\t\teditor: props.editor,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tpopup = tippy(document.body, {\n\t\t\t\t\t\t\t\t\tgetReferenceClientRect: props.clientRect,\n\t\t\t\t\t\t\t\t\tappendTo: () => document.body,\n\t\t\t\t\t\t\t\t\tcontent: component.element,\n\t\t\t\t\t\t\t\t\tshowOnCreate: true,\n\t\t\t\t\t\t\t\t\tinteractive: true,\n\t\t\t\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\t\t\tarrow: false,\n\t\t\t\t\t\t\t\t\t// tippy's default dark theme adds a visible box even when content\n\t\t\t\t\t\t\t\t\t// is empty. Strip it so our dropdown handles all visual styling.\n\t\t\t\t\t\t\t\t\tonMount: (instance) => {\n\t\t\t\t\t\t\t\t\t\tconst box =\n\t\t\t\t\t\t\t\t\t\t\tinstance.popper.querySelector<HTMLElement>('.tippy-box');\n\t\t\t\t\t\t\t\t\t\tif (box)\n\t\t\t\t\t\t\t\t\t\t\tbox.style.cssText =\n\t\t\t\t\t\t\t\t\t\t\t\t'background:none;box-shadow:none;border:none;padding:0;border-radius:0;';\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonUpdate: (props: any) => {\n\t\t\t\t\t\t\t\tcomponent.updateProps({ ...props, renderItem, renderDropdown });\n\t\t\t\t\t\t\t\tif (!props.items?.length) {\n\t\t\t\t\t\t\t\t\tpopup[0]?.hide();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpopup[0]?.setProps({\n\t\t\t\t\t\t\t\t\tgetReferenceClientRect: props.clientRect,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonKeyDown: (props: any) => {\n\t\t\t\t\t\t\t\tif (props.event.key === 'Escape') {\n\t\t\t\t\t\t\t\t\tpopup[0]?.hide();\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn (component.ref as any)?.onKeyDown(props) ?? false;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonExit: () => {\n\t\t\t\t\t\t\t\tpopup[0]?.destroy();\n\t\t\t\t\t\t\t\tcomponent.destroy();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t];\n\t\t},\n\t});\n}\n"],"names":["commands","onSelect","renderItem","renderDropdown","Extension","create","name","addProseMirrorPlugins","Suggestion","editor","this","char","items","_ref","query","filter","c","label","toLowerCase","includes","slice","command","_ref2","range","props","chain","focus","deleteRange","run","render","component","popup","onStart","ReactRenderer","SlashCommandMenu","tippy","document","body","getReferenceClientRect","clientRect","appendTo","content","element","showOnCreate","interactive","trigger","placement","zIndex","arrow","onMount","instance","box","popper","querySelector","style","cssText","onUpdate","updateProps","Object","assign","_a","length","_c","setProps","_b","hide","onKeyDown","event","key","ref","onExit","destroy"],"mappings":"uXAWM,SACLA,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAAA,UAAUC,OAAO,CACvBC,KAAM,eACNC,wBACC,MAAO,CACNC,EAAAA,QAAW,CACVC,OAAQC,KAAKD,OACbE,KAAM,IACNC,MAAOC,IAAA,IAACC,MAAEA,GAAYD,EAAA,OACrBb,EACEe,QAAQC,GACRA,EAAEC,MAAMC,cAAcC,SAASL,EAAMI,iBAErCE,MAAM,EAAG,GAAG,EACfC,QAASC,IAAkC,IAAjCb,OAAEA,EAAMc,MAAEA,EAAKC,MAAEA,GAAYF,EACtCb,EAAOgB,QAAQC,QAAQC,YAAYJ,GAAOK,MAC1C3B,SAAAA,EAAWuB,EAAM,EAElBK,OAAQA,KACP,IAAIC,EACAC,EAEJ,MAAO,CACNC,QAAUR,IACTM,EAAY,IAAIG,EAAaA,cAACC,mBAAkB,CAC/CV,qCAAYA,GAAK,CAAEtB,aAAYC,mBAC/BM,OAAQe,EAAMf,SAEfsB,EAAQI,EAAAA,QAAMC,SAASC,KAAM,CAC5BC,uBAAwBd,EAAMe,WAC9BC,SAAUA,IAAMJ,SAASC,KACzBI,QAASX,EAAUY,QACnBC,cAAc,EACdC,aAAa,EACbC,QAAS,SACTC,UAAW,eACXC,OAAQ,KACRC,OAAO,EAGPC,QAAUC,IACT,MAAMC,EACLD,EAASE,OAAOC,cAA2B,cACxCF,IACHA,EAAIG,MAAMC,QACT,yEAAwE,GAE1E,EAEHC,SAAWhC,cACVM,EAAU2B,YAAiBC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAnC,IAAOtB,aAAYC,qBAC9B,QAAXyD,EAAApC,EAAMZ,aAAK,IAAAgD,OAAA,EAAAA,EAAEC,QAIV,QAARC,EAAA/B,EAAM,UAAE,IAAA+B,GAAAA,EAAEC,SAAS,CAClBzB,uBAAwBd,EAAMe,aAJpB,QAAVyB,EAAAjC,EAAM,UAAI,IAAAiC,GAAAA,EAAAC,MAKT,EAEHC,UAAY1C,cACX,MAAwB,WAApBA,EAAM2C,MAAMC,KACL,QAAVR,EAAA7B,EAAM,UAAI,IAAA6B,GAAAA,EAAAK,QACH,GAE2C,QAA5CH,EAAsB,QAAtBE,EAAClC,EAAUuC,WAAW,IAAAL,OAAA,EAAAA,EAAEE,UAAU1C,UAAU,IAAAsC,GAAAA,CAAK,EAEzDQ,OAAQA,WACG,QAAVV,EAAA7B,EAAM,UAAI,IAAA6B,GAAAA,EAAAW,UACVzC,EAAUyC,SAAS,EAEpB,IAIL,GAEF"}
1
+ {"version":3,"file":"SlashCommandExtension.js","sources":["../../../../../src/editor/extensions/slashCommand/SlashCommandExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { ReactRenderer } from '@tiptap/react';\nimport Suggestion from '@tiptap/suggestion';\nimport type { ReactNode } from 'react';\nimport type {\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../../BikEditor.types';\nimport {\n\tcreateSuggestionPopup,\n\ttype SuggestionPopup,\n} from '../suggestionPopup';\nimport { SlashCommandMenu } from './SlashCommandMenu';\n\nexport function buildSlashCommandExtension(\n\tcommandsRef: { current: SlashCommandItem[] },\n\tonSelect?: (command: SlashCommandItem) => void,\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => ReactNode,\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => ReactNode,\n) {\n\treturn Extension.create({\n\t\tname: 'slashCommand',\n\t\taddProseMirrorPlugins() {\n\t\t\treturn [\n\t\t\t\tSuggestion({\n\t\t\t\t\teditor: this.editor,\n\t\t\t\t\tchar: '/',\n\t\t\t\t\titems: ({ query }: any) =>\n\t\t\t\t\t\tcommandsRef.current\n\t\t\t\t\t\t\t.filter((c) =>\n\t\t\t\t\t\t\t\tc.label.toLowerCase().includes(query.toLowerCase()),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.slice(0, 20),\n\t\t\t\t\tcommand: ({ editor, range, props }: any) => {\n\t\t\t\t\t\teditor.chain().focus().deleteRange(range).run();\n\t\t\t\t\t\tonSelect?.(props);\n\t\t\t\t\t},\n\t\t\t\t\trender: () => {\n\t\t\t\t\t\tlet component: ReactRenderer;\n\t\t\t\t\t\tlet popup: SuggestionPopup;\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tonStart: (props: any) => {\n\t\t\t\t\t\t\t\tcomponent = new ReactRenderer(SlashCommandMenu, {\n\t\t\t\t\t\t\t\t\tprops: { ...props, renderItem, renderDropdown },\n\t\t\t\t\t\t\t\t\teditor: props.editor,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tpopup = createSuggestionPopup(\n\t\t\t\t\t\t\t\t\tcomponent.element,\n\t\t\t\t\t\t\t\t\tprops.clientRect,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonUpdate: (props: any) => {\n\t\t\t\t\t\t\t\tcomponent.updateProps({ ...props, renderItem, renderDropdown });\n\t\t\t\t\t\t\t\tif (!props.items?.length) {\n\t\t\t\t\t\t\t\t\tpopup.hide();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpopup.show();\n\t\t\t\t\t\t\t\tpopup.updatePosition(props.clientRect);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonKeyDown: (props: any) => {\n\t\t\t\t\t\t\t\tif (props.event.key === 'Escape') {\n\t\t\t\t\t\t\t\t\tpopup.hide();\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn (component.ref as any)?.onKeyDown(props) ?? false;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonExit: () => {\n\t\t\t\t\t\t\t\tpopup.destroy();\n\t\t\t\t\t\t\t\tcomponent.destroy();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t];\n\t\t},\n\t});\n}\n"],"names":["commandsRef","onSelect","renderItem","renderDropdown","Extension","create","name","addProseMirrorPlugins","Suggestion","editor","this","char","items","_ref","query","current","filter","c","label","toLowerCase","includes","slice","command","_ref2","range","props","chain","focus","deleteRange","run","render","component","popup","onStart","ReactRenderer","SlashCommandMenu","createSuggestionPopup","element","clientRect","onUpdate","updateProps","Object","assign","_a","length","show","updatePosition","hide","onKeyDown","event","key","_b","ref","onExit","destroy"],"mappings":"6XAcM,SACLA,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAAA,UAAUC,OAAO,CACvBC,KAAM,eACNC,wBACC,MAAO,CACNC,EAAAA,QAAW,CACVC,OAAQC,KAAKD,OACbE,KAAM,IACNC,MAAOC,IAAA,IAACC,MAAEA,GAAYD,EAAA,OACrBb,EAAYe,QACVC,QAAQC,GACRA,EAAEC,MAAMC,cAAcC,SAASN,EAAMK,iBAErCE,MAAM,EAAG,GAAG,EACfC,QAASC,IAAkC,IAAjCd,OAAEA,EAAMe,MAAEA,EAAKC,MAAEA,GAAYF,EACtCd,EAAOiB,QAAQC,QAAQC,YAAYJ,GAAOK,MAC1C5B,SAAAA,EAAWwB,EAAM,EAElBK,OAAQA,KACP,IAAIC,EACAC,EAEJ,MAAO,CACNC,QAAUR,IACTM,EAAY,IAAIG,EAAaA,cAACC,mBAAkB,CAC/CV,qCAAYA,GAAK,CAAEvB,aAAYC,mBAC/BM,OAAQgB,EAAMhB,SAEfuB,EAAQI,EAAqBA,sBAC5BL,EAAUM,QACVZ,EAAMa,WACN,EAEFC,SAAWd,UACVM,EAAUS,YAAiBC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAjB,IAAOvB,aAAYC,qBAC9B,QAAXwC,EAAAlB,EAAMb,aAAK,IAAA+B,OAAA,EAAAA,EAAEC,SAIlBZ,EAAMa,OACNb,EAAMc,eAAerB,EAAMa,aAJ1BN,EAAMe,MAI+B,EAEvCC,UAAYvB,YACX,MAAwB,WAApBA,EAAMwB,MAAMC,KACflB,EAAMe,QACC,GAE2C,QAA5CI,EAAsB,QAAtBR,EAACZ,EAAUqB,WAAW,IAAAT,OAAA,EAAAA,EAAEK,UAAUvB,UAAU,IAAA0B,GAAAA,CAAK,EAEzDE,OAAQA,KACPrB,EAAMsB,UACNvB,EAAUuB,SAAS,EAEpB,IAIL,GAEF"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../editorDropdown.styles.js");const t=r.forwardRef(((t,s)=>{let{items:o,query:l,command:i,renderItem:c,renderDropdown:a}=t;const[d,u]=r.useState(0),m=r.useRef(null),h=r.useCallback((e=>{const r=m.current;if(!r)return;const n=r.children[e];null==n||n.scrollIntoView({block:"nearest"})}),[]),p=e=>{o[e]&&i(o[e])};return r.useImperativeHandle(s,(()=>({onKeyDown:e=>{let{event:r}=e;return"ArrowUp"===r.key?(u((e=>{const r=(e+o.length-1)%o.length;return h(r),r})),!0):"ArrowDown"===r.key?(u((e=>{const r=(e+1)%o.length;return h(r),r})),!0):"Enter"===r.key&&(p(d),!0)}}))),r.useEffect((()=>u(0)),[o]),o.length?a?e.jsx(e.Fragment,{children:a({items:o,query:l,activeIndex:d,onSelect:e=>i(e)})}):e.jsx(n.DropdownContainer,Object.assign({ref:m},{children:o.map(((r,t)=>e.jsx(n.DropdownItem,Object.assign({$isActive:t===d,onMouseEnter:()=>u(t),onClick:()=>p(t)},{children:c?c(r,t===d):e.jsxs(e.Fragment,{children:[e.jsx(n.SlashLabel,{children:r.label}),r.description&&e.jsx(n.SlashDescription,{children:r.description})]})}),r.id)))})):null}));t.displayName="SlashCommandMenu",exports.SlashCommandMenu=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../editorDropdown.styles.js");const t=r.forwardRef(((t,s)=>{let{items:l,query:o,command:i,renderItem:c,renderDropdown:a}=t;const[d,u]=r.useState(0),h=r.useRef(null),m=r.useCallback((e=>{const r=h.current;if(!r)return;const n=r.children[e];null==n||n.scrollIntoView({block:"nearest"})}),[]),p=e=>{l[e]&&i(l[e])};return r.useImperativeHandle(s,(()=>({onKeyDown:e=>{let{event:r}=e;return!!l.length&&("ArrowUp"===r.key?(u((e=>{const r=(e+l.length-1)%l.length;return m(r),r})),!0):"ArrowDown"===r.key?(u((e=>{const r=(e+1)%l.length;return m(r),r})),!0):"Enter"===r.key&&(p(d),!0))}}))),r.useEffect((()=>u(0)),[l]),l.length?a?e.jsx(e.Fragment,{children:a({items:l,query:o,activeIndex:d,onSelect:e=>i(e)})}):e.jsx(n.DropdownContainer,Object.assign({ref:h},{children:l.map(((r,t)=>e.jsx(n.DropdownItem,Object.assign({$isActive:t===d,onMouseEnter:()=>u(t),onClick:()=>p(t)},{children:c?c(r,t===d):e.jsxs(e.Fragment,{children:[e.jsx(n.SlashLabel,{children:r.label}),r.description&&e.jsx(n.SlashDescription,{children:r.description})]})}),r.id)))})):null}));t.displayName="SlashCommandMenu",exports.SlashCommandMenu=t;
2
2
  //# sourceMappingURL=SlashCommandMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SlashCommandMenu.js","sources":["../../../../../src/editor/extensions/slashCommand/SlashCommandMenu.tsx"],"sourcesContent":["import React, {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport type {\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../../BikEditor.types';\nimport {\n\tDropdownContainer,\n\tDropdownItem,\n\tSlashDescription,\n\tSlashLabel,\n} from '../editorDropdown.styles';\n\ninterface Props {\n\titems: SlashCommandItem[];\n\tquery: string;\n\tcommand: (item: SlashCommandItem) => void;\n\t/** Custom per-row renderer. Receives the item and whether it is the active row. */\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Full custom dropdown renderer. Takes priority over renderItem.\n\t * The editor passes activeIndex and onSelect — you handle all the visual rendering.\n\t */\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => React.ReactNode;\n}\n\nexport const SlashCommandMenu = forwardRef<any, Props>(\n\t({ items, query, command, renderItem, renderDropdown }, ref) => {\n\t\tconst [selectedIndex, setSelectedIndex] = useState(0);\n\t\tconst containerRef = useRef<HTMLDivElement>(null);\n\n\t\tconst scrollToIndex = useCallback((index: number) => {\n\t\t\tconst container = containerRef.current;\n\t\t\tif (!container) return;\n\t\t\tconst item = container.children[index] as HTMLElement | undefined;\n\t\t\titem?.scrollIntoView({ block: 'nearest' });\n\t\t}, []);\n\n\t\tconst select = (i: number) => {\n\t\t\tif (items[i]) command(items[i]);\n\t\t};\n\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tonKeyDown: ({ event }: { event: KeyboardEvent }) => {\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + items.length - 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tselect(selectedIndex);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}));\n\n\t\tuseEffect(() => setSelectedIndex(0), [items]);\n\n\t\tif (!items.length) return null;\n\n\t\t// Full custom dropdown — editor still manages keyboard nav via selectedIndex\n\t\tif (renderDropdown) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{renderDropdown({\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tquery,\n\t\t\t\t\t\tactiveIndex: selectedIndex,\n\t\t\t\t\t\tonSelect: (item) => command(item),\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<DropdownContainer ref={containerRef}>\n\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t$isActive={i === selectedIndex}\n\t\t\t\t\t\tonMouseEnter={() => setSelectedIndex(i)}\n\t\t\t\t\t\tonClick={() => select(i)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderItem ? (\n\t\t\t\t\t\t\trenderItem(item, i === selectedIndex)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<SlashLabel>{item.label}</SlashLabel>\n\t\t\t\t\t\t\t\t{item.description && (\n\t\t\t\t\t\t\t\t\t<SlashDescription>{item.description}</SlashDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t))}\n\t\t\t</DropdownContainer>\n\t\t);\n\t},\n);\nSlashCommandMenu.displayName = 'SlashCommandMenu';\n"],"names":["SlashCommandMenu","forwardRef","_ref","ref","items","query","command","renderItem","renderDropdown","selectedIndex","setSelectedIndex","useState","containerRef","useRef","scrollToIndex","useCallback","index","container","current","item","children","scrollIntoView","block","select","i","useImperativeHandle","onKeyDown","_ref2","event","key","prev","next","length","useEffect","_jsx","_Fragment","activeIndex","onSelect","DropdownContainer","Object","assign","map","DropdownItem","$isActive","onMouseEnter","onClick","_jsxs","jsxs","jsx","SlashLabel","label","description","SlashDescription","id","displayName"],"mappings":"mKAgCO,MAAMA,EAAmBC,EAAUA,YACzC,CAAAC,EAAwDC,KAAO,IAA9DC,MAAEA,EAAKC,MAAEA,EAAKC,QAAEA,EAAOC,WAAEA,EAAUC,eAAEA,GAAgBN,EACrD,MAAOO,EAAeC,GAAoBC,EAAQA,SAAC,GAC7CC,EAAeC,SAAuB,MAEtCC,EAAgBC,EAAWA,aAAEC,IAClC,MAAMC,EAAYL,EAAaM,QAC/B,IAAKD,EAAW,OAChB,MAAME,EAAOF,EAAUG,SAASJ,GAChCG,SAAAA,EAAME,eAAe,CAAEC,MAAO,WAAY,GACxC,IAEGC,EAAUC,IACXpB,EAAMoB,IAAIlB,EAAQF,EAAMoB,GAAG,EA+BhC,OA5BAC,EAAmBA,oBAACtB,GAAK,KAAO,CAC/BuB,UAAWC,IAAwC,IAAvCC,MAAEA,GAAiCD,EAC9C,MAAkB,YAAdC,EAAMC,KACTnB,GAAkBoB,IACjB,MAAMC,GAAQD,EAAO1B,EAAM4B,OAAS,GAAK5B,EAAM4B,OAE/C,OADAlB,EAAciB,GACPA,CAAI,KAEL,GAEU,cAAdH,EAAMC,KACTnB,GAAkBoB,IACjB,MAAMC,GAAQD,EAAO,GAAK1B,EAAM4B,OAEhC,OADAlB,EAAciB,GACPA,CAAI,KAEL,GAEU,UAAdH,EAAMC,MACTN,EAAOd,IACA,EAEI,MAIdwB,EAASA,WAAC,IAAMvB,EAAiB,IAAI,CAACN,IAEjCA,EAAM4B,OAGPxB,EAEF0B,EAAAA,IACEC,EAAAA,SAAA,CAAAf,SAAAZ,EAAe,CACfJ,QACAC,QACA+B,YAAa3B,EACb4B,SAAWlB,GAASb,EAAQa,OAO/Be,MAACI,EAAAA,kBAAiBC,OAAAC,OAAA,CAACrC,IAAKS,aACtBR,EAAMqC,KAAI,CAACtB,EAAMK,IACjBU,MAACQ,EAAAA,aAAYH,OAAAC,OAAA,CAAAG,UAEDnB,IAAMf,EACjBmC,aAAcA,IAAMlC,EAAiBc,GACrCqB,QAASA,IAAMtB,EAAOC,IAAE,CAAAJ,SAEvBb,EACAA,EAAWY,EAAMK,IAAMf,GAEvBqC,EACCC,KAAAZ,WAAA,CAAAf,SAAA,CAAAc,EAAAc,IAACC,aAAY,CAAA7B,SAAAD,EAAK+B,QACjB/B,EAAKgC,aACLjB,EAAAA,IAACkB,EAAAA,iBAAkB,CAAAhC,SAAAD,EAAKgC,mBAXtBhC,EAAKkC,SApBY,IAqCL,IAIvBrD,EAAiBsD,YAAc"}
1
+ {"version":3,"file":"SlashCommandMenu.js","sources":["../../../../../src/editor/extensions/slashCommand/SlashCommandMenu.tsx"],"sourcesContent":["import React, {\n\tforwardRef,\n\tuseCallback,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport type {\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../../BikEditor.types';\nimport {\n\tDropdownContainer,\n\tDropdownItem,\n\tSlashDescription,\n\tSlashLabel,\n} from '../editorDropdown.styles';\n\ninterface Props {\n\titems: SlashCommandItem[];\n\tquery: string;\n\tcommand: (item: SlashCommandItem) => void;\n\t/** Custom per-row renderer. Receives the item and whether it is the active row. */\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Full custom dropdown renderer. Takes priority over renderItem.\n\t * The editor passes activeIndex and onSelect — you handle all the visual rendering.\n\t */\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => React.ReactNode;\n}\n\nexport const SlashCommandMenu = forwardRef<any, Props>(\n\t({ items, query, command, renderItem, renderDropdown }, ref) => {\n\t\tconst [selectedIndex, setSelectedIndex] = useState(0);\n\t\tconst containerRef = useRef<HTMLDivElement>(null);\n\n\t\tconst scrollToIndex = useCallback((index: number) => {\n\t\t\tconst container = containerRef.current;\n\t\t\tif (!container) return;\n\t\t\tconst item = container.children[index] as HTMLElement | undefined;\n\t\t\titem?.scrollIntoView({ block: 'nearest' });\n\t\t}, []);\n\n\t\tconst select = (i: number) => {\n\t\t\tif (items[i]) command(items[i]);\n\t\t};\n\n\t\tuseImperativeHandle(ref, () => ({\n\t\t\tonKeyDown: ({ event }: { event: KeyboardEvent }) => {\n\t\t\t\tif (!items.length) return false;\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + items.length - 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tsetSelectedIndex((prev) => {\n\t\t\t\t\t\tconst next = (prev + 1) % items.length;\n\t\t\t\t\t\tscrollToIndex(next);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tselect(selectedIndex);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}));\n\n\t\tuseEffect(() => setSelectedIndex(0), [items]);\n\n\t\tif (!items.length) return null;\n\n\t\t// Full custom dropdown — editor still manages keyboard nav via selectedIndex\n\t\tif (renderDropdown) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{renderDropdown({\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tquery,\n\t\t\t\t\t\tactiveIndex: selectedIndex,\n\t\t\t\t\t\tonSelect: (item) => command(item),\n\t\t\t\t\t})}\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<DropdownContainer ref={containerRef}>\n\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t$isActive={i === selectedIndex}\n\t\t\t\t\t\tonMouseEnter={() => setSelectedIndex(i)}\n\t\t\t\t\t\tonClick={() => select(i)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderItem ? (\n\t\t\t\t\t\t\trenderItem(item, i === selectedIndex)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<SlashLabel>{item.label}</SlashLabel>\n\t\t\t\t\t\t\t\t{item.description && (\n\t\t\t\t\t\t\t\t\t<SlashDescription>{item.description}</SlashDescription>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t))}\n\t\t\t</DropdownContainer>\n\t\t);\n\t},\n);\nSlashCommandMenu.displayName = 'SlashCommandMenu';\n"],"names":["SlashCommandMenu","forwardRef","_ref","ref","items","query","command","renderItem","renderDropdown","selectedIndex","setSelectedIndex","useState","containerRef","useRef","scrollToIndex","useCallback","index","container","current","item","children","scrollIntoView","block","select","i","useImperativeHandle","onKeyDown","_ref2","event","length","key","prev","next","useEffect","_jsx","_Fragment","activeIndex","onSelect","DropdownContainer","Object","assign","map","DropdownItem","$isActive","onMouseEnter","onClick","_jsxs","jsxs","jsx","SlashLabel","label","description","SlashDescription","id","displayName"],"mappings":"mKAgCO,MAAMA,EAAmBC,EAAUA,YACzC,CAAAC,EAAwDC,KAAO,IAA9DC,MAAEA,EAAKC,MAAEA,EAAKC,QAAEA,EAAOC,WAAEA,EAAUC,eAAEA,GAAgBN,EACrD,MAAOO,EAAeC,GAAoBC,EAAQA,SAAC,GAC7CC,EAAeC,SAAuB,MAEtCC,EAAgBC,EAAWA,aAAEC,IAClC,MAAMC,EAAYL,EAAaM,QAC/B,IAAKD,EAAW,OAChB,MAAME,EAAOF,EAAUG,SAASJ,GAChCG,SAAAA,EAAME,eAAe,CAAEC,MAAO,WAAY,GACxC,IAEGC,EAAUC,IACXpB,EAAMoB,IAAIlB,EAAQF,EAAMoB,GAAG,EAgChC,OA7BAC,EAAmBA,oBAACtB,GAAK,KAAO,CAC/BuB,UAAWC,IAAwC,IAAvCC,MAAEA,GAAiCD,EAC9C,QAAKvB,EAAMyB,SACO,YAAdD,EAAME,KACTpB,GAAkBqB,IACjB,MAAMC,GAAQD,EAAO3B,EAAMyB,OAAS,GAAKzB,EAAMyB,OAE/C,OADAf,EAAckB,GACPA,CAAI,KAEL,GAEU,cAAdJ,EAAME,KACTpB,GAAkBqB,IACjB,MAAMC,GAAQD,EAAO,GAAK3B,EAAMyB,OAEhC,OADAf,EAAckB,GACPA,CAAI,KAEL,GAEU,UAAdJ,EAAME,MACTP,EAAOd,IACA,GAEI,MAIdwB,EAASA,WAAC,IAAMvB,EAAiB,IAAI,CAACN,IAEjCA,EAAMyB,OAGPrB,EAEF0B,EAAAA,IACEC,EAAAA,SAAA,CAAAf,SAAAZ,EAAe,CACfJ,QACAC,QACA+B,YAAa3B,EACb4B,SAAWlB,GAASb,EAAQa,OAO/Be,MAACI,EAAAA,kBAAiBC,OAAAC,OAAA,CAACrC,IAAKS,aACtBR,EAAMqC,KAAI,CAACtB,EAAMK,IACjBU,MAACQ,EAAAA,aAAYH,OAAAC,OAAA,CAAAG,UAEDnB,IAAMf,EACjBmC,aAAcA,IAAMlC,EAAiBc,GACrCqB,QAASA,IAAMtB,EAAOC,IAAE,CAAAJ,SAEvBb,EACAA,EAAWY,EAAMK,IAAMf,GAEvBqC,EACCC,KAAAZ,WAAA,CAAAf,SAAA,CAAAc,EAAAc,IAACC,aAAY,CAAA7B,SAAAD,EAAK+B,QACjB/B,EAAKgC,aACLjB,EAAAA,IAACkB,EAAAA,iBAAkB,CAAAhC,SAAAD,EAAKgC,mBAXtBhC,EAAKkC,SApBY,IAqCL,IAIvBrD,EAAiBsD,YAAc"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.createSuggestionPopup=function(e,t){const o=document.createElement("div");o.style.cssText="position:fixed;z-index:9999;pointer-events:auto;",o.appendChild(e),document.body.appendChild(o);let n=t;function i(){const e=null==n?void 0:n();if(!e)return;const t=o.offsetHeight,i=o.offsetWidth,s=window.innerHeight,d=window.innerWidth,p=s-e.bottom-4,r=e.top-4,l=p>=t?e.bottom+4:r>=t?e.top-4-t:4,c=Math.min(e.left,d-i-4);o.style.left=`${Math.max(4,c)}px`,o.style.top=`${l}px`}const s=new ResizeObserver(i);return s.observe(o),i(),{element:o,show(){o.style.display=""},hide(){o.style.display="none"},destroy(){s.disconnect(),o.remove()},updatePosition(e){n=e,i()}}};
2
+ //# sourceMappingURL=suggestionPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestionPopup.js","sources":["../../../../src/editor/extensions/suggestionPopup.ts"],"sourcesContent":["/**\n * Lightweight popup positioner for suggestion dropdowns (mentions, slash commands).\n * Replaces tippy.js — all we need is a positioned container near the cursor\n * that flips above when there isn't enough room below.\n */\n\nconst GAP = 4;\n\nexport interface SuggestionPopup {\n\tshow(): void;\n\thide(): void;\n\tdestroy(): void;\n\tupdatePosition(clientRect: () => DOMRect | null): void;\n\treadonly element: HTMLDivElement;\n}\n\nexport function createSuggestionPopup(\n\tcontent: HTMLElement,\n\tclientRect: (() => DOMRect | null) | null,\n): SuggestionPopup {\n\tconst wrapper = document.createElement('div');\n\twrapper.style.cssText = 'position:fixed;z-index:9999;pointer-events:auto;';\n\twrapper.appendChild(content);\n\tdocument.body.appendChild(wrapper);\n\n\tlet latestRectFn: (() => DOMRect | null) | null = clientRect;\n\n\tfunction reposition() {\n\t\tconst rect = latestRectFn?.();\n\t\tif (!rect) return;\n\n\t\tconst popupHeight = wrapper.offsetHeight;\n\t\tconst popupWidth = wrapper.offsetWidth;\n\t\tconst viewportH = window.innerHeight;\n\t\tconst viewportW = window.innerWidth;\n\n\t\tconst spaceBelow = viewportH - rect.bottom - GAP;\n\t\tconst spaceAbove = rect.top - GAP;\n\t\tconst fitsBelow = spaceBelow >= popupHeight;\n\n\t\tconst top = fitsBelow\n\t\t\t? rect.bottom + GAP\n\t\t\t: spaceAbove >= popupHeight\n\t\t\t? rect.top - GAP - popupHeight\n\t\t\t: GAP;\n\n\t\tconst left = Math.min(rect.left, viewportW - popupWidth - GAP);\n\n\t\twrapper.style.left = `${Math.max(GAP, left)}px`;\n\t\twrapper.style.top = `${top}px`;\n\t}\n\n\tconst observer = new ResizeObserver(reposition);\n\tobserver.observe(wrapper);\n\n\treposition();\n\n\treturn {\n\t\telement: wrapper,\n\t\tshow() {\n\t\t\twrapper.style.display = '';\n\t\t},\n\t\thide() {\n\t\t\twrapper.style.display = 'none';\n\t\t},\n\t\tdestroy() {\n\t\t\tobserver.disconnect();\n\t\t\twrapper.remove();\n\t\t},\n\t\tupdatePosition(getRectFn: () => DOMRect | null) {\n\t\t\tlatestRectFn = getRectFn;\n\t\t\treposition();\n\t\t},\n\t};\n}\n"],"names":["content","clientRect","wrapper","document","createElement","style","cssText","appendChild","body","latestRectFn","reposition","rect","popupHeight","offsetHeight","popupWidth","offsetWidth","viewportH","window","innerHeight","viewportW","innerWidth","spaceBelow","bottom","spaceAbove","top","left","Math","min","max","observer","ResizeObserver","observe","element","show","display","hide","destroy","disconnect","remove","updatePosition","getRectFn"],"mappings":"kGAgBgB,SACfA,EACAC,GAEA,MAAMC,EAAUC,SAASC,cAAc,OACvCF,EAAQG,MAAMC,QAAU,mDACxBJ,EAAQK,YAAYP,GACpBG,SAASK,KAAKD,YAAYL,GAE1B,IAAIO,EAA8CR,EAElD,SAASS,IACR,MAAMC,EAAOF,aAAA,EAAAA,IACb,IAAKE,EAAM,OAEX,MAAMC,EAAcV,EAAQW,aACtBC,EAAaZ,EAAQa,YACrBC,EAAYC,OAAOC,YACnBC,EAAYF,OAAOG,WAEnBC,EAAaL,EAAYL,EAAKW,OA9B1B,EA+BJC,EAAaZ,EAAKa,IA/Bd,EAkCJA,EAFYH,GAAcT,EAG7BD,EAAKW,OAnCE,EAoCPC,GAAcX,EACdD,EAAKa,IArCE,EAqCUZ,EArCV,EAwCJa,EAAOC,KAAKC,IAAIhB,EAAKc,KAAMN,EAAYL,EAxCnC,GA0CVZ,EAAQG,MAAMoB,KAAU,GAAAC,KAAKE,IA1CnB,EA0C4BH,OACtCvB,EAAQG,MAAMmB,IAAS,GAAAA,KACxB,CAEA,MAAMK,EAAW,IAAIC,eAAepB,GAKpC,OAJAmB,EAASE,QAAQ7B,GAEjBQ,IAEO,CACNsB,QAAS9B,EACT+B,OACC/B,EAAQG,MAAM6B,QAAU,EACxB,EACDC,OACCjC,EAAQG,MAAM6B,QAAU,MACxB,EACDE,UACCP,EAASQ,aACTnC,EAAQoC,QACR,EACDC,eAAeC,GACd/B,EAAe+B,EACf9B,GACD,EAEF"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");exports.LinkBubbleMenu=t=>{let{editor:o,renderLinkTooltip:r}=t;const[i,s]=n.useState(null),l=n.useRef(null),a=n.useCallback((()=>s(null)),[]);if(n.useEffect((()=>{const e=o.view.dom,n=n=>{var t,o;if(!e.contains(n.target))return;const r=n.target.closest("a");r?(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),s({href:null!==(t=r.getAttribute("href"))&&void 0!==t?t:"",text:null!==(o=r.textContent)&&void 0!==o?o:"",rect:r.getBoundingClientRect()})):a()},t=n=>{var t;const o=n.target;e.contains(o)||(null===(t=l.current)||void 0===t?void 0:t.contains(o))||a()},r=()=>a();return document.addEventListener("click",n,{capture:!0}),document.addEventListener("mousedown",t),e.addEventListener("keydown",r),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",t),e.removeEventListener("keydown",r)}}),[o,a]),!i)return null;const{href:d,text:c,rect:u}=i,p=()=>window.open(d,"_blank","noopener,noreferrer"),x=()=>{o.chain().focus().extendMarkRange("link").unsetLink().run(),a()};return e.jsx("div",Object.assign({ref:l},{children:r?r({href:d,text:c,rect:u,onOpen:p,onRemove:x,onHide:a}):e.jsxs("div",Object.assign({className:"bik-link-bubble",style:{position:"fixed",top:u.bottom+8,left:u.left,zIndex:9999,background:"#fff",border:"1px solid #dee2e6",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"6px 10px",display:"flex",alignItems:"center",gap:8,fontSize:13}},{children:[e.jsxs("span",Object.assign({style:{display:"inline-flex",alignItems:"center",gap:4,color:"#4f46e5",maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[e.jsxs("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})),d.length>40?d.slice(0,40)+"…":d]})),e.jsx("button",Object.assign({onMouseDown:e=>{e.preventDefault(),p()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:12,color:"#495057"}},{children:"Open ↗"})),e.jsx("span",Object.assign({style:{color:"#dee2e6"}},{children:"|"})),e.jsx("button",Object.assign({onMouseDown:e=>{e.preventDefault(),x()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:12,color:"#dc3545"}},{children:"Remove"}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react");exports.LinkBubbleMenu=t=>{let{editor:o,renderLinkTooltip:r}=t;const[i,s]=n.useState(null),l=n.useRef(null),a=n.useCallback((()=>s(null)),[]);if(n.useEffect((()=>{const e=o.view.dom,n=n=>{var t,o,r;if(!e.contains(n.target))return;const i=n.target,l=i instanceof Element?i:i.parentElement,d=null!==(t=null==l?void 0:l.closest("a"))&&void 0!==t?t:null;d?(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),s({href:null!==(o=d.getAttribute("href"))&&void 0!==o?o:"",text:null!==(r=d.textContent)&&void 0!==r?r:"",rect:d.getBoundingClientRect()})):a()},t=n=>{var t;const o=n.target;e.contains(o)||(null===(t=l.current)||void 0===t?void 0:t.contains(o))||a()},r=()=>a();return document.addEventListener("click",n,{capture:!0}),document.addEventListener("mousedown",t),e.addEventListener("keydown",r),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",t),e.removeEventListener("keydown",r)}}),[o,a]),!i)return null;const{href:d,text:c,rect:u}=i,p=()=>window.open(d,"_blank","noopener,noreferrer"),x=()=>{o.chain().focus().extendMarkRange("link").unsetLink().run(),a()};return e.jsx("div",Object.assign({ref:l},{children:r?r({href:d,text:c,rect:u,onOpen:p,onRemove:x,onHide:a}):e.jsxs("div",Object.assign({className:"bik-link-bubble",style:{position:"fixed",top:u.bottom+8,left:u.left,zIndex:9999,background:"#fff",border:"1px solid #dee2e6",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"6px 10px",display:"flex",alignItems:"center",gap:8,fontSize:13}},{children:[e.jsxs("span",Object.assign({style:{display:"inline-flex",alignItems:"center",gap:4,color:"#4f46e5",maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{children:[e.jsxs("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})),d.length>40?d.slice(0,40)+"…":d]})),e.jsx("button",Object.assign({onMouseDown:e=>{e.preventDefault(),p()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:12,color:"#495057"}},{children:"Open ↗"})),e.jsx("span",Object.assign({style:{color:"#dee2e6"}},{children:"|"})),e.jsx("button",Object.assign({onMouseDown:e=>{e.preventDefault(),x()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:12,color:"#dc3545"}},{children:"Remove"}))]}))}))};
2
2
  //# sourceMappingURL=LinkBubbleMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkBubbleMenu.js","sources":["../../../../src/editor/floating/LinkBubbleMenu.tsx"],"sourcesContent":["import { Editor } from '@tiptap/core';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { LinkTooltipProps } from '../BikEditor.types';\n\ninterface Props {\n\teditor: Editor;\n\trenderLinkTooltip?: (props: LinkTooltipProps) => React.ReactNode;\n}\n\ninterface LinkState {\n\thref: string;\n\ttext: string;\n\trect: DOMRect;\n}\n\n/**\n * Shows a tooltip when the user **clicks** a hyperlink inside the editor.\n * Hides on click outside the editor/bubble or on any keypress.\n * Does NOT trigger on cursor movement or keyboard navigation.\n */\nexport const LinkBubbleMenu: React.FC<Props> = ({\n\teditor,\n\trenderLinkTooltip,\n}) => {\n\tconst [link, setLink] = useState<LinkState | null>(null);\n\tconst bubbleRef = useRef<HTMLDivElement>(null);\n\n\tconst hide = useCallback(() => setLink(null), []);\n\n\tuseEffect(() => {\n\t\tconst dom = editor.view.dom;\n\n\t\t// Use document-level capture so we fire before ANY other listener on the\n\t\t// page — ProseMirror, browser defaults, and Storybook iframes included.\n\t\tconst handleCaptureClick = (e: MouseEvent) => {\n\t\t\t// Only act on clicks that land inside the editor\n\t\t\tif (!dom.contains(e.target as Node)) return;\n\n\t\t\tconst linkEl = (e.target as Element).closest('a');\n\t\t\tif (!linkEl) {\n\t\t\t\thide();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prevent browser href navigation\n\t\t\te.preventDefault();\n\t\t\t// Prevent the event reaching ProseMirror's bubble-phase handlers\n\t\t\te.stopPropagation();\n\t\t\te.stopImmediatePropagation();\n\n\t\t\tsetLink({\n\t\t\t\thref: linkEl.getAttribute('href') ?? '',\n\t\t\t\ttext: linkEl.textContent ?? '',\n\t\t\t\trect: linkEl.getBoundingClientRect(),\n\t\t\t});\n\t\t};\n\n\t\t// Hide when clicking outside both the editor and the bubble\n\t\tconst handleDocumentMousedown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as Node;\n\t\t\tif (!dom.contains(target) && !bubbleRef.current?.contains(target)) {\n\t\t\t\thide();\n\t\t\t}\n\t\t};\n\n\t\t// Hide on any keypress — user is typing or navigating away\n\t\tconst handleKeyDown = () => hide();\n\n\t\t// { capture: true } on document — fires before every other listener\n\t\tdocument.addEventListener('click', handleCaptureClick, { capture: true });\n\t\tdocument.addEventListener('mousedown', handleDocumentMousedown);\n\t\tdom.addEventListener('keydown', handleKeyDown);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('click', handleCaptureClick, {\n\t\t\t\tcapture: true,\n\t\t\t});\n\t\t\tdocument.removeEventListener('mousedown', handleDocumentMousedown);\n\t\t\tdom.removeEventListener('keydown', handleKeyDown);\n\t\t};\n\t}, [editor, hide]);\n\n\tif (!link) return null;\n\n\tconst { href, text, rect } = link;\n\n\tconst onOpen = () => window.open(href, '_blank', 'noopener,noreferrer');\n\tconst onRemove = () => {\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\thide();\n\t};\n\n\t// The <div ref={bubbleRef}> wrapper is what we check for outside-click detection.\n\t// Consumer tooltips use position:fixed internally but remain DOM descendants of\n\t// this wrapper, so bubbleRef.contains() correctly identifies clicks inside them.\n\treturn (\n\t\t<div ref={bubbleRef}>\n\t\t\t{renderLinkTooltip ? (\n\t\t\t\trenderLinkTooltip({ href, text, rect, onOpen, onRemove, onHide: hide })\n\t\t\t) : (\n\t\t\t\t// Built-in fallback: shows href + Open + Remove.\n\t\t\t\t// Use renderLinkTooltip to add an Edit button or custom styling.\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"bik-link-bubble\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\ttop: rect.bottom + 8,\n\t\t\t\t\t\tleft: rect.left,\n\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\t\tborder: '1px solid #dee2e6',\n\t\t\t\t\t\tborderRadius: 6,\n\t\t\t\t\t\tboxShadow: '0 4px 12px rgba(0,0,0,0.15)',\n\t\t\t\t\t\tpadding: '6px 10px',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\tfontSize: 13,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\tcolor: '#4f46e5',\n\t\t\t\t\t\t\tmaxWidth: 220,\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\ttextOverflow: 'ellipsis',\n\t\t\t\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"14\"\n\t\t\t\t\t\t\theight=\"14\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n\t\t\t\t\t\t\t<path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t{href.length > 40 ? href.slice(0, 40) + '…' : href}\n\t\t\t\t\t</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\tonMouseDown={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tonOpen();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackground: 'none',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\tpadding: '2px 4px',\n\t\t\t\t\t\t\tfontSize: 12,\n\t\t\t\t\t\t\tcolor: '#495057',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tOpen ↗\n\t\t\t\t\t</button>\n\t\t\t\t\t<span style={{ color: '#dee2e6' }}>|</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\tonMouseDown={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackground: 'none',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\tpadding: '2px 4px',\n\t\t\t\t\t\t\tfontSize: 12,\n\t\t\t\t\t\t\tcolor: '#dc3545',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tRemove\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["_ref","editor","renderLinkTooltip","link","setLink","useState","bubbleRef","useRef","hide","useCallback","useEffect","dom","view","handleCaptureClick","e","contains","target","linkEl","closest","preventDefault","stopPropagation","stopImmediatePropagation","href","getAttribute","_a","text","_b","textContent","rect","getBoundingClientRect","handleDocumentMousedown","current","handleKeyDown","document","addEventListener","capture","removeEventListener","onOpen","window","open","onRemove","chain","focus","extendMarkRange","unsetLink","run","_jsx","Object","assign","ref","children","onHide","_jsxs","className","style","position","top","bottom","left","zIndex","background","border","borderRadius","boxShadow","padding","display","alignItems","gap","fontSize","jsxs","color","maxWidth","overflow","textOverflow","whiteSpace","width","height","viewBox","fill","stroke","strokeWidth","jsx","d","length","slice","onMouseDown","cursor"],"mappings":"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"}
1
+ {"version":3,"file":"LinkBubbleMenu.js","sources":["../../../../src/editor/floating/LinkBubbleMenu.tsx"],"sourcesContent":["import { Editor } from '@tiptap/core';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { LinkTooltipProps } from '../BikEditor.types';\n\ninterface Props {\n\teditor: Editor;\n\trenderLinkTooltip?: (props: LinkTooltipProps) => React.ReactNode;\n}\n\ninterface LinkState {\n\thref: string;\n\ttext: string;\n\trect: DOMRect;\n}\n\n/**\n * Shows a tooltip when the user **clicks** a hyperlink inside the editor.\n * Hides on click outside the editor/bubble or on any keypress.\n * Does NOT trigger on cursor movement or keyboard navigation.\n */\nexport const LinkBubbleMenu: React.FC<Props> = ({\n\teditor,\n\trenderLinkTooltip,\n}) => {\n\tconst [link, setLink] = useState<LinkState | null>(null);\n\tconst bubbleRef = useRef<HTMLDivElement>(null);\n\n\tconst hide = useCallback(() => setLink(null), []);\n\n\tuseEffect(() => {\n\t\tconst dom = editor.view.dom;\n\n\t\t// Use document-level capture so we fire before ANY other listener on the\n\t\t// page — ProseMirror, browser defaults, and Storybook iframes included.\n\t\tconst handleCaptureClick = (e: MouseEvent) => {\n\t\t\t// Only act on clicks that land inside the editor\n\t\t\tif (!dom.contains(e.target as Node)) return;\n\n\t\t\tconst target = e.target as Node;\n\t\t\tconst el = target instanceof Element ? target : target.parentElement;\n\t\t\tconst linkEl = el?.closest('a') ?? null;\n\t\t\tif (!linkEl) {\n\t\t\t\thide();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prevent browser href navigation\n\t\t\te.preventDefault();\n\t\t\t// Prevent the event reaching ProseMirror's bubble-phase handlers\n\t\t\te.stopPropagation();\n\t\t\te.stopImmediatePropagation();\n\n\t\t\tsetLink({\n\t\t\t\thref: linkEl.getAttribute('href') ?? '',\n\t\t\t\ttext: linkEl.textContent ?? '',\n\t\t\t\trect: linkEl.getBoundingClientRect(),\n\t\t\t});\n\t\t};\n\n\t\t// Hide when clicking outside both the editor and the bubble\n\t\tconst handleDocumentMousedown = (e: MouseEvent) => {\n\t\t\tconst target = e.target as Node;\n\t\t\tif (!dom.contains(target) && !bubbleRef.current?.contains(target)) {\n\t\t\t\thide();\n\t\t\t}\n\t\t};\n\n\t\t// Hide on any keypress — user is typing or navigating away\n\t\tconst handleKeyDown = () => hide();\n\n\t\t// { capture: true } on document — fires before every other listener\n\t\tdocument.addEventListener('click', handleCaptureClick, { capture: true });\n\t\tdocument.addEventListener('mousedown', handleDocumentMousedown);\n\t\tdom.addEventListener('keydown', handleKeyDown);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('click', handleCaptureClick, {\n\t\t\t\tcapture: true,\n\t\t\t});\n\t\t\tdocument.removeEventListener('mousedown', handleDocumentMousedown);\n\t\t\tdom.removeEventListener('keydown', handleKeyDown);\n\t\t};\n\t}, [editor, hide]);\n\n\tif (!link) return null;\n\n\tconst { href, text, rect } = link;\n\n\tconst onOpen = () => window.open(href, '_blank', 'noopener,noreferrer');\n\tconst onRemove = () => {\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\thide();\n\t};\n\n\t// The <div ref={bubbleRef}> wrapper is what we check for outside-click detection.\n\t// Consumer tooltips use position:fixed internally but remain DOM descendants of\n\t// this wrapper, so bubbleRef.contains() correctly identifies clicks inside them.\n\treturn (\n\t\t<div ref={bubbleRef}>\n\t\t\t{renderLinkTooltip ? (\n\t\t\t\trenderLinkTooltip({ href, text, rect, onOpen, onRemove, onHide: hide })\n\t\t\t) : (\n\t\t\t\t// Built-in fallback: shows href + Open + Remove.\n\t\t\t\t// Use renderLinkTooltip to add an Edit button or custom styling.\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"bik-link-bubble\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\ttop: rect.bottom + 8,\n\t\t\t\t\t\tleft: rect.left,\n\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\t\tborder: '1px solid #dee2e6',\n\t\t\t\t\t\tborderRadius: 6,\n\t\t\t\t\t\tboxShadow: '0 4px 12px rgba(0,0,0,0.15)',\n\t\t\t\t\t\tpadding: '6px 10px',\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\tfontSize: 13,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\tcolor: '#4f46e5',\n\t\t\t\t\t\t\tmaxWidth: 220,\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\ttextOverflow: 'ellipsis',\n\t\t\t\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"14\"\n\t\t\t\t\t\t\theight=\"14\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n\t\t\t\t\t\t\t<path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t{href.length > 40 ? href.slice(0, 40) + '…' : href}\n\t\t\t\t\t</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\tonMouseDown={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tonOpen();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackground: 'none',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\tpadding: '2px 4px',\n\t\t\t\t\t\t\tfontSize: 12,\n\t\t\t\t\t\t\tcolor: '#495057',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tOpen ↗\n\t\t\t\t\t</button>\n\t\t\t\t\t<span style={{ color: '#dee2e6' }}>|</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\tonMouseDown={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackground: 'none',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\tpadding: '2px 4px',\n\t\t\t\t\t\t\tfontSize: 12,\n\t\t\t\t\t\t\tcolor: '#dc3545',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tRemove\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["_ref","editor","renderLinkTooltip","link","setLink","useState","bubbleRef","useRef","hide","useCallback","useEffect","dom","view","handleCaptureClick","e","contains","target","el","Element","parentElement","linkEl","_a","closest","preventDefault","stopPropagation","stopImmediatePropagation","href","getAttribute","_b","text","_c","textContent","rect","getBoundingClientRect","handleDocumentMousedown","current","handleKeyDown","document","addEventListener","capture","removeEventListener","onOpen","window","open","onRemove","chain","focus","extendMarkRange","unsetLink","run","_jsx","Object","assign","ref","children","onHide","_jsxs","className","style","position","top","bottom","left","zIndex","background","border","borderRadius","boxShadow","padding","display","alignItems","gap","fontSize","jsxs","color","maxWidth","overflow","textOverflow","whiteSpace","width","height","viewBox","fill","stroke","strokeWidth","jsx","d","length","slice","onMouseDown","cursor"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");const t=t=>{let{active:l,onPress:s,label:i}=t;return e.jsx("button",Object.assign({type:"button",title:i,className:"bik-toolbar-btn"+(l?" bik-toolbar-btn--active":""),onMouseDown:e=>{e.preventDefault(),s()}},{children:i}))};exports.BikEditorToolbar=l=>{let{editorRef:s,activeFormats:i,showBold:n=!0,showItalic:r=!0,showUnderline:o=!0,showStrike:a=!0,showLink:c=!0,showLists:d=!0,showAlignment:b=!1,showFontPicker:g=!1,onLinkButtonClick:v}=l;var u;const x=null===(u=s.current)||void 0===u?void 0:u.actions;return x?e.jsxs("div",Object.assign({className:"bik-editor-toolbar"},{children:[n&&e.jsx(t,{active:i.bold,onPress:x.toggleBold,label:"Bold"}),r&&e.jsx(t,{active:i.italic,onPress:x.toggleItalic,label:"Italic"}),o&&e.jsx(t,{active:i.underline,onPress:x.toggleUnderline,label:"Underline"}),a&&e.jsx(t,{active:i.strike,onPress:x.toggleStrike,label:"Strike"}),c&&e.jsx(t,{active:!!i.link,onPress:()=>{var e,t,l,n;const r=null!==(t=null===(e=s.current)||void 0===e?void 0:e.getSelectedText())&&void 0!==t?t:"",o=null!==(n=null===(l=i.link)||void 0===l?void 0:l.href)&&void 0!==n?n:null;null==v||v(r,o)},label:"Link"}),d&&e.jsxs(e.Fragment,{children:[e.jsx(t,{active:i.bulletList,onPress:x.toggleBulletList,label:"Bullet"}),e.jsx(t,{active:i.orderedList,onPress:x.toggleOrderedList,label:"Ordered"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(t,{active:"left"===i.textAlign,onPress:()=>x.setTextAlign("left"),label:"Left"}),e.jsx(t,{active:"center"===i.textAlign,onPress:()=>x.setTextAlign("center"),label:"Center"}),e.jsx(t,{active:"right"===i.textAlign,onPress:()=>x.setTextAlign("right"),label:"Right"})]})]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");const t=t=>{let{active:l,onPress:s,label:i}=t;return e.jsx("button",Object.assign({type:"button",title:i,className:"bik-toolbar-btn"+(l?" bik-toolbar-btn--active":""),onMouseDown:e=>{e.preventDefault(),s()}},{children:i}))};exports.BikEditorToolbar=l=>{let{editorRef:s,activeFormats:i,showBold:n=!0,showItalic:r=!0,showUnderline:o=!0,showStrike:a=!0,showLink:c=!0,showLists:d=!0,showAlignment:b=!1,showFontPicker:g=!1,onLinkButtonClick:v}=l;var u;const x=null===(u=s.current)||void 0===u?void 0:u.actions;return x?e.jsxs("div",Object.assign({className:"bik-editor-toolbar"},{children:[n&&e.jsx(t,{active:i.bold,onPress:x.toggleBold,label:"Bold"}),r&&e.jsx(t,{active:i.italic,onPress:x.toggleItalic,label:"Italic"}),o&&e.jsx(t,{active:i.underline,onPress:x.toggleUnderline,label:"Underline"}),a&&e.jsx(t,{active:i.strike,onPress:x.toggleStrike,label:"Strike"}),c&&e.jsx(t,{active:!!i.link,onPress:()=>{var e,t,l,n;const r=null!==(t=null===(e=s.current)||void 0===e?void 0:e.getSelectedText())&&void 0!==t?t:"",o=null!==(n=null===(l=i.link)||void 0===l?void 0:l.href)&&void 0!==n?n:null;null==v||v(r,o)},label:"Link"}),d&&e.jsxs(e.Fragment,{children:[e.jsx(t,{active:i.bulletList,onPress:x.toggleBulletList,label:"Bullet"}),e.jsx(t,{active:i.orderedList,onPress:x.toggleOrderedList,label:"Ordered"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(t,{active:"left"===i.textAlign,onPress:()=>x.setTextAlign("left"),label:"Left"}),e.jsx(t,{active:"center"===i.textAlign,onPress:()=>x.setTextAlign("center"),label:"Center"}),e.jsx(t,{active:"right"===i.textAlign,onPress:()=>x.setTextAlign("right"),label:"Right"})]})]})):null};
2
2
  //# sourceMappingURL=BikEditorToolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditorToolbar.js","sources":["../../../../src/editor/toolbar/BikEditorToolbar.tsx"],"sourcesContent":["import React from 'react';\nimport type { BikEditorRef, FormatState } from '../BikEditor.types';\n\n/**\n * Props for `<BikEditorToolbar />`.\n *\n * All `show*` props default to `true` except `showAlignment`, `showFontPicker`,\n * and `showColorPicker` which default to `false`.\n */\ninterface Props {\n\t/** The same ref you passed to `<BikEditor ref={...} />`. Required. */\n\teditorRef: React.RefObject<BikEditorRef>;\n\t/**\n\t * Active format snapshot. Keep this in state, updated via `onSelectionChange`.\n\t *\n\t * @example\n\t * const [formats, setFormats] = useState(DEFAULT_ACTIVE_FORMATS);\n\t * <BikEditor onSelectionChange={setFormats} ... />\n\t * <BikEditorToolbar activeFormats={formats} ... />\n\t */\n\tactiveFormats: FormatState;\n\t/** Show the Bold button. Default `true`. */\n\tshowBold?: boolean;\n\t/** Show the Italic button. Default `true`. */\n\tshowItalic?: boolean;\n\t/** Show the Underline button. Default `true`. */\n\tshowUnderline?: boolean;\n\t/** Show the Strikethrough button. Default `true`. */\n\tshowStrike?: boolean;\n\t/** Show the Link button. Default `true`. */\n\tshowLink?: boolean;\n\t/** Show Bullet and Ordered list buttons. Default `true`. */\n\tshowLists?: boolean;\n\t/** Show Left / Center / Right alignment buttons. Default `false`. */\n\tshowAlignment?: boolean;\n\t/** Reserved — renders nothing yet. Default `false`. */\n\tshowFontPicker?: boolean;\n\t/** Reserved — renders nothing yet. Default `false`. */\n\tshowColorPicker?: boolean;\n\t/**\n\t * Called when the user clicks the Link button.\n\t *\n\t * - `selectedText` — the selected text, or the full text of the link the cursor\n\t * is already inside (useful for pre-filling the \"Text\" field of your modal).\n\t * - `currentHref` — non-null when the cursor is inside an existing link\n\t * (useful for pre-filling the \"URL\" field).\n\t *\n\t * After the user saves, call `editorRef.current?.actions.setLink(href, text)`.\n\t */\n\tonLinkButtonClick?: (\n\t\tselectedText: string,\n\t\tcurrentHref: string | null,\n\t) => void;\n}\n\nexport const BikEditorToolbar: React.FC<Props> = ({\n\teditorRef,\n\tactiveFormats,\n\tshowBold = true,\n\tshowItalic = true,\n\tshowUnderline = true,\n\tshowStrike = true,\n\tshowLink = true,\n\tshowLists = true,\n\tshowAlignment = false,\n\tshowFontPicker = false,\n\tonLinkButtonClick,\n}) => {\n\tconst act = editorRef.current?.actions;\n\tif (!act) return null;\n\n\treturn (\n\t\t<div className=\"bik-editor-toolbar\">\n\t\t\t{showBold && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.bold}\n\t\t\t\t\tonPress={act.toggleBold}\n\t\t\t\t\tlabel=\"Bold\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showItalic && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.italic}\n\t\t\t\t\tonPress={act.toggleItalic}\n\t\t\t\t\tlabel=\"Italic\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showUnderline && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.underline}\n\t\t\t\t\tonPress={act.toggleUnderline}\n\t\t\t\t\tlabel=\"Underline\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showStrike && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.strike}\n\t\t\t\t\tonPress={act.toggleStrike}\n\t\t\t\t\tlabel=\"Strike\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showLink && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={!!activeFormats.link}\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tconst selectedText = editorRef.current?.getSelectedText() ?? '';\n\t\t\t\t\t\tconst currentHref = activeFormats.link?.href ?? null;\n\t\t\t\t\t\tonLinkButtonClick?.(selectedText, currentHref);\n\t\t\t\t\t}}\n\t\t\t\t\tlabel=\"Link ↗\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showLists && (\n\t\t\t\t<>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.bulletList}\n\t\t\t\t\t\tonPress={act.toggleBulletList}\n\t\t\t\t\t\tlabel=\"Bullet\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.orderedList}\n\t\t\t\t\t\tonPress={act.toggleOrderedList}\n\t\t\t\t\t\tlabel=\"Ordered\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{showAlignment && (\n\t\t\t\t<>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'left'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('left')}\n\t\t\t\t\t\tlabel=\"Left\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'center'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('center')}\n\t\t\t\t\t\tlabel=\"Center\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'right'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('right')}\n\t\t\t\t\t\tlabel=\"Right\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst Btn: React.FC<{\n\tactive: boolean;\n\tonPress: () => void;\n\tlabel: string;\n}> = ({ active, onPress, label }) => (\n\t<button\n\t\ttype=\"button\"\n\t\ttitle={label}\n\t\tclassName={`bik-toolbar-btn${active ? ' bik-toolbar-btn--active' : ''}`}\n\t\tonMouseDown={(e) => {\n\t\t\te.preventDefault();\n\t\t\tonPress();\n\t\t}}\n\t>\n\t\t{label}\n\t</button>\n);\n"],"names":["BikEditorToolbar","Btn","_ref2","active","onPress","label","_jsx","Object","assign","type","title","className","onMouseDown","e","preventDefault","children","_ref","editorRef","activeFormats","showBold","showItalic","showUnderline","showStrike","showLink","showLists","showAlignment","showFontPicker","onLinkButtonClick","act","_a","current","actions","_jsxs","jsx","bold","toggleBold","italic","toggleItalic","underline","toggleUnderline","strike","toggleStrike","link","selectedText","_b","getSelectedText","currentHref","_d","_c","href","jsxs","_Fragment","bulletList","toggleBulletList","orderedList","toggleOrderedList","textAlign","setTextAlign"],"mappings":"uGAuDaA,MA8FPC,EAIDC,IAAA,IAACC,OAAEA,EAAMC,QAAEA,EAAOC,MAAEA,GAAOH,EAAA,OAC/BI,MAAA,SAAAC,OAAAC,OAAA,CACCC,KAAK,SACLC,MAAOL,EACPM,UAAW,mBAAkBR,EAAS,2BAA6B,IACnES,YAAcC,IACbA,EAAEC,iBACFV,GAAS,GAGT,CAAAW,SAAAV,IACO,2BA7GuCW,IAY5C,IAZ6CC,UACjDA,EAASC,cACTA,EAAaC,SACbA,GAAW,EAAIC,WACfA,GAAa,EAAIC,cACjBA,GAAgB,EAAIC,WACpBA,GAAa,EAAIC,SACjBA,GAAW,EAAIC,UACfA,GAAY,EAAIC,cAChBA,GAAgB,EAAKC,eACrBA,GAAiB,EAAKC,kBACtBA,GACAX,QACA,MAAMY,EAAuB,QAAjBC,EAAAZ,EAAUa,eAAO,IAAAD,OAAA,EAAAA,EAAEE,QAC/B,OAAKH,EAGJI,OAAK,MAAAzB,OAAAC,OAAA,CAAAG,UAAU,sBACb,CAAAI,SAAA,CAAAI,GACAb,EAAC2B,IAAAhC,EACA,CAAAE,OAAQe,EAAcgB,KACtB9B,QAASwB,EAAIO,WACb9B,MAAM,SAGPe,GACAd,EAAC2B,IAAAhC,EACA,CAAAE,OAAQe,EAAckB,OACtBhC,QAASwB,EAAIS,aACbhC,MAAM,WAGPgB,GACAf,EAAC2B,IAAAhC,GACAE,OAAQe,EAAcoB,UACtBlC,QAASwB,EAAIW,gBACblC,MAAM,cAGPiB,GACAhB,EAAA2B,IAAChC,EAAG,CACHE,OAAQe,EAAcsB,OACtBpC,QAASwB,EAAIa,aACbpC,MAAM,WAGPkB,GACAjB,EAAC2B,IAAAhC,EACA,CAAAE,SAAUe,EAAcwB,KACxBtC,QAASA,iBACR,MAAMuC,EAAuD,QAAxCC,EAAiB,QAAjBf,EAAAZ,EAAUa,eAAO,IAAAD,OAAA,EAAAA,EAAEgB,yBAAqB,IAAAD,EAAAA,EAAA,GACvDE,EAA0C,QAA5BC,EAAoB,QAApBC,EAAA9B,EAAcwB,YAAM,IAAAM,OAAA,EAAAA,EAAAC,YAAQ,IAAAF,EAAAA,EAAA,KAChDpB,SAAAA,EAAoBgB,EAAcG,EAAY,EAE/CzC,MAAM,WAGPmB,GACAQ,EAAAkB,KAAAC,WAAA,CAAApC,SAAA,CACCT,EAAC2B,IAAAhC,GACAE,OAAQe,EAAckC,WACtBhD,QAASwB,EAAIyB,iBACbhD,MAAM,WAEPC,EAAA2B,IAAChC,EACA,CAAAE,OAAQe,EAAcoC,YACtBlD,QAASwB,EAAI2B,kBACblD,MAAM,eAIRoB,GACAO,EAAAkB,KAAAC,WAAA,CAAApC,SAAA,CACCT,EAAC2B,IAAAhC,GACAE,OAAoC,SAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,QAChCpD,MAAM,SAEPC,EAAC2B,IAAAhC,GACAE,OAAoC,WAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,UAChCpD,MAAM,WAEPC,EAAC2B,IAAAhC,GACAE,OAAoC,UAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,SAChCpD,MAAM,iBAxEM,IA4EV"}
1
+ {"version":3,"file":"BikEditorToolbar.js","sources":["../../../../src/editor/toolbar/BikEditorToolbar.tsx"],"sourcesContent":["import React from 'react';\nimport type { BikEditorRef, FormatState } from '../BikEditor.types';\n\n/**\n * Props for `<BikEditorToolbar />`.\n *\n * All `show*` props default to `true` except `showAlignment`, `showFontPicker`,\n * and `showColorPicker` which default to `false`.\n */\ninterface Props {\n\t/** The same ref you passed to `<BikEditor ref={...} />`. Required. */\n\teditorRef: React.RefObject<BikEditorRef>;\n\t/**\n\t * Active format snapshot. Keep this in state, updated via `onSelectionChange`.\n\t *\n\t * @example\n\t * const [formats, setFormats] = useState(DEFAULT_ACTIVE_FORMATS);\n\t * <BikEditor onSelectionChange={setFormats} ... />\n\t * <BikEditorToolbar activeFormats={formats} ... />\n\t */\n\tactiveFormats: FormatState;\n\t/** Show the Bold button. Default `true`. */\n\tshowBold?: boolean;\n\t/** Show the Italic button. Default `true`. */\n\tshowItalic?: boolean;\n\t/** Show the Underline button. Default `true`. */\n\tshowUnderline?: boolean;\n\t/** Show the Strikethrough button. Default `true`. */\n\tshowStrike?: boolean;\n\t/** Show the Link button. Default `true`. */\n\tshowLink?: boolean;\n\t/** Show Bullet and Ordered list buttons. Default `true`. */\n\tshowLists?: boolean;\n\t/** Show Left / Center / Right alignment buttons. Default `false`. */\n\tshowAlignment?: boolean;\n\t/** Reserved — renders nothing yet. Default `false`. */\n\tshowFontPicker?: boolean;\n\t/** Reserved — renders nothing yet. Default `false`. */\n\tshowColorPicker?: boolean;\n\t/**\n\t * Called when the user clicks the Link button.\n\t *\n\t * - `selectedText` — the selected text, or the full text of the link the cursor\n\t * is already inside (useful for pre-filling the \"Text\" field of your modal).\n\t * - `currentHref` — non-null when the cursor is inside an existing link\n\t * (useful for pre-filling the \"URL\" field).\n\t *\n\t * After the user saves, call `editorRef.current?.actions.setLink(href, text)`.\n\t */\n\tonLinkButtonClick?: (\n\t\tselectedText: string,\n\t\tcurrentHref: string | null,\n\t) => void;\n}\n\nexport const BikEditorToolbar: React.FC<Props> = ({\n\teditorRef,\n\tactiveFormats,\n\tshowBold = true,\n\tshowItalic = true,\n\tshowUnderline = true,\n\tshowStrike = true,\n\tshowLink = true,\n\tshowLists = true,\n\tshowAlignment = false,\n\tshowFontPicker = false,\n\tonLinkButtonClick,\n}) => {\n\tconst act = editorRef.current?.actions;\n\tif (!act) return null;\n\n\treturn (\n\t\t<div className=\"bik-editor-toolbar\">\n\t\t\t{showBold && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.bold}\n\t\t\t\t\tonPress={act.toggleBold}\n\t\t\t\t\tlabel=\"Bold\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showItalic && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.italic}\n\t\t\t\t\tonPress={act.toggleItalic}\n\t\t\t\t\tlabel=\"Italic\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showUnderline && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.underline}\n\t\t\t\t\tonPress={act.toggleUnderline}\n\t\t\t\t\tlabel=\"Underline\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showStrike && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={activeFormats.strike}\n\t\t\t\t\tonPress={act.toggleStrike}\n\t\t\t\t\tlabel=\"Strike\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showLink && (\n\t\t\t\t<Btn\n\t\t\t\t\tactive={!!activeFormats.link}\n\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\tconst selectedText = editorRef.current?.getSelectedText() ?? '';\n\t\t\t\t\t\tconst currentHref = activeFormats.link?.href ?? null;\n\t\t\t\t\t\tonLinkButtonClick?.(selectedText, currentHref);\n\t\t\t\t\t}}\n\t\t\t\t\tlabel=\"Link\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{showLists && (\n\t\t\t\t<>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.bulletList}\n\t\t\t\t\t\tonPress={act.toggleBulletList}\n\t\t\t\t\t\tlabel=\"Bullet\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.orderedList}\n\t\t\t\t\t\tonPress={act.toggleOrderedList}\n\t\t\t\t\t\tlabel=\"Ordered\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{showAlignment && (\n\t\t\t\t<>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'left'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('left')}\n\t\t\t\t\t\tlabel=\"Left\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'center'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('center')}\n\t\t\t\t\t\tlabel=\"Center\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Btn\n\t\t\t\t\t\tactive={activeFormats.textAlign === 'right'}\n\t\t\t\t\t\tonPress={() => act.setTextAlign('right')}\n\t\t\t\t\t\tlabel=\"Right\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst Btn: React.FC<{\n\tactive: boolean;\n\tonPress: () => void;\n\tlabel: string;\n}> = ({ active, onPress, label }) => (\n\t<button\n\t\ttype=\"button\"\n\t\ttitle={label}\n\t\tclassName={`bik-toolbar-btn${active ? ' bik-toolbar-btn--active' : ''}`}\n\t\tonMouseDown={(e) => {\n\t\t\te.preventDefault();\n\t\t\tonPress();\n\t\t}}\n\t>\n\t\t{label}\n\t</button>\n);\n"],"names":["BikEditorToolbar","Btn","_ref2","active","onPress","label","_jsx","Object","assign","type","title","className","onMouseDown","e","preventDefault","children","_ref","editorRef","activeFormats","showBold","showItalic","showUnderline","showStrike","showLink","showLists","showAlignment","showFontPicker","onLinkButtonClick","act","_a","current","actions","_jsxs","jsx","bold","toggleBold","italic","toggleItalic","underline","toggleUnderline","strike","toggleStrike","link","selectedText","_b","getSelectedText","currentHref","_d","_c","href","jsxs","_Fragment","bulletList","toggleBulletList","orderedList","toggleOrderedList","textAlign","setTextAlign"],"mappings":"uGAuDaA,MA8FPC,EAIDC,IAAA,IAACC,OAAEA,EAAMC,QAAEA,EAAOC,MAAEA,GAAOH,EAAA,OAC/BI,MAAA,SAAAC,OAAAC,OAAA,CACCC,KAAK,SACLC,MAAOL,EACPM,UAAW,mBAAkBR,EAAS,2BAA6B,IACnES,YAAcC,IACbA,EAAEC,iBACFV,GAAS,GAGT,CAAAW,SAAAV,IACO,2BA7GuCW,IAY5C,IAZ6CC,UACjDA,EAASC,cACTA,EAAaC,SACbA,GAAW,EAAIC,WACfA,GAAa,EAAIC,cACjBA,GAAgB,EAAIC,WACpBA,GAAa,EAAIC,SACjBA,GAAW,EAAIC,UACfA,GAAY,EAAIC,cAChBA,GAAgB,EAAKC,eACrBA,GAAiB,EAAKC,kBACtBA,GACAX,QACA,MAAMY,EAAuB,QAAjBC,EAAAZ,EAAUa,eAAO,IAAAD,OAAA,EAAAA,EAAEE,QAC/B,OAAKH,EAGJI,OAAK,MAAAzB,OAAAC,OAAA,CAAAG,UAAU,sBACb,CAAAI,SAAA,CAAAI,GACAb,EAAC2B,IAAAhC,EACA,CAAAE,OAAQe,EAAcgB,KACtB9B,QAASwB,EAAIO,WACb9B,MAAM,SAGPe,GACAd,EAAC2B,IAAAhC,EACA,CAAAE,OAAQe,EAAckB,OACtBhC,QAASwB,EAAIS,aACbhC,MAAM,WAGPgB,GACAf,EAAC2B,IAAAhC,GACAE,OAAQe,EAAcoB,UACtBlC,QAASwB,EAAIW,gBACblC,MAAM,cAGPiB,GACAhB,EAAA2B,IAAChC,EAAG,CACHE,OAAQe,EAAcsB,OACtBpC,QAASwB,EAAIa,aACbpC,MAAM,WAGPkB,GACAjB,EAAC2B,IAAAhC,EACA,CAAAE,SAAUe,EAAcwB,KACxBtC,QAASA,iBACR,MAAMuC,EAAuD,QAAxCC,EAAiB,QAAjBf,EAAAZ,EAAUa,eAAO,IAAAD,OAAA,EAAAA,EAAEgB,yBAAqB,IAAAD,EAAAA,EAAA,GACvDE,EAA0C,QAA5BC,EAAoB,QAApBC,EAAA9B,EAAcwB,YAAM,IAAAM,OAAA,EAAAA,EAAAC,YAAQ,IAAAF,EAAAA,EAAA,KAChDpB,SAAAA,EAAoBgB,EAAcG,EAAY,EAE/CzC,MAAM,SAGPmB,GACAQ,EAAAkB,KAAAC,WAAA,CAAApC,SAAA,CACCT,EAAC2B,IAAAhC,GACAE,OAAQe,EAAckC,WACtBhD,QAASwB,EAAIyB,iBACbhD,MAAM,WAEPC,EAAA2B,IAAChC,EACA,CAAAE,OAAQe,EAAcoC,YACtBlD,QAASwB,EAAI2B,kBACblD,MAAM,eAIRoB,GACAO,EAAAkB,KAAAC,WAAA,CAAApC,SAAA,CACCT,EAAC2B,IAAAhC,GACAE,OAAoC,SAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,QAChCpD,MAAM,SAEPC,EAAC2B,IAAAhC,GACAE,OAAoC,WAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,UAChCpD,MAAM,WAEPC,EAAC2B,IAAAhC,GACAE,OAAoC,UAA5Be,EAAcsC,UACtBpD,QAASA,IAAMwB,EAAI6B,aAAa,SAChCpD,MAAM,iBAxEM,IA4EV"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{size:l=24,color:s="currentColor"}=t,o=e.__rest(t,["size","color"]);const i=Object.assign({width:l,height:l,color:s},o);return r.jsx("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z",fill:"currentColor"})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{width:l=24,height:i=24,color:o="currentColor"}=t,s=e.__rest(t,["width","height","color"]);return r.jsx("svg",Object.assign({width:l,height:i,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:o},s,{children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z",fill:"currentColor"})}))};
2
2
  //# sourceMappingURL=ChevronUp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChevronUp.js","sources":["../../../../../src/icons/Arrows/Chevron/ChevronUp.tsx"],"sourcesContent":["import type { SVGProps } from 'react';\n\ninterface Props extends SVGProps<SVGSVGElement> {\n\tsize?: number | string;\n\tcolor?: string;\n}\nconst SvgChevronUp = ({\n\tsize = 24,\n\tcolor = 'currentColor',\n\t...rest\n}: Props) => {\n\tconst props = {\n\t\twidth: size,\n\t\theight: size,\n\t\tcolor,\n\t\t...rest,\n\t};\n\treturn (\n\t\t<svg\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n};\nexport default SvgChevronUp;\n"],"names":["_a","size","color","rest","__rest","props","Object","assign","width","height","_jsx","viewBox","fill","xmlns","children","jsx","fillRule","clipRule","d"],"mappings":"gKAMsBA,IAAA,IAAAC,KACrBA,EAAO,GAAEC,MACTA,EAAQ,gBAAcF,EACnBG,EAHkBC,EAAAA,OAAAJ,EAAA,CAAA,OAAA,UAKrB,MAAMK,EAAKC,OAAAC,OAAA,CACVC,MAAOP,EACPQ,OAAQR,EACRC,SACGC,GAEJ,OACCO,MAAA,MAAAJ,OAAAC,OAAA,CACCI,QAAQ,YACRC,KAAK,OACLC,MAAM,8BACFR,EAEJ,CAAAS,SAAAJ,EAAAK,IAAA,OAAA,CACCC,SAAS,UACTC,SAAS,UACTC,EAAE,+TACFN,KAAK,mBAED"}
1
+ {"version":3,"file":"ChevronUp.js","sources":["../../../../../src/icons/Arrows/Chevron/ChevronUp.tsx"],"sourcesContent":["import type { SVGProps } from 'react';\n\ninterface Props extends SVGProps<SVGSVGElement> {\n\tcolor?: string;\n}\nconst SvgChevronUp = ({\n\twidth = 24,\n\theight = 24,\n\tcolor = 'currentColor',\n\t...rest\n}: Props) => {\n\treturn (\n\t\t<svg\n\t\t\twidth={width}\n\t\t\theight={height}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tcolor={color}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n};\nexport default SvgChevronUp;\n"],"names":["_a","width","height","color","rest","__rest","_jsx","viewBox","fill","xmlns","children","jsx","fillRule","clipRule","d"],"mappings":"gKAKsBA,IAAA,IAAAC,MACrBA,EAAQ,GAAEC,OACVA,EAAS,GAAEC,MACXA,EAAQ,gBAEDH,EADJI,EAAIC,EAAAA,OAAAL,EAJc,4BAMrB,OACCM,2BACCL,MAAOA,EACPC,OAAQA,EACRK,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNN,MAAOA,GACHC,EAEJ,CAAAM,SAAAJ,EAAAK,IAAA,OAAA,CACCC,SAAS,UACTC,SAAS,UACTC,EAAE,+TACFN,KAAK,mBAED"}