@procore/core-react 12.25.2 → 12.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jest/ckeditorMock.js +67 -0
- package/.jest/esToolkitMock.js +23 -0
- package/.jest/example.test.js +5 -0
- package/.jest/fileMock.js +1 -0
- package/.jest/public/avatar.png +0 -0
- package/.jest/setupTests.js +31 -0
- package/.jest/snapshotResolver.js +47 -0
- package/.jest/styleMock.js +1 -0
- package/.jest/styledV6PropsMock.js +23 -0
- package/.jest/svgTransform.js +10 -0
- package/.jest/testShims.js +22 -0
- package/.jest/translationMock.js +3 -0
- package/.jest/videoMock.js +1 -0
- package/CHANGELOG.md +17 -0
- package/README.md +49 -3
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/AvatarStack/mocks/getAvatarMocks.d.ts +25 -0
- package/dist/AvatarStack/mocks/getAvatarMocks.js +305 -0
- package/dist/AvatarStack/mocks/getAvatarMocks.js.map +1 -0
- package/dist/AvatarStack/mocks/images.d.ts +2 -0
- package/dist/AvatarStack/mocks/images.js +13 -0
- package/dist/AvatarStack/mocks/images.js.map +1 -0
- package/dist/AvatarStack/mocks/img/1.png +0 -0
- package/dist/AvatarStack/mocks/img/2.png +0 -0
- package/dist/AvatarStack/mocks/img/3.png +0 -0
- package/dist/AvatarStack/mocks/img/4.png +0 -0
- package/dist/AvatarStack/mocks/img/5.png +0 -0
- package/dist/AvatarStack/mocks/logo/1.png +0 -0
- package/dist/AvatarStack/mocks/logo/2.png +0 -0
- package/dist/AvatarStack/mocks/logo/3.png +0 -0
- package/dist/AvatarStack/mocks/logo/4.png +0 -0
- package/dist/AvatarStack/mocks/logo/5.png +0 -0
- 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/DeprecatedTextEditor/DeprecatedTextEditor.d.ts +19 -0
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js +159 -0
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.js.map +1 -0
- package/dist/{TextEditor/TextEditor.styles.js → DeprecatedTextEditor/DeprecatedTextEditor.styles.js} +1 -1
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.styles.js.map +1 -0
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.d.ts +72 -0
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js +2 -0
- package/dist/DeprecatedTextEditor/DeprecatedTextEditor.types.js.map +1 -0
- package/dist/DeprecatedTextEditor/index.d.ts +2 -0
- package/dist/DeprecatedTextEditor/index.js +3 -0
- package/dist/DeprecatedTextEditor/index.js.map +1 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.d.ts +12 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js +45 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.js.map +1 -0
- package/dist/{TextEditorOutput/TextEditorOutput.styles.js → DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js} +2 -2
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js.map +1 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.d.ts +16 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js +2 -0
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.types.js.map +1 -0
- package/dist/DeprecatedTextEditorOutput/index.d.ts +2 -0
- package/dist/DeprecatedTextEditorOutput/index.js +2 -0
- package/dist/DeprecatedTextEditorOutput/index.js.map +1 -0
- 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/EmptyState/assets/default.stories.png +0 -0
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileList/storybook/fileListMockData.d.ts +5 -0
- package/dist/FileList/storybook/fileListMockData.js +34 -0
- package/dist/FileList/storybook/fileListMockData.js.map +1 -0
- 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.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 +1 -30
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +14 -14
- 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/GroupSelect/mocks/groupSelectMockData.d.ts +18 -0
- package/dist/GroupSelect/mocks/groupSelectMockData.js +122 -0
- package/dist/GroupSelect/mocks/groupSelectMockData.js.map +1 -0
- 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 +15 -15
- package/dist/Modal/Modal.styles.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/NextTextEditor/EditorError.d.ts +2 -0
- package/dist/NextTextEditor/EditorError.js +9 -0
- package/dist/NextTextEditor/EditorError.js.map +1 -0
- package/dist/NextTextEditor/NextTextEditor.d.ts +3 -0
- package/dist/NextTextEditor/NextTextEditor.js +156 -0
- package/dist/NextTextEditor/NextTextEditor.js.map +1 -0
- package/dist/NextTextEditor/NextTextEditor.styles.d.ts +5 -0
- package/dist/NextTextEditor/NextTextEditor.styles.js +22 -0
- package/dist/NextTextEditor/NextTextEditor.styles.js.map +1 -0
- package/dist/NextTextEditor/NextTextEditor.types.d.ts +111 -0
- package/dist/NextTextEditor/NextTextEditor.types.js +2 -0
- package/dist/NextTextEditor/NextTextEditor.types.js.map +1 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.d.ts +5 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.js +2 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.types.js.map +1 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.d.ts +3 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.js +153 -0
- package/dist/NextTextEditor/StickyToolbar/StickyToolbar.utils.js.map +1 -0
- package/dist/NextTextEditor/StickyToolbar/index.d.ts +4 -0
- package/dist/NextTextEditor/StickyToolbar/index.js +3 -0
- package/dist/NextTextEditor/StickyToolbar/index.js.map +1 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.d.ts +2 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.js +49 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.js.map +1 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.d.ts +12 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.js +2 -0
- package/dist/NextTextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -0
- package/dist/NextTextEditor/index.d.ts +2 -0
- package/dist/NextTextEditor/index.js +3 -0
- package/dist/NextTextEditor/index.js.map +1 -0
- package/dist/NextTextEditor/license_key.d.ts +2 -0
- package/dist/NextTextEditor/license_key.js +3 -0
- package/dist/NextTextEditor/license_key.js.map +1 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.d.ts +5 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.js +99 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutCommand.js.map +1 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.d.ts +5 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.js +56 -0
- package/dist/NextTextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -0
- package/dist/NextTextEditor/plugins/CutPlugin/index.d.ts +1 -0
- package/dist/NextTextEditor/plugins/CutPlugin/index.js +2 -0
- package/dist/NextTextEditor/plugins/CutPlugin/index.js.map +1 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +5 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +40 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +1 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.js +2 -0
- package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.d.ts +15 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js +65 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/index.js.map +1 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.d.ts +13 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js +80 -0
- package/dist/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.js.map +1 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +5 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +86 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +1 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +5 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +56 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.d.ts +1 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.js +2 -0
- package/dist/NextTextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.d.ts +5 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.js +149 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.d.ts +5 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.js +56 -0
- package/dist/NextTextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -0
- package/dist/NextTextEditor/plugins/PastePlugin/index.d.ts +1 -0
- package/dist/NextTextEditor/plugins/PastePlugin/index.js +2 -0
- package/dist/NextTextEditor/plugins/PastePlugin/index.js.map +1 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +6 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +87 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.d.ts +1 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.js +2 -0
- package/dist/NextTextEditor/plugins/TabSpacesPlugin/index.js.map +1 -0
- package/dist/NextTextEditor/textEditorTheming/icons.d.ts +23 -0
- package/dist/NextTextEditor/textEditorTheming/icons.js +24 -0
- package/dist/NextTextEditor/textEditorTheming/icons.js.map +1 -0
- package/dist/NextTextEditor/textEditorTheming/index.d.ts +1 -0
- package/dist/NextTextEditor/textEditorTheming/index.js +2 -0
- package/dist/NextTextEditor/textEditorTheming/index.js.map +1 -0
- package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.d.ts +2 -0
- package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.js +10 -0
- package/dist/NextTextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -0
- package/dist/NextTextEditor/useCKEditorCss.d.ts +3 -0
- package/dist/NextTextEditor/useCKEditorCss.js +36 -0
- package/dist/NextTextEditor/useCKEditorCss.js.map +1 -0
- package/dist/NextTextEditor/useTabAsNavigation.d.ts +11 -0
- package/dist/NextTextEditor/useTabAsNavigation.js +29 -0
- package/dist/NextTextEditor/useTabAsNavigation.js.map +1 -0
- package/dist/NextTextEditor/utils/config.d.ts +3 -0
- package/dist/NextTextEditor/utils/config.js +179 -0
- package/dist/NextTextEditor/utils/config.js.map +1 -0
- package/dist/NextTextEditor/utils/index.d.ts +2 -0
- package/dist/NextTextEditor/utils/index.js +3 -0
- package/dist/NextTextEditor/utils/index.js.map +1 -0
- package/dist/NextTextEditor/utils/locale.d.ts +3 -0
- package/dist/NextTextEditor/utils/locale.js +102 -0
- package/dist/NextTextEditor/utils/locale.js.map +1 -0
- package/dist/NextTextEditor/utils/plugins.d.ts +7 -0
- package/dist/NextTextEditor/utils/plugins.js +184 -0
- package/dist/NextTextEditor/utils/plugins.js.map +1 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.d.ts +9 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.js +29 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.js.map +1 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.d.ts +2 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js +6 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js.map +1 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.types.d.ts +9 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js +2 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.types.js.map +1 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.d.ts +2 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.js +59 -0
- package/dist/NextTextEditorOutput/NextTextEditorOutput.utils.js.map +1 -0
- package/dist/NextTextEditorOutput/index.d.ts +2 -0
- package/dist/NextTextEditorOutput/index.js +2 -0
- package/dist/NextTextEditorOutput/index.js.map +1 -0
- 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/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 +13 -13
- package/dist/Panel/Panel.styles.js.map +1 -1
- 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.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.js +5 -7
- package/dist/Spinner/Spinner.js.map +1 -1
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +10 -10
- package/dist/SplitViewCard/SplitViewCard.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- 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 +7 -7
- package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
- package/dist/Tearsheet/storybook/PageLayoutDemo.d.ts +4 -0
- package/dist/Tearsheet/storybook/PageLayoutDemo.js +164 -0
- package/dist/Tearsheet/storybook/PageLayoutDemo.js.map +1 -0
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditor/TextEditor.d.ts +2 -19
- package/dist/TextEditor/TextEditor.js +11 -169
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.d.ts +19 -86
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/TextEditorDocs.types.d.ts +65 -0
- package/dist/TextEditor/TextEditorDocs.types.js +2 -0
- package/dist/TextEditor/TextEditorDocs.types.js.map +1 -0
- package/dist/TextEditor/TextEditorProvider.d.ts +4 -0
- package/dist/TextEditor/TextEditorProvider.js +17 -0
- package/dist/TextEditor/TextEditorProvider.js.map +1 -0
- package/dist/TextEditor/TextEditorProvider.types.d.ts +14 -0
- package/dist/TextEditor/TextEditorProvider.types.js +2 -0
- package/dist/TextEditor/TextEditorProvider.types.js.map +1 -0
- package/dist/TextEditor/index.d.ts +4 -2
- package/dist/TextEditor/index.js +2 -1
- package/dist/TextEditor/index.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.d.ts +6 -8
- package/dist/TextEditorOutput/TextEditorOutput.js +17 -34
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.types.d.ts +16 -13
- package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutputDocs.types.d.ts +21 -0
- package/dist/TextEditorOutput/TextEditorOutputDocs.types.js +2 -0
- package/dist/TextEditorOutput/TextEditorOutputDocs.types.js.map +1 -0
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/Thumbnail/mocks/images/thumb_104x104_1.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_104x104_2.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_104x104_3.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_104x104_4.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_40x40_1.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_40x40_2.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_40x40_3.png +0 -0
- package/dist/Thumbnail/mocks/images/thumb_40x40_4.png +0 -0
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TierSelectionTieredSelect.js +3 -1
- package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/TieredSelect/TieredSelect.types.d.ts +4 -0
- package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Tile/mocks/dog.jpeg +0 -0
- package/dist/Tile/mocks/iframe.d.ts +5 -0
- package/dist/Tile/mocks/iframe.js +15 -0
- package/dist/Tile/mocks/iframe.js.map +1 -0
- package/dist/Tile/mocks/svg.d.ts +3 -0
- package/dist/Tile/mocks/svg.js +830 -0
- package/dist/Tile/mocks/svg.js.map +1 -0
- package/dist/Tile/mocks/video.mp4 +0 -0
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Title/mocks/thumb_40x40_1.png +0 -0
- package/dist/Title/mocks/visual_placeholder_40x40.svg +9 -0
- 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/Tree/mocks/treeMockData.d.ts +8 -0
- package/dist/Tree/mocks/treeMockData.js +44 -0
- package/dist/Tree/mocks/treeMockData.js.map +1 -0
- 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/_storyHelpers_/components/Deprecation.d.ts +3 -0
- package/dist/_storyHelpers_/components/Deprecation.js +10 -0
- package/dist/_storyHelpers_/components/Deprecation.js.map +1 -0
- package/dist/_storyHelpers_/components/Deprecation.styles.d.ts +4 -0
- package/dist/_storyHelpers_/components/Deprecation.styles.js +7 -0
- package/dist/_storyHelpers_/components/Deprecation.styles.js.map +1 -0
- package/dist/_storyHelpers_/components/Deprecation.types.d.ts +9 -0
- package/dist/_storyHelpers_/components/Deprecation.types.js +2 -0
- package/dist/_storyHelpers_/components/Deprecation.types.js.map +1 -0
- package/dist/_storyHelpers_/components/FullLayout.d.ts +6 -0
- package/dist/_storyHelpers_/components/FullLayout.js +15 -0
- package/dist/_storyHelpers_/components/FullLayout.js.map +1 -0
- package/dist/_storyHelpers_/components/StoryGrid.d.ts +7 -0
- package/dist/_storyHelpers_/components/StoryGrid.js +40 -0
- package/dist/_storyHelpers_/components/StoryGrid.js.map +1 -0
- package/dist/_storyHelpers_/components/WithNavigationLayout.d.ts +2 -0
- package/dist/_storyHelpers_/components/WithNavigationLayout.js +47 -0
- package/dist/_storyHelpers_/components/WithNavigationLayout.js.map +1 -0
- package/dist/_storyHelpers_/constants.d.ts +35 -0
- package/dist/_storyHelpers_/constants.js +168 -0
- package/dist/_storyHelpers_/constants.js.map +1 -0
- package/dist/_storyHelpers_/decorators/fullLayoutDecorator.d.ts +3 -0
- package/dist/_storyHelpers_/decorators/fullLayoutDecorator.js +8 -0
- package/dist/_storyHelpers_/decorators/fullLayoutDecorator.js.map +1 -0
- package/dist/_storyHelpers_/effects/useWaitForElement.d.ts +1 -0
- package/dist/_storyHelpers_/effects/useWaitForElement.js +24 -0
- package/dist/_storyHelpers_/effects/useWaitForElement.js.map +1 -0
- package/dist/_storyHelpers_/mocks/dropzoneMockData.d.ts +13 -0
- package/dist/_storyHelpers_/mocks/dropzoneMockData.js +39 -0
- package/dist/_storyHelpers_/mocks/dropzoneMockData.js.map +1 -0
- package/dist/_storyHelpers_/mocks/pillSelectMockData.d.ts +6 -0
- package/dist/_storyHelpers_/mocks/pillSelectMockData.js +22 -0
- package/dist/_storyHelpers_/mocks/pillSelectMockData.js.map +1 -0
- package/dist/_storyHelpers_/mocks/selectMockData.d.ts +11 -0
- package/dist/_storyHelpers_/mocks/selectMockData.js +36 -0
- package/dist/_storyHelpers_/mocks/selectMockData.js.map +1 -0
- package/dist/_storyHelpers_/mocks/tableMockData.d.ts +4 -0
- package/dist/_storyHelpers_/mocks/tableMockData.js +38 -0
- package/dist/_storyHelpers_/mocks/tableMockData.js.map +1 -0
- package/dist/_storyHelpers_/mocks/tieredSelect.d.ts +77 -0
- package/dist/_storyHelpers_/mocks/tieredSelect.js +277 -0
- package/dist/_storyHelpers_/mocks/tieredSelect.js.map +1 -0
- package/dist/_styles/mixins.d.ts +4 -0
- package/dist/_styles/mixins.js +7 -0
- package/dist/_styles/mixins.js.map +1 -1
- 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 +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +13 -13
- 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 +37 -37
- 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 +929 -773
- 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 +37 -37
- 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 +60 -60
- 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 +1 -100
- package/dist/_typedoc/TextEditor/TextEditorDocs.types.json +98 -0
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +28 -0
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +6 -42
- package/dist/_typedoc/TextEditorOutput/TextEditorOutputDocs.types.json +38 -0
- 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 +1 -1
- 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 +6 -6
- 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 +86 -86
- 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/propsTypedoc.d.ts +3 -0
- package/dist/_utils/propsTypedoc.js +3 -0
- package/dist/_utils/propsTypedoc.js.map +1 -1
- package/jestConfig.js +52 -0
- package/package.json +26 -11
- package/.eslintignore +0 -4
- package/.eslintrc.cjs +0 -54
- package/__mocks__/@react-aria/utils.js +0 -10
- package/babel.config.js +0 -40
- package/dist/TextEditor/TextEditor.styles.js.map +0 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +0 -1
- package/tsconfig.json +0 -24
- package/tsconfig.prod.json +0 -11
- package/tsconfig.test.json +0 -4
- /package/dist/{TextEditor/TextEditor.styles.d.ts → DeprecatedTextEditor/DeprecatedTextEditor.styles.d.ts} +0 -0
- /package/dist/{TextEditorOutput/TextEditorOutput.styles.d.ts → DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.d.ts} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
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); }
|
|
13
|
+
// Detects TinyMCE-like configs and augments CKEditor config accordingly.
|
|
14
|
+
|
|
15
|
+
import { LegacyPasteAdapter } from './index';
|
|
16
|
+
// Checks if the object looks like a TinyMCE init by presence of legacy keys.
|
|
17
|
+
export function isLegacyTinyMceConfig(obj) {
|
|
18
|
+
if (!obj || _typeof(obj) !== 'object') return false;
|
|
19
|
+
var o = obj;
|
|
20
|
+
return 'paste_preprocess' in o || 'paste_data_images' in o;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** @deprecated Temporary TinyMCE→CKEditor compatibility.
|
|
24
|
+
* TODO: Remove after decommission deadline.
|
|
25
|
+
*/
|
|
26
|
+
export function applyLegacyTinyMceCompatibility(base, maybeLegacy) {
|
|
27
|
+
var _base$plugins, _base$htmlSupport, _base$htmlSupport2, _base$htmlSupport$dis, _base$htmlSupport3;
|
|
28
|
+
// If it’s not a TinyMCE-like config, return the base config unchanged.
|
|
29
|
+
if (!isLegacyTinyMceConfig(maybeLegacy)) return base;
|
|
30
|
+
|
|
31
|
+
// Normalize paste_preprocess to a lowercase string for simple checks.
|
|
32
|
+
var fnStr = typeof maybeLegacy.paste_preprocess === 'function' ? String(maybeLegacy.paste_preprocess).toLowerCase() : '';
|
|
33
|
+
|
|
34
|
+
// Decide if images should be stripped based on legacy flags or code.
|
|
35
|
+
var stripImages = maybeLegacy.paste_data_images === false || /<img/i.test(fnStr);
|
|
36
|
+
|
|
37
|
+
// Detect if legacy logic intends to transform <pre> tags.
|
|
38
|
+
var wantsPreReplace = /<\s*pre/i.test(fnStr) || /<\/\s*pre\s*>/i.test(fnStr);
|
|
39
|
+
|
|
40
|
+
// Check if CKEditor would already keep <pre> (then we shouldn’t force-convert).
|
|
41
|
+
var hasCodeBlock = ((_base$plugins = base.plugins) !== null && _base$plugins !== void 0 ? _base$plugins : []).some(function (p) {
|
|
42
|
+
return (p === null || p === void 0 ? void 0 : p.pluginName) === 'CodeBlock';
|
|
43
|
+
});
|
|
44
|
+
var ghsAllowsPre = Array.isArray((_base$htmlSupport = base.htmlSupport) === null || _base$htmlSupport === void 0 ? void 0 : _base$htmlSupport.allow) && base.htmlSupport.allow.some(function (r) {
|
|
45
|
+
return (r === null || r === void 0 ? void 0 : r.name) === 'pre';
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Convert <pre>→<p> only when legacy asked for it and CKEditor won’t override it.
|
|
49
|
+
var convertPreToParagraph = wantsPreReplace && !hasCodeBlock && !ghsAllowsPre;
|
|
50
|
+
|
|
51
|
+
// Build the adapted CKEditor config with legacy options.
|
|
52
|
+
var next = _objectSpread(_objectSpread({}, base), {}, {
|
|
53
|
+
legacyTinymce: {
|
|
54
|
+
convertPreToParagraph: convertPreToParagraph,
|
|
55
|
+
stripImagesOnPaste: Boolean(stripImages)
|
|
56
|
+
},
|
|
57
|
+
// Remove image buttons from the toolbar for consistency.
|
|
58
|
+
toolbar: Array.isArray(base.toolbar) ? base.toolbar.filter(function (btn) {
|
|
59
|
+
return btn !== 'imageUpload' && btn !== 'insertImage';
|
|
60
|
+
}) : base.toolbar,
|
|
61
|
+
// Disallow <img> at the HTML input layer as an extra safety net.
|
|
62
|
+
htmlSupport: _objectSpread(_objectSpread({}, (_base$htmlSupport2 = base.htmlSupport) !== null && _base$htmlSupport2 !== void 0 ? _base$htmlSupport2 : {}), {}, {
|
|
63
|
+
disallow: [].concat(_toConsumableArray((_base$htmlSupport$dis = (_base$htmlSupport3 = base.htmlSupport) === null || _base$htmlSupport3 === void 0 ? void 0 : _base$htmlSupport3.disallow) !== null && _base$htmlSupport$dis !== void 0 ? _base$htmlSupport$dis : []), _toConsumableArray(stripImages ? [{
|
|
64
|
+
name: 'img'
|
|
65
|
+
}] : []))
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Remove image-related plugins so images can’t be added by other means.
|
|
70
|
+
if (stripImages) {
|
|
71
|
+
var _next$removePlugins;
|
|
72
|
+
var remove = new Set([].concat(_toConsumableArray((_next$removePlugins = next.removePlugins) !== null && _next$removePlugins !== void 0 ? _next$removePlugins : []), ['Image', 'ImageUpload', 'ImageToolbar']));
|
|
73
|
+
next.removePlugins = Array.from(remove);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Ensure our adapter plugin is loaded to emulate legacy paste behavior.
|
|
77
|
+
next.plugins = [].concat(_toConsumableArray(base.plugins || []), [LegacyPasteAdapter]);
|
|
78
|
+
return next;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=legacyTinyMceAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyTinyMceAdapter.js","names":["LegacyPasteAdapter","isLegacyTinyMceConfig","obj","_typeof","o","applyLegacyTinyMceCompatibility","base","maybeLegacy","_base$plugins","_base$htmlSupport","_base$htmlSupport2","_base$htmlSupport$dis","_base$htmlSupport3","fnStr","paste_preprocess","String","toLowerCase","stripImages","paste_data_images","test","wantsPreReplace","hasCodeBlock","plugins","some","p","pluginName","ghsAllowsPre","Array","isArray","htmlSupport","allow","r","name","convertPreToParagraph","next","_objectSpread","legacyTinymce","stripImagesOnPaste","Boolean","toolbar","filter","btn","disallow","concat","_toConsumableArray","_next$removePlugins","remove","Set","removePlugins","from"],"sources":["../../../../src/NextTextEditor/plugins/LegacyPasteAdapter/legacyTinyMceAdapter.ts"],"sourcesContent":["// Detects TinyMCE-like configs and augments CKEditor config accordingly.\n\nimport type { EditorConfig } from 'ckeditor5'\nimport { LegacyPasteAdapter } from './index'\n\nexport type LegacyTinyMceLike = {\n paste_data_images?: boolean\n paste_preprocess?: (...args: any[]) => void\n plugins?: string | string[]\n contextmenu?: string | false | string[]\n [key: string]: unknown\n}\n\n// Checks if the object looks like a TinyMCE init by presence of legacy keys.\nexport function isLegacyTinyMceConfig(obj: unknown): obj is LegacyTinyMceLike {\n if (!obj || typeof obj !== 'object') return false\n const o = obj as Record<string, unknown>\n return 'paste_preprocess' in o || 'paste_data_images' in o\n}\n\n/** @deprecated Temporary TinyMCE→CKEditor compatibility.\n * TODO: Remove after decommission deadline.\n */\nexport function applyLegacyTinyMceCompatibility(\n base: EditorConfig,\n maybeLegacy: unknown\n): EditorConfig {\n // If it’s not a TinyMCE-like config, return the base config unchanged.\n if (!isLegacyTinyMceConfig(maybeLegacy)) return base\n\n // Normalize paste_preprocess to a lowercase string for simple checks.\n const fnStr =\n typeof maybeLegacy.paste_preprocess === 'function'\n ? String(maybeLegacy.paste_preprocess).toLowerCase()\n : ''\n\n // Decide if images should be stripped based on legacy flags or code.\n const stripImages =\n maybeLegacy.paste_data_images === false || /<img/i.test(fnStr)\n\n // Detect if legacy logic intends to transform <pre> tags.\n const wantsPreReplace = /<\\s*pre/i.test(fnStr) || /<\\/\\s*pre\\s*>/i.test(fnStr)\n\n // Check if CKEditor would already keep <pre> (then we shouldn’t force-convert).\n const hasCodeBlock = (base.plugins ?? []).some(\n (p: any) => p?.pluginName === 'CodeBlock'\n )\n const ghsAllowsPre =\n Array.isArray(base.htmlSupport?.allow) &&\n base.htmlSupport!.allow.some((r: any) => r?.name === 'pre')\n\n // Convert <pre>→<p> only when legacy asked for it and CKEditor won’t override it.\n const convertPreToParagraph =\n wantsPreReplace && !hasCodeBlock && !ghsAllowsPre\n\n // Build the adapted CKEditor config with legacy options.\n const next: EditorConfig = {\n ...base,\n legacyTinymce: {\n convertPreToParagraph,\n stripImagesOnPaste: Boolean(stripImages),\n },\n // Remove image buttons from the toolbar for consistency.\n toolbar: Array.isArray(base.toolbar)\n ? base.toolbar.filter(\n (btn) => btn !== 'imageUpload' && btn !== 'insertImage'\n )\n : base.toolbar,\n // Disallow <img> at the HTML input layer as an extra safety net.\n htmlSupport: {\n ...(base.htmlSupport ?? {}),\n disallow: [\n ...(base.htmlSupport?.disallow ?? []),\n ...(stripImages ? [{ name: 'img' as const }] : []),\n ],\n },\n }\n\n // Remove image-related plugins so images can’t be added by other means.\n if (stripImages) {\n const remove = new Set([\n ...(next.removePlugins ?? []),\n 'Image',\n 'ImageUpload',\n 'ImageToolbar',\n ])\n next.removePlugins = Array.from(remove)\n }\n\n // Ensure our adapter plugin is loaded to emulate legacy paste behavior.\n next.plugins = [...(base.plugins || []), LegacyPasteAdapter]\n return next\n}\n"],"mappings":";;;;;;;;;;;;AAAA;;AAGA,SAASA,kBAAkB,QAAQ,SAAS;AAU5C;AACA,OAAO,SAASC,qBAAqBA,CAACC,GAAY,EAA4B;EAC5E,IAAI,CAACA,GAAG,IAAIC,OAAA,CAAOD,GAAG,MAAK,QAAQ,EAAE,OAAO,KAAK;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EACzC;;EAEA;EACAZ,IAAI,CAACZ,OAAO,MAAAqB,MAAA,CAAAC,kBAAA,CAAQtC,IAAI,CAACgB,OAAO,IAAI,EAAE,IAAGtB,kBAAkB,EAAC;EAC5D,OAAOkC,IAAI;AACb"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
3
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
4
|
+
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
5
|
+
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
6
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
7
|
+
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
8
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
9
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
10
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
11
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
12
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
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); }
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
|
+
import { Command } from 'ckeditor5';
|
|
26
|
+
export var PasteAsTextCommand = /*#__PURE__*/function (_Command) {
|
|
27
|
+
function PasteAsTextCommand() {
|
|
28
|
+
_classCallCheck(this, PasteAsTextCommand);
|
|
29
|
+
return _callSuper(this, PasteAsTextCommand, arguments);
|
|
30
|
+
}
|
|
31
|
+
_inherits(PasteAsTextCommand, _Command);
|
|
32
|
+
return _createClass(PasteAsTextCommand, [{
|
|
33
|
+
key: "execute",
|
|
34
|
+
value: function () {
|
|
35
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
36
|
+
var editor, plainText;
|
|
37
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38
|
+
while (1) switch (_context.prev = _context.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
editor = this.editor;
|
|
41
|
+
_context.prev = 1;
|
|
42
|
+
if (!(navigator.clipboard && navigator.clipboard.readText)) {
|
|
43
|
+
_context.next = 9;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
_context.next = 5;
|
|
47
|
+
return navigator.clipboard.readText();
|
|
48
|
+
case 5:
|
|
49
|
+
plainText = _context.sent;
|
|
50
|
+
if (plainText) {
|
|
51
|
+
// Insert as plain text without any formatting
|
|
52
|
+
editor.model.change(function (writer) {
|
|
53
|
+
var textNode = writer.createText(plainText);
|
|
54
|
+
editor.model.insertContent(textNode);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_context.next = 10;
|
|
58
|
+
break;
|
|
59
|
+
case 9:
|
|
60
|
+
console.warn('Clipboard API not available');
|
|
61
|
+
case 10:
|
|
62
|
+
_context.next = 15;
|
|
63
|
+
break;
|
|
64
|
+
case 12:
|
|
65
|
+
_context.prev = 12;
|
|
66
|
+
_context.t0 = _context["catch"](1);
|
|
67
|
+
console.warn('Clipboard API not available for text reading');
|
|
68
|
+
case 15:
|
|
69
|
+
case "end":
|
|
70
|
+
return _context.stop();
|
|
71
|
+
}
|
|
72
|
+
}, _callee, this, [[1, 12]]);
|
|
73
|
+
}));
|
|
74
|
+
function execute() {
|
|
75
|
+
return _execute.apply(this, arguments);
|
|
76
|
+
}
|
|
77
|
+
return execute;
|
|
78
|
+
}()
|
|
79
|
+
}, {
|
|
80
|
+
key: "refresh",
|
|
81
|
+
value: function refresh() {
|
|
82
|
+
this.isEnabled = true;
|
|
83
|
+
}
|
|
84
|
+
}]);
|
|
85
|
+
}(Command);
|
|
86
|
+
//# sourceMappingURL=PasteAsTextCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasteAsTextCommand.js","names":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_regeneratorDefine","enumerable","configurable","writable","_invoke","_OverloadYield","k","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","_classCallCheck","_defineProperties","_toPropertyKey","key","_createClass","_toPrimitive","_typeof","toPrimitive","String","Number","_callSuper","_getPrototypeOf","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","constructor","_assertThisInitialized","ReferenceError","Boolean","valueOf","_inherits","_setPrototypeOf","Command","PasteAsTextCommand","_Command","_execute","_regeneratorRuntime","mark","_callee","editor","plainText","wrap","_callee$","_context","prev","next","navigator","clipboard","readText","sent","model","change","writer","textNode","createText","insertContent","console","warn","t0","stop","execute","refresh","isEnabled"],"sources":["../../../../src/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.ts"],"sourcesContent":["import { Command } from 'ckeditor5'\n\nexport class PasteAsTextCommand extends Command {\n async execute() {\n const editor = this.editor\n\n try {\n if (navigator.clipboard && navigator.clipboard.readText) {\n const plainText = await navigator.clipboard.readText()\n\n if (plainText) {\n // Insert as plain text without any formatting\n editor.model.change((writer: any) => {\n const textNode = writer.createText(plainText)\n editor.model.insertContent(textNode)\n })\n }\n } else {\n console.warn('Clipboard API not available')\n }\n } catch (error) {\n console.warn('Clipboard API not available for text reading')\n }\n }\n\n refresh() {\n this.isEnabled = true\n }\n}\n"],"mappings":";;;;;;;0BACA,uKAAAA,CAAA,EAAAC,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WAAA,8BAAAC,EAAAN,CAAA,EAAAE,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAC,CAAA,GAAAL,CAAA,IAAAA,CAAA,CAAAM,SAAA,YAAAC,SAAA,GAAAP,CAAA,GAAAO,SAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,MAAA,CAAAL,CAAA,CAAAC,SAAA,UAAAK,mBAAA,CAAAH,CAAA,uBAAAV,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAE,CAAA,EAAAC,CAAA,EAAAG,CAAA,EAAAI,CAAA,MAAAC,CAAA,GAAAX,CAAA,QAAAY,CAAA,OAAAC,CAAA,KAAAF,CAAA,KAAAb,CAAA,KAAAgB,CAAA,EAAApB,CAAA,EAAAqB,CAAA,EAAAC,CAAA,EAAAN,CAAA,EAAAM,CAAA,CAAAC,IAAA,CAAAvB,CAAA,MAAAsB,CAAA,WAAAA,EAAArB,CAAA,EAAAC,CAAA,WAAAM,CAAA,GAAAP,CAAA,EAAAQ,CAAA,MAAAG,CAAA,GAAAZ,CAAA,EAAAmB,CAAA,CAAAf,CAAA,GAAAF,CAAA,EAAAmB,CAAA,gBAAAC,EAAApB,CAAA,EAAAE,CAAA,SAAAK,CAAA,GAAAP,CAAA,EAAAU,CAAA,GAAAR,CAAA,EAAAH,CAAA,OAAAiB,CAAA,IAAAF,CAAA,KAAAV,CAAA,IAAAL,CAAA,GAAAgB,CAAA,CAAAO,MAAA,EAAAvB,CAAA,UAAAK,CA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6BAA6B,CAAC;YAAA;cAAAd,QAAA,CAAAE,IAAA;cAAA;YAAA;cAAAF,QAAA,CAAAC,IAAA;cAAAD,QAAA,CAAAe,EAAA,GAAAf,QAAA;cAG7Ca,OAAO,CAACC,IAAI,CAAC,8CAA8C,CAAC;YAAA;YAAA;cAAA,OAAAd,QAAA,CAAAgB,IAAA;UAAA;QAAA,GAAArB,OAAA;MAAA,CAE/D;MAAA,SApBKsB,OAAOA,CAAA;QAAA,OAAAzB,QAAA,CAAA7B,KAAA,OAAAD,SAAA;MAAA;MAAA,OAAPuD,OAAO;IAAA;EAAA;IAAAhD,GAAA;IAAA9B,KAAA,EAsBb,SAAA+E,OAAOA,CAAA,EAAG;MACR,IAAI,CAACC,SAAS,GAAG,IAAI;IACvB;EAAC;AAAA,EAzBqC9B,OAAO"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), 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 _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
import { ButtonView, Plugin } from 'ckeditor5';
|
|
15
|
+
import { PasteAsTextCommand } from './PasteAsTextCommand';
|
|
16
|
+
export var PasteAsTextPlugin = /*#__PURE__*/function (_Plugin) {
|
|
17
|
+
function PasteAsTextPlugin() {
|
|
18
|
+
_classCallCheck(this, PasteAsTextPlugin);
|
|
19
|
+
return _callSuper(this, PasteAsTextPlugin, arguments);
|
|
20
|
+
}
|
|
21
|
+
_inherits(PasteAsTextPlugin, _Plugin);
|
|
22
|
+
return _createClass(PasteAsTextPlugin, [{
|
|
23
|
+
key: "init",
|
|
24
|
+
value: function init() {
|
|
25
|
+
var editor = this.editor;
|
|
26
|
+
|
|
27
|
+
// Add the paste as text command
|
|
28
|
+
editor.commands.add('pasteAsText', new PasteAsTextCommand(editor));
|
|
29
|
+
|
|
30
|
+
// Add the paste as text button to the toolbar
|
|
31
|
+
editor.ui.componentFactory.add('pasteAsText', function (locale) {
|
|
32
|
+
var _global$window$CKEDIT, _global$window$CKEDIT2;
|
|
33
|
+
var command = editor.commands.get('pasteAsText');
|
|
34
|
+
var buttonView = new ButtonView(locale);
|
|
35
|
+
buttonView.set({
|
|
36
|
+
label: (_global$window$CKEDIT = global.window.CKEDITOR_TRANSLATIONS[locale.contentLanguage]) === null || _global$window$CKEDIT === void 0 ? void 0 : (_global$window$CKEDIT2 = _global$window$CKEDIT.dictionary) === null || _global$window$CKEDIT2 === void 0 ? void 0 : _global$window$CKEDIT2.PasteAsText,
|
|
37
|
+
icon: '<svg></svg>',
|
|
38
|
+
tooltip: true
|
|
39
|
+
});
|
|
40
|
+
if (command) {
|
|
41
|
+
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
|
42
|
+
}
|
|
43
|
+
buttonView.on('execute', function () {
|
|
44
|
+
editor.execute('pasteAsText');
|
|
45
|
+
});
|
|
46
|
+
return buttonView;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}], [{
|
|
50
|
+
key: "pluginName",
|
|
51
|
+
get: function get() {
|
|
52
|
+
return 'PasteAsText';
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
}(Plugin);
|
|
56
|
+
//# sourceMappingURL=PasteAsTextPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasteAsTextPlugin.js","names":["ButtonView","Plugin","PasteAsTextCommand","PasteAsTextPlugin","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","commands","add","ui","componentFactory","locale","_global$window$CKEDIT","_global$window$CKEDIT2","command","get","buttonView","set","label","global","window","CKEDITOR_TRANSLATIONS","contentLanguage","dictionary","PasteAsText","icon","tooltip","bind","to","on","execute"],"sources":["../../../../src/NextTextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.ts"],"sourcesContent":["import { ButtonView, Plugin } from 'ckeditor5'\nimport { PasteAsTextCommand } from './PasteAsTextCommand'\n\nexport class PasteAsTextPlugin extends Plugin {\n static get pluginName() {\n return 'PasteAsText'\n }\n\n init() {\n const editor = this.editor\n\n // Add the paste as text command\n editor.commands.add('pasteAsText', new PasteAsTextCommand(editor))\n\n // Add the paste as text button to the toolbar\n editor.ui.componentFactory.add('pasteAsText', (locale) => {\n const command = editor.commands.get('pasteAsText')\n const buttonView = new ButtonView(locale)\n\n buttonView.set({\n label:\n global.window.CKEDITOR_TRANSLATIONS[locale.contentLanguage]\n ?.dictionary?.PasteAsText,\n icon: '<svg></svg>',\n tooltip: true,\n })\n\n if (command) {\n buttonView.bind('isEnabled').to(command, 'isEnabled')\n }\n\n buttonView.on('execute', () => {\n editor.execute('pasteAsText')\n })\n\n return buttonView\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,WAAW;AAC9C,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,WAAaC,iBAAiB,0BAAAC,OAAA;EAAA,SAAAD,kBAAA;IAAAE,eAAA,OAAAF,iBAAA;IAAA,OAAAG,UAAA,OAAAH,iBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,iBAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,iBAAA;IAAAO,GAAA;IAAAC,KAAA,EAK5B,SAAAC,IAAIA,CAAA,EAAG;MACL,IAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;;MAE1B;MACAA,MAAM,CAACC,QAAQ,CAACC,GAAG,CAAC,aAAa,EAAE,IAAIb,kBAAkB,CAACW,MAAM,CAAC,CAAC;;MAElE;MACAA,MAAM,CAACG,EAAE,CAACC,gBAAgB,CAACF,GAAG,CAAC,aAAa,EAAE,UAACG,MAAM,EAAK;QAAA,IAAAC,qBAAA,EAAAC,sBAAA;QACxD,IAAMC,OAAO,GAAGR,MAAM,CAACC,QAAQ,CAACQ,GAAG,CAAC,aAAa,CAAC;QAClD,IAAMC,UAAU,GAAG,IAAIvB,UAAU,CAACkB,MAAM,CAAC;QAEzCK,UAAU,CAACC,GAAG,CAAC;UACbC,KAAK,GAAAN,qBAAA,GACHO,MAAM,CAACC,MAAM,CAACC,qBAAqB,CAACV,MAAM,CAACW,eAAe,CAAC,cAAAV,qBAAA,wBAAAC,sBAAA,GAA3DD,qBAAA,CACIW,UAAU,cAAAV,sBAAA,uBADdA,sBAAA,CACgBW,WAAW;UAC7BC,IAAI,EAAE,aAAa;UACnBC,OAAO,EAAE;QACX,CAAC,CAAC;QAEF,IAAIZ,OAAO,EAAE;UACXE,UAAU,CAACW,IAAI,CAAC,WAAW,CAAC,CAACC,EAAE,CAACd,OAAO,EAAE,WAAW,CAAC;QACvD;QAEAE,UAAU,CAACa,EAAE,CAAC,SAAS,EAAE,YAAM;UAC7BvB,MAAM,CAACwB,OAAO,CAAC,aAAa,CAAC;QAC/B,CAAC,CAAC;QAEF,OAAOd,UAAU;MACnB,CAAC,CAAC;IACJ;EAAC;IAAAb,GAAA;IAAAY,GAAA,EAjCD,SAAAA,IAAA,EAAwB;MACtB,OAAO,aAAa;IACtB;EAAC;AAAA,EAHoCrB,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PasteAsTextPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/NextTextEditor/plugins/PasteAsTextPlugin/index.ts"],"sourcesContent":["export * from './PasteAsTextPlugin'\n"],"mappings":"AAAA,cAAc,qBAAqB"}
|
|
@@ -0,0 +1,149 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
3
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
4
|
+
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
5
|
+
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
6
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
7
|
+
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
8
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
9
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
|
|
10
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
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; } }
|
|
13
|
+
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; }
|
|
14
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
15
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
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); }
|
|
21
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
22
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
23
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
26
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
27
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
|
+
import { Command } from 'ckeditor5';
|
|
29
|
+
export var PasteCommand = /*#__PURE__*/function (_Command) {
|
|
30
|
+
function PasteCommand() {
|
|
31
|
+
_classCallCheck(this, PasteCommand);
|
|
32
|
+
return _callSuper(this, PasteCommand, arguments);
|
|
33
|
+
}
|
|
34
|
+
_inherits(PasteCommand, _Command);
|
|
35
|
+
return _createClass(PasteCommand, [{
|
|
36
|
+
key: "execute",
|
|
37
|
+
value: function () {
|
|
38
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
39
|
+
var editor, clipboardItems, _iterator, _step, clipboardItem, htmlBlob, htmlText, viewFragment, modelFragment, textBlob, plainText, _viewFragment, _modelFragment;
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
editor = this.editor;
|
|
44
|
+
_context.prev = 1;
|
|
45
|
+
if (!(navigator.clipboard && navigator.clipboard.read)) {
|
|
46
|
+
_context.next = 47;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
_context.next = 5;
|
|
50
|
+
return navigator.clipboard.read();
|
|
51
|
+
case 5:
|
|
52
|
+
clipboardItems = _context.sent;
|
|
53
|
+
_iterator = _createForOfIteratorHelper(clipboardItems);
|
|
54
|
+
_context.prev = 7;
|
|
55
|
+
_iterator.s();
|
|
56
|
+
case 9:
|
|
57
|
+
if ((_step = _iterator.n()).done) {
|
|
58
|
+
_context.next = 37;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
clipboardItem = _step.value;
|
|
62
|
+
if (!clipboardItem.types.includes('text/html')) {
|
|
63
|
+
_context.next = 23;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
_context.next = 14;
|
|
67
|
+
return clipboardItem.getType('text/html');
|
|
68
|
+
case 14:
|
|
69
|
+
htmlBlob = _context.sent;
|
|
70
|
+
_context.next = 17;
|
|
71
|
+
return htmlBlob.text();
|
|
72
|
+
case 17:
|
|
73
|
+
htmlText = _context.sent;
|
|
74
|
+
if (!htmlText) {
|
|
75
|
+
_context.next = 23;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
// Convert HTML to view using data processor
|
|
79
|
+
viewFragment = editor.data.processor.toView(htmlText); // Convert view to model
|
|
80
|
+
modelFragment = editor.data.toModel(viewFragment);
|
|
81
|
+
editor.model.insertContent(modelFragment);
|
|
82
|
+
return _context.abrupt("return");
|
|
83
|
+
case 23:
|
|
84
|
+
if (!clipboardItem.types.includes('text/plain')) {
|
|
85
|
+
_context.next = 35;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
_context.next = 26;
|
|
89
|
+
return clipboardItem.getType('text/plain');
|
|
90
|
+
case 26:
|
|
91
|
+
textBlob = _context.sent;
|
|
92
|
+
_context.next = 29;
|
|
93
|
+
return textBlob.text();
|
|
94
|
+
case 29:
|
|
95
|
+
plainText = _context.sent;
|
|
96
|
+
if (!plainText) {
|
|
97
|
+
_context.next = 35;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
// Convert plain text to view
|
|
101
|
+
_viewFragment = editor.data.processor.toView(plainText); // Convert view to model
|
|
102
|
+
_modelFragment = editor.data.toModel(_viewFragment);
|
|
103
|
+
editor.model.insertContent(_modelFragment);
|
|
104
|
+
return _context.abrupt("return");
|
|
105
|
+
case 35:
|
|
106
|
+
_context.next = 9;
|
|
107
|
+
break;
|
|
108
|
+
case 37:
|
|
109
|
+
_context.next = 42;
|
|
110
|
+
break;
|
|
111
|
+
case 39:
|
|
112
|
+
_context.prev = 39;
|
|
113
|
+
_context.t0 = _context["catch"](7);
|
|
114
|
+
_iterator.e(_context.t0);
|
|
115
|
+
case 42:
|
|
116
|
+
_context.prev = 42;
|
|
117
|
+
_iterator.f();
|
|
118
|
+
return _context.finish(42);
|
|
119
|
+
case 45:
|
|
120
|
+
_context.next = 48;
|
|
121
|
+
break;
|
|
122
|
+
case 47:
|
|
123
|
+
console.warn('Clipboard API not available');
|
|
124
|
+
case 48:
|
|
125
|
+
_context.next = 53;
|
|
126
|
+
break;
|
|
127
|
+
case 50:
|
|
128
|
+
_context.prev = 50;
|
|
129
|
+
_context.t1 = _context["catch"](1);
|
|
130
|
+
console.warn('Clipboard API not available');
|
|
131
|
+
case 53:
|
|
132
|
+
case "end":
|
|
133
|
+
return _context.stop();
|
|
134
|
+
}
|
|
135
|
+
}, _callee, this, [[1, 50], [7, 39, 42, 45]]);
|
|
136
|
+
}));
|
|
137
|
+
function execute() {
|
|
138
|
+
return _execute.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
return execute;
|
|
141
|
+
}()
|
|
142
|
+
}, {
|
|
143
|
+
key: "refresh",
|
|
144
|
+
value: function refresh() {
|
|
145
|
+
this.isEnabled = true;
|
|
146
|
+
}
|
|
147
|
+
}]);
|
|
148
|
+
}(Command);
|
|
149
|
+
//# sourceMappingURL=PasteCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasteCommand.js","names":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_regeneratorDefine","enumerable","configurable","writable","_invoke","_OverloadYield","k","_createForOfIteratorHelper","Array","isArray","_unsupportedIterableToArray","_n","F","s","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","_classCallCheck","_defineProperties","_toPropertyKey","key","_createClass","_toPrimitive","_typeof","toPrimitive","String","Number","_callSuper","_getPrototypeOf","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","_assertThisInitialized","ReferenceError","Boolean","valueOf","_inherits","_setPrototypeOf","Command","PasteCommand","_Command","_execute","_regeneratorRuntime","mark","_callee","editor","clipboardItems","_iterator","_step","clipboardItem","htmlBlob","htmlText","viewFragment","modelFragment","textBlob","plainText","_viewFragment","_modelFragment","wrap","_callee$","_context","prev","navigator","clipboard","read","sent","types","includes","getType","text","data","processor","toView","toModel","model","insertContent","abrupt","t0","finish","console","warn","t1","stop","execute","refresh","isEnabled"],"sources":["../../../../src/NextTextEditor/plugins/PastePlugin/PasteCommand.ts"],"sourcesContent":["import { Command } from 'ckeditor5'\n\nexport class PasteCommand extends Command {\n async execute() {\n const editor = this.editor\n\n try {\n if (navigator.clipboard && navigator.clipboard.read) {\n const clipboardItems = await navigator.clipboard.read()\n\n for (const clipboardItem of clipboardItems) {\n // Try to get HTML content first\n if (clipboardItem.types.includes('text/html')) {\n const htmlBlob = await clipboardItem.getType('text/html')\n const htmlText = await htmlBlob.text()\n\n if (htmlText) {\n // Convert HTML to view using data processor\n const viewFragment = editor.data.processor.toView(htmlText)\n\n // Convert view to model\n const modelFragment = editor.data.toModel(viewFragment)\n\n editor.model.insertContent(modelFragment)\n return\n }\n }\n\n // Fallback to plain text\n if (clipboardItem.types.includes('text/plain')) {\n const textBlob = await clipboardItem.getType('text/plain')\n const plainText = await textBlob.text()\n\n if (plainText) {\n // Convert plain text to view\n const viewFragment = editor.data.processor.toView(plainText)\n\n // Convert view to model\n const modelFragment = editor.data.toModel(viewFragment)\n\n editor.model.insertContent(modelFragment)\n return\n }\n }\n }\n } else {\n console.warn('Clipboard API not available')\n }\n } catch (error) {\n console.warn('Clipboard API not available')\n }\n }\n\n refresh() {\n this.isEnabled = true\n }\n}\n"],"mappings":";;;;;;;0BACA,uKAAAA,CAAA,EAAAC,CAAA,EAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,WAAA,8BAAAC,EAAAN,CAAA,EAAAE,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAC,CAAA,GAAAL,CAAA,IAAAA,CAAA,CAAAM,SAAA,YAAAC,SAAA,GAAAP,CAAA,GAAAO,SAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,MAAA,CAAAL,CAAA,CAAAC,SAAA,UAAAK,mBAAA,CAAAH,CAAA,uBAAAV,CAAA,EAAAE,CAAA,EAAAE,CAAA,QAAAE,CAAA,EAAAC,CAAA,EAAAG,CAAA,EAAAI,CAAA,MAAAC,CAAA,GAAAX,CAAA,QAAAY,CAAA,OAAAC,CAAA,KAAAF,CAAA,KAAAb,CAAA,KAAAgB,CAAA,EAAApB,CAAA,EAAAqB,CAAA,EAAAC,CAAA,EAAAN,CAAA,EAAAM,CAAA,CAAAC,IAAA,CAAAvB,CAAA,MAAAsB,CAAA,WAAAA,EAAArB,CAAA,EAAAC,CAAA,WAAAM,CAAA,GAAAP,CAAA,EAAAQ,CAAA,MAAAG,CAAA,GAAAZ,CAAA,EAAAmB,CAAA,CAAAf,CAA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AjB,QAAA,CAAAC,IAAA;cAAAd,SAAA,CAAAtF,CAAA;cAAA,OAAAmG,QAAA,CAAAkB,MAAA;YAAA;cAAAlB,QAAA,CAAA7D,IAAA;cAAA;YAAA;cAM/CgF,OAAO,CAACC,IAAI,CAAC,6BAA6B,CAAC;YAAA;cAAApB,QAAA,CAAA7D,IAAA;cAAA;YAAA;cAAA6D,QAAA,CAAAC,IAAA;cAAAD,QAAA,CAAAqB,EAAA,GAAArB,QAAA;cAG7CmB,OAAO,CAACC,IAAI,CAAC,6BAA6B,CAAC;YAAA;YAAA;cAAA,OAAApB,QAAA,CAAAsB,IAAA;UAAA;QAAA,GAAAtC,OAAA;MAAA,CAE9C;MAAA,SAhDKuC,OAAOA,CAAA;QAAA,OAAA1C,QAAA,CAAA5B,KAAA,OAAAD,SAAA;MAAA;MAAA,OAAPuE,OAAO;IAAA;EAAA;IAAAhE,GAAA;IAAA7C,KAAA,EAkDb,SAAA8G,OAAOA,CAAA,EAAG;MACR,IAAI,CAACC,SAAS,GAAG,IAAI;IACvB;EAAC;AAAA,EArD+B/C,OAAO"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), 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 _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
import { ButtonView, Plugin } from 'ckeditor5';
|
|
15
|
+
import { PasteCommand } from './PasteCommand';
|
|
16
|
+
export var PastePlugin = /*#__PURE__*/function (_Plugin) {
|
|
17
|
+
function PastePlugin() {
|
|
18
|
+
_classCallCheck(this, PastePlugin);
|
|
19
|
+
return _callSuper(this, PastePlugin, arguments);
|
|
20
|
+
}
|
|
21
|
+
_inherits(PastePlugin, _Plugin);
|
|
22
|
+
return _createClass(PastePlugin, [{
|
|
23
|
+
key: "init",
|
|
24
|
+
value: function init() {
|
|
25
|
+
var editor = this.editor;
|
|
26
|
+
|
|
27
|
+
// Add the paste command
|
|
28
|
+
editor.commands.add('paste', new PasteCommand(editor));
|
|
29
|
+
|
|
30
|
+
// Add the paste button to the toolbar
|
|
31
|
+
editor.ui.componentFactory.add('paste', function (locale) {
|
|
32
|
+
var _global$window$CKEDIT, _global$window$CKEDIT2;
|
|
33
|
+
var command = editor.commands.get('paste');
|
|
34
|
+
var buttonView = new ButtonView(locale);
|
|
35
|
+
buttonView.set({
|
|
36
|
+
label: (_global$window$CKEDIT = global.window.CKEDITOR_TRANSLATIONS[locale.contentLanguage]) === null || _global$window$CKEDIT === void 0 ? void 0 : (_global$window$CKEDIT2 = _global$window$CKEDIT.dictionary) === null || _global$window$CKEDIT2 === void 0 ? void 0 : _global$window$CKEDIT2.Paste,
|
|
37
|
+
icon: '<svg></svg>',
|
|
38
|
+
tooltip: true
|
|
39
|
+
});
|
|
40
|
+
if (command) {
|
|
41
|
+
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
|
42
|
+
}
|
|
43
|
+
buttonView.on('execute', function () {
|
|
44
|
+
editor.execute('paste');
|
|
45
|
+
});
|
|
46
|
+
return buttonView;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}], [{
|
|
50
|
+
key: "pluginName",
|
|
51
|
+
get: function get() {
|
|
52
|
+
return 'Paste';
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
}(Plugin);
|
|
56
|
+
//# sourceMappingURL=PastePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PastePlugin.js","names":["ButtonView","Plugin","PasteCommand","PastePlugin","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","commands","add","ui","componentFactory","locale","_global$window$CKEDIT","_global$window$CKEDIT2","command","get","buttonView","set","label","global","window","CKEDITOR_TRANSLATIONS","contentLanguage","dictionary","Paste","icon","tooltip","bind","to","on","execute"],"sources":["../../../../src/NextTextEditor/plugins/PastePlugin/PastePlugin.ts"],"sourcesContent":["import { ButtonView, Plugin } from 'ckeditor5'\nimport { PasteCommand } from './PasteCommand'\n\nexport class PastePlugin extends Plugin {\n static get pluginName() {\n return 'Paste'\n }\n\n init() {\n const editor = this.editor\n\n // Add the paste command\n editor.commands.add('paste', new PasteCommand(editor))\n\n // Add the paste button to the toolbar\n editor.ui.componentFactory.add('paste', (locale) => {\n const command = editor.commands.get('paste')\n const buttonView = new ButtonView(locale)\n\n buttonView.set({\n label:\n global.window.CKEDITOR_TRANSLATIONS[locale.contentLanguage]\n ?.dictionary?.Paste,\n icon: '<svg></svg>',\n tooltip: true,\n })\n\n if (command) {\n buttonView.bind('isEnabled').to(command, 'isEnabled')\n }\n\n buttonView.on('execute', () => {\n editor.execute('paste')\n })\n\n return buttonView\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,WAAW;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAE7C,WAAaC,WAAW,0BAAAC,OAAA;EAAA,SAAAD,YAAA;IAAAE,eAAA,OAAAF,WAAA;IAAA,OAAAG,UAAA,OAAAH,WAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,WAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,WAAA;IAAAO,GAAA;IAAAC,KAAA,EAKtB,SAAAC,IAAIA,CAAA,EAAG;MACL,IAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;;MAE1B;MACAA,MAAM,CAACC,QAAQ,CAACC,GAAG,CAAC,OAAO,EA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