@procore/core-react 12.34.1 → 12.36.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 (284) hide show
  1. package/CHANGELOG.md +53 -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.js +7 -7
  5. package/dist/Badge/Badge.styles.js +2 -2
  6. package/dist/BadgePill/BadgePill.styles.js +4 -4
  7. package/dist/Banner/Banner.styles.js +10 -10
  8. package/dist/Box/Box.styles.js +1 -1
  9. package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
  10. package/dist/Button/Button.styles.js +5 -5
  11. package/dist/Calendar/Calendar.d.ts +2 -2
  12. package/dist/Calendar/Calendar.js.map +1 -1
  13. package/dist/Calendar/Calendar.styles.d.ts +6 -3
  14. package/dist/Calendar/Calendar.styles.js +15 -9
  15. package/dist/Calendar/Calendar.styles.js.map +1 -1
  16. package/dist/Calendar/Calendar.types.d.ts +1 -31
  17. package/dist/Calendar/Calendar.types.js.map +1 -1
  18. package/dist/Card/Card.styles.js +1 -1
  19. package/dist/Checkbox/Checkbox.styles.js +6 -6
  20. package/dist/Checkbox/CheckboxTooltip.js +1 -1
  21. package/dist/ContactItem/ContactItem.styles.js +5 -5
  22. package/dist/ContactItem/ContactItem.types.d.ts +2 -0
  23. package/dist/ContactItem/ContactItem.types.js.map +1 -1
  24. package/dist/Content/Content.styles.js +2 -2
  25. package/dist/DateInput/DateInput.js +58 -53
  26. package/dist/DateInput/DateInput.js.map +1 -1
  27. package/dist/DateInput/DateInput.styles.js +9 -9
  28. package/dist/DateInput/DateInput.styles.js.map +1 -1
  29. package/dist/DetailPage/DetailPage.styles.js +7 -7
  30. package/dist/Dropdown/Dropdown.styles.js +3 -3
  31. package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
  32. package/dist/Dropzone/Dropzone.js +1 -1
  33. package/dist/Dropzone/Dropzone.styles.js +9 -9
  34. package/dist/EmptyState/EmptyState.styles.js +6 -6
  35. package/dist/Field/Field.styles.js +3 -3
  36. package/dist/FileList/FileList.styles.js +4 -4
  37. package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
  38. package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
  39. package/dist/FileSelect/FileSelect.styles.js +2 -2
  40. package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
  41. package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
  42. package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
  43. package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
  44. package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
  45. package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
  46. package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
  47. package/dist/FileToken/FileToken.styles.js +4 -4
  48. package/dist/FilterToken/FilterToken.styles.js +5 -5
  49. package/dist/FlexList/FlexList.styles.js +1 -1
  50. package/dist/Form/Form.styles.js +14 -14
  51. package/dist/Form/StyledFormikForm.styles.js +2 -2
  52. package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
  53. package/dist/Grid/Grid.styles.js +2 -2
  54. package/dist/GroupSelect/GroupSelect.styles.js +1 -1
  55. package/dist/Input/Input.styles.js +2 -2
  56. package/dist/Input/Input.styles.js.map +1 -1
  57. package/dist/Link/Link.styles.js +1 -1
  58. package/dist/ListPage/ListPage.styles.js +8 -8
  59. package/dist/Loader/Loader.styles.js +2 -2
  60. package/dist/MenuImperative/MenuImperative.styles.js +10 -10
  61. package/dist/Modal/Modal.styles.js +13 -13
  62. package/dist/MultiSelect/MultiSelect.styles.js +6 -6
  63. package/dist/NextMenu/NextMenu.styles.js +3 -3
  64. package/dist/Notation/Notation.js +1 -1
  65. package/dist/NumberInput/NumberInput.styles.js +9 -9
  66. package/dist/NumberInput/NumberInput.styles.js.map +1 -1
  67. package/dist/Overlay/OverlayArrow.styles.js +1 -1
  68. package/dist/OverlayTrigger/OverlayTrigger.js +16 -0
  69. package/dist/OverlayTrigger/OverlayTrigger.js.map +1 -1
  70. package/dist/PageLayout/PageLayout.styles.js +16 -16
  71. package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
  72. package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
  73. package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
  74. package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
  75. package/dist/Pagination/Pagination.styles.js +6 -6
  76. package/dist/Pagination/Pagination.styles.js.map +1 -1
  77. package/dist/Pagination/Pagination.types.d.ts +4 -0
  78. package/dist/Pagination/Pagination.types.js.map +1 -1
  79. package/dist/Pagination/PaginationSelect.js +59 -3
  80. package/dist/Pagination/PaginationSelect.js.map +1 -1
  81. package/dist/Panel/Panel.js +6 -2
  82. package/dist/Panel/Panel.js.map +1 -1
  83. package/dist/Panel/Panel.styles.js +11 -11
  84. package/dist/Pill/Pill.styles.js +3 -3
  85. package/dist/PillSelect/PillSelect.styles.js +4 -4
  86. package/dist/Popover/Popover.styles.js +2 -2
  87. package/dist/Portal/Portal.js +4 -1
  88. package/dist/Portal/Portal.js.map +1 -1
  89. package/dist/Portal/Portal.styles.js +1 -1
  90. package/dist/Portal/Portal.types.d.ts +1 -1
  91. package/dist/Portal/Portal.types.js.map +1 -1
  92. package/dist/Portal/PortalProvider.d.ts +5 -0
  93. package/dist/Portal/PortalProvider.js +14 -0
  94. package/dist/Portal/PortalProvider.js.map +1 -0
  95. package/dist/Portal/PortalProvider.types.d.ts +4 -0
  96. package/dist/Portal/PortalProvider.types.js +2 -0
  97. package/dist/Portal/PortalProvider.types.js.map +1 -0
  98. package/dist/Portal/index.d.ts +2 -0
  99. package/dist/Portal/index.js +1 -0
  100. package/dist/Portal/index.js.map +1 -1
  101. package/dist/ProgressBar/ProgressBar.styles.js +2 -2
  102. package/dist/RadioButton/RadioButton.styles.js +4 -4
  103. package/dist/RadioButton/RadioButton.styles.js.map +1 -1
  104. package/dist/Required/Required.styles.js +3 -3
  105. package/dist/Search/Search.styles.js +5 -5
  106. package/dist/Section/Section.styles.js +7 -7
  107. package/dist/SegmentedController/SegmentedController.styles.js +4 -4
  108. package/dist/Select/Select.js +1 -0
  109. package/dist/Select/Select.js.map +1 -1
  110. package/dist/Select/Select.styles.js +10 -10
  111. package/dist/Select/Select.styles.js.map +1 -1
  112. package/dist/Semantic/Semantic.styles.js +9 -9
  113. package/dist/Slider/Slider.js +3 -1
  114. package/dist/Slider/Slider.js.map +1 -1
  115. package/dist/Slider/Slider.styles.js +5 -5
  116. package/dist/Spinner/Spinner.styles.js +7 -7
  117. package/dist/SplitViewCard/SplitViewCard.context.js +10 -2
  118. package/dist/SplitViewCard/SplitViewCard.context.js.map +1 -1
  119. package/dist/SplitViewCard/SplitViewCard.js +4 -2
  120. package/dist/SplitViewCard/SplitViewCard.js.map +1 -1
  121. package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
  122. package/dist/SplitViewCard/SplitViewCard.types.js.map +1 -1
  123. package/dist/SuperSelect/SuperSelect.components.js +3 -3
  124. package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
  125. package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
  126. package/dist/SuperSelect/SuperSelect.styles.js +41 -41
  127. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  128. package/dist/SuperSelect/useSuperSelect.js +11 -11
  129. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  130. package/dist/Switch/Switch.styles.js +4 -4
  131. package/dist/Table/Table.d.ts +2 -2
  132. package/dist/Table/Table.js +58 -18
  133. package/dist/Table/Table.js.map +1 -1
  134. package/dist/Table/Table.styles.d.ts +3 -1
  135. package/dist/Table/Table.styles.js +34 -33
  136. package/dist/Table/Table.styles.js.map +1 -1
  137. package/dist/Table/Table.types.d.ts +5 -0
  138. package/dist/Table/Table.types.js.map +1 -1
  139. package/dist/TableShelf/TableShelf.styles.js +5 -5
  140. package/dist/Tabs/Tabs.styles.js +15 -15
  141. package/dist/Tearsheet/Tearsheet.styles.js +5 -5
  142. package/dist/TextArea/TextArea.js +1 -0
  143. package/dist/TextArea/TextArea.js.map +1 -1
  144. package/dist/TextArea/TextArea.styles.js +1 -1
  145. package/dist/TextEditor/TextEditor.d.ts +1 -1
  146. package/dist/TextEditor/TextEditor.js +67 -12
  147. package/dist/TextEditor/TextEditor.js.map +1 -1
  148. package/dist/TextEditor/TextEditor.types.d.ts +17 -0
  149. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  150. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  151. package/dist/Thumbnail/Thumbnail.styles.js +17 -17
  152. package/dist/Thumbnail/ThumbnailDocumentIcon.d.ts +3 -1
  153. package/dist/Thumbnail/ThumbnailDocumentIcon.js +61 -21
  154. package/dist/Thumbnail/ThumbnailDocumentIcon.js.map +1 -1
  155. package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
  156. package/dist/TieredSelect/TieredSelect.styles.js +9 -9
  157. package/dist/Tile/Tile.styles.js +8 -8
  158. package/dist/Title/Title.styles.js +7 -7
  159. package/dist/Toast/Toast.js +1 -1
  160. package/dist/Toast/Toast.js.map +1 -1
  161. package/dist/Toast/Toast.styles.js +3 -3
  162. package/dist/ToggleButton/ToggleButton.styles.js +1 -1
  163. package/dist/Token/Token.styles.js +3 -3
  164. package/dist/ToolHeader/ToolHeader.styles.js +6 -6
  165. package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
  166. package/dist/Tooltip/Tooltip.styles.js +2 -2
  167. package/dist/Tree/Tree.hooks.js +11 -6
  168. package/dist/Tree/Tree.hooks.js.map +1 -1
  169. package/dist/Tree/Tree.js +142 -49
  170. package/dist/Tree/Tree.js.map +1 -1
  171. package/dist/Tree/Tree.styles.d.ts +5 -0
  172. package/dist/Tree/Tree.styles.js +17 -9
  173. package/dist/Tree/Tree.styles.js.map +1 -1
  174. package/dist/Tree/Tree.types.d.ts +21 -1
  175. package/dist/Tree/Tree.types.js.map +1 -1
  176. package/dist/Typeahead/Typeahead.styles.js +3 -3
  177. package/dist/Typography/Typography.styles.js +1 -1
  178. package/dist/Typography/Typography.table.story.js +2 -2
  179. package/dist/_hooks/I18n.d.ts +200 -11
  180. package/dist/_locales/de-DE.json +11 -3
  181. package/dist/_locales/en-AU.json +10 -2
  182. package/dist/_locales/en-CA.json +10 -2
  183. package/dist/_locales/en-GB.json +10 -2
  184. package/dist/_locales/en.json +6 -0
  185. package/dist/_locales/es-ES.json +12 -4
  186. package/dist/_locales/es.json +15 -7
  187. package/dist/_locales/fr-CA.json +11 -3
  188. package/dist/_locales/fr-FR.json +12 -4
  189. package/dist/_locales/is-IS.json +11 -3
  190. package/dist/_locales/it-IT.json +56 -48
  191. package/dist/_locales/ja-JP.json +12 -4
  192. package/dist/_locales/pl-PL.json +10 -2
  193. package/dist/_locales/pseudo.json +6 -0
  194. package/dist/_locales/pt-BR.json +11 -3
  195. package/dist/_locales/pt-PT.json +190 -182
  196. package/dist/_locales/th-TH.json +13 -5
  197. package/dist/_locales/zh-SG.json +10 -2
  198. package/dist/_locales/zh-TW.json +16 -8
  199. package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
  200. package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
  201. package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
  202. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  203. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
  204. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  205. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  206. package/dist/_typedoc/Box/Box.types.json +68 -68
  207. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  208. package/dist/_typedoc/Button/Button.types.json +13 -13
  209. package/dist/_typedoc/Calendar/Calendar.types.json +89 -89
  210. package/dist/_typedoc/Card/Card.types.json +6 -6
  211. package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
  212. package/dist/_typedoc/ContactItem/ContactItem.types.json +12 -10
  213. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  214. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  215. package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
  216. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  217. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
  218. package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
  219. package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
  220. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  221. package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
  222. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  223. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  224. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  225. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  226. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  227. package/dist/_typedoc/Form/Form.types.json +794 -754
  228. package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
  229. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  230. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  231. package/dist/_typedoc/Input/Input.types.json +2 -2
  232. package/dist/_typedoc/Link/Link.types.json +1 -1
  233. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  234. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  235. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +77 -77
  236. package/dist/_typedoc/Modal/Modal.types.json +46 -46
  237. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  238. package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
  239. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  240. package/dist/_typedoc/NumberInput/NumberInput.types.json +48 -48
  241. package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +34 -34
  242. package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
  243. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  244. package/dist/_typedoc/Panel/Panel.types.json +30 -30
  245. package/dist/_typedoc/Pill/Pill.types.json +2 -2
  246. package/dist/_typedoc/PillSelect/PillSelect.types.json +51 -51
  247. package/dist/_typedoc/Popover/Popover.types.json +15 -15
  248. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
  249. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  250. package/dist/_typedoc/Required/Required.types.json +5 -5
  251. package/dist/_typedoc/Search/Search.types.json +18 -18
  252. package/dist/_typedoc/Section/Section.types.json +15 -15
  253. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
  254. package/dist/_typedoc/Select/Select.types.json +64 -64
  255. package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
  256. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  257. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  258. package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
  259. package/dist/_typedoc/Table/Table.types.json +113 -103
  260. package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
  261. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
  262. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  263. package/dist/_typedoc/TextEditor/TextEditor.types.json +29 -9
  264. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
  265. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  266. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +43 -43
  267. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +29 -29
  268. package/dist/_typedoc/Tile/Tile.types.json +8 -8
  269. package/dist/_typedoc/Title/Title.types.json +1 -1
  270. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  271. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
  272. package/dist/_typedoc/Token/Token.types.json +7 -7
  273. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  274. package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +8 -8
  275. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  276. package/dist/_typedoc/Tree/Tree.types.json +111 -86
  277. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  278. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  279. package/dist/_typedoc/_utils/types.json +3 -3
  280. package/dist/_typedoc/deprecations.json +1 -1
  281. package/dist/_utils/a11y.d.ts +1 -0
  282. package/dist/_utils/a11y.js +8 -0
  283. package/dist/_utils/a11y.js.map +1 -0
  284. package/package.json +1 -1
@@ -1 +1 @@
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","stickyToolbar","undefined","TextEditorProvider","_ref","children","createElement","Provider","value","_objectSpread","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","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: true,\n stickyToolbar: undefined,\n },\n})\n\nexport function TextEditorProvider({\n children,\n features,\n}: TextEditorProviderProps) {\n return (\n <TextEditorContext.Provider\n value={{\n features: {\n tabAsNavigation: true,\n ...features,\n },\n }}\n >\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,QAAQ,kBAAkB;AACnD,SACEC,cAAc,EACdC,uBAAuB,EACvBC,mBAAmB,EACnBC,oBAAoB,EACpBC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,QACT,mBAAmB;AAC1B,SAASC,WAAW,QAAQ,qBAAqB;AAMjD,IAAMC,QAAQ,GAAG,SAAS;AAE1B,SAASC,IAAIA,CAAA,EAAG,CAAC;AAEjB,IAAMC,iBAAiB,gBAAGhB,KAAK,CAACiB,aAAa,CAE3C;EACAC,QAAQ,EAAE;IACRC,eAAe,EAAE,IAAI;IACrBC,aAAa,EAAEC;EACjB;AACF,CAAC,CAAC;AAEF,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAGN;EAAA,IAF1BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRN,QAAQ,GAAAK,IAAA,CAARL,QAAQ;EAER,oBACElB,KAAA,CAAAyB,aAAA,CAACT,iBAAiB,CAACU,QAAQ;IACzBC,KAAK,EAAE;MACLT,QAAQ,EAAAU,aAAA;QACNT,eAAe,E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M,GAAG;EAAE,CAAE,CAAC,eACpCvE,KAAA,CAAAyB,aAAA,CAAC1B,MAAM,EAAAoG,QAAA;IACLzC,IAAI,EAAA9B,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,KACCnB,aAAa;MAChBmE,gBAAgB,EAAEtE,uBAAuB,CAACqC,OAAO,CAAC;MAClDyD,YAAY,EAAE7F,mBAAmB,CAACoD,MAAM,IAAIU,aAAa,CAAC;MAC1DgC,QAAQ,EAAE7F,oBAAoB,CAACmD,MAAM,IAAIU,aAAa,CAAC;MACvDiC,aAAa;IAAoB,GAC9BlF,aAAa,GACbuD,WAAW,GACXlB,aAAa,CAChB;IACF8C,gBAAgB,KAAAzD,MAAA,CAAKpC,aAAa,OAAAoC,MAAA,CAAIlC,cAAc,oBAAkB;IACtEmD,MAAM,EAAEA,MAAO;IACfkB,cAAc,EAAEA;EAAe,GAC3BhB,KAAK;IACTtC,KAAK,GAAA4B,YAAA,GAAEU,KAAK,CAACtC,KAAK,cAAA4B,YAAA,cAAAA,YAAA,GAAIU,KAAK,CAAC4B,YAAa;IACzCA,YAAY,EAAEG;EAAe,EAC9B,CACD,CAAC;AAEP;AAEA5C,UAAU,CAACoD,WAAW,GAAG,YAAY"}
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","stickyToolbar","undefined","TextEditorProvider","_ref","children","createElement","Provider","value","_objectSpread","setupDefaultShortcuts","editor","shortcuts","add","setupShortcuts","on","checkTabPress","event","altKey","key","execCommand","preventDefault","stopPropagation","useFocusScopePatch","plugins","focusScope","useEffect","concat","_toConsumableArray","some","plugin","setProps","contain","TextEditor","allProps","_props$initialValue","_props$value","error","initOverrides","init","locale","_allProps$onChange","onChange","_onInit","onInit","_allProps$plugins","props","_objectWithoutProperties","_excluded","ariaLabel","ariaDescription","_useI18nContext","contextLocale","_useZIndexContext","zIndex","_React$useContext","useContext","toolbar_sticky","tabControls","external_plugins","filter","p","nonbreaking_force_tab","setup","onEditorChange","_","getContent","isDirty","ref","useRef","editorRef","_React$useState","_React$useState2","_slicedToArray","isEditorReady","setIsEditorReady","updateError","current","style","borderColor","setAttribute","body","getBody","removeAttribute","editorContainer","_useState","initialValue","_useState2","derivedInitial","accessibilityConfig","iframe_aria_text","Fragment","$zIndex","_extends","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: true,\n stickyToolbar: undefined,\n },\n})\n\nexport function TextEditorProvider({\n children,\n features,\n}: TextEditorProviderProps) {\n return (\n <TextEditorContext.Provider\n value={{\n features: {\n tabAsNavigation: true,\n ...features,\n },\n }}\n >\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(allProps: TextEditorProps) {\n const {\n error,\n init: initOverrides,\n locale,\n onChange = noop,\n onInit: _onInit,\n plugins = defaultPlugins,\n ...props\n } = allProps\n const ariaLabel = allProps['aria-label']\n const ariaDescription = allProps['aria-description']\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 const editorRef = React.useRef<any>(null)\n const [isEditorReady, setIsEditorReady] = React.useState(false)\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 ref.current.setAttribute('aria-invalid', error ? 'true' : 'false')\n }\n }\n\n React.useEffect(() => {\n updateError()\n }, [error])\n\n // Update aria-label when prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorRef.current) {\n return\n }\n const body = editorRef.current.getBody()\n if (body) {\n if (ariaLabel) {\n body.setAttribute('aria-label', ariaLabel)\n } else {\n body.removeAttribute('aria-label')\n }\n }\n }, [ariaLabel, isEditorReady])\n\n // Update aria-description when prop changes\n React.useEffect(() => {\n if (!isEditorReady || !editorRef.current) {\n return\n }\n const body = editorRef.current.getBody()\n if (body) {\n if (ariaDescription) {\n body.setAttribute('aria-description', ariaDescription)\n } else {\n body.removeAttribute('aria-description')\n }\n }\n }, [ariaDescription, isEditorReady])\n\n useFocusScopePatch(plugins)\n\n const onInit: React.ComponentProps<typeof Editor>['onInit'] = (\n event,\n editor\n ) => {\n ref.current = editor.editorContainer\n editorRef.current = editor\n setIsEditorReady(true)\n updateError()\n\n // Set accessible label and description on the editable body element if provided\n // This provides the accessible name/description for screen readers\n const body = editor.getBody()\n if (body) {\n if (ariaLabel) {\n body.setAttribute('aria-label', ariaLabel)\n }\n if (ariaDescription) {\n body.setAttribute('aria-description', ariaDescription)\n }\n }\n\n _onInit && _onInit(event, editor)\n }\n\n const [derivedInitial] = useState(props.initialValue ?? props.value)\n\n const accessibilityConfig = ariaLabel ? { iframe_aria_text: ariaLabel } : {}\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 ...accessibilityConfig,\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,QAAQ,kBAAkB;AACnD,SACEC,cAAc,EACdC,uBAAuB,EACvBC,mBAAmB,EACnBC,oBAAoB,EACpBC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,QACT,mBAAmB;AAC1B,SAASC,WAAW,QAAQ,qBAAqB;AAMjD,IAAMC,QAAQ,GAAG,SAAS;AAE1B,SAASC,IAAIA,CAAA,EAAG,CAAC;AAEjB,IAAMC,iBAAiB,gBAAGhB,KAAK,CAACiB,aAAa,CAE3C;EACAC,QAAQ,EAAE;IACRC,eAAe,EAAE,IAAI;IACrBC,aAAa,EAAEC;EACjB;AACF,CAAC,CAAC;AAEF,OAAO,SAASC,kBAAkBA,CAAAC,IAAA,EAGN;EAAA,IAF1BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRN,QAAQ,GAAAK,IAAA,CAARL,QAAQ;EAER,oBACElB,KAAA,CAAAyB,aAAA,CAACT,iBAAiB,CAACU,QAAQ;IACzBC,KAAK,EAAE;MACLT,QAAQ,EAAAU,aAAA;QACNT,eAAe,EAAE;MAAI,GAClBD,QAAQ;IAEf;EAAE,GAEDM,QACyB,CAAC;AAEjC;AAEA,SAASK,qBAAqBA,CAACC,MAAW,EAAE;EAC1CA,MAAM,CAACC,SAAS,CAACC,GAAG,CAAC,cAAc,EAAE,eAA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@since 10.19.0
29
29
  */
30
30
  error?: boolean;
31
+ /**
32
+ * Accessible label for the editor's editable area. This text will be
33
+ * announced by screen readers when the user focuses the editor. It should
34
+ * match or include the visible label associated with this editor field.
35
+ * If not provided, screen readers will announce a generic "Rich Text Area" message.
36
+ *
37
+ * @since 12.35.0
38
+ */
39
+ 'aria-label'?: string;
40
+ /**
41
+ * Accessible description for the editor's editable area.
42
+ * This text provides additional context to screen reader users. It will be
43
+ * announced after the label when the user focuses the editor.
44
+ *
45
+ * @since 12.35.0
46
+ */
47
+ 'aria-description'?: string;
31
48
  /**
32
49
  * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**
33
50
  * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Editor, IAllProps } from '@tinymce/tinymce-react'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\n\ntype TextEditorFeatureToggle = {\n stickyToolbar?: boolean\n tabAsNavigation?: boolean\n}\n\n/**\n * Expect context to change the `init` config of the below `TextEditor`s.\n * **Changes after the editor has initialized are ignored.**\n * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)\n * @link [TinyMCE React configure editor](https://www.tiny.cloud/docs/integrations/react/#configuringeditorsettings)\n */\nexport interface TextEditorProviderProps {\n children: React.ReactNode\n /**\n * - `stickyToolbar` - Have the editor toolbar stick to the top when content is longer than the page length.\n * - `tabAsNavigation` - Have `Tab` key exit the editor. Support `Alt`/`Opt` + `Tab` as triple space indent.\n */\n features?: TextEditorFeatureToggle\n}\n\nexport interface TextEditorProps\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 * @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 */\n plugins?: Array<string>\n}\n"],"mappings":""}
1
+ {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Editor, IAllProps } from '@tinymce/tinymce-react'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\n\ntype TextEditorFeatureToggle = {\n stickyToolbar?: boolean\n tabAsNavigation?: boolean\n}\n\n/**\n * Expect context to change the `init` config of the below `TextEditor`s.\n * **Changes after the editor has initialized are ignored.**\n * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)\n * @link [TinyMCE React configure editor](https://www.tiny.cloud/docs/integrations/react/#configuringeditorsettings)\n */\nexport interface TextEditorProviderProps {\n children: React.ReactNode\n /**\n * - `stickyToolbar` - Have the editor toolbar stick to the top when content is longer than the page length.\n * - `tabAsNavigation` - Have `Tab` key exit the editor. Support `Alt`/`Opt` + `Tab` as triple space indent.\n */\n features?: TextEditorFeatureToggle\n}\n\nexport interface TextEditorProps\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 /**\n * Accessible label for the editor's editable area. This text will be\n * announced by screen readers when the user focuses the editor. It should\n * match or include the visible label associated with this editor field.\n * If not provided, screen readers will announce a generic \"Rich Text Area\" message.\n *\n * @since 12.35.0\n */\n 'aria-label'?: string\n\n /**\n * Accessible description for the editor's editable area.\n * This text provides additional context to screen reader users. It will be\n * announced after the label when the user focuses the editor.\n *\n * @since 12.35.0\n */\n 'aria-description'?: string\n\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 * @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 */\n plugins?: Array<string>\n}\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
  export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
3
3
  displayName: "StyledEditor",
4
- componentId: "core-12_34_1__sc-1lje1b0-0"
4
+ componentId: "core-12_36_0__sc-1lje1b0-0"
5
5
  })(["> .tox-tinymce{border:none;}"]);
6
6
  //# sourceMappingURL=TextEditorOutput.styles.js.map
@@ -27,35 +27,35 @@ var captionBase = /*#__PURE__*/css(["color:", ";font-size:12px;line-height:16px;
27
27
  });
28
28
  export var StyledMultilineCaption = /*#__PURE__*/styled.div.withConfig({
29
29
  displayName: "StyledMultilineCaption",
30
- componentId: "core-12_34_1__sc-195f70c-0"
30
+ componentId: "core-12_36_0__sc-195f70c-0"
31
31
  })(["", ";display:flex;word-wrap:break-word;overflow-wrap:break-word;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:", "px;"], captionBase, multilineCaptionMaxHeight);
32
32
  export var StyledCaptionText = /*#__PURE__*/styled.span.withConfig({
33
33
  displayName: "StyledCaptionText",
34
- componentId: "core-12_34_1__sc-195f70c-1"
34
+ componentId: "core-12_36_0__sc-195f70c-1"
35
35
  })(["width:100%;"]);
36
36
  export var StyledPlaceholderCaption = /*#__PURE__*/styled.div.withConfig({
37
37
  displayName: "StyledPlaceholderCaption",
38
- componentId: "core-12_34_1__sc-195f70c-2"
38
+ componentId: "core-12_36_0__sc-195f70c-2"
39
39
  })(["", ""], captionBase);
40
40
  export var StyledSingleLineCaption = /*#__PURE__*/styled.div.withConfig({
41
41
  displayName: "StyledSingleLineCaption",
42
- componentId: "core-12_34_1__sc-195f70c-3"
42
+ componentId: "core-12_36_0__sc-195f70c-3"
43
43
  })(["display:flex;", ""], captionBase);
44
44
  export var StyledSinglelineCaptionBody = /*#__PURE__*/styled.span.withConfig({
45
45
  displayName: "StyledSinglelineCaptionBody",
46
- componentId: "core-12_34_1__sc-195f70c-4"
46
+ componentId: "core-12_36_0__sc-195f70c-4"
47
47
  })(["", ""], getEllipsis);
48
48
  export var StyledSinglelineCaptionEnding = /*#__PURE__*/styled.span.withConfig({
49
49
  displayName: "StyledSinglelineCaptionEnding",
50
- componentId: "core-12_34_1__sc-195f70c-5"
50
+ componentId: "core-12_36_0__sc-195f70c-5"
51
51
  })(["max-width:50%;white-space:nowrap;flex-shrink:0;"]);
52
52
  export var StyledLabelText = /*#__PURE__*/styled(Typography).withConfig({
53
53
  displayName: "StyledLabelText",
54
- componentId: "core-12_34_1__sc-195f70c-6"
54
+ componentId: "core-12_36_0__sc-195f70c-6"
55
55
  })(["", ""], getEllipsis());
56
56
  export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig({
57
57
  displayName: "StyledThumbnailFigCaption",
58
- componentId: "core-12_34_1__sc-195f70c-7"
58
+ componentId: "core-12_36_0__sc-195f70c-7"
59
59
  })(["", " ", " color:", ";font-weight:", ";text-align:center;width:100%;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;background-color:", ";"], getTypographyIntent('small'), getEllipsis(), function (_ref5) {
60
60
  var _ref5$$color = _ref5.$color,
61
61
  $color = _ref5$$color === void 0 ? 'gray15' : _ref5$$color;
@@ -63,7 +63,7 @@ export var StyledThumbnailFigCaption = /*#__PURE__*/styled.figcaption.withConfig
63
63
  }, typographyWeights.bold, labelHeight, spacing.sm / 2, spacing.sm, colors.white);
64
64
  export var StyledLabel = /*#__PURE__*/styled.div.withConfig({
65
65
  displayName: "StyledLabel",
66
- componentId: "core-12_34_1__sc-195f70c-8"
66
+ componentId: "core-12_36_0__sc-195f70c-8"
67
67
  })(["display:flex;justify-content:center;position:absolute;bottom:0;right:0;left:0;opacity:0.85;height:", "px;padding:", "px ", "px;font-size:", "px;background-color:", ";"], labelHeight, spacing.sm / 2, spacing.sm, labelFontSize, colors.white);
68
68
  var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align-items:center;position:relative;overflow:hidden;border:1px solid ", ";border-radius:", "px;margin:0;", " ", " &:focus{", ";}", " ", " ", ""], colors.gray85, borderRadius.md, function (_ref6) {
69
69
  var $clickable = _ref6.$clickable;
@@ -85,7 +85,7 @@ var thumbnailBase = /*#__PURE__*/css(["display:flex;justify-content:center;align
85
85
  });
86
86
  export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
87
87
  displayName: "StyledTickIcon",
88
- componentId: "core-12_34_1__sc-195f70c-9"
88
+ componentId: "core-12_36_0__sc-195f70c-9"
89
89
  })(["position:absolute;top:", "px;right:", "px;width:", "px;height:", "px;opacity:0;transform:scale(0.75);transition:transform 250ms ease-out,opacity 100ms ease-out;", " ", ""], spacing.sm, spacing.sm, tickSize, tickSize, function (_ref1) {
90
90
  var $selected = _ref1.$selected;
91
91
  return $selected && css(["opacity:1;transform:scale(1);"]);
@@ -95,28 +95,28 @@ export var StyledTickIcon = /*#__PURE__*/styled.svg.withConfig({
95
95
  });
96
96
  export var StyledFileIcon = /*#__PURE__*/styled(DocumentIcon).withConfig({
97
97
  displayName: "StyledFileIcon",
98
- componentId: "core-12_34_1__sc-195f70c-10"
98
+ componentId: "core-12_36_0__sc-195f70c-10"
99
99
  })(["width:36.5%;height:auto;"]);
100
100
  export var StyledImageThumbnailPreview = /*#__PURE__*/styled.div.withConfig({
101
101
  displayName: "StyledImageThumbnailPreview",
102
- componentId: "core-12_34_1__sc-195f70c-11"
102
+ componentId: "core-12_36_0__sc-195f70c-11"
103
103
  })(["width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center;", ""], function (_ref11) {
104
104
  var $bgImage = _ref11.$bgImage;
105
105
  return css(["background-image:url(", ");"], $bgImage);
106
106
  });
107
107
  export var StyledImageThumbnailOverlay = /*#__PURE__*/styled.div.withConfig({
108
108
  displayName: "StyledImageThumbnailOverlay",
109
- componentId: "core-12_34_1__sc-195f70c-12"
109
+ componentId: "core-12_36_0__sc-195f70c-12"
110
110
  })(["display:none;position:absolute;top:0;bottom:0;left:0;right:0;"]);
111
111
  var blackOverlay = "\n background-color: ".concat(colors.black, ";\n opacity: 0.2;\n");
112
112
  var whiteOverlay = "\n background-color: ".concat(colors.white, ";\n opacity: 0.5;\n");
113
113
  export var StyledImageThumbnailImage = /*#__PURE__*/styled.img.withConfig({
114
114
  displayName: "StyledImageThumbnailImage",
115
- componentId: "core-12_34_1__sc-195f70c-13"
115
+ componentId: "core-12_36_0__sc-195f70c-13"
116
116
  })([""]);
117
117
  export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
118
118
  displayName: "StyledImageThumbnail",
119
- componentId: "core-12_34_1__sc-195f70c-14"
119
+ componentId: "core-12_36_0__sc-195f70c-14"
120
120
  })(["", ";flex-direction:column;", " ", " ", " ", " ", " ", ""], thumbnailBase, function (_ref12) {
121
121
  var $disabled = _ref12.$disabled;
122
122
  return $disabled && css(["&,&:hover{", "{display:block;", "}}", ",", ",", "{filter:saturate(0);}", "{filter:saturate(0);z-index:-1;}"], StyledImageThumbnailOverlay, whiteOverlay, StyledImageThumbnailPreview, StyledTickIcon, StyledImageThumbnailImage, StyledFileIcon);
@@ -145,7 +145,7 @@ export var StyledImageThumbnail = /*#__PURE__*/styled.div.withConfig({
145
145
  });
146
146
  export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
147
147
  displayName: "StyledThumbnailWrapper",
148
- componentId: "core-12_34_1__sc-195f70c-15"
148
+ componentId: "core-12_36_0__sc-195f70c-15"
149
149
  })(["display:flex;", " ", ""], function (_ref18) {
150
150
  var $size = _ref18.$size;
151
151
  return $size === 'lg' ? "\n width: ".concat(thumbnailSizeLg, "px;\n ") : '';
@@ -156,7 +156,7 @@ export var StyledThumbnailWrapper = /*#__PURE__*/styled.div.withConfig({
156
156
  });
157
157
  export var StyledPlaceholderThumbnail = /*#__PURE__*/styled.div.withConfig({
158
158
  displayName: "StyledPlaceholderThumbnail",
159
- componentId: "core-12_34_1__sc-195f70c-16"
159
+ componentId: "core-12_36_0__sc-195f70c-16"
160
160
  })(["", " ", " ", " ", " ", ""], thumbnailBase, function (_ref20) {
161
161
  var $clickable = _ref20.$clickable;
162
162
  return $clickable && css(["&:hover{background-color:", ";}"], colors.gray96);
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  export declare type ThumbnailDocumentIconVariant = 'image' | 'unknown' | 'zip' | 'drawing' | 'email' | 'excel' | 'gantt' | 'ini' | 'mov' | 'pdf' | 'powerpoint' | 'word' | 'xml' | '3d' | 'folder' | 'folderPeople' | 'folderLock' | 'file';
3
3
  export interface DocumentIconProps {
4
4
  variant: ThumbnailDocumentIconVariant;
5
+ role?: 'img';
5
6
  className?: string;
6
7
  width?: string | number;
7
8
  height?: string | number;
8
9
  focusable?: boolean;
10
+ 'aria-label'?: string;
9
11
  }
10
- export declare function DocumentIcon({ className, focusable, height, variant, width, }: DocumentIconProps): React.JSX.Element;
12
+ export declare function DocumentIcon({ className, focusable, height, variant, width, 'aria-label': ariaLabelOverride, }: DocumentIconProps): React.JSX.Element;
@@ -5,7 +5,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
5
5
  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); }
6
6
  import React from 'react';
7
7
  function Unknown(props) {
8
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
8
+ return /*#__PURE__*/React.createElement("svg", _extends({
9
+ "aria-label": "Unknown file"
10
+ }, props, {
9
11
  xmlns: "http://www.w3.org/2000/svg",
10
12
  viewBox: "0 0 24 24",
11
13
  fill: "none"
@@ -33,7 +35,9 @@ function Unknown(props) {
33
35
  }));
34
36
  }
35
37
  function Image(props) {
36
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
38
+ return /*#__PURE__*/React.createElement("svg", _extends({
39
+ "aria-label": "Image file"
40
+ }, props, {
37
41
  xmlns: "http://www.w3.org/2000/svg",
38
42
  viewBox: "0 0 24 24",
39
43
  fill: "none"
@@ -60,7 +64,9 @@ function Image(props) {
60
64
  })));
61
65
  }
62
66
  function Drawing(props) {
63
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
67
+ return /*#__PURE__*/React.createElement("svg", _extends({
68
+ "aria-label": "Drawing file"
69
+ }, props, {
64
70
  xmlns: "http://www.w3.org/2000/svg",
65
71
  viewBox: "0 0 24 24",
66
72
  fill: "none"
@@ -87,7 +93,9 @@ function Drawing(props) {
87
93
  }));
88
94
  }
89
95
  function Zip(props) {
90
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
96
+ return /*#__PURE__*/React.createElement("svg", _extends({
97
+ "aria-label": "Zip file"
98
+ }, props, {
91
99
  xmlns: "http://www.w3.org/2000/svg",
92
100
  viewBox: "0 0 24 24",
93
101
  fill: "none"
@@ -126,7 +134,9 @@ function Zip(props) {
126
134
  }));
127
135
  }
128
136
  function Email(props) {
129
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
137
+ return /*#__PURE__*/React.createElement("svg", _extends({
138
+ "aria-label": "Email"
139
+ }, props, {
130
140
  xmlns: "http://www.w3.org/2000/svg",
131
141
  viewBox: "0 0 24 24",
132
142
  fill: "none"
@@ -153,7 +163,9 @@ function Email(props) {
153
163
  }));
154
164
  }
155
165
  function Excel(props) {
156
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
166
+ return /*#__PURE__*/React.createElement("svg", _extends({
167
+ "aria-label": "Excel spreadsheet"
168
+ }, props, {
157
169
  xmlns: "http://www.w3.org/2000/svg",
158
170
  width: "24",
159
171
  height: "24",
@@ -182,7 +194,9 @@ function Excel(props) {
182
194
  }))));
183
195
  }
184
196
  function Gantt(props) {
185
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
197
+ return /*#__PURE__*/React.createElement("svg", _extends({
198
+ "aria-label": "Gantt chart"
199
+ }, props, {
186
200
  xmlns: "http://www.w3.org/2000/svg",
187
201
  viewBox: "0 0 24 24",
188
202
  fill: "none"
@@ -207,7 +221,9 @@ function Gantt(props) {
207
221
  }));
208
222
  }
209
223
  function Ini(props) {
210
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
224
+ return /*#__PURE__*/React.createElement("svg", _extends({
225
+ "aria-label": "INI file"
226
+ }, props, {
211
227
  xmlns: "http://www.w3.org/2000/svg",
212
228
  viewBox: "0 0 24 24",
213
229
  fill: "none"
@@ -232,7 +248,9 @@ function Ini(props) {
232
248
  })));
233
249
  }
234
250
  function Mov(props) {
235
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
251
+ return /*#__PURE__*/React.createElement("svg", _extends({
252
+ "aria-label": "Video file"
253
+ }, props, {
236
254
  xmlns: "http://www.w3.org/2000/svg",
237
255
  viewBox: "0 0 24 24",
238
256
  fill: "none"
@@ -257,7 +275,9 @@ function Mov(props) {
257
275
  }))));
258
276
  }
259
277
  function Pdf(props) {
260
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
278
+ return /*#__PURE__*/React.createElement("svg", _extends({
279
+ "aria-label": "PDF document"
280
+ }, props, {
261
281
  xmlns: "http://www.w3.org/2000/svg",
262
282
  viewBox: "0 0 24 24",
263
283
  fill: "none"
@@ -284,7 +304,9 @@ function Pdf(props) {
284
304
  })));
285
305
  }
286
306
  function Powerpoint(props) {
287
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
307
+ return /*#__PURE__*/React.createElement("svg", _extends({
308
+ "aria-label": "PowerPoint presentation"
309
+ }, props, {
288
310
  xmlns: "http://www.w3.org/2000/svg",
289
311
  viewBox: "0 0 24 24",
290
312
  fill: "none"
@@ -312,7 +334,9 @@ function Powerpoint(props) {
312
334
  }))));
313
335
  }
314
336
  function Word(props) {
315
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
337
+ return /*#__PURE__*/React.createElement("svg", _extends({
338
+ "aria-label": "Word document"
339
+ }, props, {
316
340
  xmlns: "http://www.w3.org/2000/svg",
317
341
  viewBox: "0 0 24 24",
318
342
  fill: "none"
@@ -343,7 +367,9 @@ function Word(props) {
343
367
  }))));
344
368
  }
345
369
  function Xml(props) {
346
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
370
+ return /*#__PURE__*/React.createElement("svg", _extends({
371
+ "aria-label": "XML file"
372
+ }, props, {
347
373
  xmlns: "http://www.w3.org/2000/svg",
348
374
  viewBox: "0 0 24 24",
349
375
  fill: "none"
@@ -383,7 +409,9 @@ function Xml(props) {
383
409
  })))));
384
410
  }
385
411
  function ThreeD(props) {
386
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
412
+ return /*#__PURE__*/React.createElement("svg", _extends({
413
+ "aria-label": "3D file"
414
+ }, props, {
387
415
  xmlns: "http://www.w3.org/2000/svg",
388
416
  viewBox: "0 0 24 24",
389
417
  fill: "none"
@@ -414,7 +442,9 @@ function ThreeD(props) {
414
442
  }));
415
443
  }
416
444
  function Folder(props) {
417
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
445
+ return /*#__PURE__*/React.createElement("svg", _extends({
446
+ "aria-label": "Folder"
447
+ }, props, {
418
448
  xmlns: "http://www.w3.org/2000/svg",
419
449
  viewBox: "0 0 24 24",
420
450
  fill: "none"
@@ -431,7 +461,9 @@ function Folder(props) {
431
461
  }))));
432
462
  }
433
463
  function FolderPeople(props) {
434
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
464
+ return /*#__PURE__*/React.createElement("svg", _extends({
465
+ "aria-label": "Shared folder"
466
+ }, props, {
435
467
  xmlns: "http://www.w3.org/2000/svg",
436
468
  viewBox: "0 0 24 24",
437
469
  fill: "none"
@@ -457,7 +489,9 @@ function FolderPeople(props) {
457
489
  }));
458
490
  }
459
491
  function FolderLock(props) {
460
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
492
+ return /*#__PURE__*/React.createElement("svg", _extends({
493
+ "aria-label": "Locked folder"
494
+ }, props, {
461
495
  xmlns: "http://www.w3.org/2000/svg",
462
496
  viewBox: "0 0 24 24",
463
497
  fill: "none"
@@ -479,7 +513,9 @@ function FolderLock(props) {
479
513
  }));
480
514
  }
481
515
  function BlankFile(props) {
482
- return /*#__PURE__*/React.createElement("svg", _extends({}, props, {
516
+ return /*#__PURE__*/React.createElement("svg", _extends({
517
+ "aria-label": "File"
518
+ }, props, {
483
519
  viewBox: "0 0 24 24",
484
520
  fill: "none",
485
521
  xmlns: "http://www.w3.org/2000/svg"
@@ -523,14 +559,18 @@ export function DocumentIcon(_ref) {
523
559
  height = _ref$height === void 0 ? 64 : _ref$height,
524
560
  variant = _ref.variant,
525
561
  _ref$width = _ref.width,
526
- width = _ref$width === void 0 ? 48 : _ref$width;
562
+ width = _ref$width === void 0 ? 48 : _ref$width,
563
+ ariaLabelOverride = _ref['aria-label'];
527
564
  var Icon = documentIcons[variant] || documentIcons.unknown;
528
- return /*#__PURE__*/React.createElement(Icon, {
565
+ return /*#__PURE__*/React.createElement(Icon, _extends({}, ariaLabelOverride !== undefined && {
566
+ 'aria-label': ariaLabelOverride
567
+ }, {
529
568
  className: className,
530
569
  focusable: focusable,
531
570
  height: height,
571
+ role: "img",
532
572
  variant: variant,
533
573
  width: width
534
- });
574
+ }));
535
575
  }
536
576
  //# sourceMappingURL=ThumbnailDocumentIcon.js.map