@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,4 @@
|
|
|
1
|
+
export type { StickyToolbarState } from './StickyToolbar.types';
|
|
2
|
+
export { createStickyToolbar } from './StickyToolbar.utils';
|
|
3
|
+
export { useStickyToolbar } from './useStickyToolbar';
|
|
4
|
+
export type { UseStickyToolbarProps, UseStickyToolbarReturn, } from './useStickyToolbar.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["createStickyToolbar","useStickyToolbar"],"sources":["../../../src/NextTextEditor/StickyToolbar/index.ts"],"sourcesContent":["export type { StickyToolbarState } from './StickyToolbar.types'\nexport { createStickyToolbar } from './StickyToolbar.utils'\nexport { useStickyToolbar } from './useStickyToolbar'\nexport type {\n UseStickyToolbarProps,\n UseStickyToolbarReturn,\n} from './useStickyToolbar.types'\n"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,gBAAgB,QAAQ,oBAAoB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { useEffect, useMemo } from 'react';
|
|
8
|
+
import { createStickyToolbar } from './StickyToolbar.utils';
|
|
9
|
+
export function useStickyToolbar(_ref) {
|
|
10
|
+
var enabled = _ref.enabled,
|
|
11
|
+
editorRef = _ref.editorRef,
|
|
12
|
+
config = _ref.config,
|
|
13
|
+
editor = _ref.editor,
|
|
14
|
+
_ref$cssLoading = _ref.cssLoading,
|
|
15
|
+
cssLoading = _ref$cssLoading === void 0 ? false : _ref$cssLoading;
|
|
16
|
+
var enhancedConfig = useMemo(function () {
|
|
17
|
+
if (!enabled) {
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Disable CKEditor's built-in sticky toolbar
|
|
22
|
+
return _objectSpread(_objectSpread({}, config), {}, {
|
|
23
|
+
ui: _objectSpread(_objectSpread({}, config.ui), {}, {
|
|
24
|
+
viewportOffset: {
|
|
25
|
+
top: 10000,
|
|
26
|
+
right: 0,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
left: 0
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}, [enabled, config]);
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
if (!enabled || !editorRef.current || cssLoading) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Disable CKEditor's built-in sticky toolbar
|
|
39
|
+
if (editor !== null && editor !== void 0 && editor.ui.view.stickyPanel) {
|
|
40
|
+
editor.ui.view.stickyPanel.isActive = false;
|
|
41
|
+
}
|
|
42
|
+
var stickyToolbar = createStickyToolbar(editorRef.current);
|
|
43
|
+
return stickyToolbar.destroy;
|
|
44
|
+
}, [enabled, editorRef, editor, cssLoading]);
|
|
45
|
+
return {
|
|
46
|
+
config: enhancedConfig
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=useStickyToolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStickyToolbar.js","names":["useEffect","useMemo","createStickyToolbar","useStickyToolbar","_ref","enabled","editorRef","config","editor","_ref$cssLoading","cssLoading","enhancedConfig","_objectSpread","ui","viewportOffset","top","right","bottom","left","current","view","stickyPanel","isActive","stickyToolbar","destroy"],"sources":["../../../src/NextTextEditor/StickyToolbar/useStickyToolbar.ts"],"sourcesContent":["import { useEffect, useMemo } from 'react'\n\nimport { createStickyToolbar } from './StickyToolbar.utils'\nimport type {\n UseStickyToolbarProps,\n UseStickyToolbarReturn,\n} from './useStickyToolbar.types'\n\nexport function useStickyToolbar({\n enabled,\n editorRef,\n config,\n editor,\n cssLoading = false,\n}: UseStickyToolbarProps): UseStickyToolbarReturn {\n const enhancedConfig = useMemo(() => {\n if (!enabled) {\n return config\n }\n\n // Disable CKEditor's built-in sticky toolbar\n return {\n ...config,\n ui: {\n ...config.ui,\n viewportOffset: {\n top: 10000,\n right: 0,\n bottom: 0,\n left: 0,\n },\n },\n }\n }, [enabled, config])\n\n useEffect(() => {\n if (!enabled || !editorRef.current || cssLoading) {\n return\n }\n\n // Disable CKEditor's built-in sticky toolbar\n if (editor?.ui.view.stickyPanel) {\n editor.ui.view.stickyPanel.isActive = false\n }\n\n const stickyToolbar = createStickyToolbar(editorRef.current)\n return stickyToolbar.destroy\n }, [enabled, editorRef, editor, cssLoading])\n\n return { config: enhancedConfig }\n}\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAE1C,SAASC,mBAAmB,QAAQ,uBAAuB;AAM3D,OAAO,SAASC,gBAAgBA,CAAAC,IAAA,EAMkB;EAAA,IALhDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAAC,eAAA,GAAAL,IAAA,CACNM,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,KAAK,GAAAA,eAAA;EAElB,IAAME,cAAc,GAAGV,OAAO,CAAC,YAAM;IACnC,IAAI,CAACI,OAAO,EAAE;MACZ,OAAOE,MAAM;IACf;;IAEA;IACA,OAAAK,aAAA,CAAAA,aAAA,KACKL,MAAM;MACTM,EAAE,EAAAD,aAAA,CAAAA,aAAA,KACGL,MAAM,CAACM,EAAE;QACZC,cAAc,EAAE;UACdC,GAAG,EAAE,KAAK;UACVC,KAAK,EAAE,CAAC;UACRC,MAAM,EAAE,CAAC;UACTC,IAAI,EAAE;QACR;MAAC;IACF;EAEL,CAAC,EAAE,CAACb,OAAO,EAAEE,MAAM,CAAC,CAAC;EAErBP,SAAS,CAAC,YAAM;IACd,IAAI,CAACK,OAAO,IAAI,CAACC,SAAS,CAACa,OAAO,IAAIT,UAAU,EAAE;MAChD;IACF;;IAEA;IACA,IAAIF,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEK,EAAE,CAACO,IAAI,CAACC,WAAW,EAAE;MAC/Bb,MAAM,CAACK,EAAE,CAACO,IAAI,CAACC,WAAW,CAACC,QAAQ,GAAG,KAAK;IAC7C;IAEA,IAAMC,aAAa,GAAGrB,mBAAmB,CAACI,SAAS,CAACa,OAAO,CAAC;IAC5D,OAAOI,aAAa,CAACC,OAAO;EAC9B,CAAC,EAAE,CAACnB,OAAO,EAAEC,SAAS,EAAEE,MAAM,EAAEE,UAAU,CAAC,CAAC;EAE5C,OAAO;IAAEH,MAAM,EAAEI;EAAe,CAAC;AACnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ClassicEditor, EditorConfig } from 'ckeditor5';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
|
+
export interface UseStickyToolbarProps {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
editorRef: RefObject<HTMLDivElement>;
|
|
6
|
+
config: EditorConfig;
|
|
7
|
+
editor?: ClassicEditor | null;
|
|
8
|
+
cssLoading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseStickyToolbarReturn {
|
|
11
|
+
config: EditorConfig;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStickyToolbar.types.js","names":[],"sources":["../../../src/NextTextEditor/StickyToolbar/useStickyToolbar.types.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport type { RefObject } from 'react'\n\nexport interface UseStickyToolbarProps {\n enabled: boolean\n editorRef: RefObject<HTMLDivElement>\n config: EditorConfig\n editor?: ClassicEditor | null\n cssLoading?: boolean\n}\n\nexport interface UseStickyToolbarReturn {\n config: EditorConfig\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["NextTextEditor"],"sources":["../../src/NextTextEditor/index.ts"],"sourcesContent":["export { NextTextEditor } from './NextTextEditor'\nexport * from './NextTextEditor.types'\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,cAAc,wBAAwB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DEV_CK_EDITOR_LICENSE_KEY = "eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NzQzOTY3OTksImp0aSI6IjE5OGE3YzVmLTkzMDEtNDI4ZC04MDBkLTI3ODQzMWNjMWFhNyIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsic2giLCJkcnVwYWwiXSwid2hpdGVMYWJlbCI6dHJ1ZSwibGljZW5zZVR5cGUiOiJkZXZlbG9wbWVudCIsImZlYXR1cmVzIjpbIkRSVVAiLCJETyIsIkZQIiwiU0MiLCJUT0MiLCJUUEwiLCJQT0UiLCJDQyIsIk1GIiwiU0VFIiwiRUNIIiwiRUlTIiwiTUxMIl0sInZjIjoiOGExYzM1YzkifQ.aWj6JvSWU5pe23uotIIJAtM0vo6Rc4bDUuKIJPCwEI4F70gtB5MrR3-fBI8dQpBUDhe5vL7wFBq0EdoCdMJ9TQ";
|
|
2
|
+
export declare const CK_EDITOR_LICENSE_KEY = "eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NzQzOTY3OTksImp0aSI6ImEyOTVlM2M0LTdlNzMtNDBiNC1hNWI3LTZhNmNmNDFkYzlkNiIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsic2giLCJkcnVwYWwiXSwid2hpdGVMYWJlbCI6dHJ1ZSwiZmVhdHVyZXMiOlsiRFJVUCIsIkRPIiwiRlAiLCJTQyIsIlRPQyIsIlRQTCIsIlBPRSIsIkNDIiwiTUYiLCJTRUUiLCJFQ0giLCJFSVMiLCJNTEwiXSwidmMiOiI4MzU4Nzg0NyJ9.IP1OzVjd-e297egGXW2SnaAmQFl1flhb0kYSv1M4JlKkrmbcVhJLSHvtV5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.js","names":["DEV_CK_EDITOR_LICENSE_KEY","CK_EDITOR_LICENSE_KEY"],"sources":["../../src/NextTextEditor/license_key.ts"],"sourcesContent":["export const DEV_CK_EDITOR_LICENSE_KEY =\n 'eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NzQzOTY3OTksImp0aSI6IjE5OGE3YzVmLTkzMDEtNDI4ZC04MDBkLTI3ODQzMWNjMWFhNyIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsic2giLCJkcnVwYWwiXSwid2hpdGVMYWJlbCI6dHJ1ZSwibGljZW5zZVR5cGUiOiJkZXZlbG9wbWVudCIsImZlYXR1cmVzIjpbIkRSVVAiLCJETyIsIkZQIiwiU0MiLCJUT0MiLCJUUEwiLCJQT0UiLCJDQyIsIk1GIiwiU0VFIiwiRUNIIiwiRUlTIiwiTUxMIl0sInZjIjoiOGExYzM1YzkifQ.aWj6JvSWU5pe23uotIIJAtM0vo6Rc4bDUuKIJPCwEI4F70gtB5MrR3-fBI8dQpBUDhe5vL7wFBq0EdoCdMJ9TQ'\n\nexport const CK_EDITOR_LICENSE_KEY =\n 'eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NzQzOTY3OTksImp0aSI6ImEyOTVlM2M0LTdlNzMtNDBiNC1hNWI3LTZhNmNmNDFkYzlkNiIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsic2giLCJkcnVwYWwiXSwid2hpdGVMYWJlbCI6dHJ1ZSwiZmVhdHVyZXMiOlsiRFJVUCIsIkRPIiwiRlAiLCJTQyIsIlRPQyIsIlRQTCIsIlBPRSIsIkNDIiwiTUYiLCJTRUUiLCJFQ0giLCJFSVMiLCJNTEwiXSwidmMiOiI4MzU4Nzg0NyJ9.IP1OzVjd-e297egGXW2SnaAmQFl1flhb0kYSv1M4JlKkrmbcVhJLSHvtV5jiwVTegeBkSQZyO6r-1E4OJ-O76g'\n"],"mappings":"AAAA,OAAO,IAAMA,yBAAyB,GACpC,4bAA4b;AAE9b,OAAO,IAAMC,qBAAqB,GAChC,sZAAsZ"}
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
import sanitizeHtml from 'sanitize-html';
|
|
27
|
+
export var CutCommand = /*#__PURE__*/function (_Command) {
|
|
28
|
+
function CutCommand() {
|
|
29
|
+
_classCallCheck(this, CutCommand);
|
|
30
|
+
return _callSuper(this, CutCommand, arguments);
|
|
31
|
+
}
|
|
32
|
+
_inherits(CutCommand, _Command);
|
|
33
|
+
return _createClass(CutCommand, [{
|
|
34
|
+
key: "execute",
|
|
35
|
+
value: function () {
|
|
36
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
|
+
var model, selection, selectedContent, viewFragment, clipboardHtml;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
model = this.editor.model;
|
|
42
|
+
selection = model.document.selection;
|
|
43
|
+
if (!selection.isCollapsed) {
|
|
44
|
+
_context.next = 4;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
return _context.abrupt("return");
|
|
48
|
+
case 4:
|
|
49
|
+
// Get selected content
|
|
50
|
+
selectedContent = model.getSelectedContent(selection); // Convert to view fragment
|
|
51
|
+
viewFragment = this.editor.data.toView(selectedContent); // Convert view to HTML string using data processor
|
|
52
|
+
clipboardHtml = this.editor.data.processor.toData(viewFragment); // Copy to clipboard
|
|
53
|
+
if (!navigator.clipboard) {
|
|
54
|
+
_context.next = 16;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
_context.prev = 8;
|
|
58
|
+
_context.next = 11;
|
|
59
|
+
return navigator.clipboard.write([new ClipboardItem({
|
|
60
|
+
'text/html': new Blob([clipboardHtml], {
|
|
61
|
+
type: 'text/html'
|
|
62
|
+
}),
|
|
63
|
+
'text/plain': new Blob([sanitizeHtml(clipboardHtml, {
|
|
64
|
+
allowedTags: [],
|
|
65
|
+
allowedAttributes: {}
|
|
66
|
+
})], {
|
|
67
|
+
type: 'text/plain'
|
|
68
|
+
})
|
|
69
|
+
})]);
|
|
70
|
+
case 11:
|
|
71
|
+
_context.next = 16;
|
|
72
|
+
break;
|
|
73
|
+
case 13:
|
|
74
|
+
_context.prev = 13;
|
|
75
|
+
_context.t0 = _context["catch"](8);
|
|
76
|
+
console.warn('Failed to copy to clipboard:', _context.t0);
|
|
77
|
+
case 16:
|
|
78
|
+
// Delete selected content
|
|
79
|
+
model.deleteContent(selection);
|
|
80
|
+
case 17:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context.stop();
|
|
83
|
+
}
|
|
84
|
+
}, _callee, this, [[8, 13]]);
|
|
85
|
+
}));
|
|
86
|
+
function execute() {
|
|
87
|
+
return _execute.apply(this, arguments);
|
|
88
|
+
}
|
|
89
|
+
return execute;
|
|
90
|
+
}()
|
|
91
|
+
}, {
|
|
92
|
+
key: "refresh",
|
|
93
|
+
value: function refresh() {
|
|
94
|
+
var selection = this.editor.model.document.selection;
|
|
95
|
+
this.isEnabled = !selection.isCollapsed;
|
|
96
|
+
}
|
|
97
|
+
}]);
|
|
98
|
+
}(Command);
|
|
99
|
+
//# sourceMappingURL=CutCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CutCommand.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","sanitizeHtml","CutCommand","_Command","_execute","_regeneratorRuntime","mark","_callee","model","selection","selectedContent","viewFragment","clipboardHtml","wrap","_callee$","_context","prev","next","editor","document","isCollapsed","abrupt","getSelectedContent","data","toView","processor","toData","navigator","clipboard","write","ClipboardItem","Blob","type","allowedTags","allowedAttributes","t0","console","warn","deleteContent","stop","execute","refresh","isEnabled"],"sources":["../../../../src/NextTextEditor/plugins/CutPlugin/CutCommand.ts"],"sourcesContent":["import { Command } from 'ckeditor5'\nimport sanitizeHtml from 'sanitize-html'\n\nexport class CutCommand extends Command {\n async execute() {\n const model = this.editor.model\n const selection = model.document.selection\n\n if (selection.isCollapsed) {\n return\n }\n\n // Get selected content\n const selectedContent = model.getSelectedContent(selection)\n\n // Convert to view fragment\n const viewFragment = this.editor.data.toView(selectedContent)\n\n // Convert view to HTML string using data processor\n const clipboardHtml = this.editor.data.processor.toData(viewFragment)\n\n // Copy to clipboard\n if (navigator.clipboard) {\n try {\n await navigator.clipboard.write([\n new ClipboardItem({\n 'text/html': new Blob([clipboardHtml], { type: 'text/html' }),\n 'text/plain': new Blob(\n [\n sanitizeHtml(clipboardHtml, {\n allowedTags: [],\n allowedAttributes: {},\n }),\n ],\n {\n type: 'text/plain',\n }\n ),\n }),\n ])\n } catch (error) {\n console.warn('Failed to copy to clipboard:', error)\n }\n }\n\n // Delete selected content\n model.deleteContent(selection)\n }\n\n refresh() {\n const selection = this.editor.model.document.selection\n this.isEnabled = !selection.isCollapsed\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,CAA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,EAAAtB,QAAA,CAAAoB,EAAO,CAAC;YAAA;cAIvD;cACA3B,KAAK,CAAC8B,aAAa,CAAC7B,SAAS,CAAC;YAAA;YAAA;cAAA,OAAAM,QAAA,CAAAwB,IAAA;UAAA;QAAA,GAAAhC,OAAA;MAAA,CAC/B;MAAA,SA3CKiC,OAAOA,CAAA;QAAA,OAAApC,QAAA,CAAA9B,KAAA,OAAAD,SAAA;MAAA;MAAA,OAAPmE,OAAO;IAAA;EAAA;IAAA5D,GAAA;IAAA9B,KAAA,EA6Cb,SAAA2F,OAAOA,CAAA,EAAG;MACR,IAAMhC,SAAS,GAAG,IAAI,CAACS,MAAM,CAACV,KAAK,CAACW,QAAQ,CAACV,SAAS;MACtD,IAAI,CAACiC,SAAS,GAAG,CAACjC,SAAS,CAACW,WAAW;IACzC;EAAC;AAAA,EAjD6BpB,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 { CutCommand } from './CutCommand';
|
|
16
|
+
export var CutPlugin = /*#__PURE__*/function (_Plugin) {
|
|
17
|
+
function CutPlugin() {
|
|
18
|
+
_classCallCheck(this, CutPlugin);
|
|
19
|
+
return _callSuper(this, CutPlugin, arguments);
|
|
20
|
+
}
|
|
21
|
+
_inherits(CutPlugin, _Plugin);
|
|
22
|
+
return _createClass(CutPlugin, [{
|
|
23
|
+
key: "init",
|
|
24
|
+
value: function init() {
|
|
25
|
+
var editor = this.editor;
|
|
26
|
+
|
|
27
|
+
// Add the cut command
|
|
28
|
+
editor.commands.add('cut', new CutCommand(editor));
|
|
29
|
+
|
|
30
|
+
// Add the cut button to the toolbar
|
|
31
|
+
editor.ui.componentFactory.add('cut', function (locale) {
|
|
32
|
+
var _global$window$CKEDIT, _global$window$CKEDIT2;
|
|
33
|
+
var command = editor.commands.get('cut');
|
|
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.Cut,
|
|
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('cut');
|
|
45
|
+
});
|
|
46
|
+
return buttonView;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}], [{
|
|
50
|
+
key: "pluginName",
|
|
51
|
+
get: function get() {
|
|
52
|
+
return 'Cut';
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
}(Plugin);
|
|
56
|
+
//# sourceMappingURL=CutPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CutPlugin.js","names":["ButtonView","Plugin","CutCommand","CutPlugin","_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","Cut","icon","tooltip","bind","to","on","execute"],"sources":["../../../../src/NextTextEditor/plugins/CutPlugin/CutPlugin.ts"],"sourcesContent":["import { ButtonView, Plugin } from 'ckeditor5'\nimport { CutCommand } from './CutCommand'\n\nexport class CutPlugin extends Plugin {\n static get pluginName() {\n return 'Cut'\n }\n\n init() {\n const editor = this.editor\n\n // Add the cut command\n editor.commands.add('cut', new CutCommand(editor))\n\n // Add the cut button to the toolbar\n editor.ui.componentFactory.add('cut', (locale) => {\n const command = editor.commands.get('cut')\n const buttonView = new ButtonView(locale)\n buttonView.set({\n label:\n global.window.CKEDITOR_TRANSLATIONS[locale.contentLanguage]\n ?.dictionary?.Cut,\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('cut')\n })\n\n return buttonView\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,WAAW;AAC9C,SAASC,UAAU,QAAQ,cAAc;AAEzC,WAAaC,SAAS,0BAAAC,OAAA;EAAA,SAAAD,UAAA;IAAAE,eAAA,OAAAF,SAAA;IAAA,OAAAG,UAAA,OAAAH,SAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,SAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,SAAA;IAAAO,GAAA;IAAAC,KAAA,EAKpB,SAAAC,IAAIA,CAAA,EAAG;MACL,IAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;;MAE1B;MACAA,MAAM,CAACC,QAAQ,CAACC,GAAG,CAAC,KAAK,EAAE,IAAIb,UAAU,CAACW,MAAM,CAAC,CAAC;;MAElD;MACAA,MAAM,CAACG,EAAE,CAACC,gBAAgB,CAACF,GAAG,CAAC,KAAK,EAAE,UAACG,MAAM,EAAK;QAAA,IAAAC,qBAAA,EAAAC,sBAAA;QAChD,IAAMC,OAAO,GAAGR,MAAM,CAACC,QAAQ,CAACQ,GAAG,CAAC,KAAK,CAAC;QAC1C,IAAMC,UAAU,GAAG,IAAIvB,UAAU,CAACkB,MAAM,CAAC;QACzCK,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,GAAG;UACrBC,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,KAAK,CAAC;QACvB,CAAC,CAAC;QAEF,OAAOd,UAAU;MACnB,CAAC,CAAC;IACJ;EAAC;IAAAb,GAAA;IAAAY,GAAA,EAhCD,SAAAA,IAAA,EAAwB;MACtB,OAAO,KAAK;IACd;EAAC;AAAA,EAH4BrB,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CutPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/NextTextEditor/plugins/CutPlugin/index.ts"],"sourcesContent":["export * from './CutPlugin'\n"],"mappings":"AAAA,cAAc,aAAa"}
|
package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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 { Plugin } from 'ckeditor5';
|
|
15
|
+
|
|
16
|
+
// Convert paragraph padding-left to margin-left to maintain compatibility with TinyMCE editor output
|
|
17
|
+
export var IndentPaddingToMarginPlugin = /*#__PURE__*/function (_Plugin) {
|
|
18
|
+
function IndentPaddingToMarginPlugin() {
|
|
19
|
+
_classCallCheck(this, IndentPaddingToMarginPlugin);
|
|
20
|
+
return _callSuper(this, IndentPaddingToMarginPlugin, arguments);
|
|
21
|
+
}
|
|
22
|
+
_inherits(IndentPaddingToMarginPlugin, _Plugin);
|
|
23
|
+
return _createClass(IndentPaddingToMarginPlugin, [{
|
|
24
|
+
key: "init",
|
|
25
|
+
value: function init() {
|
|
26
|
+
var editor = this.editor;
|
|
27
|
+
var originalToView = editor.data.processor.toView.bind(editor.data.processor);
|
|
28
|
+
editor.data.processor.toView = function (data) {
|
|
29
|
+
var convertedData = data.replace(/<p([^>]*style="[^"]*?)padding-left:\s*([^;]+)(;?)([^"]*"[^>]*>)/gi, '<p$1margin-left: $2$3$4');
|
|
30
|
+
return originalToView(convertedData);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}], [{
|
|
34
|
+
key: "pluginName",
|
|
35
|
+
get: function get() {
|
|
36
|
+
return 'IndentPaddingToMargin';
|
|
37
|
+
}
|
|
38
|
+
}]);
|
|
39
|
+
}(Plugin);
|
|
40
|
+
//# sourceMappingURL=IndentPaddingToMarginPlugin.js.map
|
package/dist/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndentPaddingToMarginPlugin.js","names":["Plugin","IndentPaddingToMarginPlugin","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","originalToView","data","processor","toView","bind","convertedData","replace","get"],"sources":["../../../../src/NextTextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.ts"],"sourcesContent":["import { Plugin } from 'ckeditor5'\n\n// Convert paragraph padding-left to margin-left to maintain compatibility with TinyMCE editor output\nexport class IndentPaddingToMarginPlugin extends Plugin {\n static get pluginName() {\n return 'IndentPaddingToMargin'\n }\n\n init() {\n const editor = this.editor\n const originalToView = editor.data.processor.toView.bind(\n editor.data.processor\n )\n editor.data.processor.toView = (data: string) => {\n const convertedData = data.replace(\n /<p([^>]*style=\"[^\"]*?)padding-left:\\s*([^;]+)(;?)([^\"]*\"[^>]*>)/gi,\n '<p$1margin-left: $2$3$4'\n )\n return originalToView(convertedData)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,MAAM,QAAQ,WAAW;;AAElC;AACA,WAAaC,2BAA2B,0BAAAC,OAAA;EAAA,SAAAD,4BAAA;IAAAE,eAAA,OAAAF,2BAAA;IAAA,OAAAG,UAAA,OAAAH,2BAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,2BAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,2BAAA;IAAAO,GAAA;IAAAC,KAAA,EAKtC,SAAAC,IAAIA,CAAA,EAAG;MACL,IAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;MAC1B,IAAMC,cAAc,GAAGD,MAAM,CAACE,IAAI,CAACC,SAAS,CAACC,MAAM,CAACC,IAAI,CACtDL,MAAM,CAACE,IAAI,CAACC,SACd,CAAC;MACDH,MAAM,CAACE,IAAI,CAACC,SAAS,CAACC,MAAM,GAAG,UAACF,IAAY,EAAK;QAC/C,IAAMI,aAAa,GAAGJ,IAAI,CAACK,OAAO,CAChC,mEAAmE,EACnE,yBACF,CAAC;QACD,OAAON,cAAc,CAACK,aAAa,CAAC;MACtC,CAAC;IACH;EAAC;IAAAT,GAAA;IAAAW,GAAA,EAhBD,SAAAA,IAAA,EAAwB;MACtB,OAAO,uBAAuB;IAChC;EAAC;AAAA,EAH8CnB,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './IndentPaddingToMarginPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/NextTextEditor/plugins/IndentPaddingToMarginPlugin/index.ts"],"sourcesContent":["export * from './IndentPaddingToMarginPlugin'\n"],"mappings":"AAAA,cAAc,+BAA+B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Clipboard, Plugin } from 'ckeditor5';
|
|
2
|
+
export interface LegacyPasteAdapterOptions {
|
|
3
|
+
convertPreToParagraph?: boolean;
|
|
4
|
+
stripImagesOnPaste?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare module 'ckeditor5' {
|
|
7
|
+
interface EditorConfig {
|
|
8
|
+
legacyTinymce?: LegacyPasteAdapterOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare class LegacyPasteAdapter extends Plugin {
|
|
12
|
+
editor: any;
|
|
13
|
+
static get requires(): (typeof Clipboard)[];
|
|
14
|
+
init(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
// A CKEditor 5 plugin that emulates TinyMCE paste_preprocess logic.
|
|
15
|
+
// It replaces <pre> with <p> and strips <img> tags from pasted HTML.
|
|
16
|
+
|
|
17
|
+
import { Clipboard, Plugin } from 'ckeditor5';
|
|
18
|
+
|
|
19
|
+
// Extend CKEditor config to pass options into this plugin.
|
|
20
|
+
|
|
21
|
+
export var LegacyPasteAdapter = /*#__PURE__*/function (_Plugin) {
|
|
22
|
+
function LegacyPasteAdapter() {
|
|
23
|
+
_classCallCheck(this, LegacyPasteAdapter);
|
|
24
|
+
return _callSuper(this, LegacyPasteAdapter, arguments);
|
|
25
|
+
}
|
|
26
|
+
_inherits(LegacyPasteAdapter, _Plugin);
|
|
27
|
+
return _createClass(LegacyPasteAdapter, [{
|
|
28
|
+
key: "init",
|
|
29
|
+
value: function init() {
|
|
30
|
+
var editor = this.editor;
|
|
31
|
+
// Read plugin options injected by the legacy adapter.
|
|
32
|
+
var opts = editor.config.get('legacyTinymce') || {};
|
|
33
|
+
var viewDocument = editor.editing.view.document;
|
|
34
|
+
console.debug('[LegacyPasteAdapter] init', editor.config.get('legacyTinymce'));
|
|
35
|
+
|
|
36
|
+
// Intercept raw clipboard HTML before CKEditor upcasts it.
|
|
37
|
+
viewDocument.on('clipboardInput', function (evt, data) {
|
|
38
|
+
var _data$dataTransfer;
|
|
39
|
+
var html = data === null || data === void 0 ? void 0 : (_data$dataTransfer = data.dataTransfer) === null || _data$dataTransfer === void 0 ? void 0 : _data$dataTransfer.getData('text/html');
|
|
40
|
+
if (!html) return;
|
|
41
|
+
var out = html;
|
|
42
|
+
// Optional: turn <pre> blocks into <p> to mirror TinyMCE behavior.
|
|
43
|
+
if (opts.convertPreToParagraph) {
|
|
44
|
+
out = out.replace(/<pre>/gi, '<p>').replace(/<\/pre>/gi, '</p>');
|
|
45
|
+
}
|
|
46
|
+
// Optional: remove any <img> tags from the pasted content.
|
|
47
|
+
if (opts.stripImagesOnPaste) {
|
|
48
|
+
out = out.replace(/<img[^>]*>/gi, '');
|
|
49
|
+
}
|
|
50
|
+
// Write the transformed HTML back so the normal pipeline consumes it.
|
|
51
|
+
data.dataTransfer.setData('text/html', out);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}], [{
|
|
55
|
+
key: "requires",
|
|
56
|
+
get:
|
|
57
|
+
// Accessed from Plugin; kept as any to avoid tight type coupling.
|
|
58
|
+
|
|
59
|
+
// Require Clipboard to hook into the paste pipeline.
|
|
60
|
+
function get() {
|
|
61
|
+
return [Clipboard];
|
|
62
|
+
}
|
|
63
|
+
}]);
|
|
64
|
+
}(Plugin);
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Clipboard","Plugin","LegacyPasteAdapter","_Plugin","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","init","editor","opts","config","get","viewDocument","editing","view","document","console","debug","on","evt","data","_data$dataTransfer","html","dataTransfer","getData","out","convertPreToParagraph","replace","stripImagesOnPaste","setData"],"sources":["../../../../src/NextTextEditor/plugins/LegacyPasteAdapter/index.ts"],"sourcesContent":["// A CKEditor 5 plugin that emulates TinyMCE paste_preprocess logic.\n// It replaces <pre> with <p> and strips <img> tags from pasted HTML.\n\nimport { Clipboard, Plugin } from 'ckeditor5'\n\nexport interface LegacyPasteAdapterOptions {\n convertPreToParagraph?: boolean\n stripImagesOnPaste?: boolean\n}\n\n// Extend CKEditor config to pass options into this plugin.\ndeclare module 'ckeditor5' {\n interface EditorConfig {\n legacyTinymce?: LegacyPasteAdapterOptions\n }\n}\n\nexport class LegacyPasteAdapter extends Plugin {\n // Accessed from Plugin; kept as any to avoid tight type coupling.\n editor: any\n // Require Clipboard to hook into the paste pipeline.\n public static get requires() {\n return [Clipboard]\n }\n\n public init(): void {\n const editor = this.editor\n // Read plugin options injected by the legacy adapter.\n const opts = editor.config.get('legacyTinymce') || {}\n\n const viewDocument = editor.editing.view.document\n console.debug(\n '[LegacyPasteAdapter] init',\n editor.config.get('legacyTinymce')\n )\n\n // Intercept raw clipboard HTML before CKEditor upcasts it.\n viewDocument.on('clipboardInput', (evt: unknown, data: any) => {\n const html: string | undefined = data?.dataTransfer?.getData('text/html')\n if (!html) return\n\n let out = html\n // Optional: turn <pre> blocks into <p> to mirror TinyMCE behavior.\n if (opts.convertPreToParagraph) {\n out = out.replace(/<pre>/gi, '<p>').replace(/<\\/pre>/gi, '</p>')\n }\n // Optional: remove any <img> tags from the pasted content.\n if (opts.stripImagesOnPaste) {\n out = out.replace(/<img[^>]*>/gi, '')\n }\n // Write the transformed HTML back so the normal pipeline consumes it.\n data.dataTransfer.setData('text/html', out)\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,WAAW;;AAO7C;;AAOA,WAAaC,kBAAkB,0BAAAC,OAAA;EAAA,SAAAD,mBAAA;IAAAE,eAAA,OAAAF,kBAAA;IAAA,OAAAG,UAAA,OAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,kBAAA,EAAAC,OAAA;EAAA,OAAAK,YAAA,CAAAN,kBAAA;IAAAO,GAAA;IAAAC,KAAA,EAQ7B,SAAOC,IAAIA,CAAA,EAAS;MAClB,IAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;MAC1B;MACA,IAAMC,IAAI,GAAGD,MAAM,CAACE,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;MAErD,IAAMC,YAAY,GAAGJ,MAAM,CAACK,OAAO,CAACC,IAAI,CAACC,QAAQ;MACjDC,OAAO,CAACC,KAAK,CACX,2BAA2B,EAC3BT,MAAM,CAACE,MAAM,CAACC,GAAG,CAAC,eAAe,CACnC,CAAC;;MAED;MACAC,YAAY,CAACM,EAAE,CAAC,gBAAgB,EAAE,UAACC,GAAY,EAAEC,IAAS,EAAK;QAAA,IAAAC,kBAAA;QAC7D,IAAMC,IAAwB,GAAGF,IAAI,aAAJA,IAAI,wBAAAC,kBAAA,GAAJD,IAAI,CAAEG,YAAY,cAAAF,kBAAA,uBAAlBA,kBAAA,CAAoBG,OAAO,CAAC,WAAW,CAAC;QACzE,IAAI,CAACF,IAAI,EAAE;QAEX,IAAIG,GAAG,GAAGH,IAAI;QACd;QACA,IAAIb,IAAI,CAACiB,qBAAqB,EAAE;UAC9BD,GAAG,GAAGA,GAAG,CAACE,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAACA,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;QAClE;QACA;QACA,IAAIlB,IAAI,CAACmB,kBAAkB,EAAE;UAC3BH,GAAG,GAAGA,GAAG,CAACE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;QACvC;QACA;QACAP,IAAI,CAACG,YAAY,CAACM,OAAO,CAAC,WAAW,EAAEJ,GAAG,CAAC;MAC7C,CAAC,CAAC;IACJ;EAAC;IAAApB,GAAA;IAAAM,GAAA;IAnCD;;IAEA;IACA,SAAAA,IAAA,EAA6B;MAC3B,OAAO,CAACf,SAAS,CAAC;IACpB;EAAC;AAAA,EANqCC,MAAM"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditorConfig } from 'ckeditor5';
|
|
2
|
+
export declare type LegacyTinyMceLike = {
|
|
3
|
+
paste_data_images?: boolean;
|
|
4
|
+
paste_preprocess?: (...args: any[]) => void;
|
|
5
|
+
plugins?: string | string[];
|
|
6
|
+
contextmenu?: string | false | string[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare function isLegacyTinyMceConfig(obj: unknown): obj is LegacyTinyMceLike;
|
|
10
|
+
/** @deprecated Temporary TinyMCE→CKEditor compatibility.
|
|
11
|
+
* TODO: Remove after decommission deadline.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyLegacyTinyMceCompatibility(base: EditorConfig, maybeLegacy: unknown): EditorConfig;
|