@bikdotai/bik-component-library 0.0.824-beta.0 → 0.0.825-1

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 (363) 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/agent-builder/components/CreateSubAgentPanel.js +1 -1
  13. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  14. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  15. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  16. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +2 -2
  17. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  18. package/dist/cjs/components/avatar/Avatar.js +1 -1
  19. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  20. package/dist/cjs/components/avatar/Avatar.styled.js +4 -4
  21. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  22. package/dist/cjs/components/avatar/AvatarHelper.js +1 -1
  23. package/dist/cjs/components/avatar/AvatarHelper.js.map +1 -1
  24. package/dist/cjs/components/bik-layout/BikSidebar.js.map +1 -1
  25. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js +2 -0
  26. package/dist/cjs/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  27. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +2 -0
  28. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  29. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +294 -0
  30. package/dist/cjs/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  31. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +2 -0
  32. package/dist/cjs/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  33. package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
  34. package/dist/cjs/components/bik-layout/CommonStyles.js.map +1 -1
  35. package/dist/cjs/components/button/Button.js +1 -1
  36. package/dist/cjs/components/button/Button.js.map +1 -1
  37. package/dist/cjs/components/button/Button.styled.js +13 -13
  38. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  39. package/dist/cjs/components/button/themes.js +6 -6
  40. package/dist/cjs/components/button/themes.js.map +1 -1
  41. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  42. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  43. package/dist/cjs/components/checkBox/CheckBox.styled.js +21 -20
  44. package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
  45. package/dist/cjs/components/country-code-picker/CountryCodePicker.js.map +1 -1
  46. package/dist/cjs/components/country-code-picker/CountryPicker.js.map +1 -1
  47. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  48. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  49. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  50. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  51. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  52. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  53. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +9 -8
  54. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  55. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  56. package/dist/cjs/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  57. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +1 -1
  58. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  59. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +9 -9
  60. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  61. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  62. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  63. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +6 -2
  64. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  65. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
  66. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  67. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +1 -1
  68. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  69. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +1 -1
  70. package/dist/cjs/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  71. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  72. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  73. package/dist/cjs/components/dropdown-button/DropdownButton.style.js +20 -6
  74. package/dist/cjs/components/dropdown-button/DropdownButton.style.js.map +1 -1
  75. package/dist/cjs/components/dual-icon-button/DualIconButton.js +2 -0
  76. package/dist/cjs/components/dual-icon-button/DualIconButton.js.map +1 -0
  77. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js +33 -0
  78. package/dist/cjs/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  79. package/dist/cjs/components/fab-menu/FABMenu.js.map +1 -1
  80. package/dist/cjs/components/icon-button/IconButton.js +1 -1
  81. package/dist/cjs/components/icon-button/IconButton.js.map +1 -1
  82. package/dist/cjs/components/icon-button/IconButton.styled.js +18 -12
  83. package/dist/cjs/components/icon-button/IconButton.styled.js.map +1 -1
  84. package/dist/cjs/components/icon-button/theme.js +1 -1
  85. package/dist/cjs/components/icon-button/theme.js.map +1 -1
  86. package/dist/cjs/components/input/Input.js +1 -1
  87. package/dist/cjs/components/input/Input.js.map +1 -1
  88. package/dist/cjs/components/input/Input.styled.js +27 -16
  89. package/dist/cjs/components/input/Input.styled.js.map +1 -1
  90. package/dist/cjs/components/list-item/ListItem.js +1 -1
  91. package/dist/cjs/components/list-item/ListItem.js.map +1 -1
  92. package/dist/cjs/components/list-item/ListItem.styled.js +6 -6
  93. package/dist/cjs/components/list-item/ListItem.styled.js.map +1 -1
  94. package/dist/cjs/components/list-item/themes.js +32 -20
  95. package/dist/cjs/components/list-item/themes.js.map +1 -1
  96. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js +1 -1
  97. package/dist/cjs/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  98. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  99. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  100. package/dist/cjs/components/multi-level-dropdown/MenuList.js +1 -1
  101. package/dist/cjs/components/multi-level-dropdown/MenuList.js.map +1 -1
  102. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js +1 -1
  103. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  104. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js +32 -29
  105. package/dist/cjs/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  106. package/dist/cjs/components/tag/Tag.js +1 -1
  107. package/dist/cjs/components/tag/Tag.js.map +1 -1
  108. package/dist/cjs/components/tag/Tag.styled.js +4 -4
  109. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  110. package/dist/cjs/components/tag/model.js.map +1 -1
  111. package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
  112. package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
  113. package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
  114. package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
  115. package/dist/cjs/components/whats-new/WhatsNewPanel.js.map +1 -1
  116. package/dist/cjs/constants/Theme.js +1 -1
  117. package/dist/cjs/constants/Theme.js.map +1 -1
  118. package/dist/cjs/editor/BikEditor.js +1 -1
  119. package/dist/cjs/editor/BikEditor.js.map +1 -1
  120. package/dist/cjs/editor/BikEditor.styles.js +47 -30
  121. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  122. package/dist/cjs/editor/extensions/editorDropdown.styles.js +10 -15
  123. package/dist/cjs/editor/extensions/editorDropdown.styles.js.map +1 -1
  124. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js +3 -2
  125. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  126. package/dist/cjs/icons/Actions/Common actions/ProductTour.js +2 -0
  127. package/dist/cjs/icons/Actions/Common actions/ProductTour.js.map +1 -0
  128. package/dist/cjs/icons/Actions/Common actions/RestApi.js +2 -0
  129. package/dist/cjs/icons/Actions/Common actions/RestApi.js.map +1 -0
  130. package/dist/cjs/icons/Actions/Common actions/Save.js +2 -0
  131. package/dist/cjs/icons/Actions/Common actions/Save.js.map +1 -0
  132. package/dist/cjs/icons/Actions/Common actions/Shortcut.js +2 -0
  133. package/dist/cjs/icons/Actions/Common actions/Shortcut.js.map +1 -0
  134. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js +1 -1
  135. package/dist/cjs/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  136. package/dist/cjs/icons/BIK AI specific/Webhook.js +2 -0
  137. package/dist/cjs/icons/BIK AI specific/Webhook.js.map +1 -0
  138. package/dist/cjs/icons/Informational/Store related/TicketForm.js +2 -0
  139. package/dist/cjs/icons/Informational/Store related/TicketForm.js.map +1 -0
  140. package/dist/cjs/icons/Legacy - Bikayi specific/Services/LoudSpeaker.js +2 -0
  141. package/dist/cjs/icons/Legacy - Bikayi specific/Services/LoudSpeaker.js.map +1 -0
  142. package/dist/cjs/icons/index.js +1 -1
  143. package/dist/cjs/index.js +1 -1
  144. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js +61 -59
  145. package/dist/esm/components/BikGiftedChat/Bubble/Bubble.js.map +1 -1
  146. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.d.ts +6 -0
  147. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.js +124 -88
  148. package/dist/esm/components/BikGiftedChat/GiftedChat/Day.js.map +1 -1
  149. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +231 -129
  150. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  151. package/dist/esm/components/BikGiftedChat/GiftedChat/types.d.ts +6 -2
  152. package/dist/esm/components/BikGiftedChat/GiftedChat/types.js.map +1 -1
  153. package/dist/esm/components/TypographyStyle.d.ts +8 -0
  154. package/dist/esm/components/TypographyStyle.js +63 -40
  155. package/dist/esm/components/TypographyStyle.js.map +1 -1
  156. package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js +54 -43
  157. package/dist/esm/components/WhatsAppTextEditor/AIRephraseButton.js.map +1 -1
  158. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +24 -24
  159. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  160. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +98 -101
  161. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  162. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +5 -7
  163. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +40 -37
  164. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  165. package/dist/esm/components/avatar/Avatar.d.ts +2 -1
  166. package/dist/esm/components/avatar/Avatar.js +54 -76
  167. package/dist/esm/components/avatar/Avatar.js.map +1 -1
  168. package/dist/esm/components/avatar/Avatar.styled.js +8 -8
  169. package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
  170. package/dist/esm/components/avatar/AvatarHelper.d.ts +5 -4
  171. package/dist/esm/components/avatar/AvatarHelper.js +4 -4
  172. package/dist/esm/components/avatar/AvatarHelper.js.map +1 -1
  173. package/dist/esm/components/bik-layout/BikSidebar.js.map +1 -1
  174. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.d.ts +33 -0
  175. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js +272 -0
  176. package/dist/esm/components/bik-layout/BikSidebarV2/BikSidebarV2.js.map +1 -0
  177. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2.model.d.ts +27 -0
  178. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.d.ts +12 -0
  179. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js +53 -0
  180. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Popup.js.map +1 -0
  181. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +44 -0
  182. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js +310 -0
  183. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.js.map +1 -0
  184. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.d.ts +2 -0
  185. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js +107 -0
  186. package/dist/esm/components/bik-layout/BikSidebarV2/SimpleSidebarV2.js.map +1 -0
  187. package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
  188. package/dist/esm/components/bik-layout/CommonStyles.js.map +1 -1
  189. package/dist/esm/components/bik-layout/index.d.ts +2 -0
  190. package/dist/esm/components/button/Button.js +31 -31
  191. package/dist/esm/components/button/Button.js.map +1 -1
  192. package/dist/esm/components/button/Button.styled.d.ts +1 -1
  193. package/dist/esm/components/button/Button.styled.js +20 -20
  194. package/dist/esm/components/button/Button.styled.js.map +1 -1
  195. package/dist/esm/components/button/model.d.ts +3 -3
  196. package/dist/esm/components/button/themes.d.ts +2 -2
  197. package/dist/esm/components/button/themes.js +31 -17
  198. package/dist/esm/components/button/themes.js.map +1 -1
  199. package/dist/esm/components/checkBox/CheckBox.d.ts +2 -1
  200. package/dist/esm/components/checkBox/CheckBox.js +124 -87
  201. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  202. package/dist/esm/components/checkBox/CheckBox.styled.d.ts +1 -1
  203. package/dist/esm/components/checkBox/CheckBox.styled.js +10 -9
  204. package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
  205. package/dist/esm/components/country-code-picker/CountryCodePicker.d.ts +1 -1
  206. package/dist/esm/components/country-code-picker/CountryCodePicker.js.map +1 -1
  207. package/dist/esm/components/country-code-picker/CountryPicker.d.ts +1 -1
  208. package/dist/esm/components/country-code-picker/CountryPicker.js.map +1 -1
  209. package/dist/esm/components/dropdown/Dropdown.d.ts +2 -0
  210. package/dist/esm/components/dropdown/Dropdown.js +80 -77
  211. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  212. package/dist/esm/components/dropdown/DropdownPopover/index.js +69 -56
  213. package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
  214. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +183 -174
  215. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  216. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +1 -1
  217. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js +5 -4
  218. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.js.map +1 -1
  219. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.d.ts +1 -1
  220. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.js.map +1 -1
  221. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +1 -1
  222. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.js.map +1 -1
  223. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.d.ts +3 -1
  224. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js +29 -20
  225. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.js.map +1 -1
  226. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +3 -1
  227. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +93 -87
  228. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  229. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +3 -1
  230. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +68 -61
  231. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  232. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +2 -1
  233. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js +7 -2
  234. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.js.map +1 -1
  235. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +3 -1
  236. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +18 -10
  237. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  238. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.d.ts +1 -1
  239. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js +18 -18
  240. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchBox.js.map +1 -1
  241. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.d.ts +1 -0
  242. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js +43 -17
  243. package/dist/esm/components/dropdown/OpenedDropdown/components/searchbox/SearchZeroState.js.map +1 -1
  244. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +2 -0
  245. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +2 -0
  246. package/dist/esm/components/dropdown/type.d.ts +6 -1
  247. package/dist/esm/components/dropdown-button/DropdownButton.d.ts +13 -1
  248. package/dist/esm/components/dropdown-button/DropdownButton.js +83 -20
  249. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  250. package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +9 -2
  251. package/dist/esm/components/dropdown-button/DropdownButton.style.js +35 -9
  252. package/dist/esm/components/dropdown-button/DropdownButton.style.js.map +1 -1
  253. package/dist/esm/components/dual-icon-button/DualIconButton.d.ts +3 -0
  254. package/dist/esm/components/dual-icon-button/DualIconButton.js +53 -0
  255. package/dist/esm/components/dual-icon-button/DualIconButton.js.map +1 -0
  256. package/dist/esm/components/dual-icon-button/DualIconButton.styled.d.ts +7 -0
  257. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js +40 -0
  258. package/dist/esm/components/dual-icon-button/DualIconButton.styled.js.map +1 -0
  259. package/dist/esm/components/dual-icon-button/index.d.ts +2 -0
  260. package/dist/esm/components/dual-icon-button/model.d.ts +12 -0
  261. package/dist/esm/components/fab-menu/FABMenu.d.ts +1 -1
  262. package/dist/esm/components/fab-menu/FABMenu.js.map +1 -1
  263. package/dist/esm/components/icon-button/IconButton.js +36 -32
  264. package/dist/esm/components/icon-button/IconButton.js.map +1 -1
  265. package/dist/esm/components/icon-button/IconButton.styled.d.ts +3 -1
  266. package/dist/esm/components/icon-button/IconButton.styled.js +20 -14
  267. package/dist/esm/components/icon-button/IconButton.styled.js.map +1 -1
  268. package/dist/esm/components/icon-button/model.d.ts +12 -1
  269. package/dist/esm/components/icon-button/theme.js +12 -10
  270. package/dist/esm/components/icon-button/theme.js.map +1 -1
  271. package/dist/esm/components/input/Input.js +130 -125
  272. package/dist/esm/components/input/Input.js.map +1 -1
  273. package/dist/esm/components/input/Input.model.d.ts +2 -1
  274. package/dist/esm/components/input/Input.styled.d.ts +8 -1
  275. package/dist/esm/components/input/Input.styled.js +34 -22
  276. package/dist/esm/components/input/Input.styled.js.map +1 -1
  277. package/dist/esm/components/list-item/List.model.d.ts +2 -1
  278. package/dist/esm/components/list-item/ListItem.js +40 -38
  279. package/dist/esm/components/list-item/ListItem.js.map +1 -1
  280. package/dist/esm/components/list-item/ListItem.styled.d.ts +2 -1
  281. package/dist/esm/components/list-item/ListItem.styled.js +8 -8
  282. package/dist/esm/components/list-item/ListItem.styled.js.map +1 -1
  283. package/dist/esm/components/list-item/themes.d.ts +2 -2
  284. package/dist/esm/components/list-item/themes.js +20 -6
  285. package/dist/esm/components/list-item/themes.js.map +1 -1
  286. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.d.ts +1 -0
  287. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js +30 -28
  288. package/dist/esm/components/multi-level-dropdown/GroupedMenuList.js.map +1 -1
  289. package/dist/esm/components/multi-level-dropdown/MenuItem.d.ts +1 -0
  290. package/dist/esm/components/multi-level-dropdown/MenuItem.js +57 -54
  291. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  292. package/dist/esm/components/multi-level-dropdown/MenuList.d.ts +1 -0
  293. package/dist/esm/components/multi-level-dropdown/MenuList.js +46 -42
  294. package/dist/esm/components/multi-level-dropdown/MenuList.js.map +1 -1
  295. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js +95 -59
  296. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.js.map +1 -1
  297. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +13 -3
  298. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js +50 -41
  299. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.js.map +1 -1
  300. package/dist/esm/components/multi-level-dropdown/type.d.ts +1 -0
  301. package/dist/esm/components/tag/Tag.d.ts +1 -1
  302. package/dist/esm/components/tag/Tag.js +22 -18
  303. package/dist/esm/components/tag/Tag.js.map +1 -1
  304. package/dist/esm/components/tag/Tag.styled.d.ts +3 -1
  305. package/dist/esm/components/tag/Tag.styled.js +7 -7
  306. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  307. package/dist/esm/components/tag/model.d.ts +5 -1
  308. package/dist/esm/components/tag/model.js.map +1 -1
  309. package/dist/esm/components/whats-new/WhatsNew.d.ts +2 -0
  310. package/dist/esm/components/whats-new/WhatsNew.js +23 -19
  311. package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
  312. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +2 -0
  313. package/dist/esm/components/whats-new/WhatsNewButton.js +34 -38
  314. package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
  315. package/dist/esm/components/whats-new/WhatsNewPanel.js.map +1 -1
  316. package/dist/esm/constants/Theme.d.ts +36 -0
  317. package/dist/esm/constants/Theme.js +21 -1
  318. package/dist/esm/constants/Theme.js.map +1 -1
  319. package/dist/esm/editor/BikEditor.js +72 -79
  320. package/dist/esm/editor/BikEditor.js.map +1 -1
  321. package/dist/esm/editor/BikEditor.styles.d.ts +4 -4
  322. package/dist/esm/editor/BikEditor.styles.js +44 -27
  323. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  324. package/dist/esm/editor/extensions/editorDropdown.styles.d.ts +8 -2
  325. package/dist/esm/editor/extensions/editorDropdown.styles.js +18 -22
  326. package/dist/esm/editor/extensions/editorDropdown.styles.js.map +1 -1
  327. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js +100 -32
  328. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  329. package/dist/esm/icons/Actions/Common actions/ProductTour.d.ts +7 -0
  330. package/dist/esm/icons/Actions/Common actions/ProductTour.js +51 -0
  331. package/dist/esm/icons/Actions/Common actions/ProductTour.js.map +1 -0
  332. package/dist/esm/icons/Actions/Common actions/RestApi.d.ts +7 -0
  333. package/dist/esm/icons/Actions/Common actions/RestApi.js +29 -0
  334. package/dist/esm/icons/Actions/Common actions/RestApi.js.map +1 -0
  335. package/dist/esm/icons/Actions/Common actions/Save.d.ts +7 -0
  336. package/dist/esm/icons/Actions/Common actions/Save.js +40 -0
  337. package/dist/esm/icons/Actions/Common actions/Save.js.map +1 -0
  338. package/dist/esm/icons/Actions/Common actions/Shortcut.d.ts +7 -0
  339. package/dist/esm/icons/Actions/Common actions/Shortcut.js +40 -0
  340. package/dist/esm/icons/Actions/Common actions/Shortcut.js.map +1 -0
  341. package/dist/esm/icons/Actions/Common actions/index.d.ts +4 -0
  342. package/dist/esm/icons/Arrows/Chevron/ChevronUp.d.ts +1 -2
  343. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js +24 -28
  344. package/dist/esm/icons/Arrows/Chevron/ChevronUp.js.map +1 -1
  345. package/dist/esm/icons/BIK AI specific/Webhook.d.ts +7 -0
  346. package/dist/esm/icons/BIK AI specific/Webhook.js +32 -0
  347. package/dist/esm/icons/BIK AI specific/Webhook.js.map +1 -0
  348. package/dist/esm/icons/BIK AI specific/index.d.ts +1 -0
  349. package/dist/esm/icons/Informational/Store related/TicketForm.d.ts +7 -0
  350. package/dist/esm/icons/Informational/Store related/TicketForm.js +65 -0
  351. package/dist/esm/icons/Informational/Store related/TicketForm.js.map +1 -0
  352. package/dist/esm/icons/Informational/Store related/index.d.ts +1 -0
  353. package/dist/esm/icons/Legacy - Bikayi specific/Services/LoudSpeaker.d.ts +7 -0
  354. package/dist/esm/icons/Legacy - Bikayi specific/Services/LoudSpeaker.js +35 -0
  355. package/dist/esm/icons/Legacy - Bikayi specific/Services/LoudSpeaker.js.map +1 -0
  356. package/dist/esm/icons/Legacy - Bikayi specific/Services/index.d.ts +1 -0
  357. package/dist/esm/icons/index.d.ts +24 -24
  358. package/dist/esm/icons/index.js +284 -270
  359. package/dist/esm/icons/index.js.map +1 -1
  360. package/dist/esm/index.d.ts +1 -0
  361. package/dist/esm/index.js +973 -967
  362. package/dist/esm/index.js.map +1 -1
  363. package/package.json +2 -2
@@ -1,21 +1,21 @@
1
- import { jsxs as p, jsx as C } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as h } from "react/jsx-runtime";
2
2
  import { getMarkRange as St } from "../node_modules/@tiptap/core/dist/index.js";
3
3
  import { useEditor as kt, EditorContent as yt } from "@tiptap/react";
4
- import { forwardRef as Bt, useState as G, useRef as a, useEffect as xt, useImperativeHandle as vt } from "react";
4
+ import { forwardRef as Bt, useState as G, useRef as a, useEffect as bt, useImperativeHandle as xt } from "react";
5
5
  import { BodyCaption as K } from "../components/TypographyStyle.js";
6
- import { BikEditorShell as bt, BikJsonActions as At, BikJsonError as Tt } from "./BikEditor.styles.js";
6
+ import { BikEditorShell as vt, BikJsonHeader as At, BikJsonError as Tt } from "./BikEditor.styles.js";
7
7
  import { DEFAULT_FORMAT_STATE as X } from "./BikEditor.types.js";
8
- import { buildJsonCodeBlockHtml as Et, buildSectionedContent as Y, normalizeHtml as i, extractActiveFormats as tt, extractContent as et, parseJson as g, getCodeBlockText as d, extractBodyContent as Rt, extractSectionContent as It, setCodeBlockText as x, findSectionEndPos as nt, findSectionStartPos as Mt, setSectionContentInEditor as T, insertInlineHtml as Lt } from "./BikEditor.utils.js";
8
+ import { buildJsonCodeBlockHtml as Et, buildSectionedContent as Y, normalizeHtml as i, extractActiveFormats as tt, extractContent as et, parseJson as p, getCodeBlockText as d, extractBodyContent as Rt, extractSectionContent as It, setCodeBlockText as b, findSectionEndPos as nt, findSectionStartPos as Mt, setSectionContentInEditor as T, insertInlineHtml as Lt } from "./BikEditor.utils.js";
9
9
  import { buildExtensions as Ot } from "./extensions/buildExtensions.js";
10
- import { LinkBubbleMenu as Ft } from "./floating/LinkBubbleMenu.js";
11
- import Jt from "../icons/BIK AI specific/WandSparkles.js";
12
- import zt from "../icons/Actions/Formatting/Copy.js";
10
+ import { LinkBubbleMenu as Jt } from "./floating/LinkBubbleMenu.js";
11
+ import Ft from "../icons/BIK AI specific/WandSparkles.js";
12
+ import Nt from "../icons/Actions/Formatting/Copy.js";
13
13
  function jt(y) {
14
14
  return Object.entries(y).map(
15
- ([v, S]) => `${v.replace(/([A-Z])/g, (k) => `-${k.toLowerCase()}`)}:${S}`
15
+ ([x, S]) => `${x.replace(/([A-Z])/g, (k) => `-${k.toLowerCase()}`)}:${S}`
16
16
  ).join(";");
17
17
  }
18
- const wt = (y, v) => {
18
+ const zt = (y, x) => {
19
19
  const {
20
20
  initialContent: S,
21
21
  sections: k,
@@ -25,12 +25,12 @@ const wt = (y, v) => {
25
25
  shortcuts: rt,
26
26
  sendShortcut: st,
27
27
  mentions: l,
28
- slashCommands: h,
28
+ slashCommands: C,
29
29
  link: it,
30
30
  onPaste: ct,
31
31
  onReady: R,
32
32
  onChange: I,
33
- onSend: b,
33
+ onSend: v,
34
34
  onFocus: M,
35
35
  onBlur: L,
36
36
  onSelectionChange: O,
@@ -38,14 +38,14 @@ const wt = (y, v) => {
38
38
  maxHeight: lt,
39
39
  style: dt,
40
40
  className: ut,
41
- editorClassName: F,
42
- editorStyle: J,
43
- renderJsonError: z
44
- } = y, m = !!B?.jsonMode, [u, j] = G(null), [mt, w] = G(!1), ft = m ? Et(S ?? "") : k?.length ? Y(
41
+ editorClassName: J,
42
+ editorStyle: F,
43
+ renderJsonError: N
44
+ } = y, m = !!B?.jsonMode, [u, j] = G(null), [mt, z] = G(!1), ft = m ? Et(S ?? "") : k?.length ? Y(
45
45
  i(S ?? ""),
46
46
  k.map((t) => ({ ...t, content: i(t.content) }))
47
- ) : i(S ?? ""), A = a([]), H = a(!1), N = a(R);
48
- N.current = R;
47
+ ) : i(S ?? ""), A = a([]), H = a(!1), w = a(R);
48
+ w.current = R;
49
49
  const P = a(I);
50
50
  P.current = I;
51
51
  const D = a(O);
@@ -54,14 +54,14 @@ const wt = (y, v) => {
54
54
  U.current = M;
55
55
  const W = a(L);
56
56
  W.current = L;
57
- const $ = a(b);
58
- $.current = b;
57
+ const $ = a(v);
58
+ $.current = v;
59
59
  const V = a(l?.agents ?? []);
60
60
  V.current = l?.agents ?? [];
61
61
  const _ = a(l?.teams ?? []);
62
62
  _.current = l?.teams ?? [];
63
- const Q = a(h?.items ?? []);
64
- Q.current = h?.items ?? [];
63
+ const Q = a(C?.items ?? []);
64
+ Q.current = C?.items ?? [];
65
65
  const n = kt({
66
66
  extensions: Ot({
67
67
  features: B,
@@ -72,18 +72,18 @@ const wt = (y, v) => {
72
72
  agents: l ? V : void 0,
73
73
  teams: l ? _ : void 0
74
74
  },
75
- slashCommands: h ? Q : void 0,
75
+ slashCommands: C ? Q : void 0,
76
76
  onPaste: ct,
77
- onSend: b ? (t) => $.current?.(t) : void 0,
77
+ onSend: v ? (t) => $.current?.(t) : void 0,
78
78
  sendShortcut: st,
79
79
  shortcuts: rt,
80
80
  onMentionSelected: l?.onSelect,
81
- onSlashCommandSelected: h?.onSelect,
81
+ onSlashCommandSelected: C?.onSelect,
82
82
  renderMentionItem: l?.renderItem,
83
83
  renderMentionDropdown: l?.renderDropdown,
84
84
  removeMentionTriggerOnDismiss: l?.removeTriggerOnDismiss,
85
- renderSlashCommandItem: h?.renderItem,
86
- renderSlashCommandDropdown: h?.renderDropdown
85
+ renderSlashCommandItem: C?.renderItem,
86
+ renderSlashCommandDropdown: C?.renderDropdown
87
87
  }),
88
88
  content: ft,
89
89
  editable: !ot,
@@ -91,13 +91,13 @@ const wt = (y, v) => {
91
91
  // SSR-safe — NEVER remove this
92
92
  editorProps: {
93
93
  attributes: {
94
- ...F ? { class: F } : {},
95
- ...J ? { style: jt(J) } : {}
94
+ ...J ? { class: J } : {},
95
+ ...F ? { style: jt(F) } : {}
96
96
  }
97
97
  },
98
98
  onUpdate: ({ editor: t }) => {
99
99
  if (P.current?.(et(t)), m) {
100
- const e = g(d(t));
100
+ const e = p(d(t));
101
101
  j(e.valid ? null : e);
102
102
  }
103
103
  },
@@ -111,13 +111,13 @@ const wt = (y, v) => {
111
111
  function s(t) {
112
112
  n ? t(n) : A.current.push(t);
113
113
  }
114
- xt(() => {
115
- if (n && (A.current.length > 0 && A.current.splice(0).forEach((e) => e(n)), H.current || (H.current = !0, N.current?.()), m)) {
116
- const t = g(d(n));
114
+ bt(() => {
115
+ if (n && (A.current.length > 0 && A.current.splice(0).forEach((e) => e(n)), H.current || (H.current = !0, w.current?.()), m)) {
116
+ const t = p(d(n));
117
117
  j(t.valid ? null : t);
118
118
  }
119
- }, [n, m]), vt(
120
- v,
119
+ }, [n, m]), xt(
120
+ x,
121
121
  () => ({
122
122
  // ── Focus ────────────────────────────────────────────────────────
123
123
  focus: (t) => s((e) => e.commands.focus(t)),
@@ -304,16 +304,16 @@ const wt = (y, v) => {
304
304
  // ── JSON body ─────────────────────────────────────────────────────
305
305
  json: B?.jsonMode ? {
306
306
  getText: () => n ? d(n) : "",
307
- setText: (t) => s((e) => x(e, t)),
308
- parse: () => g(n ? d(n) : ""),
309
- isValid: () => g(n ? d(n) : "").valid,
307
+ setText: (t) => s((e) => b(e, t)),
308
+ parse: () => p(n ? d(n) : ""),
309
+ isValid: () => p(n ? d(n) : "").valid,
310
310
  format: (t = 2) => s((e) => {
311
- const { valid: o, value: r } = g(d(e));
312
- !o || r === null || x(e, JSON.stringify(r, null, t));
311
+ const { valid: o, value: r } = p(d(e));
312
+ !o || r === null || b(e, JSON.stringify(r, null, t));
313
313
  }),
314
314
  minify: () => s((t) => {
315
- const { valid: e, value: o } = g(d(t));
316
- !e || o === null || x(t, JSON.stringify(o));
315
+ const { valid: e, value: o } = p(d(t));
316
+ !e || o === null || b(t, JSON.stringify(o));
317
317
  })
318
318
  } : void 0
319
319
  }),
@@ -322,13 +322,13 @@ const wt = (y, v) => {
322
322
  );
323
323
  const gt = () => {
324
324
  if (!n) return;
325
- const { valid: t, value: e } = g(d(n));
326
- !t || e === null || x(n, JSON.stringify(e, null, 2));
325
+ const { valid: t, value: e } = p(d(n));
326
+ !t || e === null || b(n, JSON.stringify(e, null, 2));
327
327
  }, ht = () => {
328
- n && (navigator.clipboard?.writeText(d(n)), w(!0), setTimeout(() => w(!1), 1500));
328
+ n && (navigator.clipboard?.writeText(d(n)), z(!0), setTimeout(() => z(!1), 1500));
329
329
  };
330
- return n ? /* @__PURE__ */ p(
331
- bt,
330
+ return n ? /* @__PURE__ */ g(
331
+ vt,
332
332
  {
333
333
  minHeight: at,
334
334
  maxHeight: lt,
@@ -337,39 +337,32 @@ const wt = (y, v) => {
337
337
  style: dt,
338
338
  className: ut,
339
339
  children: [
340
- /* @__PURE__ */ C(yt, { editor: n }),
341
- m && /* @__PURE__ */ p(At, { children: [
342
- /* @__PURE__ */ p(
343
- "button",
344
- {
345
- type: "button",
346
- onClick: gt,
347
- disabled: !!u,
348
- title: "Format JSON",
349
- style: { padding: 8 },
350
- children: [
351
- /* @__PURE__ */ C(Jt, { size: 16 }),
352
- /* @__PURE__ */ C(K, { children: " Beautify " })
353
- ]
354
- }
355
- ),
356
- /* @__PURE__ */ p(
357
- "button",
358
- {
359
- type: "button",
360
- onClick: ht,
361
- title: "Copy JSON",
362
- style: { padding: 8 },
363
- children: [
364
- /* @__PURE__ */ C(zt, { size: 16 }),
365
- mt && /* @__PURE__ */ C(K, { children: " Copied " })
366
- ]
367
- }
368
- )
340
+ m && /* @__PURE__ */ g(At, { children: [
341
+ /* @__PURE__ */ h("span", { className: "bik-json-header-label", children: "JSON" }),
342
+ /* @__PURE__ */ g("div", { className: "bik-json-header-actions", children: [
343
+ /* @__PURE__ */ g(
344
+ "button",
345
+ {
346
+ type: "button",
347
+ onClick: gt,
348
+ disabled: !!u,
349
+ title: "Format JSON",
350
+ children: [
351
+ /* @__PURE__ */ h(Ft, { size: 16 }),
352
+ /* @__PURE__ */ h(K, { children: "Beautify" })
353
+ ]
354
+ }
355
+ ),
356
+ /* @__PURE__ */ g("button", { type: "button", onClick: ht, title: "Copy JSON", children: [
357
+ /* @__PURE__ */ h(Nt, { size: 16 }),
358
+ mt && /* @__PURE__ */ h(K, { children: "Copied" })
359
+ ] })
360
+ ] })
369
361
  ] }),
370
- /* @__PURE__ */ C(Ft, { editor: n, renderLinkTooltip: it?.renderTooltip }),
371
- m && u ? z ? z(u) : /* @__PURE__ */ p(Tt, { children: [
372
- u.line != null && /* @__PURE__ */ p("strong", { children: [
362
+ /* @__PURE__ */ h(yt, { editor: n }),
363
+ /* @__PURE__ */ h(Jt, { editor: n, renderLinkTooltip: it?.renderTooltip }),
364
+ m && u ? N ? N(u) : /* @__PURE__ */ g(Tt, { children: [
365
+ u.line != null && /* @__PURE__ */ g("strong", { children: [
373
366
  "Line ",
374
367
  u.line,
375
368
  u.column != null ? `, column ${u.column}` : "",
@@ -382,7 +375,7 @@ const wt = (y, v) => {
382
375
  }
383
376
  ) : null;
384
377
  }, Ht = Bt(
385
- wt
378
+ zt
386
379
  );
387
380
  Ht.displayName = "BikEditor";
388
381
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"BikEditor.js","sources":["../../../src/editor/BikEditor.tsx"],"sourcesContent":["'use client';\n\n/**\n * IMPLEMENTATION LAYER — TipTap-specific.\n * If the underlying editor is swapped, this file changes; BikEditor.types.ts and\n * src/editor/index.ts (the consumer contract) do NOT change.\n */\nimport { Editor, getMarkRange } from '@tiptap/core';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { Copy, WandSparkles } from '../icons';\nimport {\n\tBikEditorShell,\n\tBikJsonActions,\n\tBikJsonError,\n} from './BikEditor.styles';\nimport {\n\tBikEditorProps,\n\tBikEditorRef,\n\tDEFAULT_FORMAT_STATE,\n\tFormatState,\n\tJsonParseResult,\n} from './BikEditor.types';\nimport {\n\tbuildJsonCodeBlockHtml,\n\tbuildSectionedContent,\n\textractActiveFormats,\n\textractBodyContent,\n\textractContent,\n\textractSectionContent,\n\tfindSectionEndPos,\n\tfindSectionStartPos,\n\tgetCodeBlockText,\n\tinsertInlineHtml,\n\tnormalizeHtml,\n\tparseJson,\n\tsetCodeBlockText,\n\tsetSectionContentInEditor,\n} from './BikEditor.utils';\nimport { buildExtensions } from './extensions/buildExtensions';\nimport { LinkBubbleMenu } from './floating/LinkBubbleMenu';\n\n/** Convert React.CSSProperties to an inline CSS string for editorProps.attributes. */\nfunction cssToString(style: React.CSSProperties): string {\n\treturn Object.entries(style)\n\t\t.map(\n\t\t\t([k, v]) => `${k.replace(/([A-Z])/g, (c) => `-${c.toLowerCase()}`)}:${v}`,\n\t\t)\n\t\t.join(';');\n}\n\nconst BikEditorInner = (\n\tprops: BikEditorProps,\n\tref: React.Ref<BikEditorRef>,\n) => {\n\tconst {\n\t\tinitialContent,\n\t\tsections,\n\t\tfeatures,\n\t\tdisabled,\n\t\tmaxCharacters,\n\t\tshortcuts,\n\t\tsendShortcut,\n\t\tmentions,\n\t\tslashCommands,\n\t\tlink,\n\t\tonPaste,\n\t\tonReady,\n\t\tonChange,\n\t\tonSend,\n\t\tonFocus,\n\t\tonBlur,\n\t\tonSelectionChange,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tstyle,\n\t\tclassName,\n\t\teditorClassName,\n\t\teditorStyle,\n\t\trenderJsonError,\n\t} = props;\n\n\tconst isJsonMode = !!features?.jsonMode;\n\n\t// Live JSON parse error, shown inside the editor when jsonMode is on.\n\t// null = valid (or not applicable) → nothing rendered.\n\tconst [jsonError, setJsonError] = useState<JsonParseResult | null>(null);\n\t// Transient \"Copied\" state for the jsonMode copy button.\n\tconst [jsonCopied, setJsonCopied] = useState(false);\n\n\t// JSON body mode: treat initialContent as raw JSON text and wrap it in a code\n\t// block. Skips section/HTML normalisation entirely.\n\tconst initialEditorContent = isJsonMode\n\t\t? buildJsonCodeBlockHtml(initialContent ?? '')\n\t\t: sections?.length\n\t\t? buildSectionedContent(\n\t\t\t\tnormalizeHtml(initialContent ?? ''),\n\t\t\t\tsections.map((s) => ({ ...s, content: normalizeHtml(s.content) })),\n\t\t )\n\t\t: normalizeHtml(initialContent ?? '');\n\n\t// ── Command queue ─────────────────────────────────────────────────────────\n\t// TipTap's useEditor initializes asynchronously; the editor instance is null\n\t// until the first commit. Any imperative method called before the editor is\n\t// ready is enqueued here and flushed automatically once it becomes non-null.\n\t// Consumers never need setTimeout or readiness guards.\n\tconst pendingQueue = useRef<Array<(e: Editor) => void>>([]);\n\tconst hasCalledOnReady = useRef(false);\n\t// Keep stable refs to all callbacks so useEditor receives the same function\n\t// identity on every render — prevents TipTap from re-registering event\n\t// handlers every time the parent re-renders with new inline function props.\n\tconst onReadyRef = useRef(onReady);\n\tonReadyRef.current = onReady;\n\tconst onChangeRef = useRef(onChange);\n\tonChangeRef.current = onChange;\n\tconst onSelectionChangeRef = useRef(onSelectionChange);\n\tonSelectionChangeRef.current = onSelectionChange;\n\tconst prevFormatsRef = useRef<FormatState>(DEFAULT_FORMAT_STATE);\n\tconst onFocusRef = useRef(onFocus);\n\tonFocusRef.current = onFocus;\n\tconst onBlurRef = useRef(onBlur);\n\tonBlurRef.current = onBlur;\n\tconst onSendRef = useRef(onSend);\n\tonSendRef.current = onSend;\n\tconst agentMentionsRef = useRef(mentions?.agents ?? []);\n\tagentMentionsRef.current = mentions?.agents ?? [];\n\tconst teamMentionsRef = useRef(mentions?.teams ?? []);\n\tteamMentionsRef.current = mentions?.teams ?? [];\n\tconst slashCommandsRef = useRef(slashCommands?.items ?? []);\n\tslashCommandsRef.current = slashCommands?.items ?? [];\n\n\tconst editor = useEditor({\n\t\textensions: buildExtensions({\n\t\t\tfeatures,\n\t\t\tplaceholder: props.placeholder,\n\t\t\tmaxCharacters,\n\t\t\thasSections: (sections?.length ?? 0) > 0,\n\t\t\tmentions: {\n\t\t\t\tagents: mentions ? agentMentionsRef : undefined,\n\t\t\t\tteams: mentions ? teamMentionsRef : undefined,\n\t\t\t},\n\t\t\tslashCommands: slashCommands ? slashCommandsRef : undefined,\n\t\t\tonPaste,\n\t\t\tonSend: onSend ? (snapshot) => onSendRef.current?.(snapshot) : undefined,\n\t\t\tsendShortcut,\n\t\t\tshortcuts,\n\t\t\tonMentionSelected: mentions?.onSelect,\n\t\t\tonSlashCommandSelected: slashCommands?.onSelect,\n\t\t\trenderMentionItem: mentions?.renderItem,\n\t\t\trenderMentionDropdown: mentions?.renderDropdown,\n\t\t\tremoveMentionTriggerOnDismiss: mentions?.removeTriggerOnDismiss,\n\t\t\trenderSlashCommandItem: slashCommands?.renderItem,\n\t\t\trenderSlashCommandDropdown: slashCommands?.renderDropdown,\n\t\t}),\n\t\tcontent: initialEditorContent,\n\t\teditable: !disabled,\n\t\timmediatelyRender: false, // SSR-safe — NEVER remove this\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\t...(editorClassName ? { class: editorClassName } : {}),\n\t\t\t\t...(editorStyle ? { style: cssToString(editorStyle) } : {}),\n\t\t\t},\n\t\t},\n\t\tonUpdate: ({ editor: e }) => {\n\t\t\tonChangeRef.current?.(extractContent(e));\n\t\t\tif (isJsonMode) {\n\t\t\t\tconst result = parseJson(getCodeBlockText(e));\n\t\t\t\tsetJsonError(result.valid ? null : result);\n\t\t\t}\n\t\t},\n\t\tonTransaction: ({ editor: e }) => {\n\t\t\tconst next = extractActiveFormats(e);\n\t\t\tconst prev = prevFormatsRef.current;\n\t\t\tconst changed =\n\t\t\t\tprev.bold !== next.bold ||\n\t\t\t\tprev.italic !== next.italic ||\n\t\t\t\tprev.underline !== next.underline ||\n\t\t\t\tprev.strike !== next.strike ||\n\t\t\t\tprev.bulletList !== next.bulletList ||\n\t\t\t\tprev.orderedList !== next.orderedList ||\n\t\t\t\tprev.blockquote !== next.blockquote ||\n\t\t\t\tprev.codeBlock !== next.codeBlock ||\n\t\t\t\tprev.superscript !== next.superscript ||\n\t\t\t\tprev.subscript !== next.subscript ||\n\t\t\t\tprev.textAlign !== next.textAlign ||\n\t\t\t\tprev.fontFamily !== next.fontFamily ||\n\t\t\t\tprev.fontSize !== next.fontSize ||\n\t\t\t\tprev.color !== next.color ||\n\t\t\t\tprev.highlight !== next.highlight ||\n\t\t\t\tprev.link?.href !== next.link?.href;\n\t\t\tif (changed) {\n\t\t\t\tprevFormatsRef.current = next;\n\t\t\t\tonSelectionChangeRef.current?.(next);\n\t\t\t}\n\t\t},\n\t\tonFocus: () => onFocusRef.current?.(),\n\t\tonBlur: () => onBlurRef.current?.(),\n\t});\n\n\t// ── enqueue ───────────────────────────────────────────────────────────────\n\t// Run immediately if the editor is ready; otherwise defer to the queue.\n\t// Closures passed to enqueue MUST capture all parameters explicitly —\n\t// they must NOT close over `editor` (which would be null at enqueue time).\n\tfunction enqueue(op: (e: Editor) => void): void {\n\t\tif (editor) {\n\t\t\top(editor);\n\t\t} else {\n\t\t\tpendingQueue.current.push(op);\n\t\t}\n\t}\n\n\t// Flush the pending queue and fire onReady when editor transitions null → ready.\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\t\tif (pendingQueue.current.length > 0) {\n\t\t\tconst queue = pendingQueue.current.splice(0);\n\t\t\tqueue.forEach((op) => op(editor));\n\t\t}\n\t\tif (!hasCalledOnReady.current) {\n\t\t\thasCalledOnReady.current = true;\n\t\t\tonReadyRef.current?.();\n\t\t}\n\t\t// Surface an error for invalid initialContent immediately on mount.\n\t\tif (isJsonMode) {\n\t\t\tconst result = parseJson(getCodeBlockText(editor));\n\t\t\tsetJsonError(result.valid ? null : result);\n\t\t}\n\t}, [editor, isJsonMode]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\t// ── Focus ────────────────────────────────────────────────────────\n\t\t\tfocus: (position) => enqueue((e) => e.commands.focus(position)),\n\t\t\tblur: () => enqueue((e) => e.commands.blur()),\n\n\t\t\t// ── Content ──────────────────────────────────────────────────────\n\t\t\tclearContent: () => enqueue((e) => e.commands.clearContent(true)),\n\t\t\tsetContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.setContent(normalised, { emitUpdate: true }));\n\t\t\t},\n\t\t\tinsertContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContent(normalised));\n\t\t\t},\n\t\t\tinsertInlineContent: (html) => {\n\t\t\t\tenqueue((e) => insertInlineHtml(e, html));\n\t\t\t},\n\t\t\tinsertAtStart: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(1, normalised));\n\t\t\t},\n\t\t\tinsertBlock: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\tappendInline: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// doc.content.size is after the last </p> (block boundary).\n\t\t\t\t// Subtract 1 to land inside the last paragraph so text appends\n\t\t\t\t// inline rather than being wrapped in a new paragraph each call.\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size - 1, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\t// Backwards-compatible aliases\n\t\t\tinsertAtEnd(html) {\n\t\t\t\tthis.insertBlock(html);\n\t\t\t},\n\t\t\tappendContent(html) {\n\t\t\t\tthis.appendInline(html);\n\t\t\t},\n\t\t\tgetContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tgetJSON: () => editor?.getJSON() ?? null,\n\t\t\tgetMentions: () => {\n\t\t\t\tconst agentIds = new Set<string>();\n\t\t\t\tconst teamIds = new Set<string>();\n\t\t\t\tif (!editor) return { agentIds: [], teamIds: [] };\n\t\t\t\teditor.state.doc.descendants((node) => {\n\t\t\t\t\tif (node.type.name === 'mentionAgent' && node.attrs['id'] != null) {\n\t\t\t\t\t\tagentIds.add(String(node.attrs['id']));\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tnode.type.name === 'mentionTeam' &&\n\t\t\t\t\t\tnode.attrs['id'] != null\n\t\t\t\t\t) {\n\t\t\t\t\t\tteamIds.add(String(node.attrs['id']));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn { agentIds: Array.from(agentIds), teamIds: Array.from(teamIds) };\n\t\t\t},\n\n\t\t\t// ── Selection ────────────────────────────────────────────────────\n\t\t\tgetCursorPosition: () => {\n\t\t\t\tif (!editor) return { from: 0, to: 0 };\n\t\t\t\tconst { from, to } = editor.state.selection;\n\t\t\t\treturn { from, to };\n\t\t\t},\n\t\t\tinsertAtPosition: (pos, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(pos, normalised));\n\t\t\t},\n\t\t\tgetSelectedText: () => {\n\t\t\t\tif (!editor) return '';\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { from, to, empty } = state.selection;\n\t\t\t\tif (!empty) {\n\t\t\t\t\treturn state.doc.textBetween(from, to, ' ');\n\t\t\t\t}\n\t\t\t\t// When the cursor is inside a link with nothing selected, return the\n\t\t\t\t// full link text — useful for pre-filling a link modal's text field.\n\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\tif (linkMarkType) {\n\t\t\t\t\tconst range = getMarkRange(state.doc.resolve(from), linkMarkType);\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\treturn state.doc.textBetween(range.from, range.to, ' ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t},\n\n\t\t\t// ── Character count ───────────────────────────────────────────────\n\t\t\tgetCharacterCount: () => ({\n\t\t\t\tcount:\n\t\t\t\t\teditor?.storage.characterCount?.characters?.() ??\n\t\t\t\t\teditor?.getText().length ??\n\t\t\t\t\t0,\n\t\t\t\tlimit: maxCharacters ?? null,\n\t\t\t}),\n\n\t\t\t// ── Sections ─────────────────────────────────────────────────────\n\t\t\tgetSectionContent: (sectionId) =>\n\t\t\t\teditor\n\t\t\t\t\t? extractSectionContent(editor, sectionId)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\n\t\t\tsetSectionContent: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, normalised));\n\t\t\t},\n\n\t\t\tfocusSection: (sectionId) => {\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tif (sectionId === 'body') {\n\t\t\t\t\t\tlet endOfBody = e.state.doc.content.size - 1;\n\t\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\t\tendOfBody === e.state.doc.content.size - 1\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tendOfBody = pos - 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn endOfBody === e.state.doc.content.size - 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (endOfBody < 1) endOfBody = 1;\n\t\t\t\t\t\te.chain().focus().setTextSelection(endOfBody).run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet targetPos = -1;\n\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\tif (targetPos !== -1) return false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// pos + nodeSize lands right after the divider;\n\t\t\t\t\t\t\t// +1 more puts us inside the first paragraph of that section.\n\t\t\t\t\t\t\ttargetPos = pos + node.nodeSize + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (targetPos !== -1) {\n\t\t\t\t\t\te.chain().focus().setTextSelection(targetPos).run();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tclearSection: (sectionId) => {\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, '<p></p>'));\n\t\t\t},\n\n\t\t\t// ── Convenience body shorthands ───────────────────────────────────\n\t\t\tgetBodyContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractBodyContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tsetBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, 'body', normalised));\n\t\t\t},\n\t\t\tsetBodyAndSections: (body, sections) => {\n\t\t\t\tconst html = buildSectionedContent(\n\t\t\t\t\tnormalizeHtml(body),\n\t\t\t\t\tsections.map((s) => ({\n\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\tcontent: normalizeHtml(s.content),\n\t\t\t\t\t})),\n\t\t\t\t);\n\t\t\t\tenqueue((e) => e.commands.setContent(html, { emitUpdate: true }));\n\t\t\t},\n\t\t\tappendBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// findSectionEndPos returns the position of the first divider (or\n\t\t\t\t// doc.content.size), which is the block boundary after the last </p>.\n\t\t\t\t// Subtract 1 to stay inside the last paragraph so successive calls\n\t\t\t\t// append inline text rather than creating a new paragraph each time.\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst boundaryPos = findSectionEndPos(e, 'body');\n\t\t\t\t\te.commands.insertContentAt(boundaryPos - 1, normalised, {\n\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionStart: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionStartPos(e, sectionId);\n\t\t\t\t\tif (pos !== -1)\n\t\t\t\t\t\te.commands.insertContentAt(pos, normalised, {\n\t\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionEnd: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionEndPos(e, sectionId);\n\t\t\t\t\te.commands.insertContentAt(pos, normalised, {\n\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\t// ── Formats & actions ─────────────────────────────────────────────\n\t\t\tgetActiveFormats: () =>\n\t\t\t\teditor ? extractActiveFormats(editor) : DEFAULT_FORMAT_STATE,\n\t\t\tactions: {\n\t\t\t\ttoggleBold: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t\ttoggleItalic: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t\ttoggleUnderline: () => editor?.chain().focus().toggleUnderline().run(),\n\t\t\t\ttoggleStrike: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t\ttoggleBulletList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBulletList().run(),\n\t\t\t\ttoggleOrderedList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleOrderedList().run(),\n\t\t\t\ttoggleBlockquote: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBlockquote().run(),\n\t\t\t\ttoggleCodeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n\t\t\t\tsetTextAlign: (align) =>\n\t\t\t\t\teditor?.chain().focus().setTextAlign(align).run(),\n\t\t\t\tsetFontFamily: (font) =>\n\t\t\t\t\teditor?.chain().focus().setFontFamily(font).run(),\n\t\t\t\tsetFontSize: (size) => editor?.chain().focus().setFontSize(size).run(),\n\t\t\t\tsetColor: (color) => editor?.chain().focus().setColor(color).run(),\n\t\t\t\tsetHighlight: (color) =>\n\t\t\t\t\teditor?.chain().focus().toggleHighlight({ color }).run(),\n\t\t\t\tunsetColor: () => editor?.chain().focus().unsetColor().run(),\n\t\t\t\tunsetHighlight: () => editor?.chain().focus().unsetHighlight().run(),\n\t\t\t\tsetLink: (href, text) => {\n\t\t\t\t\tif (!editor) return;\n\t\t\t\t\tif (text !== undefined) {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.command(({ tr, state }) => {\n\t\t\t\t\t\t\t\tconst { from, to } = tr.selection;\n\t\t\t\t\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\t\t\t\t\tif (!linkMarkType) return false;\n\t\t\t\t\t\t\t\tconst linkNode = state.schema.text(text, [\n\t\t\t\t\t\t\t\t\tlinkMarkType.create({ href }),\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\tconst space = state.schema.text(' ');\n\t\t\t\t\t\t\t\ttr.replaceWith(from, to, [linkNode, space]);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t\t.insertContent(' ')\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tupdateLink: (href) =>\n\t\t\t\t\teditor\n\t\t\t\t\t\t?.chain()\n\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t.run(),\n\t\t\t\tremoveLink: () =>\n\t\t\t\t\teditor?.chain().focus().extendMarkRange('link').unsetLink().run(),\n\t\t\t\tinsertEmoji: (emoji) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(emoji).run(),\n\t\t\t\tinsertVariable: (variableName) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(`{{${variableName}}}`).run(),\n\t\t\t\tinsertHtml: (html) =>\n\t\t\t\t\teditor?.commands.insertContent(normalizeHtml(html)),\n\t\t\t\tundo: () => editor?.chain().focus().undo().run(),\n\t\t\t\tredo: () => editor?.chain().focus().redo().run(),\n\t\t\t\tcanUndo: () => editor?.can().undo() ?? false,\n\t\t\t\tcanRedo: () => editor?.can().redo() ?? false,\n\t\t\t\ttoggleSuperscript: () =>\n\t\t\t\t\teditor?.chain().focus().toggleSuperscript().run(),\n\t\t\t\ttoggleSubscript: () => editor?.chain().focus().toggleSubscript().run(),\n\t\t\t\tinsertImage: (src) => editor?.chain().focus().setImage({ src }).run(),\n\t\t\t},\n\n\t\t\t// ── JSON body ─────────────────────────────────────────────────────\n\t\t\tjson: features?.jsonMode\n\t\t\t\t? {\n\t\t\t\t\t\tgetText: () => (editor ? getCodeBlockText(editor) : ''),\n\t\t\t\t\t\tsetText: (raw) => enqueue((e) => setCodeBlockText(e, raw)),\n\t\t\t\t\t\tparse: () => parseJson(editor ? getCodeBlockText(editor) : ''),\n\t\t\t\t\t\tisValid: () =>\n\t\t\t\t\t\t\tparseJson(editor ? getCodeBlockText(editor) : '').valid,\n\t\t\t\t\t\tformat: (indent = 2) =>\n\t\t\t\t\t\t\tenqueue((e) => {\n\t\t\t\t\t\t\t\tconst { valid, value } = parseJson(getCodeBlockText(e));\n\t\t\t\t\t\t\t\tif (!valid || value === null) return;\n\t\t\t\t\t\t\t\tsetCodeBlockText(e, JSON.stringify(value, null, indent));\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\tminify: () =>\n\t\t\t\t\t\t\tenqueue((e) => {\n\t\t\t\t\t\t\t\tconst { valid, value } = parseJson(getCodeBlockText(e));\n\t\t\t\t\t\t\t\tif (!valid || value === null) return;\n\t\t\t\t\t\t\t\tsetCodeBlockText(e, JSON.stringify(value));\n\t\t\t\t\t\t\t}),\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\t}),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[editor],\n\t);\n\n\t// ── jsonMode floating actions ────────────────────────────────────────────\n\t// Beautify pretty-prints in place (no-op / disabled while the JSON is broken);\n\t// Copy writes the raw text to the clipboard with transient feedback.\n\tconst handleJsonBeautify = () => {\n\t\tif (!editor) return;\n\t\tconst { valid, value } = parseJson(getCodeBlockText(editor));\n\t\tif (!valid || value === null) return;\n\t\tsetCodeBlockText(editor, JSON.stringify(value, null, 2));\n\t};\n\tconst handleJsonCopy = () => {\n\t\tif (!editor) return;\n\t\tvoid navigator.clipboard?.writeText(getCodeBlockText(editor));\n\t\tsetJsonCopied(true);\n\t\tsetTimeout(() => setJsonCopied(false), 1500);\n\t};\n\n\tif (!editor) return null;\n\n\treturn (\n\t\t<BikEditorShell\n\t\t\tminHeight={minHeight}\n\t\t\tmaxHeight={maxHeight}\n\t\t\ttightParagraphs={!features?.richPaste}\n\t\t\tjsonMode={isJsonMode}\n\t\t\tstyle={style}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t<EditorContent editor={editor} />\n\t\t\t{isJsonMode && (\n\t\t\t\t<BikJsonActions>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleJsonBeautify}\n\t\t\t\t\t\tdisabled={!!jsonError}\n\t\t\t\t\t\ttitle=\"Format JSON\"\n\t\t\t\t\t\tstyle={{ padding: 8 }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<WandSparkles size={16} />\n\t\t\t\t\t\t<BodyCaption> Beautify </BodyCaption>\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleJsonCopy}\n\t\t\t\t\t\ttitle=\"Copy JSON\"\n\t\t\t\t\t\tstyle={{ padding: 8 }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Copy size={16} />\n\t\t\t\t\t\t{jsonCopied && <BodyCaption> Copied </BodyCaption>}\n\t\t\t\t\t</button>\n\t\t\t\t</BikJsonActions>\n\t\t\t)}\n\t\t\t<LinkBubbleMenu editor={editor} renderLinkTooltip={link?.renderTooltip} />\n\t\t\t{isJsonMode && jsonError ? (\n\t\t\t\trenderJsonError ? (\n\t\t\t\t\trenderJsonError(jsonError)\n\t\t\t\t) : (\n\t\t\t\t\t<BikJsonError>\n\t\t\t\t\t\t{jsonError.line != null && (\n\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\tLine {jsonError.line}\n\t\t\t\t\t\t\t\t{jsonError.column != null ? `, column ${jsonError.column}` : ''}\n\t\t\t\t\t\t\t\t:{' '}\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{jsonError.error}\n\t\t\t\t\t</BikJsonError>\n\t\t\t\t)\n\t\t\t) : null}\n\t\t</BikEditorShell>\n\t);\n};\n\nexport const BikEditor = forwardRef<BikEditorRef, BikEditorProps>(\n\tBikEditorInner,\n);\nBikEditor.displayName = 'BikEditor';\n"],"names":["cssToString","style","k","v","c","BikEditorInner","props","ref","initialContent","sections","features","disabled","maxCharacters","shortcuts","sendShortcut","mentions","slashCommands","link","onPaste","onReady","onChange","onSend","onFocus","onBlur","onSelectionChange","minHeight","maxHeight","className","editorClassName","editorStyle","renderJsonError","isJsonMode","jsonError","setJsonError","useState","jsonCopied","setJsonCopied","initialEditorContent","buildJsonCodeBlockHtml","buildSectionedContent","normalizeHtml","s","pendingQueue","useRef","hasCalledOnReady","onReadyRef","onChangeRef","onSelectionChangeRef","prevFormatsRef","DEFAULT_FORMAT_STATE","onFocusRef","onBlurRef","onSendRef","agentMentionsRef","teamMentionsRef","slashCommandsRef","editor","useEditor","buildExtensions","snapshot","e","extractContent","result","parseJson","getCodeBlockText","next","extractActiveFormats","prev","enqueue","op","useEffect","useImperativeHandle","position","html","normalised","insertInlineHtml","agentIds","teamIds","node","from","to","pos","state","empty","linkMarkType","range","getMarkRange","sectionId","extractSectionContent","setSectionContentInEditor","endOfBody","targetPos","extractBodyContent","body","boundaryPos","findSectionEndPos","findSectionStartPos","align","font","size","color","href","text","tr","linkNode","space","emoji","variableName","src","raw","setCodeBlockText","indent","valid","value","handleJsonBeautify","handleJsonCopy","jsxs","BikEditorShell","jsx","EditorContent","BikJsonActions","WandSparkles","BodyCaption","Copy","LinkBubbleMenu","BikJsonError","BikEditor","forwardRef"],"mappings":";;;;;;;;;;;;AAkDA,SAASA,GAAYC,GAAoC;AACxD,SAAO,OAAO,QAAQA,CAAK,EACzB;AAAA,IACA,CAAC,CAACC,GAAGC,CAAC,MAAM,GAAGD,EAAE,QAAQ,YAAY,CAACE,MAAM,IAAIA,EAAE,YAAA,CAAa,EAAE,CAAC,IAAID,CAAC;AAAA,EAAA,EAEvE,KAAK,GAAG;AACX;AAEA,MAAME,KAAiB,CACtBC,GACAC,MACI;AACJ,QAAM;AAAA,IACL,gBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,Q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,UAAU,OAAO,YAAYA,EAAU,MAAM,KAAK;AAAA,YAAG;AAAA,YAC9D;AAAA,UAAA,GACH;AAAA,UAEAA,EAAU;AAAA,QAAA,EAAA,CACZ,IAEE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAnDc;AAsDrB,GAEa8F,KAAYC;AAAA,EACxB1H;AACD;AACAyH,GAAU,cAAc;"}
1
+ {"version":3,"file":"BikEditor.js","sources":["../../../src/editor/BikEditor.tsx"],"sourcesContent":["'use client';\n\n/**\n * IMPLEMENTATION LAYER — TipTap-specific.\n * If the underlying editor is swapped, this file changes; BikEditor.types.ts and\n * src/editor/index.ts (the consumer contract) do NOT change.\n */\nimport { Editor, getMarkRange } from '@tiptap/core';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport React, {\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { BodyCaption } from '@src/components/TypographyStyle';\nimport { Copy, WandSparkles } from '../icons';\nimport {\n\tBikEditorShell,\n\tBikJsonError,\n\tBikJsonHeader,\n} from './BikEditor.styles';\nimport {\n\tBikEditorProps,\n\tBikEditorRef,\n\tDEFAULT_FORMAT_STATE,\n\tFormatState,\n\tJsonParseResult,\n} from './BikEditor.types';\nimport {\n\tbuildJsonCodeBlockHtml,\n\tbuildSectionedContent,\n\textractActiveFormats,\n\textractBodyContent,\n\textractContent,\n\textractSectionContent,\n\tfindSectionEndPos,\n\tfindSectionStartPos,\n\tgetCodeBlockText,\n\tinsertInlineHtml,\n\tnormalizeHtml,\n\tparseJson,\n\tsetCodeBlockText,\n\tsetSectionContentInEditor,\n} from './BikEditor.utils';\nimport { buildExtensions } from './extensions/buildExtensions';\nimport { LinkBubbleMenu } from './floating/LinkBubbleMenu';\n\n/** Convert React.CSSProperties to an inline CSS string for editorProps.attributes. */\nfunction cssToString(style: React.CSSProperties): string {\n\treturn Object.entries(style)\n\t\t.map(\n\t\t\t([k, v]) => `${k.replace(/([A-Z])/g, (c) => `-${c.toLowerCase()}`)}:${v}`,\n\t\t)\n\t\t.join(';');\n}\n\nconst BikEditorInner = (\n\tprops: BikEditorProps,\n\tref: React.Ref<BikEditorRef>,\n) => {\n\tconst {\n\t\tinitialContent,\n\t\tsections,\n\t\tfeatures,\n\t\tdisabled,\n\t\tmaxCharacters,\n\t\tshortcuts,\n\t\tsendShortcut,\n\t\tmentions,\n\t\tslashCommands,\n\t\tlink,\n\t\tonPaste,\n\t\tonReady,\n\t\tonChange,\n\t\tonSend,\n\t\tonFocus,\n\t\tonBlur,\n\t\tonSelectionChange,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\tstyle,\n\t\tclassName,\n\t\teditorClassName,\n\t\teditorStyle,\n\t\trenderJsonError,\n\t} = props;\n\n\tconst isJsonMode = !!features?.jsonMode;\n\n\t// Live JSON parse error, shown inside the editor when jsonMode is on.\n\t// null = valid (or not applicable) → nothing rendered.\n\tconst [jsonError, setJsonError] = useState<JsonParseResult | null>(null);\n\t// Transient \"Copied\" state for the jsonMode copy button.\n\tconst [jsonCopied, setJsonCopied] = useState(false);\n\n\t// JSON body mode: treat initialContent as raw JSON text and wrap it in a code\n\t// block. Skips section/HTML normalisation entirely.\n\tconst initialEditorContent = isJsonMode\n\t\t? buildJsonCodeBlockHtml(initialContent ?? '')\n\t\t: sections?.length\n\t\t? buildSectionedContent(\n\t\t\t\tnormalizeHtml(initialContent ?? ''),\n\t\t\t\tsections.map((s) => ({ ...s, content: normalizeHtml(s.content) })),\n\t\t )\n\t\t: normalizeHtml(initialContent ?? '');\n\n\t// ── Command queue ─────────────────────────────────────────────────────────\n\t// TipTap's useEditor initializes asynchronously; the editor instance is null\n\t// until the first commit. Any imperative method called before the editor is\n\t// ready is enqueued here and flushed automatically once it becomes non-null.\n\t// Consumers never need setTimeout or readiness guards.\n\tconst pendingQueue = useRef<Array<(e: Editor) => void>>([]);\n\tconst hasCalledOnReady = useRef(false);\n\t// Keep stable refs to all callbacks so useEditor receives the same function\n\t// identity on every render — prevents TipTap from re-registering event\n\t// handlers every time the parent re-renders with new inline function props.\n\tconst onReadyRef = useRef(onReady);\n\tonReadyRef.current = onReady;\n\tconst onChangeRef = useRef(onChange);\n\tonChangeRef.current = onChange;\n\tconst onSelectionChangeRef = useRef(onSelectionChange);\n\tonSelectionChangeRef.current = onSelectionChange;\n\tconst prevFormatsRef = useRef<FormatState>(DEFAULT_FORMAT_STATE);\n\tconst onFocusRef = useRef(onFocus);\n\tonFocusRef.current = onFocus;\n\tconst onBlurRef = useRef(onBlur);\n\tonBlurRef.current = onBlur;\n\tconst onSendRef = useRef(onSend);\n\tonSendRef.current = onSend;\n\tconst agentMentionsRef = useRef(mentions?.agents ?? []);\n\tagentMentionsRef.current = mentions?.agents ?? [];\n\tconst teamMentionsRef = useRef(mentions?.teams ?? []);\n\tteamMentionsRef.current = mentions?.teams ?? [];\n\tconst slashCommandsRef = useRef(slashCommands?.items ?? []);\n\tslashCommandsRef.current = slashCommands?.items ?? [];\n\n\tconst editor = useEditor({\n\t\textensions: buildExtensions({\n\t\t\tfeatures,\n\t\t\tplaceholder: props.placeholder,\n\t\t\tmaxCharacters,\n\t\t\thasSections: (sections?.length ?? 0) > 0,\n\t\t\tmentions: {\n\t\t\t\tagents: mentions ? agentMentionsRef : undefined,\n\t\t\t\tteams: mentions ? teamMentionsRef : undefined,\n\t\t\t},\n\t\t\tslashCommands: slashCommands ? slashCommandsRef : undefined,\n\t\t\tonPaste,\n\t\t\tonSend: onSend ? (snapshot) => onSendRef.current?.(snapshot) : undefined,\n\t\t\tsendShortcut,\n\t\t\tshortcuts,\n\t\t\tonMentionSelected: mentions?.onSelect,\n\t\t\tonSlashCommandSelected: slashCommands?.onSelect,\n\t\t\trenderMentionItem: mentions?.renderItem,\n\t\t\trenderMentionDropdown: mentions?.renderDropdown,\n\t\t\tremoveMentionTriggerOnDismiss: mentions?.removeTriggerOnDismiss,\n\t\t\trenderSlashCommandItem: slashCommands?.renderItem,\n\t\t\trenderSlashCommandDropdown: slashCommands?.renderDropdown,\n\t\t}),\n\t\tcontent: initialEditorContent,\n\t\teditable: !disabled,\n\t\timmediatelyRender: false, // SSR-safe — NEVER remove this\n\t\teditorProps: {\n\t\t\tattributes: {\n\t\t\t\t...(editorClassName ? { class: editorClassName } : {}),\n\t\t\t\t...(editorStyle ? { style: cssToString(editorStyle) } : {}),\n\t\t\t},\n\t\t},\n\t\tonUpdate: ({ editor: e }) => {\n\t\t\tonChangeRef.current?.(extractContent(e));\n\t\t\tif (isJsonMode) {\n\t\t\t\tconst result = parseJson(getCodeBlockText(e));\n\t\t\t\tsetJsonError(result.valid ? null : result);\n\t\t\t}\n\t\t},\n\t\tonTransaction: ({ editor: e }) => {\n\t\t\tconst next = extractActiveFormats(e);\n\t\t\tconst prev = prevFormatsRef.current;\n\t\t\tconst changed =\n\t\t\t\tprev.bold !== next.bold ||\n\t\t\t\tprev.italic !== next.italic ||\n\t\t\t\tprev.underline !== next.underline ||\n\t\t\t\tprev.strike !== next.strike ||\n\t\t\t\tprev.bulletList !== next.bulletList ||\n\t\t\t\tprev.orderedList !== next.orderedList ||\n\t\t\t\tprev.blockquote !== next.blockquote ||\n\t\t\t\tprev.codeBlock !== next.codeBlock ||\n\t\t\t\tprev.superscript !== next.superscript ||\n\t\t\t\tprev.subscript !== next.subscript ||\n\t\t\t\tprev.textAlign !== next.textAlign ||\n\t\t\t\tprev.fontFamily !== next.fontFamily ||\n\t\t\t\tprev.fontSize !== next.fontSize ||\n\t\t\t\tprev.color !== next.color ||\n\t\t\t\tprev.highlight !== next.highlight ||\n\t\t\t\tprev.link?.href !== next.link?.href;\n\t\t\tif (changed) {\n\t\t\t\tprevFormatsRef.current = next;\n\t\t\t\tonSelectionChangeRef.current?.(next);\n\t\t\t}\n\t\t},\n\t\tonFocus: () => onFocusRef.current?.(),\n\t\tonBlur: () => onBlurRef.current?.(),\n\t});\n\n\t// ── enqueue ───────────────────────────────────────────────────────────────\n\t// Run immediately if the editor is ready; otherwise defer to the queue.\n\t// Closures passed to enqueue MUST capture all parameters explicitly —\n\t// they must NOT close over `editor` (which would be null at enqueue time).\n\tfunction enqueue(op: (e: Editor) => void): void {\n\t\tif (editor) {\n\t\t\top(editor);\n\t\t} else {\n\t\t\tpendingQueue.current.push(op);\n\t\t}\n\t}\n\n\t// Flush the pending queue and fire onReady when editor transitions null → ready.\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\t\tif (pendingQueue.current.length > 0) {\n\t\t\tconst queue = pendingQueue.current.splice(0);\n\t\t\tqueue.forEach((op) => op(editor));\n\t\t}\n\t\tif (!hasCalledOnReady.current) {\n\t\t\thasCalledOnReady.current = true;\n\t\t\tonReadyRef.current?.();\n\t\t}\n\t\t// Surface an error for invalid initialContent immediately on mount.\n\t\tif (isJsonMode) {\n\t\t\tconst result = parseJson(getCodeBlockText(editor));\n\t\t\tsetJsonError(result.valid ? null : result);\n\t\t}\n\t}, [editor, isJsonMode]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\t// ── Focus ────────────────────────────────────────────────────────\n\t\t\tfocus: (position) => enqueue((e) => e.commands.focus(position)),\n\t\t\tblur: () => enqueue((e) => e.commands.blur()),\n\n\t\t\t// ── Content ──────────────────────────────────────────────────────\n\t\t\tclearContent: () => enqueue((e) => e.commands.clearContent(true)),\n\t\t\tsetContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.setContent(normalised, { emitUpdate: true }));\n\t\t\t},\n\t\t\tinsertContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContent(normalised));\n\t\t\t},\n\t\t\tinsertInlineContent: (html) => {\n\t\t\t\tenqueue((e) => insertInlineHtml(e, html));\n\t\t\t},\n\t\t\tinsertAtStart: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(1, normalised));\n\t\t\t},\n\t\t\tinsertBlock: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\tappendInline: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// doc.content.size is after the last </p> (block boundary).\n\t\t\t\t// Subtract 1 to land inside the last paragraph so text appends\n\t\t\t\t// inline rather than being wrapped in a new paragraph each call.\n\t\t\t\tenqueue((e) =>\n\t\t\t\t\te.commands.insertContentAt(e.state.doc.content.size - 1, normalised),\n\t\t\t\t);\n\t\t\t},\n\t\t\t// Backwards-compatible aliases\n\t\t\tinsertAtEnd(html) {\n\t\t\t\tthis.insertBlock(html);\n\t\t\t},\n\t\t\tappendContent(html) {\n\t\t\t\tthis.appendInline(html);\n\t\t\t},\n\t\t\tgetContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tgetJSON: () => editor?.getJSON() ?? null,\n\t\t\tgetMentions: () => {\n\t\t\t\tconst agentIds = new Set<string>();\n\t\t\t\tconst teamIds = new Set<string>();\n\t\t\t\tif (!editor) return { agentIds: [], teamIds: [] };\n\t\t\t\teditor.state.doc.descendants((node) => {\n\t\t\t\t\tif (node.type.name === 'mentionAgent' && node.attrs['id'] != null) {\n\t\t\t\t\t\tagentIds.add(String(node.attrs['id']));\n\t\t\t\t\t} else if (\n\t\t\t\t\t\tnode.type.name === 'mentionTeam' &&\n\t\t\t\t\t\tnode.attrs['id'] != null\n\t\t\t\t\t) {\n\t\t\t\t\t\tteamIds.add(String(node.attrs['id']));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn { agentIds: Array.from(agentIds), teamIds: Array.from(teamIds) };\n\t\t\t},\n\n\t\t\t// ── Selection ────────────────────────────────────────────────────\n\t\t\tgetCursorPosition: () => {\n\t\t\t\tif (!editor) return { from: 0, to: 0 };\n\t\t\t\tconst { from, to } = editor.state.selection;\n\t\t\t\treturn { from, to };\n\t\t\t},\n\t\t\tinsertAtPosition: (pos, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => e.commands.insertContentAt(pos, normalised));\n\t\t\t},\n\t\t\tgetSelectedText: () => {\n\t\t\t\tif (!editor) return '';\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { from, to, empty } = state.selection;\n\t\t\t\tif (!empty) {\n\t\t\t\t\treturn state.doc.textBetween(from, to, ' ');\n\t\t\t\t}\n\t\t\t\t// When the cursor is inside a link with nothing selected, return the\n\t\t\t\t// full link text — useful for pre-filling a link modal's text field.\n\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\tif (linkMarkType) {\n\t\t\t\t\tconst range = getMarkRange(state.doc.resolve(from), linkMarkType);\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\treturn state.doc.textBetween(range.from, range.to, ' ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t},\n\n\t\t\t// ── Character count ───────────────────────────────────────────────\n\t\t\tgetCharacterCount: () => ({\n\t\t\t\tcount:\n\t\t\t\t\teditor?.storage.characterCount?.characters?.() ??\n\t\t\t\t\teditor?.getText().length ??\n\t\t\t\t\t0,\n\t\t\t\tlimit: maxCharacters ?? null,\n\t\t\t}),\n\n\t\t\t// ── Sections ─────────────────────────────────────────────────────\n\t\t\tgetSectionContent: (sectionId) =>\n\t\t\t\teditor\n\t\t\t\t\t? extractSectionContent(editor, sectionId)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\n\t\t\tsetSectionContent: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, normalised));\n\t\t\t},\n\n\t\t\tfocusSection: (sectionId) => {\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tif (sectionId === 'body') {\n\t\t\t\t\t\tlet endOfBody = e.state.doc.content.size - 1;\n\t\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\t\tendOfBody === e.state.doc.content.size - 1\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tendOfBody = pos - 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn endOfBody === e.state.doc.content.size - 1;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (endOfBody < 1) endOfBody = 1;\n\t\t\t\t\t\te.chain().focus().setTextSelection(endOfBody).run();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet targetPos = -1;\n\t\t\t\t\te.state.doc.descendants((node, pos) => {\n\t\t\t\t\t\tif (targetPos !== -1) return false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tnode.type.name === 'sectionDivider' &&\n\t\t\t\t\t\t\tnode.attrs['sectionId'] === sectionId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// pos + nodeSize lands right after the divider;\n\t\t\t\t\t\t\t// +1 more puts us inside the first paragraph of that section.\n\t\t\t\t\t\t\ttargetPos = pos + node.nodeSize + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif (targetPos !== -1) {\n\t\t\t\t\t\te.chain().focus().setTextSelection(targetPos).run();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tclearSection: (sectionId) => {\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, sectionId, '<p></p>'));\n\t\t\t},\n\n\t\t\t// ── Convenience body shorthands ───────────────────────────────────\n\t\t\tgetBodyContent: () =>\n\t\t\t\teditor\n\t\t\t\t\t? extractBodyContent(editor)\n\t\t\t\t\t: { html: '', text: '', isEmpty: true, characterCount: 0 },\n\t\t\tsetBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => setSectionContentInEditor(e, 'body', normalised));\n\t\t\t},\n\t\t\tsetBodyAndSections: (body, sections) => {\n\t\t\t\tconst html = buildSectionedContent(\n\t\t\t\t\tnormalizeHtml(body),\n\t\t\t\t\tsections.map((s) => ({\n\t\t\t\t\t\tid: s.id,\n\t\t\t\t\t\tcontent: normalizeHtml(s.content),\n\t\t\t\t\t})),\n\t\t\t\t);\n\t\t\t\tenqueue((e) => e.commands.setContent(html, { emitUpdate: true }));\n\t\t\t},\n\t\t\tappendBodyContent: (html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\t// findSectionEndPos returns the position of the first divider (or\n\t\t\t\t// doc.content.size), which is the block boundary after the last </p>.\n\t\t\t\t// Subtract 1 to stay inside the last paragraph so successive calls\n\t\t\t\t// append inline text rather than creating a new paragraph each time.\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst boundaryPos = findSectionEndPos(e, 'body');\n\t\t\t\t\te.commands.insertContentAt(boundaryPos - 1, normalised, {\n\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionStart: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionStartPos(e, sectionId);\n\t\t\t\t\tif (pos !== -1)\n\t\t\t\t\t\te.commands.insertContentAt(pos, normalised, {\n\t\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\tinsertAtSectionEnd: (sectionId, html) => {\n\t\t\t\tconst normalised = normalizeHtml(html);\n\t\t\t\tenqueue((e) => {\n\t\t\t\t\tconst pos = findSectionEndPos(e, sectionId);\n\t\t\t\t\te.commands.insertContentAt(pos, normalised, {\n\t\t\t\t\t\tparseOptions: { preserveWhitespace: true },\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\t// ── Formats & actions ─────────────────────────────────────────────\n\t\t\tgetActiveFormats: () =>\n\t\t\t\teditor ? extractActiveFormats(editor) : DEFAULT_FORMAT_STATE,\n\t\t\tactions: {\n\t\t\t\ttoggleBold: () => editor?.chain().focus().toggleBold().run(),\n\t\t\t\ttoggleItalic: () => editor?.chain().focus().toggleItalic().run(),\n\t\t\t\ttoggleUnderline: () => editor?.chain().focus().toggleUnderline().run(),\n\t\t\t\ttoggleStrike: () => editor?.chain().focus().toggleStrike().run(),\n\t\t\t\ttoggleBulletList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBulletList().run(),\n\t\t\t\ttoggleOrderedList: () =>\n\t\t\t\t\teditor?.chain().focus().toggleOrderedList().run(),\n\t\t\t\ttoggleBlockquote: () =>\n\t\t\t\t\teditor?.chain().focus().toggleBlockquote().run(),\n\t\t\t\ttoggleCodeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n\t\t\t\tsetTextAlign: (align) =>\n\t\t\t\t\teditor?.chain().focus().setTextAlign(align).run(),\n\t\t\t\tsetFontFamily: (font) =>\n\t\t\t\t\teditor?.chain().focus().setFontFamily(font).run(),\n\t\t\t\tsetFontSize: (size) => editor?.chain().focus().setFontSize(size).run(),\n\t\t\t\tsetColor: (color) => editor?.chain().focus().setColor(color).run(),\n\t\t\t\tsetHighlight: (color) =>\n\t\t\t\t\teditor?.chain().focus().toggleHighlight({ color }).run(),\n\t\t\t\tunsetColor: () => editor?.chain().focus().unsetColor().run(),\n\t\t\t\tunsetHighlight: () => editor?.chain().focus().unsetHighlight().run(),\n\t\t\t\tsetLink: (href, text) => {\n\t\t\t\t\tif (!editor) return;\n\t\t\t\t\tif (text !== undefined) {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.command(({ tr, state }) => {\n\t\t\t\t\t\t\t\tconst { from, to } = tr.selection;\n\t\t\t\t\t\t\t\tconst linkMarkType = state.schema.marks['link'];\n\t\t\t\t\t\t\t\tif (!linkMarkType) return false;\n\t\t\t\t\t\t\t\tconst linkNode = state.schema.text(text, [\n\t\t\t\t\t\t\t\t\tlinkMarkType.create({ href }),\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\tconst space = state.schema.text(' ');\n\t\t\t\t\t\t\t\ttr.replaceWith(from, to, [linkNode, space]);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor\n\t\t\t\t\t\t\t.chain()\n\t\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t\t.insertContent(' ')\n\t\t\t\t\t\t\t.run();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tupdateLink: (href) =>\n\t\t\t\t\teditor\n\t\t\t\t\t\t?.chain()\n\t\t\t\t\t\t.focus()\n\t\t\t\t\t\t.extendMarkRange('link')\n\t\t\t\t\t\t.setLink({ href })\n\t\t\t\t\t\t.run(),\n\t\t\t\tremoveLink: () =>\n\t\t\t\t\teditor?.chain().focus().extendMarkRange('link').unsetLink().run(),\n\t\t\t\tinsertEmoji: (emoji) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(emoji).run(),\n\t\t\t\tinsertVariable: (variableName) =>\n\t\t\t\t\teditor?.chain().focus().insertContent(`{{${variableName}}}`).run(),\n\t\t\t\tinsertHtml: (html) =>\n\t\t\t\t\teditor?.commands.insertContent(normalizeHtml(html)),\n\t\t\t\tundo: () => editor?.chain().focus().undo().run(),\n\t\t\t\tredo: () => editor?.chain().focus().redo().run(),\n\t\t\t\tcanUndo: () => editor?.can().undo() ?? false,\n\t\t\t\tcanRedo: () => editor?.can().redo() ?? false,\n\t\t\t\ttoggleSuperscript: () =>\n\t\t\t\t\teditor?.chain().focus().toggleSuperscript().run(),\n\t\t\t\ttoggleSubscript: () => editor?.chain().focus().toggleSubscript().run(),\n\t\t\t\tinsertImage: (src) => editor?.chain().focus().setImage({ src }).run(),\n\t\t\t},\n\n\t\t\t// ── JSON body ─────────────────────────────────────────────────────\n\t\t\tjson: features?.jsonMode\n\t\t\t\t? {\n\t\t\t\t\t\tgetText: () => (editor ? getCodeBlockText(editor) : ''),\n\t\t\t\t\t\tsetText: (raw) => enqueue((e) => setCodeBlockText(e, raw)),\n\t\t\t\t\t\tparse: () => parseJson(editor ? getCodeBlockText(editor) : ''),\n\t\t\t\t\t\tisValid: () =>\n\t\t\t\t\t\t\tparseJson(editor ? getCodeBlockText(editor) : '').valid,\n\t\t\t\t\t\tformat: (indent = 2) =>\n\t\t\t\t\t\t\tenqueue((e) => {\n\t\t\t\t\t\t\t\tconst { valid, value } = parseJson(getCodeBlockText(e));\n\t\t\t\t\t\t\t\tif (!valid || value === null) return;\n\t\t\t\t\t\t\t\tsetCodeBlockText(e, JSON.stringify(value, null, indent));\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\tminify: () =>\n\t\t\t\t\t\t\tenqueue((e) => {\n\t\t\t\t\t\t\t\tconst { valid, value } = parseJson(getCodeBlockText(e));\n\t\t\t\t\t\t\t\tif (!valid || value === null) return;\n\t\t\t\t\t\t\t\tsetCodeBlockText(e, JSON.stringify(value));\n\t\t\t\t\t\t\t}),\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\t}),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[editor],\n\t);\n\n\t// ── jsonMode floating actions ────────────────────────────────────────────\n\t// Beautify pretty-prints in place (no-op / disabled while the JSON is broken);\n\t// Copy writes the raw text to the clipboard with transient feedback.\n\tconst handleJsonBeautify = () => {\n\t\tif (!editor) return;\n\t\tconst { valid, value } = parseJson(getCodeBlockText(editor));\n\t\tif (!valid || value === null) return;\n\t\tsetCodeBlockText(editor, JSON.stringify(value, null, 2));\n\t};\n\tconst handleJsonCopy = () => {\n\t\tif (!editor) return;\n\t\tvoid navigator.clipboard?.writeText(getCodeBlockText(editor));\n\t\tsetJsonCopied(true);\n\t\tsetTimeout(() => setJsonCopied(false), 1500);\n\t};\n\n\tif (!editor) return null;\n\n\treturn (\n\t\t<BikEditorShell\n\t\t\tminHeight={minHeight}\n\t\t\tmaxHeight={maxHeight}\n\t\t\ttightParagraphs={!features?.richPaste}\n\t\t\tjsonMode={isJsonMode}\n\t\t\tstyle={style}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{isJsonMode && (\n\t\t\t\t<BikJsonHeader>\n\t\t\t\t\t<span className=\"bik-json-header-label\">JSON</span>\n\t\t\t\t\t<div className=\"bik-json-header-actions\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={handleJsonBeautify}\n\t\t\t\t\t\t\tdisabled={!!jsonError}\n\t\t\t\t\t\t\ttitle=\"Format JSON\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WandSparkles size={16} />\n\t\t\t\t\t\t\t<BodyCaption>Beautify</BodyCaption>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button type=\"button\" onClick={handleJsonCopy} title=\"Copy JSON\">\n\t\t\t\t\t\t\t<Copy size={16} />\n\t\t\t\t\t\t\t{jsonCopied && <BodyCaption>Copied</BodyCaption>}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</BikJsonHeader>\n\t\t\t)}\n\t\t\t<EditorContent editor={editor} />\n\t\t\t<LinkBubbleMenu editor={editor} renderLinkTooltip={link?.renderTooltip} />\n\t\t\t{isJsonMode && jsonError ? (\n\t\t\t\trenderJsonError ? (\n\t\t\t\t\trenderJsonError(jsonError)\n\t\t\t\t) : (\n\t\t\t\t\t<BikJsonError>\n\t\t\t\t\t\t{jsonError.line != null && (\n\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\tLine {jsonError.line}\n\t\t\t\t\t\t\t\t{jsonError.column != null ? `, column ${jsonError.column}` : ''}\n\t\t\t\t\t\t\t\t:{' '}\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{jsonError.error}\n\t\t\t\t\t</BikJsonError>\n\t\t\t\t)\n\t\t\t) : null}\n\t\t</BikEditorShell>\n\t);\n};\n\nexport const BikEditor = forwardRef<BikEditorRef, BikEditorProps>(\n\tBikEditorInner,\n);\nBikEditor.displayName = 'BikEditor';\n"],"names":["cssToString","style","k","v","c","BikEditorInner","props","ref","initialContent","sections","features","disabled","maxCharacters","shortcuts","sendShortcut","mentions","slashCommands","link","onPaste","onReady","onChange","onSend","onFocus","onBlur","onSelectionChange","minHeight","maxHeight","className","editorClassName","editorStyle","renderJsonError","isJsonMode","jsonError","setJsonError","useState","jsonCopied","setJsonCopied","initialEditorContent","buildJsonCodeBlockHtml","buildSectionedContent","normalizeHtml","s","pendingQueue","useRef","hasCalledOnReady","onReadyRef","onChangeRef","onSelectionChangeRef","prevFormatsRef","DEFAULT_FORMAT_STATE","onFocusRef","onBlurRef","onSendRef","agentMentionsRef","teamMentionsRef","slashCommandsRef","editor","useEditor","buildExtensions","snapshot","e","extractContent","result","parseJson","getCodeBlockText","next","extractActiveFormats","prev","enqueue","op","useEffect","useImperativeHandle","position","html","normalised","insertInlineHtml","agentIds","teamIds","node","from","to","pos","state","empty","linkMarkType","range","getMarkRange","sectionId","extractSectionContent","setSectionContentInEditor","endOfBody","targetPos","extractBodyContent","body","boundaryPos","findSectionEndPos","findSectionStartPos","align","font","size","color","href","text","tr","linkNode","space","emoji","variableName","src","raw","setCodeBlockText","indent","valid","value","handleJsonBeautify","handleJsonCopy","jsxs","BikEditorShell","BikJsonHeader","jsx","WandSparkles","BodyCaption","Copy","EditorContent","LinkBubbleMenu","BikJsonError","BikEditor","forwardRef"],"mappings":";;;;;;;;;;;;AAkDA,SAASA,GAAYC,GAAoC;AACxD,SAAO,OAAO,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AA;AAAA,cAAA,gBAAAI,EAACG,IAAA,EAAK,MAAM,GAAA,CAAI;AAAA,cACfvF,MAAc,gBAAAoF,EAACE,GAAA,EAAY,UAAA,SAAA,CAAM;AAAA,YAAA,EAAA,CACnC;AAAA,UAAA,EAAA,CACD;AAAA,QAAA,GACD;AAAA,QAED,gBAAAF,EAACI,MAAc,QAAAnE,GAAgB;AAAA,QAC/B,gBAAA+D,EAACK,IAAA,EAAe,QAAApE,GAAgB,mBAAmBvC,IAAM,eAAe;AAAA,QACvEc,KAAcC,IACdF,IACCA,EAAgBE,CAAS,sBAExB6F,IAAA,EACC,UAAA;AAAA,UAAA7F,EAAU,QAAQ,QAClB,gBAAAoF,EAAC,UAAA,EAAO,UAAA;AAAA,YAAA;AAAA,YACDpF,EAAU;AAAA,YACfA,EAAU,UAAU,OAAO,YAAYA,EAAU,MAAM,KAAK;AAAA,YAAG;AAAA,YAC9D;AAAA,UAAA,GACH;AAAA,UAEAA,EAAU;AAAA,QAAA,EAAA,CACZ,IAEE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IAhDc;AAmDrB,GAEa8F,KAAYC;AAAA,EACxB1H;AACD;AACAyH,GAAU,cAAc;"}
@@ -5,10 +5,10 @@ export declare const BikEditorShell: import('styled-components').StyledComponent
5
5
  jsonMode?: boolean | undefined;
6
6
  }, never>;
7
7
  /**
8
- * Floating Beautify / Copy action group for jsonMode, pinned to the top-right of
9
- * the editor so it never collides with a consumer-owned title/header. Sits above
10
- * the scrolling code area (absolute inside the position:relative shell).
8
+ * jsonMode header bar: a "JSON" label on the left and the Beautify / Copy actions
9
+ * on the right, sitting above the code area with a bottom divider. Grey fill sets
10
+ * it apart from the white code surface below (see the jsonMode block above).
11
11
  */
12
- export declare const BikJsonActions: import('styled-components').StyledComponent<"div", any, {}, never>;
12
+ export declare const BikJsonHeader: import('styled-components').StyledComponent<"div", any, {}, never>;
13
13
  /** Inline JSON parse-error banner rendered by BikEditor in jsonMode. */
14
14
  export declare const BikJsonError: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -5,11 +5,10 @@ const a = o.div`
5
5
  width: 100%;
6
6
 
7
7
  .ProseMirror {
8
- min-height: ${({ minHeight: e }) => e ?? "80px"};
8
+ min-height: ${({ minHeight: e }) => e ?? "60px"};
9
9
  max-height: ${({ maxHeight: e }) => e ?? "none"};
10
10
  overflow-y: auto;
11
11
  outline: none;
12
- padding: 8px 12px;
13
12
  font-size: 14px;
14
13
  line-height: 1.5;
15
14
  word-break: break-word;
@@ -73,12 +72,19 @@ const a = o.div`
73
72
  /* JSON body mode — scoped so normal-mode code blocks keep their default look
74
73
  (no reserved gutter, no monospace override). */
75
74
  ${({ jsonMode: e }) => e && i`
76
- /* The code block IS the editor surface. Put the grey on the scroller so
77
- it always fills the min-height (no blank strip below short JSON) and
78
- drop the frame padding so it reaches the edges. */
75
+ /* Self-framed card: the header bar and the code area share one rounded
76
+ border, so the component renders as a complete panel without the
77
+ consumer having to wrap it. */
78
+ border: 1px solid #e1e4e8;
79
+ border-radius: 8px;
80
+ overflow: hidden;
81
+
82
+ /* The code block IS the editor surface, sitting below the header bar.
83
+ White fills the scroller down to the min-height (no blank strip below
84
+ short JSON); the header owns the grey. */
79
85
  .ProseMirror {
80
86
  padding: 0;
81
- background: #f6f8fa;
87
+ background: #ffffff;
82
88
  }
83
89
  /* ProseMirror appends an empty trailing paragraph AFTER the code block
84
90
  (a <p><br class="ProseMirror-trailingBreak"></p> caret-escape node).
@@ -91,11 +97,9 @@ const a = o.div`
91
97
  position: relative;
92
98
  margin: 0;
93
99
  background: transparent;
94
- /* Left padding reserves the line-number gutter; the extra top padding
95
- keeps line 1 clear of the floating Beautify/Copy actions. Each
96
- .bik-json-lineno widget hangs back into the left padding with a
97
- matching negative margin. */
98
- padding: 34px 12px 12px 3.5em;
100
+ /* Left padding reserves the line-number gutter; each .bik-json-lineno
101
+ widget hangs back into it with a matching negative margin. */
102
+ padding: 12px 12px 12px 3.5em;
99
103
  font-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo,
100
104
  Consolas, 'Liberation Mono', monospace;
101
105
  font-size: 13px;
@@ -159,30 +163,43 @@ const a = o.div`
159
163
  }
160
164
  }
161
165
  `, d = o.div`
162
- position: absolute;
163
- top: 6px;
164
- right: 6px;
165
- z-index: 2;
166
166
  display: flex;
167
- gap: 6px;
167
+ align-items: center;
168
+ justify-content: space-between;
169
+ gap: 8px;
170
+ padding: 8px 12px;
171
+ background: #f6f8fa;
172
+ border-bottom: 1px solid #e1e4e8;
173
+
174
+ .bik-json-header-label {
175
+ font-family: inherit;
176
+ font-size: 14px;
177
+ font-weight: 500;
178
+ color: #3c4149;
179
+ user-select: none;
180
+ }
181
+
182
+ .bik-json-header-actions {
183
+ display: flex;
184
+ gap: 6px;
185
+ }
168
186
 
169
187
  button {
170
188
  display: inline-flex;
171
189
  align-items: center;
172
- gap: 4px;
173
- padding: 8px;
190
+ gap: 6px;
191
+ padding: 6px 10px;
174
192
  font-family: inherit;
175
- font-size: 12px;
193
+ font-size: 13px;
176
194
  line-height: 1.4;
177
- color: #57606a;
178
- background: rgba(255, 255, 255, 0.85);
179
- backdrop-filter: blur(2px);
180
- border: 1px solid #e0e0e0;
181
- border-radius: 4px;
195
+ color: #3c4149;
196
+ background: #ffffff;
197
+ border: 1px solid #d0d7de;
198
+ border-radius: 6px;
182
199
  cursor: pointer;
183
200
 
184
201
  &:hover:not(:disabled) {
185
- background: #ffffff;
202
+ background: #f3f4f6;
186
203
  border-color: #adb5bd;
187
204
  }
188
205
  &:disabled {
@@ -205,7 +222,7 @@ const a = o.div`
205
222
  `;
206
223
  export {
207
224
  a as BikEditorShell,
208
- d as BikJsonActions,
209
- s as BikJsonError
225
+ s as BikJsonError,
226
+ d as BikJsonHeader
210
227
  };
211
228
  //# sourceMappingURL=BikEditor.styles.js.map