@bikdotai/bik-component-library 0.0.833 → 0.0.834

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 (323) 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/Day.js +1 -1
  4. package/dist/cjs/components/BikGiftedChat/GiftedChat/Day.js.map +1 -1
  5. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  6. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  7. package/dist/cjs/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  8. package/dist/cjs/components/TypographyStyle.js +41 -20
  9. package/dist/cjs/components/TypographyStyle.js.map +1 -1
  10. package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.js +16 -5
  11. package/dist/cjs/components/WhatsAppTextEditor/AIRephraseButton.js.map +1 -1
  12. package/dist/cjs/components/avatar/Avatar.js +1 -1
  13. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  14. package/dist/cjs/components/avatar/Avatar.styled.js +4 -4
  15. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  16. package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
  17. package/dist/cjs/components/avatar/AvatarHelper.js.map +1 -1
  18. package/dist/cjs/components/bik-layout/BikSidebar.js.map +1 -1
  19. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js +2 -0
  20. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  21. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +2 -0
  22. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  23. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +293 -0
  24. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  25. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +2 -0
  26. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  27. package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
  28. package/dist/cjs/components/bik-layout/CommonStyles.js.map +1 -1
  29. package/dist/cjs/components/button/Button.js +1 -1
  30. package/dist/cjs/components/button/Button.js.map +1 -1
  31. package/dist/cjs/components/button/Button.styled.js +13 -13
  32. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  33. package/dist/cjs/components/button/themes.js +6 -6
  34. package/dist/cjs/components/button/themes.js.map +1 -1
  35. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  36. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  37. package/dist/cjs/components/checkBox/CheckBox.styled.js +21 -20
  38. package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
  39. package/dist/cjs/components/country-code-picker/CountryCodePicker.js.map +1 -1
  40. package/dist/cjs/components/country-code-picker/CountryPicker.js.map +1 -1
  41. package/dist/cjs/components/datePicker/DatePicker.styled.js +37 -4
  42. package/dist/cjs/components/datePicker/DatePicker.styled.js.map +1 -1
  43. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  44. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  45. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  46. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  47. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  48. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  49. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +9 -8
  50. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  51. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  52. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  53. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
  54. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  55. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +9 -9
  56. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  57. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  58. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  59. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +6 -2
  60. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  61. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
  62. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  63. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  64. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  65. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  66. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  67. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  68. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  69. package/dist/cjs/components/dropdown-button/DropdownButton.style.js +20 -6
  70. package/dist/cjs/components/dropdown-button/DropdownButton.style.js.map +1 -1
  71. package/dist/cjs/components/dual-icon-button/DualIconButton.js +2 -0
  72. package/dist/cjs/components/dual-icon-button/DualIconButton.js.map +1 -0
  73. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +33 -0
  74. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  75. package/dist/cjs/components/fab-menu/FABMenu.js.map +1 -1
  76. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  77. package/dist/cjs/components/icon-button/IconButton.js.map +1 -1
  78. package/dist/cjs/components/icon-button/IconButton.styled.js +18 -12
  79. package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
  80. package/dist/cjs/components/icon-button/theme.js +1 -1
  81. package/dist/cjs/components/icon-button/theme.js.map +1 -1
  82. package/dist/cjs/components/input/Input.js +1 -1
  83. package/dist/cjs/components/input/Input.js.map +1 -1
  84. package/dist/cjs/components/input/Input.styled.js +27 -16
  85. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  86. package/dist/cjs/components/list-item/ListItem.js +1 -1
  87. package/dist/cjs/components/list-item/ListItem.js.map +1 -1
  88. package/dist/cjs/components/list-item/ListItem.styled.js +6 -6
  89. package/dist/cjs/components/list-item/ListItem.styled.js.map +1 -1
  90. package/dist/cjs/components/list-item/themes.js +40 -21
  91. package/dist/cjs/components/list-item/themes.js.map +1 -1
  92. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  93. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  94. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  95. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  96. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  97. package/dist/cjs/components/multi-level-dropdown/MenuList.js.map +1 -1
  98. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  99. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  100. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +32 -29
  101. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  102. package/dist/cjs/components/tag/Tag.js +1 -1
  103. package/dist/cjs/components/tag/Tag.js.map +1 -1
  104. package/dist/cjs/components/tag/Tag.styled.js +4 -4
  105. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  106. package/dist/cjs/components/tag/model.js.map +1 -1
  107. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  108. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  109. package/dist/cjs/components/whats-new/WhatsNew.styles.js +12 -10
  110. package/dist/cjs/components/whats-new/WhatsNew.styles.js.map +1 -1
  111. package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
  112. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  113. package/dist/cjs/components/whats-new/WhatsNewPanel.js.map +1 -1
  114. package/dist/cjs/constants/Theme.js +1 -1
  115. package/dist/cjs/constants/Theme.js.map +1 -1
  116. package/dist/cjs/editor/BikEditor.js +1 -1
  117. package/dist/cjs/editor/BikEditor.js.map +1 -1
  118. package/dist/cjs/editor/BikEditor.styles.js +30 -6
  119. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  120. package/dist/cjs/editor/BikEditor.types.js.map +1 -1
  121. package/dist/cjs/editor/extensions/buildExtensions.js +2 -2
  122. package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
  123. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js +8 -0
  124. package/dist/cjs/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -0
  125. package/dist/cjs/editor/extensions/editorDropdown.styles.js +10 -15
  126. package/dist/cjs/editor/extensions/editorDropdown.styles.js.map +1 -1
  127. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js +1 -1
  128. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  129. package/dist/cjs/index.js +1 -1
  130. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js +81 -75
  131. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
  132. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.d.ts +6 -0
  133. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.js +127 -89
  134. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.js.map +1 -1
  135. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +232 -129
  136. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  137. package/dist/esm/components/BikGiftedChat/GiftedChat/types.d.ts +6 -2
  138. package/dist/esm/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  139. package/dist/esm/components/TypographyStyle.d.ts +8 -0
  140. package/dist/esm/components/TypographyStyle.js +63 -40
  141. package/dist/esm/components/TypographyStyle.js.map +1 -1
  142. package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js +54 -43
  143. package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js.map +1 -1
  144. package/dist/esm/components/avatar/Avatar.d.ts +2 -1
  145. package/dist/esm/components/avatar/Avatar.js +54 -76
  146. package/dist/esm/components/avatar/Avatar.js.map +1 -1
  147. package/dist/esm/components/avatar/Avatar.styled.js +8 -8
  148. package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
  149. package/dist/esm/components/avatar/AvatarHelper.d.ts +5 -4
  150. package/dist/esm/components/avatar/AvatarHelper.js +4 -4
  151. package/dist/esm/components/avatar/AvatarHelper.js.map +1 -1
  152. package/dist/esm/components/bik-layout/BikSidebar.js.map +1 -1
  153. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  154. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js +272 -0
  155. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  156. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  157. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +12 -0
  158. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +53 -0
  159. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  160. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  161. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +309 -0
  162. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  163. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +2 -0
  164. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +107 -0
  165. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  166. package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
  167. package/dist/esm/components/bik-layout/CommonStyles.js.map +1 -1
  168. package/dist/esm/components/bik-layout/index.d.ts +2 -0
  169. package/dist/esm/components/button/Button.js +31 -31
  170. package/dist/esm/components/button/Button.js.map +1 -1
  171. package/dist/esm/components/button/Button.styled.d.ts +1 -1
  172. package/dist/esm/components/button/Button.styled.js +20 -20
  173. package/dist/esm/components/button/Button.styled.js.map +1 -1
  174. package/dist/esm/components/button/model.d.ts +3 -3
  175. package/dist/esm/components/button/themes.d.ts +2 -2
  176. package/dist/esm/components/button/themes.js +31 -17
  177. package/dist/esm/components/button/themes.js.map +1 -1
  178. package/dist/esm/components/checkBox/CheckBox.d.ts +2 -1
  179. package/dist/esm/components/checkBox/CheckBox.js +124 -87
  180. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  181. package/dist/esm/components/checkBox/CheckBox.styled.d.ts +1 -1
  182. package/dist/esm/components/checkBox/CheckBox.styled.js +10 -9
  183. package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
  184. package/dist/esm/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  185. package/dist/esm/components/country-code-picker/CountryCodePicker.js.map +1 -1
  186. package/dist/esm/components/country-code-picker/CountryPicker.d.ts +1 -1
  187. package/dist/esm/components/country-code-picker/CountryPicker.js.map +1 -1
  188. package/dist/esm/components/datePicker/DatePicker.styled.js +39 -6
  189. package/dist/esm/components/datePicker/DatePicker.styled.js.map +1 -1
  190. package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
  191. package/dist/esm/components/dropdown/Dropdown.js +80 -77
  192. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  193. package/dist/esm/components/dropdown/DropdownPopover/index.js +69 -56
  194. package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
  195. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +183 -174
  196. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  197. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  198. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +5 -4
  199. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  200. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  201. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  202. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  203. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  204. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +3 -1
  205. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +29 -20
  206. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  207. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +3 -1
  208. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +80 -74
  209. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  210. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +3 -1
  211. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +68 -61
  212. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  213. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +2 -1
  214. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +7 -2
  215. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  216. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +3 -1
  217. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +18 -10
  218. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  219. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  220. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +18 -18
  221. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  222. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  223. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +43 -17
  224. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  225. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +2 -0
  226. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +2 -0
  227. package/dist/esm/components/dropdown/type.d.ts +6 -1
  228. package/dist/esm/components/dropdown-button/DropdownButton.d.ts +13 -1
  229. package/dist/esm/components/dropdown-button/DropdownButton.js +83 -20
  230. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  231. package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +9 -2
  232. package/dist/esm/components/dropdown-button/DropdownButton.style.js +35 -9
  233. package/dist/esm/components/dropdown-button/DropdownButton.style.js.map +1 -1
  234. package/dist/esm/components/dual-icon-button/DualIconButton.d.ts +3 -0
  235. package/dist/esm/components/dual-icon-button/DualIconButton.js +53 -0
  236. package/dist/esm/components/dual-icon-button/DualIconButton.js.map +1 -0
  237. package/dist/esm/components/dual-icon-button/DualIconButton.styled.d.ts +7 -0
  238. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js +40 -0
  239. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  240. package/dist/esm/components/dual-icon-button/index.d.ts +2 -0
  241. package/dist/esm/components/dual-icon-button/model.d.ts +12 -0
  242. package/dist/esm/components/fab-menu/FABMenu.d.ts +1 -1
  243. package/dist/esm/components/fab-menu/FABMenu.js.map +1 -1
  244. package/dist/esm/components/icon-button/IconButton.js +36 -32
  245. package/dist/esm/components/icon-button/IconButton.js.map +1 -1
  246. package/dist/esm/components/icon-button/IconButton.styled.d.ts +3 -1
  247. package/dist/esm/components/icon-button/IconButton.styled.js +20 -14
  248. package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
  249. package/dist/esm/components/icon-button/model.d.ts +12 -1
  250. package/dist/esm/components/icon-button/theme.js +12 -10
  251. package/dist/esm/components/icon-button/theme.js.map +1 -1
  252. package/dist/esm/components/input/Input.js +130 -125
  253. package/dist/esm/components/input/Input.js.map +1 -1
  254. package/dist/esm/components/input/Input.model.d.ts +2 -1
  255. package/dist/esm/components/input/Input.styled.d.ts +8 -1
  256. package/dist/esm/components/input/Input.styled.js +34 -22
  257. package/dist/esm/components/input/Input.styled.js.map +1 -1
  258. package/dist/esm/components/list-item/List.model.d.ts +3 -2
  259. package/dist/esm/components/list-item/ListItem.js +40 -38
  260. package/dist/esm/components/list-item/ListItem.js.map +1 -1
  261. package/dist/esm/components/list-item/ListItem.styled.d.ts +2 -1
  262. package/dist/esm/components/list-item/ListItem.styled.js +8 -8
  263. package/dist/esm/components/list-item/ListItem.styled.js.map +1 -1
  264. package/dist/esm/components/list-item/themes.d.ts +2 -2
  265. package/dist/esm/components/list-item/themes.js +29 -6
  266. package/dist/esm/components/list-item/themes.js.map +1 -1
  267. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  268. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +30 -28
  269. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  270. package/dist/esm/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  271. package/dist/esm/components/multi-level-dropdown/MenuItem.js +57 -54
  272. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  273. package/dist/esm/components/multi-level-dropdown/MenuList.d.ts +1 -0
  274. package/dist/esm/components/multi-level-dropdown/MenuList.js +46 -42
  275. package/dist/esm/components/multi-level-dropdown/MenuList.js.map +1 -1
  276. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +95 -59
  277. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  278. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  279. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +50 -41
  280. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  281. package/dist/esm/components/multi-level-dropdown/type.d.ts +1 -0
  282. package/dist/esm/components/tag/Tag.d.ts +1 -1
  283. package/dist/esm/components/tag/Tag.js +22 -18
  284. package/dist/esm/components/tag/Tag.js.map +1 -1
  285. package/dist/esm/components/tag/Tag.styled.d.ts +3 -1
  286. package/dist/esm/components/tag/Tag.styled.js +7 -7
  287. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  288. package/dist/esm/components/tag/model.d.ts +5 -1
  289. package/dist/esm/components/tag/model.js.map +1 -1
  290. package/dist/esm/components/whats-new/WhatsNew.d.ts +2 -0
  291. package/dist/esm/components/whats-new/WhatsNew.js +23 -19
  292. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  293. package/dist/esm/components/whats-new/WhatsNew.styles.js +8 -6
  294. package/dist/esm/components/whats-new/WhatsNew.styles.js.map +1 -1
  295. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +2 -0
  296. package/dist/esm/components/whats-new/WhatsNewButton.js +62 -52
  297. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  298. package/dist/esm/components/whats-new/WhatsNewPanel.js.map +1 -1
  299. package/dist/esm/constants/Theme.d.ts +36 -0
  300. package/dist/esm/constants/Theme.js +21 -1
  301. package/dist/esm/constants/Theme.js.map +1 -1
  302. package/dist/esm/editor/BikEditor.js +64 -62
  303. package/dist/esm/editor/BikEditor.js.map +1 -1
  304. package/dist/esm/editor/BikEditor.styles.js +32 -8
  305. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  306. package/dist/esm/editor/BikEditor.types.d.ts +8 -0
  307. package/dist/esm/editor/BikEditor.types.js.map +1 -1
  308. package/dist/esm/editor/extensions/buildExtensions.d.ts +8 -1
  309. package/dist/esm/editor/extensions/buildExtensions.js +42 -40
  310. package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
  311. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.d.ts +19 -0
  312. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js +62 -0
  313. package/dist/esm/editor/extensions/characterLimit/CharacterLimitExtension.js.map +1 -0
  314. package/dist/esm/editor/extensions/editorDropdown.styles.d.ts +8 -2
  315. package/dist/esm/editor/extensions/editorDropdown.styles.js +18 -22
  316. package/dist/esm/editor/extensions/editorDropdown.styles.js.map +1 -1
  317. package/dist/esm/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  318. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js +24 -28
  319. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  320. package/dist/esm/index.d.ts +1 -0
  321. package/dist/esm/index.js +977 -971
  322. package/dist/esm/index.js.map +1 -1
  323. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tpadding: 8px 12px;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHeight","maxHeight","tightParagraphs","COLORS","jsonMode","css","BikJsonHeader","BikJsonError"],"mappings":"uNAGaA,EAAiBC,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUrB,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA,gBACtC,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAkBzC,CAAC,CAAE,gBAAAC,CAAA,IAAuBA,EAAkB,IAAM,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAwB5DC,EAAAA,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,WAIpBA,EAAAA,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAoB5B,CAAC,CAAE,SAAAC,KACJA,GACAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GA6EC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBUC,EAAgBP,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgDvBQ,EAAeR,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"BikEditor.styles.js","sources":["../../../src/editor/BikEditor.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '../constants/Theme';\n\nexport const BikEditorShell = styled.div<{\n\tminHeight?: string;\n\tmaxHeight?: string;\n\ttightParagraphs?: boolean;\n\tjsonMode?: boolean;\n}>`\n\tposition: relative;\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmin-height: ${({ minHeight }) => minHeight ?? '60px'};\n\t\tmax-height: ${({ maxHeight }) => maxHeight ?? 'none'};\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t\tfont-size: 14px;\n\t\tline-height: 1.5;\n\t\tword-break: break-word;\n\n\t\t/* Paragraph spacing.\n\t\t Email/signature (rich): paragraphs carry the browser-default 1em block\n\t\t margin — the SAME spacing the sent HTML gets (we emit plain <p>, which\n\t\t renders against the default <p> margin in Gmail and our email viewer),\n\t\t so editor view == emitted HTML == Gmail. A single Enter = a new\n\t\t paragraph with a visible gap, like pasted Gmail/ChatGPT/Docs content.\n\t\t Other channels (WhatsApp/IG/FB/comments) are plain-text messaging, with\n\t\t no paragraph-gap concept — paragraphs are tight (margin:0) regardless of\n\t\t typed vs pasted. (A margin:0 attr still overrides to tight either way.) */\n\t\tp {\n\t\t\tmargin: ${({ tightParagraphs }) => (tightParagraphs ? '0' : '1em 0')};\n\t\t\tpadding: 0;\n\t\t}\n\n\t\tul,\n\t\tol {\n\t\t\tmargin: 0;\n\t\t\tpadding-left: 1.5em;\n\t\t}\n\n\t\tli + li {\n\t\t\tmargin-top: 2px;\n\t\t}\n\n\t\t/* The empty placeholder paragraph shouldn't inherit the rich-mode 1em\n\t\t block margin (email/SMTP/signature) — otherwise the placeholder text\n\t\t is pushed down. Real (non-empty) paragraphs keep their spacing. */\n\t\tp.is-editor-empty:first-child {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\tp.is-editor-empty:first-child::before {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tfloat: left;\n\t\t\tcolor: #adb5bd;\n\t\t\tpointer-events: none;\n\t\t\theight: 0;\n\t\t}\n\n\t\t/* hidden in-flow copy of the placeholder so a multi-line\n\t\t placeholder grows the editor instead of showing a scrollbar (the\n\t\t zero-height float above adds no height). -1lh cancels the caret line. */\n\t\tp.is-editor-empty:first-child::after {\n\t\t\tcontent: attr(data-placeholder);\n\t\t\tdisplay: block;\n\t\t\tvisibility: hidden;\n\t\t\tpointer-events: none;\n\t\t\tmargin-top: -1.5em; /* one line at the editor's line-height: 1.5 */\n\t\t\tmargin-top: -1lh;\n\t\t}\n\n\t\t/* Characters pasted beyond the soft character limit — rendered grey so the\n\t\t overflow is visible but clearly marked (see CharacterLimitExtension). */\n\t\t.bik-editor-overflow {\n\t\t\tcolor: ${COLORS.content.placeholder};\n\t\t}\n\t}\n\n\t.bik-mention {\n\t\tcolor: ${COLORS.content.brand};\n\t\tpadding: 1px 4px;\n\t}\n\t.bik-mention--team {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\t/* Typed mention chips (agent-builder): distinct colour per reference kind. */\n\t.bik-mention[data-kind='tool'] {\n\t\tcolor: #1570ef;\n\t\tbackground: #eff8ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-mention[data-kind='subagent'] {\n\t\tcolor: #6938ef;\n\t\tbackground: #f4f3ff;\n\t\tborder-radius: 4px;\n\t\tfont-weight: 500;\n\t}\n\t.bik-variable {\n\t}\n\n\t/* JSON body mode — scoped so normal-mode code blocks keep their default look\n\t (no reserved gutter, no monospace override). */\n\t${({ jsonMode }) =>\n\t\tjsonMode &&\n\t\tcss`\n\t\t\t/* Self-framed card: the header bar and the code area share one rounded\n\t\t\t border, so the component renders as a complete panel without the\n\t\t\t consumer having to wrap it. */\n\t\t\tborder: 1px solid #e1e4e8;\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\n\t\t\t/* The code block IS the editor surface, sitting below the header bar.\n\t\t\t White fills the scroller down to the min-height (no blank strip below\n\t\t\t short JSON); the header owns the grey. */\n\t\t\t.ProseMirror {\n\t\t\t\tpadding: 0;\n\t\t\t\tbackground: #ffffff;\n\t\t\t}\n\t\t\t/* ProseMirror appends an empty trailing paragraph AFTER the code block\n\t\t\t (a <p><br class=\"ProseMirror-trailingBreak\"></p> caret-escape node).\n\t\t\t In JSON mode there's nothing to escape to — it only renders as a blank\n\t\t\t line under the JSON, which is the \"extra space at the bottom\". Hide it. */\n\t\t\t.ProseMirror pre + p {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.ProseMirror pre {\n\t\t\t\tposition: relative;\n\t\t\t\tmargin: 0;\n\t\t\t\tbackground: transparent;\n\t\t\t\t/* Left padding reserves the line-number gutter; each .bik-json-lineno\n\t\t\t\t widget hangs back into it with a matching negative margin. */\n\t\t\t\tpadding: 12px 12px 12px 3.5em;\n\t\t\t\tfont-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,\n\t\t\t\t\tConsolas, 'Liberation Mono', monospace;\n\t\t\t\tfont-size: 13px;\n\t\t\t\tline-height: 1.6;\n\t\t\t\twhite-space: pre;\n\t\t\t\toverflow-x: auto;\n\t\t\t\ttab-size: 2;\n\t\t\t}\n\t\t\t.ProseMirror pre code {\n\t\t\t\tbackground: none;\n\t\t\t\tpadding: 0;\n\t\t\t\tfont-size: inherit;\n\t\t\t\tcolor: #1f2328;\n\t\t\t}\n\t\t\t/* Line-number gutter. Numbers hang into the code block's left padding via\n\t\t\t a negative margin (width + margin-right == the reserved padding, so the\n\t\t\t code text still starts at the padding edge). Stacked right borders form\n\t\t\t one continuous divider line. */\n\t\t\t.bik-json-lineno {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 2.5em;\n\t\t\t\tmargin-left: -3.5em;\n\t\t\t\tmargin-right: 1em;\n\t\t\t\tpadding-right: 0.7em;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: #8c959f;\n\t\t\t\tborder-right: 1px solid #e1e4e8;\n\t\t\t\tuser-select: none;\n\t\t\t\t-webkit-user-select: none;\n\t\t\t}\n\t\t\t.bik-json-key {\n\t\t\t\tcolor: #0550ae;\n\t\t\t}\n\t\t\t.bik-json-string {\n\t\t\t\tcolor: #0a7d33;\n\t\t\t}\n\t\t\t.bik-json-number {\n\t\t\t\tcolor: #b5590a;\n\t\t\t}\n\t\t\t.bik-json-boolean,\n\t\t\t.bik-json-null {\n\t\t\t\tcolor: #8250df;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t.bik-json-punct {\n\t\t\t\tcolor: #57606a;\n\t\t\t}\n\t\t`}\n\n\ta,\n\t.bik-link {\n\t\tcolor: #4f46e5;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-color: #a5b4fc;\n\t\ttext-underline-offset: 2px;\n\t\tcursor: pointer;\n\t\t&:hover {\n\t\t\tcolor: #3730a3;\n\t\t\ttext-decoration-color: #6366f1;\n\t\t}\n\t}\n`;\n\n/**\n * jsonMode header bar: a \"JSON\" label on the left and the Beautify / Copy actions\n * on the right, sitting above the code area with a bottom divider. Grey fill sets\n * it apart from the white code surface below (see the jsonMode block above).\n */\nexport const BikJsonHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tbackground: #f6f8fa;\n\tborder-bottom: 1px solid #e1e4e8;\n\n\t.bik-json-header-label {\n\t\tfont-family: inherit;\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #3c4149;\n\t\tuser-select: none;\n\t}\n\n\t.bik-json-header-actions {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t}\n\n\tbutton {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 10px;\n\t\tfont-family: inherit;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\tcolor: #3c4149;\n\t\tbackground: #ffffff;\n\t\tborder: 1px solid #d0d7de;\n\t\tborder-radius: 6px;\n\t\tcursor: pointer;\n\n\t\t&:hover:not(:disabled) {\n\t\t\tbackground: #f3f4f6;\n\t\t\tborder-color: #adb5bd;\n\t\t}\n\t\t&:disabled {\n\t\t\topacity: 0.5;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n`;\n\n/** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */\nexport const BikJsonError = styled.div`\n\tpadding: 6px 12px;\n\tfont-size: 12px;\n\tline-height: 1.5;\n\tcolor: #d1242f;\n\tbackground: #fff0f0;\n\tborder-top: 1px solid #ffd7d5;\n\tword-break: break-word;\n\n\tstrong {\n\t\tfont-weight: 600;\n\t}\n`;\n"],"names":["BikEditorShell","styled","minHeight","maxHeight","tightParagraphs","COLORS","jsonMode","css","BikJsonHeader","BikJsonError"],"mappings":"uNAGaA,EAAiBC,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,gBAUrB,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA,gBACtC,CAAC,CAAE,UAAAC,KAAgBA,GAAa,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAiBzC,CAAC,CAAE,gBAAAC,CAAA,IAAuBA,EAAkB,IAAM,OAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YA4C3DC,EAAAA,OAAO,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,WAK3BA,EAAAA,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,WAIpBA,EAAAA,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAoB5B,CAAC,CAAE,SAAAC,KACJA,GACAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GA6EC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBUC,EAAgBP,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgDvBQ,EAAeR,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditor.types.js","sources":["../../../src/editor/BikEditor.types.ts"],"sourcesContent":["/**\n * ┌─────────────────────────────────────────────────────────────────────────┐\n * │ PUBLIC API LAYER — zero editor-framework imports │\n * │ │\n * │ This file is the consumer contract for BikEditor. It has NO dependency │\n * │ on TipTap, Lexical, Slate, or any other rich-text library. │\n * │ │\n * │ If the underlying editor is ever swapped, ONLY the implementation files │\n * │ change — this file, src/editor/index.ts, and all consumer code stay as- │\n * │ is. The files that would change are: │\n * │ • BikEditor.tsx — wires props into the editor instance │\n * │ • BikEditor.utils.ts — HTML / document-state adapters │\n * │ • extensions/ — extension / plugin layer │\n * └─────────────────────────────────────────────────────────────────────────┘\n */\nimport React from 'react';\n\n/**\n * Opt in to specific editor capabilities. Both default to `false`.\n *\n * @example\n * // Email editor with full rich text support\n * <BikEditor features={{ richPaste: true, richTypography: true }} />\n */\nexport interface EditorFeatures {\n\t/** Preserve HTML formatting on paste. Default: `false`. */\n\trichPaste?: boolean;\n\t/** Enable font family, font size, text alignment, highlight, subscript, superscript, and image. Default: `false`. */\n\trichTypography?: boolean;\n\t/**\n\t * Restrict which inline marks are active in the editor.\n\t * When set, only the listed marks are registered — all others are disabled\n\t * (no rendering, no keyboard shortcuts, no paste preservation).\n\t * Omit to allow all marks (default).\n\t *\n\t * @example\n\t * // LiveChat: bold only, no italic / underline / strike\n\t * features={{ allowedMarks: ['bold'] }}\n\t */\n\tallowedMarks?: Array<'bold' | 'italic' | 'strike' | 'underline' | 'code'>;\n\t/**\n\t * Turn the editor into a Postman-style JSON body editor: the whole document\n\t * becomes one syntax-highlighted JSON code block. Disables the rich-text stack\n\t * (mentions, typography, rich paste, sections). Drive it via `ref.json.*`.\n\t * Default: `false`.\n\t *\n\t * @example\n\t * <BikEditor features={{ jsonMode: true }} initialContent='{ \"id\": 1 }' />\n\t */\n\tjsonMode?: boolean;\n}\n\n/**\n * A named content section placed below the main body, separated by an invisible divider.\n *\n * Sections let you split a single editor instance into independently readable\n * and writable zones — for example: body / signature / forwarded mail.\n *\n * @example\n * sections={[\n * { id: 'signature', content: '<p>Best regards,<br/>Alice</p>' },\n * { id: 'forwarded', content: '<p>--- Forwarded message ---</p>' },\n * ]}\n */\nexport interface EditorSection {\n\t/**\n\t * Unique identifier. Used in ref methods: `getSectionContent(id)`,\n\t * `setSectionContent(id, html)`, `focusSection(id)`, `clearSection(id)`.\n\t * The string `'body'` is reserved for the main content above all dividers.\n\t */\n\tid: string;\n\t/** Initial HTML content of this section. */\n\tcontent: string;\n}\n\n/**\n * Data passed to the `onPaste` callback.\n * Return `true` from your handler to suppress BikEditor's default paste handling\n * (rich-paste and plain-text stripping won't run for that event).\n */\nexport interface PasteData {\n\t/** All files in the clipboard (images, PDFs, etc.). */\n\tfiles: File[];\n\t/** Image files only — a filtered subset of `files`. */\n\timages: File[];\n\t/** Plain text from the clipboard. */\n\ttext: string;\n\t/** HTML from the clipboard (empty string if the source doesn't provide HTML). */\n\thtml: string;\n\t/** The raw browser ClipboardEvent — for advanced use. */\n\tevent: ClipboardEvent;\n}\n\n/**\n * A custom keyboard shortcut registered with the editor.\n *\n * @example\n * shortcuts={[\n * // Mod = Cmd on Mac, Ctrl on Windows/Linux\n * { key: 'Enter', modifiers: ['mod'], handler: handleSend },\n * { key: 's', modifiers: ['mod'], handler: handleSave },\n * { key: 'k', modifiers: ['mod', 'shift'], handler: openLinkModal },\n * ]}\n */\nexport interface KeyboardShortcut {\n\t/** Key name. Use the same strings as KeyboardEvent.key, e.g. `'Enter'`, `'s'`, `'k'`. */\n\tkey: string;\n\t/**\n\t * Modifier keys.\n\t * `'mod'` maps to Cmd on macOS and Ctrl on Windows/Linux — prefer it over\n\t * `'ctrl'` for cross-platform shortcuts.\n\t */\n\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t/** Called when the shortcut fires. Returning nothing is fine. */\n\thandler: () => void;\n}\n\n/** Content object returned by onChange, onSend, getContent(), and getSectionContent(). */\nexport interface EditorSnapshot {\n\t/** Serialised HTML. Safe to pass back to setContent() or setSectionContent(). */\n\thtml: string;\n\t/** Plain text, stripped of all marks and block nodes. */\n\ttext: string;\n\t/** True when the document contains no user-visible content. */\n\tisEmpty: boolean;\n\t/** Character count at this point in time. */\n\tcharacterCount: number;\n}\n\n/**\n * Result of parsing the JSON body (features.jsonMode). Returned by `ref.json.parse()`.\n * Empty / whitespace-only content is treated as valid with a `null` value.\n */\nexport interface JsonParseResult {\n\t/** True when the current text is valid JSON. */\n\tvalid: boolean;\n\t/** The parsed value (`null` when empty or invalid). */\n\tvalue: unknown;\n\t/**\n\t * Human-readable error message, cleaned of the raw parser noise\n\t * (e.g. `\"Bad control character in string literal\"` instead of\n\t * `\"… in JSON at position 94 (line 7 column 9)\"`). `null` when valid.\n\t */\n\terror: string | null;\n\t/** 1-based line of the error, or `null` when valid / not locatable. */\n\tline: number | null;\n\t/** 1-based column of the error, or `null` when valid / not locatable. */\n\tcolumn: number | null;\n}\n\n/**\n * JSON body controls, available on the ref when `features.jsonMode` is on.\n * Access via `editorRef.current.json`.\n *\n * @example\n * editorRef.current?.json?.format(); // pretty-print (2-space indent)\n * const { valid, value } = editorRef.current!.json!.parse();\n */\nexport interface JsonBodyApi {\n\t/** Current raw text of the JSON body. */\n\tgetText: () => string;\n\t/** Replace the whole JSON body with `raw` and fire onChange. */\n\tsetText: (raw: string) => void;\n\t/** Parse the current text without throwing — see JsonParseResult. */\n\tparse: () => JsonParseResult;\n\t/** True when the current text is valid JSON. */\n\tisValid: () => boolean;\n\t/**\n\t * Pretty-print the current text in place. No-op when the text is invalid.\n\t * @param indent Number of spaces per level. Default `2`.\n\t */\n\tformat: (indent?: number) => void;\n\t/** Collapse the current text to a single line. No-op when invalid. */\n\tminify: () => void;\n}\n\n/** One item shown in the @agent or #team mention dropdown. */\nexport interface MentionItem {\n\t/** Unique identifier stored as a node attribute. Used to look up the item later. */\n\tid: string | number;\n\t/** Display name shown in the dropdown and inserted into the document. */\n\tlabel: string;\n\t/** Avatar image URL. Shown in the built-in row when renderMentionItem is not provided. */\n\tavatarUrl?: string;\n\t/** When true, a green presence dot appears in the built-in row. */\n\tisOnline?: boolean;\n\t/** Any extra data your app needs. Passed back as-is in onMentionSelected. */\n\tmeta?: Record<string, unknown>;\n}\n\n/** One item shown in the / slash-command dropdown. */\nexport interface SlashCommandItem {\n\t/** Unique identifier. */\n\tid: string;\n\t/** Short command name shown as the primary label in the menu. */\n\tlabel: string;\n\t/** Optional one-line description shown below the label in the built-in row. */\n\tdescription?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Feature config objects — pass one object per feature instead of N flat props\n// ---------------------------------------------------------------------------\n\n/**\n * Props passed to the `renderDropdown` function in `MentionConfig`.\n * `activeIndex` is the keyboard-navigated row — highlight it in your UI.\n * Call `onSelect(item)` when the user picks one.\n */\nexport interface MentionDropdownRenderProps {\n\titems: MentionItem[];\n\t/** The text the user typed after the `@` or `#` trigger. */\n\tquery: string;\n\t/**\n\t * Index of the currently highlighted row (arrow-key navigation).\n\t * The editor manages this automatically — just use it for visual highlighting.\n\t */\n\tactiveIndex: number;\n\t/** Call this when the user selects an item (click, touch, etc.). */\n\tonSelect: (item: MentionItem) => void;\n\t/**\n\t * Register a keyboard handler so a CUSTOM dropdown can own arrow-key / Enter\n\t * navigation (e.g. a multi-level picker whose visible rows differ from the\n\t * flat `items` list). Return `true` from the handler to consume the key.\n\t * Pass `null` to unregister. When not registered, the editor falls back to\n\t * navigating the flat `items` list.\n\t */\n\tregisterKeyHandler?: (\n\t\thandler: ((event: KeyboardEvent) => boolean) | null,\n\t) => void;\n\t/**\n\t * Dismiss the dropdown WITHOUT selecting an item: closes the menu and strips\n\t * the typed `@`/`#` trigger + query. Use for custom actions in a multi-level\n\t * picker (e.g. a \"Create new\" row that opens a drawer instead of inserting a\n\t * mention).\n\t */\n\tonClose?: () => void;\n}\n\n/**\n * Everything related to @ and # mention dropdowns, in one place.\n *\n * @example\n * mentions={{\n * agents: [{ id: 1, label: 'Alice', avatarUrl: '...' }],\n * teams: [{ id: 't1', label: 'Support' }],\n * onSelect: (item, char) => console.log(char, item),\n * }}\n */\nexport interface MentionConfig {\n\t/** Items shown when the user types `@`. */\n\tagents?: MentionItem[];\n\t/** Items shown when the user types `#`. */\n\tteams?: MentionItem[];\n\t/** Called when the user picks an item. `char` is `'@'` or `'#'`. */\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void;\n\t/**\n\t * Custom renderer for each row in the dropdown.\n\t * `isActive` is `true` when that row is currently highlighted by keyboard\n\t * navigation (arrows move it, Enter selects it). Use it to apply a highlight\n\t * style so the user can see which item they're about to select.\n\t * Omit to use the built-in avatar + name row.\n\t *\n\t * Use `renderDropdown` instead when you need a completely different structure.\n\t *\n\t * @example\n\t * renderItem={(item, isActive) => (\n\t * <div style={{ background: isActive ? '#f0f0f0' : undefined }}>\n\t * {item.label}\n\t * </div>\n\t * )}\n\t */\n\trenderItem?: (item: MentionItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Render the entire dropdown yourself instead of individual rows.\n\t * The editor still manages keyboard navigation — `activeIndex` tells you\n\t * which row is highlighted, and `onSelect(item)` confirms the selection.\n\t * Takes priority over `renderItem` when both are provided.\n\t *\n\t * @example\n\t * renderDropdown={({ items, query, activeIndex, onSelect }) => (\n\t * <MyDropdown\n\t * items={items}\n\t * highlightedIndex={activeIndex}\n\t * onPick={onSelect}\n\t * />\n\t * )}\n\t */\n\trenderDropdown?: (props: MentionDropdownRenderProps) => React.ReactNode;\n\t/**\n\t * When true, a typed trigger char (`@` / `#`) and its query are removed if the\n\t * suggestion menu closes without a selection (click-outside / no match). Default\n\t * false — the typed text is kept.\n\t */\n\tremoveTriggerOnDismiss?: boolean;\n}\n\n/**\n * Props passed to the `renderDropdown` function in `SlashCommandConfig`.\n */\nexport interface SlashCommandDropdownRenderProps {\n\titems: SlashCommandItem[];\n\t/** The text the user typed after `/`. */\n\tquery: string;\n\t/** Index of the currently highlighted row. Use for visual highlighting. */\n\tactiveIndex: number;\n\t/** Call this when the user selects an item. */\n\tonSelect: (item: SlashCommandItem) => void;\n}\n\n/**\n * Everything related to the `/` slash-command menu, in one place.\n *\n * @example\n * slashCommands={{\n * items: [{ id: 'ai-reply', label: 'AI Reply', description: 'Generate a reply' }],\n * onSelect: (cmd) => triggerAI(cmd.id),\n * }}\n */\nexport interface SlashCommandConfig {\n\t/** The list of commands. Filtered client-side as the user types after `/`. */\n\titems: SlashCommandItem[];\n\t/** Called when the user selects a command. The `/` trigger is removed from the doc. */\n\tonSelect?: (command: SlashCommandItem) => void;\n\t/**\n\t * Custom renderer for each row.\n\t * `isActive` is `true` when that row is highlighted by keyboard navigation.\n\t * Omit to use the built-in label + description row.\n\t *\n\t * Use `renderDropdown` instead when you need a completely different structure.\n\t */\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Render the entire slash-command dropdown yourself.\n\t * The editor manages keyboard navigation — use `activeIndex` to highlight\n\t * the active row and call `onSelect(item)` to confirm selection.\n\t * Takes priority over `renderItem` when both are provided.\n\t *\n\t * @example\n\t * renderDropdown={({ items, activeIndex, onSelect }) => (\n\t * <MyCmdPalette commands={items} active={activeIndex} onPick={onSelect} />\n\t * )}\n\t */\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => React.ReactNode;\n}\n\n/**\n * Configuration for how hyperlinks behave in the editor.\n *\n * @example\n * link={{ renderTooltip: ({ href, text, onOpen, onRemove }) => (\n * <MyLinkPopover href={href} onOpen={onOpen} onRemove={onRemove} />\n * )}}\n */\nexport interface LinkConfig {\n\t/**\n\t * Custom tooltip rendered when the user clicks a link.\n\t * Receives the href, display text, bounding rect (for positioning),\n\t * and ready-to-call action handlers.\n\t * Omit to use the minimal built-in tooltip.\n\t */\n\trenderTooltip?: (props: LinkTooltipProps) => React.ReactNode;\n}\n\n/**\n * Snapshot of all active marks and block types at the current cursor or selection.\n * Returned by onSelectionChange and ref.getActiveFormats().\n *\n * Keep this in component state and pass it to BikEditorToolbar (or your own toolbar)\n * to keep button active-states in sync.\n *\n * @example\n * const [formats, setFormats] = useState(DEFAULT_ACTIVE_FORMATS);\n * <BikEditor onSelectionChange={setFormats} ... />\n * <BikEditorToolbar activeFormats={formats} ... />\n */\nexport interface FormatState {\n\tbold: boolean;\n\titalic: boolean;\n\tunderline: boolean;\n\tstrike: boolean;\n\tbulletList: boolean;\n\torderedList: boolean;\n\tblockquote: boolean;\n\tcodeBlock: boolean;\n\t/** Non-null when the cursor is inside (or selection spans) a hyperlink. */\n\tlink: { href: string } | null;\n\ttextAlign: 'left' | 'center' | 'right' | 'justify' | null;\n\tfontFamily: string | null;\n\tfontSize: string | null;\n\t/** Active text colour as a CSS colour string, or null if none. */\n\tcolor: string | null;\n\t/** Active highlight (background) colour, or null if none. */\n\thighlight: string | null;\n\t/** True when the cursor/selection is in a superscript. */\n\tsuperscript: boolean;\n\t/** True when the cursor/selection is in a subscript. */\n\tsubscript: boolean;\n}\n\nexport const DEFAULT_FORMAT_STATE: FormatState = {\n\tbold: false,\n\titalic: false,\n\tunderline: false,\n\tstrike: false,\n\tbulletList: false,\n\torderedList: false,\n\tblockquote: false,\n\tcodeBlock: false,\n\tlink: null,\n\ttextAlign: null,\n\tfontFamily: null,\n\tfontSize: null,\n\tcolor: null,\n\thighlight: null,\n\tsuperscript: false,\n\tsubscript: false,\n};\n\n/**\n * All formatting and insertion commands. Access via `editorRef.current.actions`.\n *\n * Every method focuses the editor internally — no need to call `.focus()` first.\n *\n * @example\n * editorRef.current?.actions.toggleBold();\n * editorRef.current?.actions.setLink('https://example.com', 'Visit example');\n */\nexport interface EditorActions {\n\t// ── Basic marks ───────────────────────────────────────────────────────────\n\ttoggleBold: () => void;\n\ttoggleItalic: () => void;\n\ttoggleUnderline: () => void;\n\ttoggleStrike: () => void;\n\n\t// ── Blocks ────────────────────────────────────────────────────────────────\n\ttoggleBulletList: () => void;\n\ttoggleOrderedList: () => void;\n\ttoggleBlockquote: () => void;\n\ttoggleCodeBlock: () => void;\n\n\t// ── Alignment & typography ────────────────────────────────────────────────\n\tsetTextAlign: (align: 'left' | 'center' | 'right' | 'justify') => void;\n\t/** Pass a CSS font-family value, e.g. `'Inter, sans-serif'`. Only works when richTypography is on. */\n\tsetFontFamily: (font: string) => void;\n\t/** Pass a CSS size value, e.g. `'16px'` or `'1.25rem'`. Only works when richTypography is on. */\n\tsetFontSize: (size: string) => void;\n\n\t// ── Colour ────────────────────────────────────────────────────────────────\n\t/** Sets the text colour. Pass any CSS colour value, e.g. `'#e53e3e'`. */\n\tsetColor: (color: string) => void;\n\t/** Sets the highlight (background) colour. */\n\tsetHighlight: (color: string) => void;\n\t/** Removes the text colour mark from the current selection. */\n\tunsetColor: () => void;\n\t/** Removes the highlight mark from the current selection. */\n\tunsetHighlight: () => void;\n\n\t// ── Links ─────────────────────────────────────────────────────────────────\n\t/**\n\t * Applies a hyperlink to the current selection, or updates the link the\n\t * cursor is already inside.\n\t *\n\t * @param href The URL.\n\t * @param text Optional display text. When provided, the visible text of the\n\t * linked range is replaced atomically in the same undo step.\n\t *\n\t * @example\n\t * actions.setLink('https://example.com');\n\t * actions.setLink('https://example.com', 'Visit example');\n\t */\n\tsetLink: (href: string, text?: string) => void;\n\t/** Updates only the href of the link at the current cursor. */\n\tupdateLink: (href: string) => void;\n\t/** Removes the link mark but keeps the visible text. */\n\tremoveLink: () => void;\n\n\t// ── Insertions ────────────────────────────────────────────────────────────\n\t/** Inserts an emoji character at the cursor. */\n\tinsertEmoji: (emoji: string) => void;\n\t/**\n\t * Inserts a `{{variableName}}` token at the cursor.\n\t * The token renders with a distinct highlight inside the editor.\n\t */\n\tinsertVariable: (variableName: string) => void;\n\t/** Inserts arbitrary HTML at the current cursor position. */\n\tinsertHtml: (html: string) => void;\n\n\t// ── History ───────────────────────────────────────────────────────────────\n\tundo: () => void;\n\tredo: () => void;\n\tcanUndo: () => boolean;\n\tcanRedo: () => boolean;\n\n\t// ── Rich typography (richTypography feature required) ─────────────────────\n\t/** Toggles superscript on the selection. Only works when richTypography is on. */\n\ttoggleSuperscript: () => void;\n\t/** Toggles subscript on the selection. Only works when richTypography is on. */\n\ttoggleSubscript: () => void;\n\t/** Inserts an inline image at the cursor. Only works when richTypography is on. */\n\tinsertImage: (src: string) => void;\n}\n\n/** Props passed to your renderLinkTooltip render prop. */\nexport interface LinkTooltipProps {\n\t/** The href of the active link. */\n\thref: string;\n\t/** The display text of the link. */\n\ttext: string;\n\t/** Bounding rect of the link element — use this to position your popover. */\n\trect: DOMRect;\n\t/** Opens the link in a new tab. */\n\tonOpen: () => void;\n\t/** Removes the link mark but keeps the visible text. */\n\tonRemove: () => void;\n\t/** Hides the bubble menu. Call this before opening an edit modal so the tooltip doesn't linger. */\n\tonHide: () => void;\n}\n\n/**\n * Imperative handle exposed by BikEditor.\n *\n * Obtain via `useRef<BikEditorRef>()` and pass to `<BikEditor ref={...} />`.\n * All methods are safe to call after the first render.\n *\n * @example\n * const ref = useRef<BikEditorRef>(null);\n * <BikEditor ref={ref} ... />\n * ref.current?.clearContent();\n * ref.current?.actions.toggleBold();\n */\nexport interface BikEditorRef {\n\t// ── Focus ─────────────────────────────────────────────────────────────────\n\t/** Moves focus into the editor. Optionally pass a position: 'start', 'end', 'all', or a numeric offset. */\n\tfocus: (position?: 'start' | 'end' | 'all' | number | boolean | null) => void;\n\t/** Removes focus from the editor. */\n\tblur: () => void;\n\n\t// ── Content ───────────────────────────────────────────────────────────────\n\t/** Clears the entire document and fires onChange. */\n\tclearContent: () => void;\n\t/**\n\t * Replaces the full document with the given HTML and fires onChange.\n\t * Overwrites all sections. Use setSectionContent() / setBodyContent() to\n\t * update a single section without touching the others.\n\t */\n\tsetContent: (html: string) => void;\n\t/** Inserts HTML at the current cursor position without replacing anything. */\n\tinsertContent: (html: string) => void;\n\t/**\n\t * Inserts HTML inline at the current cursor position, unwrapping block\n\t * wrappers (e.g. `<p>`) so the content merges into the surrounding paragraph\n\t * instead of creating new blocks. Use for macros, quick replies, etc.\n\t */\n\tinsertInlineContent: (html: string) => void;\n\t/** Inserts HTML at the very start of the document. */\n\tinsertAtStart: (html: string) => void;\n\t/** Inserts HTML as a new block at the end of the document. */\n\tinsertBlock: (html: string) => void;\n\t/**\n\t * Appends HTML inline inside the last paragraph of the document.\n\t * Ideal for streaming — call repeatedly with each text chunk.\n\t * Use `appendBodyContent` instead if the editor has named sections.\n\t */\n\tappendInline: (html: string) => void;\n\t/** @deprecated Use `insertBlock` */\n\tinsertAtEnd: (html: string) => void;\n\t/** @deprecated Use `appendInline` */\n\tappendContent: (html: string) => void;\n\t/** Returns the full document as `{ html, text, isEmpty, characterCount }`. */\n\tgetContent: () => EditorSnapshot;\n\t/**\n\t * Returns the raw TipTap document as a plain JSON object.\n\t * Returns `null` when the editor is not yet mounted.\n\t */\n\tgetJSON: () => Record<string, unknown> | null;\n\t/**\n\t * Walks the document and returns all mention IDs currently in the editor,\n\t * split by type. IDs are deduplicated and returned as arrays.\n\t *\n\t * @example\n\t * const { agentIds, teamIds } = ref.current?.getMentions() ?? { agentIds: [], teamIds: [] };\n\t */\n\tgetMentions: () => { agentIds: string[]; teamIds: string[] };\n\n\t// ── Selection ─────────────────────────────────────────────────────────────\n\t/**\n\t * Returns the current cursor / selection position as a `{ from, to }` pair.\n\t * When nothing is selected, `from === to` (a collapsed cursor).\n\t * Pass the returned value to `insertAtPosition()` to insert at an exact spot.\n\t *\n\t * @example\n\t * const { from } = ref.current?.getCursorPosition() ?? { from: 0, to: 0 };\n\t * ref.current?.insertAtPosition(from, '<strong>inserted</strong>');\n\t */\n\tgetCursorPosition: () => { from: number; to: number };\n\t/**\n\t * Inserts HTML at an explicit document position rather than at the current cursor.\n\t * Use `getCursorPosition()` to get the position, or any value from\n\t * `findSectionStartPos` / `findSectionEndPos` if you need section-relative insertion.\n\t *\n\t * @example\n\t * const { from } = ref.current!.getCursorPosition();\n\t * ref.current?.insertAtPosition(from, '<em>hello</em>');\n\t */\n\tinsertAtPosition: (pos: number, html: string) => void;\n\t/**\n\t * Returns the currently selected plain text.\n\t * When the cursor is inside a link with nothing selected, returns the full\n\t * link text — useful for pre-filling a link modal's text field.\n\t */\n\tgetSelectedText: () => string;\n\n\t// ── Character count ───────────────────────────────────────────────────────\n\t/**\n\t * Returns the current character count and the configured limit (or null).\n\t * Use this to render your own character counter anywhere you like.\n\t *\n\t * @example\n\t * const { count, limit } = ref.current?.getCharacterCount() ?? { count: 0, limit: null };\n\t * <span style={{ color: count >= (limit ?? Infinity) ? 'red' : 'inherit' }}>\n\t * {count}{limit != null ? ` / ${limit}` : ''}\n\t * </span>\n\t */\n\tgetCharacterCount: () => { count: number; limit: number | null };\n\n\t// ── Sections ─────────────────────────────────────────────────────────────\n\t/**\n\t * Returns content for a named section.\n\t * Use `'body'` to get the main content above all section dividers.\n\t *\n\t * @example\n\t * const sig = ref.current?.getSectionContent('signature');\n\t */\n\tgetSectionContent: (sectionId: string) => EditorSnapshot;\n\t/**\n\t * Replaces the content of a named section without touching other sections.\n\t * If the section doesn't exist yet it is appended at the end.\n\t *\n\t * @example\n\t * ref.current?.setSectionContent('signature', '<p>New signature</p>');\n\t * ref.current?.setSectionContent('body', rephrased); // same as setBodyContent\n\t */\n\tsetSectionContent: (sectionId: string, html: string) => void;\n\t/**\n\t * Moves the cursor to the start of a named section.\n\t * Use `'body'` to focus the main content area.\n\t */\n\tfocusSection: (sectionId: string) => void;\n\t/** Clears all content in a named section (replaces with an empty paragraph). */\n\tclearSection: (sectionId: string) => void;\n\n\t// ── Convenience body shorthands ───────────────────────────────────────────\n\t/** Shorthand for `getSectionContent('body')`. */\n\tgetBodyContent: () => EditorSnapshot;\n\t/** Shorthand for `setSectionContent('body', html)`. */\n\tsetBodyContent: (html: string) => void;\n\t/**\n\t * Atomically sets the body AND all sections in a single editor update.\n\t * Sections are laid out in the exact order supplied — use this instead of\n\t * multiple `setSectionContent()` calls whenever order matters (e.g. forward\n\t * mail where signature must appear before the forwarded thread).\n\t *\n\t * @example\n\t * ref.current?.setBodyAndSections('<p></p>', [\n\t * { id: 'signature', content: '<p>Alice</p>' },\n\t * { id: 'forwarded', content: '<p>--- Forwarded ---</p>' },\n\t * ]);\n\t */\n\tsetBodyAndSections: (\n\t\tbody: string,\n\t\tsections: Array<{ id: string; content: string }>,\n\t) => void;\n\t/**\n\t * Appends HTML to the end of the body section without moving the cursor.\n\t * Ideal for streaming AI-generated content — call repeatedly with each chunk.\n\t * Does NOT clear existing content; call `setBodyContent('')` first if needed.\n\t *\n\t * @example\n\t * // Stream AI response chunk-by-chunk\n\t * ref.current?.setBodyContent('');\n\t * for await (const chunk of aiStream) {\n\t * ref.current?.appendBodyContent(chunk);\n\t * }\n\t */\n\tappendBodyContent: (html: string) => void;\n\n\t/**\n\t * Inserts HTML at the start of a named section (or `'body'`).\n\t * Inserts at the very start of the document when `sectionId` is `'body'`.\n\t */\n\tinsertAtSectionStart: (sectionId: string, html: string) => void;\n\t/**\n\t * Inserts HTML at the end of a named section (or `'body'`).\n\t * For `'body'`, inserts just before the first section divider (or at end of doc).\n\t */\n\tinsertAtSectionEnd: (sectionId: string, html: string) => void;\n\n\t// ── Formats & actions ─────────────────────────────────────────────────────\n\t/** Returns a snapshot of all active marks at the current cursor or selection. */\n\tgetActiveFormats: () => FormatState;\n\t/** All formatting and insertion commands. See EditorActions. */\n\tactions: EditorActions;\n\n\t// ── JSON body (features.jsonMode required) ─────────────────────────────────\n\t/**\n\t * JSON body controls. Present only when `features.jsonMode` is on\n\t * (`undefined` otherwise). See JsonBodyApi.\n\t *\n\t * @example\n\t * editorRef.current?.json?.format();\n\t */\n\tjson?: JsonBodyApi;\n}\n\n/**\n * Props for `<BikEditor />`. All props are optional.\n */\nexport interface BikEditorProps {\n\t// ── Features ──────────────────────────────────────────────────────────────\n\t/**\n\t * Opt in to specific editor capabilities. Both default to `false`.\n\t *\n\t * @example\n\t * <BikEditor features={{ richPaste: true, richTypography: true }} />\n\t */\n\tfeatures?: EditorFeatures;\n\n\t// ── Content ───────────────────────────────────────────────────────────────\n\t/**\n\t * HTML loaded on mount. Ignored after first render.\n\t * Use `ref.setContent()` to change content imperatively later.\n\t */\n\tinitialContent?: string;\n\t/**\n\t * Named sections placed below the main body.\n\t * Each section is separated from the previous one by an invisible divider node.\n\t * The array order determines the visual order in the document.\n\t *\n\t * These are only the INITIAL values — use `ref.setSectionContent()` to update\n\t * a section after mount without re-mounting the editor.\n\t *\n\t * @example\n\t * sections={[\n\t * { id: 'signature', content: '<p>Best regards, Alice</p>' },\n\t * { id: 'forwarded', content: '<p>--- Forwarded message ---</p>' },\n\t * ]}\n\t */\n\tsections?: EditorSection[];\n\t/** Placeholder text shown when the editor is empty. */\n\tplaceholder?: string;\n\n\t// ── Behaviour ─────────────────────────────────────────────────────────────\n\t/** Makes the editor read-only. The toolbar still renders but actions are no-ops. */\n\tdisabled?: boolean;\n\t/**\n\t * Hard character limit. The editor refuses to accept input beyond this point.\n\t * The limit is enforced silently — no UI is rendered. Use\n\t * `ref.getCharacterCount()` or `onChange.characterCount` to display it yourself.\n\t */\n\tmaxCharacters?: number;\n\n\t// ── Keyboard shortcuts ────────────────────────────────────────────────────\n\t/**\n\t * Custom keyboard shortcuts. BikEditor registers no shortcuts of its own —\n\t * every shortcut must be explicitly listed here.\n\t *\n\t * @example\n\t * shortcuts={[\n\t * { key: 'Enter', modifiers: ['mod'], handler: handleSend },\n\t * { key: 's', modifiers: ['mod', 'shift'], handler: handleDraft },\n\t * ]}\n\t */\n\tshortcuts?: KeyboardShortcut[];\n\t/**\n\t * Shortcut key that fires `onSend`. No key is bound to `onSend` unless you\n\t * set this explicitly. Requires `onSend` to also be provided.\n\t *\n\t * `'mod'` maps to Cmd on macOS and Ctrl on Windows/Linux.\n\t *\n\t * @example\n\t * // Single shortcut\n\t * sendShortcut={{ key: 'Enter', modifiers: ['mod'] }}\n\t * // Multiple shortcuts\n\t * sendShortcut={[\n\t * { key: 'Enter', modifiers: ['mod'] },\n\t * { key: 's', modifiers: ['mod'] },\n\t * ]}\n\t */\n\tsendShortcut?:\n\t\t| { key: string; modifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'> }\n\t\t| Array<{\n\t\t\t\tkey: string;\n\t\t\t\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t\t }>;\n\n\t// ── Mentions ─────────────────────────────────────────────────────────────\n\t/**\n\t * Enables `@` (agent) and `#` (team) mention dropdowns.\n\t * Bundle all mention-related config in one object so it's easy to find.\n\t *\n\t * @example\n\t * mentions={{\n\t * agents: myAgents,\n\t * teams: myTeams,\n\t * onSelect: (item, char) => track(char, item.id),\n\t * }}\n\t */\n\tmentions?: MentionConfig;\n\n\t// ── Slash commands ────────────────────────────────────────────────────────\n\t/**\n\t * Enables the `/` slash-command menu.\n\t * Bundle all slash-command config in one object.\n\t *\n\t * @example\n\t * slashCommands={{\n\t * items: MY_COMMANDS,\n\t * onSelect: (cmd) => handleCommand(cmd.id),\n\t * }}\n\t */\n\tslashCommands?: SlashCommandConfig;\n\n\t// ── Link ─────────────────────────────────────────────────────────────────\n\t/**\n\t * Link-related configuration — currently just the click tooltip.\n\t *\n\t * @example\n\t * link={{ renderTooltip: ({ href, onOpen, onRemove }) => (\n\t * <MyTooltip href={href} onOpen={onOpen} onRemove={onRemove} />\n\t * )}}\n\t */\n\tlink?: LinkConfig;\n\n\t// ── JSON body (features.jsonMode) ──────────────────────────────────────────\n\t/**\n\t * Custom renderer for the JSON parse error shown below the editor in\n\t * `features.jsonMode`. Receives the current {@link JsonParseResult} (always\n\t * an invalid one — it's only called when the JSON is broken). Omit to use the\n\t * built-in inline error banner; the error is never rendered when the JSON is\n\t * valid or when `jsonMode` is off.\n\t *\n\t * @example\n\t * renderJsonError={(err) => (\n\t * <MyBanner>Line {err.line}: {err.error}</MyBanner>\n\t * )}\n\t */\n\trenderJsonError?: (error: JsonParseResult) => React.ReactNode;\n\n\t// ── Callbacks ─────────────────────────────────────────────────────────────\n\t/**\n\t * Called once, immediately after the editor finishes initializing.\n\t * Any imperative ref methods called before this fires are queued internally\n\t * and executed automatically once the editor is ready — consumers do not\n\t * need timers or readiness guards.\n\t *\n\t * @example\n\t * <BikEditor\n\t * ref={editorRef}\n\t * onReady={() => editorRef.current?.setContent(savedDraft)}\n\t * />\n\t */\n\tonReady?: () => void;\n\t/** Called on every document change. */\n\tonChange?: (content: EditorSnapshot) => void;\n\t/**\n\t * Called when the user presses the key combo defined by `sendShortcut`.\n\t * Only fires when both `onSend` and `sendShortcut` are provided.\n\t */\n\tonSend?: (content: EditorSnapshot) => void;\n\t/** Called when the editor gains focus. */\n\tonFocus?: () => void;\n\t/** Called when the editor loses focus. */\n\tonBlur?: () => void;\n\t/**\n\t * Called on every paste event. Return `true` to fully suppress BikEditor's\n\t * own paste handling (useful when you want to handle images or HTML yourself).\n\t *\n\t * @example\n\t * onPaste={({ images }) => {\n\t * if (images.length) {\n\t * uploadImages(images).then(urls => {\n\t * urls.forEach(url => ref.current?.actions.insertHtml(`<img src=\"${url}\" />`));\n\t * });\n\t * return true; // suppress default — don't embed the raw image data\n\t * }\n\t * }}\n\t */\n\tonPaste?: (data: PasteData) => boolean | void;\n\t/**\n\t * Called on every cursor move or selection change with a snapshot of all\n\t * active marks. Keep in state and pass to your toolbar to sync button states.\n\t */\n\tonSelectionChange?: (activeFormats: FormatState) => void;\n\n\t// ── Styling ───────────────────────────────────────────────────────────────\n\t// Outer wrapper — use these to control the shell (border, border-radius,\n\t// background, shadow, etc.).\n\t/** Extra class name applied to the outer wrapper div. */\n\tclassName?: string;\n\t/** Inline styles applied to the outer wrapper div. */\n\tstyle?: React.CSSProperties;\n\n\t// Inner editable area — use these to control the content div itself\n\t// (padding, font, line-height, etc.).\n\t/** Extra class name applied to the content-editable area (`.ProseMirror` in TipTap). */\n\teditorClassName?: string;\n\t/** Inline styles applied to the content-editable area. */\n\teditorStyle?: React.CSSProperties;\n\n\t// Sizing — applied to the content-editable area.\n\t/** Minimum height of the editable area. CSS value, e.g. `'80px'`. */\n\tminHeight?: string;\n\t/** Maximum height. The editor scrolls internally when exceeded. CSS value, e.g. `'400px'`. */\n\tmaxHeight?: string;\n}\n"],"names":["DEFAULT_FORMAT_STATE"],"mappings":"gFAgZO,MAAMA,EAAoC,CAChD,KAAM,GACN,OAAQ,GACR,UAAW,GACX,OAAQ,GACR,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,UAAW,GACX,KAAM,KACN,UAAW,KACX,WAAY,KACZ,SAAU,KACV,MAAO,KACP,UAAW,KACX,YAAa,GACb,UAAW,EACZ"}
1
+ {"version":3,"file":"BikEditor.types.js","sources":["../../../src/editor/BikEditor.types.ts"],"sourcesContent":["/**\n * ┌─────────────────────────────────────────────────────────────────────────┐\n * │ PUBLIC API LAYER — zero editor-framework imports │\n * │ │\n * │ This file is the consumer contract for BikEditor. It has NO dependency │\n * │ on TipTap, Lexical, Slate, or any other rich-text library. │\n * │ │\n * │ If the underlying editor is ever swapped, ONLY the implementation files │\n * │ change — this file, src/editor/index.ts, and all consumer code stay as- │\n * │ is. The files that would change are: │\n * │ • BikEditor.tsx — wires props into the editor instance │\n * │ • BikEditor.utils.ts — HTML / document-state adapters │\n * │ • extensions/ — extension / plugin layer │\n * └─────────────────────────────────────────────────────────────────────────┘\n */\nimport React from 'react';\n\n/**\n * Opt in to specific editor capabilities. Both default to `false`.\n *\n * @example\n * // Email editor with full rich text support\n * <BikEditor features={{ richPaste: true, richTypography: true }} />\n */\nexport interface EditorFeatures {\n\t/** Preserve HTML formatting on paste. Default: `false`. */\n\trichPaste?: boolean;\n\t/** Enable font family, font size, text alignment, highlight, subscript, superscript, and image. Default: `false`. */\n\trichTypography?: boolean;\n\t/**\n\t * Restrict which inline marks are active in the editor.\n\t * When set, only the listed marks are registered — all others are disabled\n\t * (no rendering, no keyboard shortcuts, no paste preservation).\n\t * Omit to allow all marks (default).\n\t *\n\t * @example\n\t * // LiveChat: bold only, no italic / underline / strike\n\t * features={{ allowedMarks: ['bold'] }}\n\t */\n\tallowedMarks?: Array<'bold' | 'italic' | 'strike' | 'underline' | 'code'>;\n\t/**\n\t * Turn the editor into a Postman-style JSON body editor: the whole document\n\t * becomes one syntax-highlighted JSON code block. Disables the rich-text stack\n\t * (mentions, typography, rich paste, sections). Drive it via `ref.json.*`.\n\t * Default: `false`.\n\t *\n\t * @example\n\t * <BikEditor features={{ jsonMode: true }} initialContent='{ \"id\": 1 }' />\n\t */\n\tjsonMode?: boolean;\n}\n\n/**\n * A named content section placed below the main body, separated by an invisible divider.\n *\n * Sections let you split a single editor instance into independently readable\n * and writable zones — for example: body / signature / forwarded mail.\n *\n * @example\n * sections={[\n * { id: 'signature', content: '<p>Best regards,<br/>Alice</p>' },\n * { id: 'forwarded', content: '<p>--- Forwarded message ---</p>' },\n * ]}\n */\nexport interface EditorSection {\n\t/**\n\t * Unique identifier. Used in ref methods: `getSectionContent(id)`,\n\t * `setSectionContent(id, html)`, `focusSection(id)`, `clearSection(id)`.\n\t * The string `'body'` is reserved for the main content above all dividers.\n\t */\n\tid: string;\n\t/** Initial HTML content of this section. */\n\tcontent: string;\n}\n\n/**\n * Data passed to the `onPaste` callback.\n * Return `true` from your handler to suppress BikEditor's default paste handling\n * (rich-paste and plain-text stripping won't run for that event).\n */\nexport interface PasteData {\n\t/** All files in the clipboard (images, PDFs, etc.). */\n\tfiles: File[];\n\t/** Image files only — a filtered subset of `files`. */\n\timages: File[];\n\t/** Plain text from the clipboard. */\n\ttext: string;\n\t/** HTML from the clipboard (empty string if the source doesn't provide HTML). */\n\thtml: string;\n\t/** The raw browser ClipboardEvent — for advanced use. */\n\tevent: ClipboardEvent;\n}\n\n/**\n * A custom keyboard shortcut registered with the editor.\n *\n * @example\n * shortcuts={[\n * // Mod = Cmd on Mac, Ctrl on Windows/Linux\n * { key: 'Enter', modifiers: ['mod'], handler: handleSend },\n * { key: 's', modifiers: ['mod'], handler: handleSave },\n * { key: 'k', modifiers: ['mod', 'shift'], handler: openLinkModal },\n * ]}\n */\nexport interface KeyboardShortcut {\n\t/** Key name. Use the same strings as KeyboardEvent.key, e.g. `'Enter'`, `'s'`, `'k'`. */\n\tkey: string;\n\t/**\n\t * Modifier keys.\n\t * `'mod'` maps to Cmd on macOS and Ctrl on Windows/Linux — prefer it over\n\t * `'ctrl'` for cross-platform shortcuts.\n\t */\n\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t/** Called when the shortcut fires. Returning nothing is fine. */\n\thandler: () => void;\n}\n\n/** Content object returned by onChange, onSend, getContent(), and getSectionContent(). */\nexport interface EditorSnapshot {\n\t/** Serialised HTML. Safe to pass back to setContent() or setSectionContent(). */\n\thtml: string;\n\t/** Plain text, stripped of all marks and block nodes. */\n\ttext: string;\n\t/** True when the document contains no user-visible content. */\n\tisEmpty: boolean;\n\t/** Character count at this point in time. */\n\tcharacterCount: number;\n}\n\n/**\n * Result of parsing the JSON body (features.jsonMode). Returned by `ref.json.parse()`.\n * Empty / whitespace-only content is treated as valid with a `null` value.\n */\nexport interface JsonParseResult {\n\t/** True when the current text is valid JSON. */\n\tvalid: boolean;\n\t/** The parsed value (`null` when empty or invalid). */\n\tvalue: unknown;\n\t/**\n\t * Human-readable error message, cleaned of the raw parser noise\n\t * (e.g. `\"Bad control character in string literal\"` instead of\n\t * `\"… in JSON at position 94 (line 7 column 9)\"`). `null` when valid.\n\t */\n\terror: string | null;\n\t/** 1-based line of the error, or `null` when valid / not locatable. */\n\tline: number | null;\n\t/** 1-based column of the error, or `null` when valid / not locatable. */\n\tcolumn: number | null;\n}\n\n/**\n * JSON body controls, available on the ref when `features.jsonMode` is on.\n * Access via `editorRef.current.json`.\n *\n * @example\n * editorRef.current?.json?.format(); // pretty-print (2-space indent)\n * const { valid, value } = editorRef.current!.json!.parse();\n */\nexport interface JsonBodyApi {\n\t/** Current raw text of the JSON body. */\n\tgetText: () => string;\n\t/** Replace the whole JSON body with `raw` and fire onChange. */\n\tsetText: (raw: string) => void;\n\t/** Parse the current text without throwing — see JsonParseResult. */\n\tparse: () => JsonParseResult;\n\t/** True when the current text is valid JSON. */\n\tisValid: () => boolean;\n\t/**\n\t * Pretty-print the current text in place. No-op when the text is invalid.\n\t * @param indent Number of spaces per level. Default `2`.\n\t */\n\tformat: (indent?: number) => void;\n\t/** Collapse the current text to a single line. No-op when invalid. */\n\tminify: () => void;\n}\n\n/** One item shown in the @agent or #team mention dropdown. */\nexport interface MentionItem {\n\t/** Unique identifier stored as a node attribute. Used to look up the item later. */\n\tid: string | number;\n\t/** Display name shown in the dropdown and inserted into the document. */\n\tlabel: string;\n\t/** Avatar image URL. Shown in the built-in row when renderMentionItem is not provided. */\n\tavatarUrl?: string;\n\t/** When true, a green presence dot appears in the built-in row. */\n\tisOnline?: boolean;\n\t/** Any extra data your app needs. Passed back as-is in onMentionSelected. */\n\tmeta?: Record<string, unknown>;\n}\n\n/** One item shown in the / slash-command dropdown. */\nexport interface SlashCommandItem {\n\t/** Unique identifier. */\n\tid: string;\n\t/** Short command name shown as the primary label in the menu. */\n\tlabel: string;\n\t/** Optional one-line description shown below the label in the built-in row. */\n\tdescription?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Feature config objects — pass one object per feature instead of N flat props\n// ---------------------------------------------------------------------------\n\n/**\n * Props passed to the `renderDropdown` function in `MentionConfig`.\n * `activeIndex` is the keyboard-navigated row — highlight it in your UI.\n * Call `onSelect(item)` when the user picks one.\n */\nexport interface MentionDropdownRenderProps {\n\titems: MentionItem[];\n\t/** The text the user typed after the `@` or `#` trigger. */\n\tquery: string;\n\t/**\n\t * Index of the currently highlighted row (arrow-key navigation).\n\t * The editor manages this automatically — just use it for visual highlighting.\n\t */\n\tactiveIndex: number;\n\t/** Call this when the user selects an item (click, touch, etc.). */\n\tonSelect: (item: MentionItem) => void;\n\t/**\n\t * Register a keyboard handler so a CUSTOM dropdown can own arrow-key / Enter\n\t * navigation (e.g. a multi-level picker whose visible rows differ from the\n\t * flat `items` list). Return `true` from the handler to consume the key.\n\t * Pass `null` to unregister. When not registered, the editor falls back to\n\t * navigating the flat `items` list.\n\t */\n\tregisterKeyHandler?: (\n\t\thandler: ((event: KeyboardEvent) => boolean) | null,\n\t) => void;\n\t/**\n\t * Dismiss the dropdown WITHOUT selecting an item: closes the menu and strips\n\t * the typed `@`/`#` trigger + query. Use for custom actions in a multi-level\n\t * picker (e.g. a \"Create new\" row that opens a drawer instead of inserting a\n\t * mention).\n\t */\n\tonClose?: () => void;\n}\n\n/**\n * Everything related to @ and # mention dropdowns, in one place.\n *\n * @example\n * mentions={{\n * agents: [{ id: 1, label: 'Alice', avatarUrl: '...' }],\n * teams: [{ id: 't1', label: 'Support' }],\n * onSelect: (item, char) => console.log(char, item),\n * }}\n */\nexport interface MentionConfig {\n\t/** Items shown when the user types `@`. */\n\tagents?: MentionItem[];\n\t/** Items shown when the user types `#`. */\n\tteams?: MentionItem[];\n\t/** Called when the user picks an item. `char` is `'@'` or `'#'`. */\n\tonSelect?: (item: MentionItem, char: '@' | '#') => void;\n\t/**\n\t * Custom renderer for each row in the dropdown.\n\t * `isActive` is `true` when that row is currently highlighted by keyboard\n\t * navigation (arrows move it, Enter selects it). Use it to apply a highlight\n\t * style so the user can see which item they're about to select.\n\t * Omit to use the built-in avatar + name row.\n\t *\n\t * Use `renderDropdown` instead when you need a completely different structure.\n\t *\n\t * @example\n\t * renderItem={(item, isActive) => (\n\t * <div style={{ background: isActive ? '#f0f0f0' : undefined }}>\n\t * {item.label}\n\t * </div>\n\t * )}\n\t */\n\trenderItem?: (item: MentionItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Render the entire dropdown yourself instead of individual rows.\n\t * The editor still manages keyboard navigation — `activeIndex` tells you\n\t * which row is highlighted, and `onSelect(item)` confirms the selection.\n\t * Takes priority over `renderItem` when both are provided.\n\t *\n\t * @example\n\t * renderDropdown={({ items, query, activeIndex, onSelect }) => (\n\t * <MyDropdown\n\t * items={items}\n\t * highlightedIndex={activeIndex}\n\t * onPick={onSelect}\n\t * />\n\t * )}\n\t */\n\trenderDropdown?: (props: MentionDropdownRenderProps) => React.ReactNode;\n\t/**\n\t * When true, a typed trigger char (`@` / `#`) and its query are removed if the\n\t * suggestion menu closes without a selection (click-outside / no match). Default\n\t * false — the typed text is kept.\n\t */\n\tremoveTriggerOnDismiss?: boolean;\n}\n\n/**\n * Props passed to the `renderDropdown` function in `SlashCommandConfig`.\n */\nexport interface SlashCommandDropdownRenderProps {\n\titems: SlashCommandItem[];\n\t/** The text the user typed after `/`. */\n\tquery: string;\n\t/** Index of the currently highlighted row. Use for visual highlighting. */\n\tactiveIndex: number;\n\t/** Call this when the user selects an item. */\n\tonSelect: (item: SlashCommandItem) => void;\n}\n\n/**\n * Everything related to the `/` slash-command menu, in one place.\n *\n * @example\n * slashCommands={{\n * items: [{ id: 'ai-reply', label: 'AI Reply', description: 'Generate a reply' }],\n * onSelect: (cmd) => triggerAI(cmd.id),\n * }}\n */\nexport interface SlashCommandConfig {\n\t/** The list of commands. Filtered client-side as the user types after `/`. */\n\titems: SlashCommandItem[];\n\t/** Called when the user selects a command. The `/` trigger is removed from the doc. */\n\tonSelect?: (command: SlashCommandItem) => void;\n\t/**\n\t * Custom renderer for each row.\n\t * `isActive` is `true` when that row is highlighted by keyboard navigation.\n\t * Omit to use the built-in label + description row.\n\t *\n\t * Use `renderDropdown` instead when you need a completely different structure.\n\t */\n\trenderItem?: (item: SlashCommandItem, isActive: boolean) => React.ReactNode;\n\t/**\n\t * Render the entire slash-command dropdown yourself.\n\t * The editor manages keyboard navigation — use `activeIndex` to highlight\n\t * the active row and call `onSelect(item)` to confirm selection.\n\t * Takes priority over `renderItem` when both are provided.\n\t *\n\t * @example\n\t * renderDropdown={({ items, activeIndex, onSelect }) => (\n\t * <MyCmdPalette commands={items} active={activeIndex} onPick={onSelect} />\n\t * )}\n\t */\n\trenderDropdown?: (props: SlashCommandDropdownRenderProps) => React.ReactNode;\n}\n\n/**\n * Configuration for how hyperlinks behave in the editor.\n *\n * @example\n * link={{ renderTooltip: ({ href, text, onOpen, onRemove }) => (\n * <MyLinkPopover href={href} onOpen={onOpen} onRemove={onRemove} />\n * )}}\n */\nexport interface LinkConfig {\n\t/**\n\t * Custom tooltip rendered when the user clicks a link.\n\t * Receives the href, display text, bounding rect (for positioning),\n\t * and ready-to-call action handlers.\n\t * Omit to use the minimal built-in tooltip.\n\t */\n\trenderTooltip?: (props: LinkTooltipProps) => React.ReactNode;\n}\n\n/**\n * Snapshot of all active marks and block types at the current cursor or selection.\n * Returned by onSelectionChange and ref.getActiveFormats().\n *\n * Keep this in component state and pass it to BikEditorToolbar (or your own toolbar)\n * to keep button active-states in sync.\n *\n * @example\n * const [formats, setFormats] = useState(DEFAULT_ACTIVE_FORMATS);\n * <BikEditor onSelectionChange={setFormats} ... />\n * <BikEditorToolbar activeFormats={formats} ... />\n */\nexport interface FormatState {\n\tbold: boolean;\n\titalic: boolean;\n\tunderline: boolean;\n\tstrike: boolean;\n\tbulletList: boolean;\n\torderedList: boolean;\n\tblockquote: boolean;\n\tcodeBlock: boolean;\n\t/** Non-null when the cursor is inside (or selection spans) a hyperlink. */\n\tlink: { href: string } | null;\n\ttextAlign: 'left' | 'center' | 'right' | 'justify' | null;\n\tfontFamily: string | null;\n\tfontSize: string | null;\n\t/** Active text colour as a CSS colour string, or null if none. */\n\tcolor: string | null;\n\t/** Active highlight (background) colour, or null if none. */\n\thighlight: string | null;\n\t/** True when the cursor/selection is in a superscript. */\n\tsuperscript: boolean;\n\t/** True when the cursor/selection is in a subscript. */\n\tsubscript: boolean;\n}\n\nexport const DEFAULT_FORMAT_STATE: FormatState = {\n\tbold: false,\n\titalic: false,\n\tunderline: false,\n\tstrike: false,\n\tbulletList: false,\n\torderedList: false,\n\tblockquote: false,\n\tcodeBlock: false,\n\tlink: null,\n\ttextAlign: null,\n\tfontFamily: null,\n\tfontSize: null,\n\tcolor: null,\n\thighlight: null,\n\tsuperscript: false,\n\tsubscript: false,\n};\n\n/**\n * All formatting and insertion commands. Access via `editorRef.current.actions`.\n *\n * Every method focuses the editor internally — no need to call `.focus()` first.\n *\n * @example\n * editorRef.current?.actions.toggleBold();\n * editorRef.current?.actions.setLink('https://example.com', 'Visit example');\n */\nexport interface EditorActions {\n\t// ── Basic marks ───────────────────────────────────────────────────────────\n\ttoggleBold: () => void;\n\ttoggleItalic: () => void;\n\ttoggleUnderline: () => void;\n\ttoggleStrike: () => void;\n\n\t// ── Blocks ────────────────────────────────────────────────────────────────\n\ttoggleBulletList: () => void;\n\ttoggleOrderedList: () => void;\n\ttoggleBlockquote: () => void;\n\ttoggleCodeBlock: () => void;\n\n\t// ── Alignment & typography ────────────────────────────────────────────────\n\tsetTextAlign: (align: 'left' | 'center' | 'right' | 'justify') => void;\n\t/** Pass a CSS font-family value, e.g. `'Inter, sans-serif'`. Only works when richTypography is on. */\n\tsetFontFamily: (font: string) => void;\n\t/** Pass a CSS size value, e.g. `'16px'` or `'1.25rem'`. Only works when richTypography is on. */\n\tsetFontSize: (size: string) => void;\n\n\t// ── Colour ────────────────────────────────────────────────────────────────\n\t/** Sets the text colour. Pass any CSS colour value, e.g. `'#e53e3e'`. */\n\tsetColor: (color: string) => void;\n\t/** Sets the highlight (background) colour. */\n\tsetHighlight: (color: string) => void;\n\t/** Removes the text colour mark from the current selection. */\n\tunsetColor: () => void;\n\t/** Removes the highlight mark from the current selection. */\n\tunsetHighlight: () => void;\n\n\t// ── Links ─────────────────────────────────────────────────────────────────\n\t/**\n\t * Applies a hyperlink to the current selection, or updates the link the\n\t * cursor is already inside.\n\t *\n\t * @param href The URL.\n\t * @param text Optional display text. When provided, the visible text of the\n\t * linked range is replaced atomically in the same undo step.\n\t *\n\t * @example\n\t * actions.setLink('https://example.com');\n\t * actions.setLink('https://example.com', 'Visit example');\n\t */\n\tsetLink: (href: string, text?: string) => void;\n\t/** Updates only the href of the link at the current cursor. */\n\tupdateLink: (href: string) => void;\n\t/** Removes the link mark but keeps the visible text. */\n\tremoveLink: () => void;\n\n\t// ── Insertions ────────────────────────────────────────────────────────────\n\t/** Inserts an emoji character at the cursor. */\n\tinsertEmoji: (emoji: string) => void;\n\t/**\n\t * Inserts a `{{variableName}}` token at the cursor.\n\t * The token renders with a distinct highlight inside the editor.\n\t */\n\tinsertVariable: (variableName: string) => void;\n\t/** Inserts arbitrary HTML at the current cursor position. */\n\tinsertHtml: (html: string) => void;\n\n\t// ── History ───────────────────────────────────────────────────────────────\n\tundo: () => void;\n\tredo: () => void;\n\tcanUndo: () => boolean;\n\tcanRedo: () => boolean;\n\n\t// ── Rich typography (richTypography feature required) ─────────────────────\n\t/** Toggles superscript on the selection. Only works when richTypography is on. */\n\ttoggleSuperscript: () => void;\n\t/** Toggles subscript on the selection. Only works when richTypography is on. */\n\ttoggleSubscript: () => void;\n\t/** Inserts an inline image at the cursor. Only works when richTypography is on. */\n\tinsertImage: (src: string) => void;\n}\n\n/** Props passed to your renderLinkTooltip render prop. */\nexport interface LinkTooltipProps {\n\t/** The href of the active link. */\n\thref: string;\n\t/** The display text of the link. */\n\ttext: string;\n\t/** Bounding rect of the link element — use this to position your popover. */\n\trect: DOMRect;\n\t/** Opens the link in a new tab. */\n\tonOpen: () => void;\n\t/** Removes the link mark but keeps the visible text. */\n\tonRemove: () => void;\n\t/** Hides the bubble menu. Call this before opening an edit modal so the tooltip doesn't linger. */\n\tonHide: () => void;\n}\n\n/**\n * Imperative handle exposed by BikEditor.\n *\n * Obtain via `useRef<BikEditorRef>()` and pass to `<BikEditor ref={...} />`.\n * All methods are safe to call after the first render.\n *\n * @example\n * const ref = useRef<BikEditorRef>(null);\n * <BikEditor ref={ref} ... />\n * ref.current?.clearContent();\n * ref.current?.actions.toggleBold();\n */\nexport interface BikEditorRef {\n\t// ── Focus ─────────────────────────────────────────────────────────────────\n\t/** Moves focus into the editor. Optionally pass a position: 'start', 'end', 'all', or a numeric offset. */\n\tfocus: (position?: 'start' | 'end' | 'all' | number | boolean | null) => void;\n\t/** Removes focus from the editor. */\n\tblur: () => void;\n\n\t// ── Content ───────────────────────────────────────────────────────────────\n\t/** Clears the entire document and fires onChange. */\n\tclearContent: () => void;\n\t/**\n\t * Replaces the full document with the given HTML and fires onChange.\n\t * Overwrites all sections. Use setSectionContent() / setBodyContent() to\n\t * update a single section without touching the others.\n\t */\n\tsetContent: (html: string) => void;\n\t/** Inserts HTML at the current cursor position without replacing anything. */\n\tinsertContent: (html: string) => void;\n\t/**\n\t * Inserts HTML inline at the current cursor position, unwrapping block\n\t * wrappers (e.g. `<p>`) so the content merges into the surrounding paragraph\n\t * instead of creating new blocks. Use for macros, quick replies, etc.\n\t */\n\tinsertInlineContent: (html: string) => void;\n\t/** Inserts HTML at the very start of the document. */\n\tinsertAtStart: (html: string) => void;\n\t/** Inserts HTML as a new block at the end of the document. */\n\tinsertBlock: (html: string) => void;\n\t/**\n\t * Appends HTML inline inside the last paragraph of the document.\n\t * Ideal for streaming — call repeatedly with each text chunk.\n\t * Use `appendBodyContent` instead if the editor has named sections.\n\t */\n\tappendInline: (html: string) => void;\n\t/** @deprecated Use `insertBlock` */\n\tinsertAtEnd: (html: string) => void;\n\t/** @deprecated Use `appendInline` */\n\tappendContent: (html: string) => void;\n\t/** Returns the full document as `{ html, text, isEmpty, characterCount }`. */\n\tgetContent: () => EditorSnapshot;\n\t/**\n\t * Returns the raw TipTap document as a plain JSON object.\n\t * Returns `null` when the editor is not yet mounted.\n\t */\n\tgetJSON: () => Record<string, unknown> | null;\n\t/**\n\t * Walks the document and returns all mention IDs currently in the editor,\n\t * split by type. IDs are deduplicated and returned as arrays.\n\t *\n\t * @example\n\t * const { agentIds, teamIds } = ref.current?.getMentions() ?? { agentIds: [], teamIds: [] };\n\t */\n\tgetMentions: () => { agentIds: string[]; teamIds: string[] };\n\n\t// ── Selection ─────────────────────────────────────────────────────────────\n\t/**\n\t * Returns the current cursor / selection position as a `{ from, to }` pair.\n\t * When nothing is selected, `from === to` (a collapsed cursor).\n\t * Pass the returned value to `insertAtPosition()` to insert at an exact spot.\n\t *\n\t * @example\n\t * const { from } = ref.current?.getCursorPosition() ?? { from: 0, to: 0 };\n\t * ref.current?.insertAtPosition(from, '<strong>inserted</strong>');\n\t */\n\tgetCursorPosition: () => { from: number; to: number };\n\t/**\n\t * Inserts HTML at an explicit document position rather than at the current cursor.\n\t * Use `getCursorPosition()` to get the position, or any value from\n\t * `findSectionStartPos` / `findSectionEndPos` if you need section-relative insertion.\n\t *\n\t * @example\n\t * const { from } = ref.current!.getCursorPosition();\n\t * ref.current?.insertAtPosition(from, '<em>hello</em>');\n\t */\n\tinsertAtPosition: (pos: number, html: string) => void;\n\t/**\n\t * Returns the currently selected plain text.\n\t * When the cursor is inside a link with nothing selected, returns the full\n\t * link text — useful for pre-filling a link modal's text field.\n\t */\n\tgetSelectedText: () => string;\n\n\t// ── Character count ───────────────────────────────────────────────────────\n\t/**\n\t * Returns the current character count and the configured limit (or null).\n\t * Use this to render your own character counter anywhere you like.\n\t *\n\t * @example\n\t * const { count, limit } = ref.current?.getCharacterCount() ?? { count: 0, limit: null };\n\t * <span style={{ color: count >= (limit ?? Infinity) ? 'red' : 'inherit' }}>\n\t * {count}{limit != null ? ` / ${limit}` : ''}\n\t * </span>\n\t */\n\tgetCharacterCount: () => { count: number; limit: number | null };\n\n\t// ── Sections ─────────────────────────────────────────────────────────────\n\t/**\n\t * Returns content for a named section.\n\t * Use `'body'` to get the main content above all section dividers.\n\t *\n\t * @example\n\t * const sig = ref.current?.getSectionContent('signature');\n\t */\n\tgetSectionContent: (sectionId: string) => EditorSnapshot;\n\t/**\n\t * Replaces the content of a named section without touching other sections.\n\t * If the section doesn't exist yet it is appended at the end.\n\t *\n\t * @example\n\t * ref.current?.setSectionContent('signature', '<p>New signature</p>');\n\t * ref.current?.setSectionContent('body', rephrased); // same as setBodyContent\n\t */\n\tsetSectionContent: (sectionId: string, html: string) => void;\n\t/**\n\t * Moves the cursor to the start of a named section.\n\t * Use `'body'` to focus the main content area.\n\t */\n\tfocusSection: (sectionId: string) => void;\n\t/** Clears all content in a named section (replaces with an empty paragraph). */\n\tclearSection: (sectionId: string) => void;\n\n\t// ── Convenience body shorthands ───────────────────────────────────────────\n\t/** Shorthand for `getSectionContent('body')`. */\n\tgetBodyContent: () => EditorSnapshot;\n\t/** Shorthand for `setSectionContent('body', html)`. */\n\tsetBodyContent: (html: string) => void;\n\t/**\n\t * Atomically sets the body AND all sections in a single editor update.\n\t * Sections are laid out in the exact order supplied — use this instead of\n\t * multiple `setSectionContent()` calls whenever order matters (e.g. forward\n\t * mail where signature must appear before the forwarded thread).\n\t *\n\t * @example\n\t * ref.current?.setBodyAndSections('<p></p>', [\n\t * { id: 'signature', content: '<p>Alice</p>' },\n\t * { id: 'forwarded', content: '<p>--- Forwarded ---</p>' },\n\t * ]);\n\t */\n\tsetBodyAndSections: (\n\t\tbody: string,\n\t\tsections: Array<{ id: string; content: string }>,\n\t) => void;\n\t/**\n\t * Appends HTML to the end of the body section without moving the cursor.\n\t * Ideal for streaming AI-generated content — call repeatedly with each chunk.\n\t * Does NOT clear existing content; call `setBodyContent('')` first if needed.\n\t *\n\t * @example\n\t * // Stream AI response chunk-by-chunk\n\t * ref.current?.setBodyContent('');\n\t * for await (const chunk of aiStream) {\n\t * ref.current?.appendBodyContent(chunk);\n\t * }\n\t */\n\tappendBodyContent: (html: string) => void;\n\n\t/**\n\t * Inserts HTML at the start of a named section (or `'body'`).\n\t * Inserts at the very start of the document when `sectionId` is `'body'`.\n\t */\n\tinsertAtSectionStart: (sectionId: string, html: string) => void;\n\t/**\n\t * Inserts HTML at the end of a named section (or `'body'`).\n\t * For `'body'`, inserts just before the first section divider (or at end of doc).\n\t */\n\tinsertAtSectionEnd: (sectionId: string, html: string) => void;\n\n\t// ── Formats & actions ─────────────────────────────────────────────────────\n\t/** Returns a snapshot of all active marks at the current cursor or selection. */\n\tgetActiveFormats: () => FormatState;\n\t/** All formatting and insertion commands. See EditorActions. */\n\tactions: EditorActions;\n\n\t// ── JSON body (features.jsonMode required) ─────────────────────────────────\n\t/**\n\t * JSON body controls. Present only when `features.jsonMode` is on\n\t * (`undefined` otherwise). See JsonBodyApi.\n\t *\n\t * @example\n\t * editorRef.current?.json?.format();\n\t */\n\tjson?: JsonBodyApi;\n}\n\n/**\n * Props for `<BikEditor />`. All props are optional.\n */\nexport interface BikEditorProps {\n\t// ── Features ──────────────────────────────────────────────────────────────\n\t/**\n\t * Opt in to specific editor capabilities. Both default to `false`.\n\t *\n\t * @example\n\t * <BikEditor features={{ richPaste: true, richTypography: true }} />\n\t */\n\tfeatures?: EditorFeatures;\n\n\t// ── Content ───────────────────────────────────────────────────────────────\n\t/**\n\t * HTML loaded on mount. Ignored after first render.\n\t * Use `ref.setContent()` to change content imperatively later.\n\t */\n\tinitialContent?: string;\n\t/**\n\t * Named sections placed below the main body.\n\t * Each section is separated from the previous one by an invisible divider node.\n\t * The array order determines the visual order in the document.\n\t *\n\t * These are only the INITIAL values — use `ref.setSectionContent()` to update\n\t * a section after mount without re-mounting the editor.\n\t *\n\t * @example\n\t * sections={[\n\t * { id: 'signature', content: '<p>Best regards, Alice</p>' },\n\t * { id: 'forwarded', content: '<p>--- Forwarded message ---</p>' },\n\t * ]}\n\t */\n\tsections?: EditorSection[];\n\t/** Placeholder text shown when the editor is empty. */\n\tplaceholder?: string;\n\n\t// ── Behaviour ─────────────────────────────────────────────────────────────\n\t/** Makes the editor read-only. The toolbar still renders but actions are no-ops. */\n\tdisabled?: boolean;\n\t/**\n\t * Hard character limit. The editor refuses to accept input beyond this point.\n\t * The limit is enforced silently — no UI is rendered. Use\n\t * `ref.getCharacterCount()` or `onChange.characterCount` to display it yourself.\n\t */\n\tmaxCharacters?: number;\n\t/**\n\t * Soft character limit. Unlike `maxCharacters`, this does NOT hard-block\n\t * input: typing is prevented once at/over the limit, but paste is allowed to\n\t * overflow and the excess characters render greyed (`.bik-editor-overflow`).\n\t * The count/error UI and send-gating are the consumer's responsibility — use\n\t * `onChange.characterCount`.\n\t */\n\tcharacterLimit?: number;\n\n\t// ── Keyboard shortcuts ────────────────────────────────────────────────────\n\t/**\n\t * Custom keyboard shortcuts. BikEditor registers no shortcuts of its own —\n\t * every shortcut must be explicitly listed here.\n\t *\n\t * @example\n\t * shortcuts={[\n\t * { key: 'Enter', modifiers: ['mod'], handler: handleSend },\n\t * { key: 's', modifiers: ['mod', 'shift'], handler: handleDraft },\n\t * ]}\n\t */\n\tshortcuts?: KeyboardShortcut[];\n\t/**\n\t * Shortcut key that fires `onSend`. No key is bound to `onSend` unless you\n\t * set this explicitly. Requires `onSend` to also be provided.\n\t *\n\t * `'mod'` maps to Cmd on macOS and Ctrl on Windows/Linux.\n\t *\n\t * @example\n\t * // Single shortcut\n\t * sendShortcut={{ key: 'Enter', modifiers: ['mod'] }}\n\t * // Multiple shortcuts\n\t * sendShortcut={[\n\t * { key: 'Enter', modifiers: ['mod'] },\n\t * { key: 's', modifiers: ['mod'] },\n\t * ]}\n\t */\n\tsendShortcut?:\n\t\t| { key: string; modifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'> }\n\t\t| Array<{\n\t\t\t\tkey: string;\n\t\t\t\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t\t }>;\n\n\t// ── Mentions ─────────────────────────────────────────────────────────────\n\t/**\n\t * Enables `@` (agent) and `#` (team) mention dropdowns.\n\t * Bundle all mention-related config in one object so it's easy to find.\n\t *\n\t * @example\n\t * mentions={{\n\t * agents: myAgents,\n\t * teams: myTeams,\n\t * onSelect: (item, char) => track(char, item.id),\n\t * }}\n\t */\n\tmentions?: MentionConfig;\n\n\t// ── Slash commands ────────────────────────────────────────────────────────\n\t/**\n\t * Enables the `/` slash-command menu.\n\t * Bundle all slash-command config in one object.\n\t *\n\t * @example\n\t * slashCommands={{\n\t * items: MY_COMMANDS,\n\t * onSelect: (cmd) => handleCommand(cmd.id),\n\t * }}\n\t */\n\tslashCommands?: SlashCommandConfig;\n\n\t// ── Link ─────────────────────────────────────────────────────────────────\n\t/**\n\t * Link-related configuration — currently just the click tooltip.\n\t *\n\t * @example\n\t * link={{ renderTooltip: ({ href, onOpen, onRemove }) => (\n\t * <MyTooltip href={href} onOpen={onOpen} onRemove={onRemove} />\n\t * )}}\n\t */\n\tlink?: LinkConfig;\n\n\t// ── JSON body (features.jsonMode) ──────────────────────────────────────────\n\t/**\n\t * Custom renderer for the JSON parse error shown below the editor in\n\t * `features.jsonMode`. Receives the current {@link JsonParseResult} (always\n\t * an invalid one — it's only called when the JSON is broken). Omit to use the\n\t * built-in inline error banner; the error is never rendered when the JSON is\n\t * valid or when `jsonMode` is off.\n\t *\n\t * @example\n\t * renderJsonError={(err) => (\n\t * <MyBanner>Line {err.line}: {err.error}</MyBanner>\n\t * )}\n\t */\n\trenderJsonError?: (error: JsonParseResult) => React.ReactNode;\n\n\t// ── Callbacks ─────────────────────────────────────────────────────────────\n\t/**\n\t * Called once, immediately after the editor finishes initializing.\n\t * Any imperative ref methods called before this fires are queued internally\n\t * and executed automatically once the editor is ready — consumers do not\n\t * need timers or readiness guards.\n\t *\n\t * @example\n\t * <BikEditor\n\t * ref={editorRef}\n\t * onReady={() => editorRef.current?.setContent(savedDraft)}\n\t * />\n\t */\n\tonReady?: () => void;\n\t/** Called on every document change. */\n\tonChange?: (content: EditorSnapshot) => void;\n\t/**\n\t * Called when the user presses the key combo defined by `sendShortcut`.\n\t * Only fires when both `onSend` and `sendShortcut` are provided.\n\t */\n\tonSend?: (content: EditorSnapshot) => void;\n\t/** Called when the editor gains focus. */\n\tonFocus?: () => void;\n\t/** Called when the editor loses focus. */\n\tonBlur?: () => void;\n\t/**\n\t * Called on every paste event. Return `true` to fully suppress BikEditor's\n\t * own paste handling (useful when you want to handle images or HTML yourself).\n\t *\n\t * @example\n\t * onPaste={({ images }) => {\n\t * if (images.length) {\n\t * uploadImages(images).then(urls => {\n\t * urls.forEach(url => ref.current?.actions.insertHtml(`<img src=\"${url}\" />`));\n\t * });\n\t * return true; // suppress default — don't embed the raw image data\n\t * }\n\t * }}\n\t */\n\tonPaste?: (data: PasteData) => boolean | void;\n\t/**\n\t * Called on every cursor move or selection change with a snapshot of all\n\t * active marks. Keep in state and pass to your toolbar to sync button states.\n\t */\n\tonSelectionChange?: (activeFormats: FormatState) => void;\n\n\t// ── Styling ───────────────────────────────────────────────────────────────\n\t// Outer wrapper — use these to control the shell (border, border-radius,\n\t// background, shadow, etc.).\n\t/** Extra class name applied to the outer wrapper div. */\n\tclassName?: string;\n\t/** Inline styles applied to the outer wrapper div. */\n\tstyle?: React.CSSProperties;\n\n\t// Inner editable area — use these to control the content div itself\n\t// (padding, font, line-height, etc.).\n\t/** Extra class name applied to the content-editable area (`.ProseMirror` in TipTap). */\n\teditorClassName?: string;\n\t/** Inline styles applied to the content-editable area. */\n\teditorStyle?: React.CSSProperties;\n\n\t// Sizing — applied to the content-editable area.\n\t/** Minimum height of the editable area. CSS value, e.g. `'80px'`. */\n\tminHeight?: string;\n\t/** Maximum height. The editor scrolls internally when exceeded. CSS value, e.g. `'400px'`. */\n\tmaxHeight?: string;\n}\n"],"names":["DEFAULT_FORMAT_STATE"],"mappings":"gFAgZO,MAAMA,EAAoC,CAChD,KAAM,GACN,OAAQ,GACR,UAAW,GACX,OAAQ,GACR,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,UAAW,GACX,KAAM,KACN,UAAW,KACX,WAAY,KACZ,SAAU,KACV,MAAO,KACP,UAAW,KACX,YAAa,GACb,UAAW,EACZ"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("@tiptap/extension-character-count"),E=require("@tiptap/extension-color"),b=require("@tiptap/extension-font-family"),k=require("@tiptap/extension-hard-break"),M=require("@tiptap/extension-highlight"),C=require("@tiptap/extension-image"),y=require("@tiptap/extension-link"),P=require("../../node_modules/@tiptap/extension-paragraph/dist/index.js"),T=require("@tiptap/extension-placeholder"),g=require("@tiptap/extension-subscript"),D=require("@tiptap/extension-superscript"),H=require("@tiptap/extension-text-align"),L=require("@tiptap/extension-text-style"),B=require("@tiptap/extension-underline"),F=require("@tiptap/starter-kit"),I=require("./FontSizeExtension.js"),O=require("./jsonHighlight/JsonHighlightExtension.js"),i=require("./mention/MentionExtension.js"),w=require("./paste/PasteExtension.js"),z=require("./plainClipboard/PasteNormalizationExtension.js"),A=require("./sectionDivider/SectionDividerNode.js"),l=require("./sendShortcut/SendShortcutExtension.js"),R=require("./slashCommand/SlashCommandExtension.js"),N=require("./variable/VariableDecorationExtension.js"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},u=t(q),d=t(E),j=t(b),v=t(k),K=t(M),J=t(C),U=t(y),c=t(T),V=t(g),W=t(D),Z=t(H),G=t(B),h=t(F);function Q(e){if(e.features?.jsonMode)return[h.default.configure({link:!1,underline:!1,bold:!1,italic:!1,strike:!1,code:!1,heading:!1,bulletList:!1,orderedList:!1,blockquote:!1,horizontalRule:!1}),c.default.configure({placeholder:e.placeholder??`{
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("@tiptap/extension-character-count"),E=require("@tiptap/extension-color"),b=require("@tiptap/extension-font-family"),k=require("@tiptap/extension-hard-break"),C=require("@tiptap/extension-highlight"),M=require("@tiptap/extension-image"),y=require("@tiptap/extension-link"),P=require("../../node_modules/@tiptap/extension-paragraph/dist/index.js"),T=require("@tiptap/extension-placeholder"),g=require("@tiptap/extension-subscript"),L=require("@tiptap/extension-superscript"),D=require("@tiptap/extension-text-align"),H=require("@tiptap/extension-text-style"),B=require("@tiptap/extension-underline"),F=require("@tiptap/starter-kit"),I=require("./characterLimit/CharacterLimitExtension.js"),O=require("./FontSizeExtension.js"),w=require("./jsonHighlight/JsonHighlightExtension.js"),i=require("./mention/MentionExtension.js"),z=require("./paste/PasteExtension.js"),A=require("./plainClipboard/PasteNormalizationExtension.js"),R=require("./sectionDivider/SectionDividerNode.js"),l=require("./sendShortcut/SendShortcutExtension.js"),N=require("./slashCommand/SlashCommandExtension.js"),j=require("./variable/VariableDecorationExtension.js"),t=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},u=t(q),d=t(E),v=t(b),K=t(k),J=t(C),U=t(M),V=t(y),c=t(T),W=t(g),Z=t(L),G=t(D),Q=t(B),h=t(F);function X(e){if(e.features?.jsonMode)return[h.default.configure({link:!1,underline:!1,bold:!1,italic:!1,strike:!1,code:!1,heading:!1,bulletList:!1,orderedList:!1,blockquote:!1,horizontalRule:!1}),c.default.configure({placeholder:e.placeholder??`{
2
2
 
3
- }`}),O.JsonHighlightExtension,l.SendShortcutExtension.configure({onSend:e.onSend,sendShortcut:e.sendShortcut,extraShortcuts:e.shortcuts??[]}),...e.maxCharacters?[u.default.configure({limit:e.maxCharacters})]:[]];const s=e.features?.richPaste??!1,m=e.features?.richTypography??!1,a=e.features?.allowedMarks,r=n=>!a||a.includes(n),f=v.default.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),o=n=>n==="0"||n==="0px"||n==="0pt"||n==="0em",S=P.default.extend({addAttributes(){return{...this.parent?.()??{},margin:{default:null,parseHTML:n=>o(n.style.marginTop)&&o(n.style.marginBottom)?"0":null,renderHTML:n=>n.margin==="0"?{style:"margin: 0px"}:{}}}}}),p=[h.default.configure({link:!1,underline:!1,hardBreak:!1,paragraph:!1,bold:r("bold")?{}:!1,italic:r("italic")?{}:!1,strike:r("strike")?{}:!1,code:r("code")?{}:!1}),S,f,...r("underline")?[G.default]:[],U.default.extend({addPasteRules:()=>[],addInputRules:()=>[]}).configure({openOnClick:!1,autolink:!1,linkOnPaste:!1,HTMLAttributes:{rel:"noopener noreferrer",class:"bik-link"}}),L.TextStyle,c.default.configure({placeholder:e.placeholder??"Type a message..."}),...e.onPaste?[w.PasteExtension.configure({onPaste:e.onPaste})]:[],z.PasteNormalizationExtension.configure({preserveMarks:s,plainOnly:!s}),l.SendShortcutExtension.configure({onSend:e.onSend,sendShortcut:e.sendShortcut,extraShortcuts:e.shortcuts??[]}),N.VariableDecorationExtension,...e.maxCharacters?[u.default.configure({limit:e.maxCharacters})]:[],A.SectionDividerNode],x=[...e.mentions?.agents?[i.buildAgentMentionExtension(e.mentions.agents,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown,e.removeMentionTriggerOnDismiss)]:[],...e.mentions?.teams?[i.buildTeamMentionExtension(e.mentions.teams,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown,e.removeMentionTriggerOnDismiss)]:[],...e.slashCommands?[R.buildSlashCommandExtension(e.slashCommands,e.onSlashCommandSelected,e.renderSlashCommandItem,e.renderSlashCommandDropdown)]:[]],_=m?[d.default,K.default.configure({multicolor:!0}),j.default,I.FontSizeExtension,Z.default.configure({types:["heading","paragraph"]}),V.default,W.default,J.default]:[d.default];return[...p,...x,..._]}exports.buildExtensions=Q;
3
+ }`}),w.JsonHighlightExtension,l.SendShortcutExtension.configure({onSend:e.onSend,sendShortcut:e.sendShortcut,extraShortcuts:e.shortcuts??[]}),...e.maxCharacters?[u.default.configure({limit:e.maxCharacters})]:[]];const s=e.features?.richPaste??!1,m=e.features?.richTypography??!1,a=e.features?.allowedMarks,r=n=>!a||a.includes(n),f=K.default.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),o=n=>n==="0"||n==="0px"||n==="0pt"||n==="0em",x=P.default.extend({addAttributes(){return{...this.parent?.()??{},margin:{default:null,parseHTML:n=>o(n.style.marginTop)&&o(n.style.marginBottom)?"0":null,renderHTML:n=>n.margin==="0"?{style:"margin: 0px"}:{}}}}}),S=[h.default.configure({link:!1,underline:!1,hardBreak:!1,paragraph:!1,bold:r("bold")?{}:!1,italic:r("italic")?{}:!1,strike:r("strike")?{}:!1,code:r("code")?{}:!1}),x,f,...r("underline")?[Q.default]:[],V.default.extend({addPasteRules:()=>[],addInputRules:()=>[]}).configure({openOnClick:!1,autolink:!1,linkOnPaste:!1,HTMLAttributes:{rel:"noopener noreferrer",class:"bik-link"}}),H.TextStyle,c.default.configure({placeholder:e.placeholder??"Type a message..."}),...e.onPaste?[z.PasteExtension.configure({onPaste:e.onPaste})]:[],A.PasteNormalizationExtension.configure({preserveMarks:s,plainOnly:!s}),l.SendShortcutExtension.configure({onSend:e.onSend,sendShortcut:e.sendShortcut,extraShortcuts:e.shortcuts??[]}),j.VariableDecorationExtension,...e.maxCharacters?[u.default.configure({limit:e.maxCharacters})]:[],...e.characterLimit?[I.CharacterLimitExtension.configure({limit:e.characterLimit})]:[],R.SectionDividerNode],p=[...e.mentions?.agents?[i.buildAgentMentionExtension(e.mentions.agents,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown,e.removeMentionTriggerOnDismiss)]:[],...e.mentions?.teams?[i.buildTeamMentionExtension(e.mentions.teams,e.onMentionSelected,e.renderMentionItem,e.renderMentionDropdown,e.removeMentionTriggerOnDismiss)]:[],...e.slashCommands?[N.buildSlashCommandExtension(e.slashCommands,e.onSlashCommandSelected,e.renderSlashCommandItem,e.renderSlashCommandDropdown)]:[]],_=m?[d.default,J.default.configure({multicolor:!0}),v.default,O.FontSizeExtension,G.default.configure({types:["heading","paragraph"]}),W.default,Z.default,U.default]:[d.default];return[...S,...p,..._]}exports.buildExtensions=X;
4
4
  //# sourceMappingURL=buildExtensions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildExtensions.js","sources":["../../../../src/editor/extensions/buildExtensions.ts"],"sourcesContent":["import CharacterCount from '@tiptap/extension-character-count';\nimport Color from '@tiptap/extension-color';\nimport FontFamily from '@tiptap/extension-font-family';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Highlight from '@tiptap/extension-highlight';\nimport Image from '@tiptap/extension-image';\nimport Link from '@tiptap/extension-link';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Subscript from '@tiptap/extension-subscript';\nimport Superscript from '@tiptap/extension-superscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport { TextStyle } from '@tiptap/extension-text-style';\nimport Underline from '@tiptap/extension-underline';\nimport StarterKit from '@tiptap/starter-kit';\nimport type { ReactNode } from 'react';\nimport type {\n\tEditorFeatures,\n\tEditorSnapshot,\n\tKeyboardShortcut,\n\tMentionDropdownRenderProps,\n\tMentionItem,\n\tPasteData,\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../BikEditor.types';\nimport { FontSizeExtension } from './FontSizeExtension';\nimport { JsonHighlightExtension } from './jsonHighlight/JsonHighlightExtension';\nimport {\n\tbuildAgentMentionExtension,\n\tbuildTeamMentionExtension,\n} from './mention/MentionExtension';\nimport { PasteExtension } from './paste/PasteExtension';\nimport { PasteNormalizationExtension } from './plainClipboard/PasteNormalizationExtension';\nimport { SectionDividerNode } from './sectionDivider/SectionDividerNode';\nimport { SendShortcutExtension } from './sendShortcut/SendShortcutExtension';\nimport { buildSlashCommandExtension } from './slashCommand/SlashCommandExtension';\nimport { VariableDecorationExtension } from './variable/VariableDecorationExtension';\n\ninterface ExtensionConfig {\n\tfeatures?: EditorFeatures;\n\tplaceholder?: string;\n\tmaxCharacters?: number;\n\thasSections?: boolean;\n\tmentions?: {\n\t\tagents?: { current: MentionItem[] };\n\t\tteams?: { current: MentionItem[] };\n\t};\n\tslashCommands?: { current: SlashCommandItem[] };\n\tonPaste?: (data: PasteData) => boolean | void;\n\tonSend?: (content: EditorSnapshot) => void;\n\tsendShortcut?:\n\t\t| { key: string; modifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'> }\n\t\t| Array<{\n\t\t\t\tkey: string;\n\t\t\t\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t\t }>;\n\tshortcuts?: KeyboardShortcut[];\n\tonMentionSelected?: (item: MentionItem, char: '@' | '#') => void;\n\tonSlashCommandSelected?: (command: SlashCommandItem) => void;\n\trenderMentionItem?: (item: MentionItem, isActive: boolean) => ReactNode;\n\trenderMentionDropdown?: (props: MentionDropdownRenderProps) => ReactNode;\n\tremoveMentionTriggerOnDismiss?: boolean;\n\trenderSlashCommandItem?: (\n\t\titem: SlashCommandItem,\n\t\tisActive: boolean,\n\t) => ReactNode;\n\trenderSlashCommandDropdown?: (\n\t\tprops: SlashCommandDropdownRenderProps,\n\t) => ReactNode;\n}\n\nexport function buildExtensions(config: ExtensionConfig) {\n\t// JSON body mode is a dedicated code editor — it deliberately skips the rich\n\t// text stack (mentions, typography, rich paste, sections) and turns the whole\n\t// document into one syntax-highlighted JSON code block, Postman-style.\n\tif (config.features?.jsonMode) {\n\t\treturn [\n\t\t\tStarterKit.configure({\n\t\t\t\tlink: false,\n\t\t\t\tunderline: false,\n\t\t\t\t// Keep codeBlock (the JSON container) and history; drop everything\n\t\t\t\t// that has no meaning inside raw JSON.\n\t\t\t\tbold: false,\n\t\t\t\titalic: false,\n\t\t\t\tstrike: false,\n\t\t\t\tcode: false,\n\t\t\t\theading: false,\n\t\t\t\tbulletList: false,\n\t\t\t\torderedList: false,\n\t\t\t\tblockquote: false,\n\t\t\t\thorizontalRule: false,\n\t\t\t}),\n\t\t\tPlaceholder.configure({\n\t\t\t\tplaceholder: config.placeholder ?? '{\\n \\n}',\n\t\t\t}),\n\t\t\tJsonHighlightExtension,\n\t\t\tSendShortcutExtension.configure({\n\t\t\t\tonSend: config.onSend,\n\t\t\t\tsendShortcut: config.sendShortcut,\n\t\t\t\textraShortcuts: config.shortcuts ?? [],\n\t\t\t}),\n\t\t\t...(config.maxCharacters\n\t\t\t\t? [CharacterCount.configure({ limit: config.maxCharacters })]\n\t\t\t\t: []),\n\t\t];\n\t}\n\n\tconst hasRichPaste = config.features?.richPaste ?? false;\n\tconst hasRichTypography = config.features?.richTypography ?? false;\n\n\t// When allowedMarks is specified only those marks are registered in the schema.\n\t// This disables rendering, keyboard shortcuts AND paste-preservation for the\n\t// excluded marks — all three come for free when the extension is absent.\n\tconst allowedMarks = config.features?.allowedMarks;\n\tconst isMark = (m: 'bold' | 'italic' | 'strike' | 'underline' | 'code') =>\n\t\t!allowedMarks || allowedMarks.includes(m);\n\n\t// Soft line break. Shift-Enter inserts a <br> inside the current block\n\t// (matches Gmail); plain Enter still splits the block into a new paragraph\n\t// via StarterKit's default. HardBreak is registered standalone — like Link\n\t// and Underline above — instead of through StarterKit, so we can bind ONLY\n\t// Shift-Enter here and leave Mod-Enter free for the send shortcut.\n\tconst softBreak = HardBreak.extend({\n\t\taddKeyboardShortcuts() {\n\t\t\treturn {\n\t\t\t\t'Shift-Enter': () => this.editor.commands.setHardBreak(),\n\t\t\t};\n\t\t},\n\t});\n\n\t// Paragraph that preserves a zero block-margin from the source (Gmail-style).\n\t// Most sources (ChatGPT, typed text) use plain <p> → no margin attr → the\n\t// editor/viewer default 1em margin provides the gap. Google-Docs-style\n\t// content uses margin:0 paragraphs and a separate blank-line paragraph for\n\t// spacing; we keep that margin:0 so the blank line — not stacked margins —\n\t// provides a single-line gap, exactly like Gmail. The paste pipeline also\n\t// sets margin:'0' on every paragraph when a paste contains blank-line\n\t// paragraphs (see applyParagraphSpacing), so spacing comes from EITHER the\n\t// margin OR the blank line, never both (no double gap).\n\tconst isZeroLen = (v: string) =>\n\t\tv === '0' || v === '0px' || v === '0pt' || v === '0em';\n\tconst ParagraphWithMargin = Paragraph.extend({\n\t\taddAttributes() {\n\t\t\treturn {\n\t\t\t\t...(this.parent?.() ?? {}),\n\t\t\t\tmargin: {\n\t\t\t\t\tdefault: null,\n\t\t\t\t\tparseHTML: (el: HTMLElement) =>\n\t\t\t\t\t\tisZeroLen(el.style.marginTop) && isZeroLen(el.style.marginBottom)\n\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\trenderHTML: (attrs: { margin?: string | null }) =>\n\t\t\t\t\t\tattrs.margin === '0' ? { style: 'margin: 0px' } : {},\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t});\n\n\tconst base = [\n\t\t// Exclude Link and Underline from StarterKit — TipTap v3 bundles both.\n\t\t// Without this, two copies of each are registered and the StarterKit copy's\n\t\t// click handler calls window.open even when openOnClick: false is set.\n\t\tStarterKit.configure({\n\t\t\tlink: false,\n\t\t\tunderline: false,\n\t\t\thardBreak: false,\n\t\t\tparagraph: false,\n\t\t\tbold: isMark('bold') ? {} : false,\n\t\t\titalic: isMark('italic') ? {} : false,\n\t\t\tstrike: isMark('strike') ? {} : false,\n\t\t\tcode: isMark('code') ? {} : false,\n\t\t}),\n\t\tParagraphWithMargin,\n\t\tsoftBreak,\n\t\t...(isMark('underline') ? [Underline] : []),\n\t\t// Extend Link to strip addPasteRules() and addInputRules() so pasting a\n\t\t// URL never creates a hyperlink regardless of autolink/linkOnPaste values.\n\t\tLink.extend({\n\t\t\taddPasteRules: () => [],\n\t\t\taddInputRules: () => [],\n\t\t}).configure({\n\t\t\topenOnClick: false,\n\t\t\tautolink: false,\n\t\t\tlinkOnPaste: false,\n\t\t\tHTMLAttributes: {\n\t\t\t\trel: 'noopener noreferrer',\n\t\t\t\tclass: 'bik-link',\n\t\t\t},\n\t\t}),\n\t\tTextStyle,\n\t\tPlaceholder.configure({\n\t\t\tplaceholder: config.placeholder ?? 'Type a message...',\n\t\t}),\n\t\t// Consumer paste callback runs first. If it returns true the event is\n\t\t// consumed and neither PlainClipboardExtension nor the editor's default\n\t\t// paste handling will run for that event.\n\t\t...(config.onPaste\n\t\t\t? [PasteExtension.configure({ onPaste: config.onPaste })]\n\t\t\t: []),\n\t\tPasteNormalizationExtension.configure({\n\t\t\tpreserveMarks: hasRichPaste,\n\t\t\t// Only email + signature (richPaste) keep the rich HTML paste pipeline.\n\t\t\t// Every other channel (WhatsApp, IG, FB, comments) forces plain-text\n\t\t\t// paste for BOTH Cmd/Ctrl+V and Cmd/Ctrl+Shift+V — no formatting.\n\t\t\tplainOnly: !hasRichPaste,\n\t\t}),\n\t\tSendShortcutExtension.configure({\n\t\t\tonSend: config.onSend,\n\t\t\tsendShortcut: config.sendShortcut,\n\t\t\textraShortcuts: config.shortcuts ?? [],\n\t\t}),\n\t\tVariableDecorationExtension,\n\t\t...(config.maxCharacters\n\t\t\t? [CharacterCount.configure({ limit: config.maxCharacters })]\n\t\t\t: []),\n\t\t// Always register SectionDividerNode so the custom <div data-section-divider>\n\t\t// node is part of the schema in every editor instance. This means imperative\n\t\t// callers (setBodyAndSections / setSectionContent) work even when no\n\t\t// `sections` prop was provided at mount time.\n\t\tSectionDividerNode,\n\t];\n\n\tconst mentionExtensions = [\n\t\t...(config.mentions?.agents\n\t\t\t? [\n\t\t\t\t\tbuildAgentMentionExtension(\n\t\t\t\t\t\tconfig.mentions.agents,\n\t\t\t\t\t\tconfig.onMentionSelected,\n\t\t\t\t\t\tconfig.renderMentionItem,\n\t\t\t\t\t\tconfig.renderMentionDropdown,\n\t\t\t\t\t\tconfig.removeMentionTriggerOnDismiss,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t\t...(config.mentions?.teams\n\t\t\t? [\n\t\t\t\t\tbuildTeamMentionExtension(\n\t\t\t\t\t\tconfig.mentions.teams,\n\t\t\t\t\t\tconfig.onMentionSelected,\n\t\t\t\t\t\tconfig.renderMentionItem,\n\t\t\t\t\t\tconfig.renderMentionDropdown,\n\t\t\t\t\t\tconfig.removeMentionTriggerOnDismiss,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t\t...(config.slashCommands\n\t\t\t? [\n\t\t\t\t\tbuildSlashCommandExtension(\n\t\t\t\t\t\tconfig.slashCommands,\n\t\t\t\t\t\tconfig.onSlashCommandSelected,\n\t\t\t\t\t\tconfig.renderSlashCommandItem,\n\t\t\t\t\t\tconfig.renderSlashCommandDropdown,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t];\n\n\tconst richExtensions = hasRichTypography\n\t\t? [\n\t\t\t\tColor,\n\t\t\t\tHighlight.configure({ multicolor: true }),\n\t\t\t\tFontFamily,\n\t\t\t\tFontSizeExtension,\n\t\t\t\tTextAlign.configure({ types: ['heading', 'paragraph'] }),\n\t\t\t\tSubscript,\n\t\t\t\tSuperscript,\n\t\t\t\tImage,\n\t\t ]\n\t\t: [Color];\n\n\treturn [...base, ...mentionExtensions, ...richExtensions];\n}\n"],"names":["buildExtensions","config","StarterKit","Placeholder","JsonHighlightExtension","SendShortcutExtension","CharacterCount","hasRichPaste","hasRichTypography","allowedMarks","isMark","m","softBreak","HardBreak","isZeroLen","v","ParagraphWithMargin","Paragraph","el","attrs","base","Underline","Link","TextStyle","PasteExtension","PasteNormalizationExtension","VariableDecorationExtension","SectionDividerNode","mentionExtensions","buildAgentMentionExtension","buildTeamMentionExtension","buildSlashCommandExtension","richExtensions","Color","Highlight","FontFamily","FontSizeExtension","TextAlign","Subscript","Superscript","Image"],"mappings":"0yCAwEO,SAASA,EAAgBC,EAAyB,CAIxD,GAAIA,EAAO,UAAU,SACpB,MAAO,CACNC,EAAAA,QAAW,UAAU,CACpB,KAAM,GACN,UAAW,GAGX,KAAM,GACN,OAAQ,GACR,OAAQ,GACR,KAAM,GACN,QAAS,GACT,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,eAAgB,EAAA,CAChB,EACDC,EAAAA,QAAY,UAAU,CACrB,YAAaF,EAAO,aAAe;AAAA;AAAA,EAAA,CACnC,EACDG,EAAAA,uBACAC,EAAAA,sBAAsB,UAAU,CAC/B,OAAQJ,EAAO,OACf,aAAcA,EAAO,aACrB,eAAgBA,EAAO,WAAa,CAAA,CAAC,CACrC,EACD,GAAIA,EAAO,cACR,CAACK,UAAe,UAAU,CAAE,MAAOL,EAAO,aAAA,CAAe,CAAC,EAC1D,CAAA,CAAC,EAIN,MAAMM,EAAeN,EAAO,UAAU,WAAa,GAC7CO,EAAoBP,EAAO,UAAU,gBAAkB,GAKvDQ,EAAeR,EAAO,UAAU,aAChCS,EAAUC,GACf,CAACF,GAAgBA,EAAa,SAASE,CAAC,EAOnCC,EAAYC,EAAAA,QAAU,OAAO,CAClC,sBAAuB,CACtB,MAAO,CACN,cAAe,IAAM,KAAK,OAAO,SAAS,aAAA,CAAa,CAEzD,CAAA,CACA,EAWKC,EAAaC,GAClBA,IAAM,KAAOA,IAAM,OAASA,IAAM,OAASA,IAAM,MAC5CC,EAAsBC,EAAAA,QAAU,OAAO,CAC5C,eAAgB,CACf,MAAO,CACN,GAAI,KAAK,SAAA,GAAc,CAAA,EACvB,OAAQ,CACP,QAAS,KACT,UAAYC,GACXJ,EAAUI,EAAG,MAAM,SAAS,GAAKJ,EAAUI,EAAG,MAAM,YAAY,EAC7D,IACA,KACJ,WAAaC,GACZA,EAAM,SAAW,IAAM,CAAE,MAAO,eAAkB,CAAA,CAAC,CACrD,CAEF,CAAA,CACA,EAEKC,EAAO,CAIZlB,EAAAA,QAAW,UAAU,CACpB,KAAM,GACN,UAAW,GACX,UAAW,GACX,UAAW,GACX,KAAMQ,EAAO,MAAM,EAAI,CAAA,EAAK,GAC5B,OAAQA,EAAO,QAAQ,EAAI,CAAA,EAAK,GAChC,OAAQA,EAAO,QAAQ,EAAI,CAAA,EAAK,GAChC,KAAMA,EAAO,MAAM,EAAI,GAAK,EAAA,CAC5B,EACDM,EACAJ,EACA,GAAIF,EAAO,WAAW,EAAI,CAACW,EAAAA,OAAS,EAAI,CAAA,EAGxCC,EAAAA,QAAK,OAAO,CACX,cAAe,IAAM,CAAA,EACrB,cAAe,IAAM,CAAA,CAAC,CACtB,EAAE,UAAU,CACZ,YAAa,GACb,SAAU,GACV,YAAa,GACb,eAAgB,CACf,IAAK,sBACL,MAAO,UAAA,CACR,CACA,EACDC,EAAAA,UACApB,EAAAA,QAAY,UAAU,CACrB,YAAaF,EAAO,aAAe,mBAAA,CACnC,EAID,GAAIA,EAAO,QACR,CAACuB,EAAAA,eAAe,UAAU,CAAE,QAASvB,EAAO,QAAS,CAAC,EACtD,CAAA,EACHwB,EAAAA,4BAA4B,UAAU,CACrC,cAAelB,EAIf,UAAW,CAACA,CAAA,CACZ,EACDF,EAAAA,sBAAsB,UAAU,CAC/B,OAAQJ,EAAO,OACf,aAAcA,EAAO,aACrB,eAAgBA,EAAO,WAAa,CAAA,CAAC,CACrC,EACDyB,EAAAA,4BACA,GAAIzB,EAAO,cACR,CAACK,EAAAA,QAAe,UAAU,CAAE,MAAOL,EAAO,cAAe,CAAC,EAC1D,CAAA,EAKH0B,EAAAA,kBAAA,EAGKC,EAAoB,CACzB,GAAI3B,EAAO,UAAU,OAClB,CACA4B,EAAAA,2BACC5B,EAAO,SAAS,OAChBA,EAAO,kBACPA,EAAO,kBACPA,EAAO,sBACPA,EAAO,6BAAA,CACR,EAEA,CAAA,EACH,GAAIA,EAAO,UAAU,MAClB,CACA6B,EAAAA,0BACC7B,EAAO,SAAS,MAChBA,EAAO,kBACPA,EAAO,kBACPA,EAAO,sBACPA,EAAO,6BAAA,CACR,EAEA,CAAA,EACH,GAAIA,EAAO,cACR,CACA8B,EAAAA,2BACC9B,EAAO,cACPA,EAAO,uBACPA,EAAO,uBACPA,EAAO,0BAAA,CACR,EAEA,CAAA,CAAC,EAGC+B,EAAiBxB,EACpB,CACAyB,EAAAA,QACAC,EAAAA,QAAU,UAAU,CAAE,WAAY,GAAM,EACxCC,EAAAA,QACAC,EAAAA,kBACAC,EAAAA,QAAU,UAAU,CAAE,MAAO,CAAC,UAAW,WAAW,EAAG,EACvDC,EAAAA,QACAC,EAAAA,QACAC,EAAAA,OAAA,EAEA,CAACP,EAAAA,OAAK,EAET,MAAO,CAAC,GAAGb,EAAM,GAAGQ,EAAmB,GAAGI,CAAc,CACzD"}
1
+ {"version":3,"file":"buildExtensions.js","sources":["../../../../src/editor/extensions/buildExtensions.ts"],"sourcesContent":["import CharacterCount from '@tiptap/extension-character-count';\nimport Color from '@tiptap/extension-color';\nimport FontFamily from '@tiptap/extension-font-family';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Highlight from '@tiptap/extension-highlight';\nimport Image from '@tiptap/extension-image';\nimport Link from '@tiptap/extension-link';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport Subscript from '@tiptap/extension-subscript';\nimport Superscript from '@tiptap/extension-superscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport { TextStyle } from '@tiptap/extension-text-style';\nimport Underline from '@tiptap/extension-underline';\nimport StarterKit from '@tiptap/starter-kit';\nimport type { ReactNode } from 'react';\nimport type {\n\tEditorFeatures,\n\tEditorSnapshot,\n\tKeyboardShortcut,\n\tMentionDropdownRenderProps,\n\tMentionItem,\n\tPasteData,\n\tSlashCommandDropdownRenderProps,\n\tSlashCommandItem,\n} from '../BikEditor.types';\nimport { CharacterLimitExtension } from './characterLimit/CharacterLimitExtension';\nimport { FontSizeExtension } from './FontSizeExtension';\nimport { JsonHighlightExtension } from './jsonHighlight/JsonHighlightExtension';\nimport {\n\tbuildAgentMentionExtension,\n\tbuildTeamMentionExtension,\n} from './mention/MentionExtension';\nimport { PasteExtension } from './paste/PasteExtension';\nimport { PasteNormalizationExtension } from './plainClipboard/PasteNormalizationExtension';\nimport { SectionDividerNode } from './sectionDivider/SectionDividerNode';\nimport { SendShortcutExtension } from './sendShortcut/SendShortcutExtension';\nimport { buildSlashCommandExtension } from './slashCommand/SlashCommandExtension';\nimport { VariableDecorationExtension } from './variable/VariableDecorationExtension';\n\ninterface ExtensionConfig {\n\tfeatures?: EditorFeatures;\n\tplaceholder?: string;\n\tmaxCharacters?: number;\n\t/**\n\t * Soft character limit. Unlike `maxCharacters` (which hard-blocks all input),\n\t * this blocks typing past the limit but ALLOWS paste to overflow, rendering\n\t * the excess characters greyed (`.bik-editor-overflow`). Purely visual +\n\t * typing-guard; the consumer shows the count/error and gates send itself.\n\t */\n\tcharacterLimit?: number;\n\thasSections?: boolean;\n\tmentions?: {\n\t\tagents?: { current: MentionItem[] };\n\t\tteams?: { current: MentionItem[] };\n\t};\n\tslashCommands?: { current: SlashCommandItem[] };\n\tonPaste?: (data: PasteData) => boolean | void;\n\tonSend?: (content: EditorSnapshot) => void;\n\tsendShortcut?:\n\t\t| { key: string; modifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'> }\n\t\t| Array<{\n\t\t\t\tkey: string;\n\t\t\t\tmodifiers?: Array<'mod' | 'ctrl' | 'shift' | 'alt'>;\n\t\t }>;\n\tshortcuts?: KeyboardShortcut[];\n\tonMentionSelected?: (item: MentionItem, char: '@' | '#') => void;\n\tonSlashCommandSelected?: (command: SlashCommandItem) => void;\n\trenderMentionItem?: (item: MentionItem, isActive: boolean) => ReactNode;\n\trenderMentionDropdown?: (props: MentionDropdownRenderProps) => ReactNode;\n\tremoveMentionTriggerOnDismiss?: boolean;\n\trenderSlashCommandItem?: (\n\t\titem: SlashCommandItem,\n\t\tisActive: boolean,\n\t) => ReactNode;\n\trenderSlashCommandDropdown?: (\n\t\tprops: SlashCommandDropdownRenderProps,\n\t) => ReactNode;\n}\n\nexport function buildExtensions(config: ExtensionConfig) {\n\t// JSON body mode is a dedicated code editor — it deliberately skips the rich\n\t// text stack (mentions, typography, rich paste, sections) and turns the whole\n\t// document into one syntax-highlighted JSON code block, Postman-style.\n\tif (config.features?.jsonMode) {\n\t\treturn [\n\t\t\tStarterKit.configure({\n\t\t\t\tlink: false,\n\t\t\t\tunderline: false,\n\t\t\t\t// Keep codeBlock (the JSON container) and history; drop everything\n\t\t\t\t// that has no meaning inside raw JSON.\n\t\t\t\tbold: false,\n\t\t\t\titalic: false,\n\t\t\t\tstrike: false,\n\t\t\t\tcode: false,\n\t\t\t\theading: false,\n\t\t\t\tbulletList: false,\n\t\t\t\torderedList: false,\n\t\t\t\tblockquote: false,\n\t\t\t\thorizontalRule: false,\n\t\t\t}),\n\t\t\tPlaceholder.configure({\n\t\t\t\tplaceholder: config.placeholder ?? '{\\n \\n}',\n\t\t\t}),\n\t\t\tJsonHighlightExtension,\n\t\t\tSendShortcutExtension.configure({\n\t\t\t\tonSend: config.onSend,\n\t\t\t\tsendShortcut: config.sendShortcut,\n\t\t\t\textraShortcuts: config.shortcuts ?? [],\n\t\t\t}),\n\t\t\t...(config.maxCharacters\n\t\t\t\t? [CharacterCount.configure({ limit: config.maxCharacters })]\n\t\t\t\t: []),\n\t\t];\n\t}\n\n\tconst hasRichPaste = config.features?.richPaste ?? false;\n\tconst hasRichTypography = config.features?.richTypography ?? false;\n\n\t// When allowedMarks is specified only those marks are registered in the schema.\n\t// This disables rendering, keyboard shortcuts AND paste-preservation for the\n\t// excluded marks — all three come for free when the extension is absent.\n\tconst allowedMarks = config.features?.allowedMarks;\n\tconst isMark = (m: 'bold' | 'italic' | 'strike' | 'underline' | 'code') =>\n\t\t!allowedMarks || allowedMarks.includes(m);\n\n\t// Soft line break. Shift-Enter inserts a <br> inside the current block\n\t// (matches Gmail); plain Enter still splits the block into a new paragraph\n\t// via StarterKit's default. HardBreak is registered standalone — like Link\n\t// and Underline above — instead of through StarterKit, so we can bind ONLY\n\t// Shift-Enter here and leave Mod-Enter free for the send shortcut.\n\tconst softBreak = HardBreak.extend({\n\t\taddKeyboardShortcuts() {\n\t\t\treturn {\n\t\t\t\t'Shift-Enter': () => this.editor.commands.setHardBreak(),\n\t\t\t};\n\t\t},\n\t});\n\n\t// Paragraph that preserves a zero block-margin from the source (Gmail-style).\n\t// Most sources (ChatGPT, typed text) use plain <p> → no margin attr → the\n\t// editor/viewer default 1em margin provides the gap. Google-Docs-style\n\t// content uses margin:0 paragraphs and a separate blank-line paragraph for\n\t// spacing; we keep that margin:0 so the blank line — not stacked margins —\n\t// provides a single-line gap, exactly like Gmail. The paste pipeline also\n\t// sets margin:'0' on every paragraph when a paste contains blank-line\n\t// paragraphs (see applyParagraphSpacing), so spacing comes from EITHER the\n\t// margin OR the blank line, never both (no double gap).\n\tconst isZeroLen = (v: string) =>\n\t\tv === '0' || v === '0px' || v === '0pt' || v === '0em';\n\tconst ParagraphWithMargin = Paragraph.extend({\n\t\taddAttributes() {\n\t\t\treturn {\n\t\t\t\t...(this.parent?.() ?? {}),\n\t\t\t\tmargin: {\n\t\t\t\t\tdefault: null,\n\t\t\t\t\tparseHTML: (el: HTMLElement) =>\n\t\t\t\t\t\tisZeroLen(el.style.marginTop) && isZeroLen(el.style.marginBottom)\n\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\trenderHTML: (attrs: { margin?: string | null }) =>\n\t\t\t\t\t\tattrs.margin === '0' ? { style: 'margin: 0px' } : {},\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t});\n\n\tconst base = [\n\t\t// Exclude Link and Underline from StarterKit — TipTap v3 bundles both.\n\t\t// Without this, two copies of each are registered and the StarterKit copy's\n\t\t// click handler calls window.open even when openOnClick: false is set.\n\t\tStarterKit.configure({\n\t\t\tlink: false,\n\t\t\tunderline: false,\n\t\t\thardBreak: false,\n\t\t\tparagraph: false,\n\t\t\tbold: isMark('bold') ? {} : false,\n\t\t\titalic: isMark('italic') ? {} : false,\n\t\t\tstrike: isMark('strike') ? {} : false,\n\t\t\tcode: isMark('code') ? {} : false,\n\t\t}),\n\t\tParagraphWithMargin,\n\t\tsoftBreak,\n\t\t...(isMark('underline') ? [Underline] : []),\n\t\t// Extend Link to strip addPasteRules() and addInputRules() so pasting a\n\t\t// URL never creates a hyperlink regardless of autolink/linkOnPaste values.\n\t\tLink.extend({\n\t\t\taddPasteRules: () => [],\n\t\t\taddInputRules: () => [],\n\t\t}).configure({\n\t\t\topenOnClick: false,\n\t\t\tautolink: false,\n\t\t\tlinkOnPaste: false,\n\t\t\tHTMLAttributes: {\n\t\t\t\trel: 'noopener noreferrer',\n\t\t\t\tclass: 'bik-link',\n\t\t\t},\n\t\t}),\n\t\tTextStyle,\n\t\tPlaceholder.configure({\n\t\t\tplaceholder: config.placeholder ?? 'Type a message...',\n\t\t}),\n\t\t// Consumer paste callback runs first. If it returns true the event is\n\t\t// consumed and neither PlainClipboardExtension nor the editor's default\n\t\t// paste handling will run for that event.\n\t\t...(config.onPaste\n\t\t\t? [PasteExtension.configure({ onPaste: config.onPaste })]\n\t\t\t: []),\n\t\tPasteNormalizationExtension.configure({\n\t\t\tpreserveMarks: hasRichPaste,\n\t\t\t// Only email + signature (richPaste) keep the rich HTML paste pipeline.\n\t\t\t// Every other channel (WhatsApp, IG, FB, comments) forces plain-text\n\t\t\t// paste for BOTH Cmd/Ctrl+V and Cmd/Ctrl+Shift+V — no formatting.\n\t\t\tplainOnly: !hasRichPaste,\n\t\t}),\n\t\tSendShortcutExtension.configure({\n\t\t\tonSend: config.onSend,\n\t\t\tsendShortcut: config.sendShortcut,\n\t\t\textraShortcuts: config.shortcuts ?? [],\n\t\t}),\n\t\tVariableDecorationExtension,\n\t\t...(config.maxCharacters\n\t\t\t? [CharacterCount.configure({ limit: config.maxCharacters })]\n\t\t\t: []),\n\t\t...(config.characterLimit\n\t\t\t? [CharacterLimitExtension.configure({ limit: config.characterLimit })]\n\t\t\t: []),\n\t\t// Always register SectionDividerNode so the custom <div data-section-divider>\n\t\t// node is part of the schema in every editor instance. This means imperative\n\t\t// callers (setBodyAndSections / setSectionContent) work even when no\n\t\t// `sections` prop was provided at mount time.\n\t\tSectionDividerNode,\n\t];\n\n\tconst mentionExtensions = [\n\t\t...(config.mentions?.agents\n\t\t\t? [\n\t\t\t\t\tbuildAgentMentionExtension(\n\t\t\t\t\t\tconfig.mentions.agents,\n\t\t\t\t\t\tconfig.onMentionSelected,\n\t\t\t\t\t\tconfig.renderMentionItem,\n\t\t\t\t\t\tconfig.renderMentionDropdown,\n\t\t\t\t\t\tconfig.removeMentionTriggerOnDismiss,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t\t...(config.mentions?.teams\n\t\t\t? [\n\t\t\t\t\tbuildTeamMentionExtension(\n\t\t\t\t\t\tconfig.mentions.teams,\n\t\t\t\t\t\tconfig.onMentionSelected,\n\t\t\t\t\t\tconfig.renderMentionItem,\n\t\t\t\t\t\tconfig.renderMentionDropdown,\n\t\t\t\t\t\tconfig.removeMentionTriggerOnDismiss,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t\t...(config.slashCommands\n\t\t\t? [\n\t\t\t\t\tbuildSlashCommandExtension(\n\t\t\t\t\t\tconfig.slashCommands,\n\t\t\t\t\t\tconfig.onSlashCommandSelected,\n\t\t\t\t\t\tconfig.renderSlashCommandItem,\n\t\t\t\t\t\tconfig.renderSlashCommandDropdown,\n\t\t\t\t\t),\n\t\t\t ]\n\t\t\t: []),\n\t];\n\n\tconst richExtensions = hasRichTypography\n\t\t? [\n\t\t\t\tColor,\n\t\t\t\tHighlight.configure({ multicolor: true }),\n\t\t\t\tFontFamily,\n\t\t\t\tFontSizeExtension,\n\t\t\t\tTextAlign.configure({ types: ['heading', 'paragraph'] }),\n\t\t\t\tSubscript,\n\t\t\t\tSuperscript,\n\t\t\t\tImage,\n\t\t ]\n\t\t: [Color];\n\n\treturn [...base, ...mentionExtensions, ...richExtensions];\n}\n"],"names":["buildExtensions","config","StarterKit","Placeholder","JsonHighlightExtension","SendShortcutExtension","CharacterCount","hasRichPaste","hasRichTypography","allowedMarks","isMark","m","softBreak","HardBreak","isZeroLen","v","ParagraphWithMargin","Paragraph","el","attrs","base","Underline","Link","TextStyle","PasteExtension","PasteNormalizationExtension","VariableDecorationExtension","CharacterLimitExtension","SectionDividerNode","mentionExtensions","buildAgentMentionExtension","buildTeamMentionExtension","buildSlashCommandExtension","richExtensions","Color","Highlight","FontFamily","FontSizeExtension","TextAlign","Subscript","Superscript","Image"],"mappings":"m2CAgFO,SAASA,EAAgBC,EAAyB,CAIxD,GAAIA,EAAO,UAAU,SACpB,MAAO,CACNC,EAAAA,QAAW,UAAU,CACpB,KAAM,GACN,UAAW,GAGX,KAAM,GACN,OAAQ,GACR,OAAQ,GACR,KAAM,GACN,QAAS,GACT,WAAY,GACZ,YAAa,GACb,WAAY,GACZ,eAAgB,EAAA,CAChB,EACDC,EAAAA,QAAY,UAAU,CACrB,YAAaF,EAAO,aAAe;AAAA;AAAA,EAAA,CACnC,EACDG,EAAAA,uBACAC,EAAAA,sBAAsB,UAAU,CAC/B,OAAQJ,EAAO,OACf,aAAcA,EAAO,aACrB,eAAgBA,EAAO,WAAa,CAAA,CAAC,CACrC,EACD,GAAIA,EAAO,cACR,CAACK,UAAe,UAAU,CAAE,MAAOL,EAAO,aAAA,CAAe,CAAC,EAC1D,CAAA,CAAC,EAIN,MAAMM,EAAeN,EAAO,UAAU,WAAa,GAC7CO,EAAoBP,EAAO,UAAU,gBAAkB,GAKvDQ,EAAeR,EAAO,UAAU,aAChCS,EAAUC,GACf,CAACF,GAAgBA,EAAa,SAASE,CAAC,EAOnCC,EAAYC,EAAAA,QAAU,OAAO,CAClC,sBAAuB,CACtB,MAAO,CACN,cAAe,IAAM,KAAK,OAAO,SAAS,aAAA,CAAa,CAEzD,CAAA,CACA,EAWKC,EAAaC,GAClBA,IAAM,KAAOA,IAAM,OAASA,IAAM,OAASA,IAAM,MAC5CC,EAAsBC,EAAAA,QAAU,OAAO,CAC5C,eAAgB,CACf,MAAO,CACN,GAAI,KAAK,SAAA,GAAc,CAAA,EACvB,OAAQ,CACP,QAAS,KACT,UAAYC,GACXJ,EAAUI,EAAG,MAAM,SAAS,GAAKJ,EAAUI,EAAG,MAAM,YAAY,EAC7D,IACA,KACJ,WAAaC,GACZA,EAAM,SAAW,IAAM,CAAE,MAAO,eAAkB,CAAA,CAAC,CACrD,CAEF,CAAA,CACA,EAEKC,EAAO,CAIZlB,EAAAA,QAAW,UAAU,CACpB,KAAM,GACN,UAAW,GACX,UAAW,GACX,UAAW,GACX,KAAMQ,EAAO,MAAM,EAAI,CAAA,EAAK,GAC5B,OAAQA,EAAO,QAAQ,EAAI,CAAA,EAAK,GAChC,OAAQA,EAAO,QAAQ,EAAI,CAAA,EAAK,GAChC,KAAMA,EAAO,MAAM,EAAI,GAAK,EAAA,CAC5B,EACDM,EACAJ,EACA,GAAIF,EAAO,WAAW,EAAI,CAACW,EAAAA,OAAS,EAAI,CAAA,EAGxCC,EAAAA,QAAK,OAAO,CACX,cAAe,IAAM,CAAA,EACrB,cAAe,IAAM,CAAA,CAAC,CACtB,EAAE,UAAU,CACZ,YAAa,GACb,SAAU,GACV,YAAa,GACb,eAAgB,CACf,IAAK,sBACL,MAAO,UAAA,CACR,CACA,EACDC,EAAAA,UACApB,EAAAA,QAAY,UAAU,CACrB,YAAaF,EAAO,aAAe,mBAAA,CACnC,EAID,GAAIA,EAAO,QACR,CAACuB,EAAAA,eAAe,UAAU,CAAE,QAASvB,EAAO,QAAS,CAAC,EACtD,CAAA,EACHwB,EAAAA,4BAA4B,UAAU,CACrC,cAAelB,EAIf,UAAW,CAACA,CAAA,CACZ,EACDF,EAAAA,sBAAsB,UAAU,CAC/B,OAAQJ,EAAO,OACf,aAAcA,EAAO,aACrB,eAAgBA,EAAO,WAAa,CAAA,CAAC,CACrC,EACDyB,EAAAA,4BACA,GAAIzB,EAAO,cACR,CAACK,EAAAA,QAAe,UAAU,CAAE,MAAOL,EAAO,cAAe,CAAC,EAC1D,CAAA,EACH,GAAIA,EAAO,eACR,CAAC0B,EAAAA,wBAAwB,UAAU,CAAE,MAAO1B,EAAO,eAAgB,CAAC,EACpE,CAAA,EAKH2B,EAAAA,kBAAA,EAGKC,EAAoB,CACzB,GAAI5B,EAAO,UAAU,OAClB,CACA6B,EAAAA,2BACC7B,EAAO,SAAS,OAChBA,EAAO,kBACPA,EAAO,kBACPA,EAAO,sBACPA,EAAO,6BAAA,CACR,EAEA,CAAA,EACH,GAAIA,EAAO,UAAU,MAClB,CACA8B,EAAAA,0BACC9B,EAAO,SAAS,MAChBA,EAAO,kBACPA,EAAO,kBACPA,EAAO,sBACPA,EAAO,6BAAA,CACR,EAEA,CAAA,EACH,GAAIA,EAAO,cACR,CACA+B,EAAAA,2BACC/B,EAAO,cACPA,EAAO,uBACPA,EAAO,uBACPA,EAAO,0BAAA,CACR,EAEA,CAAA,CAAC,EAGCgC,EAAiBzB,EACpB,CACA0B,EAAAA,QACAC,EAAAA,QAAU,UAAU,CAAE,WAAY,GAAM,EACxCC,EAAAA,QACAC,EAAAA,kBACAC,EAAAA,QAAU,UAAU,CAAE,MAAO,CAAC,UAAW,WAAW,EAAG,EACvDC,EAAAA,QACAC,EAAAA,QACAC,EAAAA,OAAA,EAEA,CAACP,EAAAA,OAAK,EAET,MAAO,CAAC,GAAGd,EAAM,GAAGS,EAAmB,GAAGI,CAAc,CACzD"}
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../../../node_modules/@tiptap/core/dist/index.js"),u=require("@tiptap/pm/state"),l=require("@tiptap/pm/view"),x=m.Extension.create({name:"characterLimitOverflow",addOptions(){return{limit:0}},addProseMirrorPlugins(){const n=this.options.limit;if(!n||n<=0)return[];const d=r=>r.textBetween(0,r.content.size,`
2
+
3
+ `,`
4
+ `).length;return[new u.Plugin({key:new u.PluginKey("characterLimitOverflow"),props:{handleTextInput(r,s,e,t){const i=r.state.doc,o=d(i),c=i.textBetween(s,e,`
5
+
6
+ `,`
7
+ `).length;return o-c+t.length>n},decorations(r){const s=[];let e=0,t=!1;return r.doc.descendants((i,o,c,f)=>{if(!t&&c&&c.type.name==="doc"&&f>0&&(e+=2,e>n&&(t=!0)),i.isText&&i.text){const a=i.text.length;if(t)s.push(l.Decoration.inline(o,o+a,{class:"bik-editor-overflow"}));else if(e+a>n){const h=Math.max(0,n-e);s.push(l.Decoration.inline(o+h,o+a,{class:"bik-editor-overflow"})),t=!0}e+=a}else i.type.name==="hardBreak"&&(e+=1,!t&&e>n&&(t=!0));return!0}),l.DecorationSet.create(r.doc,s)}}})]}});exports.CharacterLimitExtension=x;
8
+ //# sourceMappingURL=CharacterLimitExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CharacterLimitExtension.js","sources":["../../../../../src/editor/extensions/characterLimit/CharacterLimitExtension.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { Decoration, DecorationSet } from '@tiptap/pm/view';\nimport type { Node as PMNode } from '@tiptap/pm/model';\n\nexport interface CharacterLimitOptions {\n\t/** Soft character limit. 0 / undefined disables the extension entirely. */\n\tlimit: number;\n}\n\n/**\n * Soft character limit with two behaviours (see CRM design):\n *\n * 1. Typing is BLOCKED once the content is at/over the limit — `handleTextInput`\n * rejects the insertion. This never fires for paste (paste flows through the\n * clipboard pipeline), so paste is free to push the content over the limit.\n * 2. Every character BEYOND the limit is decorated with `bik-editor-overflow`\n * (rendered grey) so pasted overflow is visible but clearly marked.\n *\n * Counting mirrors `extractContent` exactly — `doc.textBetween(0, size, '\\n\\n',\n * '\\n')` — so the grey boundary lines up with the `characterCount` the consumer\n * shows in its error message (paragraph break = 2 chars, soft break = 1 char).\n */\nexport const CharacterLimitExtension = Extension.create<CharacterLimitOptions>({\n\tname: 'characterLimitOverflow',\n\n\taddOptions() {\n\t\treturn { limit: 0 };\n\t},\n\n\taddProseMirrorPlugins() {\n\t\tconst limit = this.options.limit;\n\t\tif (!limit || limit <= 0) return [];\n\n\t\t// Same metric as BikEditor.utils.extractContent → keeps the grey boundary\n\t\t// and the consumer's characterCount in sync.\n\t\tconst countChars = (doc: PMNode) =>\n\t\t\tdoc.textBetween(0, doc.content.size, '\\n\\n', '\\n').length;\n\n\t\treturn [\n\t\t\tnew Plugin({\n\t\t\t\tkey: new PluginKey('characterLimitOverflow'),\n\t\t\t\tprops: {\n\t\t\t\t\t// Block typed/composed input that would exceed the limit. Replacing\n\t\t\t\t\t// a selection is allowed as long as the result still fits.\n\t\t\t\t\thandleTextInput(view, from, to, text) {\n\t\t\t\t\t\tconst doc = view.state.doc;\n\t\t\t\t\t\tconst current = countChars(doc);\n\t\t\t\t\t\tconst removed = doc.textBetween(from, to, '\\n\\n', '\\n').length;\n\t\t\t\t\t\treturn current - removed + text.length > limit;\n\t\t\t\t\t},\n\t\t\t\t\tdecorations(state) {\n\t\t\t\t\t\tconst decorations: Decoration[] = [];\n\t\t\t\t\t\tlet count = 0;\n\t\t\t\t\t\tlet overflowing = false;\n\n\t\t\t\t\t\tstate.doc.descendants((node, pos, parent, index) => {\n\t\t\t\t\t\t\t// Account for the \"\\n\\n\" separator inserted between top-level\n\t\t\t\t\t\t\t// blocks so the boundary matches textBetween's counting.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!overflowing &&\n\t\t\t\t\t\t\t\tparent &&\n\t\t\t\t\t\t\t\tparent.type.name === 'doc' &&\n\t\t\t\t\t\t\t\tindex > 0\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcount += 2;\n\t\t\t\t\t\t\t\tif (count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (node.isText && node.text) {\n\t\t\t\t\t\t\t\tconst len = node.text.length;\n\t\t\t\t\t\t\t\tif (overflowing) {\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else if (count + len > limit) {\n\t\t\t\t\t\t\t\t\tconst startOffset = Math.max(0, limit - count);\n\t\t\t\t\t\t\t\t\tdecorations.push(\n\t\t\t\t\t\t\t\t\t\tDecoration.inline(pos + startOffset, pos + len, {\n\t\t\t\t\t\t\t\t\t\t\tclass: 'bik-editor-overflow',\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\toverflowing = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcount += len;\n\t\t\t\t\t\t\t} else if (node.type.name === 'hardBreak') {\n\t\t\t\t\t\t\t\t// Soft line break → \"\\n\" (1 char) in textBetween.\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tif (!overflowing && count > limit) overflowing = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn DecorationSet.create(state.doc, decorations);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\t},\n});\n"],"names":["CharacterLimitExtension","Extension","limit","countChars","doc","Plugin","PluginKey","view","from","to","text","current","removed","state","decorations","count","overflowing","node","pos","parent","index","len","Decoration","startOffset","DecorationSet"],"mappings":"+MAuBaA,EAA0BC,EAAAA,UAAU,OAA8B,CAC9E,KAAM,yBAEN,YAAa,CACZ,MAAO,CAAE,MAAO,CAAA,CACjB,EAEA,uBAAwB,CACvB,MAAMC,EAAQ,KAAK,QAAQ,MAC3B,GAAI,CAACA,GAASA,GAAS,QAAU,CAAA,EAIjC,MAAMC,EAAcC,GACnBA,EAAI,YAAY,EAAGA,EAAI,QAAQ,KAAM;AAAA;AAAA,EAAQ;AAAA,CAAI,EAAE,OAEpD,MAAO,CACN,IAAIC,SAAO,CACV,IAAK,IAAIC,EAAAA,UAAU,wBAAwB,EAC3C,MAAO,CAGN,gBAAgBC,EAAMC,EAAMC,EAAIC,EAAM,CACrC,MAAMN,EAAMG,EAAK,MAAM,IACjBI,EAAUR,EAAWC,CAAG,EACxBQ,EAAUR,EAAI,YAAYI,EAAMC,EAAI;AAAA;AAAA,EAAQ;AAAA,CAAI,EAAE,OACxD,OAAOE,EAAUC,EAAUF,EAAK,OAASR,CAC1C,EACA,YAAYW,EAAO,CAClB,MAAMC,EAA4B,CAAA,EAClC,IAAIC,EAAQ,EACRC,EAAc,GAElB,OAAAH,EAAM,IAAI,YAAY,CAACI,EAAMC,EAAKC,EAAQC,IAAU,CAanD,GATC,CAACJ,GACDG,GACAA,EAAO,KAAK,OAAS,OACrBC,EAAQ,IAERL,GAAS,EACLA,EAAQb,IAAOc,EAAc,KAG9BC,EAAK,QAAUA,EAAK,KAAM,CAC7B,MAAMI,EAAMJ,EAAK,KAAK,OACtB,GAAID,EACHF,EAAY,KACXQ,EAAAA,WAAW,OAAOJ,EAAKA,EAAMG,EAAK,CACjC,MAAO,qBAAA,CACP,CAAA,UAEQN,EAAQM,EAAMnB,EAAO,CAC/B,MAAMqB,EAAc,KAAK,IAAI,EAAGrB,EAAQa,CAAK,EAC7CD,EAAY,KACXQ,EAAAA,WAAW,OAAOJ,EAAMK,EAAaL,EAAMG,EAAK,CAC/C,MAAO,qBAAA,CACP,CAAA,EAEFL,EAAc,EACf,CACAD,GAASM,CACV,MAAWJ,EAAK,KAAK,OAAS,cAE7BF,GAAS,EACL,CAACC,GAAeD,EAAQb,IAAOc,EAAc,KAElD,MAAO,EACR,CAAC,EAEMQ,EAAAA,cAAc,OAAOX,EAAM,IAAKC,CAAW,CACnD,CAAA,CACD,CACA,CAAA,CAEH,CACD,CAAC"}
@@ -1,21 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("styled-components"),t=require("../../constants/Theme.js"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=r(n),a=o.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("styled-components"),n=require("../../components/TypographyStyle.js"),t=require("../../constants/Theme.js"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=a(r),i=o.default.div`
2
2
  background: ${t.COLORS.surface.standard};
3
- border: 1px solid ${t.COLORS.stroke.primary};
4
- border-radius: 8px;
3
+ border-radius: 4px;
5
4
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
6
- padding: 4px;
7
5
  min-width: 330px;
8
6
  max-height: 260px;
9
7
  overflow-y: auto;
10
8
  font-size: 14px;
11
9
  color: ${t.COLORS.content.primary};
12
- `,i=o.default.div`
10
+ `,c=o.default.div`
13
11
  display: flex;
14
12
  align-items: center;
15
13
  gap: 8px;
16
- padding: 12px 16px;
14
+ padding: 8px;
17
15
  min-height: 43px;
18
- border-radius: 6px;
19
16
  cursor: pointer;
20
17
  color: ${t.COLORS.content.primary};
21
18
  background: ${({$isActive:e})=>e?t.COLORS.surface.hovered:"transparent"};
@@ -25,7 +22,7 @@
25
22
  border-radius: 50%;
26
23
  object-fit: cover;
27
24
  flex-shrink: 0;
28
- `,s=o.default.div`
25
+ `,l=o.default.div`
29
26
  width: 24px;
30
27
  height: 24px;
31
28
  border-radius: 50%;
@@ -37,22 +34,20 @@
37
34
  font-weight: 600;
38
35
  color: ${t.COLORS.content.primary};
39
36
  flex-shrink: 0;
40
- `,c=o.default.span`
37
+ `,s=o.default.span`
41
38
  font-weight: 500;
42
39
  color: ${t.COLORS.content.primary};
43
- `,l=o.default.span`
40
+ `,p=o.default.span`
44
41
  width: 8px;
45
42
  height: 8px;
46
43
  border-radius: 50%;
47
44
  background: ${({$online:e})=>e?t.COLORS.content.positive:t.COLORS.content.placeholder};
48
45
  margin-left: auto;
49
46
  flex-shrink: 0;
50
- `,p=o.default.span`
51
- font-weight: 500;
47
+ `,u=o.default(n.BodyCaption)`
52
48
  color: ${t.COLORS.content.primary};
53
- `,u=o.default.span`
54
- font-size: 12px;
49
+ `,f=o.default(n.BodyCaption)`
55
50
  color: ${t.COLORS.content.secondary};
56
51
  margin-left: auto;
57
- `;exports.DropdownContainer=a;exports.DropdownItem=i;exports.MentionAvatar=d;exports.MentionAvatarFallback=s;exports.MentionLabel=c;exports.MentionPresenceDot=l;exports.SlashDescription=u;exports.SlashLabel=p;
52
+ `;exports.DropdownContainer=i;exports.DropdownItem=c;exports.MentionAvatar=d;exports.MentionAvatarFallback=l;exports.MentionLabel=s;exports.MentionPresenceDot=p;exports.SlashDescription=f;exports.SlashLabel=u;
58
53
  //# sourceMappingURL=editorDropdown.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editorDropdown.styles.js","sources":["../../../../src/editor/extensions/editorDropdown.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const DropdownContainer = styled.div`\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n\tpadding: 4px;\n\tmin-width: 330px;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\tfont-size: 14px;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const DropdownItem = styled.div<{ $isActive?: boolean }>`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 12px 16px;\n\tmin-height: 43px;\n\tborder-radius: 6px;\n\tcursor: pointer;\n\tcolor: ${COLORS.content.primary};\n\tbackground: ${({ $isActive }) =>\n\t\t$isActive ? COLORS.surface.hovered : 'transparent'};\n`;\n\nexport const MentionAvatar = styled.img`\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 50%;\n\tobject-fit: cover;\n\tflex-shrink: 0;\n`;\n\nexport const MentionAvatarFallback = styled.div`\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 50%;\n\tbackground: ${COLORS.surface.hovered};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcolor: ${COLORS.content.primary};\n\tflex-shrink: 0;\n`;\n\nexport const MentionLabel = styled.span`\n\tfont-weight: 500;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const MentionPresenceDot = styled.span<{ $online?: boolean }>`\n\twidth: 8px;\n\theight: 8px;\n\tborder-radius: 50%;\n\tbackground: ${({ $online }) =>\n\t\t$online ? COLORS.content.positive : COLORS.content.placeholder};\n\tmargin-left: auto;\n\tflex-shrink: 0;\n`;\n\nexport const SlashLabel = styled.span`\n\tfont-weight: 500;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const SlashDescription = styled.span`\n\tfont-size: 12px;\n\tcolor: ${COLORS.content.secondary};\n\tmargin-left: auto;\n`;\n"],"names":["DropdownContainer","styled","COLORS","DropdownItem","$isActive","MentionAvatar","MentionAvatarFallback","MentionLabel","MentionPresenceDot","$online","SlashLabel","SlashDescription"],"mappings":"0NAGaA,EAAoBC,EAAAA,QAAO;AAAA,eACzBC,EAAAA,OAAO,QAAQ,QAAQ;AAAA,qBACjBA,EAAAA,OAAO,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQhCA,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBC,EAAeF,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQzBC,EAAAA,OAAO,QAAQ,OAAO;AAAA,eACjB,CAAC,CAAE,UAAAE,KAChBA,EAAYF,EAAAA,OAAO,QAAQ,QAAU,aAAa;AAAA,EAGvCG,EAAgBJ,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQvBK,EAAwBL,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA,eAI7BC,EAAAA,OAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAM3BA,EAAAA,OAAO,QAAQ,OAAO;AAAA;AAAA,EAInBK,EAAeN,EAAAA,QAAO;AAAA;AAAA,UAEzBC,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBM,EAAqBP,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA,eAI1B,CAAC,CAAE,QAAAQ,CAAA,IAChBA,EAAUP,EAAAA,OAAO,QAAQ,SAAWA,EAAAA,OAAO,QAAQ,WAAW;AAAA;AAAA;AAAA,EAKnDQ,EAAaT,EAAAA,QAAO;AAAA;AAAA,UAEvBC,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBS,EAAmBV,EAAAA,QAAO;AAAA;AAAA,UAE7BC,EAAAA,OAAO,QAAQ,SAAS;AAAA;AAAA"}
1
+ {"version":3,"file":"editorDropdown.styles.js","sources":["../../../../src/editor/extensions/editorDropdown.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const DropdownContainer = styled.div`\n\tbackground: ${COLORS.surface.standard};\n\tborder-radius: 4px;\n\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n\tmin-width: 330px;\n\tmax-height: 260px;\n\toverflow-y: auto;\n\tfont-size: 14px;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const DropdownItem = styled.div<{ $isActive?: boolean }>`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 8px;\n\tmin-height: 43px;\n\tcursor: pointer;\n\tcolor: ${COLORS.content.primary};\n\tbackground: ${({ $isActive }) =>\n\t\t$isActive ? COLORS.surface.hovered : 'transparent'};\n`;\n\nexport const MentionAvatar = styled.img`\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 50%;\n\tobject-fit: cover;\n\tflex-shrink: 0;\n`;\n\nexport const MentionAvatarFallback = styled.div`\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 50%;\n\tbackground: ${COLORS.surface.hovered};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcolor: ${COLORS.content.primary};\n\tflex-shrink: 0;\n`;\n\nexport const MentionLabel = styled.span`\n\tfont-weight: 500;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const MentionPresenceDot = styled.span<{ $online?: boolean }>`\n\twidth: 8px;\n\theight: 8px;\n\tborder-radius: 50%;\n\tbackground: ${({ $online }) =>\n\t\t$online ? COLORS.content.positive : COLORS.content.placeholder};\n\tmargin-left: auto;\n\tflex-shrink: 0;\n`;\n\nexport const SlashLabel = styled(BodyCaption)`\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const SlashDescription = styled(BodyCaption)`\n\tcolor: ${COLORS.content.secondary};\n\tmargin-left: auto;\n`;\n"],"names":["DropdownContainer","styled","COLORS","DropdownItem","$isActive","MentionAvatar","MentionAvatarFallback","MentionLabel","MentionPresenceDot","$online","SlashLabel","BodyCaption","SlashDescription"],"mappings":"2QAIaA,EAAoBC,EAAAA,QAAO;AAAA,eACzBC,EAAAA,OAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAO5BA,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBC,EAAeF,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAOzBC,EAAAA,OAAO,QAAQ,OAAO;AAAA,eACjB,CAAC,CAAE,UAAAE,KAChBA,EAAYF,EAAAA,OAAO,QAAQ,QAAU,aAAa;AAAA,EAGvCG,EAAgBJ,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQvBK,EAAwBL,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA,eAI7BC,EAAAA,OAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAM3BA,EAAAA,OAAO,QAAQ,OAAO;AAAA;AAAA,EAInBK,EAAeN,EAAAA,QAAO;AAAA;AAAA,UAEzBC,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBM,EAAqBP,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA,eAI1B,CAAC,CAAE,QAAAQ,CAAA,IAChBA,EAAUP,EAAAA,OAAO,QAAQ,SAAWA,EAAAA,OAAO,QAAQ,WAAW;AAAA;AAAA;AAAA,EAKnDQ,EAAaT,EAAAA,QAAOU,aAAW;AAAA,UAClCT,EAAAA,OAAO,QAAQ,OAAO;AAAA,EAGnBU,EAAmBX,EAAAA,QAAOU,aAAW;AAAA,UACxCT,EAAAA,OAAO,QAAQ,SAAS;AAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=({size:e=24,color:l="currentColor",...o})=>{const r={width:e,height:e,color:l,...o};return t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z",fill:"currentColor"})})};exports.default=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=({width:l=24,height:r=24,color:o="currentColor",...t})=>e.jsx("svg",{width:l,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:o,...t,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L18.7071 14.2929C19.0976 14.6834 19.0976 15.3166 18.7071 15.7071C18.3166 16.0976 17.6834 16.0976 17.2929 15.7071L12 10.4142L6.70711 15.7071C6.31658 16.0976 5.68342 16.0976 5.29289 15.7071C4.90237 15.3166 4.90237 14.6834 5.29289 14.2929L11.2929 8.29289Z",fill:"currentColor"})});exports.default=n;
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","size","color","rest","props","jsx"],"mappings":"iJAMMA,EAAe,CAAC,CACrB,KAAAC,EAAO,GACP,MAAAC,EAAQ,eACR,GAAGC,CACJ,IAAa,CACZ,MAAMC,EAAQ,CACb,MAAOH,EACP,OAAQA,EACR,MAAAC,EACA,GAAGC,CAAA,EAEJ,OACCE,EAAAA,IAAC,MAAA,CACA,QAAQ,YACR,KAAK,OACL,MAAM,6BACL,GAAGD,EAEJ,SAAAC,EAAAA,IAAC,OAAA,CACA,SAAS,UACT,SAAS,UACT,EAAE,+TACF,KAAK,cAAA,CAAA,CACN,CAAA,CAGH"}
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","width","height","color","rest","jsx"],"mappings":"iJAKMA,EAAe,CAAC,CACrB,MAAAC,EAAQ,GACR,OAAAC,EAAS,GACT,MAAAC,EAAQ,eACR,GAAGC,CACJ,IAEEC,EAAAA,IAAC,MAAA,CACA,MAAAJ,EACA,OAAAC,EACA,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,MAAAC,EACC,GAAGC,EAEJ,SAAAC,EAAAA,IAAC,OAAA,CACA,SAAS,UACT,SAAS,UACT,EAAE,+TACF,KAAK,cAAA,CAAA,CACN,CAAA"}