@atlaskit/editor-core 159.0.1 → 162.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 +56 -0
- package/dist/cjs/actions/index.js +76 -48
- package/dist/cjs/extensibility.js +2 -2
- package/dist/cjs/labs/next/full-page.js +1 -1
- package/dist/cjs/plugins/block-type/styles.js +5 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
- package/dist/cjs/plugins/card/messages.js +4 -4
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
- package/dist/cjs/plugins/card/ui/styled.js +5 -13
- package/dist/cjs/plugins/card/ui/types.js +5 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
- package/dist/cjs/plugins/code-block/styles.js +45 -38
- package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/cjs/plugins/extension/utils.js +57 -12
- package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
- package/dist/cjs/plugins/list/commands/index.js +35 -38
- package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/styles.js +2 -2
- package/dist/cjs/plugins/media/utils/media-single.js +15 -2
- package/dist/cjs/plugins/paste/handlers.js +19 -5
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/placeholder-text/index.js +45 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/table/commands/index.js +0 -6
- package/dist/cjs/plugins/table/commands/insert.js +1 -1
- package/dist/cjs/plugins/table/commands/misc.js +5 -18
- package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
- package/dist/cjs/plugins/table/handlers.js +6 -2
- package/dist/cjs/plugins/table/index.js +7 -13
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/cjs/plugins/table/reducer.js +0 -7
- package/dist/cjs/plugins/table/toolbar.js +5 -15
- package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -1
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +47 -8
- package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
- package/dist/cjs/plugins/table/utils/nodes.js +15 -15
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
- package/dist/cjs/plugins/text-formatting/styles.js +5 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/cjs/plugins/text-formatting/utils.js +30 -2
- package/dist/cjs/plugins/type-ahead/api.js +32 -1
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +32 -9
- package/dist/cjs/utils/index.js +1 -8
- package/dist/cjs/utils/insert.js +1 -9
- package/dist/cjs/utils/selection.js +2 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +20 -23
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -2
- package/dist/es2019/plugins/block-type/styles.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
- package/dist/es2019/plugins/card/messages.js +4 -4
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
- package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/es2019/plugins/card/ui/styled.js +2 -2
- package/dist/es2019/plugins/card/ui/types.js +1 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
- package/dist/es2019/plugins/code-block/styles.js +14 -14
- package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
- package/dist/es2019/plugins/extension/utils.js +37 -2
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
- package/dist/es2019/plugins/layout/styles.js +5 -1
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
- package/dist/es2019/plugins/list/commands/index.js +29 -28
- package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/styles.js +1 -1
- package/dist/es2019/plugins/media/utils/media-single.js +14 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/placeholder-text/index.js +46 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
- package/dist/es2019/plugins/table/commands/index.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +5 -11
- package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +6 -2
- package/dist/es2019/plugins/table/index.js +4 -8
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/es2019/plugins/table/reducer.js +0 -9
- package/dist/es2019/plugins/table/toolbar.js +1 -4
- package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +41 -8
- package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
- package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
- package/dist/es2019/plugins/table/utils/nodes.js +11 -11
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/es2019/plugins/text-formatting/styles.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/es2019/plugins/text-formatting/utils.js +13 -1
- package/dist/es2019/plugins/type-ahead/api.js +31 -2
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
- package/dist/es2019/plugins/type-ahead/utils.js +15 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +45 -23
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/insert.js +2 -10
- package/dist/es2019/utils/selection.js +1 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +76 -48
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -2
- package/dist/esm/plugins/block-type/styles.js +4 -2
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
- package/dist/esm/plugins/card/messages.js +4 -4
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/esm/plugins/card/ui/assets/card.js +1 -1
- package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
- package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
- package/dist/esm/plugins/card/ui/assets/url.js +1 -1
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/esm/plugins/card/ui/styled.js +2 -2
- package/dist/esm/plugins/card/ui/types.js +1 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
- package/dist/esm/plugins/code-block/styles.js +42 -38
- package/dist/esm/plugins/extension/plugin-factory.js +3 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/esm/plugins/extension/utils.js +51 -9
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
- package/dist/esm/plugins/layout/styles.js +2 -2
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
- package/dist/esm/plugins/list/commands/index.js +33 -34
- package/dist/esm/plugins/list/utils/replace-content.js +21 -0
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/utils/media-single.js +12 -1
- package/dist/esm/plugins/paste/handlers.js +19 -5
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/placeholder-text/index.js +44 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
- package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/table/commands/index.js +1 -1
- package/dist/esm/plugins/table/commands/insert.js +1 -1
- package/dist/esm/plugins/table/commands/misc.js +5 -15
- package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
- package/dist/esm/plugins/table/handlers.js +6 -2
- package/dist/esm/plugins/table/index.js +6 -11
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/table.js +6 -37
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/esm/plugins/table/reducer.js +0 -7
- package/dist/esm/plugins/table/toolbar.js +1 -10
- package/dist/esm/plugins/table/transforms/metadata.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +43 -8
- package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
- package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
- package/dist/esm/plugins/table/utils/nodes.js +14 -14
- package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/esm/plugins/text-formatting/styles.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/esm/plugins/text-formatting/utils.js +18 -0
- package/dist/esm/plugins/type-ahead/api.js +30 -2
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
- package/dist/esm/plugins/type-ahead/utils.js +17 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +27 -9
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/insert.js +2 -10
- package/dist/esm/utils/selection.js +1 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
- package/dist/types/plugins/block-type/styles.d.ts +2 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
- package/dist/types/plugins/card/messages.d.ts +2 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/styled.d.ts +2 -3
- package/dist/types/plugins/card/ui/types.d.ts +12 -0
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/code-block/styles.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/utils.d.ts +3 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
- package/dist/types/plugins/layout/styles.d.ts +1 -1
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
- package/dist/types/plugins/list/commands/index.d.ts +0 -1
- package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/styles.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/panel/styles.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
- package/dist/types/plugins/rule/styles.d.ts +1 -1
- package/dist/types/plugins/table/commands/index.d.ts +1 -1
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/types.d.ts +1 -8
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
- package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
- package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/api.d.ts +11 -1
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/selection.d.ts +0 -1
- package/package.json +28 -26
|
@@ -13,7 +13,7 @@ import { createCommand, getPluginState } from '../pm-plugins/plugin-factory';
|
|
|
13
13
|
import { fixAutoSizedTable } from '../transforms';
|
|
14
14
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
15
15
|
import { createColumnControlsDecoration, createColumnSelectedDecoration } from '../utils/decoration';
|
|
16
|
-
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, isIsolating } from '../utils/nodes';
|
|
16
|
+
import { checkIfNumberColumnEnabled, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, isIsolating } from '../utils/nodes';
|
|
17
17
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations'; // #endregion
|
|
18
18
|
// #endregion
|
|
19
19
|
// #region Commands
|
|
@@ -40,8 +40,9 @@ export const setTableRef = ref => createCommand(state => {
|
|
|
40
40
|
tablePos,
|
|
41
41
|
tableWrapperTarget,
|
|
42
42
|
layout: layout || 'default',
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
isNumberColumnEnabled: checkIfNumberColumnEnabled(state.selection),
|
|
44
|
+
isHeaderRowEnabled: checkIfHeaderRowEnabled(state.selection),
|
|
45
|
+
isHeaderColumnEnabled: checkIfHeaderColumnEnabled(state.selection),
|
|
45
46
|
decorationSet,
|
|
46
47
|
resizeHandleColumnIndex: undefined
|
|
47
48
|
}
|
|
@@ -110,7 +111,7 @@ export const triggerUnlessTableHeader = command => (state, dispatch, view) => {
|
|
|
110
111
|
if (selection instanceof CellSelection) {
|
|
111
112
|
const rect = getSelectionRect(selection);
|
|
112
113
|
|
|
113
|
-
if (!checkIfHeaderRowEnabled(
|
|
114
|
+
if (!checkIfHeaderRowEnabled(selection) || rect && rect.top > 0) {
|
|
114
115
|
return command(state, dispatch, view);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
@@ -382,13 +383,6 @@ export const addResizeHandleDecorations = columnIndex => createCommand(state =>
|
|
|
382
383
|
}
|
|
383
384
|
};
|
|
384
385
|
}, tr => tr.setMeta('addToHistory', false));
|
|
385
|
-
export const setTableSize = (tableHeight, tableWidth) => createCommand({
|
|
386
|
-
type: 'SET_TABLE_SIZE',
|
|
387
|
-
data: {
|
|
388
|
-
tableHeight,
|
|
389
|
-
tableWidth
|
|
390
|
-
}
|
|
391
|
-
}, tr => tr.setMeta('addToHistory', false));
|
|
392
386
|
export const autoSizeTable = (view, node, table, basePos, opts) => {
|
|
393
387
|
view.dispatch(fixAutoSizedTable(view, node, table, basePos, opts));
|
|
394
388
|
return true;
|
|
@@ -313,7 +313,7 @@ export const toggleNumberColumnWithAnalytics = () => withAnalytics(state => {
|
|
|
313
313
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
314
314
|
actionSubjectId: null,
|
|
315
315
|
attributes: {
|
|
316
|
-
newState: !checkIfNumberColumnEnabled(state),
|
|
316
|
+
newState: !checkIfNumberColumnEnabled(state.selection),
|
|
317
317
|
totalRowCount,
|
|
318
318
|
totalColumnCount
|
|
319
319
|
},
|
|
@@ -6,8 +6,9 @@ import { isTableCollapsible } from './utils/collapse';
|
|
|
6
6
|
import { defaultTableSelection } from './pm-plugins/default-table-selection';
|
|
7
7
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
8
8
|
import { TableSortStep } from '@atlaskit/adf-schema/steps';
|
|
9
|
-
|
|
10
9
|
// #endregion
|
|
10
|
+
import { checkIfNumberColumnEnabled, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled } from './utils/nodes';
|
|
11
|
+
|
|
11
12
|
const nextTableSorting = (tr, table) => {
|
|
12
13
|
const tableSortStep = tr.steps.find(step => step instanceof TableSortStep);
|
|
13
14
|
return tableSortStep && table && table.pos === tableSortStep.pos ? tableSortStep.next : undefined;
|
|
@@ -63,7 +64,10 @@ const updateTableNodePluginState = ({
|
|
|
63
64
|
...defaultTableSelection,
|
|
64
65
|
tableNode,
|
|
65
66
|
ordering: nextTableSorting(tr, table),
|
|
66
|
-
resizeHandleColumnIndex: nextResizeHandleColumnIndex(tr, pluginState.resizeHandleColumnIndex)
|
|
67
|
+
resizeHandleColumnIndex: nextResizeHandleColumnIndex(tr, pluginState.resizeHandleColumnIndex),
|
|
68
|
+
isNumberColumnEnabled: checkIfNumberColumnEnabled(tr.selection),
|
|
69
|
+
isHeaderColumnEnabled: checkIfHeaderColumnEnabled(tr.selection),
|
|
70
|
+
isHeaderRowEnabled: checkIfHeaderRowEnabled(tr.selection)
|
|
67
71
|
};
|
|
68
72
|
};
|
|
69
73
|
|
|
@@ -15,7 +15,7 @@ import { createPlugin as createDecorationsPlugin } from './pm-plugins/decoration
|
|
|
15
15
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
16
16
|
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
17
17
|
import { createPlugin } from './pm-plugins/main';
|
|
18
|
-
import { pluginKey } from './pm-plugins/plugin-
|
|
18
|
+
import { pluginKey } from './pm-plugins/plugin-key';
|
|
19
19
|
import { createPlugin as createStickyHeadersPlugin, findStickyHeaderForTable, pluginKey as stickyHeadersPluginKey } from './pm-plugins/sticky-headers';
|
|
20
20
|
import { createPlugin as createFlexiResizingPlugin, pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
21
21
|
import { getToolbarConfig } from './toolbar';
|
|
@@ -25,7 +25,6 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
25
25
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
26
26
|
import LayoutButton from './ui/LayoutButton';
|
|
27
27
|
import { isLayoutSupported } from './utils';
|
|
28
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
29
28
|
import { ErrorBoundary } from '../../ui/ErrorBoundary';
|
|
30
29
|
|
|
31
30
|
const tablesPlugin = options => ({
|
|
@@ -111,6 +110,8 @@ const tablesPlugin = options => ({
|
|
|
111
110
|
}]; // workaround for prosemirrors delayed dom selection syncing during pointer drag
|
|
112
111
|
// causing issues with table selections in Safari
|
|
113
112
|
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
113
|
+
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
114
|
+
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
114
115
|
|
|
115
116
|
if (browser.safari) {
|
|
116
117
|
plugins.push({
|
|
@@ -162,15 +163,11 @@ const tablesPlugin = options => ({
|
|
|
162
163
|
insertRowButtonIndex,
|
|
163
164
|
isHeaderColumnEnabled,
|
|
164
165
|
isHeaderRowEnabled,
|
|
165
|
-
tableWrapperTarget
|
|
166
|
-
tableWidth
|
|
166
|
+
tableWrapperTarget
|
|
167
167
|
} = tablePluginState;
|
|
168
168
|
const {
|
|
169
169
|
allowControls
|
|
170
170
|
} = pluginConfig;
|
|
171
|
-
const {
|
|
172
|
-
tableRenderOptimization
|
|
173
|
-
} = getFeatureFlags(state) || {};
|
|
174
171
|
const stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
175
172
|
return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && tableRef && !isDragging && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
|
|
176
173
|
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
@@ -220,7 +217,6 @@ const tablesPlugin = options => ({
|
|
|
220
217
|
targetRef: tableWrapperTarget,
|
|
221
218
|
layout: layout,
|
|
222
219
|
isResizing: !!resizingPluginState && !!resizingPluginState.dragging,
|
|
223
|
-
tableWidth: tableRenderOptimization ? tableWidth : undefined,
|
|
224
220
|
stickyHeader: stickyHeader
|
|
225
221
|
}));
|
|
226
222
|
}
|
|
@@ -417,7 +417,7 @@ class TableComponent extends React.Component {
|
|
|
417
417
|
if (this.overflowShadowsObserver) {
|
|
418
418
|
var _this$state$stickyHea;
|
|
419
419
|
|
|
420
|
-
this.overflowShadowsObserver.observeCells((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky, containsHeaderRow(
|
|
420
|
+
this.overflowShadowsObserver.observeCells((_this$state$stickyHea = this.state.stickyHeader) === null || _this$state$stickyHea === void 0 ? void 0 : _this$state$stickyHea.sticky, containsHeaderRow(getNode()));
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
|
|
@@ -490,7 +490,7 @@ class TableComponent extends React.Component {
|
|
|
490
490
|
const headerRow = tableRef ? tableRef.querySelector('tr[data-header-row]') : undefined; //dont need to change tableHeight with tableRenderOptimization because it will be observed inside floating components
|
|
491
491
|
|
|
492
492
|
const tableHeight = tableRef && !tableRenderOptimization ? tableRef.offsetHeight : undefined;
|
|
493
|
-
const hasHeaderRow = containsHeaderRow(
|
|
493
|
+
const hasHeaderRow = containsHeaderRow(node);
|
|
494
494
|
const rowControls = /*#__PURE__*/React.createElement("div", {
|
|
495
495
|
className: ClassName.ROW_CONTROLS_WRAPPER
|
|
496
496
|
}, /*#__PURE__*/React.createElement(TableFloatingControls, {
|
|
@@ -5,12 +5,12 @@ import ReactNodeView from '../../../nodeviews/ReactNodeView';
|
|
|
5
5
|
import WithPluginState from '../../../ui/WithPluginState';
|
|
6
6
|
import { pluginKey as widthPluginKey } from '../../width';
|
|
7
7
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
8
|
-
import { getPluginState
|
|
8
|
+
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
9
|
+
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
9
10
|
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
10
11
|
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
11
12
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
12
13
|
import TableComponent from './TableComponent';
|
|
13
|
-
import { setTableSize } from '../commands';
|
|
14
14
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
15
15
|
import { EmitterEvents } from '../../../extensibility';
|
|
16
16
|
|
|
@@ -44,31 +44,17 @@ export default class TableView extends ReactNodeView {
|
|
|
44
44
|
_defineProperty(this, "hasHoveredRows", false);
|
|
45
45
|
|
|
46
46
|
this.getPos = props.getPos;
|
|
47
|
-
this.editorView = props.view;
|
|
48
47
|
this.tableRenderOptimization = props.tableRenderOptimization;
|
|
49
48
|
this.eventDispatcher = props.eventDispatcher;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
getContentDOM() {
|
|
53
|
-
var _window;
|
|
54
|
-
|
|
55
52
|
const rendered = DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
|
|
56
53
|
|
|
57
54
|
if (rendered.dom) {
|
|
58
55
|
this.table = rendered.dom;
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
if (this.tableRenderOptimization && this.table && !this.resizeObserver && (_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
62
|
-
this.resizeObserver = new ResizeObserver(entries => {
|
|
63
|
-
for (let entry of entries) {
|
|
64
|
-
const height = entry.contentRect ? entry.contentRect.height : entry.target.offsetHeight;
|
|
65
|
-
const width = entry.contentRect ? entry.contentRect.width : entry.target.offsetWidth;
|
|
66
|
-
setTableSize(height, width)(this.editorView.state, this.editorView.dispatch);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
this.resizeObserver.observe(this.table);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
58
|
return rendered;
|
|
73
59
|
}
|
|
74
60
|
|
|
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
4
|
import { DecorationSet } from 'prosemirror-view';
|
|
5
|
-
import { pluginKey as tablePluginKey } from '../plugin-
|
|
5
|
+
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
6
6
|
import { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration } from './utils';
|
|
7
7
|
export const pluginKey = new PluginKey('tableDecorationsPlugin');
|
|
8
8
|
export const getDecorations = state => pluginKey.getState(state);
|
|
@@ -12,7 +12,8 @@ import { TableCssClassName as ClassName } from '../types';
|
|
|
12
12
|
import { findControlsHoverDecoration, updateResizeHandles } from '../utils';
|
|
13
13
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
|
|
14
14
|
import { defaultTableSelection } from './default-table-selection';
|
|
15
|
-
import { createPluginState, getPluginState
|
|
15
|
+
import { createPluginState, getPluginState } from './plugin-factory';
|
|
16
|
+
import { pluginKey } from './plugin-key';
|
|
16
17
|
import TableCellNodeView from '../nodeviews/tableCell';
|
|
17
18
|
let isBreakoutEnabled;
|
|
18
19
|
let isDynamicTextSizingEnabled;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { PluginKey } from 'prosemirror-state';
|
|
2
1
|
import { pluginFactory } from '../../../utils/plugin-state-factory';
|
|
3
2
|
import { handleDocOrSelectionChanged } from '../handlers';
|
|
4
3
|
import reducer from '../reducer';
|
|
5
|
-
|
|
4
|
+
import { pluginKey } from './plugin-key';
|
|
6
5
|
export const {
|
|
7
6
|
createPluginState,
|
|
8
7
|
createCommand,
|
package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js
CHANGED
|
@@ -22,6 +22,8 @@ export const createPlugin = () => {
|
|
|
22
22
|
// DOM selection syncing during pointer drag.
|
|
23
23
|
//
|
|
24
24
|
// https://github.com/ProseMirror/prosemirror-view/commit/885258b80551ac87b81601d3ed25f552aeb22293
|
|
25
|
+
// NOTE: this workaround can be removed when next upgrading prosemirror as the issue will be fixed
|
|
26
|
+
// https://github.com/ProseMirror/prosemirror-view/pull/116
|
|
25
27
|
// This fix removes the selectionToDOM from the view
|
|
26
28
|
// prior to selectionToDOM being called.
|
|
27
29
|
// selectionToDOM checks if there is an "active"
|
|
@@ -4,7 +4,7 @@ import { pluginKey as widthPluginKey } from '../../../../../plugins/width';
|
|
|
4
4
|
import { mapChildren } from '../../../../../utils/slice';
|
|
5
5
|
import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
|
|
6
6
|
import { stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableControlsSpacing, tableScrollbarOffset } from '../../../ui/consts';
|
|
7
|
-
import { pluginKey as tablePluginKey } from '../../plugin-
|
|
7
|
+
import { pluginKey as tablePluginKey } from '../../plugin-key';
|
|
8
8
|
import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
|
|
9
9
|
import { updateStickyState } from '../commands';
|
|
10
10
|
import { getTop, getTree } from './dom';
|
|
@@ -86,15 +86,6 @@ export default ((pluginState, action) => {
|
|
|
86
86
|
...action.data
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
case 'SET_TABLE_SIZE':
|
|
90
|
-
if (pluginState.tableWidth !== action.data.tableWidth || pluginState.tableHeight !== action.data.tableHeight) {
|
|
91
|
-
return { ...pluginState,
|
|
92
|
-
...action.data
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return pluginState;
|
|
97
|
-
|
|
98
89
|
case 'SET_TABLE_REF':
|
|
99
90
|
case 'HOVER_ROWS':
|
|
100
91
|
case 'HOVER_COLUMNS':
|
|
@@ -6,7 +6,6 @@ import { deleteTableWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeader
|
|
|
6
6
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
7
7
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
8
8
|
import { TableCssClassName } from './types';
|
|
9
|
-
import { checkIfNumberColumnEnabled } from './utils';
|
|
10
9
|
import { isReferencedSource } from './utils/referentiality';
|
|
11
10
|
import { INPUT_METHOD } from '../analytics';
|
|
12
11
|
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
@@ -208,9 +207,7 @@ export const getToolbarConfig = config => (state, intl) => {
|
|
|
208
207
|
|
|
209
208
|
if (tableObject && pluginState.editorHasFocus) {
|
|
210
209
|
const nodeType = state.schema.nodes.table;
|
|
211
|
-
const menu = getToolbarMenuConfig(config,
|
|
212
|
-
isNumberColumnEnabled: checkIfNumberColumnEnabled(state)
|
|
213
|
-
}, intl);
|
|
210
|
+
const menu = getToolbarMenuConfig(config, pluginState, intl);
|
|
214
211
|
const cellItems = getCellItems(config, state, intl); // Check if we need to show confirm dialog for delete button
|
|
215
212
|
|
|
216
213
|
let confirmDialog;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pluginKey } from '../pm-plugins/plugin-
|
|
1
|
+
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
2
2
|
import { fireAnalytics } from './fix-tables'; // Set metadata on a ProseMirror transaction for debugging purposes in Synchrony
|
|
3
3
|
|
|
4
4
|
export const setMeta = meta => tr => {
|
|
@@ -4,7 +4,8 @@ import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@at
|
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { getPluginState
|
|
7
|
+
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
8
|
+
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
8
9
|
import { contextualMenuDropdownWidth, contextualMenuTriggerSize } from '../consts';
|
|
9
10
|
import { tablePopupStyles } from './styles.css';
|
|
10
11
|
import ContextualMenu from './ContextualMenu';
|
|
@@ -110,7 +110,7 @@ export class FloatingInsertButton extends React.Component {
|
|
|
110
110
|
const tableContainerWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_CONTAINER}`);
|
|
111
111
|
const tableWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_NODE_WRAPPER}`);
|
|
112
112
|
const index = type === 'column' ? insertColumnButtonIndex : insertRowButtonIndex;
|
|
113
|
-
const hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state);
|
|
113
|
+
const hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
|
|
114
114
|
return /*#__PURE__*/React.createElement(Popup, _extends({
|
|
115
115
|
target: targetCellRef,
|
|
116
116
|
mountTo: tableContainerWrapper || mountPoint,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { createRef } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -34,6 +34,20 @@ class LayoutButton extends React.Component {
|
|
|
34
34
|
constructor(...args) {
|
|
35
35
|
super(...args);
|
|
36
36
|
|
|
37
|
+
_defineProperty(this, "stickyButtonRef", /*#__PURE__*/createRef());
|
|
38
|
+
|
|
39
|
+
_defineProperty(this, "resizeObserver", new ResizeObserver(entries => {
|
|
40
|
+
entries.forEach(entry => {
|
|
41
|
+
const resizeButton = this.stickyButtonRef.current;
|
|
42
|
+
const tableWrapper = this.props.targetRef;
|
|
43
|
+
|
|
44
|
+
if (resizeButton && tableWrapper) {
|
|
45
|
+
const clientRect = tableWrapper.getBoundingClientRect();
|
|
46
|
+
resizeButton.style.left = `${clientRect.right}px`;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}));
|
|
50
|
+
|
|
37
51
|
_defineProperty(this, "handleClick", () => {
|
|
38
52
|
const {
|
|
39
53
|
state,
|
|
@@ -83,20 +97,22 @@ class LayoutButton extends React.Component {
|
|
|
83
97
|
return node.dataset['headerRow'] && node.classList.contains('sticky') ? node : null;
|
|
84
98
|
}
|
|
85
99
|
|
|
86
|
-
renderSticky(button, targetRef) {
|
|
100
|
+
renderSticky(button, targetRef, tableRef) {
|
|
87
101
|
const title = this.getTitle();
|
|
88
102
|
|
|
89
|
-
if (!targetRef || !(
|
|
103
|
+
if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
|
|
90
104
|
return null;
|
|
91
105
|
}
|
|
92
106
|
|
|
93
107
|
const pos = targetRef.getBoundingClientRect();
|
|
108
|
+
const tablePos = tableRef.getBoundingClientRect();
|
|
94
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
ref: this.stickyButtonRef,
|
|
95
111
|
"aria-label": title,
|
|
96
112
|
style: {
|
|
97
113
|
position: 'fixed',
|
|
98
114
|
top: pos.top + 22,
|
|
99
|
-
left:
|
|
115
|
+
left: tablePos.right
|
|
100
116
|
}
|
|
101
117
|
}, button);
|
|
102
118
|
}
|
|
@@ -135,22 +151,39 @@ class LayoutButton extends React.Component {
|
|
|
135
151
|
const button = this.toolbarButton();
|
|
136
152
|
const stickyTargetRef = stickyHeader && stickyHeader.sticky && stickyHeader.pos ? this.getStickyTargetRef(stickyHeader.pos) : null;
|
|
137
153
|
|
|
138
|
-
if (stickyTargetRef) {
|
|
139
|
-
return this.renderSticky(button, stickyTargetRef);
|
|
154
|
+
if (stickyTargetRef && this.props.targetRef) {
|
|
155
|
+
return this.renderSticky(button, stickyTargetRef, this.props.targetRef);
|
|
140
156
|
} else {
|
|
141
157
|
return this.renderPopup(button);
|
|
142
158
|
}
|
|
143
159
|
}
|
|
144
160
|
|
|
161
|
+
componentDidMount() {
|
|
162
|
+
const dom = this.props.editorView.dom;
|
|
163
|
+
const scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
164
|
+
|
|
165
|
+
if (scrollPanel instanceof HTMLElement) {
|
|
166
|
+
this.resizeObserver.observe(scrollPanel);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
componentWillUnmount() {
|
|
171
|
+
const dom = this.props.editorView.dom;
|
|
172
|
+
const scrollPanel = dom.closest('.fabric-editor-popup-scroll-parent');
|
|
173
|
+
|
|
174
|
+
if (scrollPanel instanceof HTMLElement) {
|
|
175
|
+
this.resizeObserver.unobserve(scrollPanel);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
145
179
|
shouldComponentUpdate(nextProps) {
|
|
146
180
|
const {
|
|
147
181
|
targetRef,
|
|
148
182
|
layout,
|
|
149
183
|
isResizing,
|
|
150
|
-
tableWidth,
|
|
151
184
|
stickyHeader
|
|
152
185
|
} = this.props;
|
|
153
|
-
return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing
|
|
186
|
+
return stickyHeader !== nextProps.stickyHeader || targetRef !== nextProps.targetRef || layout !== nextProps.layout || isResizing !== nextProps.isResizing;
|
|
154
187
|
}
|
|
155
188
|
|
|
156
189
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { css as deprecatedCss } from 'styled-components';
|
|
2
3
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
3
4
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
4
5
|
import { N40A, B300, N300, N20A, N0, R500 } from '@atlaskit/theme/colors';
|
|
@@ -40,7 +41,10 @@ const sentinelStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}`;
|
|
43
|
-
export const tableStyles =
|
|
44
|
+
export const tableStyles = props => {
|
|
45
|
+
var _props$featureFlags;
|
|
46
|
+
|
|
47
|
+
return css`
|
|
44
48
|
.${ClassName.LAYOUT_BUTTON} button {
|
|
45
49
|
background: ${N20A};
|
|
46
50
|
color: ${N300};
|
|
@@ -54,8 +58,8 @@ export const tableStyles = css`
|
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.ProseMirror {
|
|
57
|
-
${tableSharedStyle};
|
|
58
|
-
${columnControlsLineMarker};
|
|
61
|
+
${tableSharedStyle(props)};
|
|
62
|
+
${columnControlsLineMarker(props)};
|
|
59
63
|
${hoveredDeleteButton};
|
|
60
64
|
${hoveredCell};
|
|
61
65
|
${hoveredWarningCell};
|
|
@@ -73,7 +77,7 @@ export const tableStyles = css`
|
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
td.${ClassName.TABLE_CELL} {
|
|
76
|
-
background-color: ${tableCellBackgroundColor};
|
|
80
|
+
background-color: ${tableCellBackgroundColor(props)};
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
|
|
@@ -175,7 +179,7 @@ export const tableStyles = css`
|
|
|
175
179
|
|
|
176
180
|
tr.sticky th {
|
|
177
181
|
border-bottom: ${stickyHeaderBorderBottomWidth}px solid
|
|
178
|
-
${tableBorderColor};
|
|
182
|
+
${tableBorderColor(props)};
|
|
179
183
|
margin-right: -1px;
|
|
180
184
|
}
|
|
181
185
|
|
|
@@ -183,7 +187,7 @@ export const tableStyles = css`
|
|
|
183
187
|
border-right-width: 1px;
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
|
|
190
|
+
/* add left edge for first cell */
|
|
187
191
|
.${ClassName.TABLE_STICKY} tr.sticky > th:first-child {
|
|
188
192
|
margin-left: 0px;
|
|
189
193
|
}
|
|
@@ -242,16 +246,13 @@ export const tableStyles = css`
|
|
|
242
246
|
border-top: ${tableControlsSpacing - tableToolbarSize + 2}px solid white;
|
|
243
247
|
}
|
|
244
248
|
|
|
245
|
-
${props
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '';
|
|
249
|
-
}}
|
|
249
|
+
${(_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : ''}
|
|
250
|
+
${OverflowShadow(props)}
|
|
250
251
|
|
|
251
|
-
${OverflowShadow}
|
|
252
252
|
.${ClassName.TABLE_STICKY} .${ClassName.TABLE_STICKY_SHADOW} {
|
|
253
253
|
height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts
|
|
254
254
|
}
|
|
255
|
+
|
|
255
256
|
.less-padding {
|
|
256
257
|
padding: 0 ${tablePadding}px;
|
|
257
258
|
|
|
@@ -288,7 +289,7 @@ export const tableStyles = css`
|
|
|
288
289
|
width: 100% !important;
|
|
289
290
|
}
|
|
290
291
|
|
|
291
|
-
${columnControlsDecoration};
|
|
292
|
+
${columnControlsDecoration(props)};
|
|
292
293
|
|
|
293
294
|
/* Corner controls */
|
|
294
295
|
.${ClassName.CORNER_CONTROLS} {
|
|
@@ -299,7 +300,7 @@ export const tableStyles = css`
|
|
|
299
300
|
.${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
|
|
300
301
|
position: relative;
|
|
301
302
|
|
|
302
|
-
${InsertMarker(`
|
|
303
|
+
${InsertMarker(props, `
|
|
303
304
|
left: -11px;
|
|
304
305
|
top: 9px;
|
|
305
306
|
`)};
|
|
@@ -308,27 +309,29 @@ export const tableStyles = css`
|
|
|
308
309
|
.${ClassName.CORNER_CONTROLS_INSERT_COLUMN_MARKER} {
|
|
309
310
|
position: relative;
|
|
310
311
|
|
|
311
|
-
${InsertMarker(`
|
|
312
|
+
${InsertMarker(props, `
|
|
312
313
|
right: -1px;
|
|
313
314
|
top: -12px;
|
|
314
315
|
`)};
|
|
315
316
|
}
|
|
316
317
|
}
|
|
318
|
+
|
|
317
319
|
.${ClassName.CORNER_CONTROLS}.sticky {
|
|
318
320
|
.${ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER} {
|
|
319
321
|
/* sticky row insert dot overlaps other row insert and messes things up */
|
|
320
322
|
display: none !important;
|
|
321
323
|
}
|
|
322
324
|
}
|
|
325
|
+
|
|
323
326
|
.${ClassName.CONTROLS_CORNER_BUTTON} {
|
|
324
327
|
position: absolute;
|
|
325
328
|
top: 0;
|
|
326
329
|
width: ${tableToolbarSize + 1}px;
|
|
327
330
|
height: ${tableToolbarSize + 1}px;
|
|
328
|
-
border: 1px solid ${tableBorderColor};
|
|
331
|
+
border: 1px solid ${tableBorderColor(props)};
|
|
329
332
|
border-radius: 0;
|
|
330
333
|
border-top-left-radius: ${tableBorderRadiusSize}px;
|
|
331
|
-
background: ${tableToolbarColor};
|
|
334
|
+
background: ${tableToolbarColor(props)};
|
|
332
335
|
box-sizing: border-box;
|
|
333
336
|
padding: 0;
|
|
334
337
|
:focus {
|
|
@@ -339,6 +342,7 @@ export const tableStyles = css`
|
|
|
339
342
|
border-color: ${tableBorderSelectedColor};
|
|
340
343
|
background: ${tableToolbarSelectedColor};
|
|
341
344
|
}
|
|
345
|
+
|
|
342
346
|
.${ClassName.TABLE_CONTAINER}[data-number-column='true'] {
|
|
343
347
|
.${ClassName.CORNER_CONTROLS}, .${ClassName.CONTROLS_CORNER_BUTTON} {
|
|
344
348
|
width: ${akEditorTableToolbarSize + akEditorTableNumberColumnWidth}px;
|
|
@@ -347,11 +351,13 @@ export const tableStyles = css`
|
|
|
347
351
|
border-right-width: 0;
|
|
348
352
|
}
|
|
349
353
|
}
|
|
354
|
+
|
|
350
355
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.CONTROLS_CORNER_BUTTON}:hover {
|
|
351
356
|
border-color: ${tableBorderSelectedColor};
|
|
352
357
|
background: ${tableToolbarSelectedColor};
|
|
353
358
|
cursor: pointer;
|
|
354
359
|
}
|
|
360
|
+
|
|
355
361
|
:not(.${ClassName.IS_RESIZING})
|
|
356
362
|
.${ClassName.CONTROLS_CORNER_BUTTON}.${ClassName.HOVERED_CELL_IN_DANGER} {
|
|
357
363
|
border-color: ${tableBorderDeleteColor};
|
|
@@ -365,7 +371,7 @@ export const tableStyles = css`
|
|
|
365
371
|
display: none;
|
|
366
372
|
position: relative;
|
|
367
373
|
|
|
368
|
-
${InsertMarker(`
|
|
374
|
+
${InsertMarker(props, `
|
|
369
375
|
bottom: -1px;
|
|
370
376
|
left: -11px;
|
|
371
377
|
`)};
|
|
@@ -387,8 +393,8 @@ export const tableStyles = css`
|
|
|
387
393
|
z-index: ${akEditorUnitZIndex};
|
|
388
394
|
}
|
|
389
395
|
|
|
390
|
-
${HeaderButton(`
|
|
391
|
-
border-bottom: 1px solid ${tableBorderColor};
|
|
396
|
+
${HeaderButton(props, `
|
|
397
|
+
border-bottom: 1px solid ${tableBorderColor(props)};
|
|
392
398
|
border-right: 0px;
|
|
393
399
|
border-radius: 0;
|
|
394
400
|
height: 100%;
|
|
@@ -406,6 +412,7 @@ export const tableStyles = css`
|
|
|
406
412
|
}
|
|
407
413
|
`)}
|
|
408
414
|
}
|
|
415
|
+
|
|
409
416
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.ROW_CONTROLS} {
|
|
410
417
|
${HeaderButtonHover()}
|
|
411
418
|
${HeaderButtonDanger()}
|
|
@@ -420,25 +427,27 @@ export const tableStyles = css`
|
|
|
420
427
|
width: ${akEditorTableNumberColumnWidth + 1}px;
|
|
421
428
|
box-sizing: border-box;
|
|
422
429
|
}
|
|
430
|
+
|
|
423
431
|
.${ClassName.NUMBERED_COLUMN_BUTTON} {
|
|
424
|
-
border: 1px solid ${tableBorderColor};
|
|
432
|
+
border: 1px solid ${tableBorderColor(props)};
|
|
425
433
|
box-sizing: border-box;
|
|
426
434
|
margin-top: -1px;
|
|
427
435
|
padding-bottom: 2px;
|
|
428
436
|
padding: 10px 2px;
|
|
429
437
|
text-align: center;
|
|
430
438
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
431
|
-
background-color: ${tableToolbarColor};
|
|
432
|
-
color: ${tableTextColor};
|
|
433
|
-
border-color: ${tableBorderColor};
|
|
439
|
+
background-color: ${tableToolbarColor(props)};
|
|
440
|
+
color: ${tableTextColor(props)};
|
|
441
|
+
border-color: ${tableBorderColor(props)};
|
|
434
442
|
|
|
435
443
|
:first-child {
|
|
436
444
|
margin-top: 0;
|
|
437
445
|
}
|
|
438
446
|
:last-child {
|
|
439
|
-
border-bottom: 1px solid ${tableBorderColor};
|
|
447
|
+
border-bottom: 1px solid ${tableBorderColor(props)};
|
|
440
448
|
}
|
|
441
449
|
}
|
|
450
|
+
|
|
442
451
|
.${ClassName.WITH_CONTROLS} {
|
|
443
452
|
.${ClassName.CORNER_CONTROLS}, .${ClassName.ROW_CONTROLS} {
|
|
444
453
|
display: block;
|
|
@@ -567,6 +576,7 @@ export const tableStyles = css`
|
|
|
567
576
|
cursor: col-resize;
|
|
568
577
|
}
|
|
569
578
|
`;
|
|
579
|
+
};
|
|
570
580
|
export const tableFullPageEditorStyles = css`
|
|
571
581
|
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
572
582
|
margin-left: 0;
|
|
@@ -574,10 +584,25 @@ export const tableFullPageEditorStyles = css`
|
|
|
574
584
|
width: 100%;
|
|
575
585
|
}
|
|
576
586
|
`;
|
|
587
|
+
export const deprecatedTableFullPageEditorStyles = deprecatedCss`
|
|
588
|
+
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
589
|
+
margin-left: 0;
|
|
590
|
+
margin-right: 0;
|
|
591
|
+
width: 100%;
|
|
592
|
+
}
|
|
593
|
+
`;
|
|
577
594
|
export const tableCommentEditorStyles = css`
|
|
578
595
|
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
579
596
|
margin-left: 0;
|
|
580
597
|
margin-right: 0;
|
|
581
598
|
${scrollbarStyles};
|
|
582
599
|
}
|
|
600
|
+
`; // TODO remove this after migrated off styled-component
|
|
601
|
+
|
|
602
|
+
export const deprecatedTableCommentEditorStyles = deprecatedCss`
|
|
603
|
+
.ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
|
|
604
|
+
margin-left: 0;
|
|
605
|
+
margin-right: 0;
|
|
606
|
+
${scrollbarStyles};
|
|
607
|
+
}
|
|
583
608
|
`;
|