@procore/core-react 12.25.2 → 12.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/.jest/ckeditorMock.js +67 -0
  2. package/.jest/esToolkitMock.js +23 -0
  3. package/.jest/example.test.js +5 -0
  4. package/.jest/fileMock.js +1 -0
  5. package/.jest/public/avatar.png +0 -0
  6. package/.jest/setupTests.js +31 -0
  7. package/.jest/snapshotResolver.js +47 -0
  8. package/.jest/styleMock.js +1 -0
  9. package/.jest/styledV6PropsMock.js +23 -0
  10. package/.jest/svgTransform.js +10 -0
  11. package/.jest/testShims.js +22 -0
  12. package/.jest/translationMock.js +3 -0
  13. package/.jest/videoMock.js +1 -0
  14. package/CHANGELOG.md +17 -0
  15. package/README.md +49 -3
  16. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  17. package/dist/Avatar/Avatar.styles.js +5 -5
  18. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  19. package/dist/AvatarStack/mocks/getAvatarMocks.d.ts +25 -0
  20. package/dist/AvatarStack/mocks/getAvatarMocks.js +305 -0
  21. package/dist/AvatarStack/mocks/getAvatarMocks.js.map +1 -0
  22. package/dist/AvatarStack/mocks/images.d.ts +2 -0
  23. package/dist/AvatarStack/mocks/images.js +13 -0
  24. package/dist/AvatarStack/mocks/images.js.map +1 -0
  25. package/dist/AvatarStack/mocks/img/1.png +0 -0
  26. package/dist/AvatarStack/mocks/img/2.png +0 -0
  27. package/dist/AvatarStack/mocks/img/3.png +0 -0
  28. package/dist/AvatarStack/mocks/img/4.png +0 -0
  29. package/dist/AvatarStack/mocks/img/5.png +0 -0
  30. package/dist/AvatarStack/mocks/logo/1.png +0 -0
  31. package/dist/AvatarStack/mocks/logo/2.png +0 -0
  32. package/dist/AvatarStack/mocks/logo/3.png +0 -0
  33. package/dist/AvatarStack/mocks/logo/4.png +0 -0
  34. package/dist/AvatarStack/mocks/logo/5.png +0 -0
  35. package/dist/Badge/Badge.styles.js +2 -2
  36. package/dist/BadgePill/BadgePill.styles.js +4 -4
  37. package/dist/Banner/Banner.styles.js +10 -10
  38. package/dist/Box/Box.styles.js +1 -1
  39. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  40. package/dist/Button/Button.styles.js +5 -5
  41. package/dist/Calendar/Calendar.styles.js +8 -8
  42. package/dist/Card/Card.styles.js +1 -1
  43. package/dist/Checkbox/Checkbox.styles.js +6 -6
  44. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  45. package/dist/ContactItem/ContactItem.styles.js +5 -5
  46. package/dist/Content/Content.styles.js +2 -2
  47. package/dist/DateInput/DateInput.styles.js +6 -6
  48. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.d.ts +19 -0
  49. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js +159 -0
  50. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js.map +1 -0
  51. package/dist/{TextEditor/TextEditor.styles.js → DeprecatedTextEditor/DeprecatedTextEditor.styles.js} +1 -1
  52. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.styles.js.map +1 -0
  53. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.d.ts +72 -0
  54. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js +2 -0
  55. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js.map +1 -0
  56. package/dist/DeprecatedTextEditor/index.d.ts +2 -0
  57. package/dist/DeprecatedTextEditor/index.js +3 -0
  58. package/dist/DeprecatedTextEditor/index.js.map +1 -0
  59. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.d.ts +12 -0
  60. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js +45 -0
  61. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js.map +1 -0
  62. package/dist/{TextEditorOutput/TextEditorOutput.styles.js → DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js} +2 -2
  63. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js.map +1 -0
  64. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.d.ts +16 -0
  65. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js +2 -0
  66. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js.map +1 -0
  67. package/dist/DeprecatedTextEditorOutput/index.d.ts +2 -0
  68. package/dist/DeprecatedTextEditorOutput/index.js +2 -0
  69. package/dist/DeprecatedTextEditorOutput/index.js.map +1 -0
  70. package/dist/DetailPage/DetailPage.styles.js +7 -7
  71. package/dist/Dropdown/Dropdown.styles.js +3 -3
  72. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  73. package/dist/Dropzone/Dropzone.js +1 -1
  74. package/dist/Dropzone/Dropzone.styles.js +9 -9
  75. package/dist/EmptyState/EmptyState.styles.js +6 -6
  76. package/dist/EmptyState/assets/default.stories.png +0 -0
  77. package/dist/Field/Field.styles.js +3 -3
  78. package/dist/FileList/FileList.styles.js +4 -4
  79. package/dist/FileList/storybook/fileListMockData.d.ts +5 -0
  80. package/dist/FileList/storybook/fileListMockData.js +34 -0
  81. package/dist/FileList/storybook/fileListMockData.js.map +1 -0
  82. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  83. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  84. package/dist/FileSelect/FileSelect.styles.js +2 -2
  85. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  86. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  87. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  88. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  89. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  90. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  91. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  92. package/dist/FileToken/FileToken.styles.js +4 -4
  93. package/dist/FilterToken/FilterToken.styles.js +5 -5
  94. package/dist/FlexList/FlexList.styles.js +1 -1
  95. package/dist/Form/Form.js +1 -30
  96. package/dist/Form/Form.js.map +1 -1
  97. package/dist/Form/Form.styles.js +14 -14
  98. package/dist/Form/StyledFormikForm.styles.js +2 -2
  99. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  100. package/dist/Grid/Grid.styles.js +2 -2
  101. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  102. package/dist/GroupSelect/mocks/groupSelectMockData.d.ts +18 -0
  103. package/dist/GroupSelect/mocks/groupSelectMockData.js +122 -0
  104. package/dist/GroupSelect/mocks/groupSelectMockData.js.map +1 -0
  105. package/dist/Input/Input.styles.js +1 -1
  106. package/dist/Link/Link.styles.js +1 -1
  107. package/dist/ListPage/ListPage.styles.js +8 -8
  108. package/dist/Loader/Loader.styles.js +2 -2
  109. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  110. package/dist/Modal/Modal.styles.js +15 -15
  111. package/dist/Modal/Modal.styles.js.map +1 -1
  112. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  113. package/dist/NextMenu/NextMenu.styles.js +3 -3
  114. package/dist/NextTextEditor/EditorError.d.ts +2 -0
  115. package/dist/NextTextEditor/EditorError.js +9 -0
  116. package/dist/NextTextEditor/EditorError.js.map +1 -0
  117. package/dist/NextTextEditor/NextTextEditor.d.ts +3 -0
  118. package/dist/NextTextEditor/NextTextEditor.js +156 -0
  119. package/dist/NextTextEditor/NextTextEditor.js.map +1 -0
  120. package/dist/NextTextEditor/NextTextEditor.styles.d.ts +5 -0
  121. package/dist/NextTextEditor/NextTextEditor.styles.js +22 -0
  122. package/dist/NextTextEditor/NextTextEditor.styles.js.map +1 -0
  123. package/dist/NextTextEditor/NextTextEditor.types.d.ts +111 -0
  124. package/dist/NextTextEditor/NextTextEditor.types.js +2 -0
  125. package/dist/NextTextEditor/NextTextEditor.types.js.map +1 -0
  126. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.d.ts +5 -0
  127. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.js +2 -0
  128. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.js.map +1 -0
  129. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.d.ts +3 -0
  130. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.js +153 -0
  131. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.js.map +1 -0
  132. package/dist/NextTextEditor/StickyToolbar/index.d.ts +4 -0
  133. package/dist/NextTextEditor/StickyToolbar/index.js +3 -0
  134. package/dist/NextTextEditor/StickyToolbar/index.js.map +1 -0
  135. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.d.ts +2 -0
  136. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.js +49 -0
  137. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.js.map +1 -0
  138. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.d.ts +12 -0
  139. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.js +2 -0
  140. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -0
  141. package/dist/NextTextEditor/index.d.ts +2 -0
  142. package/dist/NextTextEditor/index.js +3 -0
  143. package/dist/NextTextEditor/index.js.map +1 -0
  144. package/dist/NextTextEditor/license_key.d.ts +2 -0
  145. package/dist/NextTextEditor/license_key.js +3 -0
  146. package/dist/NextTextEditor/license_key.js.map +1 -0
  147. package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.d.ts +5 -0
  148. package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.js +99 -0
  149. package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.js.map +1 -0
  150. package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.d.ts +5 -0
  151. package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.js +56 -0
  152. package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -0
  153. package/dist/NextTextEditor/plugins/CutPlugin/index.d.ts +1 -0
  154. package/dist/NextTextEditor/plugins/CutPlugin/index.js +2 -0
  155. package/dist/NextTextEditor/plugins/CutPlugin/index.js.map +1 -0
  156. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +5 -0
  157. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +40 -0
  158. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -0
  159. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +1 -0
  160. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.js +2 -0
  161. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -0
  162. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.d.ts +15 -0
  163. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js +65 -0
  164. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js.map +1 -0
  165. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.d.ts +13 -0
  166. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js +80 -0
  167. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js.map +1 -0
  168. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +5 -0
  169. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +86 -0
  170. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +1 -0
  171. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +5 -0
  172. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +56 -0
  173. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -0
  174. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.d.ts +1 -0
  175. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.js +2 -0
  176. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -0
  177. package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.d.ts +5 -0
  178. package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.js +149 -0
  179. package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -0
  180. package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.d.ts +5 -0
  181. package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.js +56 -0
  182. package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -0
  183. package/dist/NextTextEditor/plugins/PastePlugin/index.d.ts +1 -0
  184. package/dist/NextTextEditor/plugins/PastePlugin/index.js +2 -0
  185. package/dist/NextTextEditor/plugins/PastePlugin/index.js.map +1 -0
  186. package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +6 -0
  187. package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +87 -0
  188. package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -0
  189. package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.d.ts +1 -0
  190. package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.js +2 -0
  191. package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.js.map +1 -0
  192. package/dist/NextTextEditor/textEditorTheming/icons.d.ts +23 -0
  193. package/dist/NextTextEditor/textEditorTheming/icons.js +24 -0
  194. package/dist/NextTextEditor/textEditorTheming/icons.js.map +1 -0
  195. package/dist/NextTextEditor/textEditorTheming/index.d.ts +1 -0
  196. package/dist/NextTextEditor/textEditorTheming/index.js +2 -0
  197. package/dist/NextTextEditor/textEditorTheming/index.js.map +1 -0
  198. package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.d.ts +2 -0
  199. package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.js +10 -0
  200. package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -0
  201. package/dist/NextTextEditor/useCKEditorCss.d.ts +3 -0
  202. package/dist/NextTextEditor/useCKEditorCss.js +36 -0
  203. package/dist/NextTextEditor/useCKEditorCss.js.map +1 -0
  204. package/dist/NextTextEditor/useTabAsNavigation.d.ts +11 -0
  205. package/dist/NextTextEditor/useTabAsNavigation.js +29 -0
  206. package/dist/NextTextEditor/useTabAsNavigation.js.map +1 -0
  207. package/dist/NextTextEditor/utils/config.d.ts +3 -0
  208. package/dist/NextTextEditor/utils/config.js +179 -0
  209. package/dist/NextTextEditor/utils/config.js.map +1 -0
  210. package/dist/NextTextEditor/utils/index.d.ts +2 -0
  211. package/dist/NextTextEditor/utils/index.js +3 -0
  212. package/dist/NextTextEditor/utils/index.js.map +1 -0
  213. package/dist/NextTextEditor/utils/locale.d.ts +3 -0
  214. package/dist/NextTextEditor/utils/locale.js +102 -0
  215. package/dist/NextTextEditor/utils/locale.js.map +1 -0
  216. package/dist/NextTextEditor/utils/plugins.d.ts +7 -0
  217. package/dist/NextTextEditor/utils/plugins.js +184 -0
  218. package/dist/NextTextEditor/utils/plugins.js.map +1 -0
  219. package/dist/NextTextEditorOutput/NextTextEditorOutput.d.ts +9 -0
  220. package/dist/NextTextEditorOutput/NextTextEditorOutput.js +29 -0
  221. package/dist/NextTextEditorOutput/NextTextEditorOutput.js.map +1 -0
  222. package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.d.ts +2 -0
  223. package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js +6 -0
  224. package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js.map +1 -0
  225. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.d.ts +9 -0
  226. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js +2 -0
  227. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js.map +1 -0
  228. package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.d.ts +2 -0
  229. package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.js +59 -0
  230. package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.js.map +1 -0
  231. package/dist/NextTextEditorOutput/index.d.ts +2 -0
  232. package/dist/NextTextEditorOutput/index.js +2 -0
  233. package/dist/NextTextEditorOutput/index.js.map +1 -0
  234. package/dist/Notation/Notation.js +1 -1
  235. package/dist/NumberInput/NumberInput.styles.js +7 -7
  236. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  237. package/dist/PageLayout/PageLayout.styles.js +16 -16
  238. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  239. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  240. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  241. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  242. package/dist/Pagination/Pagination.styles.js +5 -5
  243. package/dist/Panel/Panel.styles.js +13 -13
  244. package/dist/Panel/Panel.styles.js.map +1 -1
  245. package/dist/Pill/Pill.styles.js +3 -3
  246. package/dist/PillSelect/PillSelect.styles.js +4 -4
  247. package/dist/Popover/Popover.styles.js +2 -2
  248. package/dist/Portal/Portal.styles.js +1 -1
  249. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  250. package/dist/RadioButton/RadioButton.styles.js +3 -3
  251. package/dist/Required/Required.styles.js +3 -3
  252. package/dist/Search/Search.styles.js +5 -5
  253. package/dist/Section/Section.styles.js +7 -7
  254. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  255. package/dist/Select/Select.styles.js +7 -7
  256. package/dist/Semantic/Semantic.styles.js +9 -9
  257. package/dist/Slider/Slider.styles.js +5 -5
  258. package/dist/Spinner/Spinner.js +5 -7
  259. package/dist/Spinner/Spinner.js.map +1 -1
  260. package/dist/Spinner/Spinner.styles.js +7 -7
  261. package/dist/SplitViewCard/SplitViewCard.styles.js +10 -10
  262. package/dist/SplitViewCard/SplitViewCard.styles.js.map +1 -1
  263. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  264. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  265. package/dist/Switch/Switch.styles.js +4 -4
  266. package/dist/Table/Table.styles.js +28 -28
  267. package/dist/TableShelf/TableShelf.styles.js +5 -5
  268. package/dist/Tabs/Tabs.styles.js +15 -15
  269. package/dist/Tearsheet/Tearsheet.styles.js +7 -7
  270. package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
  271. package/dist/Tearsheet/storybook/PageLayoutDemo.d.ts +4 -0
  272. package/dist/Tearsheet/storybook/PageLayoutDemo.js +164 -0
  273. package/dist/Tearsheet/storybook/PageLayoutDemo.js.map +1 -0
  274. package/dist/TextArea/TextArea.styles.js +1 -1
  275. package/dist/TextEditor/TextEditor.d.ts +2 -19
  276. package/dist/TextEditor/TextEditor.js +11 -169
  277. package/dist/TextEditor/TextEditor.js.map +1 -1
  278. package/dist/TextEditor/TextEditor.types.d.ts +19 -86
  279. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  280. package/dist/TextEditor/TextEditorDocs.types.d.ts +65 -0
  281. package/dist/TextEditor/TextEditorDocs.types.js +2 -0
  282. package/dist/TextEditor/TextEditorDocs.types.js.map +1 -0
  283. package/dist/TextEditor/TextEditorProvider.d.ts +4 -0
  284. package/dist/TextEditor/TextEditorProvider.js +17 -0
  285. package/dist/TextEditor/TextEditorProvider.js.map +1 -0
  286. package/dist/TextEditor/TextEditorProvider.types.d.ts +14 -0
  287. package/dist/TextEditor/TextEditorProvider.types.js +2 -0
  288. package/dist/TextEditor/TextEditorProvider.types.js.map +1 -0
  289. package/dist/TextEditor/index.d.ts +4 -2
  290. package/dist/TextEditor/index.js +2 -1
  291. package/dist/TextEditor/index.js.map +1 -1
  292. package/dist/TextEditorOutput/TextEditorOutput.d.ts +6 -8
  293. package/dist/TextEditorOutput/TextEditorOutput.js +17 -34
  294. package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
  295. package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +16 -13
  296. package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
  297. package/dist/TextEditorOutput/TextEditorOutputDocs.types.d.ts +21 -0
  298. package/dist/TextEditorOutput/TextEditorOutputDocs.types.js +2 -0
  299. package/dist/TextEditorOutput/TextEditorOutputDocs.types.js.map +1 -0
  300. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  301. package/dist/Thumbnail/mocks/images/thumb_104x104_1.png +0 -0
  302. package/dist/Thumbnail/mocks/images/thumb_104x104_2.png +0 -0
  303. package/dist/Thumbnail/mocks/images/thumb_104x104_3.png +0 -0
  304. package/dist/Thumbnail/mocks/images/thumb_104x104_4.png +0 -0
  305. package/dist/Thumbnail/mocks/images/thumb_40x40_1.png +0 -0
  306. package/dist/Thumbnail/mocks/images/thumb_40x40_2.png +0 -0
  307. package/dist/Thumbnail/mocks/images/thumb_40x40_3.png +0 -0
  308. package/dist/Thumbnail/mocks/images/thumb_40x40_4.png +0 -0
  309. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  310. package/dist/TieredSelect/TierSelectionTieredSelect.js +3 -1
  311. package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
  312. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  313. package/dist/TieredSelect/TieredSelect.types.d.ts +4 -0
  314. package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
  315. package/dist/Tile/Tile.styles.js +8 -8
  316. package/dist/Tile/mocks/dog.jpeg +0 -0
  317. package/dist/Tile/mocks/iframe.d.ts +5 -0
  318. package/dist/Tile/mocks/iframe.js +15 -0
  319. package/dist/Tile/mocks/iframe.js.map +1 -0
  320. package/dist/Tile/mocks/svg.d.ts +3 -0
  321. package/dist/Tile/mocks/svg.js +830 -0
  322. package/dist/Tile/mocks/svg.js.map +1 -0
  323. package/dist/Tile/mocks/video.mp4 +0 -0
  324. package/dist/Title/Title.styles.js +7 -7
  325. package/dist/Title/mocks/thumb_40x40_1.png +0 -0
  326. package/dist/Title/mocks/visual_placeholder_40x40.svg +9 -0
  327. package/dist/Toast/Toast.styles.js +3 -3
  328. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  329. package/dist/Token/Token.styles.js +3 -3
  330. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  331. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  332. package/dist/Tooltip/Tooltip.styles.js +2 -2
  333. package/dist/Tree/Tree.styles.js +9 -9
  334. package/dist/Tree/mocks/treeMockData.d.ts +8 -0
  335. package/dist/Tree/mocks/treeMockData.js +44 -0
  336. package/dist/Tree/mocks/treeMockData.js.map +1 -0
  337. package/dist/Typeahead/Typeahead.styles.js +3 -3
  338. package/dist/Typography/Typography.styles.js +1 -1
  339. package/dist/Typography/Typography.table.story.js +2 -2
  340. package/dist/_storyHelpers_/components/Deprecation.d.ts +3 -0
  341. package/dist/_storyHelpers_/components/Deprecation.js +10 -0
  342. package/dist/_storyHelpers_/components/Deprecation.js.map +1 -0
  343. package/dist/_storyHelpers_/components/Deprecation.styles.d.ts +4 -0
  344. package/dist/_storyHelpers_/components/Deprecation.styles.js +7 -0
  345. package/dist/_storyHelpers_/components/Deprecation.styles.js.map +1 -0
  346. package/dist/_storyHelpers_/components/Deprecation.types.d.ts +9 -0
  347. package/dist/_storyHelpers_/components/Deprecation.types.js +2 -0
  348. package/dist/_storyHelpers_/components/Deprecation.types.js.map +1 -0
  349. package/dist/_storyHelpers_/components/FullLayout.d.ts +6 -0
  350. package/dist/_storyHelpers_/components/FullLayout.js +15 -0
  351. package/dist/_storyHelpers_/components/FullLayout.js.map +1 -0
  352. package/dist/_storyHelpers_/components/StoryGrid.d.ts +7 -0
  353. package/dist/_storyHelpers_/components/StoryGrid.js +40 -0
  354. package/dist/_storyHelpers_/components/StoryGrid.js.map +1 -0
  355. package/dist/_storyHelpers_/components/WithNavigationLayout.d.ts +2 -0
  356. package/dist/_storyHelpers_/components/WithNavigationLayout.js +47 -0
  357. package/dist/_storyHelpers_/components/WithNavigationLayout.js.map +1 -0
  358. package/dist/_storyHelpers_/constants.d.ts +35 -0
  359. package/dist/_storyHelpers_/constants.js +168 -0
  360. package/dist/_storyHelpers_/constants.js.map +1 -0
  361. package/dist/_storyHelpers_/decorators/fullLayoutDecorator.d.ts +3 -0
  362. package/dist/_storyHelpers_/decorators/fullLayoutDecorator.js +8 -0
  363. package/dist/_storyHelpers_/decorators/fullLayoutDecorator.js.map +1 -0
  364. package/dist/_storyHelpers_/effects/useWaitForElement.d.ts +1 -0
  365. package/dist/_storyHelpers_/effects/useWaitForElement.js +24 -0
  366. package/dist/_storyHelpers_/effects/useWaitForElement.js.map +1 -0
  367. package/dist/_storyHelpers_/mocks/dropzoneMockData.d.ts +13 -0
  368. package/dist/_storyHelpers_/mocks/dropzoneMockData.js +39 -0
  369. package/dist/_storyHelpers_/mocks/dropzoneMockData.js.map +1 -0
  370. package/dist/_storyHelpers_/mocks/pillSelectMockData.d.ts +6 -0
  371. package/dist/_storyHelpers_/mocks/pillSelectMockData.js +22 -0
  372. package/dist/_storyHelpers_/mocks/pillSelectMockData.js.map +1 -0
  373. package/dist/_storyHelpers_/mocks/selectMockData.d.ts +11 -0
  374. package/dist/_storyHelpers_/mocks/selectMockData.js +36 -0
  375. package/dist/_storyHelpers_/mocks/selectMockData.js.map +1 -0
  376. package/dist/_storyHelpers_/mocks/tableMockData.d.ts +4 -0
  377. package/dist/_storyHelpers_/mocks/tableMockData.js +38 -0
  378. package/dist/_storyHelpers_/mocks/tableMockData.js.map +1 -0
  379. package/dist/_storyHelpers_/mocks/tieredSelect.d.ts +77 -0
  380. package/dist/_storyHelpers_/mocks/tieredSelect.js +277 -0
  381. package/dist/_storyHelpers_/mocks/tieredSelect.js.map +1 -0
  382. package/dist/_styles/mixins.d.ts +4 -0
  383. package/dist/_styles/mixins.js +7 -0
  384. package/dist/_styles/mixins.js.map +1 -1
  385. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  386. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  387. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  388. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  389. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  390. package/dist/_typedoc/Box/Box.types.json +68 -68
  391. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  392. package/dist/_typedoc/Button/Button.types.json +13 -13
  393. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  394. package/dist/_typedoc/Card/Card.types.json +6 -6
  395. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  396. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  397. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  398. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  399. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  400. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  401. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
  402. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  403. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  404. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  405. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  406. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  407. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  408. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  409. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  410. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  411. package/dist/_typedoc/Form/Form.types.json +929 -773
  412. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  413. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  414. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  415. package/dist/_typedoc/Input/Input.types.json +2 -2
  416. package/dist/_typedoc/Link/Link.types.json +1 -1
  417. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  418. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  419. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  420. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  421. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  422. package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
  423. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  424. package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
  425. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
  426. package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
  427. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  428. package/dist/_typedoc/Panel/Panel.types.json +30 -30
  429. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  430. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  431. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  432. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  433. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  434. package/dist/_typedoc/Required/Required.types.json +5 -5
  435. package/dist/_typedoc/Search/Search.types.json +18 -18
  436. package/dist/_typedoc/Section/Section.types.json +15 -15
  437. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  438. package/dist/_typedoc/Select/Select.types.json +60 -60
  439. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  440. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  441. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  442. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  443. package/dist/_typedoc/Table/Table.types.json +101 -101
  444. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  445. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  446. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  447. package/dist/_typedoc/TextEditor/TextEditor.types.json +1 -100
  448. package/dist/_typedoc/TextEditor/TextEditorDocs.types.json +98 -0
  449. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +28 -0
  450. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +6 -42
  451. package/dist/_typedoc/TextEditorOutput/TextEditorOutputDocs.types.json +38 -0
  452. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  453. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  454. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  455. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  456. package/dist/_typedoc/Title/Title.types.json +1 -1
  457. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  458. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  459. package/dist/_typedoc/Token/Token.types.json +6 -6
  460. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  461. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  462. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  463. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  464. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  465. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  466. package/dist/_typedoc/_utils/types.json +3 -3
  467. package/dist/_typedoc/deprecations.json +1 -1
  468. package/dist/_utils/propsTypedoc.d.ts +3 -0
  469. package/dist/_utils/propsTypedoc.js +3 -0
  470. package/dist/_utils/propsTypedoc.js.map +1 -1
  471. package/jestConfig.js +52 -0
  472. package/package.json +26 -11
  473. package/.eslintignore +0 -4
  474. package/.eslintrc.cjs +0 -54
  475. package/__mocks__/@react-aria/utils.js +0 -10
  476. package/babel.config.js +0 -40
  477. package/dist/TextEditor/TextEditor.styles.js.map +0 -1
  478. package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +0 -1
  479. package/tsconfig.json +0 -24
  480. package/tsconfig.prod.json +0 -11
  481. package/tsconfig.test.json +0 -4
  482. /package/dist/{TextEditor/TextEditor.styles.d.ts → DeprecatedTextEditor/DeprecatedTextEditor.styles.d.ts} +0 -0
  483. /package/dist/{TextEditorOutput/TextEditorOutput.styles.d.ts → DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTabAsNavigation.js","names":["React","useTabAsNavigation","_ref","enabled","config","editor","enhancedConfig","useMemo","plugins","filteredPlugins","filter","plugin","pluginName","_objectSpread"],"sources":["../../src/NextTextEditor/useTabAsNavigation.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport React from 'react'\n\ninterface UseTabAsNavigationProps {\n enabled: boolean\n config: EditorConfig\n editor: ClassicEditor | null\n}\n\ninterface UseTabAsNavigationReturn {\n config: EditorConfig\n}\n\nexport const useTabAsNavigation = ({\n enabled,\n config,\n editor,\n}: UseTabAsNavigationProps): UseTabAsNavigationReturn => {\n const enhancedConfig = React.useMemo(() => {\n if (!enabled || !config.plugins) {\n return config\n }\n\n // Remove TabSpacesPlugin when tabAsNavigation is enabled\n const filteredPlugins = config.plugins.filter((plugin) => {\n return typeof plugin === 'string'\n ? plugin !== 'TabSpacesPlugin'\n : plugin.pluginName !== 'TabSpacesPlugin'\n })\n\n return {\n ...config,\n plugins: filteredPlugins,\n }\n }, [enabled, config])\n\n return { config: enhancedConfig }\n}\n"],"mappings":";;;;;;AACA,OAAOA,KAAK,MAAM,OAAO;AAYzB,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAI0B;EAAA,IAHvDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,MAAM,GAAAH,IAAA,CAANG,MAAM;EAEN,IAAMC,cAAc,GAAGN,KAAK,CAACO,OAAO,CAAC,YAAM;IACzC,IAAI,CAACJ,OAAO,IAAI,CAACC,MAAM,CAACI,OAAO,EAAE;MAC/B,OAAOJ,MAAM;IACf;;IAEA;IACA,IAAMK,eAAe,GAAGL,MAAM,CAACI,OAAO,CAACE,MAAM,CAAC,UAACC,MAAM,EAAK;MACxD,OAAO,OAAOA,MAAM,KAAK,QAAQ,GAC7BA,MAAM,KAAK,iBAAiB,GAC5BA,MAAM,CAACC,UAAU,KAAK,iBAAiB;IAC7C,CAAC,CAAC;IAEF,OAAAC,aAAA,CAAAA,aAAA,KACKT,MAAM;MACTI,OAAO,EAAEC;IAAe;EAE5B,CAAC,EAAE,CAACN,OAAO,EAAEC,MAAM,CAAC,CAAC;EAErB,OAAO;IAAEA,MAAM,EAAEE;EAAe,CAAC;AACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ClassicEditor, EditorConfig } from 'ckeditor5';
2
+ export declare const getDefaultConfig: (locale?: string) => EditorConfig;
3
+ export declare const addButtonDataAttributes: (editor: ClassicEditor) => void;
@@ -0,0 +1,179 @@
1
+ import { Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Image, ImageInsert, ImageToolbar, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline } from 'ckeditor5';
2
+ import { CK_EDITOR_LICENSE_KEY } from '../license_key';
3
+ import { CutPlugin } from '../plugins/CutPlugin';
4
+ import { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin';
5
+ import { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin';
6
+ import { PastePlugin } from '../plugins/PastePlugin';
7
+ import { TabSpacesPlugin } from '../plugins/TabSpacesPlugin';
8
+ import { getEditorTranslation, getValidEditorLocale } from './locale';
9
+ var TEXT_COLOR_PALETTE = [{
10
+ color: '#BFEDD2'
11
+ }, {
12
+ color: '#FBEEB8'
13
+ }, {
14
+ color: '#F8CAC6'
15
+ }, {
16
+ color: '#ECCAFA'
17
+ }, {
18
+ color: '#C2E0F4'
19
+ }, {
20
+ color: '#2DC26B'
21
+ }, {
22
+ color: '#F1C40F'
23
+ }, {
24
+ color: '#E03E2D'
25
+ }, {
26
+ color: '#B96AD9'
27
+ }, {
28
+ color: '#3598DB'
29
+ }, {
30
+ color: '#169179'
31
+ }, {
32
+ color: '#E67E23'
33
+ }, {
34
+ color: '#BA372A'
35
+ }, {
36
+ color: '#843FA1'
37
+ }, {
38
+ color: '#236FA1'
39
+ }, {
40
+ color: '#ECF0F1'
41
+ }, {
42
+ color: '#CED4D9'
43
+ }, {
44
+ color: '#95A5A6'
45
+ }, {
46
+ color: '#7E8C8D'
47
+ }, {
48
+ color: '#34495E'
49
+ }, {
50
+ color: '#000000'
51
+ }, {
52
+ color: '#FFFFFF'
53
+ }];
54
+ export var getDefaultConfig = function getDefaultConfig() {
55
+ var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
56
+ return {
57
+ licenseKey: CK_EDITOR_LICENSE_KEY,
58
+ language: getValidEditorLocale(locale),
59
+ translations: [getEditorTranslation(locale)],
60
+ plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, Image, ImageInsert, ImageToolbar, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, TabSpacesPlugin],
61
+ toolbar: ['bold', 'italic', 'underline', 'strikethrough', '|', 'alignment:left', 'alignment:center', 'alignment:right', '|', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'cut', 'paste', 'pasteAsText', '|', 'fontSize', '|', 'fontColor', 'fontBackgroundColor', '|', 'undo', 'redo'],
62
+ fontSize: {
63
+ options: [{
64
+ title: '8pt',
65
+ model: '8px'
66
+ }, {
67
+ title: '10pt',
68
+ model: '10px'
69
+ }, {
70
+ title: '12pt',
71
+ model: '12px'
72
+ }, {
73
+ title: '14pt',
74
+ model: '14px'
75
+ }, {
76
+ title: '18pt',
77
+ model: '18px'
78
+ }, {
79
+ title: '24pt',
80
+ model: '24px'
81
+ }, {
82
+ title: '36pt',
83
+ model: '36px'
84
+ }],
85
+ supportAllValues: true
86
+ },
87
+ fontColor: {
88
+ colors: TEXT_COLOR_PALETTE
89
+ },
90
+ fontBackgroundColor: {
91
+ colors: TEXT_COLOR_PALETTE
92
+ },
93
+ indentBlock: {
94
+ offset: 40,
95
+ unit: 'px'
96
+ },
97
+ htmlSupport: {
98
+ allow: [{
99
+ name: 'p',
100
+ styles: {
101
+ 'margin-left': true
102
+ }
103
+ }]
104
+ },
105
+ list: {
106
+ properties: {
107
+ styles: {
108
+ useAttribute: true
109
+ },
110
+ startIndex: true,
111
+ reversed: true
112
+ }
113
+ },
114
+ image: {
115
+ insert: {
116
+ integrations: ['insertImageViaUrl']
117
+ }
118
+ },
119
+ table: {
120
+ contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties'],
121
+ tableProperties: {
122
+ borderColors: TEXT_COLOR_PALETTE,
123
+ backgroundColors: TEXT_COLOR_PALETTE
124
+ },
125
+ tableCellProperties: {
126
+ borderColors: TEXT_COLOR_PALETTE,
127
+ backgroundColors: TEXT_COLOR_PALETTE
128
+ }
129
+ }
130
+ };
131
+ };
132
+
133
+ // Add stable data attributes to toolbar buttons for the styling (or testing) purposes
134
+ export var addButtonDataAttributes = function addButtonDataAttributes(editor) {
135
+ var applyAttributes = function applyAttributes() {
136
+ var toolbarElement = editor.ui.view.toolbar.element;
137
+ if (!toolbarElement) {
138
+ return;
139
+ }
140
+
141
+ // Get buttons in the main toolbar
142
+ var toolbarChildren = Array.from(toolbarElement.querySelectorAll('.ck-toolbar__items > *'));
143
+
144
+ // Get buttons hidden in "more" dropdown
145
+ var moreDropdownButtons = Array.from(toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button'));
146
+ var allToolbarElements = [].concat(toolbarChildren, moreDropdownButtons);
147
+
148
+ // Create mapping based on toolbar configuration order
149
+ var toolbarItems = editor.config.get('toolbar') || [];
150
+ var elementIndex = 0;
151
+ toolbarItems.forEach(function (itemName) {
152
+ var element = allToolbarElements[elementIndex];
153
+ if (itemName !== '|' && element && !element.classList.contains('ck-toolbar__separator')) {
154
+ // Use the toolbar item name as the stable identifier
155
+ element.setAttribute('data-cke-command', itemName);
156
+ }
157
+ elementIndex++;
158
+ });
159
+ };
160
+
161
+ // Apply attributes initially
162
+ applyAttributes();
163
+
164
+ // Re-apply when dropdown menus are opened (buttons get created dynamically)
165
+ var toolbarElement = editor.ui.view.toolbar.element;
166
+ if (toolbarElement) {
167
+ var observer = new MutationObserver(function () {
168
+ applyAttributes();
169
+ });
170
+ observer.observe(toolbarElement, {
171
+ childList: true,
172
+ subtree: true
173
+ });
174
+ editor.on('destroy', function () {
175
+ observer.disconnect();
176
+ });
177
+ }
178
+ };
179
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/NextTextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin,\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,mBAAm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H,cAAc,EAAE;IAClB,IAAMoB,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;MAC1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { addButtonDataAttributes, getDefaultConfig } from './config';
2
+ export { addPluginsFromStringArray } from './plugins';
@@ -0,0 +1,3 @@
1
+ export { addButtonDataAttributes, getDefaultConfig } from './config';
2
+ export { addPluginsFromStringArray } from './plugins';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["addButtonDataAttributes","getDefaultConfig","addPluginsFromStringArray"],"sources":["../../../src/NextTextEditor/utils/index.ts"],"sourcesContent":["export { addButtonDataAttributes, getDefaultConfig } from './config'\nexport { addPluginsFromStringArray } from './plugins'\n"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,gBAAgB,QAAQ,UAAU;AACpE,SAASC,yBAAyB,QAAQ,WAAW"}
@@ -0,0 +1,3 @@
1
+ import type { Translations } from 'ckeditor5';
2
+ export declare const getValidEditorLocale: (locale: string) => string;
3
+ export declare const getEditorTranslation: (locale: string) => Translations;
@@ -0,0 +1,102 @@
1
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
2
+ import de from 'ckeditor5/translations/de.js';
3
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
4
+ import en from 'ckeditor5/translations/en.js';
5
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
6
+ import es from 'ckeditor5/translations/es.js';
7
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
8
+ import fr from 'ckeditor5/translations/fr.js';
9
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
10
+ import ja from 'ckeditor5/translations/ja.js';
11
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
12
+ import pl from 'ckeditor5/translations/pl.js';
13
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
14
+ import pt from 'ckeditor5/translations/pt.js';
15
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
16
+ import th from 'ckeditor5/translations/th.js';
17
+ // @ts-expect-error: Translation files are not typed in the ckeditor5 package.
18
+ import zh from 'ckeditor5/translations/zh.js';
19
+ import { add } from '@ckeditor/ckeditor5-utils/src/translation-service';
20
+ var editorLocaleMap = {
21
+ en: 'en',
22
+ 'en-CA': 'en',
23
+ 'fr-CA': 'fr',
24
+ 'fr-FR': 'fr',
25
+ es: 'es',
26
+ 'es-ES': 'es',
27
+ 'en-AE': 'en',
28
+ 'en-AU': 'en',
29
+ 'en-GB': 'en',
30
+ 'en-SG': 'en',
31
+ 'th-TH': 'th',
32
+ 'ja-JP': 'ja',
33
+ 'pt-BR': 'pt',
34
+ 'is-IS': 'en',
35
+ 'de-DE': 'de',
36
+ 'zh-SG': 'zh',
37
+ 'pl-PL': 'pl'
38
+ };
39
+ var editorTranslations = {
40
+ en: en,
41
+ fr: fr,
42
+ es: es,
43
+ de: de,
44
+ ja: ja,
45
+ pl: pl,
46
+ pt: pt,
47
+ th: th,
48
+ zh: zh
49
+ };
50
+ add('en', {
51
+ Cut: 'Cut',
52
+ Paste: 'Paste',
53
+ PasteAsText: 'Paste as Text'
54
+ });
55
+ add('fr', {
56
+ Cut: 'Couper',
57
+ Paste: 'Coller',
58
+ PasteAsText: 'Coller comme texte'
59
+ });
60
+ add('ja', {
61
+ Cut: 'カット',
62
+ Paste: '貼り付け',
63
+ PasteAsText: 'テキストとして貼り付け'
64
+ });
65
+ add('es', {
66
+ Cut: 'Cortar',
67
+ Paste: 'Pegar',
68
+ PasteAsText: 'Pegar como texto'
69
+ });
70
+ add('de', {
71
+ Cut: 'Ausschneiden',
72
+ Paste: 'Einfügen',
73
+ PasteAsText: 'Als Text einfügen'
74
+ });
75
+ add('pt', {
76
+ Cut: 'Recortar',
77
+ Paste: 'Colar',
78
+ PasteAsText: 'Colar como texto'
79
+ });
80
+ add('zh', {
81
+ Cut: '剪切',
82
+ Paste: '粘贴',
83
+ PasteAsText: '以文本形式粘贴'
84
+ });
85
+ add('th', {
86
+ Cut: 'ตัด',
87
+ Paste: 'วาง',
88
+ PasteAsText: 'วางในรูปแบบข้อความ'
89
+ });
90
+ add('pl', {
91
+ Cut: 'Wytnij',
92
+ Paste: 'Wklej',
93
+ PasteAsText: 'Wklej jako tekst'
94
+ });
95
+ export var getValidEditorLocale = function getValidEditorLocale(locale) {
96
+ return editorLocaleMap[locale] || 'en';
97
+ };
98
+ export var getEditorTranslation = function getEditorTranslation(locale) {
99
+ var editorLocale = getValidEditorLocale(locale);
100
+ return editorTranslations[editorLocale] || en;
101
+ };
102
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.js","names":["de","en","es","fr","ja","pl","pt","th","zh","add","editorLocaleMap","editorTranslations","Cut","Paste","PasteAsText","getValidEditorLocale","locale","getEditorTranslation","editorLocale"],"sources":["../../../src/NextTextEditor/utils/locale.ts"],"sourcesContent":["import type { Translations } from 'ckeditor5'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport de from 'ckeditor5/translations/de.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport en from 'ckeditor5/translations/en.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport es from 'ckeditor5/translations/es.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport fr from 'ckeditor5/translations/fr.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport ja from 'ckeditor5/translations/ja.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport pl from 'ckeditor5/translations/pl.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport pt from 'ckeditor5/translations/pt.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport th from 'ckeditor5/translations/th.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport zh from 'ckeditor5/translations/zh.js'\n\nimport { add } from '@ckeditor/ckeditor5-utils/src/translation-service'\n\nconst editorLocaleMap: Record<string, string> = {\n en: 'en',\n 'en-CA': 'en',\n 'fr-CA': 'fr',\n 'fr-FR': 'fr',\n es: 'es',\n 'es-ES': 'es',\n 'en-AE': 'en',\n 'en-AU': 'en',\n 'en-GB': 'en',\n 'en-SG': 'en',\n 'th-TH': 'th',\n 'ja-JP': 'ja',\n 'pt-BR': 'pt',\n 'is-IS': 'en',\n 'de-DE': 'de',\n 'zh-SG': 'zh',\n 'pl-PL': 'pl',\n}\n\nconst editorTranslations: Record<string, Translations> = {\n en,\n fr,\n es,\n de,\n ja,\n pl,\n pt,\n th,\n zh,\n}\n\nadd('en', {\n Cut: 'Cut',\n Paste: 'Paste',\n PasteAsText: 'Paste as Text',\n})\nadd('fr', {\n Cut: 'Couper',\n Paste: 'Coller',\n PasteAsText: 'Coller comme texte',\n})\nadd('ja', {\n Cut: 'カット',\n Paste: '貼り付け',\n PasteAsText: 'テキストとして貼り付け',\n})\nadd('es', {\n Cut: 'Cortar',\n Paste: 'Pegar',\n PasteAsText: 'Pegar como texto',\n})\nadd('de', {\n Cut: 'Ausschneiden',\n Paste: 'Einfügen',\n PasteAsText: 'Als Text einfügen',\n})\nadd('pt', {\n Cut: 'Recortar',\n Paste: 'Colar',\n PasteAsText: 'Colar como texto',\n})\nadd('zh', {\n Cut: '剪切',\n Paste: '粘贴',\n PasteAsText: '以文本形式粘贴',\n})\nadd('th', {\n Cut: 'ตัด',\n Paste: 'วาง',\n PasteAsText: 'วางในรูปแบบข้อความ',\n})\nadd('pl', {\n Cut: 'Wytnij',\n Paste: 'Wklej',\n PasteAsText: 'Wklej jako tekst',\n})\n\nexport const getValidEditorLocale = (locale: string) => {\n return editorLocaleMap[locale] || 'en'\n}\n\nexport const getEditorTranslation = (locale: string) => {\n const editorLocale = getValidEditorLocale(locale)\n return editorTranslations[editorLocale] || en\n}\n"],"mappings":"AACA;AACA,OAAOA,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAE7C,SAASC,GAAG,QAAQ,mDAAmD;AAEvE,IAAMC,eAAuC,GAAG;EAC9CT,EAAE,EAAE,IAAI;EACR,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACbC,EAAE,EAAE,IAAI;EACR,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE;AACX,CAAC;AAED,IAAMS,kBAAgD,GAAG;EACvDV,EAAE,EAAFA,EAAE;EACFE,EAAE,EAAFA,EAAE;EACFD,EAAE,EAAFA,EAAE;EACFF,EAAE,EAAFA,EAAE;EACFI,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EAAFA,EAAE;EACFC,EAAE,EA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Ac,EAAK;EACtD,IAAME,YAAY,GAAGH,oBAAoB,CAACC,MAAM,CAAC;EACjD,OAAOL,kBAAkB,CAACO,YAAY,CAAC,IAAIjB,EAAE;AAC/C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { EditorConfig, Plugin } from 'ckeditor5';
2
+ /** Gets CKEditor plugin objects from TinyMCE string plugin names */
3
+ export declare const getPluginsFromStringArray: (pluginNames?: string[]) => (typeof Plugin)[];
4
+ /** Gets toolbar items that should be added for the given string plugin names. */
5
+ export declare const getToolbarItemsFromStringArray: (pluginNames?: string[]) => string[];
6
+ /** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */
7
+ export declare const addPluginsFromStringArray: (config: EditorConfig, pluginNames?: string[]) => EditorConfig;
@@ -0,0 +1,184 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
11
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ import { Alignment, Autoformat, AutoLink, Autosave, BlockQuote, Bold, Bookmark, Code, CodeBlock, Emoji, FindAndReplace, FontBackgroundColor, FontColor, FontSize, Fullscreen, Heading, Highlight, HorizontalLine, Image, Indent, Italic, Link, List, MediaEmbed, PageBreak, RemoveFormat, RestrictedEditingModeEditing, ShowBlocks, SourceEditing, SpecialCharacters, Strikethrough, Subscript, Superscript, Table, TextPartLanguage, Underline, WordCount } from 'ckeditor5';
14
+ import { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin';
15
+ import { PastePlugin } from '../plugins/PastePlugin';
16
+
17
+ /** Maps TinyMCE string plugin names to CKEditor plugin objects */
18
+ var PLUGINS_MAP = {
19
+ bold: Bold,
20
+ italic: Italic,
21
+ underline: Underline,
22
+ strikethrough: Strikethrough,
23
+ list: List,
24
+ lists: List,
25
+ advlist: List,
26
+ link: Link,
27
+ table: Table,
28
+ image: Image,
29
+ imagetools: Image,
30
+ alignment: Alignment,
31
+ fontsize: FontSize,
32
+ fontcolor: FontColor,
33
+ fontbackgroundcolor: FontBackgroundColor,
34
+ indent: Indent,
35
+ autolink: AutoLink,
36
+ anchor: Bookmark,
37
+ autosave: Autosave,
38
+ charmap: SpecialCharacters,
39
+ code: Code,
40
+ codesample: CodeBlock,
41
+ directionality: TextPartLanguage,
42
+ emoticons: Emoji,
43
+ fullscreen: Fullscreen,
44
+ hr: HorizontalLine,
45
+ media: MediaEmbed,
46
+ noneditable: RestrictedEditingModeEditing,
47
+ pagebreak: PageBreak,
48
+ searchreplace: FindAndReplace,
49
+ textpattern: Autoformat,
50
+ visualblocks: ShowBlocks,
51
+ wordcount: WordCount,
52
+ blockquote: BlockQuote,
53
+ subscript: Subscript,
54
+ superscript: Superscript,
55
+ heading: Heading,
56
+ headings: Heading,
57
+ highlight: Highlight,
58
+ removeformat: RemoveFormat,
59
+ source: SourceEditing,
60
+ sourceedit: SourceEditing,
61
+ autoformat: Autoformat,
62
+ nonbreaking: SpecialCharacters,
63
+ paste: PastePlugin,
64
+ pastetext: PasteAsTextPlugin,
65
+ pasteastext: PasteAsTextPlugin,
66
+ // Part of CKEditor core
67
+ autoresize: null,
68
+ spellchecker: null,
69
+ tabfocus: null
70
+ };
71
+ var UNSUPPORTED_PLUGINS = [
72
+ // Would need custom implementation
73
+ 'help', 'visualchars', 'insertdatetime', 'save', 'template',
74
+ // Not directly supported
75
+ 'importcss',
76
+ // CKEditor uses explicit style definitions instead of scanning styles for classes
77
+ 'print',
78
+ // Could be substituted with ExportPdf, but needs cloud services
79
+ 'preview',
80
+ // Could be substituted with ExportPdf, but needs cloud services
81
+ 'toc',
82
+ // Would need TableOfContents premium plugin
83
+
84
+ // Has been removed in TinyMCE 6
85
+ 'bbcode', 'colorpicker', 'contextmenu', 'fullpage', 'legacyoutput'];
86
+
87
+ /** Maps TinyMCE toolbar button names to CKEditor command names */
88
+ var TOOLBAR_MAP = {
89
+ link: 'link',
90
+ table: 'insertTable',
91
+ image: 'insertImageViaUrl',
92
+ blockquote: 'blockQuote',
93
+ code: 'code',
94
+ codesample: 'codeBlock',
95
+ hr: 'horizontalLine',
96
+ media: 'mediaEmbed',
97
+ pagebreak: 'pageBreak',
98
+ subscript: 'subscript',
99
+ superscript: 'superscript',
100
+ removeformat: 'removeFormat',
101
+ heading: 'heading',
102
+ headings: 'heading',
103
+ highlight: 'highlight',
104
+ charmap: 'specialCharacters',
105
+ searchreplace: 'findAndReplace',
106
+ source: 'sourceEditing',
107
+ sourceedit: 'sourceEditing',
108
+ visualblocks: 'showBlocks',
109
+ wordcount: 'wordCount',
110
+ emoticons: 'emoji',
111
+ fullscreen: 'fullscreen',
112
+ anchor: 'bookmark',
113
+ toc: 'tableOfContents'
114
+ };
115
+
116
+ /** Gets CKEditor plugin objects from TinyMCE string plugin names */
117
+ export var getPluginsFromStringArray = function getPluginsFromStringArray() {
118
+ var pluginNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
119
+ var unsupportedPlugins = pluginNames.filter(function (name) {
120
+ return UNSUPPORTED_PLUGINS.includes(name.toLowerCase());
121
+ });
122
+ if (unsupportedPlugins.length) {
123
+ var pluginsList = unsupportedPlugins.join(', ');
124
+ throw new Error("The following editor plugins are not supported: ".concat(pluginsList, "."));
125
+ }
126
+ var plugins = pluginNames.map(function (name) {
127
+ return PLUGINS_MAP[name.toLowerCase()];
128
+ }).filter(function (plugin, index, array) {
129
+ return plugin !== null &&
130
+ // Remove duplicates
131
+ array.indexOf(plugin) === index;
132
+ });
133
+ return plugins;
134
+ };
135
+
136
+ /** Gets toolbar items that should be added for the given string plugin names. */
137
+ export var getToolbarItemsFromStringArray = function getToolbarItemsFromStringArray() {
138
+ var pluginNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
139
+ return pluginNames.map(function (name) {
140
+ return TOOLBAR_MAP[name.toLowerCase()];
141
+ }).filter(Boolean);
142
+ };
143
+
144
+ /** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */
145
+ export var addPluginsFromStringArray = function addPluginsFromStringArray(config) {
146
+ var pluginNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
147
+ if (!pluginNames.length) {
148
+ return config;
149
+ }
150
+ var additionalPlugins = getPluginsFromStringArray(pluginNames);
151
+ var additionalToolbarItems = getToolbarItemsFromStringArray(pluginNames);
152
+ var currentPlugins = config.plugins || [];
153
+ var enhancedPlugins = Array.from(new Set([].concat(_toConsumableArray(currentPlugins), _toConsumableArray(additionalPlugins))));
154
+ var currentToolbar = Array.isArray(config.toolbar) ? config.toolbar : [];
155
+ var enhancedToolbar = currentToolbar;
156
+ if (additionalToolbarItems.length > 0) {
157
+ // Remove undo/redo buttons temporarily
158
+ var toolbarWithoutUndo = currentToolbar.filter(function (item) {
159
+ return item !== 'undo' && item !== 'redo';
160
+ });
161
+
162
+ // Combine toolbar items
163
+ var combinedItems = [].concat(_toConsumableArray(toolbarWithoutUndo), _toConsumableArray(additionalToolbarItems), ['|', 'undo', 'redo']);
164
+
165
+ // Deduplicate items while preserving separators
166
+ var seenButtons = new Set();
167
+ enhancedToolbar = combinedItems.filter(function (item) {
168
+ if (item === '|') {
169
+ return true;
170
+ }
171
+ var itemKey = typeof item === 'string' ? item : JSON.stringify(item);
172
+ if (seenButtons.has(itemKey)) {
173
+ return false;
174
+ }
175
+ seenButtons.add(itemKey);
176
+ return true;
177
+ });
178
+ }
179
+ return _objectSpread(_objectSpread({}, config), {}, {
180
+ plugins: enhancedPlugins,
181
+ toolbar: enhancedToolbar
182
+ });
183
+ };
184
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","names":["Alignment","Autoformat","AutoLink","Autosave","BlockQuote","Bold","Bookmark","Code","CodeBlock","Emoji","FindAndReplace","FontBackgroundColor","FontColor","FontSize","Fullscreen","Heading","Highlight","HorizontalLine","Image","Indent","Italic","Link","List","MediaEmbed","PageBreak","RemoveFormat","RestrictedEditingModeEditing","ShowBlocks","SourceEditing","SpecialCharacters","Strikethrough","Subscript","Superscript","Table","TextPartLanguage","Underline","WordCount","PasteAsTextPlugin","PastePlugin","PLUGINS_MAP","bold","italic","underline","strikethrough","list","lists","advlist","link","table","image","imagetools","alignment","fontsize","fontcolor","fontbackgroundcolor","indent","autolink","anchor","autosave","charmap","code","codesample","directionality","emoticons","fullscreen","hr","media","noneditable","pagebreak","searchreplace","textpattern","visualblocks","wordcount","blockquote","subscript","superscript","heading","headings","highlight","removeformat","source","sourceedit","autoformat","nonbreaking","paste","pastetext","pasteastext","autoresize","spellchecker","tabfocus","UNSUPPORTED_PLUGINS","TOOLBAR_MAP","toc","getPluginsFromStringArray","pluginNames","arguments","length","undefined","unsupportedPlugins","filter","name","includes","toLowerCase","pluginsList","join","Error","concat","plugins","map","plugin","index","array","indexOf","getToolbarItemsFromStringArray","Boolean","addPluginsFromStringArray","config","additionalPlugins","additionalToolbarItems","currentPlugins","enhancedPlugins","Array","from","Set","_toConsumableArray","currentToolbar","isArray","toolbar","enhancedToolbar","toolbarWithoutUndo","item","combinedItems","seenButtons","itemKey","JSON","stringify","has","add","_objectSpread"],"sources":["../../../src/NextTextEditor/utils/plugins.ts"],"sourcesContent":["import type { EditorConfig, Plugin } from 'ckeditor5'\nimport {\n Alignment,\n Autoformat,\n AutoLink,\n Autosave,\n BlockQuote,\n Bold,\n Bookmark,\n Code,\n CodeBlock,\n Emoji,\n FindAndReplace,\n FontBackgroundColor,\n FontColor,\n FontSize,\n Fullscreen,\n Heading,\n Highlight,\n HorizontalLine,\n Image,\n Indent,\n Italic,\n Link,\n List,\n MediaEmbed,\n PageBreak,\n RemoveFormat,\n RestrictedEditingModeEditing,\n ShowBlocks,\n SourceEditing,\n SpecialCharacters,\n Strikethrough,\n Subscript,\n Superscript,\n Table,\n TextPartLanguage,\n Underline,\n WordCount,\n} from 'ckeditor5'\n\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\n\n/** Maps TinyMCE string plugin names to CKEditor plugin objects */\nconst PLUGINS_MAP: Record<string, typeof Plugin | null> = {\n bold: Bold,\n italic: Italic,\n underline: Underline,\n strikethrough: Strikethrough,\n list: List,\n lists: List,\n advlist: List,\n link: Link,\n table: Table,\n image: Image,\n imagetools: Image,\n alignment: Alignment,\n fontsize: FontSize,\n fontcolor: FontColor,\n fontbackgroundcolor: FontBackgroundColor,\n indent: Indent,\n autolink: AutoLink,\n anchor: Bookmark,\n autosave: Autosave,\n charmap: SpecialCharacters,\n code: Code,\n codesample: CodeBlock,\n directionality: TextPartLanguage,\n emoticons: Emoji,\n fullscreen: Fullscreen,\n hr: HorizontalLine,\n media: MediaEmbed,\n noneditable: RestrictedEditingModeEditing,\n pagebreak: PageBreak,\n searchreplace: FindAndReplace,\n textpattern: Autoformat,\n visualblocks: ShowBlocks,\n wordcount: WordCount,\n blockquote: BlockQuote,\n subscript: Subscript,\n superscript: Superscript,\n heading: Heading,\n headings: Heading,\n highlight: Highlight,\n removeformat: RemoveFormat,\n source: SourceEditing,\n sourceedit: SourceEditing,\n autoformat: Autoformat,\n nonbreaking: SpecialCharacters,\n paste: PastePlugin,\n pastetext: PasteAsTextPlugin,\n pasteastext: PasteAsTextPlugin,\n\n // Part of CKEditor core\n autoresize: null,\n spellchecker: null,\n tabfocus: null,\n}\n\nconst UNSUPPORTED_PLUGINS = [\n // Would need custom implementation\n 'help',\n 'visualchars',\n 'insertdatetime',\n 'save',\n 'template',\n\n // Not directly supported\n 'importcss', // CKEditor uses explicit style definitions instead of scanning styles for classes\n 'print', // Could be substituted with ExportPdf, but needs cloud services\n 'preview', // Could be substituted with ExportPdf, but needs cloud services\n 'toc', // Would need TableOfContents premium plugin\n\n // Has been removed in TinyMCE 6\n 'bbcode',\n 'colorpicker',\n 'contextmenu',\n 'fullpage',\n 'legacyoutput',\n]\n\n/** Maps TinyMCE toolbar button names to CKEditor command names */\nconst TOOLBAR_MAP: Record<string, string> = {\n link: 'link',\n table: 'insertTable',\n image: 'insertImageViaUrl',\n blockquote: 'blockQuote',\n code: 'code',\n codesample: 'codeBlock',\n hr: 'horizontalLine',\n media: 'mediaEmbed',\n pagebreak: 'pageBreak',\n subscript: 'subscript',\n superscript: 'superscript',\n removeformat: 'removeFormat',\n heading: 'heading',\n headings: 'heading',\n highlight: 'highlight',\n charmap: 'specialCharacters',\n searchreplace: 'findAndReplace',\n source: 'sourceEditing',\n sourceedit: 'sourceEditing',\n visualblocks: 'showBlocks',\n wordcount: 'wordCount',\n emoticons: 'emoji',\n fullscreen: 'fullscreen',\n anchor: 'bookmark',\n toc: 'tableOfContents',\n}\n\n/** Gets CKEditor plugin objects from TinyMCE string plugin names */\nexport const getPluginsFromStringArray = (pluginNames: string[] = []) => {\n const unsupportedPlugins = pluginNames.filter((name) =>\n UNSUPPORTED_PLUGINS.includes(name.toLowerCase())\n )\n if (unsupportedPlugins.length) {\n const pluginsList = unsupportedPlugins.join(', ')\n throw new Error(\n `The following editor plugins are not supported: ${pluginsList}.`\n )\n }\n\n const plugins = pluginNames\n .map((name) => PLUGINS_MAP[name.toLowerCase()])\n .filter(\n (plugin, index, array) =>\n plugin !== null &&\n // Remove duplicates\n array.indexOf(plugin) === index\n )\n return plugins as (typeof Plugin)[]\n}\n\n/** Gets toolbar items that should be added for the given string plugin names. */\nexport const getToolbarItemsFromStringArray = (pluginNames: string[] = []) => {\n return pluginNames\n .map((name) => TOOLBAR_MAP[name.toLowerCase()])\n .filter(Boolean)\n}\n\n/** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */\nexport const addPluginsFromStringArray = (\n config: EditorConfig,\n pluginNames: string[] = []\n): EditorConfig => {\n if (!pluginNames.length) {\n return config\n }\n const additionalPlugins = getPluginsFromStringArray(pluginNames)\n const additionalToolbarItems = getToolbarItemsFromStringArray(pluginNames)\n\n const currentPlugins = config.plugins || []\n const enhancedPlugins = Array.from(\n new Set([...currentPlugins, ...additionalPlugins])\n )\n\n const currentToolbar = Array.isArray(config.toolbar) ? config.toolbar : []\n\n let enhancedToolbar = currentToolbar\n if (additionalToolbarItems.length > 0) {\n // Remove undo/redo buttons temporarily\n const toolbarWithoutUndo = currentToolbar.filter(\n (item) => item !== 'undo' && item !== 'redo'\n )\n\n // Combine toolbar items\n const combinedItems = [\n ...toolbarWithoutUndo,\n ...additionalToolbarItems,\n '|',\n 'undo',\n 'redo',\n ]\n\n // Deduplicate items while preserving separators\n const seenButtons = new Set<string>()\n enhancedToolbar = combinedItems.filter((item) => {\n if (item === '|') {\n return true\n }\n const itemKey = typeof item === 'string' ? item : JSON.stringify(item)\n if (seenButtons.has(itemKey)) {\n return false\n }\n seenButtons.add(itemKey)\n return true\n })\n }\n return {\n ...config,\n plugins: enhancedPlugins,\n toolbar: enhancedToolbar,\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,SACEA,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,cAAc,EACdC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,cAAc,EACdC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,YAAY,EACZC,4BAA4B,EAC5BC,UAAU,EACVC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,EACbC,SAAS,EACTC,WAAW,EACXC,KAAK,EACLC,gBAAgB,EAChBC,SAAS,EACTC,SAAS,QACJ,WAAW;AAElB,SAASC,iBAAiB,QAAQ,8BAA8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,GAAGA,IAAI,GAAGI,IAAI,CAACC,SAAS,CAACL,IAAI,CAAC;MACtE,IAAIE,WAAW,CAACI,GAAG,CAACH,OAAO,CAAC,EAAE;QAC5B,OAAO,KAAK;MACd;MACAD,WAAW,CAACK,GAAG,CAACJ,OAAO,CAAC;MACxB,OAAO,IAAI;IACb,CAAC,CAAC;EACJ;EACA,OAAAK,aAAA,CAAAA,aAAA,KACKtB,MAAM;IACTT,OAAO,EAAEa,eAAe;IACxBO,OAAO,EAAEC;EAAe;AAE5B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { DivAttributes } from '../_utils/types';
3
+ import type { NextTextEditorOutputProps } from './NextTextEditorOutput.types';
4
+ /**
5
+ * Render formatted text from `TextEditor`
6
+ *
7
+ * @since 10.24.0
8
+ */
9
+ export declare const NextTextEditorOutput: React.ForwardRefExoticComponent<NextTextEditorOutputProps & DivAttributes & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,29 @@
1
+ var _excluded = ["value"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ import React from 'react';
6
+ import { StyledEditor } from './NextTextEditorOutput.styles';
7
+ import { sanitizeTextEditorHtml } from './NextTextEditorOutput.utils';
8
+
9
+ /**
10
+ * Render formatted text from `TextEditor`
11
+ *
12
+ * @since 10.24.0
13
+ */
14
+ export var NextTextEditorOutput = /*#__PURE__*/React.forwardRef(function NextTextEditorOutput(_ref, ref) {
15
+ var value = _ref.value,
16
+ props = _objectWithoutProperties(_ref, _excluded);
17
+ var sanitizedHtml = sanitizeTextEditorHtml(value || '');
18
+ return /*#__PURE__*/React.createElement(StyledEditor, _extends({}, props, {
19
+ ref: ref
20
+ }), /*#__PURE__*/React.createElement("div", {
21
+ className: "ck-content",
22
+ dangerouslySetInnerHTML: {
23
+ __html: sanitizedHtml
24
+ },
25
+ contentEditable: false
26
+ }));
27
+ });
28
+ NextTextEditorOutput.displayName = 'NextTextEditorOutput';
29
+ //# sourceMappingURL=NextTextEditorOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NextTextEditorOutput.js","names":["React","StyledEditor","sanitizeTextEditorHtml","NextTextEditorOutput","forwardRef","_ref","ref","value","props","_objectWithoutProperties","_excluded","sanitizedHtml","createElement","_extends","className","dangerouslySetInnerHTML","__html","contentEditable","displayName"],"sources":["../../src/NextTextEditorOutput/NextTextEditorOutput.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { DivAttributes } from '../_utils/types'\nimport { StyledEditor } from './NextTextEditorOutput.styles'\nimport type { NextTextEditorOutputProps } from './NextTextEditorOutput.types'\nimport { sanitizeTextEditorHtml } from './NextTextEditorOutput.utils'\n\n/**\n * Render formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\nexport const NextTextEditorOutput = React.forwardRef<\n HTMLDivElement,\n NextTextEditorOutputProps & DivAttributes\n>(function NextTextEditorOutput({ value, ...props }, ref) {\n const sanitizedHtml = sanitizeTextEditorHtml(value || '')\n\n return (\n <StyledEditor {...props} ref={ref}>\n <div\n className=\"ck-content\"\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n contentEditable={false}\n />\n </StyledEditor>\n )\n})\n\nNextTextEditorOutput.displayName = 'NextTextEditorOutput'\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,oBAAoB,gBAAGH,KAAK,CAACI,UAAU,CAGlD,SAASD,oBAAoBA,CAAAE,IAAA,EAAsBC,GAAG,EAAE;EAAA,IAAxBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAKC,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAC/C,IAAMC,aAAa,GAAGT,sBAAsB,CAACK,KAAK,IAAI,EAAE,CAAC;EAEzD,oBACEP,KAAA,CAAAY,aAAA,CAACX,YAAY,EAAAY,QAAA,KAAKL,KAAK;IAAEF,GAAG,EAAEA;EAAI,iBAChCN,KAAA,CAAAY,aAAA;IACEE,SAAS,EAAC,YAAY;IACtBC,uBAAuB,EAAE;MAAEC,MAAM,EAAEL;IAAc,CAAE;IACnDM,eAAe,EAAE;EAAM,CACxB,CACW,CAAC;AAEnB,CAAC,CAAC;AAEFd,oBAAoB,CAACe,WAAW,GAAG,sBAAsB"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,6 @@
1
+ import styled from 'styled-components';
2
+ export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
3
+ displayName: "StyledEditor",
4
+ componentId: "core-12_26_1__sc-2s34a1-0"
5
+ })([".ck-content{border:none;padding:0;p{margin:0;}}"]);
6
+ //# sourceMappingURL=NextTextEditorOutput.styles.js.map