carbon-react 158.6.0 → 158.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/esm/components/note/note.component.js +1 -1
  2. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  3. package/esm/components/text-editor/__internal__/__nodes__/mention.node.d.ts +60 -0
  4. package/esm/components/text-editor/__internal__/__nodes__/mention.node.js +1 -0
  5. package/esm/components/text-editor/__internal__/__nodes__/styled-span.node.d.ts +105 -0
  6. package/esm/components/text-editor/__internal__/__nodes__/styled-span.node.js +1 -0
  7. package/esm/components/text-editor/__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js +1 -0
  8. package/esm/components/text-editor/__internal__/__plugins__/StyledSpanEnter/index.d.ts +1 -0
  9. package/esm/components/text-editor/__internal__/__plugins__/StyledSpanEnter/index.js +1 -0
  10. package/esm/components/text-editor/__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.d.ts +2 -0
  11. package/esm/components/text-editor/__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js +1 -0
  12. package/esm/components/text-editor/__internal__/__plugins__/index.d.ts +4 -0
  13. package/esm/components/text-editor/__internal__/__plugins__/index.js +1 -0
  14. package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.d.ts +4 -0
  15. package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.js +1 -0
  16. package/esm/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/character-counter.style.d.ts +3 -1
  17. package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -0
  18. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.d.ts +4 -0
  19. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -0
  20. package/{lib/components/text-editor/__internal__/plugins → esm/components/text-editor/__internal__/__ui__}/ContentEditor/content-editor.style.d.ts +4 -2
  21. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -0
  22. package/esm/components/text-editor/__internal__/__ui__/Mentions/constants.d.ts +15 -0
  23. package/esm/components/text-editor/__internal__/__ui__/Mentions/constants.js +1 -0
  24. package/esm/components/text-editor/__internal__/__ui__/Mentions/helpers.d.ts +3 -0
  25. package/esm/components/text-editor/__internal__/__ui__/Mentions/helpers.js +1 -0
  26. package/esm/components/text-editor/__internal__/__ui__/Mentions/index.d.ts +2 -0
  27. package/esm/components/text-editor/__internal__/__ui__/Mentions/index.js +1 -0
  28. package/esm/components/text-editor/__internal__/__ui__/Mentions/mention-typeahead-option.class.d.ts +11 -0
  29. package/esm/components/text-editor/__internal__/__ui__/Mentions/mention-typeahead-option.class.js +1 -0
  30. package/esm/components/text-editor/__internal__/__ui__/Mentions/mention.types.d.ts +14 -0
  31. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions-typeahead-menu-item.component.d.ts +12 -0
  32. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions-typeahead-menu-item.component.js +1 -0
  33. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.component.d.ts +7 -0
  34. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.component.js +1 -0
  35. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.d.ts +3 -0
  36. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -0
  37. package/{lib/components/text-editor/__internal__/plugins → esm/components/text-editor/__internal__/__ui__}/Placeholder/placeholder.component.d.ts +1 -6
  38. package/esm/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -0
  39. package/esm/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.d.ts +6 -0
  40. package/esm/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.js +1 -0
  41. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.component.d.ts +4 -0
  42. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.component.js +1 -0
  43. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.d.ts +2 -0
  44. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -0
  45. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/bold.component.d.ts +4 -0
  46. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/bold.component.js +1 -0
  47. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/hyperlink.component.d.ts +6 -0
  48. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/hyperlink.component.js +1 -0
  49. package/esm/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/buttons/index.d.ts +3 -0
  50. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/index.js +1 -0
  51. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/italic.component.d.ts +4 -0
  52. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/italic.component.js +1 -0
  53. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/list.component.d.ts +10 -0
  54. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/list.component.js +1 -0
  55. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/save.component.d.ts +4 -0
  56. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/save.component.js +1 -0
  57. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.component.d.ts +21 -0
  58. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.component.js +1 -0
  59. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.d.ts +13 -0
  60. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -0
  61. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography.component.d.ts +20 -0
  62. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography.component.js +1 -0
  63. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/underline.component.d.ts +4 -0
  64. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/underline.component.js +1 -0
  65. package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.component.d.ts +4 -0
  66. package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.component.js +1 -0
  67. package/esm/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/toolbar.style.d.ts +7 -3
  68. package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -0
  69. package/esm/components/text-editor/__internal__/{plugins → __ui__}/index.d.ts +2 -3
  70. package/esm/components/text-editor/__internal__/__ui__/index.js +1 -0
  71. package/esm/components/text-editor/__internal__/{constants.d.ts → __utils__/constants.d.ts} +7 -6
  72. package/esm/components/text-editor/__internal__/__utils__/constants.js +1 -0
  73. package/{lib/components/text-editor/__internal__ → esm/components/text-editor/__internal__/__utils__}/helpers.d.ts +4 -1
  74. package/esm/components/text-editor/__internal__/__utils__/helpers.js +1 -0
  75. package/esm/components/text-editor/__internal__/__utils__/interfaces.types.d.ts +185 -0
  76. package/esm/components/text-editor/__internal__/__utils__/theme.d.ts +5 -0
  77. package/esm/components/text-editor/__internal__/__utils__/theme.js +1 -0
  78. package/esm/components/text-editor/__internal__/index.d.ts +1 -1
  79. package/esm/components/text-editor/__internal__/index.js +1 -1
  80. package/esm/components/text-editor/index.d.ts +4 -2
  81. package/esm/components/text-editor/index.js +1 -1
  82. package/esm/components/text-editor/text-editor.component.d.ts +1 -62
  83. package/esm/components/text-editor/text-editor.component.js +1 -1
  84. package/esm/components/text-editor/text-editor.style.d.ts +6 -3
  85. package/esm/components/text-editor/text-editor.style.js +1 -1
  86. package/esm/index.js +1 -1
  87. package/esm/locales/de-de.js +1 -1
  88. package/esm/locales/en-gb.js +1 -1
  89. package/esm/locales/es-es.js +1 -1
  90. package/esm/locales/fr-ca.js +1 -1
  91. package/esm/locales/fr-fr.js +1 -1
  92. package/esm/locales/locale.d.ts +22 -0
  93. package/lib/components/note/note.component.js +1 -1
  94. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  95. package/lib/components/text-editor/__internal__/__nodes__/mention.node.d.ts +60 -0
  96. package/lib/components/text-editor/__internal__/__nodes__/mention.node.js +1 -0
  97. package/lib/components/text-editor/__internal__/__nodes__/styled-span.node.d.ts +105 -0
  98. package/lib/components/text-editor/__internal__/__nodes__/styled-span.node.js +1 -0
  99. package/lib/components/text-editor/__internal__/__plugins__/AutoLinker/package.json +6 -0
  100. package/lib/components/text-editor/__internal__/__plugins__/EditorRef/package.json +6 -0
  101. package/lib/components/text-editor/__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js +1 -0
  102. package/lib/components/text-editor/__internal__/__plugins__/LinkMonitor/package.json +6 -0
  103. package/lib/components/text-editor/__internal__/__plugins__/StyledSpanEnter/index.d.ts +1 -0
  104. package/lib/components/text-editor/__internal__/__plugins__/StyledSpanEnter/index.js +1 -0
  105. package/lib/components/text-editor/__internal__/__plugins__/StyledSpanEnter/package.json +6 -0
  106. package/lib/components/text-editor/__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.d.ts +2 -0
  107. package/lib/components/text-editor/__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js +1 -0
  108. package/lib/components/text-editor/__internal__/__plugins__/index.d.ts +4 -0
  109. package/lib/components/text-editor/__internal__/__plugins__/index.js +1 -0
  110. package/lib/components/text-editor/__internal__/__plugins__/package.json +6 -0
  111. package/lib/components/text-editor/__internal__/__plugins__/useCursorAtEnd/package.json +6 -0
  112. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.d.ts +4 -0
  113. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.component.js +1 -0
  114. package/lib/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/character-counter.style.d.ts +3 -1
  115. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -0
  116. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/package.json +6 -0
  117. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.d.ts +4 -0
  118. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -0
  119. package/{esm/components/text-editor/__internal__/plugins → lib/components/text-editor/__internal__/__ui__}/ContentEditor/content-editor.style.d.ts +4 -2
  120. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -0
  121. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/package.json +6 -0
  122. package/lib/components/text-editor/__internal__/__ui__/LinkPreviewer/package.json +6 -0
  123. package/lib/components/text-editor/__internal__/__ui__/Mentions/constants.d.ts +15 -0
  124. package/lib/components/text-editor/__internal__/__ui__/Mentions/constants.js +1 -0
  125. package/lib/components/text-editor/__internal__/__ui__/Mentions/helpers.d.ts +3 -0
  126. package/lib/components/text-editor/__internal__/__ui__/Mentions/helpers.js +1 -0
  127. package/lib/components/text-editor/__internal__/__ui__/Mentions/index.d.ts +2 -0
  128. package/lib/components/text-editor/__internal__/__ui__/Mentions/index.js +1 -0
  129. package/lib/components/text-editor/__internal__/__ui__/Mentions/mention-typeahead-option.class.d.ts +11 -0
  130. package/lib/components/text-editor/__internal__/__ui__/Mentions/mention-typeahead-option.class.js +1 -0
  131. package/lib/components/text-editor/__internal__/__ui__/Mentions/mention.types.d.ts +14 -0
  132. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions-typeahead-menu-item.component.d.ts +12 -0
  133. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions-typeahead-menu-item.component.js +1 -0
  134. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.component.d.ts +7 -0
  135. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.component.js +1 -0
  136. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.d.ts +3 -0
  137. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -0
  138. package/lib/components/text-editor/__internal__/__ui__/Mentions/package.json +6 -0
  139. package/lib/components/text-editor/__internal__/__ui__/Placeholder/package.json +6 -0
  140. package/{esm/components/text-editor/__internal__/plugins → lib/components/text-editor/__internal__/__ui__}/Placeholder/placeholder.component.d.ts +1 -6
  141. package/lib/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/placeholder.style.js +1 -1
  142. package/lib/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.d.ts +6 -0
  143. package/lib/components/text-editor/__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.js +1 -0
  144. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.component.d.ts +4 -0
  145. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.component.js +1 -0
  146. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.d.ts +2 -0
  147. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -0
  148. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/bold.component.d.ts +4 -0
  149. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/bold.component.js +1 -0
  150. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/hyperlink.component.d.ts +6 -0
  151. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/hyperlink.component.js +1 -0
  152. package/lib/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/buttons/index.d.ts +3 -0
  153. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/index.js +1 -0
  154. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/italic.component.d.ts +4 -0
  155. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/italic.component.js +1 -0
  156. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/list.component.d.ts +10 -0
  157. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/list.component.js +1 -0
  158. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/package.json +6 -0
  159. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/save.component.d.ts +4 -0
  160. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/save.component.js +1 -0
  161. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.component.d.ts +21 -0
  162. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.component.js +1 -0
  163. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.d.ts +13 -0
  164. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -0
  165. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography.component.d.ts +20 -0
  166. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography.component.js +1 -0
  167. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/underline.component.d.ts +4 -0
  168. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/underline.component.js +1 -0
  169. package/lib/components/text-editor/__internal__/__ui__/Toolbar/package.json +6 -0
  170. package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.component.d.ts +4 -0
  171. package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.component.js +1 -0
  172. package/lib/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/toolbar.style.d.ts +7 -3
  173. package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -0
  174. package/lib/components/text-editor/__internal__/{plugins → __ui__}/index.d.ts +2 -3
  175. package/lib/components/text-editor/__internal__/__ui__/index.js +1 -0
  176. package/lib/components/text-editor/__internal__/__ui__/package.json +6 -0
  177. package/lib/components/text-editor/__internal__/{constants.d.ts → __utils__/constants.d.ts} +7 -6
  178. package/lib/components/text-editor/__internal__/__utils__/constants.js +1 -0
  179. package/{esm/components/text-editor/__internal__ → lib/components/text-editor/__internal__/__utils__}/helpers.d.ts +4 -1
  180. package/lib/components/text-editor/__internal__/__utils__/helpers.js +1 -0
  181. package/lib/components/text-editor/__internal__/__utils__/interfaces.types.d.ts +185 -0
  182. package/lib/components/text-editor/__internal__/__utils__/theme.d.ts +5 -0
  183. package/lib/components/text-editor/__internal__/__utils__/theme.js +1 -0
  184. package/lib/components/text-editor/__internal__/index.d.ts +1 -1
  185. package/lib/components/text-editor/__internal__/index.js +1 -1
  186. package/lib/components/text-editor/index.d.ts +4 -2
  187. package/lib/components/text-editor/index.js +1 -1
  188. package/lib/components/text-editor/text-editor.component.d.ts +1 -62
  189. package/lib/components/text-editor/text-editor.component.js +1 -1
  190. package/lib/components/text-editor/text-editor.style.d.ts +6 -3
  191. package/lib/components/text-editor/text-editor.style.js +1 -1
  192. package/lib/index.js +1 -1
  193. package/lib/locales/de-de.js +1 -1
  194. package/lib/locales/en-gb.js +1 -1
  195. package/lib/locales/es-es.js +1 -1
  196. package/lib/locales/fr-ca.js +1 -1
  197. package/lib/locales/fr-fr.js +1 -1
  198. package/lib/locales/locale.d.ts +22 -0
  199. package/package.json +1 -1
  200. package/esm/components/text-editor/__internal__/constants.js +0 -1
  201. package/esm/components/text-editor/__internal__/helpers.js +0 -1
  202. package/esm/components/text-editor/__internal__/plugins/CharacterCounter/__test__/character-counter.component.js +0 -1
  203. package/esm/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.component.d.ts +0 -9
  204. package/esm/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.component.js +0 -1
  205. package/esm/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.style.js +0 -1
  206. package/esm/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.d.ts +0 -23
  207. package/esm/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js +0 -1
  208. package/esm/components/text-editor/__internal__/plugins/ContentEditor/content-editor.style.js +0 -1
  209. package/esm/components/text-editor/__internal__/plugins/LinkMonitor/link-monitor.plugin.js +0 -1
  210. package/esm/components/text-editor/__internal__/plugins/Placeholder/placeholder.style.js +0 -1
  211. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.d.ts +0 -4
  212. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.js +0 -1
  213. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/common.types.d.ts +0 -6
  214. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/index.js +0 -1
  215. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.d.ts +0 -4
  216. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.js +0 -1
  217. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.d.ts +0 -5
  218. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.js +0 -1
  219. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/save.component.d.ts +0 -34
  220. package/esm/components/text-editor/__internal__/plugins/Toolbar/buttons/save.component.js +0 -1
  221. package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.d.ts +0 -15
  222. package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.js +0 -1
  223. package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.js +0 -1
  224. package/esm/components/text-editor/__internal__/plugins/index.js +0 -1
  225. package/esm/components/text-editor/__internal__/read-only-rte.component.d.ts +0 -4
  226. package/esm/components/text-editor/__internal__/read-only-rte.component.js +0 -1
  227. package/esm/components/text-editor/utils.d.ts +0 -4
  228. package/esm/components/text-editor/utils.js +0 -1
  229. package/lib/components/text-editor/__internal__/constants.js +0 -1
  230. package/lib/components/text-editor/__internal__/helpers.js +0 -1
  231. package/lib/components/text-editor/__internal__/plugins/AutoLinker/package.json +0 -6
  232. package/lib/components/text-editor/__internal__/plugins/CharacterCounter/__test__/character-counter.component.js +0 -1
  233. package/lib/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.component.d.ts +0 -9
  234. package/lib/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.component.js +0 -1
  235. package/lib/components/text-editor/__internal__/plugins/CharacterCounter/character-counter.style.js +0 -1
  236. package/lib/components/text-editor/__internal__/plugins/CharacterCounter/package.json +0 -6
  237. package/lib/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.d.ts +0 -23
  238. package/lib/components/text-editor/__internal__/plugins/ContentEditor/content-editor.component.js +0 -1
  239. package/lib/components/text-editor/__internal__/plugins/ContentEditor/content-editor.style.js +0 -1
  240. package/lib/components/text-editor/__internal__/plugins/ContentEditor/package.json +0 -6
  241. package/lib/components/text-editor/__internal__/plugins/EditorRef/package.json +0 -6
  242. package/lib/components/text-editor/__internal__/plugins/LinkMonitor/link-monitor.plugin.js +0 -1
  243. package/lib/components/text-editor/__internal__/plugins/LinkMonitor/package.json +0 -6
  244. package/lib/components/text-editor/__internal__/plugins/LinkPreviewer/package.json +0 -6
  245. package/lib/components/text-editor/__internal__/plugins/Placeholder/package.json +0 -6
  246. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.d.ts +0 -4
  247. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/bold.component.js +0 -1
  248. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/common.types.d.ts +0 -6
  249. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/index.js +0 -1
  250. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.d.ts +0 -4
  251. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/italic.component.js +0 -1
  252. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.d.ts +0 -5
  253. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/list.component.js +0 -1
  254. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/package.json +0 -6
  255. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/save.component.d.ts +0 -34
  256. package/lib/components/text-editor/__internal__/plugins/Toolbar/buttons/save.component.js +0 -1
  257. package/lib/components/text-editor/__internal__/plugins/Toolbar/package.json +0 -6
  258. package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.d.ts +0 -15
  259. package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.component.js +0 -1
  260. package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.js +0 -1
  261. package/lib/components/text-editor/__internal__/plugins/index.js +0 -1
  262. package/lib/components/text-editor/__internal__/plugins/package.json +0 -6
  263. package/lib/components/text-editor/__internal__/plugins/useCursorAtEnd/package.json +0 -6
  264. package/lib/components/text-editor/__internal__/read-only-rte.component.d.ts +0 -4
  265. package/lib/components/text-editor/__internal__/read-only-rte.component.js +0 -1
  266. package/lib/components/text-editor/utils.d.ts +0 -4
  267. package/lib/components/text-editor/utils.js +0 -1
  268. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/auto-link.component.d.ts +0 -0
  269. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/auto-link.component.js +0 -0
  270. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/index.d.ts +0 -0
  271. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/index.js +0 -0
  272. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/editor-ref.plugin.d.ts +0 -0
  273. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/editor-ref.plugin.js +0 -0
  274. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/index.d.ts +0 -0
  275. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/index.js +0 -0
  276. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/index.d.ts +0 -0
  277. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/index.js +0 -0
  278. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/link-monitor.plugin.d.ts +0 -0
  279. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/useCursorAtEnd/index.d.ts +0 -0
  280. /package/esm/components/text-editor/__internal__/{plugins → __plugins__}/useCursorAtEnd/index.js +0 -0
  281. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/index.d.ts +0 -0
  282. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/index.js +0 -0
  283. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/ContentEditor/index.d.ts +0 -0
  284. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/ContentEditor/index.js +0 -0
  285. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/index.d.ts +0 -0
  286. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/index.js +0 -0
  287. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.component.d.ts +0 -0
  288. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.component.js +0 -0
  289. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.style.d.ts +0 -0
  290. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.style.js +0 -0
  291. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/index.d.ts +0 -0
  292. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/index.js +0 -0
  293. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/placeholder.component.js +0 -0
  294. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/placeholder.style.d.ts +0 -0
  295. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/index.d.ts +0 -0
  296. /package/esm/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/index.js +0 -0
  297. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/auto-link.component.d.ts +0 -0
  298. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/auto-link.component.js +0 -0
  299. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/index.d.ts +0 -0
  300. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/AutoLinker/index.js +0 -0
  301. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/editor-ref.plugin.d.ts +0 -0
  302. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/editor-ref.plugin.js +0 -0
  303. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/index.d.ts +0 -0
  304. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/EditorRef/index.js +0 -0
  305. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/index.d.ts +0 -0
  306. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/index.js +0 -0
  307. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/LinkMonitor/link-monitor.plugin.d.ts +0 -0
  308. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/useCursorAtEnd/index.d.ts +0 -0
  309. /package/lib/components/text-editor/__internal__/{plugins → __plugins__}/useCursorAtEnd/index.js +0 -0
  310. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/index.d.ts +0 -0
  311. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/CharacterCounter/index.js +0 -0
  312. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/ContentEditor/index.d.ts +0 -0
  313. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/ContentEditor/index.js +0 -0
  314. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/index.d.ts +0 -0
  315. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/index.js +0 -0
  316. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.component.d.ts +0 -0
  317. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.component.js +0 -0
  318. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.style.d.ts +0 -0
  319. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/LinkPreviewer/link-previewer.style.js +0 -0
  320. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/index.d.ts +0 -0
  321. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/index.js +0 -0
  322. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/placeholder.component.js +0 -0
  323. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Placeholder/placeholder.style.d.ts +0 -0
  324. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/index.d.ts +0 -0
  325. /package/lib/components/text-editor/__internal__/{plugins → __ui__}/Toolbar/index.js +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("date-fns/locale/fr");const r=e=>1===("string"==typeof e?parseInt(e):e),t={locale:()=>"fr-FR",actions:{edit:()=>"Modifier",delete:()=>"Supprimer"},actionPopover:{ariaLabel:()=>"actions"},advancedColorPicker:{ariaLabel:()=>"Changer de couleur",currentColorDescriptionTerm:()=>"Couleur actuelle attribuée :",currentColorAssigned:e=>e},batchSelection:{selected:e=>`${e} sélectionné(s)`},breadcrumbs:{ariaLabel:()=>"Chemin de navigation"},confirm:{no:()=>"Non",yes:()=>"Oui"},characterCount:{tooManyCharacters:(e,r)=>1===e?`il y a ${r} caractère de trop`:`${r} caractères de trop`,charactersLeft:(e,r)=>1===e?`${r} caractère restant`:`${r} caractères restants`,visuallyHiddenHint:e=>`vous pouvez saisir jusqu'à ${e} caractères.`},date:{dateFnsLocale:()=>e.fr,ariaLabels:{previousMonthButton:()=>"Mois précédent",nextMonthButton:()=>"Mois suivant"}},dialog:{ariaLabels:{close:()=>"Fermer"}},dismissibleBox:{ariaLabels:{close:()=>"Fermer"}},errors:{messages:{formSummary:(e,t,a)=>{const n=r(e)?"erreur":"erreurs",o=r(t)?"avertissement":"avertissements";return e&&t&&"warning"===a?["et",`${t} ${o}`]:e?["Il y a",`${e} ${n}`]:t?["Il y a",`${t} ${o}`]:null}}},fileInput:{dragAndDrop:()=>"ou glisser et déposer votre fichier",selectFile:()=>"Sélectionnez le fichier",fileUploadStatus:()=>"Statut du téléchargement de fichiers",actions:{cancel:()=>"Annuler le téléchargement",clear:()=>"Effacer",delete:()=>"Supprimer le fichier"}},heading:{backLinkAriaLabel:()=>"Retour"},link:{skipLinkLabel:()=>"Passer au contenu principal"},loader:{loading:()=>"Chargement en cours"},loaderSpinner:{loading:()=>"Chargement en cours..."},loaderStar:{loading:()=>"Chargement en cours..."},menuFullscreen:{ariaLabels:{closeButton:()=>"Fermer"}},message:{closeButtonAriaLabel:()=>"Fermer",error:()=>"Erreur",info:()=>"Information",success:()=>"Action réussie",warning:()=>"Avertissement",neutral:()=>"Information",ai:()=>"Information générée par IA"},numeralDate:{validation:{day:(e,r)=>e&&r?`Le jour du ${e} doit être un nombre compris entre 1- ${r}`:"Le jour doit être un nombre compris entre 1 et 31 jours.",month:()=>"Le mois doit être un nombre compris entre 1 et 12.",year:()=>"L'année doit être un nombre compris entre 1800 et 2200."},labels:{day:()=>"Jour",month:()=>"Mois",year:()=>"Année"}},pager:{show:()=>"Afficher",records:(e,t=!0)=>{const a=r(e)?"élément":"éléments";return t?`${e} ${a}`:a},first:()=>"Première",last:()=>"Dernière",next:()=>"Suivante",previous:()=>"Précédente",pageX:()=>"Page",ofY:e=>`de ${e}`},password:{buttonLabelHide:()=>"Masquer",buttonLabelShow:()=>"Afficher",ariaLabelHide:()=>"Masquer le mot de passe",ariaLabelShow:()=>"Afficher le mot de passe",ariaLiveShownMessage:()=>"Votre mot de passe s'affiche. Assurez-vous d'être dans un environnement sûr puis survolez la zone avec votre souris et vous pourrez écouter le mot de passe.",ariaLiveHiddenMessage:()=>"Votre mot de passe est actuellement caché."},progressTracker:{of:()=>"de"},pod:{undo:()=>"Annuler"},textEditor:{boldAria:()=>"Gras",cancelButton:()=>"Annuler",cancelButtonAria:()=>"Annuler",characterCounter:e=>`${"number"==typeof e?e.toString():e} caractères restants`,characterLimit:e=>`Vous avez dépassé de ${e} caractères la limite autorisée`,contentEditorAria:()=>"Éditeur de texte enrichi",italicAria:()=>"Italique",orderedListAria:()=>"Liste ordonnée",saveButton:()=>"Enregistrer",saveButtonAria:()=>"Enregistrer",toolbarAriaLabel:()=>"Mise en forme",unorderedListAria:()=>"Liste non ordonnée"},search:{searchButtonText:()=>"Rechercher"},select:{actionButtonText:()=>"Ajouter un nouvel élément",placeholder:()=>"Sélectionner...",noResultsForTerm:e=>`Aucun résultat pour ${e}`},sidebar:{ariaLabels:{close:()=>"Fermer"}},sort:{accessibleName:(e,r)=>`Trier tous les contenus ${e&&`de type ${e}`}${r?` par ordre ${"ascending"===r?"croissant":"décroissant"}.`:" par ordre croissant ou décroissant."}`},splitButton:{ariaLabel:()=>"Afficher plus"},stepFlow:{stepLabel:(e,r)=>`Étape ${e} de ${r}`,screenReaderOnlyTitle:(e,r,t,a)=>`${a?`${a}.`:""} ${e}. Étape ${r} de ${t}.`,closeIconAriaLabel:()=>"Fermer"},switch:{on:()=>"Oui",off:()=>"Non"},tileSelect:{deselect:()=>"Désélectionner"},time:{amText:()=>"AM",pmText:()=>"PM",hoursLabelText:()=>"h",minutesLabelText:()=>"min",hoursAriaLabelText:()=>"Heures",minutesAriaLabelText:()=>"Minutes"},toast:{ariaLabels:{close:()=>"Fermer"},error:()=>"",info:()=>"",success:()=>"",warning:()=>"",neutral:()=>"",notification:()=>""},verticalMenuFullScreen:{ariaLabels:{close:()=>"Fermer"}}};exports.default=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("date-fns/locale/fr");const r=e=>1===("string"==typeof e?parseInt(e):e),t={locale:()=>"fr-FR",actions:{edit:()=>"Modifier",delete:()=>"Supprimer"},actionPopover:{ariaLabel:()=>"actions"},advancedColorPicker:{ariaLabel:()=>"Changer de couleur",currentColorDescriptionTerm:()=>"Couleur actuelle attribuée :",currentColorAssigned:e=>e},batchSelection:{selected:e=>`${e} sélectionné(s)`},breadcrumbs:{ariaLabel:()=>"Chemin de navigation"},confirm:{no:()=>"Non",yes:()=>"Oui"},characterCount:{tooManyCharacters:(e,r)=>1===e?`il y a ${r} caractère de trop`:`${r} caractères de trop`,charactersLeft:(e,r)=>1===e?`${r} caractère restant`:`${r} caractères restants`,visuallyHiddenHint:e=>`vous pouvez saisir jusqu'à ${e} caractères.`},date:{dateFnsLocale:()=>e.fr,ariaLabels:{previousMonthButton:()=>"Mois précédent",nextMonthButton:()=>"Mois suivant"}},dialog:{ariaLabels:{close:()=>"Fermer"}},dismissibleBox:{ariaLabels:{close:()=>"Fermer"}},errors:{messages:{formSummary:(e,t,a)=>{const n=r(e)?"erreur":"erreurs",i=r(t)?"avertissement":"avertissements";return e&&t&&"warning"===a?["et",`${t} ${i}`]:e?["Il y a",`${e} ${n}`]:t?["Il y a",`${t} ${i}`]:null}}},fileInput:{dragAndDrop:()=>"ou glisser et déposer votre fichier",selectFile:()=>"Sélectionnez le fichier",fileUploadStatus:()=>"Statut du téléchargement de fichiers",actions:{cancel:()=>"Annuler le téléchargement",clear:()=>"Effacer",delete:()=>"Supprimer le fichier"}},heading:{backLinkAriaLabel:()=>"Retour"},link:{skipLinkLabel:()=>"Passer au contenu principal"},loader:{loading:()=>"Chargement en cours"},loaderSpinner:{loading:()=>"Chargement en cours..."},loaderStar:{loading:()=>"Chargement en cours..."},menuFullscreen:{ariaLabels:{closeButton:()=>"Fermer"}},message:{closeButtonAriaLabel:()=>"Fermer",error:()=>"Erreur",info:()=>"Information",success:()=>"Action réussie",warning:()=>"Avertissement",neutral:()=>"Information",ai:()=>"Information générée par IA"},numeralDate:{validation:{day:(e,r)=>e&&r?`Le jour du ${e} doit être un nombre compris entre 1- ${r}`:"Le jour doit être un nombre compris entre 1 et 31 jours.",month:()=>"Le mois doit être un nombre compris entre 1 et 12.",year:()=>"L'année doit être un nombre compris entre 1800 et 2200."},labels:{day:()=>"Jour",month:()=>"Mois",year:()=>"Année"}},pager:{show:()=>"Afficher",records:(e,t=!0)=>{const a=r(e)?"élément":"éléments";return t?`${e} ${a}`:a},first:()=>"Première",last:()=>"Dernière",next:()=>"Suivante",previous:()=>"Précédente",pageX:()=>"Page",ofY:e=>`de ${e}`},password:{buttonLabelHide:()=>"Masquer",buttonLabelShow:()=>"Afficher",ariaLabelHide:()=>"Masquer le mot de passe",ariaLabelShow:()=>"Afficher le mot de passe",ariaLiveShownMessage:()=>"Votre mot de passe s'affiche. Assurez-vous d'être dans un environnement sûr puis survolez la zone avec votre souris et vous pourrez écouter le mot de passe.",ariaLiveHiddenMessage:()=>"Votre mot de passe est actuellement caché."},progressTracker:{of:()=>"de"},pod:{undo:()=>"Annuler"},textEditor:{boldAria:()=>"Gras",cancelButton:()=>"Annuler",cancelButtonAria:()=>"Annuler",characterCounter:e=>`${"number"==typeof e?e.toString():e} caractères restants`,characterLimit:e=>`Vous avez dépassé de ${e} caractères la limite autorisée`,contentEditorAria:()=>"Éditeur de texte enrichi",italicAria:()=>"Italique",orderedListAria:()=>"Liste ordonnée",saveButton:()=>"Enregistrer",saveButtonAria:()=>"Enregistrer",toolbarAriaLabel:()=>"Mise en forme",unorderedListAria:()=>"Liste non ordonnée",underlineAria:()=>"Underline",hyperlink:{buttonAria:()=>"Hyperlink",cancelButton:()=>"Cancel",cancelButtonAria:()=>"Cancel",dialogTitle:()=>"Add link",linkFieldLabel:()=>"Link",saveButton:()=>"Save",saveButtonAria:()=>"Save",textFieldLabel:()=>"Text"},typography:{selectAria:()=>"Heading type",paragraph:()=>"Paragraph",title:()=>"Title",subtitle:()=>"Subtitle",sectionHeader:()=>"Section header",sectionSubheader:()=>"Section subheader"},mentions:{listAriaLabel:()=>"List of mentionable people"}},search:{searchButtonText:()=>"Rechercher"},select:{actionButtonText:()=>"Ajouter un nouvel élément",placeholder:()=>"Sélectionner...",noResultsForTerm:e=>`Aucun résultat pour ${e}`},sidebar:{ariaLabels:{close:()=>"Fermer"}},sort:{accessibleName:(e,r)=>`Trier tous les contenus ${e&&`de type ${e}`}${r?` par ordre ${"ascending"===r?"croissant":"décroissant"}.`:" par ordre croissant ou décroissant."}`},splitButton:{ariaLabel:()=>"Afficher plus"},stepFlow:{stepLabel:(e,r)=>`Étape ${e} de ${r}`,screenReaderOnlyTitle:(e,r,t,a)=>`${a?`${a}.`:""} ${e}. Étape ${r} de ${t}.`,closeIconAriaLabel:()=>"Fermer"},switch:{on:()=>"Oui",off:()=>"Non"},tileSelect:{deselect:()=>"Désélectionner"},time:{amText:()=>"AM",pmText:()=>"PM",hoursLabelText:()=>"h",minutesLabelText:()=>"min",hoursAriaLabelText:()=>"Heures",minutesAriaLabelText:()=>"Minutes"},toast:{ariaLabels:{close:()=>"Fermer"},error:()=>"",info:()=>"",success:()=>"",warning:()=>"",neutral:()=>"",notification:()=>""},verticalMenuFullScreen:{ariaLabels:{close:()=>"Fermer"}}};exports.default=t;
@@ -137,12 +137,34 @@ interface Locale {
137
137
  characterCounter: (count: number | string) => string;
138
138
  characterLimit: (count: number) => string;
139
139
  contentEditorAria: () => string;
140
+ hyperlink: {
141
+ buttonAria: () => string;
142
+ cancelButton: () => string;
143
+ cancelButtonAria: () => string;
144
+ dialogTitle: () => string;
145
+ linkFieldLabel: () => string;
146
+ saveButton: () => string;
147
+ saveButtonAria: () => string;
148
+ textFieldLabel: () => string;
149
+ };
150
+ typography: {
151
+ selectAria: () => string;
152
+ paragraph: () => string;
153
+ title: () => string;
154
+ subtitle: () => string;
155
+ sectionHeader: () => string;
156
+ sectionSubheader: () => string;
157
+ };
140
158
  italicAria: () => string;
141
159
  orderedListAria: () => string;
142
160
  saveButton: () => string;
143
161
  saveButtonAria: () => string;
144
162
  toolbarAriaLabel: () => string;
163
+ underlineAria: () => string;
145
164
  unorderedListAria: () => string;
165
+ mentions: {
166
+ listAriaLabel: () => string;
167
+ };
146
168
  };
147
169
  search: {
148
170
  searchButtonText: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "158.6.0",
3
+ "version": "158.7.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -1 +0,0 @@
1
- import{CodeNode as t}from"@lexical/code";import{AutoLinkNode as l,LinkNode as i}from"@lexical/link";import{ListNode as e,ListItemNode as o}from"@lexical/list";import{HorizontalRuleNode as r}from"@lexical/react/LexicalHorizontalRuleNode";import{HeadingNode as c,QuoteNode as a}from"@lexical/rich-text";const m="carbon-rte",x={text:{bold:"textBold",italic:"textItalic"}},d={Bold:"bold",Italic:"italic",OrderedList:"number",UnorderedList:"bullet"},n=[l,t,i,e,o,c,a,r];export{m as COMPONENT_PREFIX,d as TextEditorActionTypes,n as markdownNodes,x as theme};
@@ -1 +0,0 @@
1
- import{createHeadlessEditor as t}from"@lexical/headless";import{$generateNodesFromDOM as e,$generateHtmlFromNodes as r}from"@lexical/html";import{$getRoot as o,$getSelection as n}from"lexical";import{markdownNodes as s,theme as i}from"./constants.js";import a from"../../../__internal__/utils/logger/index.js";const l=t=>{let e,o;return t.read((()=>{const n=t.getEditorState();o=n.toJSON(),e=r(t,null)})),{htmlString:e,json:o}},m=r=>{const l=t({namespace:"html-to-json",onError:t=>a.error(t.message),theme:i,nodes:s});let m;if(l.update((()=>{const t=(new DOMParser).parseFromString(r,"text/html"),s=e(l,t);o().select();const i=n();if(i)try{i.insertNodes(s)}catch(t){m=t}}),{discrete:!0}),m)throw m;const c=l.getEditorState().toJSON();return JSON.stringify(c)},c=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function p(t){return"https://"===t||c.test(t)}export{m as DeserializeHTML,l as SerializeLexical,p as validateUrl};
@@ -1 +0,0 @@
1
- import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useState as r,useEffect as o,useMemo as n}from"react";import{$getRoot as i}from"lexical";const a=({maxChars:a,editor:c})=>{const[s,d]=r("");o((()=>{const t=c.registerUpdateListener((()=>{c.getEditorState().read((()=>{const t=i().getTextContent();d(t)}))}));return()=>{t()}}),[c]);const l=n((()=>{const t=a-(s?s.length:0);return t>=0?t:0}),[a,s]);return t(e,{children:t("div",{"data-role":"visible-counter",children:l})})};export{a as default};
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- export interface CharacterCounterPluginProps {
3
- /** The maximum number of characters to allow before showing the warning */
4
- maxChars: number;
5
- /** The namespace of the editor that this counter belongs to */
6
- namespace: string;
7
- }
8
- declare const CharacterCounterPlugin: ({ maxChars, namespace, }: CharacterCounterPluginProps) => React.JSX.Element;
9
- export default CharacterCounterPlugin;
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as n,useMemo as c}from"react";import{useLexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{$getRoot as l}from"lexical";import{StyledCharacterCounter as m,VisuallyHiddenCharacterCounter as s}from"./character-counter.style.js";import u from"../../../../../hooks/__internal__/useDebounce/useDebounce.js";import p from"../../../../../hooks/__internal__/useLocale/useLocale.js";const h=({maxChars:h,namespace:d})=>{const[x,f]=o(""),[_]=i();a((()=>{_.registerUpdateListener((({editorState:e})=>{e.read((()=>{const e=l().getChildren().map((e=>e.getTextContent())).join("\n\n");f(e)}))}))}),[_]);const C=p(),j=n((e=>new Intl.NumberFormat(C.locale()).format(e)),[C]),[g,L]=o(0),b=c((()=>{const e=h-(x?x.length:0);return e>=0?e:0}),[x,h]),k=u((e=>{L(e||0)}),2e3);return a((()=>{k(b)}),[b,k]),e(t,{children:[r(m,{"data-role":`${d}-character-limit`,children:C.textEditor.characterCounter(j(b))}),r(s,{"aria-live":"polite",children:C.textEditor.characterCounter(j(g))})]})};export{h as default};
@@ -1 +0,0 @@
1
- import t from"styled-components";import e from"../../../../../style/utils/visually-hidden.js";const o=t.div.withConfig({displayName:"character-counter.style__StyledCharacterCounter",componentId:"sc-6116dfd5-0"})(["text-align:left;font-size:var(--fontSizes100);margin-top:var(--spacing050);margin-bottom:var(--spacing050);color:var(--colorsUtilityYin055);"]),a=t.div.withConfig({displayName:"character-counter.style__VisuallyHiddenCharacterCounter",componentId:"sc-6116dfd5-1"})(['::after{content:" ";}',""],e);export{o as StyledCharacterCounter,a as VisuallyHiddenCharacterCounter,o as default};
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- export interface ContentEditorProps {
3
- /** A hint string rendered before the editor but after the label. Intended to describe the purpose or content of the input. */
4
- inputHint?: string;
5
- /** The namespace of the editor that this content editor belongs to */
6
- namespace: string;
7
- /** The link previews to render at the foot of the editor */
8
- previews?: React.JSX.Element[];
9
- /** The number of rows to render in the editor */
10
- rows?: number;
11
- /** Whether the editor is read-only */
12
- readOnly?: boolean;
13
- /** Whether the editor is required */
14
- required?: boolean;
15
- /** Editor has an error */
16
- error?: boolean;
17
- /** Editor has a warning */
18
- warning?: boolean;
19
- /** Render the ValidationMessage above the Editor */
20
- validationMessagePositionTop?: boolean;
21
- }
22
- declare const ContentEditor: React.ForwardRefExoticComponent<ContentEditorProps & React.RefAttributes<HTMLDivElement>>;
23
- export default ContentEditor;
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{ContentEditable as r}from"@lexical/react/LexicalContentEditable";import{forwardRef as i}from"react";import o from"./content-editor.style.js";import"../AutoLinker/auto-link.component.js";import"@lexical/react/LexicalComposerContext";import"lexical";import"../CharacterCounter/character-counter.style.js";import"lodash/debounce";import"../../../../../__internal__/i18n-context/index.js";import"@lexical/link";import"@lexical/headless";import"@lexical/html";import"@lexical/code";import"@lexical/list";import"@lexical/react/LexicalHorizontalRuleNode";import"@lexical/rich-text";import"../../../text-editor.context.js";import a from"../LinkPreviewer/link-previewer.component.js";import"../Placeholder/placeholder.style.js";import"@lexical/utils";import"../Toolbar/toolbar.style.js";import"../../../../button/button.component.js";import l from"../useCursorAtEnd/index.js";const n=i((({inputHint:i,namespace:n,previews:c=[],rows:s,readOnly:m,required:p,error:d,warning:x,validationMessagePositionTop:u},b)=>{const j=l(),h=d||x?`${n}-validation-message`:"",$=i?`${n}-input-hint`:"",v=(u?`${h} ${$}`:`${$} ${h}`).trim();return e(o,{"data-role":`${n}-content-editable`,namespace:n,rows:s,readOnly:m,children:[t(r,{ref:b,"aria-describedby":v,"aria-labelledby":`${n}-label`,"aria-required":p,"aria-invalid":d,className:`${n}-editable`,"data-role":`${n}-editable`,onFocus:e=>{e.relatedTarget&&e.relatedTarget.classList.contains("toolbar-button")||j(e)},"aria-autocomplete":void 0,"aria-readonly":void 0}),t(a,{previews:c})]})}));export{n as default};
@@ -1 +0,0 @@
1
- import r,{css as o}from"styled-components";const t=r.div.withConfig({displayName:"content-editor.style__StyledContentEditable",componentId:"sc-9f20faef-0"})(["",""],(({namespace:r,rows:t,readOnly:e})=>o([".","-editable{min-height:","px;background-color:var(--colorsUtilityYang100);"," "," margin:0;padding:2px 8px;border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);:focus{outline:none;}}"],r,t&&t>2?21*t:210,!e&&"border-top: 1px solid var(--colorsUtilityMajor200);",e&&"\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100); \n ")));export{t as default};
@@ -1 +0,0 @@
1
- import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{AutoLinkNode as e}from"@lexical/link";import{useContext as o,useEffect as i}from"react";import{validateUrl as r}from"../../helpers.js";import n from"../../../text-editor.context.js";const l=()=>{const[l]=t(),{onLinkAdded:s}=o(n);return i((()=>{const t=l.registerMutationListener(e,((t,{prevEditorState:e})=>{if(l.isEditable())for(const[o,i]of t){const t=l.getElementByKey(o),n=null==t?void 0:t.innerText;if(n)r(n)&&(null==s||s(n,i));else{const t=null==e?void 0:e._nodeMap.get(o);if(t){const{__url:e}=t;null==s||s(e,i)}}}}),{skipInitialization:!1});return()=>{t()}}),[l,s]),null};export{l as default};
@@ -1 +0,0 @@
1
- import o from"styled-components";const t=o.div.withConfig({displayName:"placeholder.style__StyledPlaceholder",componentId:"sc-ef3f7290-0"})(["position:absolute;top:16px;color:var(--colorsUtilityYin055);left:10px;"]);export{t as default};
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { FormattingButtonProps } from "./common.types";
3
- declare const BoldButton: ({ isActive, namespace }: FormattingButtonProps) => React.JSX.Element;
4
- export default BoldButton;
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{FORMAT_TEXT_COMMAND as e}from"lexical";import"react";import{FormattingButton as r}from"../toolbar.style.js";import{TextEditorActionTypes as a}from"../../../constants.js";import i from"../../../../../../hooks/__internal__/useLocale/useLocale.js";const s=({isActive:s,namespace:l})=>{const m=i(),[c]=t();return o(r,{size:"small","aria-label":m.textEditor.boldAria(),onClick:()=>{c.isEditable()&&(c.focus(),c.dispatchCommand(e,a.Bold))},iconType:"bold",buttonType:s?"primary":"tertiary",isActive:s,"aria-pressed":s,"data-role":`${l}-bold-button`,tabIndex:0,className:"toolbar-button"})};export{s as default};
@@ -1,6 +0,0 @@
1
- export interface FormattingButtonProps {
2
- /** Whether the button is active or not, relative to the text at the current cursor position */
3
- isActive: boolean;
4
- /** The namespace of the editor that this button belongs to */
5
- namespace: string;
6
- }
@@ -1 +0,0 @@
1
- export{default as BoldButton}from"./bold.component.js";export{default as ItalicButton}from"./italic.component.js";export{default as ListControls}from"./list.component.js";export{default as SaveButton}from"./save.component.js";
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { FormattingButtonProps } from "./common.types";
3
- declare const ItalicButton: ({ isActive, namespace }: FormattingButtonProps) => React.JSX.Element;
4
- export default ItalicButton;
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{FORMAT_TEXT_COMMAND as a}from"lexical";import"react";import{FormattingButton as i}from"../toolbar.style.js";import{TextEditorActionTypes as e}from"../../../constants.js";import r from"../../../../../../hooks/__internal__/useLocale/useLocale.js";const s=({isActive:s,namespace:l})=>{const[c]=o(),m=r();return t(i,{size:"small","aria-label":m.textEditor.italicAria(),onClick:()=>(c.isEditable()&&c.focus(),void c.dispatchCommand(a,e.Italic)),iconType:"italic",buttonType:s?"primary":"tertiary",isActive:s,"aria-pressed":s,"data-role":`${l}-italic-button`,tabIndex:-1,className:"toolbar-button"})};export{s as default};
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- declare const ListControls: ({ namespace }: {
3
- namespace: string;
4
- }) => React.JSX.Element;
5
- export default ListControls;
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{INSERT_ORDERED_LIST_COMMAND as n,insertList as i,INSERT_UNORDERED_LIST_COMMAND as o,REMOVE_LIST_COMMAND as l,removeList as s,ListNode as a,ListItemNode as d,$isListNode as u,$isListItemNode as c,$createListNode as f}from"@lexical/list";import{useLexicalComposerContext as m}from"@lexical/react/LexicalComposerContext";import{mergeRegister as g}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as p,$getSelection as b,$isRangeSelection as h,$getNodeByKey as v}from"lexical";import{useState as y,useCallback as C,useEffect as x}from"react";import{FormattingButton as L}from"../toolbar.style.js";import{TextEditorActionTypes as S}from"../../../constants.js";import E from"../../../../../../hooks/__internal__/useLocale/useLocale.js";const T=({namespace:T})=>{const[A]=m(),_=E(),[P,k]=y(!1),[N,j]=y(!1);A.registerCommand(n,(()=>(i(A,S.OrderedList),!0)),p),A.registerCommand(o,(()=>(i(A,S.UnorderedList),!0)),p),A.registerCommand(l,(()=>(s(A),!0)),p);const B=e=>{let t=e;for(;null!==t;){if(t instanceof d)return t;t=null==t?void 0:t.getParent()}return null},w=C((()=>{const e=b();if(!e)return k(!1),void j(!1);const t=e.getNodes();if(0===t.length)return k(!1),void j(!1);const r=t.map(B).find((e=>null!==e));if(!r)return k(!1),void j(!1);let n=r.getParent();for(;n&&!(n instanceof a);)n=n.getParent();n instanceof a?(k("number"===n.getListType()),j("bullet"===n.getListType())):(k(!1),j(!1))}),[]);x((()=>g(A.registerUpdateListener((({editorState:e})=>{e.read((()=>{A.isEditable()&&w()}))})))),[w,A]);const K=e=>{A.update((()=>{const t=b();if(!h(t))return;let r=t.anchor.getNode().getParent();for(;r&&!u(r);)r=r.getParent();if(!r)return;const n=t.getNodes().map((e=>"list"===e.getType()?e:null)).filter((e=>null!==e));if(n.length>1)return i=e,void n.forEach((e=>{A.update((()=>{e.setListType(i)}))}));var i;const o=[],l=[],s=[],a=t.getNodes().map((e=>{let t=e.getParent();if(!c(t)){const e=null==t?void 0:t.getType();if(!e||!["link","autolink"].includes(e))return null;var n;t=null!==(n=null==t?void 0:t.getParent())&&void 0!==n?n:null}const i=null==t?void 0:t.getKey();return i!==(null==r?void 0:r.getKey())?i:null})).filter((e=>null!=e)),d=r.getChildrenKeys(),m=Array.from(new Set(a)),{beforeSubset:g,subset:p,afterSubset:y}=function(e,t){let r=-1;for(let n=0;n<=e.length-t.length;n++)if(e.slice(n,n+t.length).toString()===t.toString()){r=n;break}if(-1===r)throw new Error("Subset B not found in array A");return 0===r&&t.length===e.length?{beforeSubset:[],subset:e,afterSubset:[]}:{beforeSubset:e.slice(0,r),subset:e.slice(r,r+t.length),afterSubset:e.slice(r+t.length)}}(d,m);g.forEach((e=>{const t=v(e);c(t)&&o.push(t)})),p.forEach((e=>{const t=v(e);c(t)&&l.push(t)})),y.forEach((e=>{const t=v(e);c(t)&&s.push(t)}));const C=r.getListType(),x=f(C),L=f(e),S=f(C);x.append(...o),L.append(...l),S.append(...s),x.getChildren().length>0&&r.insertBefore(x),L.getChildren().length>0&&(x.getChildren().length>0?x.insertAfter(L):r.insertBefore(L)),S.getChildren().length>0&&(L.getChildren().length>0?L.insertAfter(S):x.getChildren().length>0?x.insertAfter(S):r.insertBefore(S)),r.remove()}))};return e(t,{children:[r(L,{size:"small","aria-label":_.textEditor.unorderedListAria(),onClick:()=>P?K("bullet"):void(A.isEditable()&&(A.focus(),N?(A.dispatchCommand(l,void 0),j(!1)):(A.dispatchCommand(o,void 0),j(!0)),k(!1))),iconType:"bullet_list_dotted",buttonType:N?"primary":"tertiary",isActive:N,"aria-pressed":N,"data-role":`${T}-unordered-list-button`,tabIndex:-1,className:"toolbar-button"}),r(L,{size:"small","aria-label":_.textEditor.orderedListAria(),onClick:()=>N?K("number"):void(A.isEditable()&&(A.focus(),P?(A.dispatchCommand(l,void 0),k(!1)):(A.dispatchCommand(n,void 0),k(!0)),j(!1))),iconType:"bullet_list_numbers",buttonType:P?"primary":"tertiary",isActive:P,"aria-pressed":P,"data-role":`${T}-ordered-list-button`,tabIndex:-1,className:"toolbar-button"})]})};export{T as default};
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- interface SaveObjectProps {
3
- detail: number;
4
- format: number;
5
- mode: string;
6
- style: string;
7
- text: string;
8
- type: string;
9
- version: number;
10
- }
11
- interface SaveProps {
12
- children: SaveObjectProps[];
13
- }
14
- export interface EditorFormattedValues {
15
- htmlString?: string;
16
- json?: {
17
- root: {
18
- children: SaveProps[];
19
- direction: string;
20
- format: string;
21
- indent: number;
22
- type: string;
23
- version: string;
24
- };
25
- };
26
- }
27
- interface SaveButtonProps {
28
- /** The namespace of the editor that this button belongs to */
29
- namespace: string;
30
- /** The callback to call when the save button is clicked */
31
- onSave: (value: EditorFormattedValues) => void;
32
- }
33
- declare const SaveButton: ({ namespace, onSave }: SaveButtonProps) => React.JSX.Element;
34
- export default SaveButton;
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import"react";import{SerializeLexical as e}from"../../../helpers.js";import r from"../../../../../button/button.component.js";import a from"../../../../../../hooks/__internal__/useLocale/useLocale.js";const n=({namespace:n,onSave:i})=>{const[s]=o(),l=a();return t(r,{"data-role":`${n}-save-button`,buttonType:"primary","aria-label":l.textEditor.saveButtonAria(),onClick:()=>{if(!s.isEditable())return;const t=e(s);null==i||i(t)},children:l.textEditor.saveButton()})};export{n as default};
@@ -1,15 +0,0 @@
1
- import { LexicalEditor } from "lexical";
2
- import React from "react";
3
- import { EditorFormattedValues } from "./buttons/save.component";
4
- interface ToolbarProps {
5
- /** The namespace of the editor that this toolbar belongs to */
6
- namespace: string;
7
- /** Determines if the Text Editor has a header */
8
- hasHeader?: boolean;
9
- /** The callback to call when the cancel button is clicked */
10
- onCancel?: (editor: LexicalEditor) => void;
11
- /** The callback to call when the save button is clicked */
12
- onSave?: (value: EditorFormattedValues) => void;
13
- }
14
- declare const Toolbar: ({ namespace, hasHeader, onCancel, onSave }: ToolbarProps) => React.JSX.Element;
15
- export default Toolbar;
@@ -1 +0,0 @@
1
- import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{mergeRegister as r}from"@lexical/utils";import{$getSelection as n,$isRangeSelection as a}from"lexical";import{useRef as l,useState as i,useLayoutEffect as s,useCallback as c,useEffect as m}from"react";import{StyledToolbar as d,FormattingButtons as u,CommandButtons as p}from"./toolbar.style.js";import{TextEditorActionTypes as f}from"../../constants.js";import b from"../../../../button/button.component.js";import h from"../../../../../hooks/__internal__/useLocale/useLocale.js";import v from"./buttons/bold.component.js";import x from"./buttons/italic.component.js";import j from"./buttons/list.component.js";import y from"./buttons/save.component.js";const A=({namespace:A,hasHeader:L,onCancel:g,onSave:E})=>{const[k]=e(),$=l(null),[w,C]=i(!1),[S,_]=i(!1),[B,F]=i([]);s((()=>{const t=document.querySelectorAll(`[data-role="${A}-formatting-buttons"] button`);F(Array.from(t))}),[A]);const H=h(),I=c((()=>{const t=n();a(t)&&(C(t.hasFormat(f.Bold)),_(t.hasFormat(f.Italic)))}),[]);return m((()=>r(k.registerUpdateListener((({editorState:t})=>{t.read((()=>{k.isEditable()&&I()}))})))),[I,k]),m((()=>{var t;const o=$.current,e=t=>{const o=B.findIndex((t=>t===document.activeElement));if("ArrowRight"===t.key){const t=(o+1)%B.length;B[t].focus()}else if("ArrowLeft"===t.key){const t=(o-1+B.length)%B.length;B[t].focus()}};return null===(t=$.current)||void 0===t||t.addEventListener("keydown",e),()=>{null==o||o.removeEventListener("keydown",e)}}),[B]),t(d,{role:"toolbar",hasHeader:L,"aria-label":H.textEditor.toolbarAriaLabel(),"data-role":`${A}-toolbar`,id:`${A}-toolbar`,ref:$,children:[t(u,{"data-role":`${A}-formatting-buttons`,children:[o(v,{isActive:w,namespace:A}),o(x,{isActive:S,namespace:A}),o(j,{namespace:A})]}),t(p,{"data-role":`${A}-command-buttons`,children:[g&&o(b,{buttonType:"tertiary","data-role":`${A}-cancel-button`,"aria-label":H.textEditor.cancelButtonAria(),onClick:()=>null==g?void 0:g(k),children:H.textEditor.cancelButton()}),E&&o(y,{namespace:A,onSave:E})]})]})};export{A as default};
@@ -1 +0,0 @@
1
- import o,{css as t}from"styled-components";import r from"../../../../button/button.component.js";const i=o.div.withConfig({displayName:"toolbar.style__StyledToolbar",componentId:"sc-9f02df-0"})(["display:flex;flex-direction:row;gap:8px;background-color:var(--colorsActionMajorYang100);padding:12px;border-top-left-radius:",";border-top-right-radius:",";border-bottom-left-radius:0;border-bottom-right-radius:0;justify-content:space-between;align-items:center;margin-left:1px;margin-right:1px;"],(({hasHeader:o})=>o?"0":"var(--borderRadius100)"),(({hasHeader:o})=>o?"0":"var(--borderRadius100)")),e=o.div.withConfig({displayName:"toolbar.style__FormattingButtons",componentId:"sc-9f02df-1"})(["display:flex;flex-direction:row;gap:8px;"]),a=o.div.withConfig({displayName:"toolbar.style__CommandButtons",componentId:"sc-9f02df-2"})(["display:flex;flex-direction:row;gap:8px;"]),n=o(r).withConfig({displayName:"toolbar.style__FormattingButton",componentId:"sc-9f02df-3"})(["display:inline-flex;justify-content:center;align-items:center;padding:6px;border-radius:var(--borderRadius100);border:medium;cursor:pointer;&:hover{> span{color:var(--colorsUtilityYang100) !important;}}"," > span{","}"],(({isActive:o})=>t(["background-color:",";"],o?"var(--colorsActionMajor600)":"transparent")),(({isActive:o})=>t(["color:"," !important;"],o?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin100) ")));export{a as CommandButtons,n as FormattingButton,e as FormattingButtons,i as StyledToolbar};
@@ -1 +0,0 @@
1
- export{default as AutoLinkerPlugin}from"./AutoLinker/auto-link.component.js";export{default as CharacterCounterPlugin}from"./CharacterCounter/character-counter.component.js";export{default as ContentEditor}from"./ContentEditor/content-editor.component.js";export{default as LinkMonitorPlugin}from"./LinkMonitor/link-monitor.plugin.js";export{default as LinkPreviewerPlugin}from"./LinkPreviewer/link-previewer.component.js";export{default as Placeholder}from"./Placeholder/placeholder.component.js";export{default as ToolbarPlugin}from"./Toolbar/toolbar.component.js";export{default as useCursorAtEnd}from"./useCursorAtEnd/index.js";
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { TextEditorProps } from "../text-editor.component";
3
- declare const ReadOnlyEditor: ({ namespace, initialValue, }: Partial<TextEditorProps>) => React.JSX.Element;
4
- export default ReadOnlyEditor;
@@ -1 +0,0 @@
1
- import{jsx as r}from"react/jsx-runtime";import{LexicalComposer as e}from"@lexical/react/LexicalComposer";import{ContentEditable as t}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as a}from"@lexical/react/LexicalErrorBoundary";import{RichTextPlugin as o}from"@lexical/react/LexicalRichTextPlugin";import{useMemo as i}from"react";import{createFromHTML as n}from"../utils.js";import{theme as l,markdownNodes as c}from"./constants.js";import m from"../../../__internal__/utils/logger/index.js";const s=r=>{let e;if(!r)return n("<p><br></p>");try{JSON.parse(r)&&(e=!0)}catch(r){e=!1}if(!e){if(/<[a-z][\s\S]*>/i.test(r))return n(r);const e=`<p dir="ltr"><span data-lexical-text="true">${(r=>r.replace(/((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/g,"<a href='$1'>$1</a>"))(r)}</span></p>`;return n(e)}return r},p=({namespace:n="carbon-rte-readonly",initialValue:p})=>{const d=i((()=>({namespace:n,nodes:c,onError:r=>m.error(r.message),theme:l,editorState:s(p),editable:!1})),[n,p]);return r(e,{initialConfig:d,children:r(o,{contentEditable:r(t,{"data-role":`${n}-content-editor`,"aria-autocomplete":void 0,"aria-readonly":void 0}),ErrorBoundary:a})})};export{p as default};
@@ -1,4 +0,0 @@
1
- declare const createFromHTML: (html: string) => string;
2
- /** Creates and returns a string representation of an empty editor */
3
- declare const createEmpty: () => string;
4
- export { createEmpty, createFromHTML };
@@ -1 +0,0 @@
1
- import{DeserializeHTML as r}from"./__internal__/helpers.js";const n=n=>r(n),e=()=>'{"root":{"children":[{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1}],"direction":null,"format":"","indent":0,"type":"root","version":1}}';export{e as createEmpty,n as createFromHTML};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@lexical/code"),t=require("@lexical/link"),i=require("@lexical/list"),o=require("@lexical/react/LexicalHorizontalRuleNode"),r=require("@lexical/rich-text");const l=[t.AutoLinkNode,e.CodeNode,t.LinkNode,i.ListNode,i.ListItemNode,r.HeadingNode,r.QuoteNode,o.HorizontalRuleNode];exports.COMPONENT_PREFIX="carbon-rte",exports.TextEditorActionTypes={Bold:"bold",Italic:"italic",OrderedList:"number",UnorderedList:"bullet"},exports.markdownNodes=l,exports.theme={text:{bold:"textBold",italic:"textItalic"}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@lexical/headless"),t=require("@lexical/html"),r=require("lexical"),s=require("./constants.js"),o=require("../../../__internal__/utils/logger/index.js");const n=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);exports.DeserializeHTML=n=>{const a=e.createHeadlessEditor({namespace:"html-to-json",onError:e=>o.default.error(e.message),theme:s.theme,nodes:s.markdownNodes});let i;if(a.update((()=>{const e=(new DOMParser).parseFromString(n,"text/html"),s=t.$generateNodesFromDOM(a,e);r.$getRoot().select();const o=r.$getSelection();if(o)try{o.insertNodes(s)}catch(e){i=e}}),{discrete:!0}),i)throw i;const l=a.getEditorState().toJSON();return JSON.stringify(l)},exports.SerializeLexical=e=>{let r,s;return e.read((()=>{const o=e.getEditorState();s=o.toJSON(),r=t.$generateHtmlFromNodes(e,null)})),{htmlString:r,json:s}},exports.validateUrl=function(e){return"https://"===e||n.test(e)};
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/AutoLinker/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("lexical");exports.default=({maxChars:s,editor:n})=>{const[o,i]=t.useState("");t.useEffect((()=>{const e=n.registerUpdateListener((()=>{n.getEditorState().read((()=>{const e=r.$getRoot().getTextContent();i(e)}))}));return()=>{e()}}),[n]);const a=t.useMemo((()=>{const e=s-(o?o.length:0);return e>=0?e:0}),[s,o]);return e.jsx(e.Fragment,{children:e.jsx("div",{"data-role":"visible-counter",children:a})})};
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- export interface CharacterCounterPluginProps {
3
- /** The maximum number of characters to allow before showing the warning */
4
- maxChars: number;
5
- /** The namespace of the editor that this counter belongs to */
6
- namespace: string;
7
- }
8
- declare const CharacterCounterPlugin: ({ maxChars, namespace, }: CharacterCounterPluginProps) => React.JSX.Element;
9
- export default CharacterCounterPlugin;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@lexical/react/LexicalComposerContext"),a=require("lexical"),o=require("./character-counter.style.js"),s=require("../../../../../hooks/__internal__/useDebounce/useDebounce.js"),n=require("../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({maxChars:c,namespace:u})=>{const[i,l]=t.useState(""),[d]=r.useLexicalComposerContext();t.useEffect((()=>{d.registerUpdateListener((({editorState:e})=>{e.read((()=>{const e=a.$getRoot().getChildren().map((e=>e.getTextContent())).join("\n\n");l(e)}))}))}),[d]);const x=n.default(),h=t.useCallback((e=>new Intl.NumberFormat(x.locale()).format(e)),[x]),[C,m]=t.useState(0),_=t.useMemo((()=>{const e=c-(i?i.length:0);return e>=0?e:0}),[i,c]),f=s.default((e=>{m(e||0)}),2e3);return t.useEffect((()=>{f(_)}),[_,f]),e.jsxs(e.Fragment,{children:[e.jsx(o.StyledCharacterCounter,{"data-role":`${u}-character-limit`,children:x.textEditor.characterCounter(h(_))}),e.jsx(o.VisuallyHiddenCharacterCounter,{"aria-live":"polite",children:x.textEditor.characterCounter(h(C))})]})};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../../../../style/utils/visually-hidden.js");function r(e){return e&&e.__esModule?e:{default:e}}var a=r(e);const o=a.default.div.withConfig({displayName:"character-counter.style__StyledCharacterCounter",componentId:"sc-6116dfd5-0"})(["text-align:left;font-size:var(--fontSizes100);margin-top:var(--spacing050);margin-bottom:var(--spacing050);color:var(--colorsUtilityYin055);"]),n=a.default.div.withConfig({displayName:"character-counter.style__VisuallyHiddenCharacterCounter",componentId:"sc-6116dfd5-1"})(['::after{content:" ";}',""],t.default);exports.StyledCharacterCounter=o,exports.VisuallyHiddenCharacterCounter=n,exports.default=o;
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/CharacterCounter/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- export interface ContentEditorProps {
3
- /** A hint string rendered before the editor but after the label. Intended to describe the purpose or content of the input. */
4
- inputHint?: string;
5
- /** The namespace of the editor that this content editor belongs to */
6
- namespace: string;
7
- /** The link previews to render at the foot of the editor */
8
- previews?: React.JSX.Element[];
9
- /** The number of rows to render in the editor */
10
- rows?: number;
11
- /** Whether the editor is read-only */
12
- readOnly?: boolean;
13
- /** Whether the editor is required */
14
- required?: boolean;
15
- /** Editor has an error */
16
- error?: boolean;
17
- /** Editor has a warning */
18
- warning?: boolean;
19
- /** Render the ValidationMessage above the Editor */
20
- validationMessagePositionTop?: boolean;
21
- }
22
- declare const ContentEditor: React.ForwardRefExoticComponent<ContentEditorProps & React.RefAttributes<HTMLDivElement>>;
23
- export default ContentEditor;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalContentEditable"),i=require("react"),a=require("./content-editor.style.js");require("../AutoLinker/auto-link.component.js"),require("@lexical/react/LexicalComposerContext"),require("lexical"),require("../CharacterCounter/character-counter.style.js"),require("lodash/debounce"),require("../../../../../__internal__/i18n-context/index.js"),require("@lexical/link"),require("@lexical/headless"),require("@lexical/html"),require("@lexical/code"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("../../../text-editor.context.js");var t=require("../LinkPreviewer/link-previewer.component.js");require("../Placeholder/placeholder.style.js"),require("@lexical/utils"),require("../Toolbar/toolbar.style.js"),require("../../../../button/button.component.js");var l=require("../useCursorAtEnd/index.js");const o=i.forwardRef((({inputHint:i,namespace:o,previews:n=[],rows:s,readOnly:u,required:c,error:d,warning:x,validationMessagePositionTop:q},b)=>{const p=l.default(),j=d||x?`${o}-validation-message`:"",v=i?`${o}-input-hint`:"",m=(q?`${j} ${v}`:`${v} ${j}`).trim();return e.jsxs(a.default,{"data-role":`${o}-content-editable`,namespace:o,rows:s,readOnly:u,children:[e.jsx(r.ContentEditable,{ref:b,"aria-describedby":m,"aria-labelledby":`${o}-label`,"aria-required":c,"aria-invalid":d,className:`${o}-editable`,"data-role":`${o}-editable`,onFocus:e=>{e.relatedTarget&&e.relatedTarget.classList.contains("toolbar-button")||p(e)},"aria-autocomplete":void 0,"aria-readonly":void 0}),e.jsx(t.default,{previews:n})]})}));exports.default=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("styled-components");function e(r){return r&&r.__esModule?r:{default:r}}const o=e(r).default.div.withConfig({displayName:"content-editor.style__StyledContentEditable",componentId:"sc-9f20faef-0"})(["",""],(({namespace:e,rows:o,readOnly:t})=>r.css([".","-editable{min-height:","px;background-color:var(--colorsUtilityYang100);"," "," margin:0;padding:2px 8px;border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);:focus{outline:none;}}"],e,o&&o>2?21*o:210,!t&&"border-top: 1px solid var(--colorsUtilityMajor200);",t&&"\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100); \n ")));exports.default=o;
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/ContentEditor/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/EditorRef/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/link"),r=require("react"),i=require("../../helpers.js"),n=require("../../../text-editor.context.js");exports.default=()=>{const[o]=e.useLexicalComposerContext(),{onLinkAdded:l}=r.useContext(n.default);return r.useEffect((()=>{const e=o.registerMutationListener(t.AutoLinkNode,((e,{prevEditorState:t})=>{if(o.isEditable())for(const[r,n]of e){const e=o.getElementByKey(r),s=null==e?void 0:e.innerText;if(s)i.validateUrl(s)&&(null==l||l(s,n));else{const e=null==t?void 0:t._nodeMap.get(r);if(e){const{__url:t}=e;null==l||l(t,n)}}}}),{skipInitialization:!1});return()=>{e()}}),[o,l]),null};
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/LinkMonitor/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/LinkPreviewer/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/Placeholder/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { FormattingButtonProps } from "./common.types";
3
- declare const BoldButton: ({ isActive, namespace }: FormattingButtonProps) => React.JSX.Element;
4
- export default BoldButton;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/react/LexicalComposerContext"),r=require("lexical");require("react");var a=require("../toolbar.style.js"),o=require("../../../constants.js"),i=require("../../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({isActive:s,namespace:l})=>{const c=i.default(),[u]=t.useLexicalComposerContext();return e.jsx(a.FormattingButton,{size:"small","aria-label":c.textEditor.boldAria(),onClick:()=>{u.isEditable()&&(u.focus(),u.dispatchCommand(r.FORMAT_TEXT_COMMAND,o.TextEditorActionTypes.Bold))},iconType:"bold",buttonType:s?"primary":"tertiary",isActive:s,"aria-pressed":s,"data-role":`${l}-bold-button`,tabIndex:0,className:"toolbar-button"})};
@@ -1,6 +0,0 @@
1
- export interface FormattingButtonProps {
2
- /** Whether the button is active or not, relative to the text at the current cursor position */
3
- isActive: boolean;
4
- /** The namespace of the editor that this button belongs to */
5
- namespace: string;
6
- }
@@ -1 +0,0 @@
1
- "use strict";var t=require("./bold.component.js"),e=require("./italic.component.js"),o=require("./list.component.js"),r=require("./save.component.js");exports.BoldButton=t.default,exports.ItalicButton=e.default,exports.ListControls=o.default,exports.SaveButton=r.default;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { FormattingButtonProps } from "./common.types";
3
- declare const ItalicButton: ({ isActive, namespace }: FormattingButtonProps) => React.JSX.Element;
4
- export default ItalicButton;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/react/LexicalComposerContext"),r=require("lexical");require("react");var a=require("../toolbar.style.js"),i=require("../../../constants.js"),o=require("../../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({isActive:s,namespace:l})=>{const[c]=t.useLexicalComposerContext(),u=o.default();return e.jsx(a.FormattingButton,{size:"small","aria-label":u.textEditor.italicAria(),onClick:()=>(c.isEditable()&&c.focus(),void c.dispatchCommand(r.FORMAT_TEXT_COMMAND,i.TextEditorActionTypes.Italic)),iconType:"italic",buttonType:s?"primary":"tertiary",isActive:s,"aria-pressed":s,"data-role":`${l}-italic-button`,tabIndex:-1,className:"toolbar-button"})};
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- declare const ListControls: ({ namespace }: {
3
- namespace: string;
4
- }) => React.JSX.Element;
5
- export default ListControls;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/list"),r=require("@lexical/react/LexicalComposerContext"),i=require("@lexical/utils"),n=require("lexical"),s=require("react"),o=require("../toolbar.style.js"),l=require("../../../constants.js"),a=require("../../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({namespace:d})=>{const[u]=r.useLexicalComposerContext(),c=a.default(),[g,f]=s.useState(!1),[m,p]=s.useState(!1);u.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,(()=>(t.insertList(u,l.TextEditorActionTypes.OrderedList),!0)),n.COMMAND_PRIORITY_LOW),u.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,(()=>(t.insertList(u,l.TextEditorActionTypes.UnorderedList),!0)),n.COMMAND_PRIORITY_LOW),u.registerCommand(t.REMOVE_LIST_COMMAND,(()=>(t.removeList(u),!0)),n.COMMAND_PRIORITY_LOW);const b=e=>{let r=e;for(;null!==r;){if(r instanceof t.ListItemNode)return r;r=null==r?void 0:r.getParent()}return null},h=s.useCallback((()=>{const e=n.$getSelection();if(!e)return f(!1),void p(!1);const r=e.getNodes();if(0===r.length)return f(!1),void p(!1);const i=r.map(b).find((e=>null!==e));if(!i)return f(!1),void p(!1);let s=i.getParent();for(;s&&!(s instanceof t.ListNode);)s=s.getParent();s instanceof t.ListNode?(f("number"===s.getListType()),p("bullet"===s.getListType())):(f(!1),p(!1))}),[]);s.useEffect((()=>i.mergeRegister(u.registerUpdateListener((({editorState:e})=>{e.read((()=>{u.isEditable()&&h()}))})))),[h,u]);const L=e=>{u.update((()=>{const r=n.$getSelection();if(!n.$isRangeSelection(r))return;let i=r.anchor.getNode().getParent();for(;i&&!t.$isListNode(i);)i=i.getParent();if(!i)return;const s=r.getNodes().map((e=>"list"===e.getType()?e:null)).filter((e=>null!==e));if(s.length>1)return o=e,void s.forEach((e=>{u.update((()=>{e.setListType(o)}))}));var o;const l=[],a=[],d=[],c=r.getNodes().map((e=>{let r=e.getParent();if(!t.$isListItemNode(r)){const e=null==r?void 0:r.getType();if(!e||!["link","autolink"].includes(e))return null;var n;r=null!==(n=null==r?void 0:r.getParent())&&void 0!==n?n:null}const s=null==r?void 0:r.getKey();return s!==(null==i?void 0:i.getKey())?s:null})).filter((e=>null!=e)),g=i.getChildrenKeys(),f=Array.from(new Set(c)),{beforeSubset:m,subset:p,afterSubset:b}=function(e,t){let r=-1;for(let i=0;i<=e.length-t.length;i++)if(e.slice(i,i+t.length).toString()===t.toString()){r=i;break}if(-1===r)throw new Error("Subset B not found in array A");return 0===r&&t.length===e.length?{beforeSubset:[],subset:e,afterSubset:[]}:{beforeSubset:e.slice(0,r),subset:e.slice(r,r+t.length),afterSubset:e.slice(r+t.length)}}(g,f);m.forEach((e=>{const r=n.$getNodeByKey(e);t.$isListItemNode(r)&&l.push(r)})),p.forEach((e=>{const r=n.$getNodeByKey(e);t.$isListItemNode(r)&&a.push(r)})),b.forEach((e=>{const r=n.$getNodeByKey(e);t.$isListItemNode(r)&&d.push(r)}));const h=i.getListType(),L=t.$createListNode(h),N=t.$createListNode(e),_=t.$createListNode(h);L.append(...l),N.append(...a),_.append(...d),L.getChildren().length>0&&i.insertBefore(L),N.getChildren().length>0&&(L.getChildren().length>0?L.insertAfter(N):i.insertBefore(N)),_.getChildren().length>0&&(N.getChildren().length>0?N.insertAfter(_):L.getChildren().length>0?L.insertAfter(_):i.insertBefore(_)),i.remove()}))};return e.jsxs(e.Fragment,{children:[e.jsx(o.FormattingButton,{size:"small","aria-label":c.textEditor.unorderedListAria(),onClick:()=>g?L("bullet"):void(u.isEditable()&&(u.focus(),m?(u.dispatchCommand(t.REMOVE_LIST_COMMAND,void 0),p(!1)):(u.dispatchCommand(t.INSERT_UNORDERED_LIST_COMMAND,void 0),p(!0)),f(!1))),iconType:"bullet_list_dotted",buttonType:m?"primary":"tertiary",isActive:m,"aria-pressed":m,"data-role":`${d}-unordered-list-button`,tabIndex:-1,className:"toolbar-button"}),e.jsx(o.FormattingButton,{size:"small","aria-label":c.textEditor.orderedListAria(),onClick:()=>m?L("number"):void(u.isEditable()&&(u.focus(),g?(u.dispatchCommand(t.REMOVE_LIST_COMMAND,void 0),f(!1)):(u.dispatchCommand(t.INSERT_ORDERED_LIST_COMMAND,void 0),f(!0)),p(!1))),iconType:"bullet_list_numbers",buttonType:g?"primary":"tertiary",isActive:g,"aria-pressed":g,"data-role":`${d}-ordered-list-button`,tabIndex:-1,className:"toolbar-button"})]})};
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/Toolbar/buttons/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- interface SaveObjectProps {
3
- detail: number;
4
- format: number;
5
- mode: string;
6
- style: string;
7
- text: string;
8
- type: string;
9
- version: number;
10
- }
11
- interface SaveProps {
12
- children: SaveObjectProps[];
13
- }
14
- export interface EditorFormattedValues {
15
- htmlString?: string;
16
- json?: {
17
- root: {
18
- children: SaveProps[];
19
- direction: string;
20
- format: string;
21
- indent: number;
22
- type: string;
23
- version: string;
24
- };
25
- };
26
- }
27
- interface SaveButtonProps {
28
- /** The namespace of the editor that this button belongs to */
29
- namespace: string;
30
- /** The callback to call when the save button is clicked */
31
- onSave: (value: EditorFormattedValues) => void;
32
- }
33
- declare const SaveButton: ({ namespace, onSave }: SaveButtonProps) => React.JSX.Element;
34
- export default SaveButton;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/react/LexicalComposerContext");require("react");var r=require("../../../helpers.js"),a=require("../../../../../button/button.component.js"),o=require("../../../../../../hooks/__internal__/useLocale/useLocale.js");exports.default=({namespace:i,onSave:u})=>{const[s]=t.useLexicalComposerContext(),l=o.default();return e.jsx(a.default,{"data-role":`${i}-save-button`,buttonType:"primary","aria-label":l.textEditor.saveButtonAria(),onClick:()=>{if(!s.isEditable())return;const e=r.SerializeLexical(s);null==u||u(e)},children:l.textEditor.saveButton()})};
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "main": "./index.js",
4
- "module": "../../../esm/components/text-editor/__internal__/plugins/Toolbar/index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,15 +0,0 @@
1
- import { LexicalEditor } from "lexical";
2
- import React from "react";
3
- import { EditorFormattedValues } from "./buttons/save.component";
4
- interface ToolbarProps {
5
- /** The namespace of the editor that this toolbar belongs to */
6
- namespace: string;
7
- /** Determines if the Text Editor has a header */
8
- hasHeader?: boolean;
9
- /** The callback to call when the cancel button is clicked */
10
- onCancel?: (editor: LexicalEditor) => void;
11
- /** The callback to call when the save button is clicked */
12
- onSave?: (value: EditorFormattedValues) => void;
13
- }
14
- declare const Toolbar: ({ namespace, hasHeader, onCancel, onSave }: ToolbarProps) => React.JSX.Element;
15
- export default Toolbar;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/react/LexicalComposerContext"),o=require("@lexical/utils"),r=require("lexical"),a=require("react"),n=require("./toolbar.style.js"),s=require("../../constants.js"),l=require("../../../../button/button.component.js"),i=require("../../../../../hooks/__internal__/useLocale/useLocale.js"),u=require("./buttons/bold.component.js"),c=require("./buttons/italic.component.js"),d=require("./buttons/list.component.js"),m=require("./buttons/save.component.js");exports.default=({namespace:b,hasHeader:f,onCancel:x,onSave:p})=>{const[j]=t.useLexicalComposerContext(),q=a.useRef(null),[v,y]=a.useState(!1),[h,g]=a.useState(!1),[E,A]=a.useState([]);a.useLayoutEffect((()=>{const e=document.querySelectorAll(`[data-role="${b}-formatting-buttons"] button`);A(Array.from(e))}),[b]);const L=i.default(),S=a.useCallback((()=>{const e=r.$getSelection();r.$isRangeSelection(e)&&(y(e.hasFormat(s.TextEditorActionTypes.Bold)),g(e.hasFormat(s.TextEditorActionTypes.Italic)))}),[]);return a.useEffect((()=>o.mergeRegister(j.registerUpdateListener((({editorState:e})=>{e.read((()=>{j.isEditable()&&S()}))})))),[S,j]),a.useEffect((()=>{var e;const t=q.current,o=e=>{const t=E.findIndex((e=>e===document.activeElement));if("ArrowRight"===e.key){const e=(t+1)%E.length;E[e].focus()}else if("ArrowLeft"===e.key){const e=(t-1+E.length)%E.length;E[e].focus()}};return null===(e=q.current)||void 0===e||e.addEventListener("keydown",o),()=>{null==t||t.removeEventListener("keydown",o)}}),[E]),e.jsxs(n.StyledToolbar,{role:"toolbar",hasHeader:f,"aria-label":L.textEditor.toolbarAriaLabel(),"data-role":`${b}-toolbar`,id:`${b}-toolbar`,ref:q,children:[e.jsxs(n.FormattingButtons,{"data-role":`${b}-formatting-buttons`,children:[e.jsx(u.default,{isActive:v,namespace:b}),e.jsx(c.default,{isActive:h,namespace:b}),e.jsx(d.default,{namespace:b})]}),e.jsxs(n.CommandButtons,{"data-role":`${b}-command-buttons`,children:[x&&e.jsx(l.default,{buttonType:"tertiary","data-role":`${b}-cancel-button`,"aria-label":L.textEditor.cancelButtonAria(),onClick:()=>null==x?void 0:x(j),children:L.textEditor.cancelButton()}),p&&e.jsx(m.default,{namespace:b,onSave:p})]})]})};
@@ -1 +0,0 @@
1
- "use strict";var t=require("styled-components"),o=require("../../../../button/button.component.js");function r(t){return t&&t.__esModule?t:{default:t}}var e=r(t);const a=e.default.div.withConfig({displayName:"toolbar.style__StyledToolbar",componentId:"sc-9f02df-0"})(["display:flex;flex-direction:row;gap:8px;background-color:var(--colorsActionMajorYang100);padding:12px;border-top-left-radius:",";border-top-right-radius:",";border-bottom-left-radius:0;border-bottom-right-radius:0;justify-content:space-between;align-items:center;margin-left:1px;margin-right:1px;"],(({hasHeader:t})=>t?"0":"var(--borderRadius100)"),(({hasHeader:t})=>t?"0":"var(--borderRadius100)")),i=e.default.div.withConfig({displayName:"toolbar.style__FormattingButtons",componentId:"sc-9f02df-1"})(["display:flex;flex-direction:row;gap:8px;"]),n=e.default.div.withConfig({displayName:"toolbar.style__CommandButtons",componentId:"sc-9f02df-2"})(["display:flex;flex-direction:row;gap:8px;"]),s=e.default(o.default).withConfig({displayName:"toolbar.style__FormattingButton",componentId:"sc-9f02df-3"})(["display:inline-flex;justify-content:center;align-items:center;padding:6px;border-radius:var(--borderRadius100);border:medium;cursor:pointer;&:hover{> span{color:var(--colorsUtilityYang100) !important;}}"," > span{","}"],(({isActive:o})=>t.css(["background-color:",";"],o?"var(--colorsActionMajor600)":"transparent")),(({isActive:o})=>t.css(["color:"," !important;"],o?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin100) ")));exports.CommandButtons=n,exports.FormattingButton=s,exports.FormattingButtons=i,exports.StyledToolbar=a;
@@ -1 +0,0 @@
1
- "use strict";var e=require("./AutoLinker/auto-link.component.js"),r=require("./CharacterCounter/character-counter.component.js"),o=require("./ContentEditor/content-editor.component.js"),t=require("./LinkMonitor/link-monitor.plugin.js"),n=require("./LinkPreviewer/link-previewer.component.js"),i=require("./Placeholder/placeholder.component.js"),u=require("./Toolbar/toolbar.component.js"),l=require("./useCursorAtEnd/index.js");exports.AutoLinkerPlugin=e.default,exports.CharacterCounterPlugin=r.default,exports.ContentEditor=o.default,exports.LinkMonitorPlugin=t.default,exports.LinkPreviewerPlugin=n.default,exports.Placeholder=i.default,exports.ToolbarPlugin=u.default,exports.useCursorAtEnd=l.default;