@atlaskit/editor-plugin-table 9.3.3 → 9.3.5
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 +17 -0
- package/dist/cjs/nodeviews/toDOM.js +2 -1
- package/dist/cjs/pm-plugins/utils/paste.js +60 -11
- package/dist/es2019/nodeviews/toDOM.js +2 -1
- package/dist/es2019/pm-plugins/utils/paste.js +57 -8
- package/dist/esm/nodeviews/toDOM.js +2 -1
- package/dist/esm/pm-plugins/utils/paste.js +60 -11
- package/dist/types/nodeviews/ExternalDropTargets.d.ts +2 -2
- package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +2 -2
- package/dist/types/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/nodeviews/table.d.ts +2 -2
- package/dist/types/ui/DragHandle/HandleIconComponent.d.ts +2 -2
- package/dist/types/ui/DragPreview/index.d.ts +2 -2
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -2
- package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
- package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -2
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
- package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +2 -2
- package/dist/types/ui/TableFullWidthLabel/index.d.ts +2 -2
- package/dist/types/ui/icons/AddColLeftIcon.d.ts +2 -2
- package/dist/types/ui/icons/AddColRightIcon.d.ts +2 -2
- package/dist/types/ui/icons/AddRowAboveIcon.d.ts +2 -2
- package/dist/types/ui/icons/AddRowBelowIcon.d.ts +2 -2
- package/dist/types/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
- package/dist/types/ui/icons/DragHandleIcon.d.ts +2 -2
- package/dist/types/ui/icons/DragInMotionIcon.d.ts +1 -1
- package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -2
- package/dist/types/ui/icons/MinimisedHandle.d.ts +2 -2
- package/dist/types/ui/icons/SortingIconWrapper.d.ts +1 -1
- package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/table.d.ts +2 -2
- package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +2 -2
- package/dist/types-ts4.5/ui/DragPreview/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
- package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFullWidthLabel/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/AddColLeftIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/AddColRightIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/AddRowAboveIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/AddRowBelowIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/DragHandleIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/DragInMotionIcon.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/MinimisedHandle.d.ts +2 -2
- package/dist/types-ts4.5/ui/icons/SortingIconWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -2
- package/package.json +11 -5
- package/src/nodeviews/toDOM.ts +4 -1
- package/src/pm-plugins/utils/paste.ts +71 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 9.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#108813](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108813)
|
|
8
|
+
[`123953f8b2006`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/123953f8b2006) -
|
|
9
|
+
[ux] ED-26075 Unwrap content from nested table text block slices on paste
|
|
10
|
+
|
|
11
|
+
## 9.3.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#110015](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110015)
|
|
16
|
+
[`92048a44fc3f6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/92048a44fc3f6) -
|
|
17
|
+
fix table layout shift issue
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 9.3.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
17
18
|
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
@@ -92,7 +93,7 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
|
|
|
92
93
|
'--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
|
|
93
94
|
minWidth: 'var(--ak-editor-table-min-width)',
|
|
94
95
|
maxWidth: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
|
|
95
|
-
width: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
|
|
96
|
+
width: (0, _platformFeatureFlags.fg)('platform_editor_table_layout_shift_fix') ? "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, "px)") : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
|
|
96
97
|
})
|
|
97
98
|
}, ['span', {
|
|
98
99
|
class: 'resizer-hover-zone'
|
|
@@ -172,12 +172,58 @@ var transformSliceToFixHardBreakProblemOnCopyFromCell = exports.transformSliceTo
|
|
|
172
172
|
}
|
|
173
173
|
return slice;
|
|
174
174
|
};
|
|
175
|
+
var isNodeSingleCellTable = function isNodeSingleCellTable(node, schema) {
|
|
176
|
+
var _node$firstChild, _node$firstChild$firs, _node$firstChild$firs2;
|
|
177
|
+
return node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type) === schema.nodes.tableRow && node.firstChild.childCount === 1 && (((_node$firstChild$firs = node.firstChild.firstChild) === null || _node$firstChild$firs === void 0 ? void 0 : _node$firstChild$firs.type) === schema.nodes.tableCell || ((_node$firstChild$firs2 = node.firstChild.firstChild) === null || _node$firstChild$firs2 === void 0 ? void 0 : _node$firstChild$firs2.type) === schema.nodes.tableHeader);
|
|
178
|
+
};
|
|
179
|
+
var isFragmentSingleCellTable = function isFragmentSingleCellTable(fragment, schema) {
|
|
180
|
+
return fragment.childCount === 1 && fragment.firstChild !== null && isNodeSingleCellTable(fragment.firstChild, schema);
|
|
181
|
+
};
|
|
182
|
+
var containsTextBlockChildren = function containsTextBlockChildren(fragment, schema) {
|
|
183
|
+
var containsTextBlock = false;
|
|
184
|
+
fragment.forEach(function (node) {
|
|
185
|
+
if (node.isTextblock) {
|
|
186
|
+
containsTextBlock = true;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
return containsTextBlock;
|
|
190
|
+
};
|
|
175
191
|
var transformSliceToRemoveOpenTable = exports.transformSliceToRemoveOpenTable = function transformSliceToRemoveOpenTable(slice, schema) {
|
|
176
|
-
var _slice$content$
|
|
177
|
-
|
|
178
|
-
|
|
192
|
+
var _slice$content$firstC4;
|
|
193
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_nested_tables_paste_wrap_fix')) {
|
|
194
|
+
// Case 1: A slice of a textblock selection inside a nested table
|
|
195
|
+
// Prosemirror wraps nested textblock selections in their respective tables
|
|
196
|
+
// We are using `safeInsert` to paste nested tables, so we do not want to preserve this wrapping
|
|
197
|
+
|
|
198
|
+
// slice starts and ends inside a nested table at the same depth
|
|
199
|
+
if (slice.openStart >= 7 && slice.openEnd >= 7 && slice.openStart === slice.openEnd) {
|
|
200
|
+
var cleaned = slice;
|
|
201
|
+
var descendedDepth = 0;
|
|
202
|
+
var tableDepthDecrement = 2;
|
|
179
203
|
|
|
180
|
-
|
|
204
|
+
// if the slice is a single cell table and contains cells with single cell tables, descend into it until we find textblock children
|
|
205
|
+
if (isFragmentSingleCellTable(slice.content, schema)) {
|
|
206
|
+
var _slice$content$firstC2;
|
|
207
|
+
(_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 || _slice$content$firstC2.descendants(function (node, _pos, parent) {
|
|
208
|
+
if (isNodeSingleCellTable(node, schema)) {
|
|
209
|
+
descendedDepth += tableDepthDecrement;
|
|
210
|
+
} else if (node.type === schema.nodes.table) {
|
|
211
|
+
return false;
|
|
212
|
+
} else if (containsTextBlockChildren(node.content, schema)) {
|
|
213
|
+
descendedDepth += tableDepthDecrement;
|
|
214
|
+
// create a new slice with the content of the textblock children and the depth of the nested tables subtracted
|
|
215
|
+
cleaned = new _model.Slice(node.content, slice.openStart - descendedDepth - tableDepthDecrement, slice.openEnd - descendedDepth - tableDepthDecrement);
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (!cleaned.eq(slice)) {
|
|
221
|
+
return cleaned;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Case 2: A slice entirely within a single CELL
|
|
181
227
|
if (
|
|
182
228
|
// starts and ends inside of a cell
|
|
183
229
|
slice.openStart >= 4 && slice.openEnd >= 4 &&
|
|
@@ -186,25 +232,28 @@ var transformSliceToRemoveOpenTable = exports.transformSliceToRemoveOpenTable =
|
|
|
186
232
|
// Ignored via go/ees005
|
|
187
233
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
188
234
|
slice.content.firstChild.type === schema.nodes.table) {
|
|
189
|
-
var _slice$content$
|
|
235
|
+
var _slice$content$firstC3;
|
|
236
|
+
// we're removing the table, tableRow and tableCell reducing the open depth by 3
|
|
237
|
+
var depthDecrement = 3;
|
|
238
|
+
|
|
190
239
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
191
240
|
// https://github.com/ProseMirror/prosemirror/issues/1270
|
|
192
241
|
// The structure becomes
|
|
193
242
|
// table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
|
|
194
243
|
// As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
|
|
195
|
-
var
|
|
196
|
-
if (((_slice$content$
|
|
197
|
-
|
|
244
|
+
var _cleaned = slice;
|
|
245
|
+
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.content) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.firstChild) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.content) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type) === schema.nodes.table) {
|
|
246
|
+
_cleaned = new _model.Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
|
|
198
247
|
}
|
|
199
|
-
return new _model.Slice((0, _utils.flatmap)(
|
|
248
|
+
return new _model.Slice((0, _utils.flatmap)(_cleaned.content, unwrapContentFromTable), _cleaned.openStart - depthDecrement, _cleaned.openEnd - depthDecrement);
|
|
200
249
|
}
|
|
201
250
|
|
|
202
|
-
// Case
|
|
251
|
+
// Case 3: A slice starting within a CELL and ending outside the table
|
|
203
252
|
if (
|
|
204
253
|
// starts inside of a cell but ends outside of the starting table
|
|
205
254
|
slice.openStart >= 4 &&
|
|
206
255
|
// slice starts from a table node (and spans across more than one node)
|
|
207
|
-
slice.content.childCount > 1 && ((_slice$content$
|
|
256
|
+
slice.content.childCount > 1 && ((_slice$content$firstC4 = slice.content.firstChild) === null || _slice$content$firstC4 === void 0 ? void 0 : _slice$content$firstC4.type) === schema.nodes.table) {
|
|
208
257
|
// repoint the slice's cutting depth so that cell content where the slice starts
|
|
209
258
|
// does not get lifted out of the cell on paste
|
|
210
259
|
return new _model.Slice(slice.content, 1, slice.openEnd);
|
|
@@ -2,6 +2,7 @@ import kebabCase from 'lodash/kebabCase';
|
|
|
2
2
|
import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
|
|
3
3
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
4
4
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
7
8
|
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
|
|
@@ -76,7 +77,7 @@ export const tableNodeSpecWithFixedToDOM = config => {
|
|
|
76
77
|
'--ak-editor-table-min-width': `${tableMinWidth}px`,
|
|
77
78
|
minWidth: 'var(--ak-editor-table-min-width)',
|
|
78
79
|
maxWidth: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))`,
|
|
79
|
-
width: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`
|
|
80
|
+
width: fg('platform_editor_table_layout_shift_fix') ? `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width}px)` : `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`
|
|
80
81
|
})
|
|
81
82
|
}, ['span', {
|
|
82
83
|
class: 'resizer-hover-zone'
|
|
@@ -163,12 +163,58 @@ export const transformSliceToFixHardBreakProblemOnCopyFromCell = (slice, schema)
|
|
|
163
163
|
}
|
|
164
164
|
return slice;
|
|
165
165
|
};
|
|
166
|
+
const isNodeSingleCellTable = (node, schema) => {
|
|
167
|
+
var _node$firstChild, _node$firstChild$firs, _node$firstChild$firs2;
|
|
168
|
+
return node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type) === schema.nodes.tableRow && node.firstChild.childCount === 1 && (((_node$firstChild$firs = node.firstChild.firstChild) === null || _node$firstChild$firs === void 0 ? void 0 : _node$firstChild$firs.type) === schema.nodes.tableCell || ((_node$firstChild$firs2 = node.firstChild.firstChild) === null || _node$firstChild$firs2 === void 0 ? void 0 : _node$firstChild$firs2.type) === schema.nodes.tableHeader);
|
|
169
|
+
};
|
|
170
|
+
const isFragmentSingleCellTable = (fragment, schema) => {
|
|
171
|
+
return fragment.childCount === 1 && fragment.firstChild !== null && isNodeSingleCellTable(fragment.firstChild, schema);
|
|
172
|
+
};
|
|
173
|
+
const containsTextBlockChildren = (fragment, schema) => {
|
|
174
|
+
let containsTextBlock = false;
|
|
175
|
+
fragment.forEach(node => {
|
|
176
|
+
if (node.isTextblock) {
|
|
177
|
+
containsTextBlock = true;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return containsTextBlock;
|
|
181
|
+
};
|
|
166
182
|
export const transformSliceToRemoveOpenTable = (slice, schema) => {
|
|
167
|
-
var _slice$content$
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
var _slice$content$firstC8;
|
|
184
|
+
if (fg('platform_editor_nested_tables_paste_wrap_fix')) {
|
|
185
|
+
// Case 1: A slice of a textblock selection inside a nested table
|
|
186
|
+
// Prosemirror wraps nested textblock selections in their respective tables
|
|
187
|
+
// We are using `safeInsert` to paste nested tables, so we do not want to preserve this wrapping
|
|
188
|
+
|
|
189
|
+
// slice starts and ends inside a nested table at the same depth
|
|
190
|
+
if (slice.openStart >= 7 && slice.openEnd >= 7 && slice.openStart === slice.openEnd) {
|
|
191
|
+
let cleaned = slice;
|
|
192
|
+
let descendedDepth = 0;
|
|
193
|
+
const tableDepthDecrement = 2;
|
|
170
194
|
|
|
171
|
-
|
|
195
|
+
// if the slice is a single cell table and contains cells with single cell tables, descend into it until we find textblock children
|
|
196
|
+
if (isFragmentSingleCellTable(slice.content, schema)) {
|
|
197
|
+
var _slice$content$firstC2;
|
|
198
|
+
(_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.descendants((node, _pos, parent) => {
|
|
199
|
+
if (isNodeSingleCellTable(node, schema)) {
|
|
200
|
+
descendedDepth += tableDepthDecrement;
|
|
201
|
+
} else if (node.type === schema.nodes.table) {
|
|
202
|
+
return false;
|
|
203
|
+
} else if (containsTextBlockChildren(node.content, schema)) {
|
|
204
|
+
descendedDepth += tableDepthDecrement;
|
|
205
|
+
// create a new slice with the content of the textblock children and the depth of the nested tables subtracted
|
|
206
|
+
cleaned = new Slice(node.content, slice.openStart - descendedDepth - tableDepthDecrement, slice.openEnd - descendedDepth - tableDepthDecrement);
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
if (!cleaned.eq(slice)) {
|
|
212
|
+
return cleaned;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Case 2: A slice entirely within a single CELL
|
|
172
218
|
if (
|
|
173
219
|
// starts and ends inside of a cell
|
|
174
220
|
slice.openStart >= 4 && slice.openEnd >= 4 &&
|
|
@@ -177,25 +223,28 @@ export const transformSliceToRemoveOpenTable = (slice, schema) => {
|
|
|
177
223
|
// Ignored via go/ees005
|
|
178
224
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179
225
|
slice.content.firstChild.type === schema.nodes.table) {
|
|
180
|
-
var _slice$content$
|
|
226
|
+
var _slice$content$firstC3, _slice$content$firstC4, _slice$content$firstC5, _slice$content$firstC6, _slice$content$firstC7;
|
|
227
|
+
// we're removing the table, tableRow and tableCell reducing the open depth by 3
|
|
228
|
+
const depthDecrement = 3;
|
|
229
|
+
|
|
181
230
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
182
231
|
// https://github.com/ProseMirror/prosemirror/issues/1270
|
|
183
232
|
// The structure becomes
|
|
184
233
|
// table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
|
|
185
234
|
// As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
|
|
186
235
|
let cleaned = slice;
|
|
187
|
-
if (((_slice$content$
|
|
236
|
+
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : (_slice$content$firstC4 = _slice$content$firstC3.content) === null || _slice$content$firstC4 === void 0 ? void 0 : (_slice$content$firstC5 = _slice$content$firstC4.firstChild) === null || _slice$content$firstC5 === void 0 ? void 0 : (_slice$content$firstC6 = _slice$content$firstC5.content) === null || _slice$content$firstC6 === void 0 ? void 0 : (_slice$content$firstC7 = _slice$content$firstC6.firstChild) === null || _slice$content$firstC7 === void 0 ? void 0 : _slice$content$firstC7.type) === schema.nodes.table) {
|
|
188
237
|
cleaned = new Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
|
|
189
238
|
}
|
|
190
239
|
return new Slice(flatmap(cleaned.content, unwrapContentFromTable), cleaned.openStart - depthDecrement, cleaned.openEnd - depthDecrement);
|
|
191
240
|
}
|
|
192
241
|
|
|
193
|
-
// Case
|
|
242
|
+
// Case 3: A slice starting within a CELL and ending outside the table
|
|
194
243
|
if (
|
|
195
244
|
// starts inside of a cell but ends outside of the starting table
|
|
196
245
|
slice.openStart >= 4 &&
|
|
197
246
|
// slice starts from a table node (and spans across more than one node)
|
|
198
|
-
slice.content.childCount > 1 && ((_slice$content$
|
|
247
|
+
slice.content.childCount > 1 && ((_slice$content$firstC8 = slice.content.firstChild) === null || _slice$content$firstC8 === void 0 ? void 0 : _slice$content$firstC8.type) === schema.nodes.table) {
|
|
199
248
|
// repoint the slice's cutting depth so that cell content where the slice starts
|
|
200
249
|
// does not get lifted out of the cell on paste
|
|
201
250
|
return new Slice(slice.content, 1, slice.openEnd);
|
|
@@ -7,6 +7,7 @@ import kebabCase from 'lodash/kebabCase';
|
|
|
7
7
|
import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
|
|
8
8
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
9
9
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
12
13
|
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
|
|
@@ -85,7 +86,7 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
85
86
|
'--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
|
|
86
87
|
minWidth: 'var(--ak-editor-table-min-width)',
|
|
87
88
|
maxWidth: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
|
|
88
|
-
width: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
|
|
89
|
+
width: fg('platform_editor_table_layout_shift_fix') ? "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, "px)") : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
|
|
89
90
|
})
|
|
90
91
|
}, ['span', {
|
|
91
92
|
class: 'resizer-hover-zone'
|
|
@@ -165,12 +165,58 @@ export var transformSliceToFixHardBreakProblemOnCopyFromCell = function transfor
|
|
|
165
165
|
}
|
|
166
166
|
return slice;
|
|
167
167
|
};
|
|
168
|
+
var isNodeSingleCellTable = function isNodeSingleCellTable(node, schema) {
|
|
169
|
+
var _node$firstChild, _node$firstChild$firs, _node$firstChild$firs2;
|
|
170
|
+
return node.childCount === 1 && ((_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.type) === schema.nodes.tableRow && node.firstChild.childCount === 1 && (((_node$firstChild$firs = node.firstChild.firstChild) === null || _node$firstChild$firs === void 0 ? void 0 : _node$firstChild$firs.type) === schema.nodes.tableCell || ((_node$firstChild$firs2 = node.firstChild.firstChild) === null || _node$firstChild$firs2 === void 0 ? void 0 : _node$firstChild$firs2.type) === schema.nodes.tableHeader);
|
|
171
|
+
};
|
|
172
|
+
var isFragmentSingleCellTable = function isFragmentSingleCellTable(fragment, schema) {
|
|
173
|
+
return fragment.childCount === 1 && fragment.firstChild !== null && isNodeSingleCellTable(fragment.firstChild, schema);
|
|
174
|
+
};
|
|
175
|
+
var containsTextBlockChildren = function containsTextBlockChildren(fragment, schema) {
|
|
176
|
+
var containsTextBlock = false;
|
|
177
|
+
fragment.forEach(function (node) {
|
|
178
|
+
if (node.isTextblock) {
|
|
179
|
+
containsTextBlock = true;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
return containsTextBlock;
|
|
183
|
+
};
|
|
168
184
|
export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpenTable(slice, schema) {
|
|
169
|
-
var _slice$content$
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
var _slice$content$firstC4;
|
|
186
|
+
if (fg('platform_editor_nested_tables_paste_wrap_fix')) {
|
|
187
|
+
// Case 1: A slice of a textblock selection inside a nested table
|
|
188
|
+
// Prosemirror wraps nested textblock selections in their respective tables
|
|
189
|
+
// We are using `safeInsert` to paste nested tables, so we do not want to preserve this wrapping
|
|
190
|
+
|
|
191
|
+
// slice starts and ends inside a nested table at the same depth
|
|
192
|
+
if (slice.openStart >= 7 && slice.openEnd >= 7 && slice.openStart === slice.openEnd) {
|
|
193
|
+
var cleaned = slice;
|
|
194
|
+
var descendedDepth = 0;
|
|
195
|
+
var tableDepthDecrement = 2;
|
|
172
196
|
|
|
173
|
-
|
|
197
|
+
// if the slice is a single cell table and contains cells with single cell tables, descend into it until we find textblock children
|
|
198
|
+
if (isFragmentSingleCellTable(slice.content, schema)) {
|
|
199
|
+
var _slice$content$firstC2;
|
|
200
|
+
(_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 || _slice$content$firstC2.descendants(function (node, _pos, parent) {
|
|
201
|
+
if (isNodeSingleCellTable(node, schema)) {
|
|
202
|
+
descendedDepth += tableDepthDecrement;
|
|
203
|
+
} else if (node.type === schema.nodes.table) {
|
|
204
|
+
return false;
|
|
205
|
+
} else if (containsTextBlockChildren(node.content, schema)) {
|
|
206
|
+
descendedDepth += tableDepthDecrement;
|
|
207
|
+
// create a new slice with the content of the textblock children and the depth of the nested tables subtracted
|
|
208
|
+
cleaned = new Slice(node.content, slice.openStart - descendedDepth - tableDepthDecrement, slice.openEnd - descendedDepth - tableDepthDecrement);
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (!cleaned.eq(slice)) {
|
|
214
|
+
return cleaned;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Case 2: A slice entirely within a single CELL
|
|
174
220
|
if (
|
|
175
221
|
// starts and ends inside of a cell
|
|
176
222
|
slice.openStart >= 4 && slice.openEnd >= 4 &&
|
|
@@ -179,25 +225,28 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
|
|
|
179
225
|
// Ignored via go/ees005
|
|
180
226
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
181
227
|
slice.content.firstChild.type === schema.nodes.table) {
|
|
182
|
-
var _slice$content$
|
|
228
|
+
var _slice$content$firstC3;
|
|
229
|
+
// we're removing the table, tableRow and tableCell reducing the open depth by 3
|
|
230
|
+
var depthDecrement = 3;
|
|
231
|
+
|
|
183
232
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
184
233
|
// https://github.com/ProseMirror/prosemirror/issues/1270
|
|
185
234
|
// The structure becomes
|
|
186
235
|
// table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
|
|
187
236
|
// As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
|
|
188
|
-
var
|
|
189
|
-
if (((_slice$content$
|
|
190
|
-
|
|
237
|
+
var _cleaned = slice;
|
|
238
|
+
if (((_slice$content$firstC3 = slice.content.firstChild) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.content) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.firstChild) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.content) === null || _slice$content$firstC3 === void 0 || (_slice$content$firstC3 = _slice$content$firstC3.firstChild) === null || _slice$content$firstC3 === void 0 ? void 0 : _slice$content$firstC3.type) === schema.nodes.table) {
|
|
239
|
+
_cleaned = new Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
|
|
191
240
|
}
|
|
192
|
-
return new Slice(flatmap(
|
|
241
|
+
return new Slice(flatmap(_cleaned.content, unwrapContentFromTable), _cleaned.openStart - depthDecrement, _cleaned.openEnd - depthDecrement);
|
|
193
242
|
}
|
|
194
243
|
|
|
195
|
-
// Case
|
|
244
|
+
// Case 3: A slice starting within a CELL and ending outside the table
|
|
196
245
|
if (
|
|
197
246
|
// starts inside of a cell but ends outside of the starting table
|
|
198
247
|
slice.openStart >= 4 &&
|
|
199
248
|
// slice starts from a table node (and spans across more than one node)
|
|
200
|
-
slice.content.childCount > 1 && ((_slice$content$
|
|
249
|
+
slice.content.childCount > 1 && ((_slice$content$firstC4 = slice.content.firstChild) === null || _slice$content$firstC4 === void 0 ? void 0 : _slice$content$firstC4.type) === schema.nodes.table) {
|
|
201
250
|
// repoint the slice's cutting depth so that cell content where the slice starts
|
|
202
251
|
// does not get lifted out of the cell on paste
|
|
203
252
|
return new Slice(slice.content, 1, slice.openEnd);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
|
|
@@ -6,4 +6,4 @@ export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset,
|
|
|
6
6
|
node?: PMNode | undefined;
|
|
7
7
|
getScrollOffset: () => number;
|
|
8
8
|
getTableWrapperWidth: () => number;
|
|
9
|
-
}) => JSX.Element | null;
|
|
9
|
+
}) => React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
4
|
import type { GetEditorFeatureFlags, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
@@ -25,5 +25,5 @@ type TableComponentWithSharedStateProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Use useSharedPluginState to control re-renders from plugin dependencies
|
|
27
27
|
*/
|
|
28
|
-
export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => JSX.Element | null;
|
|
28
|
+
export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => React.JSX.Element | null;
|
|
29
29
|
export {};
|
|
@@ -22,7 +22,7 @@ type ResizableTableContainerProps = {
|
|
|
22
22
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
23
23
|
isCommentEditor?: boolean;
|
|
24
24
|
};
|
|
25
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
25
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => React.JSX.Element>;
|
|
26
26
|
type TableContainerProps = {
|
|
27
27
|
node: PMNode;
|
|
28
28
|
className: string;
|
|
@@ -43,5 +43,5 @@ type TableContainerProps = {
|
|
|
43
43
|
isCommentEditor?: boolean;
|
|
44
44
|
isChromelessEditor?: boolean;
|
|
45
45
|
};
|
|
46
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
46
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
|
|
47
47
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import type { TableEventPayload } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
4
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -30,5 +31,5 @@ interface TableResizerProps {
|
|
|
30
31
|
onResizeStart?: () => void;
|
|
31
32
|
disabled?: boolean;
|
|
32
33
|
}
|
|
33
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
|
|
34
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
|
|
34
35
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
@@ -23,7 +23,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
23
23
|
};
|
|
24
24
|
setDomAttrs(node: PmNode): void;
|
|
25
25
|
getNode: () => PmNode;
|
|
26
|
-
render(props: Props, forwardRef: ForwardRef): JSX.Element;
|
|
26
|
+
render(props: Props, forwardRef: ForwardRef): React.JSX.Element;
|
|
27
27
|
private hasHoveredRows;
|
|
28
28
|
viewShouldUpdate(nextNode: PmNode): boolean;
|
|
29
29
|
ignoreMutation(mutation: MutationRecord | {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
type HandleIconProps = {
|
|
3
3
|
forceDefaultHandle: boolean;
|
|
4
4
|
isHandleHovered: boolean;
|
|
5
5
|
hasMergedCells: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
|
|
7
|
+
export declare const HandleIconComponent: (props: HandleIconProps) => React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { TableDirection } from '../../types';
|
|
3
3
|
export declare const DragPreview: ({ direction, width, height, }: {
|
|
4
4
|
direction: TableDirection;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -50,6 +50,6 @@ declare class FloatingDeleteButton extends Component<Props, State> {
|
|
|
50
50
|
* @memberof FloatingDeleteButton
|
|
51
51
|
*/
|
|
52
52
|
private handleClick;
|
|
53
|
-
render(): JSX.Element | null;
|
|
53
|
+
render(): React.JSX.Element | null;
|
|
54
54
|
}
|
|
55
55
|
export default FloatingDeleteButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
3
3
|
type DropdownMenuProps = {
|
|
4
4
|
items: Array<{
|
|
@@ -32,5 +32,5 @@ type DropdownMenuProps = {
|
|
|
32
32
|
boundariesElement?: HTMLElement;
|
|
33
33
|
scrollableElement?: HTMLElement;
|
|
34
34
|
};
|
|
35
|
-
export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => JSX.Element;
|
|
35
|
+
export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => React.JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
@@ -28,7 +28,7 @@ interface Props {
|
|
|
28
28
|
isCommentEditor?: boolean;
|
|
29
29
|
}
|
|
30
30
|
declare const FloatingDragMenu: {
|
|
31
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): JSX.Element | null;
|
|
31
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): React.JSX.Element | null;
|
|
32
32
|
displayName: string;
|
|
33
33
|
};
|
|
34
34
|
export default FloatingDragMenu;
|
|
@@ -30,7 +30,7 @@ export interface Props {
|
|
|
30
30
|
export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
31
31
|
static displayName: string;
|
|
32
32
|
constructor(props: Props & WrappedComponentProps);
|
|
33
|
-
render(): JSX.Element | null;
|
|
33
|
+
render(): React.JSX.Element | null;
|
|
34
34
|
private getCellPosition;
|
|
35
35
|
private insertRow;
|
|
36
36
|
private insertColumn;
|
|
@@ -9,5 +9,5 @@ interface Props {
|
|
|
9
9
|
stick?: boolean;
|
|
10
10
|
offset?: [number, number];
|
|
11
11
|
}
|
|
12
|
-
export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => JSX.Element>;
|
|
12
|
+
export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { TablePlugin } from '../../../tablePluginType';
|
|
@@ -28,5 +28,5 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
|
|
|
28
28
|
commands: import("../../../tablePluginType").TablePluginCommands;
|
|
29
29
|
dependencies: import("../../../tablePluginType").TablePluginDependencies;
|
|
30
30
|
}> | undefined;
|
|
31
|
-
}) => JSX.Element;
|
|
31
|
+
}) => React.JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
index: number;
|
|
4
4
|
localId?: string;
|
|
@@ -6,5 +6,5 @@ interface Props {
|
|
|
6
6
|
height?: number;
|
|
7
7
|
marginTop?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => JSX.Element;
|
|
9
|
+
export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => React.JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
tableRef: HTMLTableElement;
|
|
4
4
|
tableHeight?: number;
|
|
@@ -7,5 +7,5 @@ interface Props {
|
|
|
7
7
|
isHeaderSticky?: boolean;
|
|
8
8
|
getScrollOffset?: () => number;
|
|
9
9
|
}
|
|
10
|
-
export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => JSX.Element | null;
|
|
10
|
+
export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => React.JSX.Element | null;
|
|
11
11
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
3
3
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -29,5 +29,5 @@ interface Props {
|
|
|
29
29
|
api?: PluginInjectionAPI;
|
|
30
30
|
isChromelessEditor?: boolean;
|
|
31
31
|
}
|
|
32
|
-
declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => JSX.Element | null;
|
|
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;
|
|
33
33
|
export default TableFloatingColumnControls;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { TablePlugin } from '../../tablePluginType';
|
|
@@ -16,5 +16,5 @@ type FloatingControlsWithSelectionProps = {
|
|
|
16
16
|
tableActive: boolean;
|
|
17
17
|
api?: ExtractInjectionAPI<TablePlugin>;
|
|
18
18
|
};
|
|
19
|
-
export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => JSX.Element;
|
|
19
|
+
export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => React.JSX.Element;
|
|
20
20
|
export {};
|