@atlaskit/editor-core 166.0.4 → 167.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +46 -1
- package/CHANGELOG.md +87 -0
- package/dist/cjs/actions/index.js +26 -2
- package/dist/cjs/create-editor/ReactEditorView.js +2 -0
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +5 -2
- package/dist/cjs/keymaps/index.js +5 -1
- package/dist/cjs/labs/next/ContentComponents.js +8 -4
- package/dist/cjs/labs/next/full-page.js +14 -8
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
- package/dist/cjs/plugins/analytics/types/enums.js +3 -0
- package/dist/cjs/plugins/base/index.js +8 -17
- package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
- package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
- package/dist/cjs/plugins/card/styles.js +1 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/cjs/plugins/code-block/actions.js +36 -2
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
- package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
- package/dist/cjs/plugins/code-block/styles.js +28 -24
- package/dist/cjs/plugins/collab-edit/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/utils.js +1 -0
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
- package/dist/cjs/plugins/expand/ui/styles.js +16 -14
- package/dist/cjs/plugins/extension/commands.js +3 -2
- package/dist/cjs/plugins/extension/context-panel.js +21 -7
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
- package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/cjs/plugins/find-replace/styles.js +2 -6
- package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
- package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
- package/dist/cjs/plugins/grid/styles.js +3 -1
- package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -3
- package/dist/cjs/plugins/hyperlink/utils.js +53 -2
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
- package/dist/cjs/plugins/layout/styles.js +1 -1
- package/dist/cjs/plugins/media/commands/helpers.js +10 -9
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +23 -4
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
- package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
- package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
- package/dist/cjs/plugins/mentions/styles.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
- package/dist/cjs/plugins/panel/index.js +1 -0
- package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
- package/dist/cjs/plugins/paste/handlers.js +23 -0
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
- package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
- package/dist/cjs/plugins/placeholder/index.js +15 -3
- package/dist/cjs/plugins/placeholder/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
- package/dist/cjs/plugins/table/index.js +14 -4
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
- package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
- package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
- package/dist/cjs/plugins/table/ui/consts.js +14 -11
- package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
- package/dist/cjs/plugins/table/utils/decoration.js +3 -4
- package/dist/cjs/plugins/table/utils/paste.js +9 -9
- package/dist/cjs/plugins/type-ahead/index.js +4 -3
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
- package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
- package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
- package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
- package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
- package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +21 -14
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -2
- package/dist/cjs/ui/ContextPanel/index.js +3 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
- package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
- package/dist/cjs/ui/PluginSlot/index.js +7 -4
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
- package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
- package/dist/cjs/ui/WithFlash/index.js +4 -2
- package/dist/cjs/ui/styles.js +6 -4
- package/dist/cjs/utils/document.js +62 -6
- package/dist/cjs/utils/filter/privacy-filter.js +2 -2
- package/dist/cjs/utils/step.js +17 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +25 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -0
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +5 -1
- package/dist/es2019/labs/next/ContentComponents.js +7 -2
- package/dist/es2019/labs/next/full-page.js +11 -8
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/es2019/plugins/analytics/types/enums.js +3 -0
- package/dist/es2019/plugins/base/index.js +6 -15
- package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
- package/dist/es2019/plugins/card/styles.js +1 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/es2019/plugins/code-block/actions.js +32 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
- package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
- package/dist/es2019/plugins/code-block/styles.js +30 -27
- package/dist/es2019/plugins/collab-edit/styles.js +3 -2
- package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
- package/dist/es2019/plugins/collab-edit/utils.js +1 -0
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/es2019/plugins/expand/ui/styles.js +15 -14
- package/dist/es2019/plugins/extension/commands.js +3 -2
- package/dist/es2019/plugins/extension/context-panel.js +11 -3
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
- package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/es2019/plugins/find-replace/styles.js +4 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
- package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/es2019/plugins/grid/styles.js +4 -2
- package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
- package/dist/es2019/plugins/hyperlink/utils.js +43 -2
- package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
- package/dist/es2019/plugins/layout/styles.js +10 -7
- package/dist/es2019/plugins/media/commands/helpers.js +6 -8
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
- package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
- package/dist/es2019/plugins/media/styles.js +3 -3
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/es2019/plugins/mentions/styles.js +5 -4
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/es2019/plugins/panel/index.js +1 -0
- package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/es2019/plugins/paste/handlers.js +23 -0
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
- package/dist/es2019/plugins/placeholder/index.js +12 -1
- package/dist/es2019/plugins/placeholder/styles.js +3 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
- package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
- package/dist/es2019/plugins/table/index.js +13 -4
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
- package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
- package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
- package/dist/es2019/plugins/table/ui/consts.js +15 -12
- package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
- package/dist/es2019/plugins/table/utils/decoration.js +1 -4
- package/dist/es2019/plugins/table/utils/paste.js +9 -9
- package/dist/es2019/plugins/type-ahead/index.js +4 -3
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
- package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
- package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
- package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
- package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
- package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
- package/dist/es2019/ui/ContentStyles/index.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +5 -0
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
- package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
- package/dist/es2019/ui/PluginSlot/index.js +7 -4
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
- package/dist/es2019/ui/WithFlash/index.js +4 -3
- package/dist/es2019/ui/styles.js +10 -9
- package/dist/es2019/utils/document.js +58 -5
- package/dist/es2019/utils/filter/privacy-filter.js +1 -1
- package/dist/es2019/utils/step.js +12 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +26 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -0
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +5 -2
- package/dist/esm/keymaps/index.js +5 -1
- package/dist/esm/labs/next/ContentComponents.js +8 -4
- package/dist/esm/labs/next/full-page.js +11 -8
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/esm/plugins/analytics/types/enums.js +3 -0
- package/dist/esm/plugins/base/index.js +8 -17
- package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
- package/dist/esm/plugins/card/styles.js +1 -1
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/esm/plugins/code-block/actions.js +28 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
- package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
- package/dist/esm/plugins/code-block/styles.js +27 -23
- package/dist/esm/plugins/collab-edit/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/utils.js +2 -0
- package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
- package/dist/esm/plugins/expand/ui/styles.js +15 -14
- package/dist/esm/plugins/extension/commands.js +3 -2
- package/dist/esm/plugins/extension/context-panel.js +21 -7
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
- package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/esm/plugins/find-replace/styles.js +3 -3
- package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
- package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/esm/plugins/grid/styles.js +2 -1
- package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +4 -3
- package/dist/esm/plugins/hyperlink/utils.js +44 -2
- package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
- package/dist/esm/plugins/layout/styles.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +6 -8
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +22 -4
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +2 -0
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/esm/plugins/mentions/styles.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/esm/plugins/panel/index.js +1 -0
- package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/esm/plugins/paste/handlers.js +21 -0
- package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +27 -2
- package/dist/esm/plugins/placeholder/index.js +12 -1
- package/dist/esm/plugins/placeholder/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
- package/dist/esm/plugins/table/index.js +13 -4
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/esm/plugins/table/nodeviews/table.js +6 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/esm/plugins/table/transforms/column-width.js +1 -2
- package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +4 -2
- package/dist/esm/plugins/table/ui/consts.js +15 -12
- package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
- package/dist/esm/plugins/table/utils/decoration.js +3 -4
- package/dist/esm/plugins/table/utils/paste.js +9 -9
- package/dist/esm/plugins/type-ahead/index.js +4 -3
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
- package/dist/esm/plugins/unsupported-content/styles.js +1 -1
- package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
- package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
- package/dist/esm/ui/Appearance/Chromeless.js +2 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
- package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +21 -14
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/esm/ui/ConfigPanel/Header.js +3 -2
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
- package/dist/esm/ui/ContentStyles/index.js +3 -2
- package/dist/esm/ui/ContextPanel/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -0
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
- package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/esm/ui/ElementBrowser/constants.js +3 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/esm/ui/PanelTextInput/styles.js +4 -3
- package/dist/esm/ui/PluginSlot/index.js +7 -4
- package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
- package/dist/esm/ui/WithFlash/index.js +3 -2
- package/dist/esm/ui/styles.js +5 -4
- package/dist/esm/utils/document.js +59 -5
- package/dist/esm/utils/filter/privacy-filter.js +1 -1
- package/dist/esm/utils/step.js +12 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +6 -0
- package/dist/types/labs/next/ContentComponents.d.ts +7 -1
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
- package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +2 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
- package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +1 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/find-replace/styles.d.ts +0 -2
- package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/index.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/dist/types/plugins/table/ui/consts.d.ts +9 -9
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
- package/dist/types/types/editor-appearance-component.d.ts +0 -1
- package/dist/types/types/editor-props.d.ts +4 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/types/ui-components.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
- package/dist/types/ui/PluginSlot/index.d.ts +1 -0
- package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
- package/dist/types/utils/document.d.ts +1 -0
- package/dist/types/utils/step.d.ts +1 -0
- package/docs/0-intro.tsx +12 -4
- package/package.json +20 -20
package/dist/esm/editor.js
CHANGED
|
@@ -410,6 +410,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
410
410
|
allowConfluenceInlineComment: {
|
|
411
411
|
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
|
|
412
412
|
type: 'removed'
|
|
413
|
+
},
|
|
414
|
+
allowDynamicTextSizing: {
|
|
415
|
+
message: 'Dynamic text sizing has been unshipped since 2020. The prop is no longer needed.',
|
|
416
|
+
type: 'removed'
|
|
413
417
|
}
|
|
414
418
|
};
|
|
415
419
|
Object.keys(deprecatedProperties).forEach(function (property) {
|
|
@@ -498,7 +502,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
498
502
|
}, {
|
|
499
503
|
key: "getBaseFontSize",
|
|
500
504
|
value: function getBaseFontSize() {
|
|
501
|
-
return !
|
|
505
|
+
return !['comment', 'chromeless', 'mobile'].includes(this.props.appearance) ? akEditorFullPageDefaultFontSize : undefined;
|
|
502
506
|
}
|
|
503
507
|
}, {
|
|
504
508
|
key: "render",
|
|
@@ -581,7 +585,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
581
585
|
config = _ref3.config,
|
|
582
586
|
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
583
587
|
return jsx(BaseTheme, {
|
|
584
|
-
dynamicTextSizing: _this5.props.allowDynamicTextSizing && _this5.props.appearance !== 'full-width',
|
|
585
588
|
baseFontSize: _this5.getBaseFontSize()
|
|
586
589
|
}, jsx(Component, {
|
|
587
590
|
appearance: _this5.props.appearance,
|
|
@@ -76,8 +76,12 @@ var arrowKeysMap = {
|
|
|
76
76
|
ARROWRIGHT: "\u2192",
|
|
77
77
|
ARROWUP: "\u2191",
|
|
78
78
|
ARROWDOWN: "\u2193"
|
|
79
|
-
};
|
|
79
|
+
}; // TOOD: https://product-fabric.atlassian.net/browse/DSP-4460
|
|
80
|
+
|
|
81
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
82
|
+
|
|
80
83
|
var tooltipShortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), N400);
|
|
84
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
81
85
|
|
|
82
86
|
function formatShortcut(keymap) {
|
|
83
87
|
var shortcut;
|
|
@@ -3,7 +3,10 @@ import { pluginKey as disabledPluginKey } from '../../plugins/editor-disabled';
|
|
|
3
3
|
import WithPluginState from '../../ui/WithPluginState';
|
|
4
4
|
import PluginSlot from '../../ui/PluginSlot';
|
|
5
5
|
import { useEditorSharedConfig } from './Editor';
|
|
6
|
-
export function ContentComponents(
|
|
6
|
+
export function ContentComponents(_ref) {
|
|
7
|
+
var disabled = _ref.disabled,
|
|
8
|
+
wrapperElement = _ref.wrapperElement,
|
|
9
|
+
containerElement = _ref.containerElement;
|
|
7
10
|
var config = useEditorSharedConfig();
|
|
8
11
|
|
|
9
12
|
if (!config) {
|
|
@@ -14,10 +17,10 @@ export function ContentComponents(disabled) {
|
|
|
14
17
|
plugins: {
|
|
15
18
|
disabled: disabledPluginKey
|
|
16
19
|
},
|
|
17
|
-
render: function render(
|
|
20
|
+
render: function render(_ref2) {
|
|
18
21
|
var _disabled$editorDisab;
|
|
19
22
|
|
|
20
|
-
var disabled =
|
|
23
|
+
var disabled = _ref2.disabled;
|
|
21
24
|
return /*#__PURE__*/React.createElement(PluginSlot, {
|
|
22
25
|
editorView: config.editorView,
|
|
23
26
|
eventDispatcher: config.eventDispatcher,
|
|
@@ -26,8 +29,9 @@ export function ContentComponents(disabled) {
|
|
|
26
29
|
popupsMountPoint: config.popupsMountPoint,
|
|
27
30
|
popupsBoundariesElement: config.popupsBoundariesElement,
|
|
28
31
|
popupsScrollableElement: config.popupsScrollableElement,
|
|
29
|
-
containerElement:
|
|
32
|
+
containerElement: containerElement // TODO: Figure out how to pass containerElement here ED-8448
|
|
30
33
|
,
|
|
34
|
+
wrapperElement: wrapperElement,
|
|
31
35
|
disabled: (_disabled$editorDisab = disabled === null || disabled === void 0 ? void 0 : disabled.editorDisabled) !== null && _disabled$editorDisab !== void 0 ? _disabled$editorDisab : false
|
|
32
36
|
});
|
|
33
37
|
}
|
|
@@ -9,6 +9,7 @@ import rafSchedule from 'raf-schd';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { N30 } from '@atlaskit/theme/colors';
|
|
12
|
+
import { token } from '@atlaskit/tokens';
|
|
12
13
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
13
14
|
import { BaseTheme } from '@atlaskit/editor-common/ui';
|
|
14
15
|
import { akEditorMenuZIndex, akEditorToolbarKeylineHeight } from '@atlaskit/editor-shared-styles';
|
|
@@ -35,8 +36,8 @@ var editorContentArea = function editorContentArea(theme) {
|
|
|
35
36
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: 24px;\n height: 100%;\n width: 100%;\n max-width: ", "px;\n padding-top: 50px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding-bottom: 55px;\n\n & .ProseMirror {\n flex-grow: 1;\n box-sizing: border-box;\n }\n\n && .ProseMirror {\n & > * {\n clear: both;\n }\n > p,\n > ul,\n > ol,\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n clear: none;\n }\n }\n ", ";\n"])), theme.layoutMaxWidth + GUTTER_PADDING * 2, tableFullPageEditorStyles);
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
var mainToolbar = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: 'none';\n\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color:
|
|
39
|
-
var mainToolbarWithKeyline = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n box-shadow: 0 ", "px 0 0 ", "\n"])), mainToolbar, akEditorToolbarKeylineHeight, N30);
|
|
39
|
+
var mainToolbar = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: 'none';\n\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color: ", ";\n\n & object {\n height: 0 !important;\n }\n"])), akEditorMenuZIndex, token('elevation.surface', 'white'));
|
|
40
|
+
var mainToolbarWithKeyline = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n box-shadow: 0 ", "px 0 0 ", "\n"])), mainToolbar, akEditorToolbarKeylineHeight, token('color.border', N30));
|
|
40
41
|
var mainToolbarCustomComponentsSlot = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
|
|
41
42
|
var sidebarArea = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 100%;\n box-sizing: border-box;\n"])));
|
|
42
43
|
|
|
@@ -79,7 +80,6 @@ function useKeyline() {
|
|
|
79
80
|
function FullPage(props) {
|
|
80
81
|
var primaryToolbarComponents = props.primaryToolbarComponents,
|
|
81
82
|
contentComponents = props.contentComponents,
|
|
82
|
-
allowDynamicTextSizing = props.allowDynamicTextSizing,
|
|
83
83
|
collabEdit = props.collabEdit,
|
|
84
84
|
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
85
85
|
contextPanel = props.contextPanel;
|
|
@@ -91,13 +91,13 @@ function FullPage(props) {
|
|
|
91
91
|
scrollContainerRef = _useKeyline2[1];
|
|
92
92
|
|
|
93
93
|
var config = useEditorSharedConfig();
|
|
94
|
+
var wrapperElementRef = /*#__PURE__*/React.createRef();
|
|
94
95
|
return jsx(ContextPanelWidthProvider, null, jsx(Editor, _extends({}, props, {
|
|
95
96
|
onAnalyticsEvent: handleAnalyticsEvent
|
|
96
|
-
}), jsx(BaseTheme, {
|
|
97
|
-
dynamicTextSizing: allowDynamicTextSizing
|
|
98
|
-
}, jsx("div", {
|
|
97
|
+
}), jsx(BaseTheme, null, jsx("div", {
|
|
99
98
|
css: fullPageEditorWrapper,
|
|
100
|
-
className: "akEditor"
|
|
99
|
+
className: "akEditor",
|
|
100
|
+
ref: wrapperElementRef
|
|
101
101
|
}, jsx("div", {
|
|
102
102
|
"data-testid": "ak-editor-main-toolbar",
|
|
103
103
|
css: showKeyline ? mainToolbarWithKeyline : mainToolbar
|
|
@@ -123,7 +123,10 @@ function FullPage(props) {
|
|
|
123
123
|
}, jsx("div", {
|
|
124
124
|
style: GUTTER_STYLE,
|
|
125
125
|
className: "ak-editor-content-area"
|
|
126
|
-
}, contentComponents, jsx(EditorContent, null), jsx(ContentComponents,
|
|
126
|
+
}, contentComponents, jsx(EditorContent, null), jsx(ContentComponents, {
|
|
127
|
+
wrapperElement: wrapperElementRef.current,
|
|
128
|
+
containerElement: scrollContainerRef.current
|
|
129
|
+
}))))), contextPanel && jsx("div", {
|
|
127
130
|
css: sidebarArea
|
|
128
131
|
}, contextPanel), jsx(WidthEmitter, {
|
|
129
132
|
editorView: config === null || config === void 0 ? void 0 : config.editorView
|
|
@@ -5,6 +5,7 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
|
|
|
5
5
|
import { analyticsEventKey } from '../plugins/analytics/consts';
|
|
6
6
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
7
|
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
|
|
8
|
+
export var inlineNodeViewClassname = 'inlineNodeView';
|
|
8
9
|
|
|
9
10
|
function createNodeView(_ref) {
|
|
10
11
|
var nodeViewParams = _ref.nodeViewParams,
|
|
@@ -25,7 +26,7 @@ function createNodeView(_ref) {
|
|
|
25
26
|
// nodeView if DOM structure has nested plain "div"s, it doesn't see the
|
|
26
27
|
// difference between them and it kills the nodeView
|
|
27
28
|
|
|
28
|
-
domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "
|
|
29
|
+
domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "".concat(inlineNodeViewClassname)); // This util is shared for tracking rendering, and the ErrorBoundary that
|
|
29
30
|
// is setup to wrap the Component when rendering
|
|
30
31
|
// NOTE: This is not a prosemirror dispatch
|
|
31
32
|
|
|
@@ -162,13 +163,13 @@ function getPortalChildren(_ref2) {
|
|
|
162
163
|
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
163
164
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
164
165
|
}, /*#__PURE__*/React.createElement("span", {
|
|
165
|
-
className: "
|
|
166
|
+
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
166
167
|
}), ZERO_WIDTH_SPACE, /*#__PURE__*/React.createElement(Component, _extends({
|
|
167
168
|
view: nodeViewParams.view,
|
|
168
169
|
getPos: nodeViewParams.getPos,
|
|
169
170
|
node: currentNode
|
|
170
171
|
}, extraComponentProps)), /*#__PURE__*/React.createElement("span", {
|
|
171
|
-
className: "
|
|
172
|
+
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
172
173
|
}));
|
|
173
174
|
};
|
|
174
175
|
} // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
@@ -3,7 +3,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { inlineNodeViewClassname } from './getInlineNodeViewProducer'; // For reasoning behind styles, see comments in:
|
|
7
8
|
// ./getInlineNodeViewProducer -> portalChildren()
|
|
8
9
|
|
|
9
|
-
export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .
|
|
10
|
+
export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > * {\n white-space: pre-wrap;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, ZERO_WIDTH_SPACE);
|
|
@@ -4,7 +4,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N30 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
7
8
|
export var triggerWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
8
|
-
export var separator = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), N30);
|
|
9
|
+
export var separator = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), token('color.border', N30));
|
|
9
10
|
export var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
|
|
10
11
|
export var expandIconWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
@@ -84,6 +84,9 @@ export var ACTION;
|
|
|
84
84
|
ACTION["SYNCHRONY_ENTITY_ERROR"] = "synchronyEntityError";
|
|
85
85
|
ACTION["SYNCHRONY_ERROR"] = "synchronyError";
|
|
86
86
|
ACTION["TEXT_LINK_MARK_TRANSFORMED"] = "textLinkMarkTransformed";
|
|
87
|
+
ACTION["DEDUPE_MARKS_TRANSFORMED"] = "dedupeMarksTransformed";
|
|
88
|
+
ACTION["NODES_MISSING_CONTENT_TRANSFORMED"] = "nodesMissingContentTransformed";
|
|
89
|
+
ACTION["INDENTATION_MARKS_TRANSFORMED"] = "indentationMarksTransformed";
|
|
87
90
|
ACTION["TOGGLE_EXPAND"] = "toggleExpand";
|
|
88
91
|
ACTION["TRANSACTION_DISPATCHED"] = "transactionDispatched";
|
|
89
92
|
ACTION["TRANSACTION_MUTATED_AFTER_DISPATCH"] = "transactionMutatedAfterDispatched";
|
|
@@ -39,25 +39,16 @@ var basePlugin = function basePlugin(options) {
|
|
|
39
39
|
// In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
40
40
|
// no cursor is presented to users.
|
|
41
41
|
// In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
42
|
-
//
|
|
43
|
-
// This plugin
|
|
42
|
+
// it is not possible to navigate with arrow keys.
|
|
43
|
+
// This plugin works around the issues by inserting decorations between
|
|
44
44
|
// inline nodes which are set as contenteditable, and have a zero width space.
|
|
45
|
-
// At time of development, using this workaround in Safari caused additional issues;
|
|
46
|
-
// - visual artifacts when moving across inline nodes (ie. using the arrow key to traverse a
|
|
47
|
-
// series of inline nodes)
|
|
48
|
-
// - blocking the right arrow key when at the start of a line from moving to the end of the
|
|
49
|
-
// previous line.
|
|
50
|
-
// As such we only apply the workaround for firefox and chrome.
|
|
51
|
-
|
|
52
|
-
if (browser.chrome || browser.gecko) {
|
|
53
|
-
plugins.push({
|
|
54
|
-
name: 'inlineCursorTargetPlugin',
|
|
55
|
-
plugin: function plugin() {
|
|
56
|
-
return options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
45
|
|
|
46
|
+
plugins.push({
|
|
47
|
+
name: 'inlineCursorTargetPlugin',
|
|
48
|
+
plugin: function plugin() {
|
|
49
|
+
return options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
61
52
|
plugins.push({
|
|
62
53
|
name: 'focusHandlerPlugin',
|
|
63
54
|
plugin: function plugin(_ref2) {
|
|
@@ -4,6 +4,7 @@ import { Fragment } from 'prosemirror-model';
|
|
|
4
4
|
import { closeHistory } from 'prosemirror-history';
|
|
5
5
|
import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
|
|
6
6
|
import { PluginKey } from 'prosemirror-state';
|
|
7
|
+
import { extractSliceFromStep } from '../../../utils/step';
|
|
7
8
|
|
|
8
9
|
var getEnterKeyboardActionStep = function getEnterKeyboardActionStep(trs) {
|
|
9
10
|
var firstTr = trs.length === 1 && trs[0];
|
|
@@ -25,17 +26,6 @@ var getEnterKeyboardActionStep = function getEnterKeyboardActionStep(trs) {
|
|
|
25
26
|
return replaceSteps[0];
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
var extractSliceFromStep = function extractSliceFromStep(step) {
|
|
29
|
-
if (!(step instanceof ReplaceStep) && !(step instanceof ReplaceAroundStep)) {
|
|
30
|
-
return null;
|
|
31
|
-
} // @ts-ignore This is by design. Slice is a private property, but accesible, from ReplaceStep.
|
|
32
|
-
// However, we need to read it to found if the step was adding a newline
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var slice = step.slice;
|
|
36
|
-
return slice;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
29
|
var isSliceSplittingBlockNode = function isSliceSplittingBlockNode(slice) {
|
|
40
30
|
var hasOnlyTwoChildren = slice.size > 1 && slice.content.childCount === 2;
|
|
41
31
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from 'prosemirror-state';
|
|
4
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { ZERO_WIDTH_SPACE, browser } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { isTextSelection } from '../../../utils';
|
|
6
6
|
export var inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
7
7
|
export var isInlineNodeView = function isInlineNodeView(node) {
|
|
@@ -20,13 +20,35 @@ export default (function () {
|
|
|
20
20
|
var selection = tr.selection,
|
|
21
21
|
doc = tr.doc;
|
|
22
22
|
var $from = selection.$from,
|
|
23
|
-
$to = selection.$to;
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
$to = selection.$to; // In Safari, if the cursor target is to the right of the cursor it will block selections
|
|
24
|
+
// made with shift + arrowRight and vice versa for shift + arrowLeft. This is due to a
|
|
25
|
+
// contenteditable bug in safari, where editable elements block the selection but we need
|
|
26
|
+
// the cursor target to be editable for the following:
|
|
27
|
+
// - Ability to navigate with down/up arrows when between inline nodes
|
|
28
|
+
// - Ability to navigate with down/up arrows when between the start of a paragraph & an inline node
|
|
29
|
+
// - Ability to click and drag to select an inline node if it is the first node
|
|
30
|
+
// To prevent blocking the selection, we check handleDOMEvents and add meta to
|
|
31
|
+
// the transaction to prevent the plugin from making cursor target decorations.
|
|
32
|
+
|
|
33
|
+
var safariShiftSelection = tr.getMeta(inlineCursorTargetStateKey);
|
|
34
|
+
|
|
35
|
+
if (selection && isTextSelection(selection) && !safariShiftSelection) {
|
|
26
36
|
var hasInlineNodeViewAfter = isInlineNodeView($from.nodeAfter);
|
|
27
37
|
var hasInlineNodeViewBefore = isInlineNodeView($from.nodeBefore);
|
|
28
|
-
var
|
|
29
|
-
var
|
|
38
|
+
var isAtStartAndInlineNodeViewAfter = $from.parentOffset === 0 && isInlineNodeView($from.nodeAfter);
|
|
39
|
+
var isAtEndAndInlineNodeViewBefore = doc.resolve($from.pos).node().lastChild === $from.nodeBefore && isInlineNodeView($from.nodeBefore);
|
|
40
|
+
|
|
41
|
+
var createWidget = function createWidget(side) {
|
|
42
|
+
var node = document.createElement('span');
|
|
43
|
+
node.contentEditable = 'true';
|
|
44
|
+
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
45
|
+
node.className = 'cursor-target';
|
|
46
|
+
return Decoration.widget(selection.from, node, {
|
|
47
|
+
raw: true,
|
|
48
|
+
side: side === 'left' ? -1 : 1,
|
|
49
|
+
key: 'inlineCursor'
|
|
50
|
+
});
|
|
51
|
+
}; // Create editable decoration widgets either side of the cursor to allow
|
|
30
52
|
// text input.
|
|
31
53
|
// We check beforeInput events below to prevent content
|
|
32
54
|
// being added to the decorations.
|
|
@@ -37,18 +59,8 @@ export default (function () {
|
|
|
37
59
|
// - positioned between the beginning of another node and an inline node (firefox)
|
|
38
60
|
// - positioned between an inline node and the end of a node (chrome)
|
|
39
61
|
|
|
40
|
-
if ((hasInlineNodeViewAfter || isAtEnd) && (hasInlineNodeViewBefore || isAtStart)) {
|
|
41
|
-
var createWidget = function createWidget(side) {
|
|
42
|
-
var node = document.createElement('span');
|
|
43
|
-
node.contentEditable = 'true';
|
|
44
|
-
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
45
|
-
return Decoration.widget(selection.from, node, {
|
|
46
|
-
raw: true,
|
|
47
|
-
side: side === 'left' ? -1 : 1,
|
|
48
|
-
key: 'inlineCursor'
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
62
|
|
|
63
|
+
if (!browser.safari && (hasInlineNodeViewAfter || isAtEndAndInlineNodeViewBefore) && (hasInlineNodeViewBefore || isAtStartAndInlineNodeViewAfter)) {
|
|
52
64
|
return {
|
|
53
65
|
cursorTarget: {
|
|
54
66
|
decorations: [createWidget('left'), createWidget('right')],
|
|
@@ -58,6 +70,34 @@ export default (function () {
|
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
};
|
|
73
|
+
} // Only create one widget on the left or right of the cursor in Safari.
|
|
74
|
+
// This is to prevent the left key from being blocked when at the start of a paragraph,
|
|
75
|
+
// and the right key from being blocked when at the end of a paragraph. This also
|
|
76
|
+
// improves click and drag selections, making it easier to select the first node.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if (browser.safari) {
|
|
80
|
+
if (isAtEndAndInlineNodeViewBefore || hasInlineNodeViewBefore && hasInlineNodeViewAfter) {
|
|
81
|
+
return {
|
|
82
|
+
cursorTarget: {
|
|
83
|
+
decorations: [createWidget('left')],
|
|
84
|
+
positions: {
|
|
85
|
+
from: $from.pos,
|
|
86
|
+
to: $to.pos
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
} else if (isAtStartAndInlineNodeViewAfter) {
|
|
91
|
+
return {
|
|
92
|
+
cursorTarget: {
|
|
93
|
+
decorations: [createWidget('right')],
|
|
94
|
+
positions: {
|
|
95
|
+
from: $from.pos,
|
|
96
|
+
to: $to.pos
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
61
101
|
}
|
|
62
102
|
}
|
|
63
103
|
|
|
@@ -80,6 +120,21 @@ export default (function () {
|
|
|
80
120
|
return null;
|
|
81
121
|
},
|
|
82
122
|
handleDOMEvents: {
|
|
123
|
+
// Workaround to prevent the decorations created by the plugin from
|
|
124
|
+
// blocking shift + arrow left/right selections in safari. When
|
|
125
|
+
// a shift + arrow left/right event is detected, send meta data to the
|
|
126
|
+
// plugin to prevent it from creating decorations.
|
|
127
|
+
// TODO We may be able to remove this when playing the following ticket:
|
|
128
|
+
// https://product-fabric.atlassian.net/browse/ED-14938
|
|
129
|
+
keydown: function keydown(view, event) {
|
|
130
|
+
if (browser.safari && event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
|
|
131
|
+
view.dispatch(view.state.tr.setMeta(inlineCursorTargetStateKey, {
|
|
132
|
+
cursorTarget: undefined
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return false;
|
|
137
|
+
},
|
|
83
138
|
// Check the DOM to see if there are inline cursor targets
|
|
84
139
|
// after a composition event ends. If so, manually insert the
|
|
85
140
|
// event data in order to prevent contents ending up inside
|
|
@@ -13,6 +13,7 @@ import { shouldSplitSelectedNodeOnNodeInsertion } from '../../../utils/insert';
|
|
|
13
13
|
import { withAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
|
|
14
14
|
import { filterChildrenBetween } from '../../../utils';
|
|
15
15
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
16
|
+
import { CellSelection } from '@atlaskit/editor-tables';
|
|
16
17
|
export function setBlockType(name) {
|
|
17
18
|
return function (state, dispatch) {
|
|
18
19
|
var nodes = state.schema.nodes;
|
|
@@ -49,14 +50,18 @@ export function setBlockTypeWithAnalytics(name, inputMethod) {
|
|
|
49
50
|
}
|
|
50
51
|
export function setNormalText() {
|
|
51
52
|
return function (state, dispatch) {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
var selection = state.selection,
|
|
54
|
+
schema = state.schema,
|
|
55
|
+
tr = state.tr;
|
|
56
|
+
var ranges = selection instanceof CellSelection ? selection.ranges : [selection];
|
|
57
|
+
ranges.forEach(function (_ref) {
|
|
58
|
+
var $from = _ref.$from,
|
|
59
|
+
$to = _ref.$to;
|
|
60
|
+
tr.setBlockType($from.pos, $to.pos, schema.nodes.paragraph);
|
|
61
|
+
});
|
|
57
62
|
|
|
58
63
|
if (dispatch) {
|
|
59
|
-
dispatch(tr
|
|
64
|
+
dispatch(tr);
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
return true;
|
|
@@ -118,16 +123,20 @@ export function setNormalTextWithAnalytics(inputMethod) {
|
|
|
118
123
|
}
|
|
119
124
|
export function setHeading(level) {
|
|
120
125
|
return function (state, dispatch) {
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
var selection = state.selection,
|
|
127
|
+
schema = state.schema,
|
|
128
|
+
tr = state.tr;
|
|
129
|
+
var ranges = selection instanceof CellSelection ? selection.ranges : [selection];
|
|
130
|
+
ranges.forEach(function (_ref2) {
|
|
131
|
+
var $from = _ref2.$from,
|
|
132
|
+
$to = _ref2.$to;
|
|
133
|
+
tr.setBlockType($from.pos, $to.pos, schema.nodes.heading, {
|
|
134
|
+
level: level
|
|
135
|
+
});
|
|
136
|
+
});
|
|
126
137
|
|
|
127
138
|
if (dispatch) {
|
|
128
|
-
dispatch(tr
|
|
129
|
-
level: level
|
|
130
|
-
}));
|
|
139
|
+
dispatch(tr);
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
return true;
|
|
@@ -229,9 +238,9 @@ export var insertBlockTypesWithAnalytics = function insertBlockTypesWithAnalytic
|
|
|
229
238
|
function wrapSelectionIn(type) {
|
|
230
239
|
return function (state, dispatch) {
|
|
231
240
|
var tr = state.tr;
|
|
232
|
-
var _state$
|
|
233
|
-
$from = _state$
|
|
234
|
-
$to = _state$
|
|
241
|
+
var _state$selection = state.selection,
|
|
242
|
+
$from = _state$selection.$from,
|
|
243
|
+
$to = _state$selection.$to;
|
|
235
244
|
var _state$schema$marks = state.schema.marks,
|
|
236
245
|
alignment = _state$schema$marks.alignment,
|
|
237
246
|
indentation = _state$schema$marks.indentation;
|
|
@@ -266,9 +275,9 @@ function insertCodeBlock() {
|
|
|
266
275
|
var _state$selection$$fro;
|
|
267
276
|
|
|
268
277
|
var tr = state.tr;
|
|
269
|
-
var _state$
|
|
270
|
-
$to = _state$
|
|
271
|
-
$from = _state$
|
|
278
|
+
var _state$selection2 = state.selection,
|
|
279
|
+
$to = _state$selection2.$to,
|
|
280
|
+
$from = _state$selection2.$from;
|
|
272
281
|
var codeBlock = state.schema.nodes.codeBlock;
|
|
273
282
|
var grandParentType = (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type;
|
|
274
283
|
var parentType = state.selection.$from.parent.type;
|
|
@@ -292,8 +301,8 @@ function insertCodeBlock() {
|
|
|
292
301
|
}
|
|
293
302
|
|
|
294
303
|
export var cleanUpAtTheStartOfDocument = function cleanUpAtTheStartOfDocument(state, dispatch) {
|
|
295
|
-
var
|
|
296
|
-
$cursor =
|
|
304
|
+
var _ref3 = state.selection,
|
|
305
|
+
$cursor = _ref3.$cursor;
|
|
297
306
|
|
|
298
307
|
if ($cursor && !$cursor.nodeBefore && !$cursor.nodeAfter && $cursor.pos === 1) {
|
|
299
308
|
var tr = state.tr,
|
|
@@ -7,12 +7,13 @@ import { css } from '@emotion/react';
|
|
|
7
7
|
import { N400 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { shortcutStyle } from '../../../../ui/styles';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
export var blockTypeMenuItemStyle = function blockTypeMenuItemStyle(tagName, selected) {
|
|
11
12
|
// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
12
|
-
var selectedStyle = selected ? "".concat(tagName, " { color: white !important; }") : '';
|
|
13
|
+
var selectedStyle = selected ? "".concat(tagName, " { color: ").concat(token('color.text.inverse', 'white'), " !important; }") : '';
|
|
13
14
|
return function (themeProps) {
|
|
14
15
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0;\n }\n }\n ", ";\n "])), headingsSharedStyles(themeProps), selectedStyle);
|
|
15
16
|
};
|
|
16
17
|
};
|
|
17
18
|
export var keyboardShortcut = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n margin-left: 16px;\n"])), shortcutStyle);
|
|
18
|
-
export var keyboardShortcutSelect = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n"])), N400);
|
|
19
|
+
export var keyboardShortcutSelect = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.icon', N400));
|
|
@@ -16,7 +16,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
16
|
/** @jsx jsx */
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { css, jsx } from '@emotion/react';
|
|
19
|
-
import
|
|
19
|
+
import { B300, N300, N20A } from '@atlaskit/theme/colors';
|
|
20
20
|
import { injectIntl } from 'react-intl-next';
|
|
21
21
|
import { findParentDomRefOfType, findDomRefAtPos } from 'prosemirror-utils';
|
|
22
22
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -32,10 +32,8 @@ import { isBreakoutMarkAllowed } from '../utils/is-breakout-mark-allowed';
|
|
|
32
32
|
import { getPluginState } from '../plugin-key';
|
|
33
33
|
import { NodeSelection } from 'prosemirror-state';
|
|
34
34
|
import { isSupportedNodeForBreakout } from '../utils/is-supported-node';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
N20A = colors.N20A;
|
|
38
|
-
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: white !important;\n }\n }\n"])), N20A, N300, B300);
|
|
35
|
+
import { token } from '@atlaskit/tokens';
|
|
36
|
+
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: ", " !important;\n }\n }\n"])), token('color.background.neutral', N20A), token('color.icon', N300), token('color.background.neutral.hovered', B300), token('color.icon', 'white'));
|
|
39
37
|
var BREAKOUT_MODE = {
|
|
40
38
|
FULL_WIDTH: 'full-width',
|
|
41
39
|
CENTER: 'center',
|
|
@@ -8,4 +8,4 @@ import { N20 } from '@atlaskit/theme/colors';
|
|
|
8
8
|
import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, N20, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), token('color.border.danger', akEditorDeleteBorder), token('color.background.danger', akEditorDeleteBackground), token('color.border.danger', akEditorDeleteBorder));
|
|
11
|
+
export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: 2px;\n padding-right: 2px;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n }\n\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n &.", "\n .", "\n > div {\n ", "\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.background.neutral.subtle.hovered', N20), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, token('color.border.danger', akEditorDeleteBorder), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), token('color.border.danger', akEditorDeleteBorder), token('color.background.danger', akEditorDeleteBackground), token('color.border.danger', akEditorDeleteBorder));
|
|
@@ -17,7 +17,7 @@ var iconBoxStyles = css({
|
|
|
17
17
|
width: ICON_HEIGHT,
|
|
18
18
|
height: ICON_WIDTH,
|
|
19
19
|
overflow: 'hidden',
|
|
20
|
-
border:
|
|
20
|
+
border: "1px solid ".concat(token('color.border', 'rgba(223, 225, 229, 0.5)'))
|
|
21
21
|
/* N60 at 50% */
|
|
22
22
|
,
|
|
23
23
|
borderRadius: borderRadius(),
|
|
@@ -25,7 +25,7 @@ var iconBoxStyles = css({
|
|
|
25
25
|
display: 'flex',
|
|
26
26
|
justifyContent: 'center',
|
|
27
27
|
alignItems: 'center',
|
|
28
|
-
backgroundColor: token('
|
|
28
|
+
backgroundColor: token('elevation.surface', 'white')
|
|
29
29
|
});
|
|
30
30
|
var primitiveStyles = css({
|
|
31
31
|
padding: '0.75rem',
|
|
@@ -91,5 +91,33 @@ export var resetCopiedState = function resetCopiedState(state, dispatch) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
return true;
|
|
95
|
+
};
|
|
96
|
+
export var ignoreFollowingMutations = function ignoreFollowingMutations(state, dispatch) {
|
|
97
|
+
var tr = state.tr;
|
|
98
|
+
var ignoreFollowingMutationsTr = tr;
|
|
99
|
+
ignoreFollowingMutationsTr.setMeta(pluginKey, {
|
|
100
|
+
type: ACTIONS.SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS,
|
|
101
|
+
data: true
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (dispatch) {
|
|
105
|
+
dispatch(ignoreFollowingMutationsTr);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return true;
|
|
109
|
+
};
|
|
110
|
+
export var resetShouldIgnoreFollowingMutations = function resetShouldIgnoreFollowingMutations(state, dispatch) {
|
|
111
|
+
var tr = state.tr;
|
|
112
|
+
var ignoreFollowingMutationsTr = tr;
|
|
113
|
+
ignoreFollowingMutationsTr.setMeta(pluginKey, {
|
|
114
|
+
type: ACTIONS.SET_SHOULD_IGNORE_FOLLOWING_MUTATIONS,
|
|
115
|
+
data: false
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (dispatch) {
|
|
119
|
+
dispatch(ignoreFollowingMutationsTr);
|
|
120
|
+
}
|
|
121
|
+
|
|
94
122
|
return true;
|
|
95
123
|
};
|