@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
|
@@ -28,6 +28,7 @@ import { FilePreviewItem } from './filePreviewItem';
|
|
|
28
28
|
import { downloadMedia, removeMediaGroupNode } from './utils';
|
|
29
29
|
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard } from './commands';
|
|
30
30
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
31
|
+
import { getCopyButtonConfig, showCopyButton } from '../../copy-button/toolbar';
|
|
31
32
|
|
|
32
33
|
var remove = function remove(state, dispatch) {
|
|
33
34
|
if (dispatch) {
|
|
@@ -95,7 +96,9 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
95
96
|
title: intl.formatMessage(messages.download)
|
|
96
97
|
}, {
|
|
97
98
|
type: 'separator'
|
|
98
|
-
}, {
|
|
99
|
+
}].concat(_toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaGroup), {
|
|
100
|
+
type: 'separator'
|
|
101
|
+
}] : []), [{
|
|
99
102
|
id: 'editor.media.delete',
|
|
100
103
|
type: 'button',
|
|
101
104
|
appearance: 'danger',
|
|
@@ -107,7 +110,7 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
107
110
|
title: intl.formatMessage(commonMessages.remove),
|
|
108
111
|
onClick: handleRemoveMediaGroup,
|
|
109
112
|
testId: 'media-toolbar-remove-button'
|
|
110
|
-
}];
|
|
113
|
+
}]);
|
|
111
114
|
return items;
|
|
112
115
|
};
|
|
113
116
|
|
|
@@ -159,7 +162,9 @@ var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToo
|
|
|
159
162
|
title: intl.formatMessage(messages.download)
|
|
160
163
|
}, {
|
|
161
164
|
type: 'separator'
|
|
162
|
-
}, {
|
|
165
|
+
}].concat(_toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaInline), {
|
|
166
|
+
type: 'separator'
|
|
167
|
+
}] : []), [{
|
|
163
168
|
id: 'editor.media.delete',
|
|
164
169
|
type: 'button',
|
|
165
170
|
appearance: 'danger',
|
|
@@ -171,7 +176,7 @@ var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToo
|
|
|
171
176
|
title: intl.formatMessage(commonMessages.remove),
|
|
172
177
|
onClick: removeInlineCard,
|
|
173
178
|
testId: 'media-toolbar-remove-button'
|
|
174
|
-
}];
|
|
179
|
+
}]);
|
|
175
180
|
return items;
|
|
176
181
|
};
|
|
177
182
|
|
|
@@ -257,7 +262,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
257
262
|
onClick: remove,
|
|
258
263
|
testId: 'media-toolbar-remove-button'
|
|
259
264
|
};
|
|
260
|
-
var items = [].concat(_toConsumableArray(toolbarButtons), [
|
|
265
|
+
var items = [].concat(_toConsumableArray(toolbarButtons), _toConsumableArray(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaSingle), {
|
|
266
|
+
type: 'separator'
|
|
267
|
+
}] : []), [removeButton]);
|
|
261
268
|
return items;
|
|
262
269
|
};
|
|
263
270
|
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
8
8
|
import { isSpecialMention } from '@atlaskit/mention/resource';
|
|
9
|
-
import { name as packageName, version as packageVersion } from '../../version
|
|
9
|
+
import { name as packageName, version as packageVersion } from '../../version-wrapper';
|
|
10
10
|
import { isTeamType } from './utils';
|
|
11
11
|
var componentName = 'mention';
|
|
12
12
|
export var buildAnalyticsPayload = function buildAnalyticsPayload(actionSubject, action, eventType, sessionId) {
|
|
@@ -24,7 +24,7 @@ import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
|
|
|
24
24
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
25
25
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, withAnalytics } from '../analytics';
|
|
26
26
|
import { messages } from './message';
|
|
27
|
-
import { getCopyButtonConfig, showCopyButton } from '../copy-button/
|
|
27
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
|
|
28
28
|
export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, {
|
|
29
29
|
shortName: ':info:',
|
|
30
30
|
id: 'atlassian-info'
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
1
2
|
import { insertSliceIntoRangeSelectionInsideList, insertSliceInsideOfPanelNodeSelected, insertSliceAtNodeEdge, insertSliceIntoEmptyNode } from './lists';
|
|
2
3
|
import { isListNode } from '../../list/utils/node';
|
|
3
4
|
import { isSelectionInsidePanel, isEmptyNode, isCursorSelectionAtTextStartOrEnd } from '../util';
|
|
4
5
|
export function insertSliceForLists(_ref) {
|
|
6
|
+
var _slice$content$firstC;
|
|
7
|
+
|
|
5
8
|
var tr = _ref.tr,
|
|
6
|
-
slice = _ref.slice
|
|
9
|
+
slice = _ref.slice,
|
|
10
|
+
schema = _ref.schema;
|
|
7
11
|
var selection = tr.selection,
|
|
8
12
|
_tr$selection = tr.selection,
|
|
9
13
|
$to = _tr$selection.$to,
|
|
@@ -37,9 +41,17 @@ export function insertSliceForLists(_ref) {
|
|
|
37
41
|
tr: tr,
|
|
38
42
|
slice: slice
|
|
39
43
|
});
|
|
40
|
-
}
|
|
44
|
+
} // When pasting a single list item into an action or decision, we skip the special "insert at node edge"
|
|
45
|
+
// logic so that prosemirror pastes the list's content into the action/decision, rather than
|
|
46
|
+
// pasting a whole list node directly after the action/decision item. (But we still preserve the
|
|
47
|
+
// existing "insert at" node edge" behaviour if dealing with a list with more than one item, so that
|
|
48
|
+
// it still inserts whole list node after the action/decision item).
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var pastingIntoActionOrDecision = Boolean(findParentNodeOfType([schema.nodes.taskList, schema.nodes.decisionList])(selection));
|
|
52
|
+
var oneListItem = slice.content.childCount === 1 && isListNode(slice.content.firstChild) && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.childCount) === 1;
|
|
41
53
|
|
|
42
|
-
if (isCursorSelectionAtTextStartOrEnd(selection)) {
|
|
54
|
+
if (!(pastingIntoActionOrDecision && oneListItem) && isCursorSelectionAtTextStartOrEnd(selection)) {
|
|
43
55
|
return insertSliceAtNodeEdge({
|
|
44
56
|
tr: tr,
|
|
45
57
|
slice: slice
|
|
@@ -111,6 +111,25 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
111
111
|
dispatch(tr);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
return true;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function handlePastePanelIntoList(slice) {
|
|
118
|
+
return function (state, dispatch) {
|
|
119
|
+
var schema = state.schema,
|
|
120
|
+
tr = state.tr;
|
|
121
|
+
var selection = tr.selection; // Check this pasting action is related to copy content from panel node into a selected the list node
|
|
122
|
+
|
|
123
|
+
var selectionParentListNode = selection.$to.node(selection.$to.depth - 1);
|
|
124
|
+
var panelNode = slice.content.firstChild;
|
|
125
|
+
|
|
126
|
+
if (!dispatch || !selectionParentListNode || (selectionParentListNode === null || selectionParentListNode === void 0 ? void 0 : selectionParentListNode.type) !== schema.nodes.listItem || !panelNode || (panelNode === null || panelNode === void 0 ? void 0 : panelNode.type) !== schema.nodes.panel || (panelNode === null || panelNode === void 0 ? void 0 : panelNode.content.firstChild) === undefined) {
|
|
127
|
+
return false;
|
|
128
|
+
} // Paste the panel node contents extracted instead of pasting the entire panel node
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
tr.replaceSelection(slice).scrollIntoView();
|
|
132
|
+
dispatch(tr);
|
|
114
133
|
return true;
|
|
115
134
|
};
|
|
116
135
|
} // If we paste a link onto some selected text, apply the link as a mark
|
|
@@ -678,7 +697,8 @@ export function handleRichText(slice) {
|
|
|
678
697
|
heading = _state$schema$nodes2.heading,
|
|
679
698
|
paragraph = _state$schema$nodes2.paragraph,
|
|
680
699
|
panel = _state$schema$nodes2.panel;
|
|
681
|
-
var selection = state.selection
|
|
700
|
+
var selection = state.selection,
|
|
701
|
+
schema = state.schema;
|
|
682
702
|
var firstChildOfSlice = (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.firstChild;
|
|
683
703
|
var lastChildOfSlice = (_slice$content2 = slice.content) === null || _slice$content2 === void 0 ? void 0 : _slice$content2.lastChild; // In case user is pasting inline code,
|
|
684
704
|
// any backtick ` immediately preceding it should be removed.
|
|
@@ -709,7 +729,8 @@ export function handleRichText(slice) {
|
|
|
709
729
|
if (isSliceContentListNodes || isTargetPanelEmpty) {
|
|
710
730
|
insertSliceForLists({
|
|
711
731
|
tr: tr,
|
|
712
|
-
slice: slice
|
|
732
|
+
slice: slice,
|
|
733
|
+
schema: schema
|
|
713
734
|
});
|
|
714
735
|
} else if (noNeedForSafeInsert) {
|
|
715
736
|
tr.replaceSelection(slice);
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents, withAnalytics } from '../../analytics';
|
|
9
9
|
import { getPasteSource } from '../util';
|
|
10
|
-
import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
|
|
10
|
+
import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelIntoList } from '../handlers';
|
|
11
11
|
import { pipe } from '../../../utils';
|
|
12
12
|
import { findParentNode } from 'prosemirror-utils';
|
|
13
13
|
import { mapSlice } from '../../../utils/slice';
|
|
@@ -252,6 +252,11 @@ export var handleRichTextWithAnalytics = function handleRichTextWithAnalytics(vi
|
|
|
252
252
|
type: PasteTypes.richText
|
|
253
253
|
}))(slice);
|
|
254
254
|
};
|
|
255
|
+
export var handlePastePanelIntoListWithAnalytics = function handlePastePanelIntoListWithAnalytics(view, event, slice) {
|
|
256
|
+
return pipe(handlePastePanelIntoList, pasteCommandWithAnalytics(view, event, slice, {
|
|
257
|
+
type: PasteTypes.richText
|
|
258
|
+
}))(slice);
|
|
259
|
+
};
|
|
255
260
|
export var handleExpandWithAnalytics = function handleExpandWithAnalytics(view, event, slice) {
|
|
256
261
|
return pipe(handleExpandPasteInTable, pasteCommandWithAnalytics(view, event, slice, {
|
|
257
262
|
type: PasteTypes.richText
|
|
@@ -268,7 +273,11 @@ export var handlePasteLinkOnSelectedTextWithAnalytics = function handlePasteLink
|
|
|
268
273
|
hyperlinkPasteOnText: true
|
|
269
274
|
}))(slice);
|
|
270
275
|
};
|
|
271
|
-
export var createPasteMeasurePayload = function createPasteMeasurePayload(
|
|
276
|
+
export var createPasteMeasurePayload = function createPasteMeasurePayload(_ref) {
|
|
277
|
+
var view = _ref.view,
|
|
278
|
+
duration = _ref.duration,
|
|
279
|
+
content = _ref.content,
|
|
280
|
+
distortedDuration = _ref.distortedDuration;
|
|
272
281
|
var pasteIntoNode = getActionSubjectId(view);
|
|
273
282
|
return {
|
|
274
283
|
action: ACTION.PASTED_TIMED,
|
|
@@ -277,7 +286,8 @@ export var createPasteMeasurePayload = function createPasteMeasurePayload(view,
|
|
|
277
286
|
attributes: {
|
|
278
287
|
pasteIntoNode: pasteIntoNode,
|
|
279
288
|
content: content,
|
|
280
|
-
time: duration
|
|
289
|
+
time: duration,
|
|
290
|
+
distortedDuration: distortedDuration
|
|
281
291
|
}
|
|
282
292
|
};
|
|
283
293
|
};
|
|
@@ -14,7 +14,7 @@ import { linkifyContent } from '../../hyperlink/utils';
|
|
|
14
14
|
import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
15
15
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
16
16
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
17
|
-
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics } from './analytics';
|
|
17
|
+
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelIntoListWithAnalytics } from './analytics';
|
|
18
18
|
import { analyticsPluginKey, PasteTypes } from '../../analytics';
|
|
19
19
|
import { insideTable, measurements } from '../../../utils';
|
|
20
20
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
@@ -168,8 +168,15 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
|
|
|
168
168
|
var content = getContentNodeTypes(slice.content);
|
|
169
169
|
var pasteId = uuid();
|
|
170
170
|
var measureName = "".concat(measurements.PASTE, "_").concat(pasteId);
|
|
171
|
-
measureRender(measureName, function (
|
|
172
|
-
var
|
|
171
|
+
measureRender(measureName, function (_ref) {
|
|
172
|
+
var duration = _ref.duration,
|
|
173
|
+
distortedDuration = _ref.distortedDuration;
|
|
174
|
+
var payload = createPasteMeasurePayload({
|
|
175
|
+
view: view,
|
|
176
|
+
duration: duration,
|
|
177
|
+
content: content,
|
|
178
|
+
distortedDuration: distortedDuration
|
|
179
|
+
});
|
|
173
180
|
|
|
174
181
|
if (payload) {
|
|
175
182
|
dispatchAnalyticsEvent(payload);
|
|
@@ -222,7 +229,15 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
|
|
|
222
229
|
var markdownSlice;
|
|
223
230
|
|
|
224
231
|
if (isPlainText) {
|
|
225
|
-
|
|
232
|
+
var _markdownSlice;
|
|
233
|
+
|
|
234
|
+
markdownSlice = getMarkdownSlice(text, slice.openStart, slice.openEnd); // https://product-fabric.atlassian.net/browse/ED-15134
|
|
235
|
+
// Lists are not allowed within Blockquotes at this time. Attempting to
|
|
236
|
+
// paste a markdown list ie. ">- foo" will yeild a markdownSlice of size 0.
|
|
237
|
+
// Rather then blocking the paste action with no UI feedback, this will instead
|
|
238
|
+
// force a "paste as plain text" action by clearing the markdownSlice.
|
|
239
|
+
|
|
240
|
+
markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
|
|
226
241
|
|
|
227
242
|
if (markdownSlice) {
|
|
228
243
|
// linkify text prior to converting to macro
|
|
@@ -351,6 +366,10 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
|
|
|
351
366
|
return true;
|
|
352
367
|
}
|
|
353
368
|
|
|
369
|
+
if (handlePastePanelIntoListWithAnalytics(view, event, slice)(state, dispatch)) {
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
|
|
354
373
|
return handleRichTextWithAnalytics(view, event, slice)(state, dispatch);
|
|
355
374
|
}
|
|
356
375
|
|
|
@@ -4,7 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
7
|
-
import { name as packageName, version as packageVersion } from '../../version
|
|
7
|
+
import { name as packageName, version as packageVersion } from '../../version-wrapper';
|
|
8
8
|
export var FABRIC_CHANNEL = 'fabric-elements';
|
|
9
9
|
export var createStatusAnalyticsAndFire = function createStatusAnalyticsAndFire(createAnalyticsEvent) {
|
|
10
10
|
return function (payload) {
|
|
@@ -16,7 +16,7 @@ import tableMessages from './ui/messages';
|
|
|
16
16
|
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
17
17
|
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
18
18
|
import { closestElement } from '../../utils/dom';
|
|
19
|
-
import { getCopyButtonConfig, showCopyButton } from '../copy-button/
|
|
19
|
+
import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar'; // TODO: ED-14403 investigate why these translations don't work
|
|
20
20
|
|
|
21
21
|
export var messages = defineMessages({
|
|
22
22
|
tableOptions: {
|
|
@@ -19,7 +19,7 @@ var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(C
|
|
|
19
19
|
export var tableStyles = function tableStyles(props) {
|
|
20
20
|
var _props$featureFlags;
|
|
21
21
|
|
|
22
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, token('color.background.neutral', N20A), token('color.icon', N300), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, token('color.background.neutral.hovered', B300), token('color.icon', 'white'), tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, token('elevation.surface', 'white'), ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, token('elevation.surface', 'white'), tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, token('elevation.surface', 'white'), tableToolbarSize, ClassName.TABLE_STICKY, token('elevation.surface', 'green'), stickyRowOffsetTop, stickyRowZIndex, token('elevation.surface', 'white'), token('elevation.shadow.overflow', "0 6px 4px -4px ".concat(N40A)), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, token('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, token('color.text.inverse', R500), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
|
|
22
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: 1px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\n }\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n // Fixes Chrome border clipping bug ED-15245\n background: ", ";\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n /*\n compensating for half of the insert column button\n that is aligned to the right edge initially on hover of the top right column control when table overflown,\n its center should be aligned with the edge\n */\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), ClassName.LAYOUT_BUTTON, token('color.background.neutral', N20A), token('color.icon', N300), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, token('color.background.neutral.hovered', B300), token('color.icon', 'white'), tableSharedStyle(props), columnControlsLineMarker(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, token('elevation.surface', 'white'), ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, token('elevation.surface', 'white'), tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, token('elevation.surface', 'white'), tableToolbarSize, ClassName.TABLE_STICKY, token('elevation.surface', 'green'), stickyRowOffsetTop, stickyRowZIndex, token('elevation.surface', 'white'), token('elevation.shadow.overflow', "0 6px 4px -4px ".concat(N40A)), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, token('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER, InsertMarker(props, "\n right: -1px;\n top: -12px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, token('color.text.inverse', N0), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, token('color.text.inverse', R500), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, tableBorderColor(props), ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, tableInsertColumnButtonSize / 2, tableInsertColumnButtonSize / 2, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR);
|
|
23
23
|
};
|
|
24
24
|
export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
|
|
25
25
|
export var tableCommentEditorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -16,14 +16,14 @@ import { insertTaskDecisionWithAnalytics } from '../commands';
|
|
|
16
16
|
import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
|
|
17
17
|
import { getBlockRange, getCurrentIndentLevel, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInsideTask, isInsideTaskOrDecisionItem, liftBlock, subtreeHeight, walkOut, isTable, getTaskItemIndex, isInsideDecision } from './helpers';
|
|
18
18
|
|
|
19
|
-
var indentationAnalytics = function indentationAnalytics(curIndentLevel, direction) {
|
|
19
|
+
var indentationAnalytics = function indentationAnalytics(curIndentLevel, direction, inputMethod) {
|
|
20
20
|
return {
|
|
21
21
|
action: ACTION.FORMATTED,
|
|
22
22
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
23
23
|
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_INDENT,
|
|
24
24
|
eventType: EVENT_TYPE.TRACK,
|
|
25
25
|
attributes: {
|
|
26
|
-
inputMethod:
|
|
26
|
+
inputMethod: inputMethod,
|
|
27
27
|
previousIndentationLevel: curIndentLevel,
|
|
28
28
|
newIndentLevel: direction === INDENT_DIRECTION.OUTDENT ? curIndentLevel - 1 : curIndentLevel + 1,
|
|
29
29
|
direction: direction,
|
|
@@ -92,15 +92,18 @@ var joinTaskDecisionFollowing = function joinTaskDecisionFollowing(state, dispat
|
|
|
92
92
|
return false;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
var
|
|
96
|
-
var
|
|
95
|
+
export var getUnindentCommand = function getUnindentCommand() {
|
|
96
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
97
|
+
return filter(isInsideTask, function (state, dispatch) {
|
|
98
|
+
var curIndentLevel = getCurrentIndentLevel(state.selection);
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
if (!curIndentLevel || curIndentLevel === 1) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
+
return withAnalytics(indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(autoJoin(liftSelection, ['taskList']))(state, dispatch);
|
|
105
|
+
});
|
|
106
|
+
}; // if selection is decision item or first action item in table cell
|
|
104
107
|
// then dont consume the Tab, as table-keymap should tab to the next cell
|
|
105
108
|
|
|
106
109
|
var shouldLetTabThroughInTable = function shouldLetTabThroughInTable(state) {
|
|
@@ -118,28 +121,31 @@ var shouldLetTabThroughInTable = function shouldLetTabThroughInTable(state) {
|
|
|
118
121
|
return false;
|
|
119
122
|
};
|
|
120
123
|
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
export var getIndentCommand = function getIndentCommand() {
|
|
125
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
126
|
+
return filter(isInsideTask, function (state, dispatch) {
|
|
127
|
+
// limit ui indentation to 6 levels
|
|
128
|
+
var curIndentLevel = getCurrentIndentLevel(state.selection);
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
if (!curIndentLevel || curIndentLevel >= 6) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
128
133
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
var _state$schema$nodes3 = state.schema.nodes,
|
|
135
|
+
taskList = _state$schema$nodes3.taskList,
|
|
136
|
+
taskItem = _state$schema$nodes3.taskItem;
|
|
137
|
+
var _state$selection = state.selection,
|
|
138
|
+
$from = _state$selection.$from,
|
|
139
|
+
$to = _state$selection.$to;
|
|
140
|
+
var maxDepth = subtreeHeight($from, $to, [taskList, taskItem]);
|
|
136
141
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
if (maxDepth >= 6) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
140
145
|
|
|
141
|
-
|
|
142
|
-
});
|
|
146
|
+
return withAnalytics(indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
|
|
147
|
+
});
|
|
148
|
+
};
|
|
143
149
|
|
|
144
150
|
var backspaceFrom = function backspaceFrom($from) {
|
|
145
151
|
return function (state, dispatch) {
|
|
@@ -156,7 +162,7 @@ var backspaceFrom = function backspaceFrom($from) {
|
|
|
156
162
|
paragraph = _state$schema$nodes4.paragraph;
|
|
157
163
|
|
|
158
164
|
if ($from.node($from.depth - 2).type === taskList) {
|
|
159
|
-
return
|
|
165
|
+
return getUnindentCommand()(state, dispatch);
|
|
160
166
|
} // bottom level, should "unwrap" taskItem contents into paragraph
|
|
161
167
|
// we achieve this by slicing the content out, and replacing
|
|
162
168
|
|
|
@@ -305,7 +311,7 @@ var splitListItem = function splitListItem(state, dispatch) {
|
|
|
305
311
|
return false;
|
|
306
312
|
};
|
|
307
313
|
|
|
308
|
-
var enter = filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTaskDecision, chainCommands(
|
|
314
|
+
var enter = filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTaskDecision, chainCommands(getUnindentCommand(), splitListItem)), function (state, dispatch) {
|
|
309
315
|
var selection = state.selection,
|
|
310
316
|
schema = state.schema;
|
|
311
317
|
var taskItem = schema.nodes.taskItem;
|
|
@@ -353,12 +359,12 @@ export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
353
359
|
'Shift-Tab': filter([isInsideTaskOrDecisionItem, function (state) {
|
|
354
360
|
return !shouldLetTabThroughInTable(state);
|
|
355
361
|
}], function (state, dispatch) {
|
|
356
|
-
return
|
|
362
|
+
return getUnindentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
357
363
|
}),
|
|
358
364
|
Tab: filter([isInsideTaskOrDecisionItem, function (state) {
|
|
359
365
|
return !shouldLetTabThroughInTable(state);
|
|
360
366
|
}], function (state, dispatch) {
|
|
361
|
-
return
|
|
367
|
+
return getIndentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
362
368
|
})
|
|
363
369
|
};
|
|
364
370
|
var defaultHandlers = consumeTabs ? {
|
|
@@ -3,26 +3,43 @@ import ToolbarListsIndentation from './ui';
|
|
|
3
3
|
import WithPluginState from '../../ui/WithPluginState';
|
|
4
4
|
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
5
5
|
import { pluginKey as listPluginKey } from '../list/pm-plugins/main';
|
|
6
|
+
import { pluginKey as indentationButtonsPluginKey, createPlugin as indentationButtonsPlugin } from './pm-plugins/indentation-buttons';
|
|
6
7
|
|
|
7
8
|
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
8
|
-
var showIndentationButtons = _ref.showIndentationButtons
|
|
9
|
+
var showIndentationButtons = _ref.showIndentationButtons,
|
|
10
|
+
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
9
11
|
return {
|
|
10
12
|
name: 'toolbarListsIndentation',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
pmPlugins: function pmPlugins() {
|
|
14
|
+
return [{
|
|
15
|
+
name: 'indentationButtons',
|
|
16
|
+
plugin: function plugin(_ref2) {
|
|
17
|
+
var dispatch = _ref2.dispatch;
|
|
18
|
+
return indentationButtonsPlugin({
|
|
19
|
+
dispatch: dispatch,
|
|
20
|
+
showIndentationButtons: showIndentationButtons,
|
|
21
|
+
allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}];
|
|
25
|
+
},
|
|
26
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
|
|
27
|
+
var editorView = _ref3.editorView,
|
|
28
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
29
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
30
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
31
|
+
toolbarSize = _ref3.toolbarSize,
|
|
32
|
+
disabled = _ref3.disabled,
|
|
33
|
+
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing;
|
|
19
34
|
var isSmall = toolbarSize < ToolbarSize.L;
|
|
20
35
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
21
36
|
plugins: {
|
|
22
|
-
listState: listPluginKey
|
|
37
|
+
listState: listPluginKey,
|
|
38
|
+
indentationState: indentationButtonsPluginKey
|
|
23
39
|
},
|
|
24
|
-
render: function render(
|
|
25
|
-
var listState =
|
|
40
|
+
render: function render(_ref4) {
|
|
41
|
+
var listState = _ref4.listState,
|
|
42
|
+
indentationState = _ref4.indentationState;
|
|
26
43
|
|
|
27
44
|
if (!listState) {
|
|
28
45
|
return null;
|
|
@@ -40,7 +57,9 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref)
|
|
|
40
57
|
bulletListDisabled: listState.bulletListDisabled,
|
|
41
58
|
orderedListActive: listState.orderedListActive,
|
|
42
59
|
orderedListDisabled: listState.orderedListDisabled,
|
|
43
|
-
showIndentationButtons: !!showIndentationButtons
|
|
60
|
+
showIndentationButtons: !!showIndentationButtons,
|
|
61
|
+
indentDisabled: indentationState.indentDisabled,
|
|
62
|
+
outdentDisabled: indentationState.outdentDisabled
|
|
44
63
|
});
|
|
45
64
|
}
|
|
46
65
|
});
|