@atlaskit/editor-core 171.0.1 → 172.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/CHANGELOG.md +84 -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/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 +8 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- 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/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 +8 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- 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/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 +8 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- 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,31 @@
|
|
|
1
|
+
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
2
|
+
import commonMessages from '../../messages';
|
|
3
|
+
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
4
|
+
import { createToolbarCopyCommand, resetCopiedState } from './commands';
|
|
5
|
+
import { pluginKey } from './pm-plugins/plugin-key';
|
|
6
|
+
export var getCopyButtonConfig = function getCopyButtonConfig(state, formatMessage, nodeType, onMouseEnter, onMouseLeave) {
|
|
7
|
+
var copyButtonState = pluginKey.getState(state);
|
|
8
|
+
return {
|
|
9
|
+
id: 'editor.floatingToolbar.copy',
|
|
10
|
+
type: 'button',
|
|
11
|
+
appearance: 'subtle',
|
|
12
|
+
icon: CopyIcon,
|
|
13
|
+
onClick: createToolbarCopyCommand(nodeType),
|
|
14
|
+
title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
|
|
15
|
+
onMouseEnter: onMouseEnter || hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
|
|
16
|
+
onMouseLeave: resetCopiedState(nodeType, onMouseLeave),
|
|
17
|
+
onFocus: hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
|
|
18
|
+
onBlur: hoverDecoration(nodeType, false),
|
|
19
|
+
hideTooltipOnClick: false,
|
|
20
|
+
tabIndex: null // TODO select and delete styling needs to be removed when keyboard cursor moves away
|
|
21
|
+
// problem already exist with delete as well
|
|
22
|
+
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export var showCopyButton = function showCopyButton(state) {
|
|
26
|
+
return state && // Check if the Copy button plugin is enabled
|
|
27
|
+
// @ts-ignore pluginKey.key
|
|
28
|
+
state.plugins.find(function (p) {
|
|
29
|
+
return p.key === pluginKey.key;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var copyButtonState = pluginKey.getState(state);
|
|
8
|
-
return {
|
|
9
|
-
id: 'editor.floatingToolbar.copy',
|
|
10
|
-
type: 'button',
|
|
11
|
-
appearance: 'subtle',
|
|
12
|
-
icon: CopyIcon,
|
|
13
|
-
onClick: copy(nodeType),
|
|
14
|
-
title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
|
|
15
|
-
onMouseEnter: onMouseEnter || hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
|
|
16
|
-
onMouseLeave: resetCopiedState(nodeType, onMouseLeave),
|
|
17
|
-
onFocus: hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
|
|
18
|
-
onBlur: hoverDecoration(nodeType, false),
|
|
19
|
-
hideTooltipOnClick: false,
|
|
20
|
-
tabIndex: null // TODO select and delete styling needs to be removed when keyboard cursor moves away
|
|
21
|
-
// problem already exist with delete as well
|
|
1
|
+
import { findSelectedNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
|
|
2
|
+
import { DOMSerializer } from 'prosemirror-model';
|
|
3
|
+
export function getSelectedNodeOrNodeParentByNodeType(_ref) {
|
|
4
|
+
var nodeType = _ref.nodeType,
|
|
5
|
+
selection = _ref.selection;
|
|
6
|
+
var node = findSelectedNodeOfType(nodeType)(selection);
|
|
22
7
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
if (!node) {
|
|
9
|
+
node = findParentNodeOfType(nodeType)(selection);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return node;
|
|
13
|
+
}
|
|
14
|
+
export var toDOM = function toDOM(node, schema) {
|
|
15
|
+
return DOMSerializer.fromSchema(schema).serializeNode(node);
|
|
31
16
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
2
3
|
import commonMessages from '../../messages';
|
|
3
4
|
import { deleteExpand } from './commands';
|
|
4
5
|
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
5
6
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
7
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
|
|
6
8
|
export var getToolbarConfig = function getToolbarConfig(state, _ref) {
|
|
7
9
|
var formatMessage = _ref.formatMessage;
|
|
8
10
|
|
|
@@ -20,7 +22,9 @@ export var getToolbarConfig = function getToolbarConfig(state, _ref) {
|
|
|
20
22
|
},
|
|
21
23
|
nodeType: [nestedExpand, expand],
|
|
22
24
|
offset: [0, 6],
|
|
23
|
-
items: [{
|
|
25
|
+
items: [].concat(_toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, formatMessage, [nestedExpand, expand]), {
|
|
26
|
+
type: 'separator'
|
|
27
|
+
}] : []), [{
|
|
24
28
|
id: 'editor.expand.delete',
|
|
25
29
|
type: 'button',
|
|
26
30
|
appearance: 'danger',
|
|
@@ -32,7 +36,7 @@ export var getToolbarConfig = function getToolbarConfig(state, _ref) {
|
|
|
32
36
|
onBlur: hoverDecoration([nestedExpand, expand], false),
|
|
33
37
|
title: formatMessage(commonMessages.remove),
|
|
34
38
|
tabIndex: null
|
|
35
|
-
}]
|
|
39
|
+
}])
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -13,6 +13,7 @@ import { getPluginState } from './pm-plugins/main';
|
|
|
13
13
|
import { getSelectedExtension } from './utils';
|
|
14
14
|
import { updateExtensionLayout, removeExtension } from './commands';
|
|
15
15
|
import { pluginKey as macroPluginKey } from '../macro/plugin-key';
|
|
16
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
|
|
16
17
|
export var messages = defineMessages({
|
|
17
18
|
edit: {
|
|
18
19
|
id: 'fabric.editor.edit',
|
|
@@ -116,7 +117,9 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
116
117
|
}, {
|
|
117
118
|
type: 'extensions-placeholder',
|
|
118
119
|
separator: 'end'
|
|
119
|
-
}, {
|
|
120
|
+
}], _toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, nodeType), {
|
|
121
|
+
type: 'separator'
|
|
122
|
+
}] : []), [{
|
|
120
123
|
id: 'editor.extension.delete',
|
|
121
124
|
type: 'button',
|
|
122
125
|
icon: RemoveIcon,
|
|
@@ -13,7 +13,7 @@ export var widerLayoutClassName = 'wider-layout';
|
|
|
13
13
|
export var wrapperStyle = function wrapperStyle(theme, extensionWidth) {
|
|
14
14
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n &.without-frame {\n background: transparent;\n }\n cursor: pointer;\n width: 100%;\n\n .extension-overflow-wrapper:not(.with-body) {\n overflow-x: auto;\n }\n\n /* extension container breakout, only works on top level */\n .ProseMirror\n > ", "\n > [extensiontype]\n &.", ",\n .ProseMirror\n > [extensiontype]\n &.", " {\n width: ", ";\n margin-left: 50%;\n transform: translateX(-50%);\n }\n"])), wrapperDefault(theme), dataConsumerSelector, widerLayoutClassName, widerLayoutClassName, extensionWidth);
|
|
15
15
|
};
|
|
16
|
-
export var header = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px ", "px
|
|
16
|
+
export var header = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: 4px 8px 8px;\n }\n &.without-frame {\n padding: 0;\n }\n"])), padding / 2, padding / 2);
|
|
17
17
|
export var content = function content(theme) {
|
|
18
18
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n"])), padding, themed({
|
|
19
19
|
light: token('elevation.surface', 'white'),
|
|
@@ -7,5 +7,5 @@ import { borderRadius } from '@atlaskit/theme/constants';
|
|
|
7
7
|
import { wrapperDefault } from '../styles';
|
|
8
8
|
import { token } from '@atlaskit/tokens';
|
|
9
9
|
export var wrapperStyle = function wrapperStyle(theme) {
|
|
10
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px;\n\n > img {\n border-radius: ", "px;\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), wrapperDefault(theme), borderRadius(), token('color.background.neutral.subtle', 'white'));
|
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n cursor: pointer;\n display: inline-flex;\n margin: 1px 1px 4px;\n\n > img {\n border-radius: ", "px;\n }\n\n &::after,\n &::before {\n vertical-align: text-top;\n display: inline-block;\n width: 1px;\n content: '';\n }\n\n &.with-children {\n padding: 0;\n background: ", ";\n }\n"])), wrapperDefault(theme), borderRadius(), token('color.background.neutral.subtle', 'white'));
|
|
11
11
|
};
|
|
@@ -3,21 +3,20 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import {
|
|
6
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
7
|
import { themed } from '@atlaskit/theme/components';
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import { N20, DN50, DN700, B200, N20A, N70 } from '@atlaskit/theme/colors';
|
|
10
|
-
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
10
|
import { token } from '@atlaskit/tokens';
|
|
12
11
|
export var padding = gridSize();
|
|
13
12
|
export var BODIED_EXT_PADDING = padding * 2;
|
|
14
13
|
export var wrapperDefault = function wrapperDefault(theme) {
|
|
15
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n position: relative;\n vertical-align: middle;\n
|
|
14
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n position: relative;\n vertical-align: middle;\n\n .ProseMirror-selectednode > span > & > .extension-overlay {\n box-shadow: inset 0px 0px 0px 2px ", ";\n opacity: 1;\n }\n\n &.with-overlay {\n .extension-overlay {\n background: ", ";\n color: transparent;\n }\n\n &:hover .extension-overlay {\n opacity: 1;\n }\n }\n"])), themed({
|
|
16
15
|
light: token('color.background.neutral', N20),
|
|
17
16
|
dark: token('color.background.neutral', DN50)
|
|
18
17
|
})(theme), borderRadius(), themed({
|
|
19
18
|
dark: token('color.text', DN700)
|
|
20
|
-
})(theme),
|
|
19
|
+
})(theme), token('color.border.selected', B200), token('color.background.neutral.hovered', N20A));
|
|
21
20
|
};
|
|
22
21
|
export var overlay = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n position: absolute;\n width: 100%;\n height: 100%;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.3s;\n"])), borderRadius());
|
|
23
22
|
export var placeholderFallback = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > img {\n margin: 0 4px;\n }\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: placeholder-fallback;\n"])));
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
10
|
+
function verifyJSON(json) {
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(json);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getSpellCheck(featureFlags) {
|
|
19
|
+
if (!!(featureFlags !== null && featureFlags !== void 0 && featureFlags['disableSpellcheckByBrowser'])) {
|
|
20
|
+
return _typeof(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) === 'object' ? featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser'] : typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) === 'string' ? verifyJSON(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) : undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!!(featureFlags !== null && featureFlags !== void 0 && featureFlags['disable-spellcheck-by-browser'])) {
|
|
24
|
+
return _typeof(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) === 'object' ? featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser'] : typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) === 'string' ? verifyJSON(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) : undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
15
29
|
/**
|
|
16
30
|
* Transforms EditorProps to an FeatureFlags object,
|
|
17
31
|
* which is used by both current and archv3 editors.
|
|
@@ -19,7 +33,7 @@ var safeNumberFeatureFlag = function safeNumberFeatureFlag(value) {
|
|
|
19
33
|
|
|
20
34
|
|
|
21
35
|
export function createFeatureFlagsFromProps(props) {
|
|
22
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$
|
|
36
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$collabEdit, _props$collabEdit2, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38;
|
|
23
37
|
|
|
24
38
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
25
39
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
@@ -49,16 +63,14 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
49
63
|
plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags22 = props.featureFlags) !== null && _props$featureFlags22 !== void 0 && _props$featureFlags22.plainTextPasteLinkification) : false),
|
|
50
64
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags23 = props.featureFlags) === null || _props$featureFlags23 === void 0 ? void 0 : _props$featureFlags23.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags24 = props.featureFlags) !== null && _props$featureFlags24 !== void 0 && _props$featureFlags24.collabAvatarScroll) : false),
|
|
51
65
|
ufo: Boolean(typeof ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.ufo) === 'boolean' ? !!((_props$featureFlags26 = props.featureFlags) !== null && _props$featureFlags26 !== void 0 && _props$featureFlags26.ufo) : false),
|
|
52
|
-
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
53
66
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags27 = props.featureFlags) === null || _props$featureFlags27 === void 0 ? void 0 : _props$featureFlags27.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags28 = props.featureFlags) !== null && _props$featureFlags28 !== void 0 && _props$featureFlags28.twoLineEditorToolbar) : false),
|
|
54
|
-
|
|
55
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.saferDispatchedTransactions) : false)),
|
|
56
|
-
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.maxUnsafeChromeSpellcheckingVersion),
|
|
67
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.saferDispatchedTransactions) : false)),
|
|
57
68
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
58
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
59
|
-
viewChangingExperimentToolbarStyle: typeof ((_props$
|
|
60
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
61
|
-
indentationButtonsInTheToolbar: Boolean(typeof ((_props$
|
|
62
|
-
floatingToolbarCopyButton: Boolean(typeof ((_props$
|
|
69
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
70
|
+
viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
|
|
71
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
|
|
72
|
+
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
|
|
73
|
+
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
|
|
74
|
+
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
|
|
63
75
|
});
|
|
64
76
|
}
|
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { PluginKey } from 'prosemirror-state';
|
|
12
12
|
import { IconFeedback } from '../quick-insert/assets';
|
|
13
|
-
import { version as coreVersion } from '../../version
|
|
13
|
+
import { version as coreVersion } from '../../version-wrapper';
|
|
14
14
|
import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
|
|
15
15
|
import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
|
|
16
16
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
@@ -52,12 +52,6 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
52
|
|
|
53
53
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
54
|
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "handleKeydown", function (event) {
|
|
56
|
-
if (event.metaKey && event.key === 'f') {
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
|
|
61
55
|
_defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
|
|
62
56
|
if (_this.props.isActive) {
|
|
63
57
|
_this.props.onCancel({
|
|
@@ -72,21 +66,6 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
_createClass(FindReplaceToolbarButton, [{
|
|
75
|
-
key: "componentDidMount",
|
|
76
|
-
value: function componentDidMount() {
|
|
77
|
-
window.addEventListener('keydown', this.handleKeydown);
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "componentWillUnmount",
|
|
81
|
-
value: function componentWillUnmount() {
|
|
82
|
-
window.removeEventListener('keydown', this.handleKeydown);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Prevent browser find opening if you hit cmd+f with cursor
|
|
86
|
-
* inside find/replace component
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
}, {
|
|
90
69
|
key: "render",
|
|
91
70
|
value: function render() {
|
|
92
71
|
var _this2 = this;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
@@ -16,9 +15,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
15
|
import { css, jsx } from '@emotion/react';
|
|
17
16
|
import { Component } from 'react';
|
|
18
17
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
19
|
-
import { B400 } from '@atlaskit/theme/colors';
|
|
20
|
-
|
|
21
|
-
import Item, { itemThemeNamespace } from '@atlaskit/item';
|
|
18
|
+
import { B400 } from '@atlaskit/theme/colors';
|
|
19
|
+
import { ButtonItem } from '@atlaskit/menu';
|
|
22
20
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
23
21
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
22
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -29,26 +27,8 @@ export var menuItemDimensions = {
|
|
|
29
27
|
height: 32
|
|
30
28
|
};
|
|
31
29
|
var spacer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n padding: 8px;\n"])));
|
|
32
|
-
var menuContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: ", "px;\n\n // temporary solution
|
|
33
|
-
var padding = gridSize();
|
|
30
|
+
var menuContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: ", "px;\n\n // temporary solution to retain spacing defined by @atlaskit/Item\n & button {\n min-height: ", "px;\n padding: 8px 8px 7px;\n\n & > [data-item-elem-before] {\n margin-right: ", "px;\n }\n }\n"])), menuItemDimensions.width, gridSize() * 4, gridSize() / 2);
|
|
34
31
|
export var itemSpacing = gridSize() / 2;
|
|
35
|
-
var editorItemTheme = {
|
|
36
|
-
borderRadius: 0,
|
|
37
|
-
beforeItemSpacing: {
|
|
38
|
-
compact: itemSpacing
|
|
39
|
-
},
|
|
40
|
-
padding: {
|
|
41
|
-
compact: {
|
|
42
|
-
bottom: padding,
|
|
43
|
-
left: padding,
|
|
44
|
-
right: padding,
|
|
45
|
-
top: padding
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
height: {
|
|
49
|
-
compact: menuItemDimensions.height
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
32
|
|
|
53
33
|
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
54
34
|
_inherits(Dropdown, _Component);
|
|
@@ -76,10 +56,9 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
76
56
|
}, items.filter(function (item) {
|
|
77
57
|
return !item.hidden;
|
|
78
58
|
}).map(function (item, idx) {
|
|
79
|
-
var itemContent = jsx(
|
|
59
|
+
var itemContent = jsx(ButtonItem, {
|
|
80
60
|
key: idx,
|
|
81
|
-
|
|
82
|
-
elemBefore: _this.renderSelected(item, intl),
|
|
61
|
+
iconBefore: _this.renderSelected(item, intl),
|
|
83
62
|
onClick: function onClick() {
|
|
84
63
|
/**
|
|
85
64
|
* The order of dispatching the event and hide() is important, because
|
|
@@ -92,7 +71,9 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
92
71
|
},
|
|
93
72
|
"data-testid": item.testId,
|
|
94
73
|
isDisabled: item.disabled,
|
|
95
|
-
|
|
74
|
+
onMouseDown: function onMouseDown(e) {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
}
|
|
96
77
|
}, item.title);
|
|
97
78
|
|
|
98
79
|
if (item.tooltip) {
|