@atlaskit/editor-plugin-table 7.24.4 → 7.24.6
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 +23 -0
- package/dist/cjs/commands/misc.js +4 -2
- package/dist/cjs/commands-with-analytics.js +2 -2
- package/dist/cjs/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/nodeviews/TableContainer.js +4 -1
- package/dist/cjs/plugin.js +7 -36
- package/dist/cjs/toDOM.js +75 -0
- package/dist/cjs/toolbar.js +3 -3
- package/dist/cjs/types.js +1 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +2 -2
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/es2019/commands/misc.js +4 -2
- package/dist/es2019/commands-with-analytics.js +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/nodeviews/TableContainer.js +5 -1
- package/dist/es2019/plugin.js +9 -38
- package/dist/es2019/toDOM.js +65 -0
- package/dist/es2019/toolbar.js +3 -3
- package/dist/es2019/types.js +1 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +2 -2
- package/dist/es2019/ui/common-styles.js +8 -2
- package/dist/esm/commands/misc.js +4 -2
- package/dist/esm/commands-with-analytics.js +2 -2
- package/dist/esm/nodeviews/TableComponent.js +2 -2
- package/dist/esm/nodeviews/TableContainer.js +4 -1
- package/dist/esm/plugin.js +8 -37
- package/dist/esm/toDOM.js +68 -0
- package/dist/esm/toolbar.js +3 -3
- package/dist/esm/types.js +1 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/index.js +2 -2
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/types/commands/misc.d.ts +1 -1
- package/dist/types/commands-with-analytics.d.ts +1 -1
- package/dist/types/toDOM.d.ts +7 -0
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/commands/misc.d.ts +1 -1
- package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/toDOM.d.ts +7 -0
- package/dist/types-ts4.5/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +4 -7
- package/src/commands/misc.ts +4 -2
- package/src/commands-with-analytics.ts +4 -2
- package/src/nodeviews/TableComponent.tsx +10 -2
- package/src/nodeviews/TableContainer.tsx +7 -1
- package/src/plugin.tsx +11 -53
- package/src/toDOM.ts +135 -0
- package/src/toolbar.tsx +3 -1
- package/src/types.ts +1 -1
- package/src/ui/TableFloatingColumnControls/index.tsx +1 -1
- package/src/ui/TableFloatingControls/index.tsx +2 -4
- package/src/ui/common-styles.ts +8 -2
package/dist/es2019/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
5
5
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
@@ -26,10 +26,10 @@ import { createPlugin as createStickyHeadersPlugin, findStickyHeaderForTable, pl
|
|
|
26
26
|
import { createPlugin as createTableOverflowAnalyticsPlugin } from './pm-plugins/table-analytics';
|
|
27
27
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
28
28
|
import { createPlugin as createFlexiResizingPlugin, getPluginState as getFlexiResizingPlugin, pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
29
|
-
import { generateColgroup } from './pm-plugins/table-resizing/utils/colgroup';
|
|
30
29
|
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
31
30
|
import { createPlugin as createTableWidthPlugin, pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
32
31
|
import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
|
|
32
|
+
import { tableNodeSpecWithFixedToDOM } from './toDOM';
|
|
33
33
|
import { getToolbarConfig } from './toolbar';
|
|
34
34
|
import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
35
35
|
import FloatingContextualMenu from './ui/FloatingContextualMenu';
|
|
@@ -43,41 +43,6 @@ const defaultGetEditorFeatureFlags = () => ({});
|
|
|
43
43
|
|
|
44
44
|
// TODO: duplicating type instead of importing media plugin causing a circular dependency
|
|
45
45
|
|
|
46
|
-
// TODO: ED-23944 Move this override to `toDOM` function on table adf-schema nodespec
|
|
47
|
-
const tableNodeSpecWithFixedToDOM = tableOptions => {
|
|
48
|
-
if (!fg('platform_editor_lazy-node-views')) {
|
|
49
|
-
return table;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
...table,
|
|
53
|
-
toDOM: node => {
|
|
54
|
-
const attrs = {
|
|
55
|
-
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
56
|
-
'data-layout': node.attrs.layout,
|
|
57
|
-
'data-autosize': node.attrs.__autoSize,
|
|
58
|
-
'data-table-local-id': node.attrs.localId,
|
|
59
|
-
'data-table-width': node.attrs.width
|
|
60
|
-
};
|
|
61
|
-
let colgroup = '';
|
|
62
|
-
const {
|
|
63
|
-
allowColumnResizing
|
|
64
|
-
} = pluginConfig(tableOptions);
|
|
65
|
-
if (allowColumnResizing) {
|
|
66
|
-
colgroup = ['colgroup', {}, ...generateColgroup(node)];
|
|
67
|
-
}
|
|
68
|
-
return ['div', {
|
|
69
|
-
class: 'tableView-content-wrap'
|
|
70
|
-
}, ['div', {
|
|
71
|
-
class: 'pm-table-container'
|
|
72
|
-
}, ['div', {
|
|
73
|
-
class: 'pm-table-wrapper',
|
|
74
|
-
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
75
|
-
'data-layout': node.attrs.layout
|
|
76
|
-
}, ['table', attrs, colgroup, ['tbody', 0]]]]];
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
46
|
/**
|
|
82
47
|
* Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
83
48
|
* from `@atlaskit/editor-core`.
|
|
@@ -162,9 +127,15 @@ const tablesPlugin = ({
|
|
|
162
127
|
insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
|
|
163
128
|
},
|
|
164
129
|
nodes() {
|
|
130
|
+
const {
|
|
131
|
+
allowColumnResizing
|
|
132
|
+
} = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions);
|
|
165
133
|
return [{
|
|
166
134
|
name: 'table',
|
|
167
|
-
node: tableNodeSpecWithFixedToDOM(
|
|
135
|
+
node: tableNodeSpecWithFixedToDOM({
|
|
136
|
+
allowColumnResizing: Boolean(allowColumnResizing),
|
|
137
|
+
tableResizingEnabled: Boolean(options === null || options === void 0 ? void 0 : options.tableResizingEnabled)
|
|
138
|
+
})
|
|
168
139
|
}, {
|
|
169
140
|
name: 'tableHeader',
|
|
170
141
|
node: tableHeader
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { table } from '@atlaskit/adf-schema';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { generateColgroup } from './pm-plugins/table-resizing/utils/colgroup';
|
|
4
|
+
export const tableNodeSpecWithFixedToDOM = config => {
|
|
5
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
6
|
+
return table;
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
...table,
|
|
10
|
+
toDOM: node => {
|
|
11
|
+
const attrs = {
|
|
12
|
+
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
13
|
+
'data-layout': node.attrs.layout,
|
|
14
|
+
'data-autosize': node.attrs.__autoSize,
|
|
15
|
+
'data-table-local-id': node.attrs.localId,
|
|
16
|
+
'data-table-width': node.attrs.width
|
|
17
|
+
};
|
|
18
|
+
let colgroup = '';
|
|
19
|
+
if (config.allowColumnResizing) {
|
|
20
|
+
colgroup = ['colgroup', {}, ...generateColgroup(node)];
|
|
21
|
+
}
|
|
22
|
+
const tableContainerDiv = ['div', {
|
|
23
|
+
class: 'pm-table-container',
|
|
24
|
+
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
25
|
+
'data-layout': node.attrs.layout,
|
|
26
|
+
'data-testid': 'table-container'
|
|
27
|
+
}, ['div', {
|
|
28
|
+
class: 'pm-table-sticky-sentinel-top',
|
|
29
|
+
'data-testid': 'sticky-sentinel-top'
|
|
30
|
+
}], ['div', {
|
|
31
|
+
class: 'pm-table-row-controls-wrapper'
|
|
32
|
+
}, ['div']], ['div', {
|
|
33
|
+
class: 'pm-table-with-left-shadow'
|
|
34
|
+
}], ['div', {
|
|
35
|
+
class: 'pm-table-wrapper'
|
|
36
|
+
}, ['table', attrs, ['span', {
|
|
37
|
+
class: 'pm-table-shadow-sentinel-right'
|
|
38
|
+
}], ['span', {
|
|
39
|
+
class: 'pm-table-shadow-sentinel-left'
|
|
40
|
+
}], colgroup, ['tbody', 0]]], ['div', {
|
|
41
|
+
class: 'pm-table-with-right-shadow'
|
|
42
|
+
}], ['div', {
|
|
43
|
+
class: 'pm-table-sticky-sentinel-bottom',
|
|
44
|
+
'data-testid': 'sticky-sentinel-bottom'
|
|
45
|
+
}]];
|
|
46
|
+
if (!config.tableResizingEnabled) {
|
|
47
|
+
return ['div', {
|
|
48
|
+
class: 'tableView-content-wrap'
|
|
49
|
+
}, tableContainerDiv];
|
|
50
|
+
}
|
|
51
|
+
const tableResizingDiv = ['div', {
|
|
52
|
+
'data-testid': 'table-alignment-container'
|
|
53
|
+
}, ['div', {
|
|
54
|
+
class: 'pm-table-resizer-container'
|
|
55
|
+
}, ['div', {
|
|
56
|
+
class: 'resizer-item display-handle'
|
|
57
|
+
}, ['span', {
|
|
58
|
+
class: 'resizer-hover-zone'
|
|
59
|
+
}, tableContainerDiv]]]];
|
|
60
|
+
return ['div', {
|
|
61
|
+
class: 'tableView-content-wrap'
|
|
62
|
+
}, tableResizingDiv];
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
};
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -357,7 +357,7 @@ export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, ge
|
|
|
357
357
|
return element;
|
|
358
358
|
};
|
|
359
359
|
const menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
360
|
-
const alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled) : [];
|
|
360
|
+
const alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor) : [];
|
|
361
361
|
const isCellBackgroundDuplicated = getEditorFeatureFlags().tableDuplicateCellColouring || false;
|
|
362
362
|
const cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
|
|
363
363
|
const columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : [];
|
|
@@ -553,7 +553,7 @@ const highlightColumnsHandler = (state, dispatch) => {
|
|
|
553
553
|
};
|
|
554
554
|
export const getAlignmentOptionsConfig = (editorState, {
|
|
555
555
|
formatMessage
|
|
556
|
-
}, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) => {
|
|
556
|
+
}, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor) => {
|
|
557
557
|
const tableObject = findTable(editorState.selection);
|
|
558
558
|
if (!tableObject) {
|
|
559
559
|
return [];
|
|
@@ -586,7 +586,7 @@ export const getAlignmentOptionsConfig = (editorState, {
|
|
|
586
586
|
icon: icon,
|
|
587
587
|
title: formatMessage(layoutToMessages[value]),
|
|
588
588
|
selected: normaliseAlignment(currentLayout) === value,
|
|
589
|
-
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED),
|
|
589
|
+
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor || false)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED),
|
|
590
590
|
...(isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) && {
|
|
591
591
|
disabled: value !== 'center'
|
|
592
592
|
})
|
package/dist/es2019/types.js
CHANGED
|
@@ -89,7 +89,6 @@ export const TableCssClassName = {
|
|
|
89
89
|
/** drag and drop controls */
|
|
90
90
|
DRAG_ROW_CONTROLS_WRAPPER: `${tablePrefixSelector}-drag-row-controls-wrapper`,
|
|
91
91
|
DRAG_ROW_CONTROLS: `${tablePrefixSelector}-drag-row-controls`,
|
|
92
|
-
DRAG_CONTROLS_CHROMELESS: `drag-controls-chromeless`,
|
|
93
92
|
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: `${tablePrefixSelector}-drag-row-floating-insert-dot-wrapper`,
|
|
94
93
|
DRAG_ROW_FLOATING_INSERT_DOT: `${tablePrefixSelector}-drag-row-floating-insert-dot`,
|
|
95
94
|
DRAG_COLUMN_CONTROLS: `${tablePrefixSelector}-drag-column-controls`,
|
|
@@ -140,6 +139,7 @@ export const TableCssClassName = {
|
|
|
140
139
|
TABLE_CELL: tableCellSelector,
|
|
141
140
|
TABLE_HEADER_CELL: tableHeaderSelector,
|
|
142
141
|
TABLE_STICKY: `${tablePrefixSelector}-sticky`,
|
|
142
|
+
TABLE_CHROMELESS: `${tablePrefixSelector}-chromeless`,
|
|
143
143
|
TOP_LEFT_CELL: 'table > tbody > tr:nth-child(2) > td:nth-child(1)',
|
|
144
144
|
LAST_ITEM_IN_CELL: `${tablePrefixSelector}-last-item-in-cell`,
|
|
145
145
|
WITH_COLUMN_INSERT_LINE: `${tablePrefixSelector}-column-insert-line`,
|
|
@@ -74,7 +74,7 @@ export const TableFloatingColumnControls = ({
|
|
|
74
74
|
ref: containerRef
|
|
75
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
76
76
|
,
|
|
77
|
-
className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER + (isChromelessEditor ? ' ' + ClassName.
|
|
77
|
+
className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER + (isChromelessEditor ? ' ' + ClassName.TABLE_CHROMELESS : ''),
|
|
78
78
|
"data-testid": "table-floating-column-controls-wrapper"
|
|
79
79
|
}, /*#__PURE__*/React.createElement(ColumnControls, {
|
|
80
80
|
editorView: editorView,
|
|
@@ -82,10 +82,10 @@ export const TableFloatingControls = ({
|
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
const stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
85
|
-
const wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.
|
|
85
|
+
const wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.TABLE_CHROMELESS : ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
|
|
86
86
|
const tablePos = (_findTable = findTable(editorView.state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos;
|
|
87
87
|
const isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos);
|
|
88
|
-
const shouldShowCornerControls =
|
|
88
|
+
const shouldShowCornerControls = !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) || isNested;
|
|
89
89
|
return (
|
|
90
90
|
/*#__PURE__*/
|
|
91
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -439,7 +439,7 @@ export const baseTableStyles = props => {
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.
|
|
442
|
+
.${ClassName.DRAG_ROW_CONTROLS_WRAPPER}.${ClassName.TABLE_CHROMELESS} {
|
|
443
443
|
left: -4px;
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -447,7 +447,7 @@ export const baseTableStyles = props => {
|
|
|
447
447
|
padding: 0 ${tablePadding}px;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
.${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER}.${ClassName.
|
|
450
|
+
.${ClassName.DRAG_COLUMN_CONTROLS_WRAPPER}.${ClassName.TABLE_CHROMELESS} {
|
|
451
451
|
left: -8px;
|
|
452
452
|
}
|
|
453
453
|
|
|
@@ -461,10 +461,16 @@ export const baseTableStyles = props => {
|
|
|
461
461
|
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
462
462
|
left: 6px;
|
|
463
463
|
}
|
|
464
|
+
.${ClassName.TABLE_LEFT_SHADOW}.${ClassName.TABLE_CHROMELESS} {
|
|
465
|
+
left: 8px;
|
|
466
|
+
}
|
|
464
467
|
|
|
465
468
|
.${ClassName.TABLE_RIGHT_SHADOW} {
|
|
466
469
|
left: calc(100% - 6px);
|
|
467
470
|
}
|
|
471
|
+
.${ClassName.TABLE_RIGHT_SHADOW}.${ClassName.TABLE_CHROMELESS} {
|
|
472
|
+
left: calc(100% - 16px);
|
|
473
|
+
}
|
|
468
474
|
}
|
|
469
475
|
|
|
470
476
|
> .${ClassName.NODEVIEW_WRAPPER} {
|
|
@@ -583,7 +583,7 @@ export var updateWidthToWidest = function updateWidthToWidest(widthToWidest) {
|
|
|
583
583
|
};
|
|
584
584
|
});
|
|
585
585
|
};
|
|
586
|
-
export var setTableAlignment = function setTableAlignment(newAlignment) {
|
|
586
|
+
export var setTableAlignment = function setTableAlignment(newAlignment, isCommentEditor) {
|
|
587
587
|
return function (_ref2) {
|
|
588
588
|
var tr = _ref2.tr;
|
|
589
589
|
var tableObject = findTable(tr.selection);
|
|
@@ -596,7 +596,9 @@ export var setTableAlignment = function setTableAlignment(newAlignment) {
|
|
|
596
596
|
|
|
597
597
|
// table uses old breakout values in layout attribute to determine width
|
|
598
598
|
// but that information is lost when alignment changes, so we need to ensure we retain that info
|
|
599
|
-
|
|
599
|
+
// If table width is not set in the Comment editor, it means that the table width is inherited from the editor and is "full width".
|
|
600
|
+
// In that case when switching between alignment options in the Comment editor we should keep the table width unset.
|
|
601
|
+
if (!tableObject.node.attrs.width && !isCommentEditor) {
|
|
600
602
|
var tableWidth = getTableContainerWidth(tableObject.node);
|
|
601
603
|
nextTableAttrs.width = tableWidth;
|
|
602
604
|
}
|
|
@@ -534,7 +534,7 @@ export var toggleFixedColumnWidthsOptionAnalytics = function toggleFixedColumnWi
|
|
|
534
534
|
};
|
|
535
535
|
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableDisplayMode));
|
|
536
536
|
};
|
|
537
|
-
export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI) {
|
|
537
|
+
export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor) {
|
|
538
538
|
return function (newAlignment, previousAlignment, inputMethod, reason) {
|
|
539
539
|
return withEditorAnalyticsAPI(function (state) {
|
|
540
540
|
var _getSelectedTableInfo14 = getSelectedTableInfo(state.selection),
|
|
@@ -556,7 +556,7 @@ export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalyt
|
|
|
556
556
|
reason: reason
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
|
-
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableAlignment(newAlignment)));
|
|
559
|
+
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableAlignment(newAlignment, isCommentEditor)));
|
|
560
560
|
};
|
|
561
561
|
};
|
|
562
562
|
export var setTableAlignmentWithTableContentWithPosWithAnalytics = function setTableAlignmentWithTableContentWithPosWithAnalytics(editorAnalyticsAPI) {
|
|
@@ -862,7 +862,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
862
862
|
style: shadowStyle(showBeforeShadow)
|
|
863
863
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
864
864
|
,
|
|
865
|
-
className: ClassName.TABLE_LEFT_SHADOW
|
|
865
|
+
className: options !== null && options !== void 0 && options.isChromelessEditor && !isDragAndDropEnabled ? ClassName.TABLE_LEFT_SHADOW + ' ' + ClassName.TABLE_CHROMELESS : ClassName.TABLE_LEFT_SHADOW
|
|
866
866
|
}), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
|
|
867
867
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
868
868
|
className: "".concat(ClassName.TABLE_LEFT_SHADOW, " ").concat(ClassName.TABLE_STICKY_SHADOW),
|
|
@@ -911,7 +911,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
911
911
|
style: shadowStyle(showAfterShadow)
|
|
912
912
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
913
913
|
,
|
|
914
|
-
className: ClassName.TABLE_RIGHT_SHADOW
|
|
914
|
+
className: options !== null && options !== void 0 && options.isChromelessEditor && !isDragAndDropEnabled ? ClassName.TABLE_RIGHT_SHADOW + ' ' + ClassName.TABLE_CHROMELESS : ClassName.TABLE_RIGHT_SHADOW
|
|
915
915
|
}), this.state.stickyHeader && /*#__PURE__*/React.createElement("div", {
|
|
916
916
|
style: {
|
|
917
917
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -6,6 +6,7 @@ import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
|
6
6
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
7
7
|
import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../commands-with-analytics';
|
|
9
|
+
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
9
10
|
import { TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils';
|
|
10
11
|
import { TableCssClassName as ClassName } from '../types';
|
|
11
12
|
import { ALIGN_CENTER, ALIGN_START } from '../utils/alignment';
|
|
@@ -311,12 +312,14 @@ export var TableContainer = function TableContainer(_ref6) {
|
|
|
311
312
|
isCommentEditor: isCommentEditor
|
|
312
313
|
}, children);
|
|
313
314
|
}
|
|
315
|
+
var _getPluginState = getPluginState(editorView.state),
|
|
316
|
+
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
314
317
|
return /*#__PURE__*/React.createElement(InnerContainer, {
|
|
315
318
|
node: node
|
|
316
319
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
317
320
|
,
|
|
318
321
|
className: classNames(className, {
|
|
319
|
-
'less-padding': editorWidth < akEditorMobileBreakoutPoint && !isNested
|
|
322
|
+
'less-padding': editorWidth < akEditorMobileBreakoutPoint && !isNested && !(isChromelessEditor && isDragAndDropEnabled)
|
|
320
323
|
}),
|
|
321
324
|
style: {
|
|
322
325
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
7
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
8
7
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
9
8
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
@@ -30,10 +29,10 @@ import { createPlugin as createStickyHeadersPlugin, findStickyHeaderForTable, pl
|
|
|
30
29
|
import { createPlugin as createTableOverflowAnalyticsPlugin } from './pm-plugins/table-analytics';
|
|
31
30
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
32
31
|
import { createPlugin as createFlexiResizingPlugin, getPluginState as getFlexiResizingPlugin, pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
33
|
-
import { generateColgroup } from './pm-plugins/table-resizing/utils/colgroup';
|
|
34
32
|
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
35
33
|
import { createPlugin as createTableWidthPlugin, pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
36
34
|
import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
|
|
35
|
+
import { tableNodeSpecWithFixedToDOM } from './toDOM';
|
|
37
36
|
import { getToolbarConfig } from './toolbar';
|
|
38
37
|
import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
39
38
|
import FloatingContextualMenu from './ui/FloatingContextualMenu';
|
|
@@ -49,39 +48,6 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
|
49
48
|
|
|
50
49
|
// TODO: duplicating type instead of importing media plugin causing a circular dependency
|
|
51
50
|
|
|
52
|
-
// TODO: ED-23944 Move this override to `toDOM` function on table adf-schema nodespec
|
|
53
|
-
var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(tableOptions) {
|
|
54
|
-
if (!fg('platform_editor_lazy-node-views')) {
|
|
55
|
-
return table;
|
|
56
|
-
}
|
|
57
|
-
return _objectSpread(_objectSpread({}, table), {}, {
|
|
58
|
-
toDOM: function toDOM(node) {
|
|
59
|
-
var attrs = {
|
|
60
|
-
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
61
|
-
'data-layout': node.attrs.layout,
|
|
62
|
-
'data-autosize': node.attrs.__autoSize,
|
|
63
|
-
'data-table-local-id': node.attrs.localId,
|
|
64
|
-
'data-table-width': node.attrs.width
|
|
65
|
-
};
|
|
66
|
-
var colgroup = '';
|
|
67
|
-
var _pluginConfig = pluginConfig(tableOptions),
|
|
68
|
-
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
69
|
-
if (allowColumnResizing) {
|
|
70
|
-
colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroup(node)));
|
|
71
|
-
}
|
|
72
|
-
return ['div', {
|
|
73
|
-
class: 'tableView-content-wrap'
|
|
74
|
-
}, ['div', {
|
|
75
|
-
class: 'pm-table-container'
|
|
76
|
-
}, ['div', {
|
|
77
|
-
class: 'pm-table-wrapper',
|
|
78
|
-
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
79
|
-
'data-layout': node.attrs.layout
|
|
80
|
-
}, ['table', attrs, colgroup, ['tbody', 0]]]]];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
|
|
85
51
|
/**
|
|
86
52
|
* Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
87
53
|
* from `@atlaskit/editor-core`.
|
|
@@ -165,9 +131,14 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
165
131
|
insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
|
|
166
132
|
},
|
|
167
133
|
nodes: function nodes() {
|
|
134
|
+
var _pluginConfig = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions),
|
|
135
|
+
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
168
136
|
return [{
|
|
169
137
|
name: 'table',
|
|
170
|
-
node: tableNodeSpecWithFixedToDOM(
|
|
138
|
+
node: tableNodeSpecWithFixedToDOM({
|
|
139
|
+
allowColumnResizing: Boolean(allowColumnResizing),
|
|
140
|
+
tableResizingEnabled: Boolean(options === null || options === void 0 ? void 0 : options.tableResizingEnabled)
|
|
141
|
+
})
|
|
171
142
|
}, {
|
|
172
143
|
name: 'tableHeader',
|
|
173
144
|
node: tableHeader
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
import { table } from '@atlaskit/adf-schema';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { generateColgroup } from './pm-plugins/table-resizing/utils/colgroup';
|
|
8
|
+
export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(config) {
|
|
9
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
10
|
+
return table;
|
|
11
|
+
}
|
|
12
|
+
return _objectSpread(_objectSpread({}, table), {}, {
|
|
13
|
+
toDOM: function toDOM(node) {
|
|
14
|
+
var attrs = {
|
|
15
|
+
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
16
|
+
'data-layout': node.attrs.layout,
|
|
17
|
+
'data-autosize': node.attrs.__autoSize,
|
|
18
|
+
'data-table-local-id': node.attrs.localId,
|
|
19
|
+
'data-table-width': node.attrs.width
|
|
20
|
+
};
|
|
21
|
+
var colgroup = '';
|
|
22
|
+
if (config.allowColumnResizing) {
|
|
23
|
+
colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroup(node)));
|
|
24
|
+
}
|
|
25
|
+
var tableContainerDiv = ['div', {
|
|
26
|
+
class: 'pm-table-container',
|
|
27
|
+
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
28
|
+
'data-layout': node.attrs.layout,
|
|
29
|
+
'data-testid': 'table-container'
|
|
30
|
+
}, ['div', {
|
|
31
|
+
class: 'pm-table-sticky-sentinel-top',
|
|
32
|
+
'data-testid': 'sticky-sentinel-top'
|
|
33
|
+
}], ['div', {
|
|
34
|
+
class: 'pm-table-row-controls-wrapper'
|
|
35
|
+
}, ['div']], ['div', {
|
|
36
|
+
class: 'pm-table-with-left-shadow'
|
|
37
|
+
}], ['div', {
|
|
38
|
+
class: 'pm-table-wrapper'
|
|
39
|
+
}, ['table', attrs, ['span', {
|
|
40
|
+
class: 'pm-table-shadow-sentinel-right'
|
|
41
|
+
}], ['span', {
|
|
42
|
+
class: 'pm-table-shadow-sentinel-left'
|
|
43
|
+
}], colgroup, ['tbody', 0]]], ['div', {
|
|
44
|
+
class: 'pm-table-with-right-shadow'
|
|
45
|
+
}], ['div', {
|
|
46
|
+
class: 'pm-table-sticky-sentinel-bottom',
|
|
47
|
+
'data-testid': 'sticky-sentinel-bottom'
|
|
48
|
+
}]];
|
|
49
|
+
if (!config.tableResizingEnabled) {
|
|
50
|
+
return ['div', {
|
|
51
|
+
class: 'tableView-content-wrap'
|
|
52
|
+
}, tableContainerDiv];
|
|
53
|
+
}
|
|
54
|
+
var tableResizingDiv = ['div', {
|
|
55
|
+
'data-testid': 'table-alignment-container'
|
|
56
|
+
}, ['div', {
|
|
57
|
+
class: 'pm-table-resizer-container'
|
|
58
|
+
}, ['div', {
|
|
59
|
+
class: 'resizer-item display-handle'
|
|
60
|
+
}, ['span', {
|
|
61
|
+
class: 'resizer-hover-zone'
|
|
62
|
+
}, tableContainerDiv]]]];
|
|
63
|
+
return ['div', {
|
|
64
|
+
class: 'tableView-content-wrap'
|
|
65
|
+
}, tableResizingDiv];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -370,7 +370,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
370
370
|
return element;
|
|
371
371
|
};
|
|
372
372
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
373
|
-
var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled) : [];
|
|
373
|
+
var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor) : [];
|
|
374
374
|
var isCellBackgroundDuplicated = getEditorFeatureFlags().tableDuplicateCellColouring || false;
|
|
375
375
|
var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
|
|
376
376
|
var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : [];
|
|
@@ -586,7 +586,7 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
|
|
|
586
586
|
}
|
|
587
587
|
return false;
|
|
588
588
|
};
|
|
589
|
-
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) {
|
|
589
|
+
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor) {
|
|
590
590
|
var formatMessage = _ref6.formatMessage;
|
|
591
591
|
var tableObject = findTable(editorState.selection);
|
|
592
592
|
if (!tableObject) {
|
|
@@ -618,7 +618,7 @@ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editor
|
|
|
618
618
|
icon: icon,
|
|
619
619
|
title: formatMessage(layoutToMessages[value]),
|
|
620
620
|
selected: normaliseAlignment(currentLayout) === value,
|
|
621
|
-
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
|
|
621
|
+
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor || false)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
|
|
622
622
|
}, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) && {
|
|
623
623
|
disabled: value !== 'center'
|
|
624
624
|
});
|
package/dist/esm/types.js
CHANGED
|
@@ -91,7 +91,6 @@ export var TableCssClassName = _objectSpread(_objectSpread({}, TableSharedCssCla
|
|
|
91
91
|
/** drag and drop controls */
|
|
92
92
|
DRAG_ROW_CONTROLS_WRAPPER: "".concat(tablePrefixSelector, "-drag-row-controls-wrapper"),
|
|
93
93
|
DRAG_ROW_CONTROLS: "".concat(tablePrefixSelector, "-drag-row-controls"),
|
|
94
|
-
DRAG_CONTROLS_CHROMELESS: "drag-controls-chromeless",
|
|
95
94
|
DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: "".concat(tablePrefixSelector, "-drag-row-floating-insert-dot-wrapper"),
|
|
96
95
|
DRAG_ROW_FLOATING_INSERT_DOT: "".concat(tablePrefixSelector, "-drag-row-floating-insert-dot"),
|
|
97
96
|
DRAG_COLUMN_CONTROLS: "".concat(tablePrefixSelector, "-drag-column-controls"),
|
|
@@ -142,6 +141,7 @@ export var TableCssClassName = _objectSpread(_objectSpread({}, TableSharedCssCla
|
|
|
142
141
|
TABLE_CELL: tableCellSelector,
|
|
143
142
|
TABLE_HEADER_CELL: tableHeaderSelector,
|
|
144
143
|
TABLE_STICKY: "".concat(tablePrefixSelector, "-sticky"),
|
|
144
|
+
TABLE_CHROMELESS: "".concat(tablePrefixSelector, "-chromeless"),
|
|
145
145
|
TOP_LEFT_CELL: 'table > tbody > tr:nth-child(2) > td:nth-child(1)',
|
|
146
146
|
LAST_ITEM_IN_CELL: "".concat(tablePrefixSelector, "-last-item-in-cell"),
|
|
147
147
|
WITH_COLUMN_INSERT_LINE: "".concat(tablePrefixSelector, "-column-insert-line"),
|
|
@@ -75,7 +75,7 @@ export var TableFloatingColumnControls = function TableFloatingColumnControls(_r
|
|
|
75
75
|
ref: containerRef
|
|
76
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
77
|
,
|
|
78
|
-
className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER + (isChromelessEditor ? ' ' + ClassName.
|
|
78
|
+
className: ClassName.DRAG_COLUMN_CONTROLS_WRAPPER + (isChromelessEditor ? ' ' + ClassName.TABLE_CHROMELESS : ''),
|
|
79
79
|
"data-testid": "table-floating-column-controls-wrapper"
|
|
80
80
|
}, /*#__PURE__*/React.createElement(ColumnControls, {
|
|
81
81
|
editorView: editorView,
|
|
@@ -72,10 +72,10 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
var stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
75
|
-
var wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.
|
|
75
|
+
var wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.TABLE_CHROMELESS : ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
|
|
76
76
|
var tablePos = (_findTable = findTable(editorView.state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos;
|
|
77
77
|
var isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos);
|
|
78
|
-
var shouldShowCornerControls =
|
|
78
|
+
var shouldShowCornerControls = !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) || isNested;
|
|
79
79
|
return (
|
|
80
80
|
/*#__PURE__*/
|
|
81
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|