@bikdotai/bik-component-library 0.0.805-beta.16 → 0.0.805-beta.18

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 (351) hide show
  1. package/dist/cjs/components/BikGiftedChat/Bubble/Bubble.js +1 -1
  2. package/dist/cjs/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
  3. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  4. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  5. package/dist/cjs/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  6. package/dist/cjs/components/avatar/Avatar.js +1 -1
  7. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  8. package/dist/cjs/components/avatar/Avatar.styled.js +3 -3
  9. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  10. package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
  11. package/dist/cjs/components/avatar/AvatarHelper.js.map +1 -1
  12. package/dist/cjs/components/bik-layout/BikSidebar.js.map +1 -1
  13. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js +2 -0
  14. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  15. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +2 -0
  16. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  17. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +294 -0
  18. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  19. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +2 -0
  20. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  21. package/dist/cjs/components/button/Button.js +1 -1
  22. package/dist/cjs/components/button/Button.js.map +1 -1
  23. package/dist/cjs/components/button/Button.styled.js +1 -1
  24. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  25. package/dist/cjs/components/button/themes.js +1 -1
  26. package/dist/cjs/components/button/themes.js.map +1 -1
  27. package/dist/cjs/components/country-code-picker/CountryCodePicker.js.map +1 -1
  28. package/dist/cjs/components/country-code-picker/CountryPicker.js.map +1 -1
  29. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  30. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  31. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  32. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  33. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  34. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  35. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +6 -5
  36. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  37. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  38. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  39. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  40. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +7 -7
  41. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  42. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  43. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  44. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +8 -4
  45. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  46. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  47. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  48. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  49. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  50. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  51. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  52. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  53. package/dist/cjs/components/dropdown-button/DropdownButton.style.js +10 -6
  54. package/dist/cjs/components/dropdown-button/DropdownButton.style.js.map +1 -1
  55. package/dist/cjs/components/dual-icon-button/DualIconButton.js +2 -0
  56. package/dist/cjs/components/dual-icon-button/DualIconButton.js.map +1 -0
  57. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +26 -0
  58. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  59. package/dist/cjs/components/fab-menu/FABMenu.js.map +1 -1
  60. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  61. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  62. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
  63. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  64. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
  65. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  66. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  67. package/dist/cjs/components/icon-button/IconButton.js.map +1 -1
  68. package/dist/cjs/components/icon-button/IconButton.styled.js +3 -3
  69. package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
  70. package/dist/cjs/components/icon-button/theme.js +1 -1
  71. package/dist/cjs/components/icon-button/theme.js.map +1 -1
  72. package/dist/cjs/components/input/Input.js +1 -1
  73. package/dist/cjs/components/input/Input.js.map +1 -1
  74. package/dist/cjs/components/input/Input.styled.js +1 -1
  75. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  76. package/dist/cjs/components/list-item/ListItem.js +1 -1
  77. package/dist/cjs/components/list-item/ListItem.js.map +1 -1
  78. package/dist/cjs/components/list-item/ListItem.styled.js +1 -1
  79. package/dist/cjs/components/list-item/ListItem.styled.js.map +1 -1
  80. package/dist/cjs/components/list-item/themes.js +1 -1
  81. package/dist/cjs/components/list-item/themes.js.map +1 -1
  82. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  83. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  84. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  85. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  86. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  87. package/dist/cjs/components/multi-level-dropdown/MenuList.js.map +1 -1
  88. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  89. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  90. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +33 -30
  91. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  92. package/dist/cjs/components/tag/Tag.js +1 -1
  93. package/dist/cjs/components/tag/Tag.js.map +1 -1
  94. package/dist/cjs/components/tag/Tag.styled.js +1 -1
  95. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  96. package/dist/cjs/components/tag/model.js.map +1 -1
  97. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  98. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  99. package/dist/cjs/components/whats-new/WhatsNewButton.js +1 -1
  100. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  101. package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
  102. package/dist/cjs/components/whats-new/WhatsNewPanel.js.map +1 -1
  103. package/dist/cjs/constants/Theme.js +1 -1
  104. package/dist/cjs/constants/Theme.js.map +1 -1
  105. package/dist/cjs/editor/BikEditor.utils.js +1 -1
  106. package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
  107. package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
  108. package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
  109. package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js +1 -1
  110. package/dist/cjs/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +1 -1
  111. package/dist/cjs/editor/extensions/slashCommand/SlashCommandExtension.js +1 -1
  112. package/dist/cjs/editor/extensions/slashCommand/SlashCommandExtension.js.map +1 -1
  113. package/dist/cjs/editor/serializers/toWhatsAppText.js +1 -1
  114. package/dist/cjs/editor/serializers/toWhatsAppText.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/BikGiftedChat/GiftedChat/types.d.ts +6 -2
  119. package/dist/cjs/src/components/avatar/Avatar.d.ts +3 -2
  120. package/dist/cjs/src/components/avatar/AvatarHelper.d.ts +5 -4
  121. package/dist/cjs/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  122. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  123. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +13 -0
  124. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  125. package/dist/cjs/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +3 -0
  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/feature-announcements/types/feature.types.d.ts +1 -1
  153. package/dist/cjs/src/components/icon-button/IconButton.styled.d.ts +3 -1
  154. package/dist/cjs/src/components/icon-button/model.d.ts +12 -1
  155. package/dist/cjs/src/components/input/Input.model.d.ts +2 -1
  156. package/dist/cjs/src/components/input/Input.styled.d.ts +16 -1
  157. package/dist/cjs/src/components/list-item/List.model.d.ts +1 -1
  158. package/dist/cjs/src/components/list-item/ListItem.styled.d.ts +1 -1
  159. package/dist/cjs/src/components/list-item/themes.d.ts +2 -2
  160. package/dist/cjs/src/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  161. package/dist/cjs/src/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  162. package/dist/cjs/src/components/multi-level-dropdown/MenuList.d.ts +1 -0
  163. package/dist/cjs/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  164. package/dist/cjs/src/components/multi-level-dropdown/type.d.ts +1 -0
  165. package/dist/cjs/src/components/tag/Tag.d.ts +1 -1
  166. package/dist/cjs/src/components/tag/Tag.stories.d.ts +5 -5
  167. package/dist/cjs/src/components/tag/Tag.styled.d.ts +3 -1
  168. package/dist/cjs/src/components/tag/model.d.ts +5 -1
  169. package/dist/cjs/src/components/whats-new/WhatsNew.d.ts +2 -0
  170. package/dist/cjs/src/components/whats-new/WhatsNew.types.d.ts +2 -0
  171. package/dist/cjs/src/constants/Theme.d.ts +6 -0
  172. package/dist/cjs/src/editor/BikEditor.utils.d.ts +10 -3
  173. package/dist/cjs/src/editor/serializers/toWhatsAppText.d.ts +2 -2
  174. package/dist/cjs/src/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  175. package/dist/cjs/src/index.d.ts +1 -0
  176. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js +1 -1
  177. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
  178. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  179. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  180. package/dist/esm/components/BikGiftedChat/GiftedChat/types.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/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  236. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  237. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
  238. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  239. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
  240. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  241. package/dist/esm/components/icon-button/IconButton.js +1 -1
  242. package/dist/esm/components/icon-button/IconButton.js.map +1 -1
  243. package/dist/esm/components/icon-button/IconButton.styled.js +1 -1
  244. package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
  245. package/dist/esm/components/icon-button/theme.js +1 -1
  246. package/dist/esm/components/icon-button/theme.js.map +1 -1
  247. package/dist/esm/components/input/Input.js +1 -1
  248. package/dist/esm/components/input/Input.js.map +1 -1
  249. package/dist/esm/components/input/Input.styled.js +1 -1
  250. package/dist/esm/components/input/Input.styled.js.map +1 -1
  251. package/dist/esm/components/list-item/ListItem.js +1 -1
  252. package/dist/esm/components/list-item/ListItem.js.map +1 -1
  253. package/dist/esm/components/list-item/ListItem.styled.js +1 -1
  254. package/dist/esm/components/list-item/ListItem.styled.js.map +1 -1
  255. package/dist/esm/components/list-item/themes.js +1 -1
  256. package/dist/esm/components/list-item/themes.js.map +1 -1
  257. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  258. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  259. package/dist/esm/components/multi-level-dropdown/MenuItem.js +1 -1
  260. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  261. package/dist/esm/components/multi-level-dropdown/MenuList.js +1 -1
  262. package/dist/esm/components/multi-level-dropdown/MenuList.js.map +1 -1
  263. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  264. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  265. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +32 -29
  266. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  267. package/dist/esm/components/tag/Tag.js +1 -1
  268. package/dist/esm/components/tag/Tag.js.map +1 -1
  269. package/dist/esm/components/tag/Tag.styled.js +1 -1
  270. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  271. package/dist/esm/components/tag/model.js.map +1 -1
  272. package/dist/esm/components/whats-new/WhatsNew.js +1 -1
  273. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  274. package/dist/esm/components/whats-new/WhatsNewButton.js +1 -1
  275. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  276. package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -1
  277. package/dist/esm/components/whats-new/WhatsNewPanel.js.map +1 -1
  278. package/dist/esm/constants/Theme.js +1 -1
  279. package/dist/esm/constants/Theme.js.map +1 -1
  280. package/dist/esm/editor/BikEditor.utils.js +1 -1
  281. package/dist/esm/editor/BikEditor.utils.js.map +1 -1
  282. package/dist/esm/editor/extensions/mention/MentionExtension.js +1 -1
  283. package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
  284. package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js +1 -1
  285. package/dist/esm/editor/extensions/plainClipboard/PlainClipboardExtension.js.map +1 -1
  286. package/dist/esm/editor/extensions/slashCommand/SlashCommandExtension.js +1 -1
  287. package/dist/esm/editor/extensions/slashCommand/SlashCommandExtension.js.map +1 -1
  288. package/dist/esm/editor/serializers/toWhatsAppText.js +1 -1
  289. package/dist/esm/editor/serializers/toWhatsAppText.js.map +1 -1
  290. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js +1 -1
  291. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  292. package/dist/esm/index.js +1 -1
  293. package/dist/esm/src/components/BikGiftedChat/GiftedChat/types.d.ts +6 -2
  294. package/dist/esm/src/components/avatar/Avatar.d.ts +3 -2
  295. package/dist/esm/src/components/avatar/AvatarHelper.d.ts +5 -4
  296. package/dist/esm/src/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  297. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  298. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +13 -0
  299. package/dist/esm/src/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  300. package/dist/esm/src/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +3 -0
  301. package/dist/esm/src/components/bik-layout/index.d.ts +2 -0
  302. package/dist/esm/src/components/button/Button.styled.d.ts +1 -1
  303. package/dist/esm/src/components/button/model.d.ts +3 -3
  304. package/dist/esm/src/components/button/themes.d.ts +2 -2
  305. package/dist/esm/src/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  306. package/dist/esm/src/components/country-code-picker/CountryPicker.d.ts +1 -1
  307. package/dist/esm/src/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  308. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  309. package/dist/esm/src/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  310. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +1 -1
  311. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +1 -1
  312. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +1 -1
  313. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +2 -1
  314. package/dist/esm/src/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -1
  315. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  316. package/dist/esm/src/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  317. package/dist/esm/src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +2 -0
  318. package/dist/esm/src/components/dropdown/hooks/useDropdown.d.ts +2 -0
  319. package/dist/esm/src/components/dropdown/type.d.ts +2 -1
  320. package/dist/esm/src/components/dropdown-button/DropdownButton.d.ts +3 -1
  321. package/dist/esm/src/components/dropdown-button/DropdownButton.style.d.ts +9 -2
  322. package/dist/esm/src/components/dual-icon-button/DualIconButton.d.ts +3 -0
  323. package/dist/esm/src/components/dual-icon-button/DualIconButton.styled.d.ts +7 -0
  324. package/dist/esm/src/components/dual-icon-button/index.d.ts +2 -0
  325. package/dist/esm/src/components/dual-icon-button/model.d.ts +12 -0
  326. package/dist/esm/src/components/fab-menu/FABMenu.d.ts +1 -1
  327. package/dist/esm/src/components/feature-announcements/types/feature.types.d.ts +1 -1
  328. package/dist/esm/src/components/icon-button/IconButton.styled.d.ts +3 -1
  329. package/dist/esm/src/components/icon-button/model.d.ts +12 -1
  330. package/dist/esm/src/components/input/Input.model.d.ts +2 -1
  331. package/dist/esm/src/components/input/Input.styled.d.ts +16 -1
  332. package/dist/esm/src/components/list-item/List.model.d.ts +1 -1
  333. package/dist/esm/src/components/list-item/ListItem.styled.d.ts +1 -1
  334. package/dist/esm/src/components/list-item/themes.d.ts +2 -2
  335. package/dist/esm/src/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  336. package/dist/esm/src/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  337. package/dist/esm/src/components/multi-level-dropdown/MenuList.d.ts +1 -0
  338. package/dist/esm/src/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  339. package/dist/esm/src/components/multi-level-dropdown/type.d.ts +1 -0
  340. package/dist/esm/src/components/tag/Tag.d.ts +1 -1
  341. package/dist/esm/src/components/tag/Tag.stories.d.ts +5 -5
  342. package/dist/esm/src/components/tag/Tag.styled.d.ts +3 -1
  343. package/dist/esm/src/components/tag/model.d.ts +5 -1
  344. package/dist/esm/src/components/whats-new/WhatsNew.d.ts +2 -0
  345. package/dist/esm/src/components/whats-new/WhatsNew.types.d.ts +2 -0
  346. package/dist/esm/src/constants/Theme.d.ts +6 -0
  347. package/dist/esm/src/editor/BikEditor.utils.d.ts +10 -3
  348. package/dist/esm/src/editor/serializers/toWhatsAppText.d.ts +2 -2
  349. package/dist/esm/src/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  350. package/dist/esm/src/index.d.ts +1 -0
  351. package/package.json +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sources":["../../../src/constants/Theme.ts"],"sourcesContent":["export const BASE_COLORS = {\n\tbrand: {\n\t\t900: '#28034E',\n\t\t800: '#4B1583',\n\t\t500: '#731DCF',\n\t\t100: '#F3EDF9',\n\t\t50: '#EFE6F9',\n\t\t10: '#F9F3FF',\n\t},\n\tgrayscale: {\n\t\t900: '#212121',\n\t\t700: '#616161',\n\t\t500: '#9E9E9E',\n\t\t400: '#BDBDBD',\n\t\t200: '#E0E0E0',\n\t\t100: '#F0F0F0',\n\t\t70: '#F7F7F7',\n\t\t50: '#FAFAFA',\n\t\twhite: '#FFFFFF',\n\t\talpha: '#00000088',\n\t},\n\tnegative: {\n\t\t900: '#B92321',\n\t\t700: '#D53434',\n\t\t100: '#FFCED4',\n\t\t50: '#FFEBEF',\n\t},\n\twarning: {\n\t\t900: '#99631B',\n\t\t500: '#FEC02D',\n\t\t100: '#FFEABE',\n\t\t50: '#FFF7E5',\n\t},\n\tpositive: {\n\t\t900: '#00580E',\n\t\t700: '#1A872C',\n\t\t100: '#C3E4C4',\n\t\t50: '#E6F4E7',\n\t},\n\tbikAi: {\n\t\t500: 'linear-gradient(93deg, #FF166A 0.37%, #FB5F08 100%)',\n\t\t100: 'linear-gradient(93deg, #FEBAD2 0.37%, #FDD1B9 100%)',\n\t\t50: 'linear-gradient(93deg, #FFE6EE 0.37%, #FFF0E7 100%)',\n\t},\n};\n\nexport const COLORS = {\n\tbackground: {\n\t\tinactive: BASE_COLORS.grayscale['200'],\n\t\tbase: BASE_COLORS.grayscale['100'],\n\t\tinverse: BASE_COLORS.brand['900'],\n\t\tinverseLight: BASE_COLORS.brand['800'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tbrandLight: BASE_COLORS.brand['50'],\n\t\tbrandVeryLight: BASE_COLORS.brand['10'],\n\t\tpureWhite: BASE_COLORS.grayscale.white,\n\t\tbrandTint: BASE_COLORS.brand['100'],\n\t\tnegative: {\n\t\t\tvibrant: BASE_COLORS.negative['700'],\n\t\t\tlight: BASE_COLORS.negative['50'],\n\t\t},\n\t\twarning: {\n\t\t\tvibrant: BASE_COLORS.warning['500'],\n\t\t\tlight: BASE_COLORS.warning['50'],\n\t\t},\n\t\tpositive: {\n\t\t\tvibrant: BASE_COLORS.positive['700'],\n\t\t\tlight: BASE_COLORS.positive['50'],\n\t\t},\n\t\tblue: {\n\t\t\tlight: '#E5F2FF',\n\t\t},\n\t},\n\ticon: { placeholder: '#9E9E9E' },\n\tscrim: {\n\t\tstandard: '#00000099',\n\t},\n\tsurface: {\n\t\tstandard: BASE_COLORS.grayscale['white'],\n\t\tsubdued: BASE_COLORS.grayscale['50'],\n\t\thovered: BASE_COLORS.grayscale['100'],\n\t\tgrey: BASE_COLORS.grayscale['70'],\n\t\tai: BASE_COLORS.bikAi['500'],\n\t\taiLight: BASE_COLORS.bikAi['50'],\n\t},\n\tcontent: {\n\t\tprimary: BASE_COLORS.grayscale['900'],\n\t\tsecondary: BASE_COLORS.grayscale['700'],\n\t\tplaceholder: BASE_COLORS.grayscale['500'],\n\t\tinactive: BASE_COLORS.grayscale['400'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tprimaryInverse: BASE_COLORS.grayscale['white'],\n\t\tsecondaryInverse: '#ffffffcc',\n\t\tnegative: BASE_COLORS.negative['900'],\n\t\twarning: BASE_COLORS.warning['900'],\n\t\tpositive: BASE_COLORS.positive['900'],\n\t\tblue: '#28458F',\n\t\tai: BASE_COLORS.bikAi['500'],\n\t},\n\tstroke: {\n\t\tprimary: BASE_COLORS.grayscale['200'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tnegative: {\n\t\t\tlightAlt: BASE_COLORS.negative['100'],\n\t\t\tvibrant: BASE_COLORS.negative['700'],\n\t\t},\n\t\twarning: {\n\t\t\tlightAlt: BASE_COLORS.warning['100'],\n\t\t\tvibrant: BASE_COLORS.warning['500'],\n\t\t},\n\t\tpositive: {\n\t\t\tlightAlt: BASE_COLORS.positive['100'],\n\t\t\tvibrant: BASE_COLORS.positive['700'],\n\t\t},\n\t\tbrandLightAlt: '#DDCCF0',\n\t\tblue: {\n\t\t\tlightAlt: '#C3D5E5',\n\t\t},\n\t\tai: {\n\t\t\tlightAlt: '#FEBAD2',\n\t\t\tvibrant: '#F23275',\n\t\t},\n\t},\n\tspecial: {\n\t\twhatsapp: {\n\t\t\tbrand: '#25D366',\n\t\t\tgradient: 'linear-gradient(360deg, #20B038 0%, #60D66A 100%)',\n\t\t\tdark: '#455A64',\n\t\t\tgradientArr: ['#20B038', '#60D66A'],\n\t\t},\n\t\tbrand: {\n\t\t\tgoogle: '#DD4B39',\n\t\t\tfacebook: '#1877F2',\n\t\t},\n\t},\n\ttext: {\n\t\tprimary: BASE_COLORS.grayscale['900'],\n\t\tsecondary: BASE_COLORS.grayscale['700'],\n\t\tplaceholder: BASE_COLORS.grayscale['500'],\n\t\tdisabled: BASE_COLORS.grayscale['400'],\n\t\twhite: BASE_COLORS.grayscale['white'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\taltPrimary: BASE_COLORS.brand['900'],\n\t\taltSecondary: BASE_COLORS.brand['800'],\n\t},\n};\n\nexport const FONTS = {\n\tdisplay: {\n\t\tfontWeight: '400',\n\t\tfontSize: 32,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleXLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 32,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 28,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleMedium: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\ttitleRegular: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitleSmall: {\n\t\tfontWeight: '600',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tbodyPrimary: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\tbodyLarge: {\n\t\tfontWeight: '400',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\tbodySecondary: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tcaption: {\n\t\tfontWeight: '400',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttiny: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tsubHeading: {\n\t\tfontWeight: '600',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\n\ttitle1: {\n\t\tfontWeight: '600',\n\t\tfontSize: 24,\n\t\tlineHeight: 32,\n\t\tletterSpacing: 0,\n\t},\n\ttitle1Mobile: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 30,\n\t\tletterSpacing: 0,\n\t},\n\ttitle2: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\ttitle2Mobile: {\n\t\tfontWeight: '600',\n\t\tfontSize: 18,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitle3: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitle3Mobile: {\n\t\tfontWeight: '500',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\ttitle4: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\ttextPlaceholder: {\n\t\tfontWeight: '400',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttitle4Mobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\tbodyRegularMobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 18,\n\t\tletterSpacing: 0,\n\t},\n\tbodyRegular: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\n\tbodySmall: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tbuttonLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tbuttonRegular: {\n\t\tfontWeight: '600',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tcaptionMobile: {\n\t\tfontWeight: '500',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tcaptionBold: {\n\t\tfontWeight: '700',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttext1Bold: {\n\t\tfontWeight: '700',\n\t\tfontSize: 10,\n\t\tlineHeight: 14,\n\t\tletterSpacing: 0,\n\t},\n\ttoast: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttoastMobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n};\n\n// For backward compatibility\nexport const DEFAULT_THEME = {\n\tcolorsV2: COLORS,\n\tfonts: FONTS,\n};\n"],"names":["BASE_COLORS","brand","grayscale","white","alpha","negative","warning","positive","bikAi","COLORS","background","inactive","base","inverse","inverseLight","brandLight","brandVeryLight","pureWhite","brandTint","vibrant","light","blue","icon","placeholder","scrim","standard","surface","subdued","hovered","grey","ai","aiLight","content","primary","secondary","primaryInverse","secondaryInverse","stroke","lightAlt","brandLightAlt","special","whatsapp","gradient","dark","gradientArr","google","facebook","text","disabled","altPrimary","altSecondary","FONTS","display","fontWeight","fontSize","lineHeight","letterSpacing","titleXLarge","titleLarge","titleMedium","titleRegular","titleSmall","bodyPrimary","bodyLarge","bodySecondary","caption","tiny","subHeading","title1","title1Mobile","title2","title2Mobile","title3","title3Mobile","title4","textPlaceholder","title4Mobile","bodyRegularMobile","bodyRegular","bodySmall","buttonLarge","buttonRegular","captionMobile","captionBold","text1Bold","toast","toastMobile","DEFAULT_THEME","colorsV2","fonts"],"mappings":"AAAO,MAAMA,EAAc,CAC1BC,MAAO,CACN,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,GAAI,UACJ,GAAI,WAELC,UAAW,CACV,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,GAAI,UACJ,GAAI,UACJC,MAAO,UACPC,MAA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AY,GACZC,cAAe,GAEhByB,cAAe,CACd5B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB0B,cAAe,CACd7B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB2B,YAAa,CACZ9B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB4B,UAAW,CACV/B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB6B,MAAO,CACNhC,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB8B,YAAa,CACZjC,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,IAKJ+B,EAAgB,CAC5BC,SAAU/E,EACVgF,MAAOtC"}
1
+ {"version":3,"file":"Theme.js","sources":["../../../src/constants/Theme.ts"],"sourcesContent":["export const BASE_COLORS = {\n\tbrand: {\n\t\t900: '#28034E',\n\t\t850: '#360A63',\n\t\t800: '#4B1583',\n\t\t700: '#5E3A83',\n\t\t500: '#731DCF',\n\t\t100: '#F3EDF9',\n\t\t50: '#EFE6F9',\n\t\t10: '#F9F3FF',\n\t},\n\tgrayscale: {\n\t\t900: '#212121',\n\t\t700: '#616161',\n\t\t500: '#9E9E9E',\n\t\t400: '#BDBDBD',\n\t\t200: '#E0E0E0',\n\t\t100: '#F0F0F0',\n\t\t70: '#F7F7F7',\n\t\t50: '#FAFAFA',\n\t\twhite: '#FFFFFF',\n\t\talpha: '#00000088',\n\t},\n\tnegative: {\n\t\t900: '#B92321',\n\t\t700: '#D53434',\n\t\t100: '#FFCED4',\n\t\t50: '#FFEBEF',\n\t},\n\twarning: {\n\t\t900: '#99631B',\n\t\t500: '#FEC02D',\n\t\t100: '#FFEABE',\n\t\t50: '#FFF7E5',\n\t},\n\tpositive: {\n\t\t900: '#00580E',\n\t\t700: '#1A872C',\n\t\t100: '#C3E4C4',\n\t\t50: '#E6F4E7',\n\t},\n\tbikAi: {\n\t\t500: 'linear-gradient(93deg, #FF166A 0.37%, #FB5F08 100%)',\n\t\t100: 'linear-gradient(93deg, #FEBAD2 0.37%, #FDD1B9 100%)',\n\t\t50: 'linear-gradient(93deg, #FFE6EE 0.37%, #FFF0E7 100%)',\n\t},\n};\n\nexport const COLORS = {\n\tbackground: {\n\t\tinactive: BASE_COLORS.grayscale['200'],\n\t\tbase: BASE_COLORS.grayscale['100'],\n\t\tinverse: BASE_COLORS.brand['900'],\n\t\tinverseLight: BASE_COLORS.brand['800'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tbrandLight: BASE_COLORS.brand['50'],\n\t\tbrandVeryLight: BASE_COLORS.brand['10'],\n\t\tpureWhite: BASE_COLORS.grayscale.white,\n\t\tbrandTint: BASE_COLORS.brand['100'],\n\t\tbrandHovered: BASE_COLORS.brand['850'],\n\t\tnegative: {\n\t\t\tvibrant: BASE_COLORS.negative['700'],\n\t\t\tlight: BASE_COLORS.negative['50'],\n\t\t},\n\t\twarning: {\n\t\t\tvibrant: BASE_COLORS.warning['500'],\n\t\t\tlight: BASE_COLORS.warning['50'],\n\t\t},\n\t\tpositive: {\n\t\t\tvibrant: BASE_COLORS.positive['700'],\n\t\t\tlight: BASE_COLORS.positive['50'],\n\t\t},\n\t\tblue: {\n\t\t\tlight: '#E5F2FF',\n\t\t},\n\t},\n\ticon: { placeholder: '#9E9E9E' },\n\tscrim: {\n\t\tstandard: '#00000099',\n\t},\n\tsurface: {\n\t\tstandard: BASE_COLORS.grayscale['white'],\n\t\tsubdued: BASE_COLORS.grayscale['50'],\n\t\thovered: BASE_COLORS.grayscale['100'],\n\t\tgrey: BASE_COLORS.grayscale['70'],\n\t\tai: BASE_COLORS.bikAi['500'],\n\t\taiLight: BASE_COLORS.bikAi['50'],\n\t},\n\tcontent: {\n\t\tprimary: BASE_COLORS.grayscale['900'],\n\t\tsecondary: BASE_COLORS.grayscale['700'],\n\t\tplaceholder: BASE_COLORS.grayscale['500'],\n\t\tinactive: BASE_COLORS.grayscale['400'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tprimaryInverse: BASE_COLORS.grayscale['white'],\n\t\tsecondaryInverse: '#ffffffcc',\n\t\tnegative: BASE_COLORS.negative['900'],\n\t\twarning: BASE_COLORS.warning['900'],\n\t\tpositive: BASE_COLORS.positive['900'],\n\t\tblue: '#28458F',\n\t\tai: BASE_COLORS.bikAi['500'],\n\t},\n\tstroke: {\n\t\tprimary: BASE_COLORS.grayscale['200'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\tnegative: {\n\t\t\tlightAlt: BASE_COLORS.negative['100'],\n\t\t\tvibrant: BASE_COLORS.negative['700'],\n\t\t},\n\t\twarning: {\n\t\t\tlightAlt: BASE_COLORS.warning['100'],\n\t\t\tvibrant: BASE_COLORS.warning['500'],\n\t\t},\n\t\tpositive: {\n\t\t\tlightAlt: BASE_COLORS.positive['100'],\n\t\t\tvibrant: BASE_COLORS.positive['700'],\n\t\t},\n\t\tbrandLightAlt: '#DDCCF0',\n\t\tbrandSubdued: BASE_COLORS.brand['700'],\n\t\tblue: {\n\t\t\tlightAlt: '#C3D5E5',\n\t\t},\n\t\tai: {\n\t\t\tlightAlt: '#FEBAD2',\n\t\t\tvibrant: '#F23275',\n\t\t},\n\t},\n\tspecial: {\n\t\twhatsapp: {\n\t\t\tbrand: '#25D366',\n\t\t\tgradient: 'linear-gradient(360deg, #20B038 0%, #60D66A 100%)',\n\t\t\tdark: '#455A64',\n\t\t\tgradientArr: ['#20B038', '#60D66A'],\n\t\t},\n\t\tbrand: {\n\t\t\tgoogle: '#DD4B39',\n\t\t\tfacebook: '#1877F2',\n\t\t},\n\t},\n\ttext: {\n\t\tprimary: BASE_COLORS.grayscale['900'],\n\t\tsecondary: BASE_COLORS.grayscale['700'],\n\t\tplaceholder: BASE_COLORS.grayscale['500'],\n\t\tdisabled: BASE_COLORS.grayscale['400'],\n\t\twhite: BASE_COLORS.grayscale['white'],\n\t\tbrand: BASE_COLORS.brand['500'],\n\t\taltPrimary: BASE_COLORS.brand['900'],\n\t\taltSecondary: BASE_COLORS.brand['800'],\n\t},\n};\n\nexport const FONTS = {\n\tdisplay: {\n\t\tfontWeight: '400',\n\t\tfontSize: 32,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleXLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 32,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 28,\n\t\tlineHeight: 40,\n\t\tletterSpacing: 0,\n\t},\n\ttitleMedium: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\ttitleRegular: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitleSmall: {\n\t\tfontWeight: '600',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tbodyPrimary: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\tbodyLarge: {\n\t\tfontWeight: '400',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\tbodySecondary: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tcaption: {\n\t\tfontWeight: '400',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttiny: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tsubHeading: {\n\t\tfontWeight: '600',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\n\ttitle1: {\n\t\tfontWeight: '600',\n\t\tfontSize: 24,\n\t\tlineHeight: 32,\n\t\tletterSpacing: 0,\n\t},\n\ttitle1Mobile: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 30,\n\t\tletterSpacing: 0,\n\t},\n\ttitle2: {\n\t\tfontWeight: '600',\n\t\tfontSize: 20,\n\t\tlineHeight: 28,\n\t\tletterSpacing: 0,\n\t},\n\ttitle2Mobile: {\n\t\tfontWeight: '600',\n\t\tfontSize: 18,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitle3: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttitle3Mobile: {\n\t\tfontWeight: '500',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\ttitle4: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\ttextPlaceholder: {\n\t\tfontWeight: '400',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttitle4Mobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\tbodyRegularMobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 14,\n\t\tlineHeight: 18,\n\t\tletterSpacing: 0,\n\t},\n\tbodyRegular: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\n\tbodySmall: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tbuttonLarge: {\n\t\tfontWeight: '600',\n\t\tfontSize: 16,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tbuttonRegular: {\n\t\tfontWeight: '600',\n\t\tfontSize: 14,\n\t\tlineHeight: 20,\n\t\tletterSpacing: 0,\n\t},\n\tcaptionMobile: {\n\t\tfontWeight: '500',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n\tcaptionBold: {\n\t\tfontWeight: '700',\n\t\tfontSize: 12,\n\t\tlineHeight: 16,\n\t\tletterSpacing: 0,\n\t},\n\ttext1Bold: {\n\t\tfontWeight: '700',\n\t\tfontSize: 10,\n\t\tlineHeight: 14,\n\t\tletterSpacing: 0,\n\t},\n\ttoast: {\n\t\tfontWeight: '400',\n\t\tfontSize: 16,\n\t\tlineHeight: 24,\n\t\tletterSpacing: 0,\n\t},\n\ttoastMobile: {\n\t\tfontWeight: '400',\n\t\tfontSize: 10,\n\t\tlineHeight: 12,\n\t\tletterSpacing: 0,\n\t},\n};\n\n// For backward compatibility\nexport const DEFAULT_THEME = {\n\tcolorsV2: COLORS,\n\tfonts: FONTS,\n};\n"],"names":["BASE_COLORS","brand","grayscale","white","alpha","negative","warning","positive","bikAi","COLORS","background","inactive","base","inverse","inverseLight","brandLight","brandVeryLight","pureWhite","brandTint","brandHovered","vibrant","light","blue","icon","placeholder","scrim","standard","surface","subdued","hovered","grey","ai","aiLight","content","primary","secondary","primaryInverse","secondaryInverse","stroke","lightAlt","brandLightAlt","brandSubdued","special","whatsapp","gradient","dark","gradientArr","google","facebook","text","disabled","altPrimary","altSecondary","FONTS","display","fontWeight","fontSize","lineHeight","letterSpacing","titleXLarge","titleLarge","titleMedium","titleRegular","titleSmall","bodyPrimary","bodyLarge","bodySecondary","caption","tiny","subHeading","title1","title1Mobile","title2","title2Mobile","title3","title3Mobile","title4","textPlaceholder","title4Mobile","bodyRegularMobile","bodyRegular","bodySmall","buttonLarge","buttonRegular","captionMobile","captionBold","text1Bold","toast","toastMobile","DEFAULT_THEME","colorsV2","fonts"],"mappings":"AAAO,MAAMA,EAAc,CAC1BC,MAAO,CACN,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,GAAI,UACJ,GA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Ae,GAEhBsB,YAAa,CACZzB,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAGhBuB,UAAW,CACV1B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhBwB,YAAa,CACZ3B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhByB,cAAe,CACd5B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB0B,cAAe,CACd7B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB2B,YAAa,CACZ9B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB4B,UAAW,CACV/B,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB6B,MAAO,CACNhC,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,GAEhB8B,YAAa,CACZjC,WAAY,MACZC,SAAU,GACVC,WAAY,GACZC,cAAe,IAKJ+B,EAAgB,CAC5BC,SAAUjF,EACVkF,MAAOtC"}
@@ -1,2 +1,2 @@
1
- import{DOMSerializer as t,DOMParser as e}from"../node_modules/prosemirror-model/dist/index.js";function n(t){return t.replace(/<p[^>]*>\s*<br\s*\/?>\s*<\/p>/gi,"<p></p>").replace(/<\/?span[^>]*>/gi,"")}function i(t,i){const r=n(i),o=document.createElement("div");o.innerHTML=r;const s=e.fromSchema(t.schema).parseSlice(o);if(0===s.size)return;const{from:c,to:l}=t.state.selection,d=t.state.tr.replaceRange(c,l,s);t.view.dispatch(d)}const r=t=>`<div data-section-divider="${t}" style="display:none;height:0;line-height:0;overflow:hidden;"></div>`;function o(t,e){let n=t;for(const t of e)n+=r(t.id)+t.content;return n}function s(t){var e;if(!t)return"";return null!==(e=l(t).get("body"))&&void 0!==e?e:t}function c(t){if(!t)return"";const e=s(t);return t.substring(e.length)}function l(t){const e=new Map,n=/<div[^>]*data-section-divider="([^"]*)[^>]*>\s*<\/div>/g,i=[];let r;for(;null!==(r=n.exec(t));)i.push({id:r[1],index:r.index,endIndex:r.index+r[0].length});if(0===i.length)return e.set("body",t),e;e.set("body",t.slice(0,i[0].index));for(let n=0;n<i.length;n++){const r=i[n].endIndex,o=n+1<i.length?i[n+1].index:t.length;e.set(i[n].id,t.slice(r,o))}return e}function d(e,n){var i;const r=h(e,n);if(-1===r)return{html:"",text:"",isEmpty:!0,characterCount:0};const o=m(e,n),s=e.state.doc.slice(r,o),c=document.createElement("div"),l=t.fromSchema(e.schema);c.appendChild(l.serializeFragment(s.content));const d=c.innerHTML,u=null!==(i=c.textContent)&&void 0!==i?i:"";return{html:d,text:u,isEmpty:!u.trim(),characterCount:u.length}}function u(t,n,i){const o=h(t,n);if(-1===o){const e=t.state.doc.content.size,o=r(n)+i;return void t.commands.insertContentAt(e,o,{updateSelection:!1})}const s=m(t,n),c=function(t,n){const i=document.createElement("div");return i.innerHTML=n,e.fromSchema(t.schema).parse(i).content}(t,i),{tr:l}=t.state,d="body"===n?0:o;l.replaceWith(d,s,c),l.setMeta("addToHistory",!1),t.view.dispatch(l)}function a(t){return d(t,"body")}function f(t){var e,n,i,r;return{bold:t.isActive("bold"),italic:t.isActive("italic"),underline:t.isActive("underline"),strike:t.isActive("strike"),bulletList:t.isActive("bulletList"),orderedList:t.isActive("orderedList"),blockquote:t.isActive("blockquote"),codeBlock:t.isActive("codeBlock"),link:(()=>{var e,n,i;if(t.isActive("link"))return{href:null!==(e=t.getAttributes("link").href)&&void 0!==e?e:""};const{$from:r}=t.state.selection;if(r.pos>0){const t=r.doc.resolve(r.pos).marks().find((t=>"link"===t.type.name));if(t)return{href:null!==(i=t.attrs.href)&&void 0!==i?i:""};{const t=r.nodeBefore,e=null==t?void 0:t.marks.find((t=>"link"===t.type.name));if(e)return{href:null!==(n=e.attrs.href)&&void 0!==n?n:""}}}return null})(),textAlign:t.isActive({textAlign:"center"})?"center":t.isActive({textAlign:"right"})?"right":t.isActive({textAlign:"justify"})?"justify":t.isActive({textAlign:"left"})?"left":null,fontFamily:null!==(e=t.getAttributes("textStyle").fontFamily)&&void 0!==e?e:null,fontSize:null!==(n=t.getAttributes("textStyle").fontSize)&&void 0!==n?n:null,color:null!==(i=t.getAttributes("textStyle").color)&&void 0!==i?i:null,highlight:t.isActive("highlight")?null!==(r=t.getAttributes("highlight").color)&&void 0!==r?r:"default":null,superscript:t.isActive("superscript"),subscript:t.isActive("subscript")}}function v(t){var e,n,i;return{html:t.getHTML(),text:t.getText(),isEmpty:t.isEmpty,characterCount:null!==(i=null===(n=null===(e=t.storage.characterCount)||void 0===e?void 0:e.characters)||void 0===n?void 0:n.call(e))&&void 0!==i?i:t.getText().length}}function h(t,e){if("body"===e)return 1;let n=-1;return t.state.doc.descendants(((t,i)=>{if(-1!==n)return!1;"sectionDivider"===t.type.name&&t.attrs.sectionId===e&&(n=i+t.nodeSize)})),n}function m(t,e){const n=t.state.doc,i=n.content.size;if("body"===e){let t=-1;return n.descendants(((e,n)=>{if(-1!==t)return!1;"sectionDivider"===e.type.name&&(t=n)})),-1!==t?t:i}let r=!1,o=-1;return n.descendants(((t,n)=>-1===o&&(r?void("sectionDivider"===t.type.name&&(o=n)):("sectionDivider"===t.type.name&&t.attrs.sectionId===e&&(r=!0),!1)))),-1!==o?o:i}export{r as SECTION_DIVIDER_HTML,o as buildSectionedContent,f as extractActiveFormats,l as extractAllSectionsFromHtml,a as extractBodyContent,v as extractContent,d as extractSectionContent,m as findSectionEndPos,h as findSectionStartPos,s as getBodyHtml,c as getSectionsHtml,i as insertInlineHtml,n as normalizeHtml,u as setSectionContentInEditor};
1
+ import{DOMSerializer as t,DOMParser as e}from"../node_modules/prosemirror-model/dist/index.js";function n(t){return t.replace(/<p>\s*<br\s*\/?>\s*<\/p>/gi,"<p></p>").replace(/<\/?span[^>]*>/gi,"")}function i(t,i){const r=n(i),o=document.createElement("div");o.innerHTML=r;const s=e.fromSchema(t.schema).parseSlice(o);if(0===s.size)return;const{from:c,to:l}=t.state.selection,d=t.state.tr.replaceRange(c,l,s);t.view.dispatch(d)}const r=t=>`<div data-section-divider="${t}" style="display:none;height:0;line-height:0;overflow:hidden;"></div>`;function o(t,e){let n=t;for(const t of e)n+=r(t.id)+t.content;return n}function s(t){var e;if(!t)return"";return null!==(e=l(t).get("body"))&&void 0!==e?e:t}function c(t){if(!t)return"";const e=s(t);return t.substring(e.length)}function l(t){const e=new Map,n=/<div[^>]*data-section-divider="([^"]*)[^>]*>\s*<\/div>/g,i=[];let r;for(;null!==(r=n.exec(t));)i.push({id:r[1],index:r.index,endIndex:r.index+r[0].length});if(0===i.length)return e.set("body",t),e;e.set("body",t.slice(0,i[0].index));for(let n=0;n<i.length;n++){const r=i[n].endIndex,o=n+1<i.length?i[n+1].index:t.length;e.set(i[n].id,t.slice(r,o))}return e}function d(e,n){var i;const r=h(e,n);if(-1===r)return{html:"",text:"",isEmpty:!0,characterCount:0};const o=m(e,n),s=e.state.doc.slice(r,o),c=document.createElement("div"),l=t.fromSchema(e.schema);c.appendChild(l.serializeFragment(s.content));const d=c.innerHTML,u=null!==(i=c.textContent)&&void 0!==i?i:"";return{html:d,text:u,isEmpty:!u.trim(),characterCount:u.length}}function u(t,n,i){const o=h(t,n);if(-1===o){const e=t.state.doc.content.size,o=r(n)+i;return void t.commands.insertContentAt(e,o,{updateSelection:!1})}const s=m(t,n),c=function(t,n){const i=document.createElement("div");return i.innerHTML=n,e.fromSchema(t.schema).parse(i).content}(t,i),{tr:l}=t.state,d="body"===n?0:o;l.replaceWith(d,s,c),l.setMeta("addToHistory",!1),t.view.dispatch(l)}function a(t){return d(t,"body")}function f(t){var e,n,i,r;return{bold:t.isActive("bold"),italic:t.isActive("italic"),underline:t.isActive("underline"),strike:t.isActive("strike"),bulletList:t.isActive("bulletList"),orderedList:t.isActive("orderedList"),blockquote:t.isActive("blockquote"),codeBlock:t.isActive("codeBlock"),link:(()=>{var e,n,i;if(t.isActive("link"))return{href:null!==(e=t.getAttributes("link").href)&&void 0!==e?e:""};const{$from:r}=t.state.selection;if(r.pos>0){const t=r.doc.resolve(r.pos).marks().find((t=>"link"===t.type.name));if(t)return{href:null!==(i=t.attrs.href)&&void 0!==i?i:""};{const t=r.nodeBefore,e=null==t?void 0:t.marks.find((t=>"link"===t.type.name));if(e)return{href:null!==(n=e.attrs.href)&&void 0!==n?n:""}}}return null})(),textAlign:t.isActive({textAlign:"center"})?"center":t.isActive({textAlign:"right"})?"right":t.isActive({textAlign:"justify"})?"justify":t.isActive({textAlign:"left"})?"left":null,fontFamily:null!==(e=t.getAttributes("textStyle").fontFamily)&&void 0!==e?e:null,fontSize:null!==(n=t.getAttributes("textStyle").fontSize)&&void 0!==n?n:null,color:null!==(i=t.getAttributes("textStyle").color)&&void 0!==i?i:null,highlight:t.isActive("highlight")?null!==(r=t.getAttributes("highlight").color)&&void 0!==r?r:"default":null,superscript:t.isActive("superscript"),subscript:t.isActive("subscript")}}function v(t){var e,n,i;return{html:t.getHTML(),text:t.getText(),isEmpty:t.isEmpty,characterCount:null!==(i=null===(n=null===(e=t.storage.characterCount)||void 0===e?void 0:e.characters)||void 0===n?void 0:n.call(e))&&void 0!==i?i:t.getText().length}}function h(t,e){if("body"===e)return 1;let n=-1;return t.state.doc.descendants(((t,i)=>{if(-1!==n)return!1;"sectionDivider"===t.type.name&&t.attrs.sectionId===e&&(n=i+t.nodeSize)})),n}function m(t,e){const n=t.state.doc,i=n.content.size;if("body"===e){let t=-1;return n.descendants(((e,n)=>{if(-1!==t)return!1;"sectionDivider"===e.type.name&&(t=n)})),-1!==t?t:i}let r=!1,o=-1;return n.descendants(((t,n)=>-1===o&&(r?void("sectionDivider"===t.type.name&&(o=n)):("sectionDivider"===t.type.name&&t.attrs.sectionId===e&&(r=!0),!1)))),-1!==o?o:i}export{r as SECTION_DIVIDER_HTML,o as buildSectionedContent,f as extractActiveFormats,l as extractAllSectionsFromHtml,a as extractBodyContent,v as extractContent,d as extractSectionContent,m as findSectionEndPos,h as findSectionStartPos,s as getBodyHtml,c as getSectionsHtml,i as insertInlineHtml,n as normalizeHtml,u as setSectionContentInEditor};
2
2
  //# sourceMappingURL=BikEditor.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditor.utils.js","sources":["../../../src/editor/BikEditor.utils.ts"],"sourcesContent":["import { Editor } from '@tiptap/core';\nimport { DOMParser, DOMSerializer } from 'prosemirror-model';\nimport { EditorSnapshot, FormatState } from './BikEditor.types';\n\n// ---------------------------------------------------------------------------\n// HTML normalisation\n// ---------------------------------------------------------------------------\n\n/**\n * Normalise HTML before passing it to TipTap.\n *\n * Empty paragraphs containing only a `<br>` (e.g. `<p><br></p>` or\n * `<p style=\"...\"><br></p>`) are collapsed to `<p></p>` so they render\n * with 0 height. This is in sync with how Gmail renders HTML.\n */\nexport function normalizeHtml(html: string): string {\n\treturn html\n\t\t.replace(/<p[^>]*>\\s*<br\\s*\\/?>\\s*<\\/p>/gi, '<p></p>')\n\t\t.replace(/<\\/?span[^>]*>/gi, '');\n}\n\n// ---------------------------------------------------------------------------\n// Inline content insertion\n// ---------------------------------------------------------------------------\n\n/**\n * Insert HTML at the current cursor position, merging the first paragraph\n * inline while preserving the block structure of subsequent paragraphs/lists.\n *\n * Uses `parseSlice` which returns an open-ended Slice — the first block merges\n * at the cursor, middle blocks stay intact, and the last block merges with any\n * text that follows the cursor.\n */\nexport function insertInlineHtml(editor: Editor, html: string): void {\n\tconst normalised = normalizeHtml(html);\n\tconst dom = document.createElement('div');\n\tdom.innerHTML = normalised;\n\tconst slice = DOMParser.fromSchema(editor.schema).parseSlice(dom);\n\n\tif (slice.size === 0) return;\n\n\tconst { from, to } = editor.state.selection;\n\tconst tr = editor.state.tr.replaceRange(from, to, slice);\n\teditor.view.dispatch(tr);\n}\n\n// ---------------------------------------------------------------------------\n// Section divider HTML\n// ---------------------------------------------------------------------------\n\nexport const SECTION_DIVIDER_HTML = (id: string) =>\n\t`<div data-section-divider=\"${id}\" style=\"display:none;height:0;line-height:0;overflow:hidden;\"></div>`;\n\n/**\n * Build initial HTML for an editor with one or more named sections below the body.\n * Each section is separated by an invisible divider node.\n *\n * @example\n * buildSectionedContent('<p>Body</p>', [\n * { id: 'signature', content: '<p>Alice</p>' },\n * { id: 'forwarded', content: '<p>--- fwd ---</p>' },\n * ])\n */\nexport function buildSectionedContent(\n\tbody: string,\n\tsections: Array<{ id: string; content: string }>,\n): string {\n\tlet html = body;\n\tfor (const s of sections) {\n\t\thtml += SECTION_DIVIDER_HTML(s.id) + s.content;\n\t}\n\treturn html;\n}\n\n// ---------------------------------------------------------------------------\n// Section extraction\n// ---------------------------------------------------------------------------\n\n/**\n * Parse the editor HTML into a Map of sectionId → raw HTML string.\n * The special key `'body'` always holds the content before the first divider.\n * Map iteration order matches document order.\n */\nexport function extractAllSections(editor: Editor): Map<string, string> {\n\treturn extractAllSectionsFromHtml(editor.getHTML());\n}\n\n/**\n * Extract just the body portion (everything before the first section divider)\n * from an HTML string produced by BikEditor. Safe to call on plain HTML too —\n * returns the full string when no dividers are present.\n */\nexport function getBodyHtml(html: string): string {\n\tif (!html) return '';\n\tconst sections = extractAllSectionsFromHtml(html);\n\treturn sections.get('body') ?? html;\n}\n\n/**\n * Extract everything from the first section divider onward (dividers + their\n * content). Returns an empty string when there are no sections.\n */\nexport function getSectionsHtml(html: string): string {\n\tif (!html) return '';\n\tconst body = getBodyHtml(html);\n\treturn html.substring(body.length);\n}\n\nexport function extractAllSectionsFromHtml(html: string): Map<string, string> {\n\tconst sections = new Map<string, string>();\n\tconst dividerRegex =\n\t\t/<div[^>]*data-section-divider=\"([^\"]*)[^>]*>\\s*<\\/div>/g;\n\tconst dividers: Array<{ id: string; index: number; endIndex: number }> = [];\n\n\tlet match: RegExpExecArray | null;\n\twhile ((match = dividerRegex.exec(html)) !== null) {\n\t\tdividers.push({\n\t\t\tid: match[1],\n\t\t\tindex: match.index,\n\t\t\tendIndex: match.index + match[0].length,\n\t\t});\n\t}\n\n\tif (dividers.length === 0) {\n\t\tsections.set('body', html);\n\t\treturn sections;\n\t}\n\n\tsections.set('body', html.slice(0, dividers[0].index));\n\tfor (let i = 0; i < dividers.length; i++) {\n\t\tconst start = dividers[i].endIndex;\n\t\tconst end = i + 1 < dividers.length ? dividers[i + 1].index : html.length;\n\t\tsections.set(dividers[i].id, html.slice(start, end));\n\t}\n\n\treturn sections;\n}\n\n/** Returns BikEditorContent for a single named section (or 'body'). */\nexport function extractSectionContent(\n\teditor: Editor,\n\tid: string,\n): EditorSnapshot {\n\tconst startPos = findSectionStartPos(editor, id);\n\tif (startPos === -1)\n\t\treturn { html: '', text: '', isEmpty: true, characterCount: 0 };\n\tconst endPos = findSectionEndPos(editor, id);\n\tconst slice = editor.state.doc.slice(startPos, endPos);\n\tconst container = document.createElement('div');\n\tconst serializer = DOMSerializer.fromSchema(editor.schema);\n\tcontainer.appendChild(serializer.serializeFragment(slice.content));\n\tconst html = container.innerHTML;\n\tconst text = container.textContent ?? '';\n\treturn { html, text, isEmpty: !text.trim(), characterCount: text.length };\n}\n\n/**\n * Parse an HTML string into ProseMirror nodes using the editor's schema.\n */\nfunction parseHtmlToNodes(editor: Editor, html: string) {\n\tconst container = document.createElement('div');\n\tcontainer.innerHTML = html;\n\treturn DOMParser.fromSchema(editor.schema).parse(container).content;\n}\n\n/**\n * Replace the content of a single named section without touching others.\n * Uses a ProseMirror transaction to replace only the target range,\n * preserving undo history and other sections' state.\n * If the section doesn't exist yet, it is appended at the end of the document.\n */\nexport function setSectionContentInEditor(\n\teditor: Editor,\n\tid: string,\n\thtml: string,\n): void {\n\tconst startPos = findSectionStartPos(editor, id);\n\tif (startPos === -1) {\n\t\tconst endPos = editor.state.doc.content.size;\n\t\tconst dividerHtml = SECTION_DIVIDER_HTML(id) + html;\n\t\teditor.commands.insertContentAt(endPos, dividerHtml, {\n\t\t\tupdateSelection: false,\n\t\t});\n\t\treturn;\n\t}\n\tconst endPos = findSectionEndPos(editor, id);\n\tconst fragment = parseHtmlToNodes(editor, html);\n\tconst { tr } = editor.state;\n\t// For body, replace from position 0 (before the first paragraph's opening\n\t// boundary) so ProseMirror swaps entire block nodes cleanly. Position 1\n\t// (inside the paragraph) would force ProseMirror to close the open paragraph\n\t// first, creating a ghost empty <p></p>.\n\tconst replaceFrom = id === 'body' ? 0 : startPos;\n\ttr.replaceWith(replaceFrom, endPos, fragment);\n\ttr.setMeta('addToHistory', false);\n\teditor.view.dispatch(tr);\n}\n\n// ---------------------------------------------------------------------------\n// Convenience shorthands (body = first section)\n// ---------------------------------------------------------------------------\n\n/** Extract BikEditorContent for just the body (before the first divider). */\nexport function extractBodyContent(editor: Editor): EditorSnapshot {\n\treturn extractSectionContent(editor, 'body');\n}\n\n// ---------------------------------------------------------------------------\n// Active formats\n// ---------------------------------------------------------------------------\n\nexport function extractActiveFormats(editor: Editor): FormatState {\n\treturn {\n\t\tbold: editor.isActive('bold'),\n\t\titalic: editor.isActive('italic'),\n\t\tunderline: editor.isActive('underline'),\n\t\tstrike: editor.isActive('strike'),\n\t\tbulletList: editor.isActive('bulletList'),\n\t\torderedList: editor.isActive('orderedList'),\n\t\tblockquote: editor.isActive('blockquote'),\n\t\tcodeBlock: editor.isActive('codeBlock'),\n\t\tlink: (() => {\n\t\t\tif (editor.isActive('link')) {\n\t\t\t\treturn { href: editor.getAttributes('link')['href'] ?? '' };\n\t\t\t}\n\t\t\tconst { $from } = editor.state.selection;\n\t\t\tif ($from.pos > 0) {\n\t\t\t\tconst before = $from.doc.resolve($from.pos);\n\t\t\t\tconst linkMark = before.marks().find((m) => m.type.name === 'link');\n\t\t\t\tif (!linkMark) {\n\t\t\t\t\tconst nodeBefore = $from.nodeBefore;\n\t\t\t\t\tconst markOnPrev = nodeBefore?.marks.find(\n\t\t\t\t\t\t(m) => m.type.name === 'link',\n\t\t\t\t\t);\n\t\t\t\t\tif (markOnPrev) {\n\t\t\t\t\t\treturn { href: markOnPrev.attrs['href'] ?? '' };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn { href: linkMark.attrs['href'] ?? '' };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t})(),\n\t\ttextAlign: editor.isActive({ textAlign: 'center' })\n\t\t\t? 'center'\n\t\t\t: editor.isActive({ textAlign: 'right' })\n\t\t\t? 'right'\n\t\t\t: editor.isActive({ textAlign: 'justify' })\n\t\t\t? 'justify'\n\t\t\t: editor.isActive({ textAlign: 'left' })\n\t\t\t? 'left'\n\t\t\t: null,\n\t\tfontFamily: editor.getAttributes('textStyle')['fontFamily'] ?? null,\n\t\tfontSize: editor.getAttributes('textStyle')['fontSize'] ?? null,\n\t\tcolor: editor.getAttributes('textStyle')['color'] ?? null,\n\t\thighlight: editor.isActive('highlight')\n\t\t\t? editor.getAttributes('highlight')['color'] ?? 'default'\n\t\t\t: null,\n\t\tsuperscript: editor.isActive('superscript'),\n\t\tsubscript: editor.isActive('subscript'),\n\t};\n}\n\nexport function extractContent(editor: Editor): EditorSnapshot {\n\treturn {\n\t\thtml: editor.getHTML(),\n\t\ttext: editor.getText(),\n\t\tisEmpty: editor.isEmpty,\n\t\tcharacterCount:\n\t\t\teditor.storage.characterCount?.characters?.() ?? editor.getText().length,\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Section position helpers (used by insertAtSectionStart/End and appendBodyContent)\n// ---------------------------------------------------------------------------\n\n/**\n * Returns the ProseMirror position immediately after a section's opening divider\n * (i.e. the start of the section's own content).\n * For `'body'`, returns 1 (beginning of the document).\n * Returns -1 if the named section's divider is not found.\n */\nexport function findSectionStartPos(editor: Editor, sectionId: string): number {\n\tif (sectionId === 'body') return 1;\n\tlet startPos = -1;\n\teditor.state.doc.descendants((node, pos) => {\n\t\tif (startPos !== -1) return false;\n\t\tif (\n\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t) {\n\t\t\tstartPos = pos + node.nodeSize; // position right after the divider\n\t\t}\n\t});\n\treturn startPos;\n}\n\n/**\n * Returns the ProseMirror position at the end of a named section's content:\n * - For `'body'`: position of the first section divider, or end of document.\n * - For a named section: position of the next divider, or end of document.\n */\nexport function findSectionEndPos(editor: Editor, sectionId: string): number {\n\tconst doc = editor.state.doc;\n\tconst docSize = doc.content.size;\n\n\tif (sectionId === 'body') {\n\t\tlet firstDividerPos = -1;\n\t\tdoc.descendants((node, pos) => {\n\t\t\tif (firstDividerPos !== -1) return false;\n\t\t\tif (node.type.name === 'sectionDivider') {\n\t\t\t\tfirstDividerPos = pos;\n\t\t\t}\n\t\t});\n\t\treturn firstDividerPos !== -1 ? firstDividerPos : docSize;\n\t}\n\n\tlet passedSection = false;\n\tlet nextDividerPos = -1;\n\tdoc.descendants((node, pos) => {\n\t\tif (nextDividerPos !== -1) return false;\n\t\tif (!passedSection) {\n\t\t\tif (\n\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t) {\n\t\t\t\tpassedSection = true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (node.type.name === 'sectionDivider') {\n\t\t\tnextDividerPos = pos;\n\t\t}\n\t});\n\treturn nextDividerPos !== -1 ? nextDividerPos : docSize;\n}\n"],"names":["normalizeHtml","html","replace","insertInlineHtml","editor","normalised","dom","document","createElement","innerHTML","slice","DOMParser","fromSchema","schema","parseSlice","size","from","to","state","selection","tr","replaceRange","view","dispatch","SECTION_DIVIDER_HTML","id","buildSectionedContent","body","sections","s","content","getBodyHtml","_a","extractAllSectionsFromHtml","get","getSectionsHtml","substring","length","Map","dividerRegex","dividers","match","exec","push","index","endIndex","set","i","start","end","extractSectionContent","startPos","findSectionStartPos","text","isEmpty","characterCount","endPos","findSectionEndPos","doc","container","serializer","DOMSerializer","appendChild","serializeFragment","textContent","trim","setSectionContentInEditor","dividerHtml","commands","insertContentAt","updateSelection","fragment","parse","parseHtmlToNodes","replaceFrom","replaceWith","setMeta","extractBodyContent","extractActiveFormats","bold","isActive","italic","underline","strike","bulletList","orderedList","blockquote","codeBlock","link","href","getAttributes","$from","pos","linkMark","resolve","marks","find","m","type","name","_c","attrs","nodeBefore","markOnPrev","_b","textAlign","fontFamily","fontSize","color","highlight","_d","superscript","subscript","extractContent","getHTML","getText","storage","characters","sectionId","descendants","node","nodeSize","docSize","firstDividerPos","passedSection","nextDividerPos"],"mappings":"+FAeM,SAAUA,EAAcC,GAC7B,OAAOA,EACLC,QAAQ,kCAAmC,WAC3CA,QAAQ,mBAAoB,GAC/B,CAcgB,SAAAC,EAAiBC,EAAgBH,GAChD,MAAMI,EAAaL,EAAcC,GAC3BK,EAAMC,SAASC,cAAc,OACnCF,EAAIG,UAAYJ,EAChB,MAAMK,EAAQC,EAAUC,WAAWR,EAAOS,QAAQC,WAAWR,GAE7D,GAAmB,IAAfI,EAAMK,KAAY,OAEtB,MAAMC,KAAEA,EAAIC,GAAEA,GAAOb,EAAOc,MAAMC,UAC5BC,EAAKhB,EAAOc,MAAME,GAAGC,aAAaL,EAAMC,EAAIP,GAClDN,EAAOkB,KAAKC,SAASH,EACtB,OAMaI,EAAwBC,GACpC,8BAA8BA,yEAYf,SAAAC,EACfC,EACAC,GAEA,IAAI3B,EAAO0B,EACX,IAAK,MAAME,KAAKD,EACf3B,GAAQuB,EAAqBK,EAAEJ,IAAMI,EAAEC,QAExC,OAAO7B,CACR,CAoBM,SAAU8B,EAAY9B,SAC3B,IAAKA,EAAM,MAAO,GAElB,OAA+B,QAAxB+B,EADUC,EAA2BhC,GAC5BiC,IAAI,eAAW,IAAAF,EAAAA,EAAA/B,CAChC,CAMM,SAAUkC,EAAgBlC,GAC/B,IAAKA,EAAM,MAAO,GAClB,MAAM0B,EAAOI,EAAY9B,GACzB,OAAOA,EAAKmC,UAAUT,EAAKU,OAC5B,CAEM,SAAUJ,EAA2BhC,GAC1C,MAAM2B,EAAW,IAAIU,IACfC,EACL,0DACKC,EAAmE,GAEzE,IAAIC,EACJ,KAA6C,QAArCA,EAAQF,EAAaG,KAAKzC,KACjCuC,EAASG,KAAK,CACblB,GAAIgB,EAAM,GACVG,MAAOH,EAAMG,M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mBAAnBqE,EAAKtB,KAAKC,MACVqB,EAAKnB,MAAiB,YAAMiB,IAE5BnE,EAAWyC,EAAM4B,EAAKC,SACtB,IAEKtE,CACR,CAOgB,SAAAM,EAAkBrD,EAAgBkH,GACjD,MAAM5D,EAAMtD,EAAOc,MAAMwC,IACnBgE,EAAUhE,EAAI5B,QAAQf,KAE5B,GAAkB,SAAduG,EAAsB,CACzB,IAAIK,GAAmB,EAOvB,OANAjE,EAAI6D,aAAY,CAACC,EAAM5B,KACtB,IAAyB,IAArB+B,EAAwB,OAAO,EACZ,mBAAnBH,EAAKtB,KAAKC,OACbwB,EAAkB/B,EAClB,KAE0B,IAArB+B,EAAyBA,EAAkBD,CAClD,CAED,IAAIE,GAAgB,EAChBC,GAAkB,EAgBtB,OAfAnE,EAAI6D,aAAY,CAACC,EAAM5B,KACE,IAApBiC,IACCD,OASkB,mBAAnBJ,EAAKtB,KAAKC,OACb0B,EAAiBjC,KARG,mBAAnB4B,EAAKtB,KAAKC,MACVqB,EAAKnB,MAAiB,YAAMiB,IAE5BM,GAAgB,IAEV,OAMkB,IAApBC,EAAwBA,EAAiBH,CACjD"}
1
+ {"version":3,"file":"BikEditor.utils.js","sources":["../../../src/editor/BikEditor.utils.ts"],"sourcesContent":["import { Editor } from '@tiptap/core';\nimport { DOMParser, DOMSerializer } from 'prosemirror-model';\nimport { EditorSnapshot, FormatState } from './BikEditor.types';\n\n// ---------------------------------------------------------------------------\n// HTML normalisation\n// ---------------------------------------------------------------------------\n\n/**\n * Normalise HTML before passing it to TipTap.\n *\n * Problem: Quill uses `<p><br></p>` as a blank-line separator. TipTap's\n * HardBreak extension parses that `<br>` as a real `hard_break` node.\n * ProseMirror then also appends `<br class=\"ProseMirror-trailingBreak\">` as a\n * cursor-position decoration, making the empty paragraph render at **2× line\n * height** instead of 1×.\n *\n * Fix: replace `<p><br></p>` → `<p></p>` so TipTap stores a truly empty\n * paragraph. ProseMirror adds only the trailing decoration, giving the correct\n * 1× line height. The WA text output is unchanged (`\\n` either way after\n * surrounding-newline collapse in `toWhatsAppText`).\n */\nexport function normalizeHtml(html: string): string {\n\treturn html\n\t\t.replace(/<p>\\s*<br\\s*\\/?>\\s*<\\/p>/gi, '<p></p>')\n\t\t.replace(/<\\/?span[^>]*>/gi, '');\n}\n\n// ---------------------------------------------------------------------------\n// Inline content insertion\n// ---------------------------------------------------------------------------\n\n/**\n * Insert HTML at the current cursor position, merging the first paragraph\n * inline while preserving the block structure of subsequent paragraphs/lists.\n *\n * Uses `parseSlice` which returns an open-ended Slice — the first block merges\n * at the cursor, middle blocks stay intact, and the last block merges with any\n * text that follows the cursor.\n */\nexport function insertInlineHtml(editor: Editor, html: string): void {\n\tconst normalised = normalizeHtml(html);\n\tconst dom = document.createElement('div');\n\tdom.innerHTML = normalised;\n\tconst slice = DOMParser.fromSchema(editor.schema).parseSlice(dom);\n\n\tif (slice.size === 0) return;\n\n\tconst { from, to } = editor.state.selection;\n\tconst tr = editor.state.tr.replaceRange(from, to, slice);\n\teditor.view.dispatch(tr);\n}\n\n// ---------------------------------------------------------------------------\n// Section divider HTML\n// ---------------------------------------------------------------------------\n\nexport const SECTION_DIVIDER_HTML = (id: string) =>\n\t`<div data-section-divider=\"${id}\" style=\"display:none;height:0;line-height:0;overflow:hidden;\"></div>`;\n\n/**\n * Build initial HTML for an editor with one or more named sections below the body.\n * Each section is separated by an invisible divider node.\n *\n * @example\n * buildSectionedContent('<p>Body</p>', [\n * { id: 'signature', content: '<p>Alice</p>' },\n * { id: 'forwarded', content: '<p>--- fwd ---</p>' },\n * ])\n */\nexport function buildSectionedContent(\n\tbody: string,\n\tsections: Array<{ id: string; content: string }>,\n): string {\n\tlet html = body;\n\tfor (const s of sections) {\n\t\thtml += SECTION_DIVIDER_HTML(s.id) + s.content;\n\t}\n\treturn html;\n}\n\n// ---------------------------------------------------------------------------\n// Section extraction\n// ---------------------------------------------------------------------------\n\n/**\n * Parse the editor HTML into a Map of sectionId → raw HTML string.\n * The special key `'body'` always holds the content before the first divider.\n * Map iteration order matches document order.\n */\nexport function extractAllSections(editor: Editor): Map<string, string> {\n\treturn extractAllSectionsFromHtml(editor.getHTML());\n}\n\n/**\n * Extract just the body portion (everything before the first section divider)\n * from an HTML string produced by BikEditor. Safe to call on plain HTML too —\n * returns the full string when no dividers are present.\n */\nexport function getBodyHtml(html: string): string {\n\tif (!html) return '';\n\tconst sections = extractAllSectionsFromHtml(html);\n\treturn sections.get('body') ?? html;\n}\n\n/**\n * Extract everything from the first section divider onward (dividers + their\n * content). Returns an empty string when there are no sections.\n */\nexport function getSectionsHtml(html: string): string {\n\tif (!html) return '';\n\tconst body = getBodyHtml(html);\n\treturn html.substring(body.length);\n}\n\nexport function extractAllSectionsFromHtml(html: string): Map<string, string> {\n\tconst sections = new Map<string, string>();\n\tconst dividerRegex =\n\t\t/<div[^>]*data-section-divider=\"([^\"]*)[^>]*>\\s*<\\/div>/g;\n\tconst dividers: Array<{ id: string; index: number; endIndex: number }> = [];\n\n\tlet match: RegExpExecArray | null;\n\twhile ((match = dividerRegex.exec(html)) !== null) {\n\t\tdividers.push({\n\t\t\tid: match[1],\n\t\t\tindex: match.index,\n\t\t\tendIndex: match.index + match[0].length,\n\t\t});\n\t}\n\n\tif (dividers.length === 0) {\n\t\tsections.set('body', html);\n\t\treturn sections;\n\t}\n\n\tsections.set('body', html.slice(0, dividers[0].index));\n\tfor (let i = 0; i < dividers.length; i++) {\n\t\tconst start = dividers[i].endIndex;\n\t\tconst end = i + 1 < dividers.length ? dividers[i + 1].index : html.length;\n\t\tsections.set(dividers[i].id, html.slice(start, end));\n\t}\n\n\treturn sections;\n}\n\n/** Returns BikEditorContent for a single named section (or 'body'). */\nexport function extractSectionContent(\n\teditor: Editor,\n\tid: string,\n): EditorSnapshot {\n\tconst startPos = findSectionStartPos(editor, id);\n\tif (startPos === -1)\n\t\treturn { html: '', text: '', isEmpty: true, characterCount: 0 };\n\tconst endPos = findSectionEndPos(editor, id);\n\tconst slice = editor.state.doc.slice(startPos, endPos);\n\tconst container = document.createElement('div');\n\tconst serializer = DOMSerializer.fromSchema(editor.schema);\n\tcontainer.appendChild(serializer.serializeFragment(slice.content));\n\tconst html = container.innerHTML;\n\tconst text = container.textContent ?? '';\n\treturn { html, text, isEmpty: !text.trim(), characterCount: text.length };\n}\n\n/**\n * Parse an HTML string into ProseMirror nodes using the editor's schema.\n */\nfunction parseHtmlToNodes(editor: Editor, html: string) {\n\tconst container = document.createElement('div');\n\tcontainer.innerHTML = html;\n\treturn DOMParser.fromSchema(editor.schema).parse(container).content;\n}\n\n/**\n * Replace the content of a single named section without touching others.\n * Uses a ProseMirror transaction to replace only the target range,\n * preserving undo history and other sections' state.\n * If the section doesn't exist yet, it is appended at the end of the document.\n */\nexport function setSectionContentInEditor(\n\teditor: Editor,\n\tid: string,\n\thtml: string,\n): void {\n\tconst startPos = findSectionStartPos(editor, id);\n\tif (startPos === -1) {\n\t\tconst endPos = editor.state.doc.content.size;\n\t\tconst dividerHtml = SECTION_DIVIDER_HTML(id) + html;\n\t\teditor.commands.insertContentAt(endPos, dividerHtml, {\n\t\t\tupdateSelection: false,\n\t\t});\n\t\treturn;\n\t}\n\tconst endPos = findSectionEndPos(editor, id);\n\tconst fragment = parseHtmlToNodes(editor, html);\n\tconst { tr } = editor.state;\n\t// For body, replace from position 0 (before the first paragraph's opening\n\t// boundary) so ProseMirror swaps entire block nodes cleanly. Position 1\n\t// (inside the paragraph) would force ProseMirror to close the open paragraph\n\t// first, creating a ghost empty <p></p>.\n\tconst replaceFrom = id === 'body' ? 0 : startPos;\n\ttr.replaceWith(replaceFrom, endPos, fragment);\n\ttr.setMeta('addToHistory', false);\n\teditor.view.dispatch(tr);\n}\n\n// ---------------------------------------------------------------------------\n// Convenience shorthands (body = first section)\n// ---------------------------------------------------------------------------\n\n/** Extract BikEditorContent for just the body (before the first divider). */\nexport function extractBodyContent(editor: Editor): EditorSnapshot {\n\treturn extractSectionContent(editor, 'body');\n}\n\n// ---------------------------------------------------------------------------\n// Active formats\n// ---------------------------------------------------------------------------\n\nexport function extractActiveFormats(editor: Editor): FormatState {\n\treturn {\n\t\tbold: editor.isActive('bold'),\n\t\titalic: editor.isActive('italic'),\n\t\tunderline: editor.isActive('underline'),\n\t\tstrike: editor.isActive('strike'),\n\t\tbulletList: editor.isActive('bulletList'),\n\t\torderedList: editor.isActive('orderedList'),\n\t\tblockquote: editor.isActive('blockquote'),\n\t\tcodeBlock: editor.isActive('codeBlock'),\n\t\tlink: (() => {\n\t\t\tif (editor.isActive('link')) {\n\t\t\t\treturn { href: editor.getAttributes('link')['href'] ?? '' };\n\t\t\t}\n\t\t\tconst { $from } = editor.state.selection;\n\t\t\tif ($from.pos > 0) {\n\t\t\t\tconst before = $from.doc.resolve($from.pos);\n\t\t\t\tconst linkMark = before.marks().find((m) => m.type.name === 'link');\n\t\t\t\tif (!linkMark) {\n\t\t\t\t\tconst nodeBefore = $from.nodeBefore;\n\t\t\t\t\tconst markOnPrev = nodeBefore?.marks.find(\n\t\t\t\t\t\t(m) => m.type.name === 'link',\n\t\t\t\t\t);\n\t\t\t\t\tif (markOnPrev) {\n\t\t\t\t\t\treturn { href: markOnPrev.attrs['href'] ?? '' };\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn { href: linkMark.attrs['href'] ?? '' };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t})(),\n\t\ttextAlign: editor.isActive({ textAlign: 'center' })\n\t\t\t? 'center'\n\t\t\t: editor.isActive({ textAlign: 'right' })\n\t\t\t? 'right'\n\t\t\t: editor.isActive({ textAlign: 'justify' })\n\t\t\t? 'justify'\n\t\t\t: editor.isActive({ textAlign: 'left' })\n\t\t\t? 'left'\n\t\t\t: null,\n\t\tfontFamily: editor.getAttributes('textStyle')['fontFamily'] ?? null,\n\t\tfontSize: editor.getAttributes('textStyle')['fontSize'] ?? null,\n\t\tcolor: editor.getAttributes('textStyle')['color'] ?? null,\n\t\thighlight: editor.isActive('highlight')\n\t\t\t? editor.getAttributes('highlight')['color'] ?? 'default'\n\t\t\t: null,\n\t\tsuperscript: editor.isActive('superscript'),\n\t\tsubscript: editor.isActive('subscript'),\n\t};\n}\n\nexport function extractContent(editor: Editor): EditorSnapshot {\n\treturn {\n\t\thtml: editor.getHTML(),\n\t\ttext: editor.getText(),\n\t\tisEmpty: editor.isEmpty,\n\t\tcharacterCount:\n\t\t\teditor.storage.characterCount?.characters?.() ?? editor.getText().length,\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Section position helpers (used by insertAtSectionStart/End and appendBodyContent)\n// ---------------------------------------------------------------------------\n\n/**\n * Returns the ProseMirror position immediately after a section's opening divider\n * (i.e. the start of the section's own content).\n * For `'body'`, returns 1 (beginning of the document).\n * Returns -1 if the named section's divider is not found.\n */\nexport function findSectionStartPos(editor: Editor, sectionId: string): number {\n\tif (sectionId === 'body') return 1;\n\tlet startPos = -1;\n\teditor.state.doc.descendants((node, pos) => {\n\t\tif (startPos !== -1) return false;\n\t\tif (\n\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t) {\n\t\t\tstartPos = pos + node.nodeSize; // position right after the divider\n\t\t}\n\t});\n\treturn startPos;\n}\n\n/**\n * Returns the ProseMirror position at the end of a named section's content:\n * - For `'body'`: position of the first section divider, or end of document.\n * - For a named section: position of the next divider, or end of document.\n */\nexport function findSectionEndPos(editor: Editor, sectionId: string): number {\n\tconst doc = editor.state.doc;\n\tconst docSize = doc.content.size;\n\n\tif (sectionId === 'body') {\n\t\tlet firstDividerPos = -1;\n\t\tdoc.descendants((node, pos) => {\n\t\t\tif (firstDividerPos !== -1) return false;\n\t\t\tif (node.type.name === 'sectionDivider') {\n\t\t\t\tfirstDividerPos = pos;\n\t\t\t}\n\t\t});\n\t\treturn firstDividerPos !== -1 ? firstDividerPos : docSize;\n\t}\n\n\tlet passedSection = false;\n\tlet nextDividerPos = -1;\n\tdoc.descendants((node, pos) => {\n\t\tif (nextDividerPos !== -1) return false;\n\t\tif (!passedSection) {\n\t\t\tif (\n\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t) {\n\t\t\t\tpassedSection = true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tif (node.type.name === 'sectionDivider') {\n\t\t\tnextDividerPos = pos;\n\t\t}\n\t});\n\treturn nextDividerPos !== -1 ? nextDividerPos : docSize;\n}\n"],"names":["normalizeHtml","html","replace","insertInlineHtml","editor","normalised","dom","document","createElement","innerHTML","slice","DOMParser","fromSchema","schema","parseSlice","size","from","to","state","selection","tr","replaceRange","view","dispatch","SECTION_DIVIDER_HTML","id","buildSectionedContent","body","sections","s","content","getBodyHtml","_a","extractAllSectionsFromHtml","get","getSectionsHtml","substring","length","Map","dividerRegex","dividers","match","exec","push","index","endIndex","set","i","start","end","extractSectionContent","startPos","findSectionStartPos","text","isEmpty","characterCount","endPos","findSectionEndPos","doc","container","serializer","DOMSerializer","appendChild","serializeFragment","textContent","trim","setSectionContentInEditor","dividerHtml","commands","insertContentAt","updateSelection","fragment","parse","parseHtmlToNodes","replaceFrom","replaceWith","setMeta","extractBodyContent","extractActiveFormats","bold","isActive","italic","underline","strike","bulletList","orderedList","blockquote","codeBlock","link","href","getAttributes","$from","pos","linkMark","resolve","marks","find","m","type","name","_c","attrs","nodeBefore","markOnPrev","_b","textAlign","fontFamily","fontSize","color","highlight","_d","superscript","subscript","extractContent","getHTML","getText","storage","characters","sectionId","descendants","node","nodeSize","docSize","firstDividerPos","passedSection","nextDividerPos"],"mappings":"+FAsBM,SAAUA,EAAcC,GAC7B,OAAOA,EACLC,QAAQ,6BAA8B,WACtCA,QAAQ,mBAAoB,GAC/B,CAcgB,SAAAC,EAAiBC,EAAgBH,GAChD,MAAMI,EAAaL,EAAcC,GAC3BK,EAAMC,SAASC,cAAc,OACnCF,EAAIG,UAAYJ,EAChB,MAAMK,EAAQC,EAAUC,WAAWR,EAAOS,QAAQ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,IAArB+B,EAAyBA,EAAkBD,CAClD,CAED,IAAIE,GAAgB,EAChBC,GAAkB,EAgBtB,OAfAnE,EAAI6D,aAAY,CAACC,EAAM5B,KACE,IAApBiC,IACCD,OASkB,mBAAnBJ,EAAKtB,KAAKC,OACb0B,EAAiBjC,KARG,mBAAnB4B,EAAKtB,KAAKC,MACVqB,EAAKnB,MAAiB,YAAMiB,IAE5BM,GAAgB,IAEV,OAMkB,IAApBC,EAAwBA,EAAiBH,CACjD"}
@@ -1,2 +1,2 @@
1
- import{mergeAttributes as e}from"../../../node_modules/@tiptap/core/dist/index.js";import t from"@tiptap/extension-mention";import{ReactRenderer as n}from"@tiptap/react";import{createSuggestionPopup as r}from"../suggestionPopup.js";import{MentionDropdown as o}from"./MentionDropdown.js";function i(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(o,{props:Object.assign(Object.assign({},a),{renderItem:t,renderDropdown:i}),editor:a.editor}),s=r(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()}}}}function s(n,r,o,s){return t.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(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"@",allowSpaces:!0,items:e=>{let{query:t}=e;return n.current.filter((e=>e.label.toLowerCase().includes(t.toLowerCase())))},command:e=>{let{editor:t,range:n,props:o}=e;t.chain().focus().deleteRange(n).insertContent({type:"mentionAgent",attrs:{id:o.id,label:o.label}}).run(),null==r||r(o,"@")},render:i(r,"@",o,s)}})}function a(n,r,o,s){return t.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(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"#",allowSpaces:!0,items:e=>{let{query:t}=e;return n.current.filter((e=>e.label.toLowerCase().includes(t.toLowerCase())))},command:e=>{let{editor:t,range:n,props:o}=e;t.chain().focus().deleteRange(n).insertContent({type:"mentionTeam",attrs:{id:o.id,label:o.label}}).run(),null==r||r(o,"#")},render:i(r,"#",o,s)}})}export{s as buildAgentMentionExtension,a as buildTeamMentionExtension};
1
+ import{mergeAttributes as e}from"../../../node_modules/@tiptap/core/dist/index.js";import t from"@tiptap/extension-mention";import{ReactRenderer as n}from"@tiptap/react";import{createSuggestionPopup as r}from"../suggestionPopup.js";import{MentionDropdown as o}from"./MentionDropdown.js";function i(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(o,{props:Object.assign(Object.assign({},a),{renderItem:t,renderDropdown:i}),editor:a.editor}),s=r(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()}}}}function s(n,r,o,s){return t.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(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"@",items:e=>{let{query:t}=e;return n.current.filter((e=>e.label.toLowerCase().includes(t.toLowerCase())))},command:e=>{let{editor:t,range:n,props:o}=e;t.chain().focus().deleteRange(n).insertContent({type:"mentionAgent",attrs:{id:o.id,label:o.label}}).run(),null==r||r(o,"@")},render:i(r,"@",o,s)}})}function a(n,r,o,s){return t.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(n.HTMLAttributes),`${n.suggestion.char}${r.attrs.label}`]},suggestion:{char:"#",items:e=>{let{query:t}=e;return n.current.filter((e=>e.label.toLowerCase().includes(t.toLowerCase())))},command:e=>{let{editor:t,range:n,props:o}=e;t.chain().focus().deleteRange(n).insertContent({type:"mentionTeam",attrs:{id:o.id,label:o.label}}).run(),null==r||r(o,"#")},render:i(r,"#",o,s)}})}export{s as buildAgentMentionExtension,a as buildTeamMentionExtension};
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 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\tallowSpaces: true,\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\tallowSpaces: true,\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","buildAgentMentionExtension","agentsRef","Mention","extend","name","configure","HTMLAttributes","class","renderText","_ref","options","node","suggestion","char","attrs","renderHTML","_ref2","mergeAttributes","allowSpaces","_ref3","query","current","filter","a","label","toLowerCase","includes","command","_ref4","range","chain","focus","deleteRange","insertContent","type","id","run","render","buildTeamMentionExtension","teamsRef","_ref5","_ref6","_ref7","t","_ref8"],"mappings":"+RAcA,SAASA,EACRC,GACqB,IACrBC,EAAgEC,UAAAC,OAAAD,EAAAA,kBAAAE,EAChEC,EAAiEH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEjE,MAAO,KACN,IAAIE,EACAC,EAEJ,MAAO,CACNC,QAAUC,IACTH,EAAY,IAAII,EAAcC,EAAiB,CAC9CF,qCAAYA,GAAK,CAAER,aAAYI,mBAC/BO,OAAQH,EAAMG,SAEfL,EAAQM,EAAsBP,EAAUQ,QAASL,EAAMM,WAAW,EAEnEC,SAAWP,UACVH,EAAUW,YAAiBC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAV,IAAOR,aAAYI,qBAC9B,QAAXe,EAAAX,EAAMY,aAAK,IAAAD,OAAA,EAAAA,EAAEjB,SAIlBI,EAAMe,OACNf,EAAMgB,eAAed,EAAMM,aAJ1BR,EAAMiB,MAI+B,EAEvCC,UAAYhB,YACX,MAAwB,WAApBA,EAAMiB,MAAMC,KACfpB,EAAMiB,QACC,GAE2C,QAA5CI,EAAsB,QAAtBR,EAACd,EAAUuB,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EACnDC,WAAY0B,IAAA,IAAC/B,QAAEA,EAAOC,KAAEA,GAAM8B,EAAA,MAAK,CAClC,OACAxB,EAAgBP,EAAQJ,gBACxB,GAAGI,EAAQE,WAAWC,OAAOF,EAAKG,MAAa,QAC/C,EACDF,WAAY,CACXC,KAAM,IACNK,aAAa,EACb7B,MAAOqD,IAAA,IAACtB,MAAEA,GAA0BsB,EAAA,OACnCH,EAASlB,QAAQC,QAAQqB,GACxBA,EAAEnB,MAAMC,cAAcC,SAASN,EAAMK,gBACrC,EACFE,QAASiB,IAAkC,IAAjChE,OAAEA,EAAMiD,MAAEA,EAAKpD,MAAEA,GAAYmE,EACtChE,EACEkD,QACAC,QACAC,YAAYH,GACZI,cAAc,CACdC,KAAM,cACNpB,MAAO,CAAEqB,GAAI1D,EAAM0D,GAAIX,MAAO/C,EAAM+C,SAEpCY,MACFpE,SAAAA,EAAWS,EAAO,IAAI,EAEvB4D,OAAQtE,EAAYC,EAAU,IAAKC,EAAYI,KAGlD"}
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","buildAgentMentionExtension","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","buildTeamMentionExtension","teamsRef","_ref5","_ref6","_ref7","t","_ref8"],"mappings":"+RAcA,SAASA,EACRC,GACqB,IACrBC,EAAgEC,UAAAC,OAAAD,EAAAA,kBAAAE,EAChEC,EAAiEH,UAAAC,OAAAD,EAAAA,kBAAAE,EAEjE,MAAO,KACN,IAAIE,EACAC,EAEJ,MAAO,CACNC,QAAUC,IACTH,EAAY,IAAII,EAAcC,EAAiB,CAC9CF,qCAAYA,GAAK,CAAER,aAAYI,mBAC/BO,OAAQH,EAAMG,SAEfL,EAAQM,EAAsBP,EAAUQ,QAASL,EAAMM,WAAW,EAEnEC,SAAWP,UACVH,EAAUW,YAAiBC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAV,IAAOR,aAAYI,qBAC9B,QAAXe,EAAAX,EAAMY,aAAK,IAAAD,OAAA,EAAAA,EAAEjB,SAIlBI,EAAMe,OACNf,EAAMgB,eAAed,EAAMM,aAJ1BR,EAAMiB,MAI+B,EAEvCC,UAAYhB,YACX,MAAwB,WAApBA,EAAMiB,MAAMC,KACfpB,EAAMiB,QACC,GAE2C,QAA5CI,EAAsB,QAAtBR,EAACd,EAAUuB,WAAW,IAAAT,OAAA,EAAAA,EAAEK,UAAUhB,UAAU,IAAAmB,GAAAA,CAAK,EAEzDE,OAAQA,KACPvB,EAAMwB,UACNzB,EAAUyB,SAAS,EAEpB,CAEH,CAEM,SAAUC,EACfC,EACAjC,EACAC,EACAI,GAEA,OAAO6B,EAAQC,OAAO,CAAEC,K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GAA0BsB,EAAA,OACnCH,EAASlB,QAAQC,QAAQqB,GACxBA,EAAEnB,MAAMC,cAAcC,SAASN,EAAMK,gBACrC,EACFE,QAASiB,IAAkC,IAAjC/D,OAAEA,EAAMgD,MAAEA,EAAKnD,MAAEA,GAAYkE,EACtC/D,EACEiD,QACAC,QACAC,YAAYH,GACZI,cAAc,CACdC,KAAM,cACNnB,MAAO,CAAEoB,GAAIzD,EAAMyD,GAAIX,MAAO9C,EAAM8C,SAEpCY,MACFnE,SAAAA,EAAWS,EAAO,IAAI,EAEvB2D,OAAQrE,EAAYC,EAAU,IAAKC,EAAYI,KAGlD"}
@@ -1,2 +1,2 @@
1
- import{Extension as t}from"../../../node_modules/@tiptap/core/dist/index.js";import{Slice as a,Fragment as e}from"@tiptap/pm/model";import{Plugin as r}from"@tiptap/pm/state";const o=t.create({name:"plainClipboard",addProseMirrorPlugins:()=>[new r({props:{handlePaste(t,r){var o,i,l,p;if(null===(i=null===(o=r.clipboardData)||void 0===o?void 0:o.files)||void 0===i?void 0:i.length)return!1;const n=null===(l=r.clipboardData)||void 0===l?void 0:l.getData("text/html"),d=null===(p=r.clipboardData)||void 0===p?void 0:p.getData("text/plain");if(!d||!n)return!1;const s=t.state.schema,m=d.split("\n").filter((t=>t.length>0)).map((t=>s.node("paragraph",null,[s.text(t)]))),c=new a(e.fromArray(m),1,1);return t.dispatch(t.state.tr.replaceSelection(c)),!0}}})]});export{o as PlainClipboardExtension};
1
+ import{Extension as t}from"../../../node_modules/@tiptap/core/dist/index.js";import{Slice as a,Fragment as e}from"@tiptap/pm/model";import{Plugin as o}from"@tiptap/pm/state";const r=t.create({name:"plainClipboard",addProseMirrorPlugins:()=>[new o({props:{handlePaste(t,o){var r,i,l,p;if(null===(i=null===(r=o.clipboardData)||void 0===r?void 0:r.files)||void 0===i?void 0:i.length)return!1;const n=null===(l=o.clipboardData)||void 0===l?void 0:l.getData("text/html"),d=null===(p=o.clipboardData)||void 0===p?void 0:p.getData("text/plain");if(!d||!n)return!1;const s=t.state.schema,m=d.split("\n").map((t=>s.node("paragraph",null,t?[s.text(t)]:[]))),c=new a(e.fromArray(m),1,1);return t.dispatch(t.state.tr.replaceSelection(c)),!0}}})]});export{r as PlainClipboardExtension};
2
2
  //# sourceMappingURL=PlainClipboardExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlainClipboardExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/PlainClipboardExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Fragment, Slice } from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\n\nexport const PlainClipboardExtension = Extension.create({\n\tname: 'plainClipboard',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false; // let ImagePaste handle\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tconst text = event.clipboardData?.getData('text/plain');\n\t\t\t\t\t\tif (!text || !html) return false;\n\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\t\t\t\t\t\t// Split on each newline so that multi-paragraph pastes produce\n\t\t\t\t\t\t// separate paragraph nodes — matching the behaviour of pressing\n\t\t\t\t\t\t// Enter between lines. Using schema.text() collapses all newlines\n\t\t\t\t\t\t// because ProseMirror text nodes cannot contain '\\n'.\n\t\t\t\t\t\t// Empty paragraphs render with 0 height (in sync with how\n\t\t\t\t\t\t// Gmail renders HTML), so strip blank lines on paste to\n\t\t\t\t\t\t// avoid invisible gaps.\n\t\t\t\t\t\tconst paragraphs = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.filter((line) => line.length > 0)\n\t\t\t\t\t\t\t.map((line) =>\n\t\t\t\t\t\t\t\tschema.node('paragraph', null, [schema.text(line)]),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tconst slice = new Slice(Fragment.fromArray(paragraphs), 1, 1);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["PlainClipboardExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","text","_d","schema","state","paragraphs","split","filter","line","map","node","slice","Slice","Fragment","fromArray","dispatch","tr","replaceSelection"],"mappings":"oLAIaA,EAA0BC,EAAUC,OAAO,CACvDC,KAAM,iBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,eAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aACpCC,EAA0B,QAAnBC,EAAAV,EAAME,qBAAa,IAAAQ,OAAA,EAAAA,EAAEF,QAAQ,cAC1C,IAAKC,IAASH,EAAM,OAAO,EAE3B,MAAMK,EAASZ,EAAMa,MAAMD,OAQrBE,EAAaJ,EACjBK,MAAM,MACNC,QAAQC,GAASA,EAAKX,OAAS,IAC/BY,KAAKD,GACLL,EAAOO,KAAK,YAAa,KAAM,CAACP,EAAOF,KAAKO,OAExCG,EAAQ,IAAIC,EAAMC,EAASC,UAAUT,GAAa,EAAG,GAE3D,OADAd,EAAMwB,SAASxB,EAAMa,MAAMY,GAAGC,iBAAiBN,KACxC,CACR"}
1
+ {"version":3,"file":"PlainClipboardExtension.js","sources":["../../../../../src/editor/extensions/plainClipboard/PlainClipboardExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Fragment, Slice } from '@tiptap/pm/model';\nimport { Plugin } from '@tiptap/pm/state';\n\nexport const PlainClipboardExtension = Extension.create({\n\tname: 'plainClipboard',\n\taddProseMirrorPlugins() {\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tprops: {\n\t\t\t\t\thandlePaste(_view, event) {\n\t\t\t\t\t\tif (event.clipboardData?.files?.length) return false; // let ImagePaste handle\n\t\t\t\t\t\tconst html = event.clipboardData?.getData('text/html');\n\t\t\t\t\t\tconst text = event.clipboardData?.getData('text/plain');\n\t\t\t\t\t\tif (!text || !html) return false;\n\n\t\t\t\t\t\tconst schema = _view.state.schema;\n\t\t\t\t\t\t// Split on each newline so that multi-paragraph pastes produce\n\t\t\t\t\t\t// separate paragraph nodes — matching the behaviour of pressing\n\t\t\t\t\t\t// Enter between lines. Using schema.text() collapses all newlines\n\t\t\t\t\t\t// because ProseMirror text nodes cannot contain '\\n'.\n\t\t\t\t\t\tconst paragraphs = text\n\t\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t\t.map((line) =>\n\t\t\t\t\t\t\t\tschema.node('paragraph', null, line ? [schema.text(line)] : []),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\tconst slice = new Slice(Fragment.fromArray(paragraphs), 1, 1);\n\t\t\t\t\t\t_view.dispatch(_view.state.tr.replaceSelection(slice));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["PlainClipboardExtension","Extension","create","name","addProseMirrorPlugins","Plugin","props","handlePaste","_view","event","_b","clipboardData","_a","files","length","html","_c","getData","text","_d","schema","state","paragraphs","split","map","line","node","slice","Slice","Fragment","fromArray","dispatch","tr","replaceSelection"],"mappings":"oLAIaA,EAA0BC,EAAUC,OAAO,CACvDC,KAAM,iBACNC,sBAAqBA,IACb,CACN,IAAIC,EAAO,CACVC,MAAO,CACNC,YAAYC,EAAOC,eAClB,WAAIC,EAAqB,UAArBD,EAAME,qBAAe,IAAAC,OAAA,EAAAA,EAAAC,4BAAOC,OAAQ,OAAO,EAC/C,MAAMC,EAA0B,QAAnBC,EAAAP,EAAME,qBAAa,IAAAK,OAAA,EAAAA,EAAEC,QAAQ,aACpCC,EAA0B,QAAnBC,EAAAV,EAAME,qBAAa,IAAAQ,OAAA,EAAAA,EAAEF,QAAQ,cAC1C,IAAKC,IAASH,EAAM,OAAO,EAE3B,MAAMK,EAASZ,EAAMa,MAAMD,OAKrBE,EAAaJ,EACjBK,MAAM,MACNC,KAAKC,GACLL,EAAOM,KAAK,YAAa,KAAMD,EAAO,CAACL,EAAOF,KAAKO,IAAS,MAExDE,EAAQ,IAAIC,EAAMC,EAASC,UAAUR,GAAa,EAAG,GAE3D,OADAd,EAAMuB,SAASvB,EAAMa,MAAMW,GAAGC,iBAAiBN,KACxC,CACR"}
@@ -1,2 +1,2 @@
1
- import{Extension as e}from"../../../node_modules/@tiptap/core/dist/index.js";import{ReactRenderer as r}from"@tiptap/react";import t from"@tiptap/suggestion";import{createSuggestionPopup as o}from"../suggestionPopup.js";import{SlashCommandMenu as n}from"./SlashCommandMenu.js";function i(i,s,d,a){return e.create({name:"slashCommand",addProseMirrorPlugins(){return[t({editor:this.editor,char:"/",allowSpaces:!0,items:e=>{let{query:r}=e;return i.current.filter((e=>e.label.toLowerCase().includes(r.toLowerCase()))).slice(0,20)},command:e=>{let{editor:r,range:t,props:o}=e;r.chain().focus().deleteRange(t).run(),null==s||s(o)},render:()=>{let e,t;return{onStart:i=>{e=new r(n,{props:Object.assign(Object.assign({},i),{renderItem:d,renderDropdown:a}),editor:i.editor}),t=o(e.element,i.clientRect)},onUpdate:r=>{var o;e.updateProps(Object.assign(Object.assign({},r),{renderItem:d,renderDropdown:a})),(null===(o=r.items)||void 0===o?void 0:o.length)?(t.show(),t.updatePosition(r.clientRect)):t.hide()},onKeyDown:r=>{var o,n;return"Escape"===r.event.key?(t.hide(),!0):null!==(n=null===(o=e.ref)||void 0===o?void 0:o.onKeyDown(r))&&void 0!==n&&n},onExit:()=>{t.destroy(),e.destroy()}}}})]}})}export{i as buildSlashCommandExtension};
1
+ import{Extension as e}from"../../../node_modules/@tiptap/core/dist/index.js";import{ReactRenderer as r}from"@tiptap/react";import t from"@tiptap/suggestion";import{createSuggestionPopup as o}from"../suggestionPopup.js";import{SlashCommandMenu as n}from"./SlashCommandMenu.js";function i(i,s,d,a){return e.create({name:"slashCommand",addProseMirrorPlugins(){return[t({editor:this.editor,char:"/",items:e=>{let{query:r}=e;return i.current.filter((e=>e.label.toLowerCase().includes(r.toLowerCase()))).slice(0,20)},command:e=>{let{editor:r,range:t,props:o}=e;r.chain().focus().deleteRange(t).run(),null==s||s(o)},render:()=>{let e,t;return{onStart:i=>{e=new r(n,{props:Object.assign(Object.assign({},i),{renderItem:d,renderDropdown:a}),editor:i.editor}),t=o(e.element,i.clientRect)},onUpdate:r=>{var o;e.updateProps(Object.assign(Object.assign({},r),{renderItem:d,renderDropdown:a})),(null===(o=r.items)||void 0===o?void 0:o.length)?(t.show(),t.updatePosition(r.clientRect)):t.hide()},onKeyDown:r=>{var o,n;return"Escape"===r.event.key?(t.hide(),!0):null!==(n=null===(o=e.ref)||void 0===o?void 0:o.onKeyDown(r))&&void 0!==n&&n},onExit:()=>{t.destroy(),e.destroy()}}}})]}})}export{i as buildSlashCommandExtension};
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 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\tallowSpaces: true,\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":["buildSlashCommandExtension","commandsRef","onSelect","renderItem","renderDropdown","Extension","create","name","addProseMirrorPlugins","Suggestion","editor","this","char","allowSpaces","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":"oRAcM,SAAUA,EACfC,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAUC,OAAO,CACvBC,KAAM,eACNC,wBACC,MAAO,CACNC,EAAW,CACVC,OAAQC,KAAKD,OACbE,KAAM,IACNC,aAAa,EACbC,MAAOC,IAAA,IAACC,MAAEA,GAAYD,EAAA,OACrBd,EAAYgB,QACVC,QAAQC,GACRA,EAAEC,MAAMC,cAAcC,SAASN,EAAMK,iBAErCE,MAAM,EAAG,GAAG,EACfC,QAASC,IAAkC,IAAjCf,OAAEA,EAAMgB,MAAEA,EAAKC,MAAEA,GAAYF,EACtCf,EAAOkB,QAAQC,QAAQC,YAAYJ,GAAOK,MAC1C7B,SAAAA,EAAWyB,EAAM,EAElBK,OAAQA,KACP,IAAIC,EACAC,EAEJ,MAAO,CACNC,QAAUR,IACTM,EAAY,IAAIG,EAAcC,EAAkB,CAC/CV,qCAAYA,GAAK,CAAExB,aAAYC,mBAC/BM,OAAQiB,EAAMjB,SAEfwB,EAAQI,EACPL,EAAUM,QACVZ,EAAMa,WACN,EAEFC,SAAWd,UACVM,EAAUS,YAAiBC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EAAAjB,IAAOxB,aAAYC,qBAC9B,QAAXyC,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
+ {"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":["buildSlashCommandExtension","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":"oRAcM,SAAUA,EACfC,EACAC,EACAC,EACAC,GAEA,OAAOC,EAAUC,OAAO,CACvBC,KAAM,eACNC,wBACC,MAAO,CACNC,EAAW,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,EAAcC,EAAkB,CAC/CV,qCAAYA,GAAK,CAAEvB,aAAYC,mBAC/BM,OAAQgB,EAAMhB,SAEfuB,EAAQI,EACPL,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
- function e(e){if(!e)return"";if("undefined"!=typeof document){return r((new DOMParser).parseFromString(e,"text/html").body).replace(/\n{3,}/g,"\n\n").trim()}return function(e){return e.replace(/<strong[^>]*>([\s\S]*?)<\/strong>/gi,"*$1*").replace(/<b[^>]*>([\s\S]*?)<\/b>/gi,"*$1*").replace(/<em[^>]*>([\s\S]*?)<\/em>/gi,"_$1_").replace(/<i[^>]*>([\s\S]*?)<\/i>/gi,"_$1_").replace(/<s[^>]*>([\s\S]*?)<\/s>/gi,"~$1~").replace(/<del[^>]*>([\s\S]*?)<\/del>/gi,"~$1~").replace(/<code[^>]*>([\s\S]*?)<\/code>/gi,"`$1`").replace(/<a[^>]*>([\s\S]*?)<\/a>/gi,"$1").replace(/<br\s*\/?>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<\/div>/gi,"\n").replace(/<\/h[1-6]>/gi,"\n").replace(/<li[^>]*>/gi,"• ").replace(/<\/li>/gi,"\n").replace(/<[^>]+>/g,"").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/\n{3,}/g,"\n\n").trim()}(e)}function r(e){var n;if(e.nodeType===Node.TEXT_NODE)return null!==(n=e.textContent)&&void 0!==n?n:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const a=e,c=a.tagName.toLowerCase(),t=function(e){return Array.from(e.childNodes).map(r).join("")}(a);switch(c){case"strong":case"b":return t?`*${t}*`:"";case"em":case"i":return t?`_${t}_`:"";case"s":case"del":case"strike":return t?`~${t}~`:"";case"code":return t?`\`${t}\``:"";case"pre":return t?`\`\`\`${t}\`\`\``:"";case"a":case"ul":case"ol":case"body":default:return t;case"br":return"\n";case"p":case"div":return t?`${t}\n`:"\n";case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return t?`*${t}*\n`:"\n";case"li":return`• ${t.trimEnd()}\n`;case"blockquote":return t.split("\n").map((e=>e?`> ${e}`:"")).join("\n")+"\n"}}export{e as toWhatsAppText};
1
+ function e(e){if(!e)return"";if("undefined"!=typeof document){return r((new DOMParser).parseFromString(e,"text/html").body).replace(/\n{3,}/g,"\n\n").trim()}return function(e){return e.replace(/<strong[^>]*>([\s\S]*?)<\/strong>/gi,"*$1*").replace(/<b[^>]*>([\s\S]*?)<\/b>/gi,"*$1*").replace(/<em[^>]*>([\s\S]*?)<\/em>/gi,"_$1_").replace(/<i[^>]*>([\s\S]*?)<\/i>/gi,"_$1_").replace(/<s[^>]*>([\s\S]*?)<\/s>/gi,"~$1~").replace(/<del[^>]*>([\s\S]*?)<\/del>/gi,"~$1~").replace(/<code[^>]*>([\s\S]*?)<\/code>/gi,"`$1`").replace(/<a[^>]*href="([^"]*)"[^>]*>[\s\S]*?<\/a>/gi,"$1").replace(/<br\s*\/?>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<\/div>/gi,"\n").replace(/<\/h[1-6]>/gi,"\n").replace(/<li[^>]*>/gi,"• ").replace(/<\/li>/gi,"\n").replace(/<[^>]+>/g,"").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/\n{3,}/g,"\n\n").trim()}(e)}function r(e){var n,a;if(e.nodeType===Node.TEXT_NODE)return null!==(n=e.textContent)&&void 0!==n?n:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const c=e,t=c.tagName.toLowerCase(),s=function(e){return Array.from(e.childNodes).map(r).join("")}(c);switch(t){case"strong":case"b":return s?`*${s}*`:"";case"em":case"i":return s?`_${s}_`:"";case"s":case"del":case"strike":return s?`~${s}~`:"";case"code":return s?`\`${s}\``:"";case"pre":return s?`\`\`\`${s}\`\`\``:"";case"a":return(null!==(a=c.getAttribute("href"))&&void 0!==a?a:"")||s;case"br":return"\n";case"p":case"div":return s?`${s}\n`:"\n";case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return s?`*${s}*\n`:"\n";case"ul":case"ol":case"body":default:return s;case"li":return`• ${s.trimEnd()}\n`;case"blockquote":return s.split("\n").map((e=>e?`> ${e}`:"")).join("\n")+"\n"}}export{e as toWhatsAppText};
2
2
  //# sourceMappingURL=toWhatsAppText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toWhatsAppText.js","sources":["../../../../src/editor/serializers/toWhatsAppText.ts"],"sourcesContent":["/**\n * Converts TipTap HTML to WhatsApp-flavoured markdown text.\n *\n * WhatsApp formatting:\n * *bold* _italic_ ~strikethrough~ ```monospace```\n *\n * Links: WhatsApp does not support hyperlinks.\n * <a href=\"https://…\">Visit us</a> → Visit us (display text kept, href dropped)\n *\n * @example\n * const { html } = ref.current?.getContent();\n * const waText = toWhatsAppText(html);\n * sendWhatsApp({ text: waText });\n */\nexport function toWhatsAppText(html: string): string {\n\tif (!html) return '';\n\n\tif (typeof document !== 'undefined') {\n\t\tconst doc = new DOMParser().parseFromString(html, 'text/html');\n\t\treturn serializeNode(doc.body)\n\t\t\t.replace(/\\n{3,}/g, '\\n\\n')\n\t\t\t.trim();\n\t}\n\n\t// SSR / Node.js fallback — handles simple non-nested markup\n\treturn ssrFallback(html);\n}\n\n// ---------------------------------------------------------------------------\n// Browser path — DOM-based, handles nested marks correctly\n// ---------------------------------------------------------------------------\n\nfunction serializeNode(node: Node): string {\n\tif (node.nodeType === Node.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\tif (node.nodeType !== Node.ELEMENT_NODE) return '';\n\n\tconst el = node as Element;\n\tconst tag = el.tagName.toLowerCase();\n\tconst inner = serializeChildren(el);\n\n\tswitch (tag) {\n\t\tcase 'strong':\n\t\tcase 'b':\n\t\t\treturn inner ? `*${inner}*` : '';\n\n\t\tcase 'em':\n\t\tcase 'i':\n\t\t\treturn inner ? `_${inner}_` : '';\n\n\t\tcase 's':\n\t\tcase 'del':\n\t\tcase 'strike':\n\t\t\treturn inner ? `~${inner}~` : '';\n\n\t\tcase 'code':\n\t\t\treturn inner ? `\\`${inner}\\`` : '';\n\n\t\tcase 'pre':\n\t\t\treturn inner ? `\\`\\`\\`${inner}\\`\\`\\`` : '';\n\n\t\tcase 'a':\n\t\t\treturn inner;\n\n\t\tcase 'br':\n\t\t\treturn '\\n';\n\n\t\tcase 'p':\n\t\tcase 'div':\n\t\t\treturn inner ? `${inner}\\n` : '\\n';\n\n\t\tcase 'h1':\n\t\tcase 'h2':\n\t\tcase 'h3':\n\t\tcase 'h4':\n\t\tcase 'h5':\n\t\tcase 'h6':\n\t\t\treturn inner ? `*${inner}*\\n` : '\\n';\n\n\t\tcase 'ul':\n\t\tcase 'ol':\n\t\t\treturn inner;\n\n\t\tcase 'li':\n\t\t\treturn `• ${inner.trimEnd()}\\n`;\n\n\t\tcase 'blockquote':\n\t\t\treturn (\n\t\t\t\tinner\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((l) => (l ? `> ${l}` : ''))\n\t\t\t\t\t.join('\\n') + '\\n'\n\t\t\t);\n\n\t\tcase 'body':\n\t\tdefault:\n\t\t\treturn inner;\n\t}\n}\n\nfunction serializeChildren(el: Element): string {\n\treturn Array.from(el.childNodes).map(serializeNode).join('');\n}\n\n// ---------------------------------------------------------------------------\n// SSR fallback — regex-based, best-effort for simple markup\n// ---------------------------------------------------------------------------\n\nfunction ssrFallback(html: string): string {\n\treturn html\n\t\t.replace(/<strong[^>]*>([\\s\\S]*?)<\\/strong>/gi, '*$1*')\n\t\t.replace(/<b[^>]*>([\\s\\S]*?)<\\/b>/gi, '*$1*')\n\t\t.replace(/<em[^>]*>([\\s\\S]*?)<\\/em>/gi, '_$1_')\n\t\t.replace(/<i[^>]*>([\\s\\S]*?)<\\/i>/gi, '_$1_')\n\t\t.replace(/<s[^>]*>([\\s\\S]*?)<\\/s>/gi, '~$1~')\n\t\t.replace(/<del[^>]*>([\\s\\S]*?)<\\/del>/gi, '~$1~')\n\t\t.replace(/<code[^>]*>([\\s\\S]*?)<\\/code>/gi, '`$1`')\n\t\t.replace(/<a[^>]*>([\\s\\S]*?)<\\/a>/gi, '$1')\n\t\t.replace(/<br\\s*\\/?>/gi, '\\n')\n\t\t.replace(/<\\/p>/gi, '\\n')\n\t\t.replace(/<\\/div>/gi, '\\n')\n\t\t.replace(/<\\/h[1-6]>/gi, '\\n')\n\t\t.replace(/<li[^>]*>/gi, '• ')\n\t\t.replace(/<\\/li>/gi, '\\n')\n\t\t.replace(/<[^>]+>/g, '')\n\t\t.replace(/&amp;/g, '&')\n\t\t.replace(/&lt;/g, '<')\n\t\t.replace(/&gt;/g, '>')\n\t\t.replace(/&nbsp;/g, ' ')\n\t\t.replace(/\\n{3,}/g, '\\n\\n')\n\t\t.trim();\n}\n"],"names":["toWhatsAppText","html","document","serializeNode","DOMParser","parseFromString","body","replace","trim","ssrFallback","node","nodeType","Node","TEXT_NODE","textContent","_a","ELEMENT_NODE","el","tag","tagName","toLowerCase","inner","Array","from","childNodes","map","join","serializeChildren","trimEnd","split","l"],"mappings":"AAcM,SAAUA,EAAeC,GAC9B,IAAKA,EAAM,MAAO,GAElB,GAAwB,oBAAbC,SAA0B,CAEpC,OAAOC,GADK,IAAIC,WAAYC,gBAAgBJ,EAAM,aACzBK,MACvBC,QAAQ,UAAW,QACn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AK,MACJ,OAAOA,EAAQ,GAAGA,MAAY,KAE/B,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACJ,OAAOA,EAAQ,IAAIA,OAAa,KAMjC,IAAK,KACJ,WAAYA,EAAMO,cAEnB,IAAK,aACJ,OACCP,EACEQ,MAAM,MACNJ,KAAKK,GAAOA,EAAI,KAAKA,IAAM,KAC3BJ,KAAK,MAAQ,KAOnB"}
1
+ {"version":3,"file":"toWhatsAppText.js","sources":["../../../../src/editor/serializers/toWhatsAppText.ts"],"sourcesContent":["/**\n * Converts TipTap HTML to WhatsApp-flavoured markdown text.\n *\n * WhatsApp formatting:\n * *bold* _italic_ ~strikethrough~ ```monospace```\n *\n * Links: WhatsApp does not support custom display text for hyperlinks.\n * <a href=\"https://…\">Visit us</a> → https://… (href wins, display text dropped)\n *\n * @example\n * const { html } = ref.current?.getContent();\n * const waText = toWhatsAppText(html);\n * sendWhatsApp({ text: waText });\n */\nexport function toWhatsAppText(html: string): string {\n\tif (!html) return '';\n\n\tif (typeof document !== 'undefined') {\n\t\tconst doc = new DOMParser().parseFromString(html, 'text/html');\n\t\treturn serializeNode(doc.body)\n\t\t\t.replace(/\\n{3,}/g, '\\n\\n')\n\t\t\t.trim();\n\t}\n\n\t// SSR / Node.js fallback — handles simple non-nested markup\n\treturn ssrFallback(html);\n}\n\n// ---------------------------------------------------------------------------\n// Browser path — DOM-based, handles nested marks correctly\n// ---------------------------------------------------------------------------\n\nfunction serializeNode(node: Node): string {\n\tif (node.nodeType === Node.TEXT_NODE) {\n\t\treturn node.textContent ?? '';\n\t}\n\tif (node.nodeType !== Node.ELEMENT_NODE) return '';\n\n\tconst el = node as Element;\n\tconst tag = el.tagName.toLowerCase();\n\tconst inner = serializeChildren(el);\n\n\tswitch (tag) {\n\t\tcase 'strong':\n\t\tcase 'b':\n\t\t\treturn inner ? `*${inner}*` : '';\n\n\t\tcase 'em':\n\t\tcase 'i':\n\t\t\treturn inner ? `_${inner}_` : '';\n\n\t\tcase 's':\n\t\tcase 'del':\n\t\tcase 'strike':\n\t\t\treturn inner ? `~${inner}~` : '';\n\n\t\tcase 'code':\n\t\t\treturn inner ? `\\`${inner}\\`` : '';\n\n\t\tcase 'pre':\n\t\t\treturn inner ? `\\`\\`\\`${inner}\\`\\`\\`` : '';\n\n\t\tcase 'a': {\n\t\t\t// WhatsApp doesn't support custom link text — just emit the URL.\n\t\t\tconst href = el.getAttribute('href') ?? '';\n\t\t\treturn href || inner;\n\t\t}\n\n\t\tcase 'br':\n\t\t\treturn '\\n';\n\n\t\tcase 'p':\n\t\tcase 'div':\n\t\t\treturn inner ? `${inner}\\n` : '\\n';\n\n\t\tcase 'h1':\n\t\tcase 'h2':\n\t\tcase 'h3':\n\t\tcase 'h4':\n\t\tcase 'h5':\n\t\tcase 'h6':\n\t\t\treturn inner ? `*${inner}*\\n` : '\\n';\n\n\t\tcase 'ul':\n\t\tcase 'ol':\n\t\t\treturn inner;\n\n\t\tcase 'li':\n\t\t\treturn `• ${inner.trimEnd()}\\n`;\n\n\t\tcase 'blockquote':\n\t\t\treturn (\n\t\t\t\tinner\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((l) => (l ? `> ${l}` : ''))\n\t\t\t\t\t.join('\\n') + '\\n'\n\t\t\t);\n\n\t\tcase 'body':\n\t\tdefault:\n\t\t\treturn inner;\n\t}\n}\n\nfunction serializeChildren(el: Element): string {\n\treturn Array.from(el.childNodes).map(serializeNode).join('');\n}\n\n// ---------------------------------------------------------------------------\n// SSR fallback — regex-based, best-effort for simple markup\n// ---------------------------------------------------------------------------\n\nfunction ssrFallback(html: string): string {\n\treturn html\n\t\t.replace(/<strong[^>]*>([\\s\\S]*?)<\\/strong>/gi, '*$1*')\n\t\t.replace(/<b[^>]*>([\\s\\S]*?)<\\/b>/gi, '*$1*')\n\t\t.replace(/<em[^>]*>([\\s\\S]*?)<\\/em>/gi, '_$1_')\n\t\t.replace(/<i[^>]*>([\\s\\S]*?)<\\/i>/gi, '_$1_')\n\t\t.replace(/<s[^>]*>([\\s\\S]*?)<\\/s>/gi, '~$1~')\n\t\t.replace(/<del[^>]*>([\\s\\S]*?)<\\/del>/gi, '~$1~')\n\t\t.replace(/<code[^>]*>([\\s\\S]*?)<\\/code>/gi, '`$1`')\n\t\t.replace(/<a[^>]*href=\"([^\"]*)\"[^>]*>[\\s\\S]*?<\\/a>/gi, '$1')\n\t\t.replace(/<br\\s*\\/?>/gi, '\\n')\n\t\t.replace(/<\\/p>/gi, '\\n')\n\t\t.replace(/<\\/div>/gi, '\\n')\n\t\t.replace(/<\\/h[1-6]>/gi, '\\n')\n\t\t.replace(/<li[^>]*>/gi, '• ')\n\t\t.replace(/<\\/li>/gi, '\\n')\n\t\t.replace(/<[^>]+>/g, '')\n\t\t.replace(/&amp;/g, '&')\n\t\t.replace(/&lt;/g, '<')\n\t\t.replace(/&gt;/g, '>')\n\t\t.replace(/&nbsp;/g, ' ')\n\t\t.replace(/\\n{3,}/g, '\\n\\n')\n\t\t.trim();\n}\n"],"names":["toWhatsAppText","html","document","serializeNode","DOMParser","parseFromString","body","replace","trim","ssrFallback","node","nodeType","Node","TEXT_NODE","textContent","_a","ELEMENT_NODE","el","tag","tagName","toLowerCase","inner","Array","from","childNodes","map","join","serializeChildren","_b","getAttribute","trimEnd","split","l"],"mappings":"AAcM,SAAUA,EAAeC,GAC9B,IAAKA,EAAM,MAAO,GAElB,GAAwB,oBAAbC,SAA0B,CAEpC,OAAOC,GADK,IAAIC,WAAYC,gBAAgBJ,EAAM,aACzBK,MACvBC,QAAQ,UAAW,QACnBC,MACF,CAGD,OAuFD,SAAqBP,GACpB,OAAOA,EACLM,QAAQ,sCAAuC,QAC/CA,QAAQ,4BAA6B,QACrCA,QAAQ,8BAA+B,QACvCA,QAAQ,4BAA6B,QACrCA,QAAQ,4BAA6B,QACrCA,QAAQ,gCAAiC,QACzCA,QAAQ,kCAAmC,QAC3CA,QAAQ,6CAA8C,MACtDA,QAA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,EAAMS,cAEnB,IAAK,aACJ,OACCT,EACEU,MAAM,MACNN,KAAKO,GAAOA,EAAI,KAAKA,IAAM,KAC3BN,KAAK,MAAQ,KAOnB"}
@@ -1,2 +1,2 @@
1
- import{__rest as o}from"../../../_virtual/_tslib.js";import{jsx as r}from"react/jsx-runtime";const e=e=>{var{size:t=24,color:l="currentColor"}=e,i=o(e,["size","color"]);const s=Object.assign({width:t,height:t,color:l},i);return r("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{children:r("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"})}))};export{e as default};
1
+ import{__rest as r}from"../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";const o=o=>{var{width:e=24,height:l=24,color:i="currentColor"}=o,h=r(o,["width","height","color"]);return t("svg",Object.assign({width:e,height:l,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:i},h,{children:t("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"})}))};export{o as default};
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":["SvgChevronUp","_a","size","color","rest","__rest","props","Object","assign","width","height","_jsx","viewBox","fill","xmlns","children","fillRule","clipRule","d"],"mappings":"6FAMMA,MAAAA,EAAgBC,IAAA,IAAAC,KACrBA,EAAO,GAAEC,MACTA,EAAQ,gBAAcF,EACnBG,EAHkBC,EAAAJ,EAAA,CAAA,OAAA,UAKrB,MAAMK,EAAKC,OAAAC,OAAA,CACVC,MAAOP,EACPQ,OAAQR,EACRC,SACGC,GAEJ,OACCO,EAAA,MAAAJ,OAAAC,OAAA,CACCI,QAAQ,YACRC,KAAK,OACLC,MAAM,8BACFR,EAEJ,CAAAS,SAAAJ,EAAA,OAAA,CACCK,SAAS,UACTC,SAAS,UACTC,EAAE,+TACFL,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":["SvgChevronUp","_a","width","height","color","rest","__rest","_jsx","viewBox","fill","xmlns","children","fillRule","clipRule","d"],"mappings":"6FAKMA,MAAAA,EAAgBC,IAAA,IAAAC,MACrBA,EAAQ,GAAEC,OACVA,EAAS,GAAEC,MACXA,EAAQ,gBAEDH,EADJI,EAAIC,EAAAL,EAJc,4BAMrB,OACCM,uBACCL,MAAOA,EACPC,OAAQA,EACRK,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNN,MAAOA,GACHC,EAEJ,CAAAM,SAAAJ,EAAA,OAAA,CACCK,SAAS,UACTC,SAAS,UACTC,EAAE,+TACFL,KAAK,mBAED"}