@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
|
@@ -6,26 +6,26 @@ import { getFocus } from '../_styles/mixins';
|
|
|
6
6
|
import { spacing } from '../_styles/spacing';
|
|
7
7
|
export var StyledMultiSelectValues = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledMultiSelectValues",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_26_1__sc-s9ym9q-0"
|
|
10
10
|
})(["display:flex;flex-wrap:wrap;margin-bottom:2px;margin-left:", "px;margin-right:", "px;margin-top:2px;min-width:0;width:100%;"], spacing.md, spacing.xs);
|
|
11
11
|
export var StyledMultiSelectToken = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledMultiSelectToken",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_26_1__sc-s9ym9q-1"
|
|
14
14
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:0 1 auto;> div{max-width:178px;width:100%;}"], spacing.xs);
|
|
15
15
|
export var StyledMultiSelectSearchInput = /*#__PURE__*/styled.input.withConfig({
|
|
16
16
|
displayName: "StyledMultiSelectSearchInput",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_26_1__sc-s9ym9q-2"
|
|
18
18
|
})(["background-color:transparent;border-width:0;font-family:inherit;padding:0;height:24px;width:100%;", " ", " &::-ms-clear{display:none;}&:focus{box-shadow:none;outline:none;}&::placeholder{color:", ";}"], getTypographyIntent('body'), function (_ref) {
|
|
19
19
|
var $isNavigatingTokens = _ref.$isNavigatingTokens;
|
|
20
20
|
return $isNavigatingTokens && css(["color:transparent;"]);
|
|
21
21
|
}, colors.gray45);
|
|
22
22
|
export var StyledMultiSelectSearch = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
displayName: "StyledMultiSelectSearch",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_26_1__sc-s9ym9q-3"
|
|
25
25
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:1;max-width:100%;min-width:24px;"], spacing.xs);
|
|
26
26
|
export var StyledMultiSelectSearchIcon = /*#__PURE__*/styled.div.withConfig({
|
|
27
27
|
displayName: "StyledMultiSelectSearchIcon",
|
|
28
|
-
componentId: "core-
|
|
28
|
+
componentId: "core-12_26_1__sc-s9ym9q-4"
|
|
29
29
|
})(["align-items:center;align-self:flex-start;display:flex;height:34px;justify-content:flex-end;margin-left:", "px;margin-right:", "px;min-width:40px;width:40px;"], spacing.xs, spacing.md);
|
|
30
30
|
export var StyledMultiSelectClearIcon = StyledSelectClearIcon;
|
|
31
31
|
export var StyledMultiSelectArrowContainer = StyledSelectArrowContainer;
|
|
@@ -33,7 +33,7 @@ export var StyledMultiSelectArrow = StyledSelectArrow;
|
|
|
33
33
|
export var StyledMultiSelectMenu = StyledSelectMenu;
|
|
34
34
|
export var StyledMultiSelectButton = /*#__PURE__*/styled(StyledSelectButton).withConfig({
|
|
35
35
|
displayName: "StyledMultiSelectButton",
|
|
36
|
-
componentId: "core-
|
|
36
|
+
componentId: "core-12_26_1__sc-s9ym9q-5"
|
|
37
37
|
})(["height:auto;padding:0;white-space:normal;&:focus-within{", "}", ""], getFocus(), function (_ref2) {
|
|
38
38
|
var $emptyValue = _ref2.$emptyValue;
|
|
39
39
|
return $emptyValue && css(["", "{cursor:pointer;}"], StyledMultiSelectSearchInput);
|
|
@@ -6,14 +6,14 @@ export var optionMinHeight = 32;
|
|
|
6
6
|
export var defaultMenuHeight = 64;
|
|
7
7
|
export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledOptions",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_26_1__sc-3o6zya-0"
|
|
10
10
|
})([""]);
|
|
11
11
|
export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledItem",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_26_1__sc-3o6zya-1"
|
|
14
14
|
})(["", ";padding:", "px ", "px;cursor:pointer;list-style-type:none;"], getTypographyIntent('body'), spacing.xs, spacing.md);
|
|
15
15
|
export var StyledGroup = /*#__PURE__*/styled.div.withConfig({
|
|
16
16
|
displayName: "StyledGroup",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_26_1__sc-3o6zya-2"
|
|
18
18
|
})(["", ";padding:", "px ", "px ", "px;font-weight:", ";background:white;list-style-type:none;"], getTypographyIntent('body'), spacing.md, spacing.md, spacing.xs, typographyWeights.semibold);
|
|
19
19
|
//# sourceMappingURL=NextMenu.styles.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Banner } from '../Banner';
|
|
3
|
+
export var EditorError = function EditorError(_ref) {
|
|
4
|
+
var children = _ref.children;
|
|
5
|
+
return /*#__PURE__*/React.createElement(Banner, {
|
|
6
|
+
variant: "error"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Banner.Content, null, /*#__PURE__*/React.createElement(Banner.Body, null, children)));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=EditorError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorError.js","names":["React","Banner","EditorError","_ref","children","createElement","variant","Content","Body"],"sources":["../../src/NextTextEditor/EditorError.tsx"],"sourcesContent":["import React, { type PropsWithChildren } from 'react'\nimport { Banner } from '../Banner'\n\nexport const EditorError = ({ children }: PropsWithChildren<{}>) => {\n return (\n <Banner variant=\"error\">\n <Banner.Content>\n <Banner.Body>{children}</Banner.Body>\n </Banner.Content>\n </Banner>\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAkC,OAAO;AACrD,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAA4C;EAAA,IAAtCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACpC,oBACEJ,KAAA,CAAAK,aAAA,CAACJ,MAAM;IAACK,OAAO,EAAC;EAAO,gBACrBN,KAAA,CAAAK,aAAA,CAACJ,MAAM,CAACM,OAAO,qBACbP,KAAA,CAAAK,aAAA,CAACJ,MAAM,CAACO,IAAI,QAAEJ,QAAsB,CACtB,CACV,CAAC;AAEb,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { NextTextEditorProps } from './NextTextEditor.types';
|
|
3
|
+
export declare function NextTextEditor({ disabled, error, value, initialValue, onChange, onEditorChange, onDirty, onInit, onKeyDown, onFocusOut, onBlur, init, config: externalConfig, plugins: stringPlugins, locale: propLocale, ...restProps }: NextTextEditorProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["disabled", "error", "value", "initialValue", "onChange", "onEditorChange", "onDirty", "onInit", "onKeyDown", "onFocusOut", "onBlur", "init", "config", "plugins", "locale"];
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
+
import { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
18
|
+
import { ClassicEditor } from 'ckeditor5';
|
|
19
|
+
import React from 'react';
|
|
20
|
+
import { TextEditorContext } from '../TextEditor/TextEditorProvider';
|
|
21
|
+
import { useOverridableFocusScope } from '../_hooks/FocusScopeOverride';
|
|
22
|
+
import { useI18nContext } from '../_hooks/I18n';
|
|
23
|
+
import { useZIndexContext } from '../_hooks/ZIndex';
|
|
24
|
+
import { EditorStyles } from './NextTextEditor.styles';
|
|
25
|
+
import { useStickyToolbar } from './StickyToolbar';
|
|
26
|
+
import { TextEditorTheme } from './textEditorTheming';
|
|
27
|
+
import { useCKEditorCss } from './useCKEditorCss';
|
|
28
|
+
import { useTabAsNavigation } from './useTabAsNavigation';
|
|
29
|
+
import { addButtonDataAttributes, addPluginsFromStringArray, getDefaultConfig } from './utils';
|
|
30
|
+
import { applyLegacyTinyMceCompatibility, isLegacyTinyMceConfig } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter';
|
|
31
|
+
export function NextTextEditor(_ref) {
|
|
32
|
+
var disabled = _ref.disabled,
|
|
33
|
+
error = _ref.error,
|
|
34
|
+
value = _ref.value,
|
|
35
|
+
initialValue = _ref.initialValue,
|
|
36
|
+
onChange = _ref.onChange,
|
|
37
|
+
onEditorChange = _ref.onEditorChange,
|
|
38
|
+
onDirty = _ref.onDirty,
|
|
39
|
+
onInit = _ref.onInit,
|
|
40
|
+
onKeyDown = _ref.onKeyDown,
|
|
41
|
+
onFocusOut = _ref.onFocusOut,
|
|
42
|
+
onBlur = _ref.onBlur,
|
|
43
|
+
init = _ref.init,
|
|
44
|
+
externalConfig = _ref.config,
|
|
45
|
+
stringPlugins = _ref.plugins,
|
|
46
|
+
propLocale = _ref.locale,
|
|
47
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
+
var _useCKEditorCss = useCKEditorCss(),
|
|
49
|
+
cssLoading = _useCKEditorCss.isLoading;
|
|
50
|
+
var editorRef = React.useRef(null);
|
|
51
|
+
var editorInstanceRef = React.useRef(null);
|
|
52
|
+
var initialValueRef = React.useRef(value || initialValue || '');
|
|
53
|
+
var _React$useState = React.useState(false),
|
|
54
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
55
|
+
isDirtyState = _React$useState2[0],
|
|
56
|
+
setIsDirtyState = _React$useState2[1];
|
|
57
|
+
var _useI18nContext = useI18nContext(),
|
|
58
|
+
contextLocale = _useI18nContext.locale;
|
|
59
|
+
var locale = propLocale || contextLocale;
|
|
60
|
+
React.useEffect(function () {
|
|
61
|
+
if (value !== undefined) {
|
|
62
|
+
initialValueRef.current = value;
|
|
63
|
+
}
|
|
64
|
+
}, [value]);
|
|
65
|
+
var _useZIndexContext = useZIndexContext(),
|
|
66
|
+
zIndex = _useZIndexContext.value;
|
|
67
|
+
var _React$useContext = React.useContext(TextEditorContext),
|
|
68
|
+
features = _React$useContext.features;
|
|
69
|
+
var enableStickyToolbar = !!(features !== null && features !== void 0 && features.stickyToolbar);
|
|
70
|
+
var enableTabAsNavigation = !!(features !== null && features !== void 0 && features.tabAsNavigation);
|
|
71
|
+
var mergedConfig = React.useMemo(function () {
|
|
72
|
+
var defaultConfig = getDefaultConfig(locale);
|
|
73
|
+
|
|
74
|
+
// Handle string plugins for backward compatibility
|
|
75
|
+
var configWithPlugins = stringPlugins !== null && stringPlugins !== void 0 && stringPlugins.length ? addPluginsFromStringArray(defaultConfig, stringPlugins) : defaultConfig;
|
|
76
|
+
|
|
77
|
+
// Apply any external CKEditor config overrides provided by the consumer
|
|
78
|
+
var externalResult = typeof externalConfig === 'function' ? externalConfig(configWithPlugins) : undefined;
|
|
79
|
+
// Merge default config (with plugins) and consumer overrides
|
|
80
|
+
var finalConfig = _objectSpread(_objectSpread({}, configWithPlugins), externalResult !== null && externalResult !== void 0 ? externalResult : {});
|
|
81
|
+
// Apply TinyMCE legacy compatibility only if `init` contains a legacy config
|
|
82
|
+
if (init && isLegacyTinyMceConfig(init)) {
|
|
83
|
+
finalConfig = applyLegacyTinyMceCompatibility(finalConfig, init);
|
|
84
|
+
}
|
|
85
|
+
return finalConfig;
|
|
86
|
+
}, [externalConfig, init, locale, stringPlugins]);
|
|
87
|
+
var focusScope = useOverridableFocusScope();
|
|
88
|
+
React.useEffect(function () {
|
|
89
|
+
focusScope.setProps({
|
|
90
|
+
contain: false
|
|
91
|
+
});
|
|
92
|
+
}, [focusScope]);
|
|
93
|
+
var handleChange = function handleChange(_event, editor) {
|
|
94
|
+
var data = editor.getData();
|
|
95
|
+
var isDirty = data !== initialValueRef.current;
|
|
96
|
+
|
|
97
|
+
// Call onDirty only on first content modification
|
|
98
|
+
if (isDirty && !isDirtyState) {
|
|
99
|
+
setIsDirtyState(true);
|
|
100
|
+
onDirty === null || onDirty === void 0 ? void 0 : onDirty();
|
|
101
|
+
}
|
|
102
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(data, isDirty);
|
|
103
|
+
onEditorChange === null || onEditorChange === void 0 ? void 0 : onEditorChange(data);
|
|
104
|
+
};
|
|
105
|
+
var handleReady = function handleReady(editor) {
|
|
106
|
+
addButtonDataAttributes(editor);
|
|
107
|
+
editorInstanceRef.current = editor;
|
|
108
|
+
if (initialValue) {
|
|
109
|
+
editor.setData(initialValue);
|
|
110
|
+
}
|
|
111
|
+
if (onKeyDown) {
|
|
112
|
+
editor.editing.view.document.on('keydown', function (_event, data) {
|
|
113
|
+
onKeyDown(data.domEvent);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
onInit === null || onInit === void 0 ? void 0 : onInit();
|
|
117
|
+
};
|
|
118
|
+
var handleBlur = function handleBlur(event, editor) {
|
|
119
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, editor);
|
|
120
|
+
onFocusOut === null || onFocusOut === void 0 ? void 0 : onFocusOut();
|
|
121
|
+
};
|
|
122
|
+
var _useStickyToolbar = useStickyToolbar({
|
|
123
|
+
config: mergedConfig,
|
|
124
|
+
enabled: enableStickyToolbar,
|
|
125
|
+
editor: editorInstanceRef.current,
|
|
126
|
+
editorRef: editorRef,
|
|
127
|
+
cssLoading: cssLoading
|
|
128
|
+
}),
|
|
129
|
+
stickyConfig = _useStickyToolbar.config;
|
|
130
|
+
var _useTabAsNavigation = useTabAsNavigation({
|
|
131
|
+
config: stickyConfig,
|
|
132
|
+
enabled: enableTabAsNavigation,
|
|
133
|
+
editor: editorInstanceRef.current
|
|
134
|
+
}),
|
|
135
|
+
config = _useTabAsNavigation.config;
|
|
136
|
+
var editorKey = "".concat(locale, "-").concat(enableTabAsNavigation);
|
|
137
|
+
if (cssLoading) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
ref: editorRef,
|
|
142
|
+
key: editorKey
|
|
143
|
+
}, /*#__PURE__*/React.createElement(EditorStyles, {
|
|
144
|
+
error: error,
|
|
145
|
+
zIndex: zIndex + 1
|
|
146
|
+
}), /*#__PURE__*/React.createElement(TextEditorTheme, null), /*#__PURE__*/React.createElement(CKEditor, _extends({}, restProps, {
|
|
147
|
+
editor: ClassicEditor,
|
|
148
|
+
config: config,
|
|
149
|
+
disabled: disabled,
|
|
150
|
+
data: value,
|
|
151
|
+
onChange: handleChange,
|
|
152
|
+
onReady: handleReady,
|
|
153
|
+
onBlur: handleBlur
|
|
154
|
+
})));
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=NextTextEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextTextEditor.js","names":["CKEditor","ClassicEditor","React","TextEditorContext","useOverridableFocusScope","useI18nContext","useZIndexContext","EditorStyles","useStickyToolbar","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","applyLegacyTinyMceCompatibility","isLegacyTinyMceConfig","NextTextEditor","_ref","disabled","error","value","initialValue","onChange","onEditorChange","onDirty","onInit","onKeyDown","onFocusOut","onBlur","init","externalConfig","config","stringPlugins","plugins","propLocale","locale","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_useI18nContext","contextLocale","useEffect","undefined","current","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","focusScope","setProps","contain","handleChange","_event","editor","data","getData","isDirty","handleReady","setData","editing","view","document","on","domEvent","handleBlur","event","_useStickyToolbar","enabled","stickyConfig","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/NextTextEditor/NextTextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { TextEditorContext } from '../TextEditor/TextEditorProvider'\nimport { useOverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useZIndexContext } from '../_hooks/ZIndex'\nimport { EditorStyles } from './NextTextEditor.styles'\nimport type { NextTextEditorProps } from './NextTextEditor.types'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\nimport {\n applyLegacyTinyMceCompatibility,\n isLegacyTinyMceConfig,\n} from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport function NextTextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onEditorChange,\n onDirty,\n onInit,\n onKeyDown,\n onFocusOut,\n onBlur,\n init,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n ...restProps\n}: NextTextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n // Apply TinyMCE legacy compatibility only if `init` contains a legacy config\n if (init && isLegacyTinyMceConfig(init)) {\n finalConfig = applyLegacyTinyMceCompatibility(finalConfig, init)\n }\n\n return finalConfig\n }, [externalConfig, init, locale, stringPlugins])\n\n const focusScope = useOverridableFocusScope()\n React.useEffect(() => {\n focusScope.setProps({ contain: false })\n }, [focusScope])\n\n const handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n onEditorChange?.(data)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n\n if (initialValue) {\n editor.setData(initialValue)\n }\n\n if (onKeyDown) {\n editor.editing.view.document.on('keydown', (_event, data) => {\n onKeyDown(data.domEvent as KeyboardEvent)\n })\n }\n\n onInit?.()\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n onBlur?.(event, editor)\n onFocusOut?.()\n }\n\n const { config: stickyConfig } = useStickyToolbar({\n config: mergedConfig,\n enabled: enableStickyToolbar,\n editor: editorInstanceRef.current,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: stickyConfig,\n enabled: enableTabAsNavigation,\n editor: editorInstanceRef.current,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n return (\n <div ref={editorRef} key={editorKey}>\n <EditorStyles error={error} zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,wBAAwB,QAAQ,8BAA8B;AACvE,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SACEC,uBAAuB,EACvBC,yBAAyB,EACzBC,gBAAgB,QACX,SAAS;AAEhB,SACEC,+BAA+B,EAC/BC,qBAAqB,QAChB,mDAAmD;AAE1D,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAiBN;EAAA,IAhBtBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,OAAO,GA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
|
2
|
+
import { colors } from '../_styles/colors';
|
|
3
|
+
export var EditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-default:", ";--ck-z-modal:", ";}.ck-body-wrapper{--ck-z-default:", ";--ck-z-modal:", ";}.ck-balloon-panel{z-index:", " !important;}.ck-content{padding:16px 28px !important;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen,Ubuntu,Cantarell,\"Open Sans\",\"Helvetica Neue\",sans-serif;line-height:1.4;p{margin-top:0 !important;margin-bottom:0 !important;}ul,ol{li .ck-list-bogus-paragraph > br{display:none;}}ol,ol ol,ol ol ol{list-style-type:revert-layer;}}", ""], function (_ref) {
|
|
4
|
+
var zIndex = _ref.zIndex;
|
|
5
|
+
return zIndex;
|
|
6
|
+
}, function (_ref2) {
|
|
7
|
+
var zIndex = _ref2.zIndex;
|
|
8
|
+
return zIndex + 999;
|
|
9
|
+
}, function (_ref3) {
|
|
10
|
+
var zIndex = _ref3.zIndex;
|
|
11
|
+
return zIndex;
|
|
12
|
+
}, function (_ref4) {
|
|
13
|
+
var zIndex = _ref4.zIndex;
|
|
14
|
+
return zIndex + 999;
|
|
15
|
+
}, function (_ref5) {
|
|
16
|
+
var zIndex = _ref5.zIndex;
|
|
17
|
+
return zIndex + 1000;
|
|
18
|
+
}, function (_ref6) {
|
|
19
|
+
var error = _ref6.error;
|
|
20
|
+
return error && "\n .ck-sticky-panel__content {\n border-top-color: ".concat(colors.red50, " !important;\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n }\n\n .ck-editor__editable {\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n border-bottom-color: ").concat(colors.red50, " !important;\n }\n ");
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=NextTextEditor.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextTextEditor.styles.js","names":["createGlobalStyle","colors","EditorStyles","_ref","zIndex","_ref2","_ref3","_ref4","_ref5","_ref6","error","concat","red50"],"sources":["../../src/NextTextEditor/NextTextEditor.styles.ts"],"sourcesContent":["import { createGlobalStyle } from 'styled-components'\nimport { colors } from '../_styles/colors'\n\nexport const EditorStyles = createGlobalStyle<{\n error?: boolean\n zIndex: number\n}>`\n :root {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n }\n \n .ck-body-wrapper {\n --ck-z-default: ${({ zIndex }) => zIndex};\n --ck-z-modal: ${({ zIndex }) => zIndex + 999};\n }\n \n .ck-balloon-panel {\n z-index: ${({ zIndex }) => zIndex + 1000} !important;\n }\n\n .ck-content {\n padding: 16px 28px !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n \"Open Sans\",\n \"Helvetica Neue\",\n sans-serif;\n line-height: 1.4;\n\n p {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n\n ul, ol {\n li .ck-list-bogus-paragraph > br {\n display: none;\n }\n }\n\n ol,\n ol ol,\n ol ol ol {\n list-style-type: revert-layer;\n }\n }\n\n ${({ error }) =>\n error &&\n `\n .ck-sticky-panel__content {\n border-top-color: ${colors.red50} !important;\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n }\n\n .ck-editor__editable {\n border-left-color: ${colors.red50} !important;\n border-right-color: ${colors.red50} !important;\n border-bottom-color: ${colors.red50} !important;\n }\n `}\n`\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,IAAMC,YAAY,gBAAGF,iBAAiB,sfAKvB,UAAAG,IAAA;EAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAC,KAAA;EAAA,IAAGD,MAAM,GAAAC,KAAA,CAAND,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAI1B,UAAAE,KAAA;EAAA,IAAGF,MAAM,GAAAE,KAAA,CAANF,MAAM;EAAA,OAAOA,MAAM;AAAA,GACxB,UAAAG,KAAA;EAAA,IAAGH,MAAM,GAAAG,KAAA,CAANH,MAAM;EAAA,OAAOA,MAAM,GAAG,GAAG;AAAA,GAIjC,UAAAI,KAAA;EAAA,IAAGJ,MAAM,GAAAI,KAAA,CAANJ,MAAM;EAAA,OAAOA,MAAM,GAAG,IAAI;AAAA,GAoCxC,UAAAK,KAAA;EAAA,IAAGC,KAAK,GAAAD,KAAA,CAALC,KAAK;EAAA,OACRA,KAAK,sEAAAC,MAAA,CAGmBV,MAAM,CAACW,KAAK,+CAAAD,MAAA,CACXV,MAAM,CAACW,KAAK,gDAAAD,MAAA,CACXV,MAAM,CAACW,KAAK,wFAAAD,MAAA,CAIbV,MAAM,CAACW,KAAK,gDAAAD,MAAA,CACXV,MAAM,CAACW,KAAK,iDAAAD,MAAA,CACXV,MAAM,CAACW,KAAK,8BAExC;AAAA,EACF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { CKEditor } from '@ckeditor/ckeditor5-react';
|
|
2
|
+
import type { ClassicEditor, EditorConfig } from 'ckeditor5';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { Locale } from '../_hooks/I18n';
|
|
5
|
+
import type { LegacyTinyMceLike } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter';
|
|
6
|
+
export declare type NextTextEditorProps = Pick<React.ComponentProps<typeof CKEditor<ClassicEditor>>, 'onFocus' | 'onBlur' | 'onError' | 'onAfterDestroy' | 'disabled' | 'id'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Indicates if the editor is in an error state
|
|
9
|
+
*
|
|
10
|
+
* @since 10.19.0
|
|
11
|
+
*/
|
|
12
|
+
error?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated
|
|
15
|
+
* `initialValue` has been deprecated and will be removed in a future version.
|
|
16
|
+
* Please use the `value` prop instead
|
|
17
|
+
*
|
|
18
|
+
* @deprecatedSince 10.20.0
|
|
19
|
+
* @since 10.19.0
|
|
20
|
+
*/
|
|
21
|
+
initialValue?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The current value of the editor
|
|
24
|
+
*
|
|
25
|
+
* @since 10.19.0
|
|
26
|
+
*/
|
|
27
|
+
value?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Callback fired when the editor is ready
|
|
30
|
+
*
|
|
31
|
+
* @since 10.19.0
|
|
32
|
+
*/
|
|
33
|
+
onInit?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired when the editor content changes
|
|
36
|
+
*
|
|
37
|
+
* @param value - The current content of the editor
|
|
38
|
+
* @param isDirty - Whether the content differs from the initial value
|
|
39
|
+
* @since 10.19.0
|
|
40
|
+
*/
|
|
41
|
+
onChange?: (value: string, isDirty?: boolean) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when the editor content changes
|
|
44
|
+
*
|
|
45
|
+
* @param value - The current content of the editor
|
|
46
|
+
* @since 12.26.0
|
|
47
|
+
* @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.
|
|
48
|
+
*/
|
|
49
|
+
onEditorChange?: (value: string) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback fired when the editor becomes dirty (content differs from initial value)
|
|
52
|
+
*
|
|
53
|
+
* @since 12.26.0
|
|
54
|
+
* @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.
|
|
55
|
+
*/
|
|
56
|
+
onDirty?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Callback fired when a key is pressed in the editor
|
|
59
|
+
*
|
|
60
|
+
* @param event - The keyboard event
|
|
61
|
+
* @since 12.26.0
|
|
62
|
+
* @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.
|
|
63
|
+
*/
|
|
64
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Callback fired when the editor loses focus
|
|
67
|
+
*
|
|
68
|
+
* @since 12.26.0
|
|
69
|
+
* @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.
|
|
70
|
+
*/
|
|
71
|
+
onFocusOut?: () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Locale which will be used for localization. Can be passed directly or
|
|
74
|
+
* set by wrapping components in I18n provider.
|
|
75
|
+
* @since 10.19.0
|
|
76
|
+
*/
|
|
77
|
+
locale?: Locale;
|
|
78
|
+
/**
|
|
79
|
+
* Configuration function for customizing the editor
|
|
80
|
+
*
|
|
81
|
+
* @param defaultConfig - The default CKEditor configuration
|
|
82
|
+
* @returns Customized configuration object
|
|
83
|
+
* @since 12.26.0
|
|
84
|
+
*/
|
|
85
|
+
config?: (defaultConfig: EditorConfig) => EditorConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Legacy TinyMCE-style config object (e.g., NO_IMAGE_PASTE_TINY_MCE_CONFIG()).
|
|
88
|
+
* If provided, we auto-adapt it to CKEditor (paste_preprocess / paste_data_images).
|
|
89
|
+
*
|
|
90
|
+
* * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.
|
|
91
|
+
*
|
|
92
|
+
* TODO Remove after adapter decommission.
|
|
93
|
+
* Decommission plan:
|
|
94
|
+
* 1) Release CKEditor
|
|
95
|
+
* 2) Remove TinyMCE
|
|
96
|
+
* 3) Announce adapter decommission deadline
|
|
97
|
+
* 4) Teams migrate to CKEditor standard API
|
|
98
|
+
* 5) Delete this TinyMCE→CKEditor adapter API
|
|
99
|
+
*
|
|
100
|
+
* @since 12.26.0
|
|
101
|
+
*/
|
|
102
|
+
init?: LegacyTinyMceLike | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Array of plugin names to add to the editor in addition to the defaults.
|
|
105
|
+
* This provides backward compatibility with the deprecated TinyMCE version of the editor.
|
|
106
|
+
* Supports plugin names like 'link', 'image', 'table', etc.
|
|
107
|
+
*
|
|
108
|
+
* @since 12.26.0
|
|
109
|
+
*/
|
|
110
|
+
plugins?: string[];
|
|
111
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextTextEditor.types.js","names":[],"sources":["../../src/NextTextEditor/NextTextEditor.types.ts"],"sourcesContent":["import type { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\nimport type { LegacyTinyMceLike } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport type NextTextEditorProps = Pick<\n React.ComponentProps<typeof CKEditor<ClassicEditor>>,\n 'onFocus' | 'onBlur' | 'onError' | 'onAfterDestroy' | 'disabled' | 'id'\n> & {\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\n\n /**\n * @deprecated\n * `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n *\n * @deprecatedSince 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 10.19.0\n */\n onInit?: () => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onEditorChange?: (value: string) => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onFocusOut?: () => void\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 10.19.0\n */\n locale?: Locale\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\n\n /**\n * Legacy TinyMCE-style config object (e.g., NO_IMAGE_PASTE_TINY_MCE_CONFIG()).\n * If provided, we auto-adapt it to CKEditor (paste_preprocess / paste_data_images).\n *\n * * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n *\n * TODO Remove after adapter decommission.\n * Decommission plan:\n * 1) Release CKEditor\n * 2) Remove TinyMCE\n * 3) Announce adapter decommission deadline\n * 4) Teams migrate to CKEditor standard API\n * 5) Delete this TinyMCE→CKEditor adapter API\n *\n * @since 12.26.0\n */\n init?: LegacyTinyMceLike | undefined\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyToolbar.types.js","names":[],"sources":["../../../src/NextTextEditor/StickyToolbar/StickyToolbar.types.ts"],"sourcesContent":["export interface StickyToolbarState {\n toolbar: HTMLElement | null\n placeholder: HTMLElement | null\n isSticky: boolean\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,153 @@
|
|
|
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 _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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
8
|
+
var StickyToolbarManager = /*#__PURE__*/function () {
|
|
9
|
+
function StickyToolbarManager() {
|
|
10
|
+
var _this = this;
|
|
11
|
+
_classCallCheck(this, StickyToolbarManager);
|
|
12
|
+
_defineProperty(this, "state", {
|
|
13
|
+
toolbar: null,
|
|
14
|
+
placeholder: null,
|
|
15
|
+
isSticky: false
|
|
16
|
+
});
|
|
17
|
+
_defineProperty(this, "handleScroll", function () {
|
|
18
|
+
var _this$state = _this.state,
|
|
19
|
+
toolbar = _this$state.toolbar,
|
|
20
|
+
placeholder = _this$state.placeholder;
|
|
21
|
+
if (!toolbar || !placeholder) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
var editorContainer = toolbar.closest('.ck-editor');
|
|
25
|
+
if (!editorContainer) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
var editorRect = editorContainer.getBoundingClientRect();
|
|
29
|
+
var toolbarHeight = toolbar.offsetHeight;
|
|
30
|
+
var shouldBeSticky = editorRect.top <= 0 && editorRect.bottom > toolbarHeight;
|
|
31
|
+
if (shouldBeSticky !== _this.state.isSticky) {
|
|
32
|
+
_this.toggleSticky(shouldBeSticky, editorRect);
|
|
33
|
+
} else if (shouldBeSticky) {
|
|
34
|
+
_this.updatePosition(editorRect);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return _createClass(StickyToolbarManager, [{
|
|
39
|
+
key: "toggleSticky",
|
|
40
|
+
value: function toggleSticky(sticky, editorRect) {
|
|
41
|
+
var _this$state2 = this.state,
|
|
42
|
+
toolbar = _this$state2.toolbar,
|
|
43
|
+
placeholder = _this$state2.placeholder;
|
|
44
|
+
if (!toolbar || !placeholder) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.state.isSticky = sticky;
|
|
48
|
+
if (sticky) {
|
|
49
|
+
placeholder.style.height = "".concat(toolbar.offsetHeight, "px");
|
|
50
|
+
Object.assign(toolbar.style, {
|
|
51
|
+
position: 'fixed',
|
|
52
|
+
top: '0px',
|
|
53
|
+
left: "".concat(editorRect.left, "px"),
|
|
54
|
+
width: "".concat(editorRect.width, "px"),
|
|
55
|
+
zIndex: '1000',
|
|
56
|
+
background: 'var(--ck-color-toolbar-background, #fff)',
|
|
57
|
+
borderBottom: '1px solid var(--ck-color-toolbar-border, #ccc)'
|
|
58
|
+
});
|
|
59
|
+
} else {
|
|
60
|
+
placeholder.style.height = '0px';
|
|
61
|
+
this.resetToolbarStyles(toolbar);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "updatePosition",
|
|
66
|
+
value: function updatePosition(editorRect) {
|
|
67
|
+
var toolbar = this.state.toolbar;
|
|
68
|
+
if (!toolbar) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
toolbar.style.left = "".concat(editorRect.left, "px");
|
|
72
|
+
toolbar.style.width = "".concat(editorRect.width, "px");
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "resetToolbarStyles",
|
|
76
|
+
value: function resetToolbarStyles(toolbar) {
|
|
77
|
+
Object.assign(toolbar.style, {
|
|
78
|
+
position: '',
|
|
79
|
+
top: '',
|
|
80
|
+
left: '',
|
|
81
|
+
width: '',
|
|
82
|
+
zIndex: '',
|
|
83
|
+
background: '',
|
|
84
|
+
borderBottom: ''
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "init",
|
|
89
|
+
value: function init(editorContainer) {
|
|
90
|
+
var _toolbar$parentNode;
|
|
91
|
+
var toolbar = editorContainer.querySelector('.ck-toolbar');
|
|
92
|
+
if (!toolbar) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
this.resetToolbarStyles(toolbar);
|
|
96
|
+
var placeholder = document.createElement('div');
|
|
97
|
+
placeholder.style.height = '0px';
|
|
98
|
+
placeholder.style.visibility = 'hidden';
|
|
99
|
+
(_toolbar$parentNode = toolbar.parentNode) === null || _toolbar$parentNode === void 0 ? void 0 : _toolbar$parentNode.insertBefore(placeholder, toolbar);
|
|
100
|
+
this.state = {
|
|
101
|
+
toolbar: toolbar,
|
|
102
|
+
placeholder: placeholder,
|
|
103
|
+
isSticky: false
|
|
104
|
+
};
|
|
105
|
+
window.addEventListener('scroll', this.handleScroll);
|
|
106
|
+
window.addEventListener('resize', this.handleScroll);
|
|
107
|
+
this.handleScroll();
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "destroy",
|
|
112
|
+
value: function destroy() {
|
|
113
|
+
window.removeEventListener('scroll', this.handleScroll);
|
|
114
|
+
window.removeEventListener('resize', this.handleScroll);
|
|
115
|
+
if (this.state.isSticky && this.state.toolbar) {
|
|
116
|
+
this.toggleSticky(false, new DOMRect());
|
|
117
|
+
}
|
|
118
|
+
if (this.state.placeholder) {
|
|
119
|
+
this.state.placeholder.remove();
|
|
120
|
+
}
|
|
121
|
+
this.state = {
|
|
122
|
+
toolbar: null,
|
|
123
|
+
placeholder: null,
|
|
124
|
+
isSticky: false
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}]);
|
|
128
|
+
}();
|
|
129
|
+
export function createStickyToolbar(editorContainer) {
|
|
130
|
+
var manager = new StickyToolbarManager();
|
|
131
|
+
var retryTimeout = null;
|
|
132
|
+
var retryCount = 0;
|
|
133
|
+
var maxRetries = 50;
|
|
134
|
+
var _init = function init() {
|
|
135
|
+
if (!manager.init(editorContainer)) {
|
|
136
|
+
if (retryCount < maxRetries) {
|
|
137
|
+
retryCount++;
|
|
138
|
+
retryTimeout = setTimeout(_init, 100);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
_init();
|
|
143
|
+
return {
|
|
144
|
+
destroy: function destroy() {
|
|
145
|
+
if (retryTimeout) {
|
|
146
|
+
clearTimeout(retryTimeout);
|
|
147
|
+
retryTimeout = null;
|
|
148
|
+
}
|
|
149
|
+
manager.destroy();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=StickyToolbar.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StickyToolbar.utils.js","names":["StickyToolbarManager","_this","_classCallCheck","_defineProperty","toolbar","placeholder","isSticky","_this$state","state","editorContainer","closest","editorRect","getBoundingClientRect","toolbarHeight","offsetHeight","shouldBeSticky","top","bottom","toggleSticky","updatePosition","_createClass","key","value","sticky","_this$state2","style","height","concat","Object","assign","position","left","width","zIndex","background","borderBottom","resetToolbarStyles","init","_toolbar$parentNode","querySelector","document","createElement","visibility","parentNode","insertBefore","window","addEventListener","handleScroll","destroy","removeEventListener","DOMRect","remove","createStickyToolbar","manager","retryTimeout","retryCount","maxRetries","setTimeout","clearTimeout"],"sources":["../../../src/NextTextEditor/StickyToolbar/StickyToolbar.utils.ts"],"sourcesContent":["import type { StickyToolbarState } from './StickyToolbar.types'\n\nclass StickyToolbarManager {\n private state: StickyToolbarState = {\n toolbar: null,\n placeholder: null,\n isSticky: false,\n }\n\n private handleScroll = () => {\n const { toolbar, placeholder } = this.state\n if (!toolbar || !placeholder) {\n return\n }\n\n const editorContainer = toolbar.closest('.ck-editor')\n if (!editorContainer) {\n return\n }\n\n const editorRect = editorContainer.getBoundingClientRect()\n const toolbarHeight = toolbar.offsetHeight\n const shouldBeSticky =\n editorRect.top <= 0 && editorRect.bottom > toolbarHeight\n\n if (shouldBeSticky !== this.state.isSticky) {\n this.toggleSticky(shouldBeSticky, editorRect)\n } else if (shouldBeSticky) {\n this.updatePosition(editorRect)\n }\n }\n\n private toggleSticky(sticky: boolean, editorRect: DOMRect) {\n const { toolbar, placeholder } = this.state\n if (!toolbar || !placeholder) {\n return\n }\n\n this.state.isSticky = sticky\n\n if (sticky) {\n placeholder.style.height = `${toolbar.offsetHeight}px`\n Object.assign(toolbar.style, {\n position: 'fixed',\n top: '0px',\n left: `${editorRect.left}px`,\n width: `${editorRect.width}px`,\n zIndex: '1000',\n background: 'var(--ck-color-toolbar-background, #fff)',\n borderBottom: '1px solid var(--ck-color-toolbar-border, #ccc)',\n })\n } else {\n placeholder.style.height = '0px'\n this.resetToolbarStyles(toolbar)\n }\n }\n\n private updatePosition(editorRect: DOMRect) {\n const { toolbar } = this.state\n if (!toolbar) {\n return\n }\n\n toolbar.style.left = `${editorRect.left}px`\n toolbar.style.width = `${editorRect.width}px`\n }\n\n private resetToolbarStyles(toolbar: HTMLElement) {\n Object.assign(toolbar.style, {\n position: '',\n top: '',\n left: '',\n width: '',\n zIndex: '',\n background: '',\n borderBottom: '',\n })\n }\n\n init(editorContainer: HTMLElement): boolean {\n const toolbar = editorContainer.querySelector('.ck-toolbar') as HTMLElement\n if (!toolbar) {\n return false\n }\n\n this.resetToolbarStyles(toolbar)\n\n const placeholder = document.createElement('div')\n placeholder.style.height = '0px'\n placeholder.style.visibility = 'hidden'\n toolbar.parentNode?.insertBefore(placeholder, toolbar)\n\n this.state = { toolbar, placeholder, isSticky: false }\n\n window.addEventListener('scroll', this.handleScroll)\n window.addEventListener('resize', this.handleScroll)\n\n this.handleScroll()\n\n return true\n }\n\n destroy(): void {\n window.removeEventListener('scroll', this.handleScroll)\n window.removeEventListener('resize', this.handleScroll)\n\n if (this.state.isSticky && this.state.toolbar) {\n this.toggleSticky(false, new DOMRect())\n }\n\n if (this.state.placeholder) {\n this.state.placeholder.remove()\n }\n\n this.state = { toolbar: null, placeholder: null, isSticky: false }\n }\n}\n\nexport function createStickyToolbar(editorContainer: HTMLElement) {\n const manager = new StickyToolbarManager()\n let retryTimeout: ReturnType<typeof setTimeout> | null = null\n let retryCount = 0\n const maxRetries = 50\n\n const init = () => {\n if (!manager.init(editorContainer)) {\n if (retryCount < maxRetries) {\n retryCount++\n retryTimeout = setTimeout(init, 100)\n }\n }\n }\n\n init()\n\n return {\n destroy: () => {\n if (retryTimeout) {\n clearTimeout(retryTimeout)\n retryTimeout = null\n }\n manager.destroy()\n },\n }\n}\n"],"mappings":";;;;;;;IAEMA,oBAAoB;EAAA,SAAAA,qBAAA;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAF,oBAAA;IAAAG,eAAA,gBACY;MAClCC,OAAO,EAAE,IAAI;MACbC,WAAW,EAAE,IAAI;MACjBC,QAAQ,EAAE;IACZ,CAAC;IAAAH,eAAA,uBAEsB,YAAM;MAC3B,IAAAI,WAAA,GAAiCN,KAAI,CAACO,KAAK;QAAnCJ,OAAO,GAAAG,WAAA,CAAPH,OAAO;QAAEC,WAAW,GAAAE,WAAA,CAAXF,WAAW;MAC5B,IAAI,CAACD,OAAO,IAAI,CAACC,WAAW,EAAE;QAC5B;MACF;MAEA,IAAMI,eAAe,GAAGL,OAAO,CAACM,OAAO,CAAC,YAAY,CAAC;MACrD,IAAI,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