@atlaskit/editor-plugin-table 22.4.13 → 22.4.14
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,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 22.4.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c77cce42b15b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c77cce42b15b) -
|
|
8
|
+
Updated sync blocks to support ssr streaming
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 22.4.13
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -21,6 +21,7 @@ var _collab = require("@atlaskit/editor-common/collab");
|
|
|
21
21
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
22
22
|
var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
|
|
23
23
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
24
|
+
var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
|
|
24
25
|
var _table = require("@atlaskit/editor-common/table");
|
|
25
26
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
27
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -92,6 +93,21 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
92
93
|
_this.props.view.dispatch(tr);
|
|
93
94
|
});
|
|
94
95
|
(0, _defineProperty2.default)(_this, "lastSetTableRef", null);
|
|
96
|
+
(0, _defineProperty2.default)(_this, "setWrapperRef", function (elem) {
|
|
97
|
+
_this.wrapper = elem;
|
|
98
|
+
if (!elem) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
_this.props.contentDOM(elem);
|
|
102
|
+
var tableElement = elem.querySelector('table');
|
|
103
|
+
if (tableElement !== _this.table) {
|
|
104
|
+
_this.table = tableElement;
|
|
105
|
+
_this.observeTable(_this.table);
|
|
106
|
+
if (_this.table && (!(0, _expValEquals.expValEquals)('platform_editor_table_ref_optimisation', 'isEnabled', true) || _this.props.tableActive) && _this.props.view && !(0, _expValEquals.expValEquals)('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_table_update_table_ref', 'isEnabled', true) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_update_ref_atlas'))) {
|
|
107
|
+
(0, _commands.setTableRef)(_this.table)(_this.props.view.state, _this.props.view.dispatch);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
95
111
|
(0, _defineProperty2.default)(_this, "onStickyState", function (state) {
|
|
96
112
|
var pos = _this.props.getPos();
|
|
97
113
|
if (!(0, _utils.isValidPosition)(pos, _this.props.view.state)) {
|
|
@@ -956,26 +972,12 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
956
972
|
var _this5$wrapper3;
|
|
957
973
|
return ((_this5$wrapper3 = _this5.wrapper) === null || _this5$wrapper3 === void 0 ? void 0 : _this5$wrapper3.clientWidth) || 760;
|
|
958
974
|
}
|
|
959
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
960
|
-
|
|
975
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNodeView.NodeViewContentHole
|
|
976
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides -- existing table wrapper class required for legacy styling hooks
|
|
977
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
978
|
+
, {
|
|
961
979
|
className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_NODE_WRAPPER),
|
|
962
|
-
ref:
|
|
963
|
-
_this5.wrapper = elem;
|
|
964
|
-
if (elem) {
|
|
965
|
-
_this5.props.contentDOM(elem);
|
|
966
|
-
var tableElement = elem.querySelector('table');
|
|
967
|
-
if (tableElement !== _this5.table) {
|
|
968
|
-
_this5.table = tableElement;
|
|
969
|
-
_this5.observeTable(_this5.table);
|
|
970
|
-
|
|
971
|
-
// // Update tableRef in plugin state when table is properly mounted
|
|
972
|
-
// // At this point, both table and wrapper are in DOM with correct parent-child relationship
|
|
973
|
-
if (_this5.table && (!(0, _expValEquals.expValEquals)('platform_editor_table_ref_optimisation', 'isEnabled', true) || _this5.props.tableActive) && _this5.props.view && !(0, _expValEquals.expValEquals)('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_table_update_table_ref', 'isEnabled', true) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_update_ref_atlas'))) {
|
|
974
|
-
(0, _commands.setTableRef)(_this5.table)(_this5.props.view.state, _this5.props.view.dispatch);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
980
|
+
ref: this.setWrapperRef
|
|
979
981
|
}, allowControls && colControls), !this.isNestedInTable ? /*#__PURE__*/_react.default.createElement("div", {
|
|
980
982
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
981
983
|
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
@@ -8,6 +8,7 @@ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
|
8
8
|
import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
|
|
9
9
|
import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
|
|
10
10
|
import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
11
|
+
import { NodeViewContentHole } from '@atlaskit/editor-common/react-node-view';
|
|
11
12
|
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
12
13
|
import { isValidPosition } from '@atlaskit/editor-common/utils';
|
|
13
14
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -19,7 +20,7 @@ import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/c
|
|
|
19
20
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
|
|
20
21
|
import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers/plugin-key';
|
|
21
22
|
import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
|
|
22
|
-
import {
|
|
23
|
+
import { hasTableBeenResized, insertColgroupFromNode } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
23
24
|
import { COLUMN_MIN_WIDTH, TABLE_EDITOR_MARGIN, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
24
25
|
import { updateControls } from '../pm-plugins/table-resizing/utils/dom';
|
|
25
26
|
import { getLayoutSize, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
|
|
@@ -71,6 +72,21 @@ class TableComponent extends React.Component {
|
|
|
71
72
|
this.props.view.dispatch(tr);
|
|
72
73
|
});
|
|
73
74
|
_defineProperty(this, "lastSetTableRef", null);
|
|
75
|
+
_defineProperty(this, "setWrapperRef", elem => {
|
|
76
|
+
this.wrapper = elem;
|
|
77
|
+
if (!elem) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.props.contentDOM(elem);
|
|
81
|
+
const tableElement = elem.querySelector('table');
|
|
82
|
+
if (tableElement !== this.table) {
|
|
83
|
+
this.table = tableElement;
|
|
84
|
+
this.observeTable(this.table);
|
|
85
|
+
if (this.table && (!expValEquals('platform_editor_table_ref_optimisation', 'isEnabled', true) || this.props.tableActive) && this.props.view && !expValEquals('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) || fg('platform_editor_enable_table_update_ref_atlas'))) {
|
|
86
|
+
setTableRef(this.table)(this.props.view.state, this.props.view.dispatch);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
74
90
|
_defineProperty(this, "onStickyState", state => {
|
|
75
91
|
const pos = this.props.getPos();
|
|
76
92
|
if (!isValidPosition(pos, this.props.view.state)) {
|
|
@@ -919,26 +935,12 @@ class TableComponent extends React.Component {
|
|
|
919
935
|
var _this$wrapper4;
|
|
920
936
|
return ((_this$wrapper4 = this.wrapper) === null || _this$wrapper4 === void 0 ? void 0 : _this$wrapper4.clientWidth) || 760;
|
|
921
937
|
}
|
|
922
|
-
}), /*#__PURE__*/React.createElement(
|
|
923
|
-
|
|
938
|
+
}), /*#__PURE__*/React.createElement(NodeViewContentHole
|
|
939
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides -- existing table wrapper class required for legacy styling hooks
|
|
940
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
941
|
+
, {
|
|
924
942
|
className: classnames(ClassName.TABLE_NODE_WRAPPER),
|
|
925
|
-
ref:
|
|
926
|
-
this.wrapper = elem;
|
|
927
|
-
if (elem) {
|
|
928
|
-
this.props.contentDOM(elem);
|
|
929
|
-
const tableElement = elem.querySelector('table');
|
|
930
|
-
if (tableElement !== this.table) {
|
|
931
|
-
this.table = tableElement;
|
|
932
|
-
this.observeTable(this.table);
|
|
933
|
-
|
|
934
|
-
// // Update tableRef in plugin state when table is properly mounted
|
|
935
|
-
// // At this point, both table and wrapper are in DOM with correct parent-child relationship
|
|
936
|
-
if (this.table && (!expValEquals('platform_editor_table_ref_optimisation', 'isEnabled', true) || this.props.tableActive) && this.props.view && !expValEquals('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) || fg('platform_editor_enable_table_update_ref_atlas'))) {
|
|
937
|
-
setTableRef(this.table)(this.props.view.state, this.props.view.dispatch);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
}
|
|
943
|
+
ref: this.setWrapperRef
|
|
942
944
|
}, allowControls && colControls), !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
|
|
943
945
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
944
946
|
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
@@ -21,6 +21,7 @@ import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
|
21
21
|
import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
|
|
22
22
|
import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
|
|
23
23
|
import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
24
|
+
import { NodeViewContentHole } from '@atlaskit/editor-common/react-node-view';
|
|
24
25
|
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
25
26
|
import { isValidPosition } from '@atlaskit/editor-common/utils';
|
|
26
27
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -32,7 +33,7 @@ import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/c
|
|
|
32
33
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
|
|
33
34
|
import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers/plugin-key';
|
|
34
35
|
import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
|
|
35
|
-
import {
|
|
36
|
+
import { hasTableBeenResized, insertColgroupFromNode } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
36
37
|
import { COLUMN_MIN_WIDTH, TABLE_EDITOR_MARGIN, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
37
38
|
import { updateControls } from '../pm-plugins/table-resizing/utils/dom';
|
|
38
39
|
import { getLayoutSize, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
|
|
@@ -86,6 +87,21 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
86
87
|
_this.props.view.dispatch(tr);
|
|
87
88
|
});
|
|
88
89
|
_defineProperty(_this, "lastSetTableRef", null);
|
|
90
|
+
_defineProperty(_this, "setWrapperRef", function (elem) {
|
|
91
|
+
_this.wrapper = elem;
|
|
92
|
+
if (!elem) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
_this.props.contentDOM(elem);
|
|
96
|
+
var tableElement = elem.querySelector('table');
|
|
97
|
+
if (tableElement !== _this.table) {
|
|
98
|
+
_this.table = tableElement;
|
|
99
|
+
_this.observeTable(_this.table);
|
|
100
|
+
if (_this.table && (!expValEquals('platform_editor_table_ref_optimisation', 'isEnabled', true) || _this.props.tableActive) && _this.props.view && !expValEquals('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) || fg('platform_editor_enable_table_update_ref_atlas'))) {
|
|
101
|
+
setTableRef(_this.table)(_this.props.view.state, _this.props.view.dispatch);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
89
105
|
_defineProperty(_this, "onStickyState", function (state) {
|
|
90
106
|
var pos = _this.props.getPos();
|
|
91
107
|
if (!isValidPosition(pos, _this.props.view.state)) {
|
|
@@ -950,26 +966,12 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
950
966
|
var _this5$wrapper3;
|
|
951
967
|
return ((_this5$wrapper3 = _this5.wrapper) === null || _this5$wrapper3 === void 0 ? void 0 : _this5$wrapper3.clientWidth) || 760;
|
|
952
968
|
}
|
|
953
|
-
}), /*#__PURE__*/React.createElement(
|
|
954
|
-
|
|
969
|
+
}), /*#__PURE__*/React.createElement(NodeViewContentHole
|
|
970
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides -- existing table wrapper class required for legacy styling hooks
|
|
971
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
972
|
+
, {
|
|
955
973
|
className: classnames(ClassName.TABLE_NODE_WRAPPER),
|
|
956
|
-
ref:
|
|
957
|
-
_this5.wrapper = elem;
|
|
958
|
-
if (elem) {
|
|
959
|
-
_this5.props.contentDOM(elem);
|
|
960
|
-
var tableElement = elem.querySelector('table');
|
|
961
|
-
if (tableElement !== _this5.table) {
|
|
962
|
-
_this5.table = tableElement;
|
|
963
|
-
_this5.observeTable(_this5.table);
|
|
964
|
-
|
|
965
|
-
// // Update tableRef in plugin state when table is properly mounted
|
|
966
|
-
// // At this point, both table and wrapper are in DOM with correct parent-child relationship
|
|
967
|
-
if (_this5.table && (!expValEquals('platform_editor_table_ref_optimisation', 'isEnabled', true) || _this5.props.tableActive) && _this5.props.view && !expValEquals('platform_editor_fix_editor_unhandled_type_errors', 'isEnabled', true) && (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) || fg('platform_editor_enable_table_update_ref_atlas'))) {
|
|
968
|
-
setTableRef(_this5.table)(_this5.props.view.state, _this5.props.view.dispatch);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
974
|
+
ref: this.setWrapperRef
|
|
973
975
|
}, allowControls && colControls), !this.isNestedInTable ? /*#__PURE__*/React.createElement("div", {
|
|
974
976
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
975
977
|
className: ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "22.4.
|
|
3
|
+
"version": "22.4.14",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
60
60
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
61
61
|
"@atlaskit/primitives": "^19.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^82.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^82.3.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.6.0",
|
|
64
64
|
"@atlaskit/tokens": "^13.0.0",
|
|
65
65
|
"@atlaskit/tooltip": "^22.2.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"uuid": "^3.1.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@atlaskit/editor-common": "^114.
|
|
77
|
+
"@atlaskit/editor-common": "^114.41.0",
|
|
78
78
|
"react": "^18.2.0",
|
|
79
79
|
"react-dom": "^18.2.0",
|
|
80
80
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -169,6 +169,8 @@
|
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
171
|
"devDependencies": {
|
|
172
|
+
"react": "^18.2.0",
|
|
173
|
+
"react-dom": "^18.2.0",
|
|
172
174
|
"react-intl": "^6.6.2"
|
|
173
175
|
}
|
|
174
176
|
}
|