@procore/core-react 12.28.0 → 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.
- package/CHANGELOG.md +13 -0
- package/README.md +3 -49
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.d.ts +76 -76
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.d.ts +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.js +29 -10
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.d.ts +2 -2
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/Modal/storyHelpers.js +4 -1
- package/dist/Modal/storyHelpers.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/OverlayTrigger/a11yPresets.d.ts +6 -6
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.d.ts +76 -76
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.js +1 -2
- package/dist/SplitViewCard/SplitViewCard.js.map +1 -1
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.components.js +1 -5
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +38 -38
- package/dist/SuperSelect/SuperSelect.types.d.ts +0 -1
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.js +15 -3
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditor/TextEditor.d.ts +17 -41
- package/dist/TextEditor/TextEditor.js +141 -155
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.d.ts +2 -5
- package/dist/TextEditor/TextEditor.styles.js +4 -24
- package/dist/TextEditor/TextEditor.styles.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +55 -109
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/index.d.ts +2 -4
- package/dist/TextEditor/index.js +1 -3
- package/dist/TextEditor/index.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.d.ts +7 -3
- package/dist/TextEditorOutput/TextEditorOutput.js +29 -13
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +2 -2
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +10 -3
- package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.d.ts +64 -64
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.d.ts +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +14 -0
- package/dist/_locales/de-DE.json +2 -1
- package/dist/_locales/en-AU.json +2 -1
- package/dist/_locales/en-CA.json +2 -1
- package/dist/_locales/en-GB.json +2 -1
- package/dist/_locales/es-ES.json +3 -2
- package/dist/_locales/es.json +4 -3
- package/dist/_locales/fr-CA.json +2 -1
- package/dist/_locales/fr-FR.json +2 -1
- package/dist/_locales/is-IS.json +2 -1
- package/dist/_locales/it-IT.json +2 -1
- package/dist/_locales/ja-JP.json +2 -1
- package/dist/_locales/pl-PL.json +2 -1
- package/dist/_locales/pt-BR.json +2 -1
- package/dist/_locales/pt-PT.json +380 -0
- package/dist/_locales/th-TH.json +2 -1
- package/dist/_locales/zh-SG.json +2 -1
- package/dist/_locales/zh-TW.json +219 -218
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +72 -72
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +15 -15
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +39 -39
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +847 -1131
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +54 -54
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +30 -30
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +62 -62
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +44 -160
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +15 -5
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +3 -3
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +7 -7
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +88 -88
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_typedoc/deprecations.json +1 -1
- package/dist/_utils/TinyMCE.d.ts +21 -0
- package/dist/_utils/TinyMCE.js +86 -0
- package/dist/_utils/TinyMCE.js.map +1 -0
- package/dist/_utils/props.d.ts +4 -0
- package/dist/_utils/props.js +5 -0
- package/dist/_utils/props.js.map +1 -0
- package/dist/_utils/propsTypedoc.d.ts +0 -1
- package/dist/_utils/propsTypedoc.js +0 -1
- package/dist/_utils/propsTypedoc.js.map +1 -1
- package/dist/index.d.ts +7 -12
- package/dist/index.js +9 -17
- package/dist/index.js.map +1 -1
- package/package.json +5 -13
- package/dist/TextEditor/EditorError.d.ts +0 -2
- package/dist/TextEditor/EditorError.js +0 -9
- package/dist/TextEditor/EditorError.js.map +0 -1
- package/dist/TextEditor/StickyToolbar/StickyToolbar.types.d.ts +0 -5
- package/dist/TextEditor/StickyToolbar/StickyToolbar.types.js +0 -2
- package/dist/TextEditor/StickyToolbar/StickyToolbar.types.js.map +0 -1
- package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.d.ts +0 -3
- package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.js +0 -153
- package/dist/TextEditor/StickyToolbar/StickyToolbar.utils.js.map +0 -1
- package/dist/TextEditor/StickyToolbar/index.d.ts +0 -4
- package/dist/TextEditor/StickyToolbar/index.js +0 -3
- package/dist/TextEditor/StickyToolbar/index.js.map +0 -1
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.d.ts +0 -2
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.js +0 -49
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +0 -1
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.d.ts +0 -12
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js +0 -2
- package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +0 -1
- package/dist/TextEditor/TextEditorProvider.d.ts +0 -4
- package/dist/TextEditor/TextEditorProvider.js +0 -17
- package/dist/TextEditor/TextEditorProvider.js.map +0 -1
- package/dist/TextEditor/TextEditorProvider.types.d.ts +0 -14
- package/dist/TextEditor/TextEditorProvider.types.js +0 -2
- package/dist/TextEditor/TextEditorProvider.types.js.map +0 -1
- package/dist/TextEditor/license_key.d.ts +0 -2
- package/dist/TextEditor/license_key.js +0 -3
- package/dist/TextEditor/license_key.js.map +0 -1
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.d.ts +0 -5
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js +0 -99
- package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +0 -1
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.d.ts +0 -5
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js +0 -56
- package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +0 -1
- package/dist/TextEditor/plugins/CutPlugin/index.d.ts +0 -1
- package/dist/TextEditor/plugins/CutPlugin/index.js +0 -2
- package/dist/TextEditor/plugins/CutPlugin/index.js.map +0 -1
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +0 -5
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +0 -40
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +0 -1
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +0 -1
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js +0 -2
- package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +0 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +0 -5
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +0 -86
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +0 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +0 -5
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +0 -56
- package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +0 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.d.ts +0 -1
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js +0 -2
- package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +0 -1
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.d.ts +0 -5
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js +0 -149
- package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +0 -1
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.d.ts +0 -5
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js +0 -56
- package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +0 -1
- package/dist/TextEditor/plugins/PastePlugin/index.d.ts +0 -1
- package/dist/TextEditor/plugins/PastePlugin/index.js +0 -2
- package/dist/TextEditor/plugins/PastePlugin/index.js.map +0 -1
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +0 -6
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +0 -87
- package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +0 -1
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.d.ts +0 -1
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.js +0 -2
- package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +0 -1
- package/dist/TextEditor/textEditorTheming/icons.d.ts +0 -23
- package/dist/TextEditor/textEditorTheming/icons.js +0 -24
- package/dist/TextEditor/textEditorTheming/icons.js.map +0 -1
- package/dist/TextEditor/textEditorTheming/index.d.ts +0 -1
- package/dist/TextEditor/textEditorTheming/index.js +0 -2
- package/dist/TextEditor/textEditorTheming/index.js.map +0 -1
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.d.ts +0 -2
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js +0 -10
- package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +0 -1
- package/dist/TextEditor/useCKEditorCss.d.ts +0 -3
- package/dist/TextEditor/useCKEditorCss.js +0 -36
- package/dist/TextEditor/useCKEditorCss.js.map +0 -1
- package/dist/TextEditor/useTabAsNavigation.d.ts +0 -11
- package/dist/TextEditor/useTabAsNavigation.js +0 -29
- package/dist/TextEditor/useTabAsNavigation.js.map +0 -1
- package/dist/TextEditor/utils/config.d.ts +0 -3
- package/dist/TextEditor/utils/config.js +0 -179
- package/dist/TextEditor/utils/config.js.map +0 -1
- package/dist/TextEditor/utils/index.d.ts +0 -2
- package/dist/TextEditor/utils/index.js +0 -3
- package/dist/TextEditor/utils/index.js.map +0 -1
- package/dist/TextEditor/utils/locale.d.ts +0 -3
- package/dist/TextEditor/utils/locale.js +0 -102
- package/dist/TextEditor/utils/locale.js.map +0 -1
- package/dist/TextEditor/utils/plugins.d.ts +0 -7
- package/dist/TextEditor/utils/plugins.js +0 -184
- package/dist/TextEditor/utils/plugins.js.map +0 -1
- package/dist/TextEditorOutput/TextEditorOutput.utils.d.ts +0 -2
- package/dist/TextEditorOutput/TextEditorOutput.utils.js +0 -59
- package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +0 -1
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +0 -28
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
2
|
-
import de from 'ckeditor5/translations/de.js';
|
|
3
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
4
|
-
import en from 'ckeditor5/translations/en.js';
|
|
5
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
6
|
-
import es from 'ckeditor5/translations/es.js';
|
|
7
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
8
|
-
import fr from 'ckeditor5/translations/fr.js';
|
|
9
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
10
|
-
import ja from 'ckeditor5/translations/ja.js';
|
|
11
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
12
|
-
import pl from 'ckeditor5/translations/pl.js';
|
|
13
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
14
|
-
import pt from 'ckeditor5/translations/pt.js';
|
|
15
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
16
|
-
import th from 'ckeditor5/translations/th.js';
|
|
17
|
-
// @ts-expect-error: Translation files are not typed in the ckeditor5 package.
|
|
18
|
-
import zh from 'ckeditor5/translations/zh.js';
|
|
19
|
-
import { add } from '@ckeditor/ckeditor5-utils/src/translation-service';
|
|
20
|
-
var editorLocaleMap = {
|
|
21
|
-
en: 'en',
|
|
22
|
-
'en-CA': 'en',
|
|
23
|
-
'fr-CA': 'fr',
|
|
24
|
-
'fr-FR': 'fr',
|
|
25
|
-
es: 'es',
|
|
26
|
-
'es-ES': 'es',
|
|
27
|
-
'en-AE': 'en',
|
|
28
|
-
'en-AU': 'en',
|
|
29
|
-
'en-GB': 'en',
|
|
30
|
-
'en-SG': 'en',
|
|
31
|
-
'th-TH': 'th',
|
|
32
|
-
'ja-JP': 'ja',
|
|
33
|
-
'pt-BR': 'pt',
|
|
34
|
-
'is-IS': 'en',
|
|
35
|
-
'de-DE': 'de',
|
|
36
|
-
'zh-SG': 'zh',
|
|
37
|
-
'pl-PL': 'pl'
|
|
38
|
-
};
|
|
39
|
-
var editorTranslations = {
|
|
40
|
-
en: en,
|
|
41
|
-
fr: fr,
|
|
42
|
-
es: es,
|
|
43
|
-
de: de,
|
|
44
|
-
ja: ja,
|
|
45
|
-
pl: pl,
|
|
46
|
-
pt: pt,
|
|
47
|
-
th: th,
|
|
48
|
-
zh: zh
|
|
49
|
-
};
|
|
50
|
-
add('en', {
|
|
51
|
-
Cut: 'Cut',
|
|
52
|
-
Paste: 'Paste',
|
|
53
|
-
PasteAsText: 'Paste as Text'
|
|
54
|
-
});
|
|
55
|
-
add('fr', {
|
|
56
|
-
Cut: 'Couper',
|
|
57
|
-
Paste: 'Coller',
|
|
58
|
-
PasteAsText: 'Coller comme texte'
|
|
59
|
-
});
|
|
60
|
-
add('ja', {
|
|
61
|
-
Cut: 'カット',
|
|
62
|
-
Paste: '貼り付け',
|
|
63
|
-
PasteAsText: 'テキストとして貼り付け'
|
|
64
|
-
});
|
|
65
|
-
add('es', {
|
|
66
|
-
Cut: 'Cortar',
|
|
67
|
-
Paste: 'Pegar',
|
|
68
|
-
PasteAsText: 'Pegar como texto'
|
|
69
|
-
});
|
|
70
|
-
add('de', {
|
|
71
|
-
Cut: 'Ausschneiden',
|
|
72
|
-
Paste: 'Einfügen',
|
|
73
|
-
PasteAsText: 'Als Text einfügen'
|
|
74
|
-
});
|
|
75
|
-
add('pt', {
|
|
76
|
-
Cut: 'Recortar',
|
|
77
|
-
Paste: 'Colar',
|
|
78
|
-
PasteAsText: 'Colar como texto'
|
|
79
|
-
});
|
|
80
|
-
add('zh', {
|
|
81
|
-
Cut: '剪切',
|
|
82
|
-
Paste: '粘贴',
|
|
83
|
-
PasteAsText: '以文本形式粘贴'
|
|
84
|
-
});
|
|
85
|
-
add('th', {
|
|
86
|
-
Cut: 'ตัด',
|
|
87
|
-
Paste: 'วาง',
|
|
88
|
-
PasteAsText: 'วางในรูปแบบข้อความ'
|
|
89
|
-
});
|
|
90
|
-
add('pl', {
|
|
91
|
-
Cut: 'Wytnij',
|
|
92
|
-
Paste: 'Wklej',
|
|
93
|
-
PasteAsText: 'Wklej jako tekst'
|
|
94
|
-
});
|
|
95
|
-
export var getValidEditorLocale = function getValidEditorLocale(locale) {
|
|
96
|
-
return editorLocaleMap[locale] || 'en';
|
|
97
|
-
};
|
|
98
|
-
export var getEditorTranslation = function getEditorTranslation(locale) {
|
|
99
|
-
var editorLocale = getValidEditorLocale(locale);
|
|
100
|
-
return editorTranslations[editorLocale] || en;
|
|
101
|
-
};
|
|
102
|
-
//# sourceMappingURL=locale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","names":["de","en","es","fr","ja","pl","pt","th","zh","add","editorLocaleMap","editorTranslations","Cut","Paste","PasteAsText","getValidEditorLocale","locale","getEditorTranslation","editorLocale"],"sources":["../../../src/TextEditor/utils/locale.ts"],"sourcesContent":["import type { Translations } from 'ckeditor5'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport de from 'ckeditor5/translations/de.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport en from 'ckeditor5/translations/en.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport es from 'ckeditor5/translations/es.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport fr from 'ckeditor5/translations/fr.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport ja from 'ckeditor5/translations/ja.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport pl from 'ckeditor5/translations/pl.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport pt from 'ckeditor5/translations/pt.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport th from 'ckeditor5/translations/th.js'\n// @ts-expect-error: Translation files are not typed in the ckeditor5 package.\nimport zh from 'ckeditor5/translations/zh.js'\n\nimport { add } from '@ckeditor/ckeditor5-utils/src/translation-service'\n\nconst editorLocaleMap: Record<string, string> = {\n en: 'en',\n 'en-CA': 'en',\n 'fr-CA': 'fr',\n 'fr-FR': 'fr',\n es: 'es',\n 'es-ES': 'es',\n 'en-AE': 'en',\n 'en-AU': 'en',\n 'en-GB': 'en',\n 'en-SG': 'en',\n 'th-TH': 'th',\n 'ja-JP': 'ja',\n 'pt-BR': 'pt',\n 'is-IS': 'en',\n 'de-DE': 'de',\n 'zh-SG': 'zh',\n 'pl-PL': 'pl',\n}\n\nconst editorTranslations: Record<string, Translations> = {\n en,\n fr,\n es,\n de,\n ja,\n pl,\n pt,\n th,\n zh,\n}\n\nadd('en', {\n Cut: 'Cut',\n Paste: 'Paste',\n PasteAsText: 'Paste as Text',\n})\nadd('fr', {\n Cut: 'Couper',\n Paste: 'Coller',\n PasteAsText: 'Coller comme texte',\n})\nadd('ja', {\n Cut: 'カット',\n Paste: '貼り付け',\n PasteAsText: 'テキストとして貼り付け',\n})\nadd('es', {\n Cut: 'Cortar',\n Paste: 'Pegar',\n PasteAsText: 'Pegar como texto',\n})\nadd('de', {\n Cut: 'Ausschneiden',\n Paste: 'Einfügen',\n PasteAsText: 'Als Text einfügen',\n})\nadd('pt', {\n Cut: 'Recortar',\n Paste: 'Colar',\n PasteAsText: 'Colar como texto',\n})\nadd('zh', {\n Cut: '剪切',\n Paste: '粘贴',\n PasteAsText: '以文本形式粘贴',\n})\nadd('th', {\n Cut: 'ตัด',\n Paste: 'วาง',\n PasteAsText: 'วางในรูปแบบข้อความ',\n})\nadd('pl', {\n Cut: 'Wytnij',\n Paste: 'Wklej',\n PasteAsText: 'Wklej jako tekst',\n})\n\nexport const getValidEditorLocale = (locale: string) => {\n return editorLocaleMap[locale] || 'en'\n}\n\nexport const getEditorTranslation = (locale: string) => {\n const editorLocale = getValidEditorLocale(locale)\n return editorTranslations[editorLocale] || en\n}\n"],"mappings":"AACA;AACA,OAAOA,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAC7C;AACA,OAAOC,EAAE,MAAM,8BAA8B;AAE7C,SAASC,GAAG,QAAQ,mDAAmD;AAEvE,IAAMC,eAAuC,GAAG;EAC9CT,EAAE,EAAE,IAAI;EACR,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACbC,EAAE,EAAE,IAAI;EACR,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,IAAI;EACb,OA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C,IAAI,EAAE;EACRG,GAAG,EAAE,KAAK;EACVC,KAAK,EAAE,KAAK;EACZC,WAAW,EAAE;AACf,CAAC,CAAC;AACFL,GAAG,CAAC,IAAI,EAAE;EACRG,GAAG,EAAE,QAAQ;EACbC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE;AACf,CAAC,CAAC;AAEF,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,MAAc,EAAK;EACtD,OAAON,eAAe,CAACM,MAAM,CAAC,IAAI,IAAI;AACxC,CAAC;AAED,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAID,MAAc,EAAK;EACtD,IAAME,YAAY,GAAGH,oBAAoB,CAACC,MAAM,CAAC;EACjD,OAAOL,kBAAkB,CAACO,YAAY,CAAC,IAAIjB,EAAE;AAC/C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EditorConfig, Plugin } from 'ckeditor5';
|
|
2
|
-
/** Gets CKEditor plugin objects from TinyMCE string plugin names */
|
|
3
|
-
export declare const getPluginsFromStringArray: (pluginNames?: string[]) => (typeof Plugin)[];
|
|
4
|
-
/** Gets toolbar items that should be added for the given string plugin names. */
|
|
5
|
-
export declare const getToolbarItemsFromStringArray: (pluginNames?: string[]) => string[];
|
|
6
|
-
/** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */
|
|
7
|
-
export declare const addPluginsFromStringArray: (config: EditorConfig, pluginNames?: string[]) => EditorConfig;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
11
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
-
import { Alignment, Autoformat, AutoLink, Autosave, BlockQuote, Bold, Bookmark, Code, CodeBlock, Emoji, FindAndReplace, FontBackgroundColor, FontColor, FontSize, Fullscreen, Heading, Highlight, HorizontalLine, Image, Indent, Italic, Link, List, MediaEmbed, PageBreak, RemoveFormat, RestrictedEditingModeEditing, ShowBlocks, SourceEditing, SpecialCharacters, Strikethrough, Subscript, Superscript, Table, TextPartLanguage, Underline, WordCount } from 'ckeditor5';
|
|
14
|
-
import { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin';
|
|
15
|
-
import { PastePlugin } from '../plugins/PastePlugin';
|
|
16
|
-
|
|
17
|
-
/** Maps TinyMCE string plugin names to CKEditor plugin objects */
|
|
18
|
-
var PLUGINS_MAP = {
|
|
19
|
-
bold: Bold,
|
|
20
|
-
italic: Italic,
|
|
21
|
-
underline: Underline,
|
|
22
|
-
strikethrough: Strikethrough,
|
|
23
|
-
list: List,
|
|
24
|
-
lists: List,
|
|
25
|
-
advlist: List,
|
|
26
|
-
link: Link,
|
|
27
|
-
table: Table,
|
|
28
|
-
image: Image,
|
|
29
|
-
imagetools: Image,
|
|
30
|
-
alignment: Alignment,
|
|
31
|
-
fontsize: FontSize,
|
|
32
|
-
fontcolor: FontColor,
|
|
33
|
-
fontbackgroundcolor: FontBackgroundColor,
|
|
34
|
-
indent: Indent,
|
|
35
|
-
autolink: AutoLink,
|
|
36
|
-
anchor: Bookmark,
|
|
37
|
-
autosave: Autosave,
|
|
38
|
-
charmap: SpecialCharacters,
|
|
39
|
-
code: Code,
|
|
40
|
-
codesample: CodeBlock,
|
|
41
|
-
directionality: TextPartLanguage,
|
|
42
|
-
emoticons: Emoji,
|
|
43
|
-
fullscreen: Fullscreen,
|
|
44
|
-
hr: HorizontalLine,
|
|
45
|
-
media: MediaEmbed,
|
|
46
|
-
noneditable: RestrictedEditingModeEditing,
|
|
47
|
-
pagebreak: PageBreak,
|
|
48
|
-
searchreplace: FindAndReplace,
|
|
49
|
-
textpattern: Autoformat,
|
|
50
|
-
visualblocks: ShowBlocks,
|
|
51
|
-
wordcount: WordCount,
|
|
52
|
-
blockquote: BlockQuote,
|
|
53
|
-
subscript: Subscript,
|
|
54
|
-
superscript: Superscript,
|
|
55
|
-
heading: Heading,
|
|
56
|
-
headings: Heading,
|
|
57
|
-
highlight: Highlight,
|
|
58
|
-
removeformat: RemoveFormat,
|
|
59
|
-
source: SourceEditing,
|
|
60
|
-
sourceedit: SourceEditing,
|
|
61
|
-
autoformat: Autoformat,
|
|
62
|
-
nonbreaking: SpecialCharacters,
|
|
63
|
-
paste: PastePlugin,
|
|
64
|
-
pastetext: PasteAsTextPlugin,
|
|
65
|
-
pasteastext: PasteAsTextPlugin,
|
|
66
|
-
// Part of CKEditor core
|
|
67
|
-
autoresize: null,
|
|
68
|
-
spellchecker: null,
|
|
69
|
-
tabfocus: null
|
|
70
|
-
};
|
|
71
|
-
var UNSUPPORTED_PLUGINS = [
|
|
72
|
-
// Would need custom implementation
|
|
73
|
-
'help', 'visualchars', 'insertdatetime', 'save', 'template',
|
|
74
|
-
// Not directly supported
|
|
75
|
-
'importcss',
|
|
76
|
-
// CKEditor uses explicit style definitions instead of scanning styles for classes
|
|
77
|
-
'print',
|
|
78
|
-
// Could be substituted with ExportPdf, but needs cloud services
|
|
79
|
-
'preview',
|
|
80
|
-
// Could be substituted with ExportPdf, but needs cloud services
|
|
81
|
-
'toc',
|
|
82
|
-
// Would need TableOfContents premium plugin
|
|
83
|
-
|
|
84
|
-
// Has been removed in TinyMCE 6
|
|
85
|
-
'bbcode', 'colorpicker', 'contextmenu', 'fullpage', 'legacyoutput'];
|
|
86
|
-
|
|
87
|
-
/** Maps TinyMCE toolbar button names to CKEditor command names */
|
|
88
|
-
var TOOLBAR_MAP = {
|
|
89
|
-
link: 'link',
|
|
90
|
-
table: 'insertTable',
|
|
91
|
-
image: 'insertImageViaUrl',
|
|
92
|
-
blockquote: 'blockQuote',
|
|
93
|
-
code: 'code',
|
|
94
|
-
codesample: 'codeBlock',
|
|
95
|
-
hr: 'horizontalLine',
|
|
96
|
-
media: 'mediaEmbed',
|
|
97
|
-
pagebreak: 'pageBreak',
|
|
98
|
-
subscript: 'subscript',
|
|
99
|
-
superscript: 'superscript',
|
|
100
|
-
removeformat: 'removeFormat',
|
|
101
|
-
heading: 'heading',
|
|
102
|
-
headings: 'heading',
|
|
103
|
-
highlight: 'highlight',
|
|
104
|
-
charmap: 'specialCharacters',
|
|
105
|
-
searchreplace: 'findAndReplace',
|
|
106
|
-
source: 'sourceEditing',
|
|
107
|
-
sourceedit: 'sourceEditing',
|
|
108
|
-
visualblocks: 'showBlocks',
|
|
109
|
-
wordcount: 'wordCount',
|
|
110
|
-
emoticons: 'emoji',
|
|
111
|
-
fullscreen: 'fullscreen',
|
|
112
|
-
anchor: 'bookmark',
|
|
113
|
-
toc: 'tableOfContents'
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/** Gets CKEditor plugin objects from TinyMCE string plugin names */
|
|
117
|
-
export var getPluginsFromStringArray = function getPluginsFromStringArray() {
|
|
118
|
-
var pluginNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
119
|
-
var unsupportedPlugins = pluginNames.filter(function (name) {
|
|
120
|
-
return UNSUPPORTED_PLUGINS.includes(name.toLowerCase());
|
|
121
|
-
});
|
|
122
|
-
if (unsupportedPlugins.length) {
|
|
123
|
-
var pluginsList = unsupportedPlugins.join(', ');
|
|
124
|
-
throw new Error("The following editor plugins are not supported: ".concat(pluginsList, "."));
|
|
125
|
-
}
|
|
126
|
-
var plugins = pluginNames.map(function (name) {
|
|
127
|
-
return PLUGINS_MAP[name.toLowerCase()];
|
|
128
|
-
}).filter(function (plugin, index, array) {
|
|
129
|
-
return plugin !== null &&
|
|
130
|
-
// Remove duplicates
|
|
131
|
-
array.indexOf(plugin) === index;
|
|
132
|
-
});
|
|
133
|
-
return plugins;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/** Gets toolbar items that should be added for the given string plugin names. */
|
|
137
|
-
export var getToolbarItemsFromStringArray = function getToolbarItemsFromStringArray() {
|
|
138
|
-
var pluginNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
139
|
-
return pluginNames.map(function (name) {
|
|
140
|
-
return TOOLBAR_MAP[name.toLowerCase()];
|
|
141
|
-
}).filter(Boolean);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */
|
|
145
|
-
export var addPluginsFromStringArray = function addPluginsFromStringArray(config) {
|
|
146
|
-
var pluginNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
147
|
-
if (!pluginNames.length) {
|
|
148
|
-
return config;
|
|
149
|
-
}
|
|
150
|
-
var additionalPlugins = getPluginsFromStringArray(pluginNames);
|
|
151
|
-
var additionalToolbarItems = getToolbarItemsFromStringArray(pluginNames);
|
|
152
|
-
var currentPlugins = config.plugins || [];
|
|
153
|
-
var enhancedPlugins = Array.from(new Set([].concat(_toConsumableArray(currentPlugins), _toConsumableArray(additionalPlugins))));
|
|
154
|
-
var currentToolbar = Array.isArray(config.toolbar) ? config.toolbar : [];
|
|
155
|
-
var enhancedToolbar = currentToolbar;
|
|
156
|
-
if (additionalToolbarItems.length > 0) {
|
|
157
|
-
// Remove undo/redo buttons temporarily
|
|
158
|
-
var toolbarWithoutUndo = currentToolbar.filter(function (item) {
|
|
159
|
-
return item !== 'undo' && item !== 'redo';
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// Combine toolbar items
|
|
163
|
-
var combinedItems = [].concat(_toConsumableArray(toolbarWithoutUndo), _toConsumableArray(additionalToolbarItems), ['|', 'undo', 'redo']);
|
|
164
|
-
|
|
165
|
-
// Deduplicate items while preserving separators
|
|
166
|
-
var seenButtons = new Set();
|
|
167
|
-
enhancedToolbar = combinedItems.filter(function (item) {
|
|
168
|
-
if (item === '|') {
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
var itemKey = typeof item === 'string' ? item : JSON.stringify(item);
|
|
172
|
-
if (seenButtons.has(itemKey)) {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
seenButtons.add(itemKey);
|
|
176
|
-
return true;
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
|
180
|
-
plugins: enhancedPlugins,
|
|
181
|
-
toolbar: enhancedToolbar
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","names":["Alignment","Autoformat","AutoLink","Autosave","BlockQuote","Bold","Bookmark","Code","CodeBlock","Emoji","FindAndReplace","FontBackgroundColor","FontColor","FontSize","Fullscreen","Heading","Highlight","HorizontalLine","Image","Indent","Italic","Link","List","MediaEmbed","PageBreak","RemoveFormat","RestrictedEditingModeEditing","ShowBlocks","SourceEditing","SpecialCharacters","Strikethrough","Subscript","Superscript","Table","TextPartLanguage","Underline","WordCount","PasteAsTextPlugin","PastePlugin","PLUGINS_MAP","bold","italic","underline","strikethrough","list","lists","advlist","link","table","image","imagetools","alignment","fontsize","fontcolor","fontbackgroundcolor","indent","autolink","anchor","autosave","charmap","code","codesample","directionality","emoticons","fullscreen","hr","media","noneditable","pagebreak","searchreplace","textpattern","visualblocks","wordcount","blockquote","subscript","superscript","heading","headings","highlight","removeformat","source","sourceedit","autoformat","nonbreaking","paste","pastetext","pasteastext","autoresize","spellchecker","tabfocus","UNSUPPORTED_PLUGINS","TOOLBAR_MAP","toc","getPluginsFromStringArray","pluginNames","arguments","length","undefined","unsupportedPlugins","filter","name","includes","toLowerCase","pluginsList","join","Error","concat","plugins","map","plugin","index","array","indexOf","getToolbarItemsFromStringArray","Boolean","addPluginsFromStringArray","config","additionalPlugins","additionalToolbarItems","currentPlugins","enhancedPlugins","Array","from","Set","_toConsumableArray","currentToolbar","isArray","toolbar","enhancedToolbar","toolbarWithoutUndo","item","combinedItems","seenButtons","itemKey","JSON","stringify","has","add","_objectSpread"],"sources":["../../../src/TextEditor/utils/plugins.ts"],"sourcesContent":["import type { EditorConfig, Plugin } from 'ckeditor5'\nimport {\n Alignment,\n Autoformat,\n AutoLink,\n Autosave,\n BlockQuote,\n Bold,\n Bookmark,\n Code,\n CodeBlock,\n Emoji,\n FindAndReplace,\n FontBackgroundColor,\n FontColor,\n FontSize,\n Fullscreen,\n Heading,\n Highlight,\n HorizontalLine,\n Image,\n Indent,\n Italic,\n Link,\n List,\n MediaEmbed,\n PageBreak,\n RemoveFormat,\n RestrictedEditingModeEditing,\n ShowBlocks,\n SourceEditing,\n SpecialCharacters,\n Strikethrough,\n Subscript,\n Superscript,\n Table,\n TextPartLanguage,\n Underline,\n WordCount,\n} from 'ckeditor5'\n\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\n\n/** Maps TinyMCE string plugin names to CKEditor plugin objects */\nconst PLUGINS_MAP: Record<string, typeof Plugin | null> = {\n bold: Bold,\n italic: Italic,\n underline: Underline,\n strikethrough: Strikethrough,\n list: List,\n lists: List,\n advlist: List,\n link: Link,\n table: Table,\n image: Image,\n imagetools: Image,\n alignment: Alignment,\n fontsize: FontSize,\n fontcolor: FontColor,\n fontbackgroundcolor: FontBackgroundColor,\n indent: Indent,\n autolink: AutoLink,\n anchor: Bookmark,\n autosave: Autosave,\n charmap: SpecialCharacters,\n code: Code,\n codesample: CodeBlock,\n directionality: TextPartLanguage,\n emoticons: Emoji,\n fullscreen: Fullscreen,\n hr: HorizontalLine,\n media: MediaEmbed,\n noneditable: RestrictedEditingModeEditing,\n pagebreak: PageBreak,\n searchreplace: FindAndReplace,\n textpattern: Autoformat,\n visualblocks: ShowBlocks,\n wordcount: WordCount,\n blockquote: BlockQuote,\n subscript: Subscript,\n superscript: Superscript,\n heading: Heading,\n headings: Heading,\n highlight: Highlight,\n removeformat: RemoveFormat,\n source: SourceEditing,\n sourceedit: SourceEditing,\n autoformat: Autoformat,\n nonbreaking: SpecialCharacters,\n paste: PastePlugin,\n pastetext: PasteAsTextPlugin,\n pasteastext: PasteAsTextPlugin,\n\n // Part of CKEditor core\n autoresize: null,\n spellchecker: null,\n tabfocus: null,\n}\n\nconst UNSUPPORTED_PLUGINS = [\n // Would need custom implementation\n 'help',\n 'visualchars',\n 'insertdatetime',\n 'save',\n 'template',\n\n // Not directly supported\n 'importcss', // CKEditor uses explicit style definitions instead of scanning styles for classes\n 'print', // Could be substituted with ExportPdf, but needs cloud services\n 'preview', // Could be substituted with ExportPdf, but needs cloud services\n 'toc', // Would need TableOfContents premium plugin\n\n // Has been removed in TinyMCE 6\n 'bbcode',\n 'colorpicker',\n 'contextmenu',\n 'fullpage',\n 'legacyoutput',\n]\n\n/** Maps TinyMCE toolbar button names to CKEditor command names */\nconst TOOLBAR_MAP: Record<string, string> = {\n link: 'link',\n table: 'insertTable',\n image: 'insertImageViaUrl',\n blockquote: 'blockQuote',\n code: 'code',\n codesample: 'codeBlock',\n hr: 'horizontalLine',\n media: 'mediaEmbed',\n pagebreak: 'pageBreak',\n subscript: 'subscript',\n superscript: 'superscript',\n removeformat: 'removeFormat',\n heading: 'heading',\n headings: 'heading',\n highlight: 'highlight',\n charmap: 'specialCharacters',\n searchreplace: 'findAndReplace',\n source: 'sourceEditing',\n sourceedit: 'sourceEditing',\n visualblocks: 'showBlocks',\n wordcount: 'wordCount',\n emoticons: 'emoji',\n fullscreen: 'fullscreen',\n anchor: 'bookmark',\n toc: 'tableOfContents',\n}\n\n/** Gets CKEditor plugin objects from TinyMCE string plugin names */\nexport const getPluginsFromStringArray = (pluginNames: string[] = []) => {\n const unsupportedPlugins = pluginNames.filter((name) =>\n UNSUPPORTED_PLUGINS.includes(name.toLowerCase())\n )\n if (unsupportedPlugins.length) {\n const pluginsList = unsupportedPlugins.join(', ')\n throw new Error(\n `The following editor plugins are not supported: ${pluginsList}.`\n )\n }\n\n const plugins = pluginNames\n .map((name) => PLUGINS_MAP[name.toLowerCase()])\n .filter(\n (plugin, index, array) =>\n plugin !== null &&\n // Remove duplicates\n array.indexOf(plugin) === index\n )\n return plugins as (typeof Plugin)[]\n}\n\n/** Gets toolbar items that should be added for the given string plugin names. */\nexport const getToolbarItemsFromStringArray = (pluginNames: string[] = []) => {\n return pluginNames\n .map((name) => TOOLBAR_MAP[name.toLowerCase()])\n .filter(Boolean)\n}\n\n/** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */\nexport const addPluginsFromStringArray = (\n config: EditorConfig,\n pluginNames: string[] = []\n): EditorConfig => {\n if (!pluginNames.length) {\n return config\n }\n const additionalPlugins = getPluginsFromStringArray(pluginNames)\n const additionalToolbarItems = getToolbarItemsFromStringArray(pluginNames)\n\n const currentPlugins = config.plugins || []\n const enhancedPlugins = Array.from(\n new Set([...currentPlugins, ...additionalPlugins])\n )\n\n const currentToolbar = Array.isArray(config.toolbar) ? config.toolbar : []\n\n let enhancedToolbar = currentToolbar\n if (additionalToolbarItems.length > 0) {\n // Remove undo/redo buttons temporarily\n const toolbarWithoutUndo = currentToolbar.filter(\n (item) => item !== 'undo' && item !== 'redo'\n )\n\n // Combine toolbar items\n const combinedItems = [\n ...toolbarWithoutUndo,\n ...additionalToolbarItems,\n '|',\n 'undo',\n 'redo',\n ]\n\n // Deduplicate items while preserving separators\n const seenButtons = new Set<string>()\n enhancedToolbar = combinedItems.filter((item) => {\n if (item === '|') {\n return true\n }\n const itemKey = typeof item === 'string' ? item : JSON.stringify(item)\n if (seenButtons.has(itemKey)) {\n return false\n }\n seenButtons.add(itemKey)\n return true\n })\n }\n return {\n ...config,\n plugins: enhancedPlugins,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AAIP,sBAAsB,CAACtB,MAAM,GAAG,CAAC,EAAE;IACrC;IACA,IAAMiC,kBAAkB,GAAGJ,cAAc,CAAC1B,MAAM,CAC9C,UAAC+B,IAAI;MAAA,OAAKA,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,MAAM;IAAA,CAC9C,CAAC;;IAED;IACA,IAAMC,aAAa,MAAAzB,MAAA,CAAAkB,kBAAA,CACdK,kBAAkB,GAAAL,kBAAA,CAClBN,sBAAsB,IACzB,GAAG,EACH,MAAM,EACN,MAAM,EACP;;IAED;IACA,IAAMc,WAAW,GAAG,IAAIT,GAAG,CAAS,CAAC;IACrCK,eAAe,GAAGG,aAAa,CAAChC,MAAM,CAAC,UAAC+B,IAAI,EAAK;MAC/C,IAAIA,IAAI,KAAK,GAAG,EAAE;QAChB,OAAO,IAAI;MACb;MACA,IAAMG,OAAO,GAAG,OAAOH,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGI,IAAI,CAACC,SAAS,CAACL,IAAI,CAAC;MACtE,IAAIE,WAAW,CAACI,GAAG,CAACH,OAAO,CAAC,EAAE;QAC5B,OAAO,KAAK;MACd;MACAD,WAAW,CAACK,GAAG,CAACJ,OAAO,CAAC;MACxB,OAAO,IAAI;IACb,CAAC,CAAC;EACJ;EACA,OAAAK,aAAA,CAAAA,aAAA,KACKtB,MAAM;IACTT,OAAO,EAAEa,eAAe;IACxBO,OAAO,EAAEC;EAAe;AAE5B,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import sanitizeHtml from 'sanitize-html';
|
|
2
|
-
|
|
3
|
-
/** Sanitize HTML content while preserving custom styling */
|
|
4
|
-
export var sanitizeTextEditorHtml = function sanitizeTextEditorHtml(html) {
|
|
5
|
-
if (!html) {
|
|
6
|
-
return '';
|
|
7
|
-
}
|
|
8
|
-
return sanitizeHtml(html, {
|
|
9
|
-
allowedTags: ['p', 'br', 'strong', 'b', 'em', 'i', 'u', 's', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'a', 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'blockquote', 'pre', 'code', 'hr', 'img', 'sub', 'sup'],
|
|
10
|
-
allowedAttributes: {
|
|
11
|
-
'*': ['style', 'class', 'data-*'],
|
|
12
|
-
a: ['href', 'title', 'target', 'rel'],
|
|
13
|
-
img: ['src', 'alt', 'title', 'width', 'height'],
|
|
14
|
-
table: ['border', 'cellpadding', 'cellspacing'],
|
|
15
|
-
td: ['colspan', 'rowspan'],
|
|
16
|
-
th: ['colspan', 'rowspan', 'scope']
|
|
17
|
-
},
|
|
18
|
-
allowedStyles: {
|
|
19
|
-
'*': {
|
|
20
|
-
color: [/^#[0-9a-fA-F]{3,6}$/, /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/, /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)$/],
|
|
21
|
-
'background-color': [/^#[0-9a-fA-F]{3,6}$/, /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/, /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)$/],
|
|
22
|
-
'font-size': [/^\d+(?:px|pt|em|rem|%)$/],
|
|
23
|
-
'font-weight': [/^(?:normal|bold|bolder|lighter|\d{1,3})$/],
|
|
24
|
-
'font-style': [/^(?:normal|italic|oblique)$/],
|
|
25
|
-
'font-family': [/.*/],
|
|
26
|
-
'text-decoration': [/^(?:none|underline|line-through|overline)$/],
|
|
27
|
-
'text-align': [/^(?:left|right|center|justify)$/],
|
|
28
|
-
'line-height': [/^\d+(?:\.\d+)?(?:px|pt|em|rem|%)?$/],
|
|
29
|
-
margin: [/^\d+(?:px|pt|em|rem|%)?(?:\s+\d+(?:px|pt|em|rem|%)?)*$/],
|
|
30
|
-
'margin-top': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
31
|
-
'margin-bottom': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
32
|
-
'margin-left': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
33
|
-
'margin-right': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
34
|
-
padding: [/^\d+(?:px|pt|em|rem|%)?(?:\s+\d+(?:px|pt|em|rem|%)?)*$/],
|
|
35
|
-
'padding-top': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
36
|
-
'padding-bottom': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
37
|
-
'padding-left': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
38
|
-
'padding-right': [/^\d+(?:px|pt|em|rem|%)?$/],
|
|
39
|
-
border: [/.*/],
|
|
40
|
-
'border-top': [/.*/],
|
|
41
|
-
'border-bottom': [/.*/],
|
|
42
|
-
'border-left': [/.*/],
|
|
43
|
-
'border-right': [/.*/],
|
|
44
|
-
'border-color': [/^#[0-9a-fA-F]{3,6}$/, /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/, /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)$/],
|
|
45
|
-
'border-width': [/^\d+(?:px|pt|em|rem)?$/],
|
|
46
|
-
'border-style': [/^(?:none|solid|dashed|dotted|double)$/],
|
|
47
|
-
'list-style-type': [/.*/],
|
|
48
|
-
'vertical-align': [/.*/],
|
|
49
|
-
'white-space': [/.*/]
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
allowedSchemes: ['http', 'https', 'mailto', 'tel'],
|
|
53
|
-
allowedSchemesByTag: {
|
|
54
|
-
img: ['data', 'http', 'https']
|
|
55
|
-
},
|
|
56
|
-
allowedIframeHostnames: []
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=TextEditorOutput.utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorOutput.utils.js","names":["sanitizeHtml","sanitizeTextEditorHtml","html","allowedTags","allowedAttributes","a","img","table","td","th","allowedStyles","color","margin","padding","border","allowedSchemes","allowedSchemesByTag","allowedIframeHostnames"],"sources":["../../src/TextEditorOutput/TextEditorOutput.utils.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html'\n\n/** Sanitize HTML content while preserving custom styling */\nexport const sanitizeTextEditorHtml = (html: string) => {\n if (!html) {\n return ''\n }\n\n return sanitizeHtml(html, {\n allowedTags: [\n 'p',\n 'br',\n 'strong',\n 'b',\n 'em',\n 'i',\n 'u',\n 's',\n 'span',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'ul',\n 'ol',\n 'li',\n 'a',\n 'table',\n 'thead',\n 'tbody',\n 'tr',\n 'td',\n 'th',\n 'blockquote',\n 'pre',\n 'code',\n 'hr',\n 'img',\n 'sub',\n 'sup',\n ],\n allowedAttributes: {\n '*': ['style', 'class', 'data-*'],\n a: ['href', 'title', 'target', 'rel'],\n img: ['src', 'alt', 'title', 'width', 'height'],\n table: ['border', 'cellpadding', 'cellspacing'],\n td: ['colspan', 'rowspan'],\n th: ['colspan', 'rowspan', 'scope'],\n },\n allowedStyles: {\n '*': {\n color: [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'background-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'font-size': [/^\\d+(?:px|pt|em|rem|%)$/],\n 'font-weight': [/^(?:normal|bold|bolder|lighter|\\d{1,3})$/],\n 'font-style': [/^(?:normal|italic|oblique)$/],\n 'font-family': [/.*/],\n 'text-decoration': [/^(?:none|underline|line-through|overline)$/],\n 'text-align': [/^(?:left|right|center|justify)$/],\n 'line-height': [/^\\d+(?:\\.\\d+)?(?:px|pt|em|rem|%)?$/],\n margin: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'margin-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'margin-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n padding: [/^\\d+(?:px|pt|em|rem|%)?(?:\\s+\\d+(?:px|pt|em|rem|%)?)*$/],\n 'padding-top': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-bottom': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-left': [/^\\d+(?:px|pt|em|rem|%)?$/],\n 'padding-right': [/^\\d+(?:px|pt|em|rem|%)?$/],\n border: [/.*/],\n 'border-top': [/.*/],\n 'border-bottom': [/.*/],\n 'border-left': [/.*/],\n 'border-right': [/.*/],\n 'border-color': [\n /^#[0-9a-fA-F]{3,6}$/,\n /^rgb\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*\\)$/,\n /^rgba\\(\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*\\d+\\s*,\\s*[\\d.]+\\s*\\)$/,\n ],\n 'border-width': [/^\\d+(?:px|pt|em|rem)?$/],\n 'border-style': [/^(?:none|solid|dashed|dotted|double)$/],\n 'list-style-type': [/.*/],\n 'vertical-align': [/.*/],\n 'white-space': [/.*/],\n },\n },\n allowedSchemes: ['http', 'https', 'mailto', 'tel'],\n allowedSchemesByTag: {\n img: ['data', 'http', 'https'],\n },\n allowedIframeHostnames: [],\n })\n}\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,eAAe;;AAExC;AACA,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,s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+0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"TextEditorProviderProps": {
|
|
3
|
-
"name": "TextEditorProviderProps",
|
|
4
|
-
"properties": [
|
|
5
|
-
{
|
|
6
|
-
"name": "children",
|
|
7
|
-
"required": true,
|
|
8
|
-
"type": "<span class=\"tsd-signature-type\">ReactNode</span>",
|
|
9
|
-
"typeDetail": "<span class=\"tsd-signature-type\">ReactNode</span>",
|
|
10
|
-
"description": "",
|
|
11
|
-
"descriptionHtml": "",
|
|
12
|
-
"sourceFile": "packages/core-react/src/TextEditor/TextEditorProvider.types.ts",
|
|
13
|
-
"sourceUrl": "https://github.com/procore/core/blob/a78a42b/packages/core-react/src/TextEditor/TextEditorProvider.types.ts#L9"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "features",
|
|
17
|
-
"required": false,
|
|
18
|
-
"type": "<span class=\"tsd-signature-type\">TextEditorFeatureToggle</span>",
|
|
19
|
-
"typeDetail": "<span class=\"tsd-signature-type\">TextEditorFeatureToggle</span>",
|
|
20
|
-
"description": "- `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.",
|
|
21
|
-
"descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<ul>\n<li><code>stickyToolbar</code> - Have the editor toolbar stick to the top when content is longer than the page length.</li>\n<li><code>tabAsNavigation</code> - Have <code>Tab</code> key exit the editor. Support <code>Alt</code>/<code>Opt</code> + <code>Tab</code> as triple space indent.</li>\n</ul>\n</div></div>",
|
|
22
|
-
"sourceFile": "packages/core-react/src/TextEditor/TextEditorProvider.types.ts",
|
|
23
|
-
"sourceUrl": "https://github.com/procore/core/blob/a78a42b/packages/core-react/src/TextEditor/TextEditorProvider.types.ts#L14"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"description": ""
|
|
27
|
-
}
|
|
28
|
-
}
|