@atlaskit/editor-plugin-table 5.3.30 → 5.3.32
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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.3.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43379](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43379) [`482c025520d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/482c025520d) - ED-20763 Upgrade ADF schema version to 33.2.3 for MBE nodes.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 5.3.31
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#43131](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43131) [`31f8285fa54`](https://bitbucket.org/atlassian/atlassian-frontend/commits/31f8285fa54) - Fix hover other table in same page will also update cell position issue in selected table.
|
|
15
|
+
|
|
3
16
|
## 5.3.30
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -332,17 +332,25 @@ var whenTableInFocus = exports.whenTableInFocus = function whenTableInFocus(even
|
|
|
332
332
|
};
|
|
333
333
|
};
|
|
334
334
|
var trackCellLocation = function trackCellLocation(view, mouseEvent) {
|
|
335
|
+
var _tableElement$dataset;
|
|
335
336
|
var target = mouseEvent.target;
|
|
336
337
|
var maybeTableCell = (0, _utils.isElementInTableCell)(target);
|
|
337
338
|
var tableRef = (0, _pluginFactory2.getPluginState)(view.state).tableRef;
|
|
339
|
+
var _getPluginState8 = (0, _pluginFactory2.getPluginState)(view.state),
|
|
340
|
+
hoveredCell = _getPluginState8.hoveredCell,
|
|
341
|
+
tableNode = _getPluginState8.tableNode;
|
|
342
|
+
var tableElement = (0, _utils.closestElement)(target, 'table');
|
|
343
|
+
|
|
344
|
+
// hover will only trigger if target localId is the same with selected localId
|
|
345
|
+
if (tableElement !== null && tableElement !== void 0 && (_tableElement$dataset = tableElement.dataset) !== null && _tableElement$dataset !== void 0 && _tableElement$dataset.tableLocalId && tableElement.dataset.tableLocalId !== (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId)) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
338
348
|
if (!maybeTableCell || !tableRef) {
|
|
339
349
|
return;
|
|
340
350
|
}
|
|
341
351
|
var colIndex = maybeTableCell.cellIndex;
|
|
342
352
|
var rowElement = (0, _utils.closestElement)(target, 'tr');
|
|
343
353
|
var rowIndex = rowElement && rowElement.rowIndex;
|
|
344
|
-
var _getPluginState8 = (0, _pluginFactory2.getPluginState)(view.state),
|
|
345
|
-
hoveredCell = _getPluginState8.hoveredCell;
|
|
346
354
|
var colHeight = tableRef.offsetHeight;
|
|
347
355
|
var colWidth = maybeTableCell.offsetWidth;
|
|
348
356
|
if (hoveredCell.colIndex !== colIndex || hoveredCell.rowIndex !== rowIndex || hoveredCell.colWidth !== colWidth || hoveredCell.colHeight !== colHeight) {
|
|
@@ -339,18 +339,26 @@ export const whenTableInFocus = (eventHandler, elementContentRects) => (view, mo
|
|
|
339
339
|
return eventHandler(view, mouseEvent, elementContentRects);
|
|
340
340
|
};
|
|
341
341
|
const trackCellLocation = (view, mouseEvent) => {
|
|
342
|
+
var _tableElement$dataset;
|
|
342
343
|
const target = mouseEvent.target;
|
|
343
344
|
const maybeTableCell = isElementInTableCell(target);
|
|
344
345
|
const tableRef = getPluginState(view.state).tableRef;
|
|
346
|
+
const {
|
|
347
|
+
hoveredCell,
|
|
348
|
+
tableNode
|
|
349
|
+
} = getPluginState(view.state);
|
|
350
|
+
const tableElement = closestElement(target, 'table');
|
|
351
|
+
|
|
352
|
+
// hover will only trigger if target localId is the same with selected localId
|
|
353
|
+
if (tableElement !== null && tableElement !== void 0 && (_tableElement$dataset = tableElement.dataset) !== null && _tableElement$dataset !== void 0 && _tableElement$dataset.tableLocalId && tableElement.dataset.tableLocalId !== (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId)) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
345
356
|
if (!maybeTableCell || !tableRef) {
|
|
346
357
|
return;
|
|
347
358
|
}
|
|
348
359
|
const colIndex = maybeTableCell.cellIndex;
|
|
349
360
|
const rowElement = closestElement(target, 'tr');
|
|
350
361
|
const rowIndex = rowElement && rowElement.rowIndex;
|
|
351
|
-
const {
|
|
352
|
-
hoveredCell
|
|
353
|
-
} = getPluginState(view.state);
|
|
354
362
|
const colHeight = tableRef.offsetHeight;
|
|
355
363
|
const colWidth = maybeTableCell.offsetWidth;
|
|
356
364
|
if (hoveredCell.colIndex !== colIndex || hoveredCell.rowIndex !== rowIndex || hoveredCell.colWidth !== colWidth || hoveredCell.colHeight !== colHeight) {
|
|
@@ -323,17 +323,25 @@ export var whenTableInFocus = function whenTableInFocus(eventHandler, elementCon
|
|
|
323
323
|
};
|
|
324
324
|
};
|
|
325
325
|
var trackCellLocation = function trackCellLocation(view, mouseEvent) {
|
|
326
|
+
var _tableElement$dataset;
|
|
326
327
|
var target = mouseEvent.target;
|
|
327
328
|
var maybeTableCell = isElementInTableCell(target);
|
|
328
329
|
var tableRef = getPluginState(view.state).tableRef;
|
|
330
|
+
var _getPluginState8 = getPluginState(view.state),
|
|
331
|
+
hoveredCell = _getPluginState8.hoveredCell,
|
|
332
|
+
tableNode = _getPluginState8.tableNode;
|
|
333
|
+
var tableElement = closestElement(target, 'table');
|
|
334
|
+
|
|
335
|
+
// hover will only trigger if target localId is the same with selected localId
|
|
336
|
+
if (tableElement !== null && tableElement !== void 0 && (_tableElement$dataset = tableElement.dataset) !== null && _tableElement$dataset !== void 0 && _tableElement$dataset.tableLocalId && tableElement.dataset.tableLocalId !== (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId)) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
329
339
|
if (!maybeTableCell || !tableRef) {
|
|
330
340
|
return;
|
|
331
341
|
}
|
|
332
342
|
var colIndex = maybeTableCell.cellIndex;
|
|
333
343
|
var rowElement = closestElement(target, 'tr');
|
|
334
344
|
var rowIndex = rowElement && rowElement.rowIndex;
|
|
335
|
-
var _getPluginState8 = getPluginState(view.state),
|
|
336
|
-
hoveredCell = _getPluginState8.hoveredCell;
|
|
337
345
|
var colHeight = tableRef.offsetHeight;
|
|
338
346
|
var colWidth = maybeTableCell.offsetWidth;
|
|
339
347
|
if (hoveredCell.colIndex !== colIndex || hoveredCell.rowIndex !== rowIndex || hoveredCell.colWidth !== colWidth || hoveredCell.colHeight !== colHeight) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.32",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"releaseModel": "continuous"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
31
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
32
|
-
"@atlaskit/editor-common": "^76.
|
|
30
|
+
"@atlaskit/adf-schema": "^33.2.3",
|
|
31
|
+
"@atlaskit/custom-steps": "^0.0.3",
|
|
32
|
+
"@atlaskit/editor-common": "^76.22.0",
|
|
33
33
|
"@atlaskit/editor-palette": "1.5.2",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
35
35
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -533,6 +533,20 @@ const trackCellLocation = (view: EditorView, mouseEvent: Event) => {
|
|
|
533
533
|
target as HTMLElement,
|
|
534
534
|
) as HTMLTableCellElement | null;
|
|
535
535
|
const tableRef = getPluginState(view.state).tableRef;
|
|
536
|
+
const { hoveredCell, tableNode } = getPluginState(view.state);
|
|
537
|
+
|
|
538
|
+
const tableElement = closestElement(
|
|
539
|
+
target as HTMLElement,
|
|
540
|
+
'table',
|
|
541
|
+
) as HTMLTableElement;
|
|
542
|
+
|
|
543
|
+
// hover will only trigger if target localId is the same with selected localId
|
|
544
|
+
if (
|
|
545
|
+
tableElement?.dataset?.tableLocalId &&
|
|
546
|
+
tableElement.dataset.tableLocalId !== tableNode?.attrs.localId
|
|
547
|
+
) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
536
550
|
|
|
537
551
|
if (!maybeTableCell || !tableRef) {
|
|
538
552
|
return;
|
|
@@ -544,7 +558,6 @@ const trackCellLocation = (view: EditorView, mouseEvent: Event) => {
|
|
|
544
558
|
'tr',
|
|
545
559
|
) as HTMLTableRowElement;
|
|
546
560
|
const rowIndex = rowElement && rowElement.rowIndex;
|
|
547
|
-
const { hoveredCell } = getPluginState(view.state);
|
|
548
561
|
|
|
549
562
|
const colHeight = tableRef.offsetHeight;
|
|
550
563
|
const colWidth = maybeTableCell.offsetWidth;
|