@atlaskit/editor-core 171.0.0 → 172.0.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/CHANGELOG.md +96 -0
- package/codemods/172.0.0-transform-smartlinks-prop.ts +8 -0
- package/codemods/__tests__/rename-smartlinks-prop.ts +204 -0
- package/codemods/migrates/rename-smartlinks-prop.ts +56 -0
- package/dist/cjs/create-editor/ReactEditorView.js +13 -4
- package/dist/cjs/create-editor/create-plugins-list.js +21 -12
- package/dist/cjs/editor.js +8 -23
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/cjs/labs/next/presets/default.js +1 -1
- package/dist/cjs/nodeviews/context-adapter.js +2 -2
- package/dist/cjs/plugins/analytics/plugin.js +24 -11
- package/dist/cjs/plugins/base/index.js +3 -3
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +84 -0
- package/dist/cjs/plugins/card/index.js +1 -1
- package/dist/cjs/plugins/card/toolbar.js +11 -5
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/code-block/actions.js +13 -0
- package/dist/cjs/plugins/code-block/index.js +7 -0
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +132 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +1 -23
- package/dist/cjs/plugins/code-block/styles.js +3 -36
- package/dist/cjs/plugins/code-block/toolbar.js +9 -0
- package/dist/cjs/plugins/code-block/ui/class-names.js +1 -2
- package/dist/cjs/plugins/copy-button/commands.js +40 -20
- package/dist/cjs/plugins/copy-button/toolbar.js +51 -0
- package/dist/cjs/plugins/copy-button/utils.js +16 -38
- package/dist/cjs/plugins/expand/toolbar.js +8 -2
- package/dist/cjs/plugins/extension/toolbar.js +5 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +2 -4
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +29 -18
- package/dist/cjs/plugins/feedback-dialog/index.js +2 -2
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -20
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +7 -32
- package/dist/cjs/plugins/hyperlink/Toolbar.js +146 -135
- package/dist/cjs/plugins/hyperlink/index.js +4 -4
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +50 -0
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +38 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -5
- package/dist/cjs/plugins/indentation/commands/index.js +35 -7
- package/dist/cjs/plugins/indentation/commands/utils.js +11 -7
- package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -3
- package/dist/cjs/plugins/layout/toolbar.js +3 -1
- package/dist/cjs/plugins/media/toolbar/index.js +13 -5
- package/dist/cjs/plugins/mentions/analytics.js +5 -5
- package/dist/cjs/plugins/panel/toolbar.js +3 -3
- package/dist/cjs/plugins/paste/edge-cases/index.js +16 -3
- package/dist/cjs/plugins/paste/handlers.js +25 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +16 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +22 -3
- package/dist/cjs/plugins/status/analytics.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +2 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +43 -32
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +33 -13
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +122 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +40 -19
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +10 -0
- package/dist/cjs/types/browser.js +6 -0
- package/dist/cjs/ui/Addon/click-area-helper.js +40 -19
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +1 -3
- package/dist/cjs/ui/DropList/index.js +215 -0
- package/dist/cjs/ui/Dropdown/index.js +2 -5
- package/dist/cjs/ui/DropdownMenu/index.js +140 -86
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +25 -14
- package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +2 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +28 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +2 -7
- package/dist/cjs/ui/Layer/index.js +245 -0
- package/dist/cjs/ui/Layer/internal/helpers.js +70 -0
- package/dist/cjs/ui/PortalProvider/index.js +7 -26
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +15 -4
- package/dist/es2019/create-editor/create-plugins-list.js +21 -11
- package/dist/es2019/editor.js +9 -23
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/nodeviews/context-adapter.js +2 -2
- package/dist/es2019/plugins/analytics/plugin.js +19 -4
- package/dist/es2019/plugins/base/index.js +3 -3
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +70 -0
- package/dist/es2019/plugins/card/index.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -5
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/es2019/plugins/code-block/actions.js +12 -0
- package/dist/es2019/plugins/code-block/index.js +4 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -21
- package/dist/es2019/plugins/code-block/styles.js +2 -159
- package/dist/es2019/plugins/code-block/toolbar.js +8 -0
- package/dist/es2019/plugins/code-block/ui/class-names.js +1 -2
- package/dist/es2019/plugins/copy-button/commands.js +35 -15
- package/dist/es2019/plugins/copy-button/toolbar.js +29 -0
- package/dist/es2019/plugins/copy-button/utils.js +15 -27
- package/dist/es2019/plugins/expand/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +1 -3
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +27 -15
- package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -19
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +14 -29
- package/dist/es2019/plugins/hyperlink/Toolbar.js +11 -5
- package/dist/es2019/plugins/hyperlink/index.js +4 -4
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +24 -0
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -9
- package/dist/es2019/plugins/indentation/commands/index.js +24 -9
- package/dist/es2019/plugins/indentation/commands/utils.js +8 -3
- package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/es2019/plugins/layout/toolbar.js +2 -1
- package/dist/es2019/plugins/media/toolbar/index.js +10 -3
- package/dist/es2019/plugins/mentions/analytics.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +1 -1
- package/dist/es2019/plugins/paste/edge-cases/index.js +15 -3
- package/dist/es2019/plugins/paste/handlers.js +27 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +12 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +24 -4
- package/dist/es2019/plugins/status/analytics.js +1 -1
- package/dist/es2019/plugins/table/toolbar.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +2 -0
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +10 -10
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +23 -4
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +104 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -16
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/es2019/types/browser.js +2 -0
- package/dist/es2019/ui/Addon/click-area-helper.js +37 -18
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +5 -9
- package/dist/es2019/ui/DropList/index.js +186 -0
- package/dist/es2019/ui/Dropdown/index.js +2 -6
- package/dist/es2019/ui/DropdownMenu/index.js +124 -75
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +11 -22
- package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/es2019/ui/ElementBrowser/constants.js +1 -4
- package/dist/es2019/ui/Layer/index.js +195 -0
- package/dist/es2019/ui/Layer/internal/helpers.js +62 -0
- package/dist/es2019/ui/PortalProvider/index.js +5 -23
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +13 -4
- package/dist/esm/create-editor/create-plugins-list.js +21 -12
- package/dist/esm/editor.js +9 -23
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/nodeviews/context-adapter.js +2 -2
- package/dist/esm/plugins/analytics/plugin.js +24 -11
- package/dist/esm/plugins/base/index.js +3 -3
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +72 -0
- package/dist/esm/plugins/card/index.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/esm/plugins/card/toolbar.js +11 -5
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/esm/plugins/code-block/actions.js +12 -0
- package/dist/esm/plugins/code-block/index.js +6 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -20
- package/dist/esm/plugins/code-block/styles.js +4 -32
- package/dist/esm/plugins/code-block/toolbar.js +8 -0
- package/dist/esm/plugins/code-block/ui/class-names.js +1 -2
- package/dist/esm/plugins/copy-button/commands.js +35 -15
- package/dist/esm/plugins/copy-button/toolbar.js +31 -0
- package/dist/esm/plugins/copy-button/utils.js +14 -29
- package/dist/esm/plugins/expand/toolbar.js +6 -2
- package/dist/esm/plugins/extension/toolbar.js +4 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -4
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +28 -16
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -21
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -27
- package/dist/esm/plugins/hyperlink/Toolbar.js +144 -135
- package/dist/esm/plugins/hyperlink/index.js +4 -4
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +26 -0
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +46 -5
- package/dist/esm/plugins/indentation/commands/index.js +30 -9
- package/dist/esm/plugins/indentation/commands/utils.js +12 -8
- package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/esm/plugins/layout/toolbar.js +2 -1
- package/dist/esm/plugins/media/toolbar/index.js +12 -5
- package/dist/esm/plugins/mentions/analytics.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +1 -1
- package/dist/esm/plugins/paste/edge-cases/index.js +15 -3
- package/dist/esm/plugins/paste/handlers.js +23 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +23 -4
- package/dist/esm/plugins/status/analytics.js +1 -1
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +37 -31
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +32 -13
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +105 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -20
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/esm/types/browser.js +2 -0
- package/dist/esm/ui/Addon/click-area-helper.js +37 -18
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +2 -4
- package/dist/esm/ui/DropList/index.js +203 -0
- package/dist/esm/ui/Dropdown/index.js +2 -6
- package/dist/esm/ui/DropdownMenu/index.js +134 -88
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +27 -17
- package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/esm/ui/ElementBrowser/constants.js +1 -4
- package/dist/esm/ui/Layer/index.js +228 -0
- package/dist/esm/ui/Layer/internal/helpers.js +62 -0
- package/dist/esm/ui/PortalProvider/index.js +7 -26
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -0
- package/dist/types/plugins/analytics/plugin.d.ts +5 -1
- package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +2 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +1 -0
- package/dist/types/plugins/analytics/types/paste-events.d.ts +1 -0
- package/dist/types/plugins/base/index.d.ts +1 -1
- package/dist/types/plugins/base/pm-plugins/{fix-chrome-spell-checking.d.ts → disable-spell-checking.d.ts} +0 -0
- package/dist/types/plugins/card/index.d.ts +2 -7
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
- package/dist/types/plugins/card/toolbar.d.ts +3 -5
- package/dist/types/plugins/card/types.d.ts +2 -0
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -1
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
- package/dist/types/plugins/code-block/styles.d.ts +0 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +0 -1
- package/dist/types/plugins/copy-button/commands.d.ts +2 -2
- package/dist/types/plugins/copy-button/toolbar.d.ts +7 -0
- package/dist/types/plugins/copy-button/utils.d.ts +7 -6
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -2
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/types.d.ts +30 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +4 -3
- package/dist/types/plugins/indentation/commands/index.d.ts +6 -2
- package/dist/types/plugins/indentation/commands/utils.d.ts +8 -2
- package/dist/types/plugins/paste/edge-cases/index.d.ts +3 -2
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +7 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +5 -0
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -1
- package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +14 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/types/browser.d.ts +10 -0
- package/dist/types/types/editor-props.d.ts +6 -5
- package/dist/types/types/feature-flags.d.ts +29 -24
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/Addon/click-area-helper.d.ts +10 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/DropList/index.d.ts +22 -0
- package/dist/types/ui/Dropdown/index.d.ts +2 -1
- package/dist/types/ui/DropdownMenu/index.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +1 -0
- package/dist/types/ui/ElementBrowser/constants.d.ts +1 -3
- package/dist/types/ui/Layer/index.d.ts +47 -0
- package/dist/types/ui/Layer/internal/helpers.d.ts +5 -0
- package/package.json +23 -18
- package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -37
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +0 -195
- package/dist/cjs/utils/check-if-mobile-bridge.js +0 -19
- package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -22
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +0 -152
- package/dist/es2019/utils/check-if-mobile-bridge.js +0 -12
- package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -24
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +0 -178
- package/dist/esm/utils/check-if-mobile-bridge.js +0 -12
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +0 -48
- package/dist/types/utils/check-if-mobile-bridge.d.ts +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { PluginKey } from 'prosemirror-state';
|
|
2
|
+
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
3
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
+
import { shallowEqual } from '../../../utils';
|
|
5
|
+
import { getListItemAttributes, isInsideListItem } from '../../list/utils/selection';
|
|
6
|
+
import { getCurrentIndentLevel as getTaskListIndentLevel, getTaskItemIndex, isInsideTask } from '../../tasks-and-decisions/pm-plugins/helpers';
|
|
7
|
+
import { isIndentationAllowed, MAX_INDENTATION_LEVEL } from '../../indentation/commands';
|
|
8
|
+
export var pluginKey = new PluginKey('indentationButtonsPlugin');
|
|
9
|
+
|
|
10
|
+
function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation) {
|
|
11
|
+
var state = {
|
|
12
|
+
indentDisabled: true,
|
|
13
|
+
outdentDisabled: true,
|
|
14
|
+
node: null
|
|
15
|
+
};
|
|
16
|
+
var selection = editorState.selection;
|
|
17
|
+
var node = selection.$from.node(); // Handle bullet and numbered lists seperately as they do
|
|
18
|
+
// not use the indentation mark.
|
|
19
|
+
// Check for lists before paragraphs and headings in case
|
|
20
|
+
// the selection is in a list nested in a layout column.
|
|
21
|
+
|
|
22
|
+
if (isInsideListItem(editorState)) {
|
|
23
|
+
var _getListItemAttribute = getListItemAttributes(selection.$head),
|
|
24
|
+
indentLevel = _getListItemAttribute.indentLevel,
|
|
25
|
+
itemIndex = _getListItemAttribute.itemIndex;
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
// List indent levels are zero indexed so we need to subtract 1
|
|
29
|
+
indentDisabled: itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL - 1,
|
|
30
|
+
outdentDisabled: false,
|
|
31
|
+
node: 'list'
|
|
32
|
+
};
|
|
33
|
+
} // Handle tasks seperately as they do not use the indentation mark
|
|
34
|
+
// and have different behaviour for outdent compared to lists
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if (isInsideTask(editorState)) {
|
|
38
|
+
var _indentLevel = getTaskListIndentLevel(selection) || 0;
|
|
39
|
+
|
|
40
|
+
var _itemIndex = getTaskItemIndex(editorState);
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
indentDisabled: _itemIndex === 0 || _indentLevel >= MAX_INDENTATION_LEVEL,
|
|
44
|
+
outdentDisabled: _indentLevel <= 1,
|
|
45
|
+
node: 'taskList'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var isTopLevelParagraphOrHeading = selection.$from.depth === 1;
|
|
50
|
+
var isInLayoutNode = hasParentNodeOfType(editorState.schema.nodes.layoutColumn)(selection) && // depth of non-nested paragraphs and headings in layouts will always be 3
|
|
51
|
+
selection.$from.depth === 3;
|
|
52
|
+
|
|
53
|
+
if (allowHeadingAndParagraphIndentation && isIndentationAllowed(editorState.schema, node) && (isTopLevelParagraphOrHeading || isInLayoutNode)) {
|
|
54
|
+
var indentationMark = node.marks.find(function (mark) {
|
|
55
|
+
return mark.type === editorState.schema.marks.indentation;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
if (!indentationMark) {
|
|
59
|
+
return {
|
|
60
|
+
outdentDisabled: true,
|
|
61
|
+
indentDisabled: false,
|
|
62
|
+
node: 'paragraph_heading'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
indentDisabled: indentationMark.attrs.level >= MAX_INDENTATION_LEVEL,
|
|
68
|
+
outdentDisabled: false,
|
|
69
|
+
node: 'paragraph_heading'
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return state;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export var createPlugin = function createPlugin(_ref) {
|
|
77
|
+
var dispatch = _ref.dispatch,
|
|
78
|
+
showIndentationButtons = _ref.showIndentationButtons,
|
|
79
|
+
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
80
|
+
return new SafePlugin({
|
|
81
|
+
state: {
|
|
82
|
+
init: function init(_config, state) {
|
|
83
|
+
var initialState = {
|
|
84
|
+
indentDisabled: true,
|
|
85
|
+
outdentDisabled: true,
|
|
86
|
+
node: null
|
|
87
|
+
};
|
|
88
|
+
return showIndentationButtons ? getIndentationButtonsState(state, allowHeadingAndParagraphIndentation) : initialState;
|
|
89
|
+
},
|
|
90
|
+
apply: function apply(_tr, pluginState, _oldState, newState) {
|
|
91
|
+
if (showIndentationButtons) {
|
|
92
|
+
var state = getIndentationButtonsState(newState, allowHeadingAndParagraphIndentation);
|
|
93
|
+
|
|
94
|
+
if (!shallowEqual(pluginState, state)) {
|
|
95
|
+
dispatch(pluginKey, state);
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return pluginState;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
key: pluginKey
|
|
104
|
+
});
|
|
105
|
+
};
|
|
@@ -21,6 +21,8 @@ export function Toolbar(props) {
|
|
|
21
21
|
orderedListActive = props.orderedListActive,
|
|
22
22
|
orderedListDisabled = props.orderedListDisabled,
|
|
23
23
|
showIndentationButtons = props.showIndentationButtons,
|
|
24
|
+
indentDisabled = props.indentDisabled,
|
|
25
|
+
outdentDisabled = props.outdentDisabled,
|
|
24
26
|
onItemActivated = props.onItemActivated;
|
|
25
27
|
var labelUnorderedList = formatMessage(messages.unorderedList);
|
|
26
28
|
var labelOrderedList = formatMessage(messages.orderedList);
|
|
@@ -67,28 +69,32 @@ export function Toolbar(props) {
|
|
|
67
69
|
label: ""
|
|
68
70
|
})
|
|
69
71
|
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
70
|
-
buttonId: TOOLBAR_BUTTON.
|
|
72
|
+
buttonId: TOOLBAR_BUTTON.OUTDENT,
|
|
73
|
+
testId: TOOLBAR_BUTTON.OUTDENT,
|
|
71
74
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
72
|
-
onClick: handleOnItemActivated('
|
|
73
|
-
iconBefore: jsx(
|
|
75
|
+
onClick: handleOnItemActivated('outdent'),
|
|
76
|
+
iconBefore: jsx(OutdentIcon, {
|
|
74
77
|
label: ""
|
|
75
78
|
}),
|
|
76
|
-
disabled:
|
|
79
|
+
disabled: outdentDisabled || disabled,
|
|
80
|
+
"aria-label": formatMessage(indentationMessages.outdent),
|
|
77
81
|
title: jsx(ToolTipContent, {
|
|
78
|
-
description: formatMessage(indentationMessages.
|
|
79
|
-
keymap:
|
|
82
|
+
description: formatMessage(indentationMessages.outdent),
|
|
83
|
+
keymap: toggleOutdentKeymap
|
|
80
84
|
})
|
|
81
85
|
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
82
|
-
buttonId: TOOLBAR_BUTTON.
|
|
86
|
+
buttonId: TOOLBAR_BUTTON.INDENT,
|
|
87
|
+
testId: TOOLBAR_BUTTON.INDENT,
|
|
83
88
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
84
|
-
onClick: handleOnItemActivated('
|
|
85
|
-
iconBefore: jsx(
|
|
89
|
+
onClick: handleOnItemActivated('indent'),
|
|
90
|
+
iconBefore: jsx(IndentIcon, {
|
|
86
91
|
label: ""
|
|
87
92
|
}),
|
|
88
|
-
disabled:
|
|
93
|
+
disabled: indentDisabled || disabled,
|
|
94
|
+
"aria-label": formatMessage(indentationMessages.indent),
|
|
89
95
|
title: jsx(ToolTipContent, {
|
|
90
|
-
description: formatMessage(indentationMessages.
|
|
91
|
-
keymap:
|
|
96
|
+
description: formatMessage(indentationMessages.indent),
|
|
97
|
+
keymap: toggleIndentKeymap
|
|
92
98
|
})
|
|
93
99
|
}), jsx("span", {
|
|
94
100
|
css: separatorStyles
|
|
@@ -123,27 +123,27 @@ function useItems(props) {
|
|
|
123
123
|
var labelIndent = formatMessage(indentationMessages.indent);
|
|
124
124
|
var labelOutdent = formatMessage(indentationMessages.outdent);
|
|
125
125
|
items.push({
|
|
126
|
-
key: '
|
|
127
|
-
content:
|
|
126
|
+
key: 'outdent',
|
|
127
|
+
content: labelOutdent,
|
|
128
128
|
value: {
|
|
129
|
-
name: '
|
|
129
|
+
name: 'outdent'
|
|
130
130
|
},
|
|
131
|
-
isDisabled:
|
|
131
|
+
isDisabled: props.outdentDisabled,
|
|
132
132
|
isActive: false,
|
|
133
133
|
elemAfter: jsx("div", {
|
|
134
134
|
css: shortcutStyle
|
|
135
|
-
}, tooltip(
|
|
135
|
+
}, tooltip(toggleOutdentKeymap))
|
|
136
136
|
}, {
|
|
137
|
-
key: '
|
|
138
|
-
content:
|
|
137
|
+
key: 'indent',
|
|
138
|
+
content: labelIndent,
|
|
139
139
|
value: {
|
|
140
|
-
name: '
|
|
140
|
+
name: 'indent'
|
|
141
141
|
},
|
|
142
|
-
isDisabled:
|
|
142
|
+
isDisabled: props.indentDisabled,
|
|
143
143
|
isActive: false,
|
|
144
144
|
elemAfter: jsx("div", {
|
|
145
145
|
css: shortcutStyle
|
|
146
|
-
}, tooltip(
|
|
146
|
+
}, tooltip(toggleIndentKeymap))
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -14,7 +14,9 @@ export default function ToolbarListsIndentation(props) {
|
|
|
14
14
|
showIndentationButtons = props.showIndentationButtons,
|
|
15
15
|
popupsMountPoint = props.popupsMountPoint,
|
|
16
16
|
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
17
|
-
popupsScrollableElement = props.popupsScrollableElement
|
|
17
|
+
popupsScrollableElement = props.popupsScrollableElement,
|
|
18
|
+
indentDisabled = props.indentDisabled,
|
|
19
|
+
outdentDisabled = props.outdentDisabled;
|
|
18
20
|
|
|
19
21
|
if (isSmall) {
|
|
20
22
|
return jsx(ToolbarDropdown, {
|
|
@@ -28,6 +30,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
28
30
|
showIndentationButtons: showIndentationButtons,
|
|
29
31
|
orderedListActive: orderedListActive,
|
|
30
32
|
orderedListDisabled: orderedListDisabled,
|
|
33
|
+
indentDisabled: indentDisabled,
|
|
34
|
+
outdentDisabled: outdentDisabled,
|
|
31
35
|
disabled: disabled,
|
|
32
36
|
onItemActivated: onItemActivated
|
|
33
37
|
});
|
|
@@ -41,6 +45,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
41
45
|
showIndentationButtons: showIndentationButtons,
|
|
42
46
|
orderedListActive: orderedListActive,
|
|
43
47
|
orderedListDisabled: orderedListDisabled,
|
|
48
|
+
indentDisabled: indentDisabled,
|
|
49
|
+
outdentDisabled: outdentDisabled,
|
|
44
50
|
disabled: disabled,
|
|
45
51
|
onItemActivated: onItemActivated
|
|
46
52
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { toggleBulletList, toggleOrderedList } from '../../list/commands';
|
|
1
|
+
import { indentList, outdentList, toggleBulletList, toggleOrderedList } from '../../list/commands';
|
|
2
|
+
import { getIndentCommand as indentParagraphOrHeading, getOutdentCommand as outdentParagraphOrHeading } from '../../indentation/commands';
|
|
3
|
+
import { getIndentCommand as indentTaskList, getUnindentCommand as outdentTaskList } from '../../tasks-and-decisions/pm-plugins/keymaps';
|
|
2
4
|
import { INPUT_METHOD } from '../../analytics';
|
|
5
|
+
import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
|
|
3
6
|
export function onItemActivated(_ref) {
|
|
4
7
|
var buttonName = _ref.buttonName,
|
|
5
8
|
editorView = _ref.editorView;
|
|
@@ -14,26 +17,41 @@ export function onItemActivated(_ref) {
|
|
|
14
17
|
break;
|
|
15
18
|
|
|
16
19
|
case 'indent':
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
{
|
|
21
|
+
var node = indentationButtonsPluginKey.getState(editorView.state).node;
|
|
22
|
+
|
|
23
|
+
if (node === 'paragraph_heading') {
|
|
24
|
+
indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (node === 'list') {
|
|
28
|
+
indentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (node === 'taskList') {
|
|
32
|
+
indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
26
37
|
|
|
27
38
|
case 'outdent':
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
{
|
|
40
|
+
var _node = indentationButtonsPluginKey.getState(editorView.state).node;
|
|
41
|
+
|
|
42
|
+
if (_node === 'paragraph_heading') {
|
|
43
|
+
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (_node === 'list') {
|
|
47
|
+
outdentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (_node === 'taskList') {
|
|
51
|
+
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
38
56
|
}
|
|
39
57
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TextSelection } from 'prosemirror-state';
|
|
2
2
|
import { pluginKey } from '../pm-plugins/key';
|
|
3
3
|
import { ACTIONS } from '../pm-plugins/actions';
|
|
4
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
5
|
export var openTypeAhead = function openTypeAhead(props) {
|
|
5
6
|
return function (tr) {
|
|
6
7
|
var triggerHandler = props.triggerHandler,
|
|
@@ -21,6 +22,8 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
21
22
|
inputMethod = _ref.inputMethod,
|
|
22
23
|
query = _ref.query;
|
|
23
24
|
return function (tr) {
|
|
25
|
+
var _selection$$head, _selection$$head$pare, _selection$$head$pare2, _selection$$head$pare3;
|
|
26
|
+
|
|
24
27
|
openTypeAhead({
|
|
25
28
|
triggerHandler: triggerHandler,
|
|
26
29
|
inputMethod: inputMethod,
|
|
@@ -44,6 +47,12 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
44
47
|
|
|
45
48
|
if (nodeAtCursor && isPlaceholderAtCursorPosition) {
|
|
46
49
|
tr.delete(cursorPos, cursorPos + nodeAtCursor.nodeSize);
|
|
50
|
+
} // ME-2375 remove the superfluous '@' inserted before decoration
|
|
51
|
+
// by composition (https://github.com/ProseMirror/prosemirror/issues/903)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if (browser.chrome && browser.android && cursorPos > 2 && !!(selection !== null && selection !== void 0 && (_selection$$head = selection.$head) !== null && _selection$$head !== void 0 && (_selection$$head$pare = _selection$$head.parent) !== null && _selection$$head$pare !== void 0 && _selection$$head$pare.textContent) && (_selection$$head$pare2 = (_selection$$head$pare3 = selection.$head.parent.textContent).endsWith) !== null && _selection$$head$pare2 !== void 0 && _selection$$head$pare2.call(_selection$$head$pare3, '@')) {
|
|
55
|
+
tr.delete(cursorPos - 1, cursorPos);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
return tr;
|
|
@@ -13,10 +13,34 @@ var insideContentArea = function insideContentArea(ref) {
|
|
|
13
13
|
|
|
14
14
|
return false;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* @see ED-14699 - check if editor is inside a modal to continue to bring cursor to input when
|
|
18
|
+
* any part of the editor container is clicked
|
|
19
|
+
*
|
|
20
|
+
* Handles two cases when a click event is fired:
|
|
21
|
+
*
|
|
22
|
+
* 1. if editor (e.g. comment inside of Jira ticket view) is inside modal then ensure focus and cursor is brought to the input
|
|
23
|
+
* 2. if another modal is open (e.g. delete confirmation modal for confluence table) then ignore clicks as they shouldn't influence editor state
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export var checkForModal = function checkForModal(target) {
|
|
28
|
+
var modalDialog = target.closest('[role=dialog]');
|
|
29
|
+
|
|
30
|
+
if (modalDialog) {
|
|
31
|
+
// return false if not an editor inside modal, otherwise return true
|
|
32
|
+
return !!(modalDialog !== null && modalDialog !== void 0 && modalDialog.querySelector('.akEditor'));
|
|
33
|
+
} // no modal present so we can return true
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
return true;
|
|
37
|
+
};
|
|
16
38
|
|
|
17
39
|
var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
|
|
18
|
-
var
|
|
19
|
-
|
|
40
|
+
var _view$hasFocus;
|
|
41
|
+
|
|
42
|
+
var isTargetContentArea = event.currentTarget.querySelector('.ak-editor-content-area');
|
|
43
|
+
var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus = view.hasFocus) !== null && _view$hasFocus !== void 0 && _view$hasFocus.call(view));
|
|
20
44
|
var target = event.target; // @see https://product-fabric.atlassian.net/browse/ED-4287
|
|
21
45
|
// click event gets triggered twice on a checkbox (on <label> first and then on <input>)
|
|
22
46
|
// by the time it gets triggered on input, PM already re-renders nodeView and detaches it from DOM
|
|
@@ -28,13 +52,10 @@ var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
|
|
|
28
52
|
|
|
29
53
|
var isTextAreaClicked = target.nodeName === 'TEXTAREA';
|
|
30
54
|
var isBreadcrumbClicked = !!closestElement(target, 'nav[aria-label="Breadcrumbs"]');
|
|
31
|
-
var
|
|
32
|
-
var tragetIsNotChildOfContentArea = !insideContentArea(target.parentNode);
|
|
33
|
-
var editorIsNotInFocus = editorFocused === false;
|
|
55
|
+
var isTargetChildOfContentArea = insideContentArea(target.parentNode);
|
|
34
56
|
var selection = window.getSelection();
|
|
35
57
|
var isEditorPopupTextSelected = (selection === null || selection === void 0 ? void 0 : selection.type) === 'Range' && closestElement(selection === null || selection === void 0 ? void 0 : selection.anchorNode, '[data-editor-popup]');
|
|
36
|
-
var
|
|
37
|
-
var isClickOutsideEditor = (targetIsNotContentArea || tragetIsNotChildOfContentArea || editorIsNotInFocus) && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isModalDialog && !isBreadcrumbClicked && !isPopupClicked && !isEditorPopupTextSelected;
|
|
58
|
+
var isClickOutsideEditor = (!isTargetContentArea || !isTargetChildOfContentArea || !isEditorFocused) && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target); // click was within editor container and focus should be brought to input
|
|
38
59
|
|
|
39
60
|
if (isClickOutsideEditor && view) {
|
|
40
61
|
outsideProsemirrorEditorClickHandler(view, event);
|
|
@@ -42,15 +63,21 @@ var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
|
|
|
42
63
|
};
|
|
43
64
|
|
|
44
65
|
var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClickHandler(view, event) {
|
|
66
|
+
var _view$hasFocus2;
|
|
67
|
+
|
|
45
68
|
var dispatch = view.dispatch,
|
|
46
69
|
dom = view.dom,
|
|
47
70
|
state = view.state;
|
|
48
|
-
var editorFocused = !!(view && view.hasFocus());
|
|
49
71
|
var tr = state.tr;
|
|
50
|
-
|
|
72
|
+
var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus2 = view.hasFocus) !== null && _view$hasFocus2 !== void 0 && _view$hasFocus2.call(view));
|
|
73
|
+
var isBottomAreaClicked = event.clientY > dom.getBoundingClientRect().bottom;
|
|
74
|
+
|
|
75
|
+
if (isBottomAreaClicked) {
|
|
76
|
+
addParagraphAtEnd(tr);
|
|
77
|
+
}
|
|
51
78
|
|
|
52
79
|
if (hasGapCursorPlugin(state)) {
|
|
53
|
-
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view),
|
|
80
|
+
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
54
81
|
}
|
|
55
82
|
|
|
56
83
|
if (!tr.docChanged && !tr.selectionSet) {
|
|
@@ -66,12 +93,4 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
|
|
|
66
93
|
event.preventDefault();
|
|
67
94
|
};
|
|
68
95
|
|
|
69
|
-
var appendEmptyParagraph = function appendEmptyParagraph(event, dom, tr) {
|
|
70
|
-
var bottomAreaClicked = event.clientY > dom.getBoundingClientRect().bottom;
|
|
71
|
-
|
|
72
|
-
if (bottomAreaClicked) {
|
|
73
|
-
addParagraphAtEnd(tr);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
96
|
export { clickAreaClickHandler };
|
|
@@ -40,8 +40,8 @@ import { TableControlsPadding, MainToolbar, mainToolbarCustomComponentsSlotStyle
|
|
|
40
40
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
41
41
|
var CommentEditorMargin = 14;
|
|
42
42
|
var CommentEditorSmallerMargin = 8;
|
|
43
|
-
var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((
|
|
44
|
-
var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for
|
|
43
|
+
var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Paragraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n\n height: auto;\n background-color: ", ";\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, token('color.background.input', 'white'), token('color.border', N40), borderRadius());
|
|
44
|
+
var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for table controls. Otherwise margin collapse and controls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, tableCommentEditorStyles));
|
|
45
45
|
ContentArea.displayName = 'ContentArea';
|
|
46
46
|
var secondaryToolbarStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
|
|
47
47
|
|
|
@@ -14,7 +14,7 @@ import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
|
|
|
14
14
|
import { tableStyles } from '../../plugins/table/ui/common-styles';
|
|
15
15
|
import { placeholderStyles } from '../../plugins/placeholder/styles';
|
|
16
16
|
import { blocktypeStyles } from '../../plugins/block-type/styles';
|
|
17
|
-
import { codeBlockStyles
|
|
17
|
+
import { codeBlockStyles } from '../../plugins/code-block/styles';
|
|
18
18
|
import { listsStyles } from '../../plugins/list/styles';
|
|
19
19
|
import { ruleStyles } from '../../plugins/rule/styles';
|
|
20
20
|
import { mediaStyles } from '../../plugins/media/styles';
|
|
@@ -40,11 +40,9 @@ import { useFeatureFlags } from '../../plugins/feature-flags-context';
|
|
|
40
40
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
41
41
|
|
|
42
42
|
var contentStyles = function contentStyles(props) {
|
|
43
|
-
var _props$featureFlags;
|
|
44
|
-
|
|
45
43
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
|
46
44
|
theme: props.theme
|
|
47
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, token('color.border.focused', '#8cf'), placeholderTextStyles, placeholderStyles,
|
|
45
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, token('color.border.focused', '#8cf'), placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|