@procore/core-react 12.28.1 → 12.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +3 -49
  3. package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
  4. package/dist/Avatar/Avatar.styles.js +5 -5
  5. package/dist/AvatarStack/AvatarStack.styles.d.ts +76 -76
  6. package/dist/AvatarStack/AvatarStack.styles.js +7 -7
  7. package/dist/Badge/Badge.styles.js +2 -2
  8. package/dist/BadgePill/BadgePill.styles.js +4 -4
  9. package/dist/Banner/Banner.styles.js +10 -10
  10. package/dist/Box/Box.styles.js +1 -1
  11. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  12. package/dist/Button/Button.styles.js +5 -5
  13. package/dist/Calendar/Calendar.styles.js +8 -8
  14. package/dist/Card/Card.styles.js +1 -1
  15. package/dist/Checkbox/Checkbox.styles.js +6 -6
  16. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  17. package/dist/ContactItem/ContactItem.styles.js +5 -5
  18. package/dist/Content/Content.styles.js +2 -2
  19. package/dist/DateInput/DateInput.styles.js +6 -6
  20. package/dist/DetailPage/DetailPage.styles.js +7 -7
  21. package/dist/Dropdown/Dropdown.styles.js +3 -3
  22. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  23. package/dist/Dropzone/Dropzone.js +1 -1
  24. package/dist/Dropzone/Dropzone.styles.js +9 -9
  25. package/dist/EmptyState/EmptyState.styles.js +6 -6
  26. package/dist/Field/Field.styles.js +3 -3
  27. package/dist/FileList/FileList.styles.js +4 -4
  28. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  29. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  30. package/dist/FileSelect/FileSelect.styles.js +2 -2
  31. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  32. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  33. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  34. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  35. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  36. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
  37. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  38. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  39. package/dist/FileToken/FileToken.styles.js +4 -4
  40. package/dist/FilterToken/FilterToken.styles.js +5 -5
  41. package/dist/FlexList/FlexList.styles.js +1 -1
  42. package/dist/Form/Form.js +29 -10
  43. package/dist/Form/Form.js.map +1 -1
  44. package/dist/Form/Form.styles.js +14 -14
  45. package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
  46. package/dist/Form/StyledFormikForm.styles.js +2 -2
  47. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  48. package/dist/Grid/Grid.styles.js +2 -2
  49. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  50. package/dist/Input/Input.styles.js +1 -1
  51. package/dist/Link/Link.styles.js +1 -1
  52. package/dist/ListPage/ListPage.styles.js +8 -8
  53. package/dist/Loader/Loader.styles.js +2 -2
  54. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  55. package/dist/Modal/Modal.styles.js +13 -13
  56. package/dist/Modal/storyHelpers.js +4 -1
  57. package/dist/Modal/storyHelpers.js.map +1 -1
  58. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  59. package/dist/NextMenu/NextMenu.styles.js +3 -3
  60. package/dist/Notation/Notation.js +1 -1
  61. package/dist/NumberInput/NumberInput.styles.js +7 -7
  62. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  63. package/dist/OverlayTrigger/a11yPresets.d.ts +6 -6
  64. package/dist/PageLayout/PageLayout.styles.js +16 -16
  65. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  66. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  67. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  68. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  69. package/dist/Pagination/Pagination.styles.js +5 -5
  70. package/dist/Panel/Panel.styles.js +11 -11
  71. package/dist/Pill/Pill.styles.js +3 -3
  72. package/dist/PillSelect/PillSelect.styles.js +4 -4
  73. package/dist/Popover/Popover.styles.js +2 -2
  74. package/dist/Portal/Portal.styles.js +1 -1
  75. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  76. package/dist/RadioButton/RadioButton.styles.js +3 -3
  77. package/dist/Required/Required.styles.js +3 -3
  78. package/dist/Search/Search.styles.js +5 -5
  79. package/dist/Section/Section.styles.js +7 -7
  80. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  81. package/dist/Select/Select.styles.js +7 -7
  82. package/dist/Semantic/Semantic.styles.d.ts +76 -76
  83. package/dist/Semantic/Semantic.styles.js +9 -9
  84. package/dist/Slider/Slider.styles.js +5 -5
  85. package/dist/Spinner/Spinner.styles.js +7 -7
  86. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  87. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  88. package/dist/SuperSelect/SuperSelect.styles.js +38 -38
  89. package/dist/Switch/Switch.styles.js +4 -4
  90. package/dist/Table/Table.styles.js +28 -28
  91. package/dist/TableShelf/TableShelf.styles.js +5 -5
  92. package/dist/Tabs/Tabs.styles.js +15 -15
  93. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  94. package/dist/TextArea/TextArea.styles.js +1 -1
  95. package/dist/TextEditor/TextEditor.d.ts +17 -41
  96. package/dist/TextEditor/TextEditor.js +141 -155
  97. package/dist/TextEditor/TextEditor.js.map +1 -1
  98. package/dist/TextEditor/TextEditor.styles.d.ts +2 -5
  99. package/dist/TextEditor/TextEditor.styles.js +4 -24
  100. package/dist/TextEditor/TextEditor.styles.js.map +1 -1
  101. package/dist/TextEditor/TextEditor.types.d.ts +55 -109
  102. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  103. package/dist/TextEditor/index.d.ts +2 -4
  104. package/dist/TextEditor/index.js +1 -3
  105. package/dist/TextEditor/index.js.map +1 -1
  106. package/dist/TextEditorOutput/TextEditorOutput.d.ts +7 -3
  107. package/dist/TextEditorOutput/TextEditorOutput.js +29 -13
  108. package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
  109. package/dist/TextEditorOutput/TextEditorOutput.styles.js +2 -2
  110. package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
  111. package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +10 -3
  112. package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
  113. package/dist/Thumbnail/Thumbnail.hooks.d.ts +64 -64
  114. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  115. package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
  116. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  117. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  118. package/dist/Tile/Tile.styles.js +8 -8
  119. package/dist/Title/Title.styles.js +7 -7
  120. package/dist/Toast/Toast.styles.js +3 -3
  121. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  122. package/dist/Token/Token.styles.js +3 -3
  123. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  124. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  125. package/dist/Tooltip/Tooltip.styles.js +2 -2
  126. package/dist/Tree/Tree.styles.js +9 -9
  127. package/dist/Typeahead/Typeahead.styles.js +3 -3
  128. package/dist/Typography/Typography.styles.js +1 -1
  129. package/dist/Typography/Typography.table.story.js +2 -2
  130. package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
  131. package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
  132. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  133. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  134. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  135. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  136. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  137. package/dist/_typedoc/Box/Box.types.json +72 -72
  138. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  139. package/dist/_typedoc/Button/Button.types.json +15 -15
  140. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  141. package/dist/_typedoc/Card/Card.types.json +6 -6
  142. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  143. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  144. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  145. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  146. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  147. package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
  148. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
  149. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  150. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  151. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  152. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  153. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  154. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  155. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  156. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  157. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  158. package/dist/_typedoc/Form/Form.types.json +847 -1131
  159. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  160. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  161. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  162. package/dist/_typedoc/Input/Input.types.json +2 -2
  163. package/dist/_typedoc/Link/Link.types.json +1 -1
  164. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  165. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  166. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
  167. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  168. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  169. package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
  170. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  171. package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
  172. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
  173. package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
  174. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  175. package/dist/_typedoc/Panel/Panel.types.json +30 -30
  176. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  177. package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
  178. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  179. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  180. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  181. package/dist/_typedoc/Required/Required.types.json +5 -5
  182. package/dist/_typedoc/Search/Search.types.json +18 -18
  183. package/dist/_typedoc/Section/Section.types.json +15 -15
  184. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  185. package/dist/_typedoc/Select/Select.types.json +62 -62
  186. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  187. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  188. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  189. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  190. package/dist/_typedoc/Table/Table.types.json +101 -101
  191. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  192. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  193. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  194. package/dist/_typedoc/TextEditor/TextEditor.types.json +44 -160
  195. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +15 -5
  196. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  197. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  198. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  199. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  200. package/dist/_typedoc/Title/Title.types.json +3 -3
  201. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  202. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  203. package/dist/_typedoc/Token/Token.types.json +7 -7
  204. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  205. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
  206. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  207. package/dist/_typedoc/Tree/Tree.types.json +88 -88
  208. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  209. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  210. package/dist/_typedoc/_utils/types.json +3 -3
  211. package/dist/_typedoc/deprecations.json +1 -1
  212. package/dist/_utils/TinyMCE.d.ts +21 -0
  213. package/dist/_utils/TinyMCE.js +86 -0
  214. package/dist/_utils/TinyMCE.js.map +1 -0
  215. package/dist/_utils/props.d.ts +4 -0
  216. package/dist/_utils/props.js +5 -0
  217. package/dist/_utils/props.js.map +1 -0
  218. package/dist/_utils/propsTypedoc.d.ts +0 -1
  219. package/dist/_utils/propsTypedoc.js +0 -1
  220. package/dist/_utils/propsTypedoc.js.map +1 -1
  221. package/dist/index.d.ts +7 -12
  222. package/dist/index.js +9 -17
  223. package/dist/index.js.map +1 -1
  224. package/package.json +5 -13
  225. package/dist/TextEditor/EditorError.d.ts +0 -2
  226. package/dist/TextEditor/EditorError.js +0 -9
  227. package/dist/TextEditor/EditorError.js.map +0 -1
  228. package/dist/TextEditor/StickyToolbar/StickyToolbar.types.d.ts +0 -5
  229. package/dist/TextEditor/StickyToolbar/StickyToolbar.types.js +0 -2
  230. package/dist/TextEditor/StickyToolbar/StickyToolbar.types.js.map +0 -1
  231. package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.d.ts +0 -3
  232. package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.js +0 -153
  233. package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.js.map +0 -1
  234. package/dist/TextEditor/StickyToolbar/index.d.ts +0 -4
  235. package/dist/TextEditor/StickyToolbar/index.js +0 -3
  236. package/dist/TextEditor/StickyToolbar/index.js.map +0 -1
  237. package/dist/TextEditor/StickyToolbar/useStickyToolbar.d.ts +0 -2
  238. package/dist/TextEditor/StickyToolbar/useStickyToolbar.js +0 -49
  239. package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +0 -1
  240. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.d.ts +0 -12
  241. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js +0 -2
  242. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +0 -1
  243. package/dist/TextEditor/TextEditorProvider.d.ts +0 -4
  244. package/dist/TextEditor/TextEditorProvider.js +0 -17
  245. package/dist/TextEditor/TextEditorProvider.js.map +0 -1
  246. package/dist/TextEditor/TextEditorProvider.types.d.ts +0 -14
  247. package/dist/TextEditor/TextEditorProvider.types.js +0 -2
  248. package/dist/TextEditor/TextEditorProvider.types.js.map +0 -1
  249. package/dist/TextEditor/license_key.d.ts +0 -2
  250. package/dist/TextEditor/license_key.js +0 -3
  251. package/dist/TextEditor/license_key.js.map +0 -1
  252. package/dist/TextEditor/plugins/CutPlugin/CutCommand.d.ts +0 -5
  253. package/dist/TextEditor/plugins/CutPlugin/CutCommand.js +0 -99
  254. package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +0 -1
  255. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.d.ts +0 -5
  256. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js +0 -56
  257. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +0 -1
  258. package/dist/TextEditor/plugins/CutPlugin/index.d.ts +0 -1
  259. package/dist/TextEditor/plugins/CutPlugin/index.js +0 -2
  260. package/dist/TextEditor/plugins/CutPlugin/index.js.map +0 -1
  261. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +0 -5
  262. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +0 -40
  263. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +0 -1
  264. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +0 -1
  265. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js +0 -2
  266. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +0 -1
  267. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +0 -5
  268. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +0 -86
  269. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +0 -1
  270. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +0 -5
  271. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +0 -56
  272. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +0 -1
  273. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.d.ts +0 -1
  274. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js +0 -2
  275. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +0 -1
  276. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.d.ts +0 -5
  277. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js +0 -149
  278. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +0 -1
  279. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.d.ts +0 -5
  280. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js +0 -56
  281. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +0 -1
  282. package/dist/TextEditor/plugins/PastePlugin/index.d.ts +0 -1
  283. package/dist/TextEditor/plugins/PastePlugin/index.js +0 -2
  284. package/dist/TextEditor/plugins/PastePlugin/index.js.map +0 -1
  285. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +0 -6
  286. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +0 -87
  287. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +0 -1
  288. package/dist/TextEditor/plugins/TabSpacesPlugin/index.d.ts +0 -1
  289. package/dist/TextEditor/plugins/TabSpacesPlugin/index.js +0 -2
  290. package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +0 -1
  291. package/dist/TextEditor/textEditorTheming/icons.d.ts +0 -23
  292. package/dist/TextEditor/textEditorTheming/icons.js +0 -24
  293. package/dist/TextEditor/textEditorTheming/icons.js.map +0 -1
  294. package/dist/TextEditor/textEditorTheming/index.d.ts +0 -1
  295. package/dist/TextEditor/textEditorTheming/index.js +0 -2
  296. package/dist/TextEditor/textEditorTheming/index.js.map +0 -1
  297. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.d.ts +0 -2
  298. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js +0 -10
  299. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +0 -1
  300. package/dist/TextEditor/useCKEditorCss.d.ts +0 -3
  301. package/dist/TextEditor/useCKEditorCss.js +0 -36
  302. package/dist/TextEditor/useCKEditorCss.js.map +0 -1
  303. package/dist/TextEditor/useTabAsNavigation.d.ts +0 -11
  304. package/dist/TextEditor/useTabAsNavigation.js +0 -29
  305. package/dist/TextEditor/useTabAsNavigation.js.map +0 -1
  306. package/dist/TextEditor/utils/config.d.ts +0 -3
  307. package/dist/TextEditor/utils/config.js +0 -177
  308. package/dist/TextEditor/utils/config.js.map +0 -1
  309. package/dist/TextEditor/utils/index.d.ts +0 -2
  310. package/dist/TextEditor/utils/index.js +0 -3
  311. package/dist/TextEditor/utils/index.js.map +0 -1
  312. package/dist/TextEditor/utils/locale.d.ts +0 -3
  313. package/dist/TextEditor/utils/locale.js +0 -102
  314. package/dist/TextEditor/utils/locale.js.map +0 -1
  315. package/dist/TextEditor/utils/plugins.d.ts +0 -7
  316. package/dist/TextEditor/utils/plugins.js +0 -184
  317. package/dist/TextEditor/utils/plugins.js.map +0 -1
  318. package/dist/TextEditorOutput/TextEditorOutput.utils.d.ts +0 -2
  319. package/dist/TextEditorOutput/TextEditorOutput.utils.js +0 -59
  320. package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +0 -1
  321. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +0 -28
@@ -1,5 +1,5 @@
1
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", "onInit", "onBlur", "config", "plugins", "locale", "onDirty", "tinyMCE", "init", "onKeyDown", "onEditorChange", "onFocusOut"];
2
+ var _excluded = ["error", "init", "locale", "onChange", "onInit", "plugins"];
3
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
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
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; }
@@ -8,180 +8,166 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
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
9
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
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
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; } }
14
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
15
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; }
16
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; }
17
- import { CKEditor } from '@ckeditor/ckeditor5-react';
18
- import { ClassicEditor } from 'ckeditor5';
19
- import React from 'react';
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';
20
23
  import { useOverridableFocusScope } from '../_hooks/FocusScopeOverride';
21
24
  import { useI18nContext } from '../_hooks/I18n';
22
25
  import { useZIndexContext } from '../_hooks/ZIndex';
23
- import { useStickyToolbar } from './StickyToolbar';
24
- import { GlobalEditorStyles, StyledTextEditor } from './TextEditor.styles';
25
- import { TextEditorContext } from './TextEditorProvider';
26
- import { TextEditorTheme } from './textEditorTheming';
27
- import { useCKEditorCss } from './useCKEditorCss';
28
- import { useTabAsNavigation } from './useTabAsNavigation';
29
- import { addButtonDataAttributes, addPluginsFromStringArray, getDefaultConfig } from './utils';
26
+ import { defaultPlugins, generateExternalPlugins, generateLanguageUrl, getValidLookupLocale, tinyMCEConfig, tinyMCESource, tinyMCETabMarkup, tinyMCEVersion } from '../_utils/TinyMCE';
27
+ import { GlobalStyle } from './TextEditor.styles';
28
+ var errorRed = '#E61920';
29
+ function noop() {}
30
+ var TextEditorContext = /*#__PURE__*/React.createContext({
31
+ features: {
32
+ tabAsNavigation: undefined,
33
+ stickyToolbar: undefined
34
+ }
35
+ });
36
+ export function TextEditorProvider(_ref) {
37
+ var children = _ref.children,
38
+ features = _ref.features;
39
+ return /*#__PURE__*/React.createElement(TextEditorContext.Provider, {
40
+ value: {
41
+ features: features
42
+ }
43
+ }, children);
44
+ }
45
+ function setupDefaultShortcuts(editor) {
46
+ editor.shortcuts.add('meta+shift+s', 'Strikethrough', 'Strikethrough');
47
+ }
30
48
 
31
49
  /**
32
- * To ensure your Jest tests work with the new CKEditor implementation, wrap your Jest configuration with `coreReactJestConfig`:
33
- *
34
- * @example
35
- *
36
- * // Using Jest config file
37
- *
38
- * const { coreReactJestConfig } = require('@procore/core-react/jestConfig')
39
- *
40
- * module.exports = coreReactJestConfig({
41
- * // Your existing Jest config
42
- * })
43
- *
44
- * @example
45
- *
46
- * // Using Hammer
47
- *
48
- * import { coreReactJestConfig } from '@procore/core-react/jestConfig'
49
- *
50
- * export default {
51
- * testJest: (defaultConfig) =>
52
- * coreReactJestConfig({
53
- * ...defaultConfig,
54
- * // Your existing Jest config
55
- * }),
56
- * }
57
- *
58
- * @example
59
- *
60
- * // Using Core Scripts
61
- *
62
- * const { coreReactJestConfig } = require('@procore/core-react/jestConfig')
63
- *
64
- * module.exports = () => ({
65
- * jestOverride: (defaultConfig) =>
66
- * coreReactJestConfig({
67
- * ...defaultConfig,
68
- * // Your existing Jest config
69
- * }),
70
- * })
50
+ * editor.addShortcut does not notify on Tab key presses
71
51
  */
72
- export function TextEditor(_ref) {
73
- var disabled = _ref.disabled,
74
- error = _ref.error,
75
- value = _ref.value,
76
- initialValue = _ref.initialValue,
77
- onChange = _ref.onChange,
78
- onInit = _ref.onInit,
79
- onBlur = _ref.onBlur,
80
- externalConfig = _ref.config,
81
- stringPlugins = _ref.plugins,
82
- propLocale = _ref.locale,
83
- onDirty = _ref.onDirty,
84
- _tinyMCE = _ref.tinyMCE,
85
- _init = _ref.init,
86
- _onKeyDown = _ref.onKeyDown,
87
- _onEditorChange = _ref.onEditorChange,
88
- _onFocusOut = _ref.onFocusOut,
89
- restProps = _objectWithoutProperties(_ref, _excluded);
90
- var _useCKEditorCss = useCKEditorCss(),
91
- cssLoading = _useCKEditorCss.isLoading;
92
- var editorRef = React.useRef(null);
93
- var editorInstanceRef = React.useRef(null);
94
- var initialValueRef = React.useRef(value || initialValue || '');
95
- var _React$useState = React.useState(false),
96
- _React$useState2 = _slicedToArray(_React$useState, 2),
97
- isDirtyState = _React$useState2[0],
98
- setIsDirtyState = _React$useState2[1];
99
- var _useI18nContext = useI18nContext(),
100
- contextLocale = _useI18nContext.locale;
101
- var locale = propLocale || contextLocale;
52
+ function setupShortcuts(editor) {
53
+ setupDefaultShortcuts(editor);
54
+ editor.on('keydown', function checkTabPress(event) {
55
+ if (event.altKey && event.key === 'Tab') {
56
+ editor.execCommand('mceInsertContent', false, tinyMCETabMarkup);
57
+ event.preventDefault();
58
+ event.stopPropagation();
59
+ return false;
60
+ }
61
+ });
62
+ }
63
+
64
+ /**
65
+ * The following plugins open a TinyMCE modal.
66
+ * When used with React Aria contained FocusScope,
67
+ * focus does not move into the TinyMCE modal.
68
+ * This patch gets critical functionality back at
69
+ * the cost of possibly failing accessbility.
70
+ */
71
+ function useFocusScopePatch(plugins) {
72
+ var focusScope = useOverridableFocusScope();
102
73
  React.useEffect(function () {
103
- if (value !== undefined) {
104
- initialValueRef.current = value;
74
+ if ([].concat(_toConsumableArray(defaultPlugins), _toConsumableArray(plugins)).some(
75
+ // Add plugins that open a tinymce modal here
76
+ function (plugin) {
77
+ return plugin === 'link' || plugin === 'table' || plugin === 'image';
78
+ })) {
79
+ focusScope.setProps({
80
+ contain: false
81
+ });
105
82
  }
106
- }, [value]);
83
+ }, [focusScope, plugins]);
84
+ }
85
+
86
+ /**
87
+
88
+ We use text editors to allow users to enter multiple lines of formatted text.
89
+
90
+ If users need to add unformatted text, see Text Area.
91
+
92
+ @since 10.19.0
93
+
94
+ @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-texteditor--demo)
95
+
96
+ @see [Design Guidelines](https://design.procore.com/text-editor)
97
+
98
+ */
99
+ export function TextEditor(_ref2) {
100
+ var _props$initialValue, _props$value;
101
+ var error = _ref2.error,
102
+ initOverrides = _ref2.init,
103
+ locale = _ref2.locale,
104
+ _ref2$onChange = _ref2.onChange,
105
+ onChange = _ref2$onChange === void 0 ? noop : _ref2$onChange,
106
+ _onInit = _ref2.onInit,
107
+ _ref2$plugins = _ref2.plugins,
108
+ plugins = _ref2$plugins === void 0 ? defaultPlugins : _ref2$plugins,
109
+ props = _objectWithoutProperties(_ref2, _excluded);
110
+ var _useI18nContext = useI18nContext(),
111
+ contextLocale = _useI18nContext.locale;
107
112
  var _useZIndexContext = useZIndexContext(),
108
113
  zIndex = _useZIndexContext.value;
109
114
  var _React$useContext = React.useContext(TextEditorContext),
110
115
  features = _React$useContext.features;
111
- var enableStickyToolbar = !!(features !== null && features !== void 0 && features.stickyToolbar);
112
- var enableTabAsNavigation = !!(features !== null && features !== void 0 && features.tabAsNavigation);
113
- var mergedConfig = React.useMemo(function () {
114
- var defaultConfig = getDefaultConfig(locale);
115
-
116
- // Handle string plugins for backward compatibility
117
- var configWithPlugins = stringPlugins !== null && stringPlugins !== void 0 && stringPlugins.length ? addPluginsFromStringArray(defaultConfig, stringPlugins) : defaultConfig;
118
-
119
- // Apply any external CKEditor config overrides provided by the consumer
120
- var externalResult = typeof externalConfig === 'function' ? externalConfig(configWithPlugins) : undefined;
121
- // Merge default config (with plugins) and consumer overrides
122
- var finalConfig = _objectSpread(_objectSpread({}, configWithPlugins), externalResult !== null && externalResult !== void 0 ? externalResult : {});
123
- return finalConfig;
124
- }, [externalConfig, locale, stringPlugins]);
125
- var focusScope = useOverridableFocusScope();
126
- React.useEffect(function () {
127
- focusScope.setProps({
128
- contain: false
129
- });
130
- }, [focusScope]);
131
- var handleChange = function handleChange(_event, editor) {
132
- var data = editor.getData();
133
- var isDirty = data !== initialValueRef.current;
134
-
135
- // Call onDirty only on first content modification
136
- if (isDirty && !isDirtyState) {
137
- setIsDirtyState(true);
138
- onDirty === null || onDirty === void 0 ? void 0 : onDirty();
139
- }
140
- onChange === null || onChange === void 0 ? void 0 : onChange(data, isDirty);
116
+ var stickyToolbar = features !== null && features !== void 0 && features.stickyToolbar ? {
117
+ toolbar_sticky: true
118
+ } : {};
119
+ var tabControls = features !== null && features !== void 0 && features.tabAsNavigation ? {
120
+ external_plugins: generateExternalPlugins(plugins, defaultPlugins.filter(function (p) {
121
+ return p !== 'nonbreaking';
122
+ })),
123
+ nonbreaking_force_tab: false,
124
+ setup: setupShortcuts
125
+ } : {
126
+ setup: setupDefaultShortcuts
141
127
  };
142
- var handleReady = function handleReady(editor) {
143
- addButtonDataAttributes(editor);
144
- editorInstanceRef.current = editor;
145
- if (initialValue) {
146
- editor.setData(initialValue);
128
+ var onEditorChange = function onEditorChange(_, editor) {
129
+ onChange(editor.getContent(), editor.isDirty());
130
+ };
131
+ var ref = React.useRef();
132
+ var updateError = function updateError() {
133
+ if (ref.current) {
134
+ if (error) {
135
+ ref.current.style.borderColor = errorRed;
136
+ } else {
137
+ ref.current.style.borderColor = '';
138
+ }
147
139
  }
148
- onInit === null || onInit === void 0 ? void 0 : onInit(editor);
149
140
  };
150
- var handleBlur = function handleBlur(event, editor) {
151
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, editor);
141
+ React.useEffect(function () {
142
+ updateError();
143
+ }, [error]);
144
+ useFocusScopePatch(plugins);
145
+ var onInit = function onInit(event, editor) {
146
+ ref.current = editor.editorContainer;
147
+ updateError();
148
+ _onInit && _onInit(event, editor);
152
149
  };
153
- var _useStickyToolbar = useStickyToolbar({
154
- config: mergedConfig,
155
- enabled: enableStickyToolbar,
156
- editor: editorInstanceRef.current,
157
- editorRef: editorRef,
158
- cssLoading: cssLoading
159
- }),
160
- stickyConfig = _useStickyToolbar.config;
161
- var _useTabAsNavigation = useTabAsNavigation({
162
- config: stickyConfig,
163
- enabled: enableTabAsNavigation,
164
- editor: editorInstanceRef.current
165
- }),
166
- config = _useTabAsNavigation.config;
167
- var editorKey = "".concat(locale, "-").concat(enableTabAsNavigation);
168
- if (cssLoading) {
169
- return null;
170
- }
171
- return /*#__PURE__*/React.createElement(StyledTextEditor, {
172
- ref: editorRef,
173
- key: editorKey,
174
- error: error
175
- }, /*#__PURE__*/React.createElement(GlobalEditorStyles, {
176
- zIndex: zIndex + 1
177
- }), /*#__PURE__*/React.createElement(TextEditorTheme, null), /*#__PURE__*/React.createElement(CKEditor, _extends({}, restProps, {
178
- editor: ClassicEditor,
179
- config: config,
180
- disabled: disabled,
181
- data: value,
182
- onChange: handleChange,
183
- onReady: handleReady,
184
- onBlur: handleBlur
150
+ var _useState = useState((_props$initialValue = props.initialValue) !== null && _props$initialValue !== void 0 ? _props$initialValue : props.value),
151
+ _useState2 = _slicedToArray(_useState, 1),
152
+ derivedInitial = _useState2[0];
153
+
154
+ // zIndex + 1 because on first render zIndex of Portal(Modal) is higher
155
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GlobalStyle, {
156
+ $zIndex: zIndex + 1
157
+ }), /*#__PURE__*/React.createElement(Editor, _extends({
158
+ init: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tinyMCEConfig), {}, {
159
+ external_plugins: generateExternalPlugins(plugins),
160
+ language_url: generateLanguageUrl(locale || contextLocale),
161
+ language: getValidLookupLocale(locale || contextLocale),
162
+ content_style: "p { margin: 0; }"
163
+ }, stickyToolbar), tabControls), initOverrides),
164
+ tinymceScriptSrc: "".concat(tinyMCESource, "/").concat(tinyMCEVersion, "/tinymce.min.js"),
165
+ onInit: onInit,
166
+ onEditorChange: onEditorChange
167
+ }, props, {
168
+ value: (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : props.initialValue,
169
+ initialValue: derivedInitial
185
170
  })));
186
171
  }
172
+ TextEditor.displayName = 'TextEditor';
187
173
  //# sourceMappingURL=TextEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.js","names":["CKEditor","ClassicEditor","React","useOverridableFocusScope","useI18nContext","useZIndexContext","useStickyToolbar","GlobalEditorStyles","StyledTextEditor","TextEditorContext","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","TextEditor","_ref","disabled","error","value","initialValue","onChange","onInit","onBlur","externalConfig","config","stringPlugins","plugins","propLocale","locale","onDirty","_tinyMCE","tinyMCE","_init","init","_onKeyDown","onKeyDown","_onEditorChange","onEditorChange","_onFocusOut","onFocusOut","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_useI18nContext","contextLocale","useEffect","undefined","current","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","focusScope","setProps","contain","handleChange","_event","editor","data","getData","isDirty","handleReady","setData","handleBlur","event","_useStickyToolbar","enabled","stickyConfig","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/TextEditor/TextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { useOverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useZIndexContext } from '../_hooks/ZIndex'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { GlobalEditorStyles, StyledTextEditor } from './TextEditor.styles'\nimport type { TextEditorProps } from './TextEditor.types'\nimport { TextEditorContext } from './TextEditorProvider'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\n/**\n * To ensure your Jest tests work with the new CKEditor implementation, wrap your Jest configuration with `coreReactJestConfig`:\n *\n * @example\n *\n * // Using Jest config file\n *\n * const { coreReactJestConfig } = require('@procore/core-react/jestConfig')\n *\n * module.exports = coreReactJestConfig({\n * // Your existing Jest config\n * })\n *\n * @example\n *\n * // Using Hammer\n *\n * import { coreReactJestConfig } from '@procore/core-react/jestConfig'\n *\n * export default {\n * testJest: (defaultConfig) =>\n * coreReactJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * }\n *\n * @example\n *\n * // Using Core Scripts\n *\n * const { coreReactJestConfig } = require('@procore/core-react/jestConfig')\n *\n * module.exports = () => ({\n * jestOverride: (defaultConfig) =>\n * coreReactJestConfig({\n * ...defaultConfig,\n * // Your existing Jest config\n * }),\n * })\n */\nexport function TextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onInit,\n onBlur,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n onDirty,\n // Deprecated TinyMCE props - no-op for backward compatibility\n tinyMCE: _tinyMCE,\n init: _init,\n onKeyDown: _onKeyDown,\n onEditorChange: _onEditorChange,\n onFocusOut: _onFocusOut,\n ...restProps\n}: TextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n\n return finalConfig\n }, [externalConfig, locale, stringPlugins])\n\n const focusScope = useOverridableFocusScope()\n React.useEffect(() => {\n focusScope.setProps({ contain: false })\n }, [focusScope])\n\n const handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n\n if (initialValue) {\n editor.setData(initialValue)\n }\n\n onInit?.(editor)\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n onBlur?.(event, editor)\n }\n\n const { config: stickyConfig } = useStickyToolbar({\n config: mergedConfig,\n enabled: enableStickyToolbar,\n editor: editorInstanceRef.current,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: stickyConfig,\n enabled: enableTabAsNavigation,\n editor: editorInstanceRef.current,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n return (\n <StyledTextEditor ref={editorRef} key={editorKey} error={error}>\n <GlobalEditorStyles zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </StyledTextEditor>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,wBAAwB,QAAQ,8BAA8B;AACvE,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ,qBAAqB;AAE1E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SACEC,uBAAuB,EACvBC,yBAAyB,EACzBC,gB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jE,MAAM,EAAEmE;EAAW,EACpB,CACe,CAAC;AAEvB"}
1
+ {"version":3,"file":"TextEditor.js","names":["Editor","React","useState","useOverridableFocusScope","useI18nContext","useZIndexContext","defaultPlugins","generateExternalPlugins","generateLanguageUrl","getValidLookupLocale","tinyMCEConfig","tinyMCESource","tinyMCETabMarkup","tinyMCEVersion","GlobalStyle","errorRed","noop","TextEditorContext","createContext","features","tabAsNavigation","undefined","stickyToolbar","TextEditorProvider","_ref","children","createElement","Provider","value","setupDefaultShortcuts","editor","shortcuts","add","setupShortcuts","on","checkTabPress","event","altKey","key","execCommand","preventDefault","stopPropagation","useFocusScopePatch","plugins","focusScope","useEffect","concat","_toConsumableArray","some","plugin","setProps","contain","TextEditor","_ref2","_props$initialValue","_props$value","error","initOverrides","init","locale","_ref2$onChange","onChange","_onInit","onInit","_ref2$plugins","props","_objectWithoutProperties","_excluded","_useI18nContext","contextLocale","_useZIndexContext","zIndex","_React$useContext","useContext","toolbar_sticky","tabControls","external_plugins","filter","p","nonbreaking_force_tab","setup","onEditorChange","_","getContent","isDirty","ref","useRef","updateError","current","style","borderColor","editorContainer","_useState","initialValue","_useState2","_slicedToArray","derivedInitial","Fragment","$zIndex","_extends","_objectSpread","language_url","language","content_style","tinymceScriptSrc","displayName"],"sources":["../../src/TextEditor/TextEditor.tsx"],"sourcesContent":["import { Editor } from '@tinymce/tinymce-react'\nimport React, { useState } from 'react'\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 './TextEditor.styles'\nimport type {\n TextEditorProps,\n TextEditorProviderProps,\n} from './TextEditor.types'\n\nconst errorRed = '#E61920'\n\nfunction noop() {}\n\nconst TextEditorContext = React.createContext<\n Omit<TextEditorProviderProps, 'children'>\n>({\n features: {\n tabAsNavigation: undefined,\n stickyToolbar: undefined,\n },\n})\n\nexport function TextEditorProvider({\n children,\n features,\n}: TextEditorProviderProps) {\n return (\n <TextEditorContext.Provider value={{ features }}>\n {children}\n </TextEditorContext.Provider>\n )\n}\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 TextEditor({\n error,\n init: initOverrides,\n locale,\n onChange = noop,\n onInit: _onInit,\n plugins = defaultPlugins,\n ...props\n}: TextEditorProps) {\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\nTextEditor.displayName = 'TextEditor'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,wBAAwB,QAAQ,8BAA8B;AACvE,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,gBAAgB,QAA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B,YAAA,cAAAA,YAAA,GAAIU,KAAK,CAAC4B,YAAa;IACzCA,YAAY,EAAEG;EAAe,EAC9B,CACD,CAAC;AAEP;AAEA5C,UAAU,CAACqD,WAAW,GAAG,YAAY"}
@@ -1,7 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const GlobalEditorStyles: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
- zIndex: number;
2
+ export declare const GlobalStyle: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
+ $zIndex: number;
4
4
  }>;
5
- export declare const StyledTextEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
- error?: boolean | undefined;
7
- }>> & string;
@@ -1,26 +1,6 @@
1
- import styled, { createGlobalStyle } from 'styled-components';
2
- import { colors } from '../_styles/colors';
3
- export var GlobalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-default:", ";--ck-z-modal:", ";}.ck-body-wrapper{--ck-z-default:", ";--ck-z-modal:", ";}.ck-balloon-panel{z-index:", " !important;}.ck-content{padding:16px 28px !important;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen,Ubuntu,Cantarell,\"Open Sans\",\"Helvetica Neue\",sans-serif;line-height:1.4;p{margin-top:0 !important;margin-bottom:0 !important;}ol,ol ol,ol ol ol{list-style-type:revert-layer;}}"], function (_ref) {
4
- var zIndex = _ref.zIndex;
5
- return zIndex;
6
- }, function (_ref2) {
7
- var zIndex = _ref2.zIndex;
8
- return zIndex + 999;
9
- }, function (_ref3) {
10
- var zIndex = _ref3.zIndex;
11
- return zIndex;
12
- }, function (_ref4) {
13
- var zIndex = _ref4.zIndex;
14
- return zIndex + 999;
15
- }, function (_ref5) {
16
- var zIndex = _ref5.zIndex;
17
- return zIndex + 1000;
18
- });
19
- export var StyledTextEditor = /*#__PURE__*/styled.div.withConfig({
20
- displayName: "StyledTextEditor",
21
- componentId: "core-12_28_1__sc-1hpwgdu-0"
22
- })(["", ""], function (_ref6) {
23
- var error = _ref6.error;
24
- return error && "\n .ck-sticky-panel__content {\n border-top-color: ".concat(colors.red50, " !important;\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n }\n\n .ck-editor__editable {\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n border-bottom-color: ").concat(colors.red50, " !important;\n }\n ");
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;
25
5
  });
26
6
  //# sourceMappingURL=TextEditor.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.styles.js","names":["styled","createGlobalStyle","colors","GlobalEditorStyles","_ref","zIndex","_ref2","_ref3","_ref4","_ref5","StyledTextEditor","div","withConfig","displayName","componentId","_ref6","error","concat","red50"],"sources":["../../src/TextEditor/TextEditor.styles.ts"],"sourcesContent":["import styled, { createGlobalStyle } from 'styled-components'\nimport { colors } from '../_styles/colors'\n\nexport const GlobalEditorStyles = createGlobalStyle<{\n zIndex: number\n}>`\n :root {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n }\n \n .ck-body-wrapper {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n }\n \n .ck-balloon-panel {\n z-index: ${({ zIndex }) => zIndex + 1000} !important;\n }\n\n .ck-content {\n padding: 16px 28px !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n \"Open Sans\",\n \"Helvetica Neue\",\n sans-serif;\n line-height: 1.4;\n\n p {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n\n ol,\n ol ol,\n ol ol ol {\n list-style-type: revert-layer;\n }\n }\n`\n\nexport const StyledTextEditor = styled.div<{\n error?: boolean\n}>`\n ${({ error }) =>\n error &&\n `\n .ck-sticky-panel__content {\n border-top-color: ${colors.red50} !important;\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n }\n\n .ck-editor__editable {\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n border-bottom-color: ${colors.red50} !important;\n }\n `}\n`\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,iBAAiB,QAAQ,mBAAmB;AAC7D,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,IAAMC,kBAAkB,gBAAGF,iBAAiB,4bAI7B,UAAAG,IAAA;EAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAC,KAAA;EAAA,IAAGD,MAAM,GAAAC,KAAA,CAAND,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAI1B,UAAAE,KAAA;EAAA,IAAGF,MAAM,GAAAE,KAAA,CAANF,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAG,KAAA;EAAA,IAAGH,MAAM,GAAAG,KAAA,CAANH,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAIjC,UAAAI,KAAA;EAAA,IAAGJ,MAAM,GAAAI,KAAA,CAANJ,MAAM;EAAA,OAAOA,MAAM,GAAG,IAAI;AAAA,EA6B3C;AAED,OAAO,IAAMK,gBAAgB,gBAAGV,MAAM,CAACW,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAGtC,UAAAC,KAAA;EAAA,IAAGC,KAAK,GAAAD,KAAA,CAALC,KAAK;EAAA,OACRA,KAAK,sEAAAC,MAAA,CAGmBf,MAAM,CAACgB,KAAK,+CAAAD,MAAA,CACXf,MAAM,CAACgB,KAAK,gDAAAD,MAAA,CACXf,MAAM,CAACgB,KAAK,wFAAAD,MAAA,CAIbf,MAAM,CAACgB,KAAK,gDAAAD,MAAA,CACXf,MAAM,CAACgB,KAAK,iDAAAD,MAAA,CACXf,MAAM,CAACgB,KAAK,gCAEtC;AAAA,EACJ"}
1
+ {"version":3,"file":"TextEditor.styles.js","names":["createGlobalStyle","GlobalStyle","_ref","$zIndex"],"sources":["../../src/TextEditor/TextEditor.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"}