@atlaskit/editor-plugin-table 22.2.14 → 22.2.16
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 +14 -0
- package/dist/cjs/nodeviews/TableComponent.js +3 -4
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +1 -1
- package/dist/cjs/nodeviews/TableContainer.js +1 -4
- package/dist/cjs/nodeviews/table.js +0 -2
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/cjs/ui/ContentComponent.js +14 -30
- package/dist/cjs/ui/FloatingInsertButton/index.js +5 -14
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +16 -85
- package/dist/cjs/ui/TableFloatingControls/index.js +1 -1
- package/dist/cjs/ui/event-handlers.js +5 -10
- package/dist/cjs/ui/toolbar.js +27 -60
- package/dist/es2019/nodeviews/TableComponent.js +3 -4
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +1 -1
- package/dist/es2019/nodeviews/TableContainer.js +1 -5
- package/dist/es2019/nodeviews/table.js +0 -2
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/es2019/ui/ContentComponent.js +14 -30
- package/dist/es2019/ui/FloatingInsertButton/index.js +5 -12
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -69
- package/dist/es2019/ui/TableFloatingControls/index.js +1 -1
- package/dist/es2019/ui/event-handlers.js +5 -10
- package/dist/es2019/ui/toolbar.js +13 -40
- package/dist/esm/nodeviews/TableComponent.js +3 -4
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +1 -1
- package/dist/esm/nodeviews/TableContainer.js +1 -4
- package/dist/esm/nodeviews/table.js +0 -2
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/esm/ui/ContentComponent.js +14 -30
- package/dist/esm/ui/FloatingInsertButton/index.js +5 -12
- package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +16 -85
- package/dist/esm/ui/TableFloatingControls/index.js +1 -1
- package/dist/esm/ui/event-handlers.js +5 -10
- package/dist/esm/ui/toolbar.js +27 -60
- package/dist/types/nodeviews/table-node-views.d.ts +0 -1
- package/dist/types/nodeviews/types.d.ts +0 -1
- package/dist/types/ui/FloatingDragMenu/index.d.ts +4 -3
- package/dist/types/ui/FloatingInsertButton/index.d.ts +0 -1
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +1 -2
- package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +0 -3
- package/dist/types/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +0 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +4 -3
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -1
- package/package.json +6 -6
|
@@ -8,7 +8,6 @@ import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
9
|
import FloatingContextualButton from './FloatingContextualButton';
|
|
10
10
|
import FloatingContextualMenu from './FloatingContextualMenu';
|
|
11
|
-
import FloatingDeleteButton from './FloatingDeleteButton';
|
|
12
11
|
import FloatingDragMenu from './FloatingDragMenu';
|
|
13
12
|
// Ignored via go/ees005
|
|
14
13
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -18,7 +17,7 @@ import { GlobalStylesWrapper } from './global-styles';
|
|
|
18
17
|
import { SizeSelector } from './SizeSelector';
|
|
19
18
|
import { FullWidthDisplay } from './TableFullWidthLabel';
|
|
20
19
|
var selector = function selector(states) {
|
|
21
|
-
var _states$tableState, _states$tableState2, _states$tableState3, _states$tableState4, _states$tableState5, _states$tableState6, _states$tableState7, _states$tableState8, _states$tableState9, _states$tableState0, _states$tableState1, _states$tableState10, _states$tableState11, _states$tableState12, _states$tableState13, _states$tableState14, _states$tableState15, _states$tableState16, _states$tableState17, _states$tableState18, _states$tableState19, _states$tableState20, _states$tableState21, _states$tableState22, _states$tableState23
|
|
20
|
+
var _states$tableState, _states$tableState2, _states$tableState3, _states$tableState4, _states$tableState5, _states$tableState6, _states$tableState7, _states$tableState8, _states$tableState9, _states$tableState0, _states$tableState1, _states$tableState10, _states$tableState11, _states$tableState12, _states$tableState13, _states$tableState14, _states$tableState15, _states$tableState16, _states$tableState17, _states$tableState18, _states$tableState19, _states$tableState20, _states$tableState21, _states$tableState22, _states$tableState23;
|
|
22
21
|
return {
|
|
23
22
|
resizingTableLocalId: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.resizingTableLocalId,
|
|
24
23
|
resizingTableRef: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.resizingTableRef,
|
|
@@ -34,19 +33,18 @@ var selector = function selector(states) {
|
|
|
34
33
|
insertRowButtonIndex: (_states$tableState10 = states.tableState) === null || _states$tableState10 === void 0 ? void 0 : _states$tableState10.insertRowButtonIndex,
|
|
35
34
|
isHeaderColumnEnabled: (_states$tableState11 = states.tableState) === null || _states$tableState11 === void 0 ? void 0 : _states$tableState11.isHeaderColumnEnabled,
|
|
36
35
|
isHeaderRowEnabled: (_states$tableState12 = states.tableState) === null || _states$tableState12 === void 0 ? void 0 : _states$tableState12.isHeaderRowEnabled,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
sizeSelectorTargetRef: (_states$tableState21 = states.tableState) === null || _states$tableState21 === void 0 ? void 0 : _states$tableState21.sizeSelectorTargetRef,
|
|
36
|
+
tableWrapperTarget: (_states$tableState13 = states.tableState) === null || _states$tableState13 === void 0 ? void 0 : _states$tableState13.tableWrapperTarget,
|
|
37
|
+
isCellMenuOpenByKeyboard: (_states$tableState14 = states.tableState) === null || _states$tableState14 === void 0 ? void 0 : _states$tableState14.isCellMenuOpenByKeyboard,
|
|
38
|
+
stickyHeader: (_states$tableState15 = states.tableState) === null || _states$tableState15 === void 0 ? void 0 : _states$tableState15.stickyHeader,
|
|
39
|
+
dragMenuDirection: (_states$tableState16 = states.tableState) === null || _states$tableState16 === void 0 ? void 0 : _states$tableState16.dragMenuDirection,
|
|
40
|
+
dragMenuIndex: (_states$tableState17 = states.tableState) === null || _states$tableState17 === void 0 ? void 0 : _states$tableState17.dragMenuIndex,
|
|
41
|
+
isDragMenuOpen: (_states$tableState18 = states.tableState) === null || _states$tableState18 === void 0 ? void 0 : _states$tableState18.isDragMenuOpen,
|
|
42
|
+
isSizeSelectorOpen: (_states$tableState19 = states.tableState) === null || _states$tableState19 === void 0 ? void 0 : _states$tableState19.isSizeSelectorOpen,
|
|
43
|
+
sizeSelectorTargetRef: (_states$tableState20 = states.tableState) === null || _states$tableState20 === void 0 ? void 0 : _states$tableState20.sizeSelectorTargetRef,
|
|
46
44
|
// IMPORTANT: hovered states are used by FloatingDragMenu component to render popup in the correct location
|
|
47
|
-
hoveredRows: (_states$
|
|
48
|
-
hoveredColumns: (_states$
|
|
49
|
-
hoveredCell: (_states$
|
|
45
|
+
hoveredRows: (_states$tableState21 = states.tableState) === null || _states$tableState21 === void 0 ? void 0 : _states$tableState21.hoveredRows,
|
|
46
|
+
hoveredColumns: (_states$tableState22 = states.tableState) === null || _states$tableState22 === void 0 ? void 0 : _states$tableState22.hoveredColumns,
|
|
47
|
+
hoveredCell: (_states$tableState23 = states.tableState) === null || _states$tableState23 === void 0 ? void 0 : _states$tableState23.hoveredCell
|
|
50
48
|
};
|
|
51
49
|
};
|
|
52
50
|
var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
@@ -78,7 +76,6 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
78
76
|
insertRowButtonIndex = _useSharedPluginState.insertRowButtonIndex,
|
|
79
77
|
isHeaderColumnEnabled = _useSharedPluginState.isHeaderColumnEnabled,
|
|
80
78
|
isHeaderRowEnabled = _useSharedPluginState.isHeaderRowEnabled,
|
|
81
|
-
isDragAndDropEnabled = _useSharedPluginState.isDragAndDropEnabled,
|
|
82
79
|
tableWrapperTarget = _useSharedPluginState.tableWrapperTarget,
|
|
83
80
|
isCellMenuOpenByKeyboard = _useSharedPluginState.isCellMenuOpenByKeyboard,
|
|
84
81
|
stickyHeader = _useSharedPluginState.stickyHeader,
|
|
@@ -103,8 +100,7 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
103
100
|
isContextualMenuOpen: isContextualMenuOpen,
|
|
104
101
|
stickyHeader: stickyHeader,
|
|
105
102
|
tableWrapper: tableWrapperTarget,
|
|
106
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
107
|
-
isDragAndDropEnabled: isDragAndDropEnabled
|
|
103
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
108
104
|
}), allowControls && /*#__PURE__*/React.createElement(FloatingInsertButton, {
|
|
109
105
|
tableNode: tableNode,
|
|
110
106
|
tableRef: tableRef,
|
|
@@ -112,7 +108,6 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
112
108
|
insertRowButtonIndex: insertRowButtonIndex,
|
|
113
109
|
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
114
110
|
isHeaderRowEnabled: isHeaderRowEnabled,
|
|
115
|
-
isDragAndDropEnabled: isDragAndDropEnabled,
|
|
116
111
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
117
112
|
editorView: editorView,
|
|
118
113
|
mountPoint: popupsMountPoint,
|
|
@@ -140,7 +135,7 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
140
135
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
141
136
|
api: api,
|
|
142
137
|
isDragMenuOpen: isDragMenuOpen
|
|
143
|
-
}),
|
|
138
|
+
}), /*#__PURE__*/React.createElement(FloatingDragMenu, {
|
|
144
139
|
editorView: editorView,
|
|
145
140
|
mountPoint: popupsMountPoint,
|
|
146
141
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -160,17 +155,6 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
160
155
|
api: api,
|
|
161
156
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
162
157
|
tableWrapper: tableWrapperTarget
|
|
163
|
-
}), allowControls && !isDragAndDropEnabled && !isResizing && /*#__PURE__*/React.createElement(FloatingDeleteButton, {
|
|
164
|
-
editorView: editorView,
|
|
165
|
-
selection: editorView.state.selection,
|
|
166
|
-
tableRef: tableRef,
|
|
167
|
-
mountPoint: popupsMountPoint,
|
|
168
|
-
boundariesElement: popupsBoundariesElement,
|
|
169
|
-
scrollableElement: popupsScrollableElement,
|
|
170
|
-
stickyHeaders: stickyHeader,
|
|
171
|
-
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
172
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
173
|
-
api: api
|
|
174
158
|
}), ((options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || (options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) && options.isCommentEditor) && isTableResizing && widthToWidest && resizingTableLocalId && resizingTableRef && widthToWidest[resizingTableLocalId] && /*#__PURE__*/React.createElement(FloatingToolbarLabel, {
|
|
175
159
|
target: resizingTableRef,
|
|
176
160
|
content: editorExperiment('single_column_layouts', true) ? /*#__PURE__*/React.createElement(ResizerBreakoutModeLabel, {
|
|
@@ -22,7 +22,7 @@ import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../pm-plug
|
|
|
22
22
|
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
23
23
|
import { TableCssClassName as ClassName } from '../../types';
|
|
24
24
|
import getPopupOptions from './getPopupOptions';
|
|
25
|
-
import
|
|
25
|
+
import { DragAndDropInsertButton } from './InsertButton';
|
|
26
26
|
// Ignored via go/ees005
|
|
27
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
28
28
|
export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
@@ -48,12 +48,10 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
48
48
|
boundariesElement = _this$props.boundariesElement,
|
|
49
49
|
isHeaderColumnEnabled = _this$props.isHeaderColumnEnabled,
|
|
50
50
|
isHeaderRowEnabled = _this$props.isHeaderRowEnabled,
|
|
51
|
-
isDragAndDropEnabled = _this$props.isDragAndDropEnabled,
|
|
52
51
|
dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
|
|
53
52
|
isChromelessEditor = _this$props.isChromelessEditor;
|
|
54
|
-
|
|
55
53
|
// TODO: ED-26961 - temporarily disable insert button for first column and row https://atlassian.slack.com/archives/C05U8HRQM50/p1698363744682219?thread_ts=1698209039.104909&cid=C05U8HRQM50
|
|
56
|
-
if (
|
|
54
|
+
if (insertColumnButtonIndex === 0 || insertRowButtonIndex === 0) {
|
|
57
55
|
return null;
|
|
58
56
|
}
|
|
59
57
|
var type = typeof insertColumnButtonIndex !== 'undefined' ? 'column' : typeof insertRowButtonIndex !== 'undefined' ? 'row' : null;
|
|
@@ -125,7 +123,7 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
125
123
|
// Fixed the 'add column button' not visible issue when sticky header is enabled
|
|
126
124
|
// By setting the Popup z-index higher than the sticky header z-index ( common-styles.ts tr.sticky)
|
|
127
125
|
// Only when inserting a column, otherwise set to undefined
|
|
128
|
-
// Need to set z-index in the Popup, set z-index in the <
|
|
126
|
+
// Need to set z-index in the Popup, set z-index in the <DragAndDropInsertButton /> will not work
|
|
129
127
|
var zIndex = expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') || type === 'column' ? akEditorTableCellOnStickyHeaderZIndex : undefined;
|
|
130
128
|
return /*#__PURE__*/React.createElement(Popup, _extends({
|
|
131
129
|
target: targetCellRef,
|
|
@@ -139,19 +137,14 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
139
137
|
allowOutOfBounds: true
|
|
140
138
|
// Ignored via go/ees005
|
|
141
139
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
142
|
-
}, getPopupOptions(type, index, hasNumberedColumns,
|
|
140
|
+
}, getPopupOptions(type, index, hasNumberedColumns, true, tableContainerWrapper), {
|
|
143
141
|
zIndex: zIndex
|
|
144
|
-
}),
|
|
142
|
+
}), /*#__PURE__*/React.createElement(DragAndDropInsertButton, {
|
|
145
143
|
type: type,
|
|
146
144
|
tableRef: tableRef,
|
|
147
145
|
onMouseDown: type === 'column' ? this.insertColumn : this.insertRow,
|
|
148
146
|
hasStickyHeaders: this.props.hasStickyHeaders || false,
|
|
149
147
|
isChromelessEditor: isChromelessEditor
|
|
150
|
-
}) : /*#__PURE__*/React.createElement(InsertButton, {
|
|
151
|
-
type: type,
|
|
152
|
-
tableRef: tableRef,
|
|
153
|
-
onMouseDown: type === 'column' ? this.insertColumn : this.insertRow,
|
|
154
|
-
hasStickyHeaders: this.props.hasStickyHeaders || false
|
|
155
148
|
}));
|
|
156
149
|
}
|
|
157
150
|
}, {
|
|
@@ -26,8 +26,7 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
26
26
|
getScrollOffset = _ref.getScrollOffset,
|
|
27
27
|
tableWrapperHeight = _ref.tableWrapperHeight,
|
|
28
28
|
api = _ref.api,
|
|
29
|
-
isChromelessEditor = _ref.isChromelessEditor
|
|
30
|
-
isDragAndDropEnabled = _ref.isDragAndDropEnabled;
|
|
29
|
+
isChromelessEditor = _ref.isChromelessEditor;
|
|
31
30
|
var _useState = useState(false),
|
|
32
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
33
32
|
isDragging = _useState2[0],
|
|
@@ -9,10 +9,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
9
9
|
import React, { Component } from 'react';
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
12
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
13
12
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
14
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
|
-
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
16
14
|
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
17
15
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
18
16
|
import { tableBorderColor } from '../../consts';
|
|
@@ -26,46 +24,10 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
26
24
|
args[_key] = arguments[_key];
|
|
27
25
|
}
|
|
28
26
|
_this = _callSuper(this, NumberColumn, [].concat(args));
|
|
29
|
-
_defineProperty(_this, "hoverRows", function (index) {
|
|
30
|
-
return _this.props.tableActive ? _this.props.hoverRows([index]) : null;
|
|
31
|
-
});
|
|
32
|
-
_defineProperty(_this, "selectRow", function (index, event) {
|
|
33
|
-
var _this$props = _this.props,
|
|
34
|
-
tableActive = _this$props.tableActive,
|
|
35
|
-
editorView = _this$props.editorView,
|
|
36
|
-
selectRow = _this$props.selectRow;
|
|
37
|
-
// If selection is outside the table then first reset the selection inside table
|
|
38
|
-
if (!tableActive && event.target && event.target instanceof Node) {
|
|
39
|
-
var _editorView$state = editorView.state,
|
|
40
|
-
doc = _editorView$state.doc,
|
|
41
|
-
selection = _editorView$state.selection,
|
|
42
|
-
tr = _editorView$state.tr;
|
|
43
|
-
var pos = editorView.posAtDOM(event.target, 1);
|
|
44
|
-
var $pos = doc.resolve(pos);
|
|
45
|
-
var newPos = selection.head > pos ?
|
|
46
|
-
// Selection is after table
|
|
47
|
-
// nodeSize - 3 will move the position inside last table cell
|
|
48
|
-
Selection.near(doc.resolve(pos + ($pos.parent.nodeSize - 3)), -1) :
|
|
49
|
-
// Selection is before table
|
|
50
|
-
Selection.near($pos);
|
|
51
|
-
editorView.dispatch(tr.setSelection(newPos));
|
|
52
|
-
}
|
|
53
|
-
selectRow(index, event.shiftKey);
|
|
54
|
-
});
|
|
55
|
-
_defineProperty(_this, "clearHoverSelection", function () {
|
|
56
|
-
var _this$props2 = _this.props,
|
|
57
|
-
tableActive = _this$props2.tableActive,
|
|
58
|
-
editorView = _this$props2.editorView;
|
|
59
|
-
if (tableActive) {
|
|
60
|
-
var state = editorView.state,
|
|
61
|
-
dispatch = editorView.dispatch;
|
|
62
|
-
clearHoverSelection()(state, dispatch);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
27
|
_defineProperty(_this, "getCellStyles", function (index, rowHeight) {
|
|
66
|
-
var _this$
|
|
67
|
-
stickyTop = _this$
|
|
68
|
-
hasHeaderRow = _this$
|
|
28
|
+
var _this$props = _this.props,
|
|
29
|
+
stickyTop = _this$props.stickyTop,
|
|
30
|
+
hasHeaderRow = _this$props.hasHeaderRow;
|
|
69
31
|
if (stickyTop && hasHeaderRow && index === 0) {
|
|
70
32
|
var topOffset = 0;
|
|
71
33
|
return {
|
|
@@ -79,12 +41,12 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
79
41
|
});
|
|
80
42
|
_defineProperty(_this, "getClassNames", function (index) {
|
|
81
43
|
var isButtonDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
82
|
-
var _this$
|
|
83
|
-
hoveredRows = _this$
|
|
84
|
-
editorView = _this$
|
|
85
|
-
isInDanger = _this$
|
|
86
|
-
isResizing = _this$
|
|
87
|
-
tableActive = _this$
|
|
44
|
+
var _this$props2 = _this.props,
|
|
45
|
+
hoveredRows = _this$props2.hoveredRows,
|
|
46
|
+
editorView = _this$props2.editorView,
|
|
47
|
+
isInDanger = _this$props2.isInDanger,
|
|
48
|
+
isResizing = _this$props2.isResizing,
|
|
49
|
+
tableActive = _this$props2.tableActive;
|
|
88
50
|
var isActive = isRowSelected(index)(editorView.state.selection) || (hoveredRows || []).indexOf(index) !== -1 && !isResizing;
|
|
89
51
|
return classnames(ClassName.NUMBERED_COLUMN_BUTTON, _defineProperty(_defineProperty(_defineProperty({}, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, isButtonDisabled), ClassName.HOVERED_CELL_IN_DANGER, tableActive && isActive && isInDanger), ClassName.HOVERED_CELL_ACTIVE, tableActive && isActive));
|
|
90
52
|
});
|
|
@@ -95,12 +57,12 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
95
57
|
key: "render",
|
|
96
58
|
value: function render() {
|
|
97
59
|
var _this2 = this;
|
|
98
|
-
var _this$
|
|
99
|
-
tableRef = _this$
|
|
100
|
-
hasHeaderRow = _this$
|
|
101
|
-
isDragAndDropEnabled = _this$
|
|
102
|
-
tableActive = _this$
|
|
103
|
-
updateCellHoverLocation = _this$
|
|
60
|
+
var _this$props3 = this.props,
|
|
61
|
+
tableRef = _this$props3.tableRef,
|
|
62
|
+
hasHeaderRow = _this$props3.hasHeaderRow,
|
|
63
|
+
isDragAndDropEnabled = _this$props3.isDragAndDropEnabled,
|
|
64
|
+
tableActive = _this$props3.tableActive,
|
|
65
|
+
updateCellHoverLocation = _this$props3.updateCellHoverLocation;
|
|
104
66
|
var rowHeights = getRowHeights(tableRef);
|
|
105
67
|
if (isSSR()) {
|
|
106
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -132,7 +94,7 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
132
94
|
},
|
|
133
95
|
contentEditable: false
|
|
134
96
|
}, rowHeights.map(function (rowHeight, index) {
|
|
135
|
-
return
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
136
98
|
// Ignored via go/ees005
|
|
137
99
|
// eslint-disable-next-line react/no-array-index-key
|
|
138
100
|
key: "wrapper-".concat(index)
|
|
@@ -149,37 +111,6 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
149
111
|
onMouseOver: function onMouseOver() {
|
|
150
112
|
return updateCellHoverLocation(index);
|
|
151
113
|
}
|
|
152
|
-
}, hasHeaderRow ? index > 0 ? index : null : index + 1) : /*#__PURE__*/React.createElement("div", {
|
|
153
|
-
// Ignored via go/ees005
|
|
154
|
-
role: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined
|
|
155
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
156
|
-
,
|
|
157
|
-
key: "wrapper-".concat(index)
|
|
158
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
159
|
-
,
|
|
160
|
-
className: _this2.getClassNames(index),
|
|
161
|
-
"data-index": index
|
|
162
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
163
|
-
,
|
|
164
|
-
style: _this2.getCellStyles(index, rowHeight),
|
|
165
|
-
onClick: function onClick(event) {
|
|
166
|
-
return _this2.selectRow(index, event);
|
|
167
|
-
},
|
|
168
|
-
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
169
|
-
return _this2.hoverRows(index);
|
|
170
|
-
} : undefined,
|
|
171
|
-
onMouseOver: function onMouseOver() {
|
|
172
|
-
return _this2.hoverRows(index);
|
|
173
|
-
},
|
|
174
|
-
tabIndex: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined,
|
|
175
|
-
onKeyDown: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (event) {
|
|
176
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
_this2.selectRow(index, event);
|
|
179
|
-
}
|
|
180
|
-
} : undefined,
|
|
181
|
-
onMouseOut: _this2.clearHoverSelection,
|
|
182
|
-
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? _this2.clearHoverSelection : undefined
|
|
183
114
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1);
|
|
184
115
|
}));
|
|
185
116
|
}
|
|
@@ -35,11 +35,11 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
|
35
35
|
isNumberColumnEnabled = _ref.isNumberColumnEnabled,
|
|
36
36
|
isHeaderRowEnabled = _ref.isHeaderRowEnabled,
|
|
37
37
|
isHeaderColumnEnabled = _ref.isHeaderColumnEnabled,
|
|
38
|
+
isDragAndDropEnabled = _ref.isDragAndDropEnabled,
|
|
38
39
|
tableActive = _ref.tableActive,
|
|
39
40
|
hasHeaderRow = _ref.hasHeaderRow,
|
|
40
41
|
hoveredRows = _ref.hoveredRows,
|
|
41
42
|
stickyHeader = _ref.stickyHeader,
|
|
42
|
-
isDragAndDropEnabled = _ref.isDragAndDropEnabled,
|
|
43
43
|
hoveredCell = _ref.hoveredCell,
|
|
44
44
|
isTableHovered = _ref.isTableHovered,
|
|
45
45
|
tableWrapperWidth = _ref.tableWrapperWidth,
|
|
@@ -247,17 +247,12 @@ export var handleMouseLeave = function handleMouseLeave(view, event) {
|
|
|
247
247
|
var _getPluginState5 = getPluginState(state),
|
|
248
248
|
insertColumnButtonIndex = _getPluginState5.insertColumnButtonIndex,
|
|
249
249
|
insertRowButtonIndex = _getPluginState5.insertRowButtonIndex,
|
|
250
|
-
isDragAndDropEnabled = _getPluginState5.isDragAndDropEnabled,
|
|
251
250
|
isTableHovered = _getPluginState5.isTableHovered;
|
|
252
251
|
if (isTableHovered) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
!isDragMenuOpen && setTableHovered(false)(state, dispatch);
|
|
258
|
-
} else {
|
|
259
|
-
setTableHovered(false)(state, dispatch);
|
|
260
|
-
}
|
|
252
|
+
var _getDragDropPluginSta = getDragDropPluginState(state),
|
|
253
|
+
_getDragDropPluginSta2 = _getDragDropPluginSta.isDragMenuOpen,
|
|
254
|
+
isDragMenuOpen = _getDragDropPluginSta2 === void 0 ? false : _getDragDropPluginSta2;
|
|
255
|
+
!isDragMenuOpen && setTableHovered(false)(state, dispatch);
|
|
261
256
|
return true;
|
|
262
257
|
}
|
|
263
258
|
|
|
@@ -485,7 +480,7 @@ var trackCellLocation = function trackCellLocation(view, mouseEvent) {
|
|
|
485
480
|
};
|
|
486
481
|
export var withCellTracking = function withCellTracking(eventHandler) {
|
|
487
482
|
return function (view, mouseEvent) {
|
|
488
|
-
if (
|
|
483
|
+
if (getDragDropPluginState(view.state) && !getDragDropPluginState(view.state).isDragging) {
|
|
489
484
|
trackCellLocation(view, mouseEvent);
|
|
490
485
|
}
|
|
491
486
|
return eventHandler(view, mouseEvent);
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -105,32 +105,18 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
|
|
|
105
105
|
}
|
|
106
106
|
}];
|
|
107
107
|
var tableOptionsDropdownWidth = isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
} else {
|
|
122
|
-
return {
|
|
123
|
-
id: 'editor.table.tableOptions',
|
|
124
|
-
type: 'dropdown',
|
|
125
|
-
testId: 'table_options',
|
|
126
|
-
title: formatMessage(messages.tableOptions),
|
|
127
|
-
hidden: options.every(function (option) {
|
|
128
|
-
return option.hidden;
|
|
129
|
-
}),
|
|
130
|
-
options: options,
|
|
131
|
-
dropdownWidth: tableOptionsDropdownWidth
|
|
132
|
-
};
|
|
133
|
-
}
|
|
108
|
+
return {
|
|
109
|
+
id: 'editor.table.tableOptions',
|
|
110
|
+
type: 'dropdown',
|
|
111
|
+
testId: 'table_options',
|
|
112
|
+
iconBefore: CustomizeIcon,
|
|
113
|
+
title: formatMessage(messages.tableOptions),
|
|
114
|
+
hidden: options.every(function (option) {
|
|
115
|
+
return option.hidden;
|
|
116
|
+
}),
|
|
117
|
+
options: options,
|
|
118
|
+
dropdownWidth: tableOptionsDropdownWidth
|
|
119
|
+
};
|
|
134
120
|
};
|
|
135
121
|
|
|
136
122
|
// Added these options for mobile. Mobile bridge translates this menu and
|
|
@@ -464,8 +450,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
464
450
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
465
451
|
var alignmentMenu = config.allowTableAlignment && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, editorView, shouldUseIncreasedScalingPercent, areAnyNewToolbarFlagsEnabled, options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor) : [];
|
|
466
452
|
var isLimitedModeEnabled = (_api$limitedMode$shar = api === null || api === void 0 || (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode === void 0 ? void 0 : _api$limitedMode.enabled) !== null && _api$limitedMode$shar !== void 0 ? _api$limitedMode$shar : false;
|
|
467
|
-
var
|
|
468
|
-
var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor, isLimitedModeEnabled) : [];
|
|
453
|
+
var columnSettingsItems = getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor, isLimitedModeEnabled);
|
|
469
454
|
var colorPicker = !areAnyNewToolbarFlagsEnabled ? getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView) : [];
|
|
470
455
|
var fitToContentButton = isContentModeSupported({
|
|
471
456
|
allowColumnResizing: !!pluginState.pluginConfig.allowColumnResizing,
|
|
@@ -566,7 +551,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
566
551
|
},
|
|
567
552
|
zIndex: akEditorFloatingPanelZIndex + 1,
|
|
568
553
|
// Place the context menu slightly above the others
|
|
569
|
-
items: [menu].concat(_toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(menu.hidden)] : []), _toConsumableArray(alignmentMenu), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(alignmentMenu.length === 0)] : []),
|
|
554
|
+
items: [menu].concat(_toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(menu.hidden)] : []), _toConsumableArray(alignmentMenu), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(alignmentMenu.length === 0)] : []), columnSettingsItems, fitToContentButton, _toConsumableArray(colorPicker), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [{
|
|
570
555
|
type: 'extensions-placeholder',
|
|
571
556
|
separator: 'end'
|
|
572
557
|
}, copyButton, {
|
|
@@ -642,24 +627,6 @@ var separator = function separator(hidden) {
|
|
|
642
627
|
hidden: hidden
|
|
643
628
|
};
|
|
644
629
|
};
|
|
645
|
-
var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerWidth, api, editorAnalyticsAPI) {
|
|
646
|
-
var formatMessage = _ref3.formatMessage;
|
|
647
|
-
var isTableScalingEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
648
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
649
|
-
var shouldUseIncreasedScalingPercent = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
650
|
-
var isCommentEditor = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
651
|
-
var isLimitedModeEnabled = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
652
|
-
var initialSelectionRect = getClosestSelectionRect(state);
|
|
653
|
-
if (initialSelectionRect) {
|
|
654
|
-
var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
|
|
655
|
-
formatMessage: formatMessage
|
|
656
|
-
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isLimitedModeEnabled);
|
|
657
|
-
// Ignored via go/ees005
|
|
658
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
659
|
-
return [cellOptions, separator(cellOptions.hidden)];
|
|
660
|
-
}
|
|
661
|
-
return [];
|
|
662
|
-
};
|
|
663
630
|
var getDistributeConfig = function getDistributeConfig(getEditorContainerWidth, api, editorAnalyticsAPI) {
|
|
664
631
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
665
632
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
@@ -680,9 +647,9 @@ var getDistributeConfig = function getDistributeConfig(getEditorContainerWidth,
|
|
|
680
647
|
|
|
681
648
|
// this create the button group for distribute column and also fixed column width
|
|
682
649
|
// fixed column button should be in this function call in the future
|
|
683
|
-
var getColumnSettingItems = function getColumnSettingItems(editorState, editorView,
|
|
650
|
+
var getColumnSettingItems = function getColumnSettingItems(editorState, editorView, _ref3, getEditorContainerWidth, api, editorAnalyticsAPI) {
|
|
684
651
|
var _pluginState$pluginCo3;
|
|
685
|
-
var formatMessage =
|
|
652
|
+
var formatMessage = _ref3.formatMessage;
|
|
686
653
|
var isTableScalingEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
687
654
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
688
655
|
var isCommentEditor = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
@@ -708,7 +675,7 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
|
|
|
708
675
|
wouldChange = (_newResizeStateWithAn3 = (_newResizeStateWithAn4 = newResizeStateWithAnalytics) === null || _newResizeStateWithAn4 === void 0 ? void 0 : _newResizeStateWithAn4.changed) !== null && _newResizeStateWithAn3 !== void 0 ? _newResizeStateWithAn3 : false;
|
|
709
676
|
}
|
|
710
677
|
}
|
|
711
|
-
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns
|
|
678
|
+
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns) {
|
|
712
679
|
items.push({
|
|
713
680
|
id: 'editor.table.distributeColumns',
|
|
714
681
|
type: 'button',
|
|
@@ -732,9 +699,9 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
|
|
|
732
699
|
}
|
|
733
700
|
return items;
|
|
734
701
|
};
|
|
735
|
-
var getColorPicker = function getColorPicker(state, menu,
|
|
702
|
+
var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalyticsAPI, getEditorView) {
|
|
736
703
|
var _node$attrs;
|
|
737
|
-
var formatMessage =
|
|
704
|
+
var formatMessage = _ref4.formatMessage;
|
|
738
705
|
var _getPluginState2 = getPluginState(state),
|
|
739
706
|
targetCellPosition = _getPluginState2.targetCellPosition,
|
|
740
707
|
pluginConfig = _getPluginState2.pluginConfig;
|
|
@@ -796,8 +763,8 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
|
|
|
796
763
|
}
|
|
797
764
|
return false;
|
|
798
765
|
};
|
|
799
|
-
var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState,
|
|
800
|
-
var formatMessage =
|
|
766
|
+
var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref5, editorAnalyticsAPI, getEditorContainerWidth, editorView, shouldUseIncreasedScalingPercent, areAnyNewToolbarFlagsEnabled, isFullWidthEditor, isCommentEditor) {
|
|
767
|
+
var formatMessage = _ref5.formatMessage;
|
|
801
768
|
var tableObject = findTable(editorState.selection);
|
|
802
769
|
if (!tableObject) {
|
|
803
770
|
return [];
|
|
@@ -895,13 +862,13 @@ var isLayoutOptionDisabledImpl = function isLayoutOptionDisabledImpl(selectedNod
|
|
|
895
862
|
}
|
|
896
863
|
return false;
|
|
897
864
|
};
|
|
898
|
-
var getMemoizedIsLayoutOptionDisabled = memoizeOne(isLayoutOptionDisabledImpl, function (
|
|
865
|
+
var getMemoizedIsLayoutOptionDisabled = memoizeOne(isLayoutOptionDisabledImpl, function (_ref6, _ref7) {
|
|
866
|
+
var _ref8 = _toArray(_ref6),
|
|
867
|
+
prevNode = _ref8[0],
|
|
868
|
+
prevRest = _ref8.slice(1);
|
|
899
869
|
var _ref9 = _toArray(_ref7),
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
var _ref0 = _toArray(_ref8),
|
|
903
|
-
nextNode = _ref0[0],
|
|
904
|
-
nextRest = _ref0.slice(1);
|
|
870
|
+
nextNode = _ref9[0],
|
|
871
|
+
nextRest = _ref9.slice(1);
|
|
905
872
|
// Only node needs special comparison (attrs only), rest use reference equality
|
|
906
873
|
var nodeEqual = isEqual(prevNode.attrs, nextNode.attrs);
|
|
907
874
|
var restEqual = prevRest.every(function (val, idx) {
|
|
@@ -22,7 +22,6 @@ type TableViewOptions = {
|
|
|
22
22
|
export declare const tableView: (options: TableViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => NodeView;
|
|
23
23
|
type TableCellViewOptions = {
|
|
24
24
|
eventDispatcher: EventDispatcher;
|
|
25
|
-
isDragAndDropEnabled?: boolean;
|
|
26
25
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
26
|
};
|
|
28
27
|
export declare const tableCellView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
|
|
@@ -8,7 +8,6 @@ import type { PluginInjectionAPI } from '../types';
|
|
|
8
8
|
export type TableOptions = {
|
|
9
9
|
isChromelessEditor?: boolean;
|
|
10
10
|
isCommentEditor?: boolean;
|
|
11
|
-
isDragAndDropEnabled?: boolean;
|
|
12
11
|
isFullWidthModeEnabled?: boolean;
|
|
13
12
|
isTableScalingEnabled?: boolean;
|
|
14
13
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
@@ -28,8 +28,9 @@ interface Props {
|
|
|
28
28
|
tableWrapper?: HTMLElement;
|
|
29
29
|
targetCellPosition?: number;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
(
|
|
31
|
+
interface FloatingDragMenuFunction {
|
|
32
|
+
(props: Props): React.JSX.Element | null;
|
|
33
33
|
displayName: string;
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
declare const FloatingDragMenu: FloatingDragMenuFunction;
|
|
35
36
|
export default FloatingDragMenu;
|
|
@@ -17,7 +17,6 @@ interface Props {
|
|
|
17
17
|
hoveredCell?: CellHoverMeta;
|
|
18
18
|
hoveredRows?: number[];
|
|
19
19
|
isChromelessEditor?: boolean;
|
|
20
|
-
isDragAndDropEnabled?: boolean;
|
|
21
20
|
isInDanger?: boolean;
|
|
22
21
|
isNumberColumnEnabled?: boolean;
|
|
23
22
|
isResizing?: boolean;
|
|
@@ -30,5 +29,5 @@ interface Props {
|
|
|
30
29
|
tableRef?: HTMLTableElement;
|
|
31
30
|
tableWrapperHeight?: number;
|
|
32
31
|
}
|
|
33
|
-
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor,
|
|
32
|
+
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => React.JSX.Element | null;
|
|
34
33
|
export default TableFloatingColumnControls;
|
|
@@ -31,7 +31,7 @@ interface TableFloatingControlsProps {
|
|
|
31
31
|
tableRef?: HTMLTableElement;
|
|
32
32
|
tableWrapperWidth?: number;
|
|
33
33
|
}
|
|
34
|
-
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader,
|
|
34
|
+
export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, isDragAndDropEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
|
|
35
35
|
api?: ExtractInjectionAPI<TablePlugin>;
|
|
36
36
|
}) => jsx.JSX.Element | null;
|
|
37
37
|
export default TableFloatingControls;
|
|
@@ -22,7 +22,6 @@ type TableViewOptions = {
|
|
|
22
22
|
export declare const tableView: (options: TableViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => NodeView;
|
|
23
23
|
type TableCellViewOptions = {
|
|
24
24
|
eventDispatcher: EventDispatcher;
|
|
25
|
-
isDragAndDropEnabled?: boolean;
|
|
26
25
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
26
|
};
|
|
28
27
|
export declare const tableCellView: (options: TableCellViewOptions) => (node: PMNode, view: EditorView, getPos: () => number | undefined) => TableCell;
|
|
@@ -8,7 +8,6 @@ import type { PluginInjectionAPI } from '../types';
|
|
|
8
8
|
export type TableOptions = {
|
|
9
9
|
isChromelessEditor?: boolean;
|
|
10
10
|
isCommentEditor?: boolean;
|
|
11
|
-
isDragAndDropEnabled?: boolean;
|
|
12
11
|
isFullWidthModeEnabled?: boolean;
|
|
13
12
|
isTableScalingEnabled?: boolean;
|
|
14
13
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
@@ -28,8 +28,9 @@ interface Props {
|
|
|
28
28
|
tableWrapper?: HTMLElement;
|
|
29
29
|
targetCellPosition?: number;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
(
|
|
31
|
+
interface FloatingDragMenuFunction {
|
|
32
|
+
(props: Props): React.JSX.Element | null;
|
|
33
33
|
displayName: string;
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
declare const FloatingDragMenu: FloatingDragMenuFunction;
|
|
35
36
|
export default FloatingDragMenu;
|