@atlaskit/editor-plugin-table 12.3.1 → 12.3.2
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 +8 -0
- package/dist/cjs/nodeviews/TableContainer.js +9 -7
- package/dist/cjs/nodeviews/table.js +5 -0
- package/dist/cjs/nodeviews/toDOM.js +5 -2
- package/dist/es2019/nodeviews/TableContainer.js +9 -7
- package/dist/es2019/nodeviews/table.js +5 -0
- package/dist/es2019/nodeviews/toDOM.js +5 -1
- package/dist/esm/nodeviews/TableContainer.js +9 -7
- package/dist/esm/nodeviews/table.js +5 -0
- package/dist/esm/nodeviews/toDOM.js +5 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 12.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dd62fd4cc8e91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd62fd4cc8e91) -
|
|
8
|
+
mark table elements for better TTVC tracking
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 12.3.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -104,14 +104,14 @@ var AlignmentTableContainer = function AlignmentTableContainer(_ref2) {
|
|
|
104
104
|
var style = (0, _react.useMemo)(function () {
|
|
105
105
|
return (0, _tableContainerStyles.getAlignmentStyle)(alignment);
|
|
106
106
|
}, [alignment]);
|
|
107
|
-
return (
|
|
108
|
-
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
+
"data-testid": "table-alignment-container",
|
|
109
|
+
"data-ssr-placeholder": (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
110
|
+
"data-ssr-placeholder-replace": (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined
|
|
109
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, children)
|
|
114
|
-
);
|
|
112
|
+
,
|
|
113
|
+
style: style
|
|
114
|
+
}, children);
|
|
115
115
|
};
|
|
116
116
|
var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_ref3) {
|
|
117
117
|
var isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
@@ -123,6 +123,8 @@ var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_re
|
|
|
123
123
|
if (!isTableAlignmentEnabled) {
|
|
124
124
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
125
125
|
"data-testid": "table-alignment-container",
|
|
126
|
+
"data-ssr-placeholder": (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
127
|
+
"data-ssr-placeholder-replace": (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
126
128
|
style: {
|
|
127
129
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
128
130
|
display: 'flex',
|
|
@@ -21,6 +21,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
22
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
23
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
24
25
|
var _createPluginConfig = require("../pm-plugins/create-plugin-config");
|
|
25
26
|
var _pluginKey = require("../pm-plugins/drag-and-drop/plugin-key");
|
|
26
27
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -153,6 +154,10 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
153
154
|
if (this.view.state.selection.visible) {
|
|
154
155
|
selectionBookmark = this.view.state.selection.getBookmark();
|
|
155
156
|
}
|
|
157
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
158
|
+
this.dom.setAttribute('data-ssr-placeholder', "table-nodeview-".concat(this.node.attrs.localId));
|
|
159
|
+
this.dom.setAttribute('data-ssr-placeholder-replace', "table-nodeview-".concat(this.node.attrs.localId));
|
|
160
|
+
}
|
|
156
161
|
|
|
157
162
|
// Remove the ProseMirror table DOM structure to avoid duplication, as it's replaced with the React table node.
|
|
158
163
|
if (this.dom && this.renderedDOM) {
|
|
@@ -40,13 +40,16 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
|
|
|
40
40
|
var tableMinWidth = (0, _colgroup.getResizerMinWidth)(node);
|
|
41
41
|
var tableWidthAttribute = node.attrs.width ? "".concat(node.attrs.width, "px") : "100%";
|
|
42
42
|
var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
|
|
43
|
-
var attrs = {
|
|
43
|
+
var attrs = _objectSpread({
|
|
44
44
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
45
45
|
'data-layout': node.attrs.layout,
|
|
46
46
|
'data-autosize': node.attrs.__autoSize,
|
|
47
47
|
'data-table-local-id': node.attrs.localId,
|
|
48
48
|
'data-table-width': node.attrs.width
|
|
49
|
-
}
|
|
49
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) && {
|
|
50
|
+
'data-ssr-placeholder': "table-".concat(node.attrs.localId),
|
|
51
|
+
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId)
|
|
52
|
+
});
|
|
50
53
|
|
|
51
54
|
// This would be used for table scaling in colgroup CSS
|
|
52
55
|
// cqw, or px is well supported
|
|
@@ -101,14 +101,14 @@ const AlignmentTableContainer = ({
|
|
|
101
101
|
const style = useMemo(() => {
|
|
102
102
|
return getAlignmentStyle(alignment);
|
|
103
103
|
}, [alignment]);
|
|
104
|
-
return (
|
|
105
|
-
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
"data-testid": "table-alignment-container",
|
|
106
|
+
"data-ssr-placeholder": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? `table-${node.attrs.localId}` : undefined,
|
|
107
|
+
"data-ssr-placeholder-replace": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? `table-${node.attrs.localId}` : undefined
|
|
106
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, children)
|
|
111
|
-
);
|
|
109
|
+
,
|
|
110
|
+
style: style
|
|
111
|
+
}, children);
|
|
112
112
|
};
|
|
113
113
|
const AlignmentTableContainerWrapper = ({
|
|
114
114
|
isTableAlignmentEnabled,
|
|
@@ -121,6 +121,8 @@ const AlignmentTableContainerWrapper = ({
|
|
|
121
121
|
if (!isTableAlignmentEnabled) {
|
|
122
122
|
return /*#__PURE__*/React.createElement("div", {
|
|
123
123
|
"data-testid": "table-alignment-container",
|
|
124
|
+
"data-ssr-placeholder": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? `table-${node.attrs.localId}` : undefined,
|
|
125
|
+
"data-ssr-placeholder-replace": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? `table-${node.attrs.localId}` : undefined,
|
|
124
126
|
style: {
|
|
125
127
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
126
128
|
display: 'flex',
|
|
@@ -7,6 +7,7 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
7
7
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
11
12
|
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
|
|
12
13
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -125,6 +126,10 @@ export default class TableView extends ReactNodeView {
|
|
|
125
126
|
if (this.view.state.selection.visible) {
|
|
126
127
|
selectionBookmark = this.view.state.selection.getBookmark();
|
|
127
128
|
}
|
|
129
|
+
if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
130
|
+
this.dom.setAttribute('data-ssr-placeholder', `table-nodeview-${this.node.attrs.localId}`);
|
|
131
|
+
this.dom.setAttribute('data-ssr-placeholder-replace', `table-nodeview-${this.node.attrs.localId}`);
|
|
132
|
+
}
|
|
128
133
|
|
|
129
134
|
// Remove the ProseMirror table DOM structure to avoid duplication, as it's replaced with the React table node.
|
|
130
135
|
if (this.dom && this.renderedDOM) {
|
|
@@ -29,7 +29,11 @@ export const tableNodeSpecWithFixedToDOM = config => {
|
|
|
29
29
|
'data-layout': node.attrs.layout,
|
|
30
30
|
'data-autosize': node.attrs.__autoSize,
|
|
31
31
|
'data-table-local-id': node.attrs.localId,
|
|
32
|
-
'data-table-width': node.attrs.width
|
|
32
|
+
'data-table-width': node.attrs.width,
|
|
33
|
+
...(expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) && {
|
|
34
|
+
'data-ssr-placeholder': `table-${node.attrs.localId}`,
|
|
35
|
+
'data-ssr-placeholder-replace': `table-${node.attrs.localId}`
|
|
36
|
+
})
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
// This would be used for table scaling in colgroup CSS
|
|
@@ -95,14 +95,14 @@ var AlignmentTableContainer = function AlignmentTableContainer(_ref2) {
|
|
|
95
95
|
var style = useMemo(function () {
|
|
96
96
|
return getAlignmentStyle(alignment);
|
|
97
97
|
}, [alignment]);
|
|
98
|
-
return (
|
|
99
|
-
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
"data-testid": "table-alignment-container",
|
|
100
|
+
"data-ssr-placeholder": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
101
|
+
"data-ssr-placeholder-replace": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined
|
|
100
102
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, children)
|
|
105
|
-
);
|
|
103
|
+
,
|
|
104
|
+
style: style
|
|
105
|
+
}, children);
|
|
106
106
|
};
|
|
107
107
|
var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_ref3) {
|
|
108
108
|
var isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
@@ -114,6 +114,8 @@ var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_re
|
|
|
114
114
|
if (!isTableAlignmentEnabled) {
|
|
115
115
|
return /*#__PURE__*/React.createElement("div", {
|
|
116
116
|
"data-testid": "table-alignment-container",
|
|
117
|
+
"data-ssr-placeholder": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
118
|
+
"data-ssr-placeholder-replace": expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? "table-".concat(node.attrs.localId) : undefined,
|
|
117
119
|
style: {
|
|
118
120
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
119
121
|
display: 'flex',
|
|
@@ -17,6 +17,7 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
17
17
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
19
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
21
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
21
22
|
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
|
|
22
23
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -146,6 +147,10 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
146
147
|
if (this.view.state.selection.visible) {
|
|
147
148
|
selectionBookmark = this.view.state.selection.getBookmark();
|
|
148
149
|
}
|
|
150
|
+
if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
151
|
+
this.dom.setAttribute('data-ssr-placeholder', "table-nodeview-".concat(this.node.attrs.localId));
|
|
152
|
+
this.dom.setAttribute('data-ssr-placeholder-replace', "table-nodeview-".concat(this.node.attrs.localId));
|
|
153
|
+
}
|
|
149
154
|
|
|
150
155
|
// Remove the ProseMirror table DOM structure to avoid duplication, as it's replaced with the React table node.
|
|
151
156
|
if (this.dom && this.renderedDOM) {
|
|
@@ -33,13 +33,16 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
33
33
|
var tableMinWidth = getResizerMinWidth(node);
|
|
34
34
|
var tableWidthAttribute = node.attrs.width ? "".concat(node.attrs.width, "px") : "100%";
|
|
35
35
|
var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
|
|
36
|
-
var attrs = {
|
|
36
|
+
var attrs = _objectSpread({
|
|
37
37
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
38
38
|
'data-layout': node.attrs.layout,
|
|
39
39
|
'data-autosize': node.attrs.__autoSize,
|
|
40
40
|
'data-table-local-id': node.attrs.localId,
|
|
41
41
|
'data-table-width': node.attrs.width
|
|
42
|
-
}
|
|
42
|
+
}, expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) && {
|
|
43
|
+
'data-ssr-placeholder': "table-".concat(node.attrs.localId),
|
|
44
|
+
'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId)
|
|
45
|
+
});
|
|
43
46
|
|
|
44
47
|
// This would be used for table scaling in colgroup CSS
|
|
45
48
|
// cqw, or px is well supported
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.2",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"singleton": true
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
31
|
+
"@atlaskit/adf-schema": "^50.2.2",
|
|
32
32
|
"@atlaskit/button": "^23.4.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^3.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^3.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "6.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "6.2.0",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^3.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^5.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^0.0.3",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/primitives": "^14.11.0",
|
|
58
58
|
"@atlaskit/react-ufo": "^4.4.0",
|
|
59
59
|
"@atlaskit/theme": "^19.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^11.7.0",
|
|
61
61
|
"@atlaskit/toggle": "^15.1.0",
|
|
62
62
|
"@atlaskit/tokens": "^6.0.0",
|
|
63
63
|
"@atlaskit/tooltip": "^20.4.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.1.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atlaskit/editor-common": "^107.
|
|
73
|
+
"@atlaskit/editor-common": "^107.31.0",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"react-intl-next": "npm:react-intl@^5.18.1"
|