@procore/core-react 12.26.6 → 12.27.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 (402) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  3. package/dist/Avatar/Avatar.styles.js +5 -5
  4. package/dist/AvatarStack/AvatarStack.styles.d.ts +76 -76
  5. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  6. package/dist/Badge/Badge.styles.js +2 -2
  7. package/dist/BadgePill/BadgePill.styles.js +4 -4
  8. package/dist/Banner/Banner.styles.js +10 -10
  9. package/dist/Box/Box.styles.js +1 -1
  10. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  11. package/dist/Button/Button.styles.js +5 -5
  12. package/dist/Calendar/Calendar.styles.js +8 -8
  13. package/dist/Card/Card.styles.js +1 -1
  14. package/dist/Checkbox/Checkbox.styles.js +6 -6
  15. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  16. package/dist/ContactItem/ContactItem.styles.js +5 -5
  17. package/dist/Content/Content.styles.js +2 -2
  18. package/dist/DateInput/DateInput.styles.js +6 -6
  19. package/dist/DetailPage/DetailPage.styles.js +7 -7
  20. package/dist/Dropdown/Dropdown.styles.js +3 -3
  21. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  22. package/dist/Dropzone/Dropzone.js +1 -1
  23. package/dist/Dropzone/Dropzone.styles.js +9 -9
  24. package/dist/EmptyState/EmptyState.styles.js +6 -6
  25. package/dist/Field/Field.styles.js +3 -3
  26. package/dist/FileList/FileList.styles.js +4 -4
  27. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  28. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  29. package/dist/FileSelect/FileSelect.styles.js +2 -2
  30. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  31. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  32. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  33. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  34. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  35. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
  36. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  37. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  38. package/dist/FileToken/FileToken.styles.js +4 -4
  39. package/dist/FilterToken/FilterToken.styles.js +5 -5
  40. package/dist/FlexList/FlexList.styles.js +1 -1
  41. package/dist/Form/Form.js +11 -1
  42. package/dist/Form/Form.js.map +1 -1
  43. package/dist/Form/Form.styles.js +14 -14
  44. package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
  45. package/dist/Form/StyledFormikForm.styles.js +2 -2
  46. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  47. package/dist/Grid/Grid.styles.js +2 -2
  48. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  49. package/dist/Input/Input.styles.js +1 -1
  50. package/dist/Link/Link.styles.js +1 -1
  51. package/dist/ListPage/ListPage.styles.js +8 -8
  52. package/dist/Loader/Loader.styles.js +2 -2
  53. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  54. package/dist/Modal/Modal.styles.js +13 -13
  55. package/dist/Modal/storyHelpers.js +1 -4
  56. package/dist/Modal/storyHelpers.js.map +1 -1
  57. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  58. package/dist/NextMenu/NextMenu.styles.js +3 -3
  59. package/dist/Notation/Notation.js +1 -1
  60. package/dist/NumberInput/NumberInput.styles.js +7 -7
  61. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  62. package/dist/OverlayTrigger/a11yPresets.d.ts +6 -6
  63. package/dist/PageLayout/PageLayout.styles.js +16 -16
  64. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  65. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  66. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  67. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  68. package/dist/Pagination/Pagination.styles.js +5 -5
  69. package/dist/Panel/Panel.styles.js +11 -11
  70. package/dist/Pill/Pill.styles.js +3 -3
  71. package/dist/PillSelect/PillSelect.styles.js +4 -4
  72. package/dist/Popover/Popover.styles.js +2 -2
  73. package/dist/Portal/Portal.styles.js +1 -1
  74. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  75. package/dist/RadioButton/RadioButton.styles.js +3 -3
  76. package/dist/Required/Required.styles.js +3 -3
  77. package/dist/Search/Search.styles.js +5 -5
  78. package/dist/Section/Section.styles.js +7 -7
  79. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  80. package/dist/Select/Select.styles.js +7 -7
  81. package/dist/Semantic/Semantic.styles.d.ts +76 -76
  82. package/dist/Semantic/Semantic.styles.js +9 -9
  83. package/dist/Slider/Slider.styles.js +5 -5
  84. package/dist/Spinner/Spinner.styles.js +7 -7
  85. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  86. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  87. package/dist/SuperSelect/SuperSelect.styles.js +37 -37
  88. package/dist/Switch/Switch.styles.js +4 -4
  89. package/dist/Table/Table.styles.js +28 -28
  90. package/dist/TableShelf/TableShelf.styles.js +5 -5
  91. package/dist/Tabs/Tabs.styles.js +15 -15
  92. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  93. package/dist/TextArea/TextArea.styles.js +1 -1
  94. package/dist/TextEditor/EditorError.js.map +1 -0
  95. package/dist/TextEditor/StickyToolbar/StickyToolbar.types.js.map +1 -0
  96. package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.js.map +1 -0
  97. package/dist/TextEditor/StickyToolbar/index.js.map +1 -0
  98. package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +1 -0
  99. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -0
  100. package/dist/TextEditor/TextEditor.d.ts +42 -1
  101. package/dist/TextEditor/TextEditor.js +182 -10
  102. package/dist/TextEditor/TextEditor.js.map +1 -1
  103. package/dist/{NextTextEditor/NextTextEditor.styles.js → TextEditor/TextEditor.styles.js} +2 -2
  104. package/dist/TextEditor/TextEditor.styles.js.map +1 -0
  105. package/dist/TextEditor/TextEditor.types.d.ts +139 -18
  106. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  107. package/dist/TextEditor/index.d.ts +1 -1
  108. package/dist/TextEditor/index.js +1 -0
  109. package/dist/TextEditor/index.js.map +1 -1
  110. package/dist/TextEditor/license_key.js.map +1 -0
  111. package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +1 -0
  112. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -0
  113. package/dist/TextEditor/plugins/CutPlugin/index.js.map +1 -0
  114. package/dist/{NextTextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +1 -1
  115. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -0
  116. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -0
  117. package/dist/{NextTextEditor/plugins/CutPlugin/CutCommand.js.map → TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map} +1 -1
  118. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -0
  119. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -0
  120. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -0
  121. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -0
  122. package/dist/TextEditor/plugins/PastePlugin/index.js.map +1 -0
  123. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -0
  124. package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +1 -0
  125. package/dist/TextEditor/textEditorTheming/icons.js.map +1 -0
  126. package/dist/TextEditor/textEditorTheming/index.js.map +1 -0
  127. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -0
  128. package/dist/TextEditor/useCKEditorCss.js.map +1 -0
  129. package/dist/TextEditor/useTabAsNavigation.js.map +1 -0
  130. package/dist/TextEditor/utils/config.js.map +1 -0
  131. package/dist/TextEditor/utils/index.js.map +1 -0
  132. package/dist/TextEditor/utils/locale.js.map +1 -0
  133. package/dist/TextEditor/utils/plugins.js.map +1 -0
  134. package/dist/TextEditorOutput/TextEditorOutput.d.ts +1 -3
  135. package/dist/TextEditorOutput/TextEditorOutput.js +15 -14
  136. package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
  137. package/dist/{NextTextEditorOutput/NextTextEditorOutput.styles.js → TextEditorOutput/TextEditorOutput.styles.js} +2 -2
  138. package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -0
  139. package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +7 -17
  140. package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
  141. package/dist/{NextTextEditorOutput/NextTextEditorOutput.utils.js → TextEditorOutput/TextEditorOutput.utils.js} +1 -1
  142. package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +1 -0
  143. package/dist/Thumbnail/Thumbnail.hooks.d.ts +64 -64
  144. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  145. package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
  146. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  147. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  148. package/dist/Tile/Tile.styles.js +8 -8
  149. package/dist/Title/Title.styles.js +7 -7
  150. package/dist/Toast/Toast.styles.js +3 -3
  151. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  152. package/dist/Token/Token.styles.js +3 -3
  153. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  154. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  155. package/dist/Tooltip/Tooltip.styles.js +2 -2
  156. package/dist/Tree/Tree.styles.js +9 -9
  157. package/dist/Typeahead/Typeahead.styles.js +3 -3
  158. package/dist/Typography/Typography.styles.js +1 -1
  159. package/dist/Typography/Typography.table.story.js +2 -2
  160. package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
  161. package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
  162. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  163. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  164. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  165. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  166. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  167. package/dist/_typedoc/Box/Box.types.json +72 -72
  168. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  169. package/dist/_typedoc/Button/Button.types.json +15 -15
  170. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  171. package/dist/_typedoc/Card/Card.types.json +6 -6
  172. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  173. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  174. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  175. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  176. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  177. package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
  178. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
  179. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  180. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  181. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  182. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  183. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  184. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  185. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  186. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  187. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  188. package/dist/_typedoc/Form/Form.types.json +1048 -920
  189. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  190. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  191. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  192. package/dist/_typedoc/Input/Input.types.json +2 -2
  193. package/dist/_typedoc/Link/Link.types.json +1 -1
  194. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  195. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  196. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  197. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  198. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  199. package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
  200. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  201. package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
  202. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
  203. package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
  204. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  205. package/dist/_typedoc/Panel/Panel.types.json +30 -30
  206. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  207. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  208. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  209. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  210. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  211. package/dist/_typedoc/Required/Required.types.json +5 -5
  212. package/dist/_typedoc/Search/Search.types.json +18 -18
  213. package/dist/_typedoc/Section/Section.types.json +15 -15
  214. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  215. package/dist/_typedoc/Select/Select.types.json +62 -62
  216. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  217. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  218. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  219. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  220. package/dist/_typedoc/Table/Table.types.json +101 -101
  221. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  222. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  223. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  224. package/dist/_typedoc/TextEditor/TextEditor.types.json +216 -1
  225. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
  226. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +32 -6
  227. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  228. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  229. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  230. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  231. package/dist/_typedoc/Title/Title.types.json +3 -3
  232. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  233. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  234. package/dist/_typedoc/Token/Token.types.json +7 -7
  235. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  236. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  237. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  238. package/dist/_typedoc/Tree/Tree.types.json +88 -88
  239. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  240. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  241. package/dist/_typedoc/_utils/types.json +3 -3
  242. package/dist/_typedoc/deprecations.json +1 -1
  243. package/dist/_utils/propsTypedoc.d.ts +0 -2
  244. package/dist/_utils/propsTypedoc.js +0 -2
  245. package/dist/_utils/propsTypedoc.js.map +1 -1
  246. package/dist/index.d.ts +12 -6
  247. package/dist/index.js +17 -8
  248. package/dist/index.js.map +1 -1
  249. package/package.json +1 -2
  250. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.d.ts +0 -19
  251. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js +0 -159
  252. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js.map +0 -1
  253. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.styles.d.ts +0 -4
  254. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.styles.js +0 -6
  255. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.styles.js.map +0 -1
  256. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.d.ts +0 -72
  257. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js +0 -2
  258. package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js.map +0 -1
  259. package/dist/DeprecatedTextEditor/index.d.ts +0 -2
  260. package/dist/DeprecatedTextEditor/index.js +0 -3
  261. package/dist/DeprecatedTextEditor/index.js.map +0 -1
  262. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.d.ts +0 -12
  263. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js +0 -45
  264. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js.map +0 -1
  265. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js +0 -6
  266. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js.map +0 -1
  267. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.d.ts +0 -16
  268. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js +0 -2
  269. package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js.map +0 -1
  270. package/dist/DeprecatedTextEditorOutput/index.d.ts +0 -2
  271. package/dist/DeprecatedTextEditorOutput/index.js +0 -2
  272. package/dist/DeprecatedTextEditorOutput/index.js.map +0 -1
  273. package/dist/NextTextEditor/EditorError.js.map +0 -1
  274. package/dist/NextTextEditor/NextTextEditor.d.ts +0 -3
  275. package/dist/NextTextEditor/NextTextEditor.js +0 -156
  276. package/dist/NextTextEditor/NextTextEditor.js.map +0 -1
  277. package/dist/NextTextEditor/NextTextEditor.styles.js.map +0 -1
  278. package/dist/NextTextEditor/NextTextEditor.types.d.ts +0 -111
  279. package/dist/NextTextEditor/NextTextEditor.types.js +0 -2
  280. package/dist/NextTextEditor/NextTextEditor.types.js.map +0 -1
  281. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.js.map +0 -1
  282. package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.js.map +0 -1
  283. package/dist/NextTextEditor/StickyToolbar/index.js.map +0 -1
  284. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.js.map +0 -1
  285. package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.js.map +0 -1
  286. package/dist/NextTextEditor/index.d.ts +0 -2
  287. package/dist/NextTextEditor/index.js +0 -3
  288. package/dist/NextTextEditor/index.js.map +0 -1
  289. package/dist/NextTextEditor/license_key.js.map +0 -1
  290. package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.js.map +0 -1
  291. package/dist/NextTextEditor/plugins/CutPlugin/index.js.map +0 -1
  292. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +0 -1
  293. package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +0 -1
  294. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.d.ts +0 -15
  295. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js +0 -65
  296. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js.map +0 -1
  297. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.d.ts +0 -13
  298. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js +0 -80
  299. package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js.map +0 -1
  300. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +0 -1
  301. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +0 -1
  302. package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.js.map +0 -1
  303. package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.js.map +0 -1
  304. package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.js.map +0 -1
  305. package/dist/NextTextEditor/plugins/PastePlugin/index.js.map +0 -1
  306. package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +0 -1
  307. package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.js.map +0 -1
  308. package/dist/NextTextEditor/textEditorTheming/icons.js.map +0 -1
  309. package/dist/NextTextEditor/textEditorTheming/index.js.map +0 -1
  310. package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.js.map +0 -1
  311. package/dist/NextTextEditor/useCKEditorCss.js.map +0 -1
  312. package/dist/NextTextEditor/useTabAsNavigation.js.map +0 -1
  313. package/dist/NextTextEditor/utils/config.js.map +0 -1
  314. package/dist/NextTextEditor/utils/index.js.map +0 -1
  315. package/dist/NextTextEditor/utils/locale.js.map +0 -1
  316. package/dist/NextTextEditor/utils/plugins.js.map +0 -1
  317. package/dist/NextTextEditorOutput/NextTextEditorOutput.d.ts +0 -8
  318. package/dist/NextTextEditorOutput/NextTextEditorOutput.js +0 -29
  319. package/dist/NextTextEditorOutput/NextTextEditorOutput.js.map +0 -1
  320. package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.d.ts +0 -2
  321. package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js.map +0 -1
  322. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.d.ts +0 -9
  323. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js +0 -2
  324. package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js.map +0 -1
  325. package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.js.map +0 -1
  326. package/dist/NextTextEditorOutput/index.d.ts +0 -2
  327. package/dist/NextTextEditorOutput/index.js +0 -2
  328. package/dist/NextTextEditorOutput/index.js.map +0 -1
  329. package/dist/TextEditor/TextEditorDocs.types.d.ts +0 -65
  330. package/dist/TextEditor/TextEditorDocs.types.js +0 -2
  331. package/dist/TextEditor/TextEditorDocs.types.js.map +0 -1
  332. package/dist/TextEditorOutput/TextEditorOutputDocs.types.d.ts +0 -21
  333. package/dist/TextEditorOutput/TextEditorOutputDocs.types.js +0 -2
  334. package/dist/TextEditorOutput/TextEditorOutputDocs.types.js.map +0 -1
  335. package/dist/_typedoc/TextEditor/TextEditorDocs.types.json +0 -98
  336. package/dist/_typedoc/TextEditorOutput/TextEditorOutputDocs.types.json +0 -38
  337. package/dist/_utils/TinyMCE.d.ts +0 -21
  338. package/dist/_utils/TinyMCE.js +0 -86
  339. package/dist/_utils/TinyMCE.js.map +0 -1
  340. package/dist/_utils/props.d.ts +0 -4
  341. package/dist/_utils/props.js +0 -5
  342. package/dist/_utils/props.js.map +0 -1
  343. /package/dist/{NextTextEditor → TextEditor}/EditorError.d.ts +0 -0
  344. /package/dist/{NextTextEditor → TextEditor}/EditorError.js +0 -0
  345. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/StickyToolbar.types.d.ts +0 -0
  346. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/StickyToolbar.types.js +0 -0
  347. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/StickyToolbar.utils.d.ts +0 -0
  348. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/StickyToolbar.utils.js +0 -0
  349. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/index.d.ts +0 -0
  350. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/index.js +0 -0
  351. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/useStickyToolbar.d.ts +0 -0
  352. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/useStickyToolbar.js +0 -0
  353. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/useStickyToolbar.types.d.ts +0 -0
  354. /package/dist/{NextTextEditor → TextEditor}/StickyToolbar/useStickyToolbar.types.js +0 -0
  355. /package/dist/{NextTextEditor/NextTextEditor.styles.d.ts → TextEditor/TextEditor.styles.d.ts} +0 -0
  356. /package/dist/{NextTextEditor → TextEditor}/license_key.d.ts +0 -0
  357. /package/dist/{NextTextEditor → TextEditor}/license_key.js +0 -0
  358. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/CutCommand.d.ts +0 -0
  359. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/CutCommand.js +0 -0
  360. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/CutPlugin.d.ts +0 -0
  361. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/CutPlugin.js +0 -0
  362. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/index.d.ts +0 -0
  363. /package/dist/{NextTextEditor → TextEditor}/plugins/CutPlugin/index.js +0 -0
  364. /package/dist/{NextTextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +0 -0
  365. /package/dist/{NextTextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/index.d.ts +0 -0
  366. /package/dist/{NextTextEditor → TextEditor}/plugins/IndentPaddingToMarginPlugin/index.js +0 -0
  367. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +0 -0
  368. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +0 -0
  369. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +0 -0
  370. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +0 -0
  371. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/index.d.ts +0 -0
  372. /package/dist/{NextTextEditor → TextEditor}/plugins/PasteAsTextPlugin/index.js +0 -0
  373. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/PasteCommand.d.ts +0 -0
  374. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/PasteCommand.js +0 -0
  375. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/PastePlugin.d.ts +0 -0
  376. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/PastePlugin.js +0 -0
  377. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/index.d.ts +0 -0
  378. /package/dist/{NextTextEditor → TextEditor}/plugins/PastePlugin/index.js +0 -0
  379. /package/dist/{NextTextEditor → TextEditor}/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +0 -0
  380. /package/dist/{NextTextEditor → TextEditor}/plugins/TabSpacesPlugin/TabSpacesPlugin.js +0 -0
  381. /package/dist/{NextTextEditor → TextEditor}/plugins/TabSpacesPlugin/index.d.ts +0 -0
  382. /package/dist/{NextTextEditor → TextEditor}/plugins/TabSpacesPlugin/index.js +0 -0
  383. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/icons.d.ts +0 -0
  384. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/icons.js +0 -0
  385. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/index.d.ts +0 -0
  386. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/index.js +0 -0
  387. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/textEditorTheming.styles.d.ts +0 -0
  388. /package/dist/{NextTextEditor → TextEditor}/textEditorTheming/textEditorTheming.styles.js +0 -0
  389. /package/dist/{NextTextEditor → TextEditor}/useCKEditorCss.d.ts +0 -0
  390. /package/dist/{NextTextEditor → TextEditor}/useCKEditorCss.js +0 -0
  391. /package/dist/{NextTextEditor → TextEditor}/useTabAsNavigation.d.ts +0 -0
  392. /package/dist/{NextTextEditor → TextEditor}/useTabAsNavigation.js +0 -0
  393. /package/dist/{NextTextEditor → TextEditor}/utils/config.d.ts +0 -0
  394. /package/dist/{NextTextEditor → TextEditor}/utils/config.js +0 -0
  395. /package/dist/{NextTextEditor → TextEditor}/utils/index.d.ts +0 -0
  396. /package/dist/{NextTextEditor → TextEditor}/utils/index.js +0 -0
  397. /package/dist/{NextTextEditor → TextEditor}/utils/locale.d.ts +0 -0
  398. /package/dist/{NextTextEditor → TextEditor}/utils/locale.js +0 -0
  399. /package/dist/{NextTextEditor → TextEditor}/utils/plugins.d.ts +0 -0
  400. /package/dist/{NextTextEditor → TextEditor}/utils/plugins.js +0 -0
  401. /package/dist/{DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.d.ts → TextEditorOutput/TextEditorOutput.styles.d.ts} +0 -0
  402. /package/dist/{NextTextEditorOutput/NextTextEditorOutput.utils.d.ts → TextEditorOutput/TextEditorOutput.utils.d.ts} +0 -0
@@ -1,159 +0,0 @@
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
- var _excluded = ["error", "init", "locale", "onChange", "onInit", "plugins"];
3
- 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); }
4
- 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; }
5
- 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; }
6
- 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; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
- 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); }
9
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
- 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; }
14
- 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; }
15
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
16
- 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."); }
17
- 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; } }
18
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
19
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
20
- 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; }
21
- import { Editor } from '@tinymce/tinymce-react';
22
- import React, { useState } from 'react';
23
- import { TextEditorContext } from '../TextEditor/TextEditorProvider';
24
- import { useOverridableFocusScope } from '../_hooks/FocusScopeOverride';
25
- import { useI18nContext } from '../_hooks/I18n';
26
- import { useZIndexContext } from '../_hooks/ZIndex';
27
- import { defaultPlugins, generateExternalPlugins, generateLanguageUrl, getValidLookupLocale, tinyMCEConfig, tinyMCESource, tinyMCETabMarkup, tinyMCEVersion } from '../_utils/TinyMCE';
28
- import { GlobalStyle } from './DeprecatedTextEditor.styles';
29
- var errorRed = '#E61920';
30
- function noop() {}
31
- function setupDefaultShortcuts(editor) {
32
- editor.shortcuts.add('meta+shift+s', 'Strikethrough', 'Strikethrough');
33
- }
34
-
35
- /**
36
- * editor.addShortcut does not notify on Tab key presses
37
- */
38
- function setupShortcuts(editor) {
39
- setupDefaultShortcuts(editor);
40
- editor.on('keydown', function checkTabPress(event) {
41
- if (event.altKey && event.key === 'Tab') {
42
- editor.execCommand('mceInsertContent', false, tinyMCETabMarkup);
43
- event.preventDefault();
44
- event.stopPropagation();
45
- return false;
46
- }
47
- });
48
- }
49
-
50
- /**
51
- * The following plugins open a TinyMCE modal.
52
- * When used with React Aria contained FocusScope,
53
- * focus does not move into the TinyMCE modal.
54
- * This patch gets critical functionality back at
55
- * the cost of possibly failing accessbility.
56
- */
57
- function useFocusScopePatch(plugins) {
58
- var focusScope = useOverridableFocusScope();
59
- React.useEffect(function () {
60
- if ([].concat(_toConsumableArray(defaultPlugins), _toConsumableArray(plugins)).some(
61
- // Add plugins that open a tinymce modal here
62
- function (plugin) {
63
- return plugin === 'link' || plugin === 'table' || plugin === 'image';
64
- })) {
65
- focusScope.setProps({
66
- contain: false
67
- });
68
- }
69
- }, [focusScope, plugins]);
70
- }
71
-
72
- /**
73
-
74
- We use text editors to allow users to enter multiple lines of formatted text.
75
-
76
- If users need to add unformatted text, see Text Area.
77
-
78
- @since 10.19.0
79
-
80
- @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditor--demo)
81
-
82
- @see [Design Guidelines](https://design.procore.com/text-editor)
83
-
84
- */
85
- export function DeprecatedTextEditor(_ref) {
86
- var _props$initialValue, _props$value;
87
- var error = _ref.error,
88
- initOverrides = _ref.init,
89
- locale = _ref.locale,
90
- _ref$onChange = _ref.onChange,
91
- onChange = _ref$onChange === void 0 ? noop : _ref$onChange,
92
- _onInit = _ref.onInit,
93
- _ref$plugins = _ref.plugins,
94
- plugins = _ref$plugins === void 0 ? defaultPlugins : _ref$plugins,
95
- props = _objectWithoutProperties(_ref, _excluded);
96
- var _useI18nContext = useI18nContext(),
97
- contextLocale = _useI18nContext.locale;
98
- var _useZIndexContext = useZIndexContext(),
99
- zIndex = _useZIndexContext.value;
100
- var _React$useContext = React.useContext(TextEditorContext),
101
- features = _React$useContext.features;
102
- var stickyToolbar = features !== null && features !== void 0 && features.stickyToolbar ? {
103
- toolbar_sticky: true
104
- } : {};
105
- var tabControls = features !== null && features !== void 0 && features.tabAsNavigation ? {
106
- external_plugins: generateExternalPlugins(plugins, defaultPlugins.filter(function (p) {
107
- return p !== 'nonbreaking';
108
- })),
109
- nonbreaking_force_tab: false,
110
- setup: setupShortcuts
111
- } : {
112
- setup: setupDefaultShortcuts
113
- };
114
- var onEditorChange = function onEditorChange(_, editor) {
115
- onChange(editor.getContent(), editor.isDirty());
116
- };
117
- var ref = React.useRef();
118
- var updateError = function updateError() {
119
- if (ref.current) {
120
- if (error) {
121
- ref.current.style.borderColor = errorRed;
122
- } else {
123
- ref.current.style.borderColor = '';
124
- }
125
- }
126
- };
127
- React.useEffect(function () {
128
- updateError();
129
- }, [error]);
130
- useFocusScopePatch(plugins);
131
- var onInit = function onInit(event, editor) {
132
- ref.current = editor.editorContainer;
133
- updateError();
134
- _onInit && _onInit(event, editor);
135
- };
136
- var _useState = useState((_props$initialValue = props.initialValue) !== null && _props$initialValue !== void 0 ? _props$initialValue : props.value),
137
- _useState2 = _slicedToArray(_useState, 1),
138
- derivedInitial = _useState2[0];
139
-
140
- // zIndex + 1 because on first render zIndex of Portal(Modal) is higher
141
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GlobalStyle, {
142
- $zIndex: zIndex + 1
143
- }), /*#__PURE__*/React.createElement(Editor, _extends({
144
- init: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tinyMCEConfig), {}, {
145
- external_plugins: generateExternalPlugins(plugins),
146
- language_url: generateLanguageUrl(locale || contextLocale),
147
- language: getValidLookupLocale(locale || contextLocale),
148
- content_style: "p { margin: 0; }"
149
- }, stickyToolbar), tabControls), initOverrides),
150
- tinymceScriptSrc: "".concat(tinyMCESource, "/").concat(tinyMCEVersion, "/tinymce.min.js"),
151
- onInit: onInit,
152
- onEditorChange: onEditorChange
153
- }, props, {
154
- value: (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : props.initialValue,
155
- initialValue: derivedInitial
156
- })));
157
- }
158
- DeprecatedTextEditor.displayName = 'DeprecatedTextEditor';
159
- //# sourceMappingURL=DeprecatedTextEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditor.js","names":["Editor","React","useState","TextEditorContext","useOverridableFocusScope","useI18nContext","useZIndexContext","defaultPlugins","generateExternalPlugins","generateLanguageUrl","getValidLookupLocale","tinyMCEConfig","tinyMCESource","tinyMCETabMarkup","tinyMCEVersion","GlobalStyle","errorRed","noop","setupDefaultShortcuts","editor","shortcuts","add","setupShortcuts","on","checkTabPress","event","altKey","key","execCommand","preventDefault","stopPropagation","useFocusScopePatch","plugins","focusScope","useEffect","concat","_toConsumableArray","some","plugin","setProps","contain","DeprecatedTextEditor","_ref","_props$initialValue","_props$value","error","initOverrides","init","locale","_ref$onChange","onChange","_onInit","onInit","_ref$plugins","props","_objectWithoutProperties","_excluded","_useI18nContext","contextLocale","_useZIndexContext","zIndex","value","_React$useContext","useContext","features","stickyToolbar","toolbar_sticky","tabControls","tabAsNavigation","external_plugins","filter","p","nonbreaking_force_tab","setup","onEditorChange","_","getContent","isDirty","ref","useRef","updateError","current","style","borderColor","editorContainer","_useState","initialValue","_useState2","_slicedToArray","derivedInitial","createElement","Fragment","$zIndex","_extends","_objectSpread","language_url","language","content_style","tinymceScriptSrc","displayName"],"sources":["../../src/DeprecatedTextEditor/DeprecatedTextEditor.tsx"],"sourcesContent":["import { Editor } from '@tinymce/tinymce-react'\nimport React, { useState } from 'react'\nimport { TextEditorContext } from '../TextEditor/TextEditorProvider'\nimport { useOverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useZIndexContext } from '../_hooks/ZIndex'\nimport {\n defaultPlugins,\n generateExternalPlugins,\n generateLanguageUrl,\n getValidLookupLocale,\n tinyMCEConfig,\n tinyMCESource,\n tinyMCETabMarkup,\n tinyMCEVersion,\n} from '../_utils/TinyMCE'\nimport { GlobalStyle } from './DeprecatedTextEditor.styles'\nimport type { DeprecatedTextEditorProps } from './DeprecatedTextEditor.types'\n\nconst errorRed = '#E61920'\n\nfunction noop() {}\n\nfunction setupDefaultShortcuts(editor: any) {\n editor.shortcuts.add('meta+shift+s', 'Strikethrough', 'Strikethrough')\n}\n\n/**\n * editor.addShortcut does not notify on Tab key presses\n */\nfunction setupShortcuts(editor: any) {\n setupDefaultShortcuts(editor)\n editor.on('keydown', function checkTabPress(event: React.KeyboardEvent) {\n if (event.altKey && event.key === 'Tab') {\n editor.execCommand('mceInsertContent', false, tinyMCETabMarkup)\n event.preventDefault()\n event.stopPropagation()\n return false\n }\n })\n}\n\n/**\n * The following plugins open a TinyMCE modal.\n * When used with React Aria contained FocusScope,\n * focus does not move into the TinyMCE modal.\n * This patch gets critical functionality back at\n * the cost of possibly failing accessbility.\n */\nfunction useFocusScopePatch(plugins: string[]) {\n const focusScope = useOverridableFocusScope()\n React.useEffect(() => {\n if (\n [...defaultPlugins, ...plugins].some(\n // Add plugins that open a tinymce modal here\n (plugin) =>\n plugin === 'link' || plugin === 'table' || plugin === 'image'\n )\n ) {\n focusScope.setProps({ contain: false })\n }\n }, [focusScope, plugins])\n}\n\n/**\n\n We use text editors to allow users to enter multiple lines of formatted text.\n\n If users need to add unformatted text, see Text Area.\n\n @since 10.19.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditor--demo)\n\n @see [Design Guidelines](https://design.procore.com/text-editor)\n\n */\nexport function DeprecatedTextEditor({\n error,\n init: initOverrides,\n locale,\n onChange = noop,\n onInit: _onInit,\n plugins = defaultPlugins,\n ...props\n}: DeprecatedTextEditorProps) {\n const { locale: contextLocale } = useI18nContext()\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const stickyToolbar = features?.stickyToolbar ? { toolbar_sticky: true } : {}\n const tabControls = features?.tabAsNavigation\n ? {\n external_plugins: generateExternalPlugins(\n plugins,\n defaultPlugins.filter((p) => p !== 'nonbreaking')\n ),\n nonbreaking_force_tab: false,\n setup: setupShortcuts,\n }\n : {\n setup: setupDefaultShortcuts,\n }\n\n const onEditorChange: React.ComponentProps<\n typeof Editor\n >['onEditorChange'] = (_: any, editor: any) => {\n onChange(editor.getContent(), editor.isDirty())\n }\n\n const ref = React.useRef<HTMLElement>()\n\n const updateError = () => {\n if (ref.current) {\n if (error) {\n ref.current.style.borderColor = errorRed\n } else {\n ref.current.style.borderColor = ''\n }\n }\n }\n\n React.useEffect(() => {\n updateError()\n }, [error])\n\n useFocusScopePatch(plugins)\n\n const onInit: React.ComponentProps<typeof Editor>['onInit'] = (\n event,\n editor\n ) => {\n ref.current = editor.editorContainer\n updateError()\n _onInit && _onInit(event, editor)\n }\n\n const [derivedInitial] = useState(props.initialValue ?? props.value)\n\n // zIndex + 1 because on first render zIndex of Portal(Modal) is higher\n return (\n <>\n <GlobalStyle $zIndex={zIndex + 1} />\n <Editor\n init={{\n ...tinyMCEConfig,\n external_plugins: generateExternalPlugins(plugins),\n language_url: generateLanguageUrl(locale || contextLocale),\n language: getValidLookupLocale(locale || contextLocale),\n content_style: `p { margin: 0; }`,\n ...stickyToolbar,\n ...tabControls,\n ...initOverrides,\n }}\n tinymceScriptSrc={`${tinyMCESource}/${tinyMCEVersion}/tinymce.min.js`}\n onInit={onInit}\n onEditorChange={onEditorChange}\n {...props}\n value={props.value ?? props.initialValue}\n initialValue={derivedInitial}\n />\n </>\n )\n}\n\nDeprecatedTextEditor.displayName = 'DeprecatedTextEditor'\n"],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const GlobalStyle: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
- $zIndex: number;
4
- }>;
@@ -1,6 +0,0 @@
1
- import { createGlobalStyle } from 'styled-components';
2
- export var GlobalStyle = /*#__PURE__*/createGlobalStyle([".tox.tox-tinymce-aux{z-index:", ";}"], function (_ref) {
3
- var $zIndex = _ref.$zIndex;
4
- return $zIndex;
5
- });
6
- //# sourceMappingURL=DeprecatedTextEditor.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditor.styles.js","names":["createGlobalStyle","GlobalStyle","_ref","$zIndex"],"sources":["../../src/DeprecatedTextEditor/DeprecatedTextEditor.styles.ts"],"sourcesContent":["import { createGlobalStyle } from 'styled-components'\n\nexport const GlobalStyle = createGlobalStyle<{ $zIndex: number }>`\n .tox.tox-tinymce-aux {\n z-index: ${({ $zIndex }) => $zIndex};\n }\n`\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,mBAAmB;AAErD,OAAO,IAAMC,WAAW,gBAAGD,iBAAiB,0CAE7B,UAAAE,IAAA;EAAA,IAAGC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAAA,OAAOA,OAAO;AAAA,EAEtC"}
@@ -1,72 +0,0 @@
1
- import type { Editor, IAllProps } from '@tinymce/tinymce-react';
2
- import type React from 'react';
3
- import type { Locale } from '../_hooks/I18n';
4
- export interface DeprecatedTextEditorProps extends Omit<React.ComponentProps<typeof Editor>, 'onChange' | 'onKeyUp'> {
5
- /**
6
- * @since 10.19.0
7
- */
8
- disabled?: boolean;
9
- /**
10
- * @since 10.19.0
11
- */
12
- error?: boolean;
13
- /**
14
- * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**
15
- * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)
16
- * @unsupported Use at your own risk. DST makes no guarantees about this API,
17
- * and is subject to removal at any point without warning or deprecation.
18
- * @deprecated `init` has been deprecated and will be removed in a future version.
19
- * @since 10.19.0
20
- */
21
- init?: IAllProps['init'];
22
- /**
23
- * @deprecated
24
- * `initialValue` has been deprecated and will be removed in a future version.
25
- * Please use the `value` prop instead
26
- *
27
- * The first value passed into `value` prop will be the `TextEditor` initial
28
- * value. Changing the value will update the text of the `TextEditor`.
29
- * The editor should be controlled via the combination of `value`
30
- * and `onChange` props.
31
- *
32
- * **Before**
33
- *
34
- * `<TextEditor initialValue="Hello World" />`
35
- *
36
- * **After**
37
- *
38
- * `<TextEditor value="Hello World" />`
39
- *
40
- * @deprecatedSince 10.20.0
41
- * @since 10.19.0
42
- */
43
- initialValue?: string;
44
- /**
45
- * Locale which will be used used for localization. Can be passed directly or
46
- * set by wrapping components in I18n provider. Icelandic (is-IS) is not
47
- * actually supported by TinyMCE, so it is defaulted to english.
48
- * @since 10.19.0
49
- */
50
- locale?: Locale;
51
- /**
52
- * onChange event handler for text editor area
53
- *
54
- * ```
55
- * (content: string) => void
56
- * ```
57
- * @since 10.19.0
58
- */
59
- onChange?: (content: string, isDirty?: boolean) => void;
60
- /**
61
- *
62
- * Array of plugins to use with the editor in addition to the defaults.
63
- * Can be any of:
64
- *
65
- * ```
66
- * [{plugins.map((plugin) => `'${plugin}'`).join(', ')}]
67
- * ```
68
- * @since 10.19.0
69
- * @deprecated `plugins` has been deprecated and will be removed in a future version.
70
- */
71
- plugins?: Array<string>;
72
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DeprecatedTextEditor.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditor.types.js","names":[],"sources":["../../src/DeprecatedTextEditor/DeprecatedTextEditor.types.ts"],"sourcesContent":["import type { Editor, IAllProps } from '@tinymce/tinymce-react'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\n\nexport interface DeprecatedTextEditorProps\n extends Omit<React.ComponentProps<typeof Editor>, 'onChange' | 'onKeyUp'> {\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean\n /**\n * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**\n * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)\n * @unsupported Use at your own risk. DST makes no guarantees about this API,\n * and is subject to removal at any point without warning or deprecation.\n * @deprecated `init` has been deprecated and will be removed in a future version.\n * @since 10.19.0\n */\n init?: IAllProps['init']\n /**\n * @deprecated\n * `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n *\n * The first value passed into `value` prop will be the `TextEditor` initial\n * value. Changing the value will update the text of the `TextEditor`.\n * The editor should be controlled via the combination of `value`\n * and `onChange` props.\n *\n * **Before**\n *\n * `<TextEditor initialValue=\"Hello World\" />`\n *\n * **After**\n *\n * `<TextEditor value=\"Hello World\" />`\n *\n * @deprecatedSince 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * Locale which will be used used for localization. Can be passed directly or\n * set by wrapping components in I18n provider. Icelandic (is-IS) is not\n * actually supported by TinyMCE, so it is defaulted to english.\n * @since 10.19.0\n */\n locale?: Locale\n\n /**\n * onChange event handler for text editor area\n *\n * ```\n * (content: string) => void\n * ```\n * @since 10.19.0\n */\n onChange?: (content: string, isDirty?: boolean) => void\n\n /**\n *\n * Array of plugins to use with the editor in addition to the defaults.\n * Can be any of:\n *\n * ```\n * [{plugins.map((plugin) => `'${plugin}'`).join(', ')}]\n * ```\n * @since 10.19.0\n * @deprecated `plugins` has been deprecated and will be removed in a future version.\n */\n plugins?: Array<string>\n}\n"],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './DeprecatedTextEditor';
2
- export * from './DeprecatedTextEditor.types';
@@ -1,3 +0,0 @@
1
- export * from './DeprecatedTextEditor';
2
- export * from './DeprecatedTextEditor.types';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/DeprecatedTextEditor/index.ts"],"sourcesContent":["export * from './DeprecatedTextEditor'\nexport * from './DeprecatedTextEditor.types'\n"],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,8BAA8B"}
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { DeprecatedTextEditorOutputProps } from './DeprecatedTextEditorOutput.types';
3
- /**
4
-
5
- Render formatted text from `TextEditor`
6
-
7
- @since 10.24.0
8
-
9
- @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditoroutput--demo)
10
-
11
- */
12
- export declare const DeprecatedTextEditorOutput: React.ForwardRefExoticComponent<DeprecatedTextEditorOutputProps & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -1,45 +0,0 @@
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
- var _excluded = ["value", "init"];
3
- 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); }
4
- 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; }
5
- 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; }
6
- 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; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
- 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); }
9
- 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; }
10
- 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; }
11
- import { Editor } from '@tinymce/tinymce-react';
12
- import React from 'react';
13
- import { generateExternalPlugins, tinyMCEConfig, tinyMCESource, tinyMCEVersion } from '../_utils/TinyMCE';
14
- import { StyledEditor } from './DeprecatedTextEditorOutput.styles';
15
- /**
16
-
17
- Render formatted text from `TextEditor`
18
-
19
- @since 10.24.0
20
-
21
- @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditoroutput--demo)
22
-
23
- */
24
- export var DeprecatedTextEditorOutput = /*#__PURE__*/React.forwardRef(function DeprecatedTextEditorOutput(_ref, ref) {
25
- var value = _ref.value,
26
- initOverrides = _ref.init,
27
- props = _objectWithoutProperties(_ref, _excluded);
28
- return /*#__PURE__*/React.createElement(StyledEditor, _extends({}, props, {
29
- ref: ref
30
- }), /*#__PURE__*/React.createElement(Editor, {
31
- value: value,
32
- init: _objectSpread(_objectSpread({}, tinyMCEConfig), {}, {
33
- external_plugins: generateExternalPlugins(['autoresize']),
34
- toolbar: false,
35
- autoresize_overflow_padding: 0,
36
- min_height: 0,
37
- max_height: 400,
38
- content_style: "body { margin: 0; padding: 0; } p { margin: 0; }"
39
- }, initOverrides),
40
- tinymceScriptSrc: "".concat(tinyMCESource, "/").concat(tinyMCEVersion, "/tinymce.min.js"),
41
- disabled: true
42
- }));
43
- });
44
- DeprecatedTextEditorOutput.displayName = 'DeprecatedTextEditorOutput';
45
- //# sourceMappingURL=DeprecatedTextEditorOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditorOutput.js","names":["Editor","React","generateExternalPlugins","tinyMCEConfig","tinyMCESource","tinyMCEVersion","StyledEditor","DeprecatedTextEditorOutput","forwardRef","_ref","ref","value","initOverrides","init","props","_objectWithoutProperties","_excluded","createElement","_extends","_objectSpread","external_plugins","toolbar","autoresize_overflow_padding","min_height","max_height","content_style","tinymceScriptSrc","concat","disabled","displayName"],"sources":["../../src/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.tsx"],"sourcesContent":["import { Editor } from '@tinymce/tinymce-react'\nimport React from 'react'\nimport {\n generateExternalPlugins,\n tinyMCEConfig,\n tinyMCESource,\n tinyMCEVersion,\n} from '../_utils/TinyMCE'\nimport { StyledEditor } from './DeprecatedTextEditorOutput.styles'\nimport type { DeprecatedTextEditorOutputProps } from './DeprecatedTextEditorOutput.types'\n\n/**\n\n Render formatted text from `TextEditor`\n\n @since 10.24.0\n\n @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditoroutput--demo)\n\n */\nexport const DeprecatedTextEditorOutput = React.forwardRef<\n HTMLDivElement,\n DeprecatedTextEditorOutputProps & React.HTMLAttributes<HTMLDivElement>\n>(function DeprecatedTextEditorOutput(\n { value, init: initOverrides, ...props },\n ref\n) {\n return (\n <StyledEditor {...props} ref={ref}>\n <Editor\n value={value}\n init={{\n ...tinyMCEConfig,\n external_plugins: generateExternalPlugins(['autoresize']),\n toolbar: false,\n autoresize_overflow_padding: 0,\n min_height: 0,\n max_height: 400,\n content_style: `body { margin: 0; padding: 0; } p { margin: 0; }`,\n ...initOverrides,\n }}\n tinymceScriptSrc={`${tinyMCESource}/${tinyMCEVersion}/tinymce.min.js`}\n disabled\n />\n </StyledEditor>\n )\n})\n\nDeprecatedTextEditorOutput.displayName = 'DeprecatedTextEditorOutput'\n"],"mappings":";;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,KAAK,MAAM,OAAO;AACzB,SACEC,uBAAuB,EACvBC,aAAa,EACbC,aAAa,EACbC,cAAc,QACT,mBAAmB;AAC1B,SAASC,YAAY,QAAQ,qCAAqC;AAGlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,0BAA0B,gBAAGN,KAAK,CAACO,UAAU,CAGxD,SAASD,0BAA0BA,CAAAE,IAAA,EAEnCC,GAAG,EACH;EAAA,IAFEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAQC,aAAa,GAAAH,IAAA,CAAnBI,IAAI;IAAoBC,KAAK,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA;EAGtC,oBACEf,KAAA,CAAAgB,aAAA,CAACX,YAAY,EAAAY,QAAA,KAAKJ,KAAK;IAAEJ,GAAG,EAAEA;EAAI,iBAChCT,KAAA,CAAAgB,aAAA,CAACjB,MAAM;IACLW,KAAK,EAAEA,KAAM;IACbE,IAAI,EAAAM,aAAA,CAAAA,aAAA,KACChB,aAAa;MAChBiB,gBAAgB,EAAElB,uBAAuB,CAAC,CAAC,YAAY,CAAC,CAAC;MACzDmB,OAAO,EAAE,KAAK;MACdC,2BAA2B,EAAE,CAAC;MAC9BC,UAAU,EAAE,CAAC;MACbC,UAAU,EAAE,GAAG;MACfC,aAAa;IAAoD,GAC9Db,aAAa,CAChB;IACFc,gBAAgB,KAAAC,MAAA,CAAKvB,aAAa,OAAAuB,MAAA,CAAItB,cAAc,oBAAkB;IACtEuB,QAAQ;EAAA,CACT,CACW,CAAC;AAEnB,CAAC,CAAC;AAEFrB,0BAA0B,CAACsB,WAAW,GAAG,4BAA4B"}
@@ -1,6 +0,0 @@
1
- import styled from 'styled-components';
2
- export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
3
- displayName: "StyledEditor",
4
- componentId: "core-12_26_6__sc-byycgb-0"
5
- })(["> .tox-tinymce{border:none;}"]);
6
- //# sourceMappingURL=DeprecatedTextEditorOutput.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n > .tox-tinymce {\n border: none;\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oCAIrC"}
@@ -1,16 +0,0 @@
1
- import type { IAllProps } from '@tinymce/tinymce-react';
2
- import type { Props } from '../_utils/types';
3
- export interface DeprecatedTextEditorOutputProps extends Omit<Props, 'children'> {
4
- /**
5
- * formatted text
6
- * @since 10.24.0
7
- * */
8
- value?: IAllProps['value'];
9
- /**
10
- * Config for when the editor is initialized.
11
- * **Changes after the editor has initialized are ignored.**
12
- * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)
13
- * @since 11.17.0
14
- */
15
- init?: IAllProps['init'];
16
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DeprecatedTextEditorOutput.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeprecatedTextEditorOutput.types.js","names":[],"sources":["../../src/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.ts"],"sourcesContent":["import type { IAllProps } from '@tinymce/tinymce-react'\nimport type { Props } from '../_utils/types'\n\nexport interface DeprecatedTextEditorOutputProps\n extends Omit<Props, 'children'> {\n /**\n * formatted text\n * @since 10.24.0\n * */\n value?: IAllProps['value']\n /**\n * Config for when the editor is initialized.\n * **Changes after the editor has initialized are ignored.**\n * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)\n * @since 11.17.0\n */\n init?: IAllProps['init']\n}\n"],"mappings":""}
@@ -1,2 +0,0 @@
1
- export { DeprecatedTextEditorOutput } from './DeprecatedTextEditorOutput';
2
- export type { DeprecatedTextEditorOutputProps } from './DeprecatedTextEditorOutput.types';
@@ -1,2 +0,0 @@
1
- export { DeprecatedTextEditorOutput } from './DeprecatedTextEditorOutput';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["DeprecatedTextEditorOutput"],"sources":["../../src/DeprecatedTextEditorOutput/index.ts"],"sourcesContent":["export { DeprecatedTextEditorOutput } from './DeprecatedTextEditorOutput'\nexport type { DeprecatedTextEditorOutputProps } from './DeprecatedTextEditorOutput.types'\n"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,8BAA8B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorError.js","names":["React","Banner","EditorError","_ref","children","createElement","variant","Content","Body"],"sources":["../../src/NextTextEditor/EditorError.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react'\nimport { Banner } from '../Banner'\n\nexport const EditorError = ({ children }: PropsWithChildren<{}>) => {\n return (\n <Banner variant=\"error\">\n <Banner.Content>\n <Banner.Body>{children}</Banner.Body>\n </Banner.Content>\n </Banner>\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAkC,OAAO;AACrD,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAA4C;EAAA,IAAtCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACpC,oBACEJ,KAAA,CAAAK,aAAA,CAACJ,MAAM;IAACK,OAAO,EAAC;EAAO,gBACrBN,KAAA,CAAAK,aAAA,CAACJ,MAAM,CAACM,OAAO,qBACbP,KAAA,CAAAK,aAAA,CAACJ,MAAM,CAACO,IAAI,QAAEJ,QAAsB,CACtB,CACV,CAAC;AAEb,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { NextTextEditorProps } from './NextTextEditor.types';
3
- export declare function NextTextEditor({ disabled, error, value, initialValue, onChange, onEditorChange, onDirty, onInit, onKeyDown, onFocusOut, onBlur, init, config: externalConfig, plugins: stringPlugins, locale: propLocale, ...restProps }: NextTextEditorProps): React.JSX.Element | null;
@@ -1,156 +0,0 @@
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
- var _excluded = ["disabled", "error", "value", "initialValue", "onChange", "onEditorChange", "onDirty", "onInit", "onKeyDown", "onFocusOut", "onBlur", "init", "config", "plugins", "locale"];
3
- 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); }
4
- 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; }
5
- 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; }
6
- 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; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
- 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); }
9
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
- 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; } }
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
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
- 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; }
16
- 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; }
17
- import { CKEditor } from '@ckeditor/ckeditor5-react';
18
- import { ClassicEditor } from 'ckeditor5';
19
- import React from 'react';
20
- import { TextEditorContext } from '../TextEditor/TextEditorProvider';
21
- import { useOverridableFocusScope } from '../_hooks/FocusScopeOverride';
22
- import { useI18nContext } from '../_hooks/I18n';
23
- import { useZIndexContext } from '../_hooks/ZIndex';
24
- import { GlobalEditorStyles, StyledTextEditor } from './NextTextEditor.styles';
25
- import { useStickyToolbar } from './StickyToolbar';
26
- import { TextEditorTheme } from './textEditorTheming';
27
- import { useCKEditorCss } from './useCKEditorCss';
28
- import { useTabAsNavigation } from './useTabAsNavigation';
29
- import { addButtonDataAttributes, addPluginsFromStringArray, getDefaultConfig } from './utils';
30
- import { applyLegacyTinyMceCompatibility, isLegacyTinyMceConfig } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter';
31
- export function NextTextEditor(_ref) {
32
- var disabled = _ref.disabled,
33
- error = _ref.error,
34
- value = _ref.value,
35
- initialValue = _ref.initialValue,
36
- onChange = _ref.onChange,
37
- onEditorChange = _ref.onEditorChange,
38
- onDirty = _ref.onDirty,
39
- onInit = _ref.onInit,
40
- onKeyDown = _ref.onKeyDown,
41
- onFocusOut = _ref.onFocusOut,
42
- onBlur = _ref.onBlur,
43
- init = _ref.init,
44
- externalConfig = _ref.config,
45
- stringPlugins = _ref.plugins,
46
- propLocale = _ref.locale,
47
- restProps = _objectWithoutProperties(_ref, _excluded);
48
- var _useCKEditorCss = useCKEditorCss(),
49
- cssLoading = _useCKEditorCss.isLoading;
50
- var editorRef = React.useRef(null);
51
- var editorInstanceRef = React.useRef(null);
52
- var initialValueRef = React.useRef(value || initialValue || '');
53
- var _React$useState = React.useState(false),
54
- _React$useState2 = _slicedToArray(_React$useState, 2),
55
- isDirtyState = _React$useState2[0],
56
- setIsDirtyState = _React$useState2[1];
57
- var _useI18nContext = useI18nContext(),
58
- contextLocale = _useI18nContext.locale;
59
- var locale = propLocale || contextLocale;
60
- React.useEffect(function () {
61
- if (value !== undefined) {
62
- initialValueRef.current = value;
63
- }
64
- }, [value]);
65
- var _useZIndexContext = useZIndexContext(),
66
- zIndex = _useZIndexContext.value;
67
- var _React$useContext = React.useContext(TextEditorContext),
68
- features = _React$useContext.features;
69
- var enableStickyToolbar = !!(features !== null && features !== void 0 && features.stickyToolbar);
70
- var enableTabAsNavigation = !!(features !== null && features !== void 0 && features.tabAsNavigation);
71
- var mergedConfig = React.useMemo(function () {
72
- var defaultConfig = getDefaultConfig(locale);
73
-
74
- // Handle string plugins for backward compatibility
75
- var configWithPlugins = stringPlugins !== null && stringPlugins !== void 0 && stringPlugins.length ? addPluginsFromStringArray(defaultConfig, stringPlugins) : defaultConfig;
76
-
77
- // Apply any external CKEditor config overrides provided by the consumer
78
- var externalResult = typeof externalConfig === 'function' ? externalConfig(configWithPlugins) : undefined;
79
- // Merge default config (with plugins) and consumer overrides
80
- var finalConfig = _objectSpread(_objectSpread({}, configWithPlugins), externalResult !== null && externalResult !== void 0 ? externalResult : {});
81
- // Apply TinyMCE legacy compatibility only if `init` contains a legacy config
82
- if (init && isLegacyTinyMceConfig(init)) {
83
- finalConfig = applyLegacyTinyMceCompatibility(finalConfig, init);
84
- }
85
- return finalConfig;
86
- }, [externalConfig, init, locale, stringPlugins]);
87
- var focusScope = useOverridableFocusScope();
88
- React.useEffect(function () {
89
- focusScope.setProps({
90
- contain: false
91
- });
92
- }, [focusScope]);
93
- var handleChange = function handleChange(_event, editor) {
94
- var data = editor.getData();
95
- var isDirty = data !== initialValueRef.current;
96
-
97
- // Call onDirty only on first content modification
98
- if (isDirty && !isDirtyState) {
99
- setIsDirtyState(true);
100
- onDirty === null || onDirty === void 0 ? void 0 : onDirty();
101
- }
102
- onChange === null || onChange === void 0 ? void 0 : onChange(data, isDirty);
103
- onEditorChange === null || onEditorChange === void 0 ? void 0 : onEditorChange(data);
104
- };
105
- var handleReady = function handleReady(editor) {
106
- addButtonDataAttributes(editor);
107
- editorInstanceRef.current = editor;
108
- if (initialValue) {
109
- editor.setData(initialValue);
110
- }
111
- if (onKeyDown) {
112
- editor.editing.view.document.on('keydown', function (_event, data) {
113
- onKeyDown(data.domEvent);
114
- });
115
- }
116
- onInit === null || onInit === void 0 ? void 0 : onInit(editor);
117
- };
118
- var handleBlur = function handleBlur(event, editor) {
119
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, editor);
120
- onFocusOut === null || onFocusOut === void 0 ? void 0 : onFocusOut();
121
- };
122
- var _useStickyToolbar = useStickyToolbar({
123
- config: mergedConfig,
124
- enabled: enableStickyToolbar,
125
- editor: editorInstanceRef.current,
126
- editorRef: editorRef,
127
- cssLoading: cssLoading
128
- }),
129
- stickyConfig = _useStickyToolbar.config;
130
- var _useTabAsNavigation = useTabAsNavigation({
131
- config: stickyConfig,
132
- enabled: enableTabAsNavigation,
133
- editor: editorInstanceRef.current
134
- }),
135
- config = _useTabAsNavigation.config;
136
- var editorKey = "".concat(locale, "-").concat(enableTabAsNavigation);
137
- if (cssLoading) {
138
- return null;
139
- }
140
- return /*#__PURE__*/React.createElement(StyledTextEditor, {
141
- ref: editorRef,
142
- key: editorKey,
143
- error: error
144
- }, /*#__PURE__*/React.createElement(GlobalEditorStyles, {
145
- zIndex: zIndex + 1
146
- }), /*#__PURE__*/React.createElement(TextEditorTheme, null), /*#__PURE__*/React.createElement(CKEditor, _extends({}, restProps, {
147
- editor: ClassicEditor,
148
- config: config,
149
- disabled: disabled,
150
- data: value,
151
- onChange: handleChange,
152
- onReady: handleReady,
153
- onBlur: handleBlur
154
- })));
155
- }
156
- //# sourceMappingURL=NextTextEditor.js.map