@atlaskit/editor-plugin-table 28.0.7 → 28.0.8

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,14 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 28.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c967639892512`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c967639892512) -
8
+ Cleanup experiment `platform_editor_table_q4_patch_5` and permanently restrict sticky table
9
+ headers to the first header row.
10
+ - Updated dependencies
11
+
3
12
  ## 28.0.7
4
13
 
5
14
  ### Patch Changes
@@ -110,17 +110,11 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
110
110
  if (pos) {
111
111
  var $pos = view.state.doc.resolve(pos);
112
112
  _this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)($pos) > 1;
113
- // Resolve rowIndex only when the flag is on — otherwise it's unused
114
- if ((0, _expValEquals.expValEquals)('platform_editor_fix_sticky_header_row', 'isEnabled', true) && !(0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
115
- rowIndex = $pos.index();
116
- }
117
113
  }
118
114
  } catch (_unused) {
119
115
  // Intentionally swallowed — getPos can return stale positions during AI streaming
120
116
  }
121
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
122
- rowIndex = (0, _nodes.getTableRowIndex)(view, getPos);
123
- }
117
+ rowIndex = (0, _nodes.getTableRowIndex)(view, getPos);
124
118
  _this.isHeaderRow = (0, _nodes.supportedHeaderRow)(node, rowIndex);
125
119
  if (_this.isHeaderRow) {
126
120
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -167,20 +161,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
167
161
 
168
162
  // see if we're changing into a header row or
169
163
  // changing away from one
170
- var rowIndex = 0;
171
- if ((0, _expValEquals.expValEquals)('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
172
- try {
173
- var pos = this.getPos();
174
- if (pos) {
175
- rowIndex = this.view.state.doc.resolve(pos).index();
176
- }
177
- } catch (_unused2) {
178
- // Intentionally swallowed — getPos can return stale positions during AI streaming
179
- }
180
- }
181
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
182
- rowIndex = (0, _nodes.getTableRowIndex)(this.view, this.getPos);
183
- }
164
+ var rowIndex = (0, _nodes.getTableRowIndex)(this.view, this.getPos);
184
165
  var newNodeIsHeaderRow = (0, _nodes.supportedHeaderRow)(node, rowIndex);
185
166
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
186
167
  return false; // re-create nodeview
@@ -516,7 +497,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
516
497
  return false;
517
498
  }
518
499
  }
519
- } catch (_unused3) {
500
+ } catch (_unused2) {
520
501
  // getPos can return stale positions during AI streaming — fall back to non-sticky
521
502
  return false;
522
503
  }
@@ -109,12 +109,8 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
109
109
  _this.disableNativeSticky = false;
110
110
  }
111
111
  });
112
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
113
- var rowIndex = (0, _nodes.getTableRowIndex)(view, getPos);
114
- _this.isHeaderRow = (0, _nodes.supportedHeaderRow)(node, rowIndex);
115
- } else {
116
- _this.isHeaderRow = (0, _nodes.supportedHeaderRow)(node);
117
- }
112
+ var rowIndex = (0, _nodes.getTableRowIndex)(view, getPos);
113
+ _this.isHeaderRow = (0, _nodes.supportedHeaderRow)(node, rowIndex);
118
114
  if (_this.isHeaderRow && (0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_4', 'isEnabled', true)) {
119
115
  _this.isSingleRowTable = _this.checkIsSingleRowTable();
120
116
  }
@@ -207,19 +203,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
207
203
 
208
204
  // see if we're changing into a header row or
209
205
  // changing away from one
210
- var rowIndex = 0;
211
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
212
- rowIndex = (0, _nodes.getTableRowIndex)(this.view, this.getPos);
213
- } else if ((0, _expValEquals.expValEquals)('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
214
- try {
215
- var pos = this.getPos();
216
- if (pos) {
217
- rowIndex = this.view.state.doc.resolve(pos).index();
218
- }
219
- } catch (_unused2) {
220
- // Intentionally swallowed — getPos can return stale positions during AI streaming
221
- }
222
- }
206
+ var rowIndex = (0, _nodes.getTableRowIndex)(this.view, this.getPos);
223
207
  var newNodeIsHeaderRow = (0, _nodes.supportedHeaderRow)(node, rowIndex);
224
208
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
225
209
  if (!newNodeIsHeaderRow && this.isHeaderRow) {
@@ -756,7 +740,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
756
740
  return false;
757
741
  }
758
742
  }
759
- } catch (_unused3) {
743
+ } catch (_unused2) {
760
744
  // getPos can return stale positions during AI streaming — fall back to non-sticky
761
745
  return false;
762
746
  }
@@ -936,7 +920,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
936
920
  return node.type === _this1.view.state.schema.nodes.table;
937
921
  })) === null || _findParentNodeCloses3 === void 0 ? void 0 : _findParentNodeCloses3.node;
938
922
  return (tableNode === null || tableNode === void 0 ? void 0 : tableNode.childCount) === 1;
939
- } catch (_unused4) {
923
+ } catch (_unused3) {
940
924
  // getPos can return stale positions during AI streaming. Preserve the original sticky
941
925
  // header behaviour when the containing table cannot be determined.
942
926
  return false;
@@ -153,7 +153,7 @@ var getTableRowIndex = exports.getTableRowIndex = function getTableRowIndex(view
153
153
 
154
154
  /**
155
155
  * Check if a given node is a header row with this definition:
156
- * - the row is the first row when platform_editor_table_q4_patch_5 is enabled
156
+ * - the row is the first row
157
157
  * - all children are tableHeader cells
158
158
  * - no table cells have been merged with other table row cells (rowspan > 1)
159
159
  * - no table cells have been merged with other table column cells (colspan > 1),
@@ -167,7 +167,7 @@ var getTableRowIndex = exports.getTableRowIndex = function getTableRowIndex(view
167
167
  */
168
168
  var supportedHeaderRow = exports.supportedHeaderRow = function supportedHeaderRow(node) {
169
169
  var rowIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
170
- if ((0, _expValEquals.expValEquals)('platform_editor_table_q4_patch_5', 'isEnabled', true) && rowIndex !== 0) {
170
+ if (rowIndex !== 0) {
171
171
  return false;
172
172
  }
173
173
  var allHeaders = (0, _utils.mapChildren)(node, function (child) {
@@ -95,17 +95,11 @@ export default class TableRow extends TableNodeView {
95
95
  if (pos) {
96
96
  const $pos = view.state.doc.resolve(pos);
97
97
  this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)($pos) > 1;
98
- // Resolve rowIndex only when the flag is on — otherwise it's unused
99
- if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true) && !expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
100
- rowIndex = $pos.index();
101
- }
102
98
  }
103
99
  } catch {
104
100
  // Intentionally swallowed — getPos can return stale positions during AI streaming
105
101
  }
106
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
107
- rowIndex = getTableRowIndex(view, getPos);
108
- }
102
+ rowIndex = getTableRowIndex(view, getPos);
109
103
  this.isHeaderRow = supportedHeaderRow(node, rowIndex);
110
104
  if (this.isHeaderRow) {
111
105
  this.dom.setAttribute('data-vc-nvs', 'true');
@@ -147,20 +141,7 @@ export default class TableRow extends TableNodeView {
147
141
 
148
142
  // see if we're changing into a header row or
149
143
  // changing away from one
150
- let rowIndex = 0;
151
- if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
152
- try {
153
- const pos = this.getPos();
154
- if (pos) {
155
- rowIndex = this.view.state.doc.resolve(pos).index();
156
- }
157
- } catch {
158
- // Intentionally swallowed — getPos can return stale positions during AI streaming
159
- }
160
- }
161
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
162
- rowIndex = getTableRowIndex(this.view, this.getPos);
163
- }
144
+ const rowIndex = getTableRowIndex(this.view, this.getPos);
164
145
  const newNodeIsHeaderRow = supportedHeaderRow(node, rowIndex);
165
146
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
166
147
  return false; // re-create nodeview
@@ -93,12 +93,8 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
93
93
  this.disableNativeSticky = false;
94
94
  }
95
95
  });
96
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
97
- const rowIndex = getTableRowIndex(view, getPos);
98
- this.isHeaderRow = supportedHeaderRow(node, rowIndex);
99
- } else {
100
- this.isHeaderRow = supportedHeaderRow(node);
101
- }
96
+ const rowIndex = getTableRowIndex(view, getPos);
97
+ this.isHeaderRow = supportedHeaderRow(node, rowIndex);
102
98
  if (this.isHeaderRow && expValEquals('platform_editor_table_q4_patch_4', 'isEnabled', true)) {
103
99
  this.isSingleRowTable = this.checkIsSingleRowTable();
104
100
  }
@@ -188,19 +184,7 @@ export default class TableRowNativeStickyWithFallback extends TableNodeView {
188
184
 
189
185
  // see if we're changing into a header row or
190
186
  // changing away from one
191
- let rowIndex = 0;
192
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
193
- rowIndex = getTableRowIndex(this.view, this.getPos);
194
- } else if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
195
- try {
196
- const pos = this.getPos();
197
- if (pos) {
198
- rowIndex = this.view.state.doc.resolve(pos).index();
199
- }
200
- } catch {
201
- // Intentionally swallowed — getPos can return stale positions during AI streaming
202
- }
203
- }
187
+ const rowIndex = getTableRowIndex(this.view, this.getPos);
204
188
  const newNodeIsHeaderRow = supportedHeaderRow(node, rowIndex);
205
189
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
206
190
  if (!newNodeIsHeaderRow && this.isHeaderRow) {
@@ -121,7 +121,7 @@ export const getTableRowIndex = (view, getPos) => {
121
121
 
122
122
  /**
123
123
  * Check if a given node is a header row with this definition:
124
- * - the row is the first row when platform_editor_table_q4_patch_5 is enabled
124
+ * - the row is the first row
125
125
  * - all children are tableHeader cells
126
126
  * - no table cells have been merged with other table row cells (rowspan > 1)
127
127
  * - no table cells have been merged with other table column cells (colspan > 1),
@@ -134,7 +134,7 @@ export const getTableRowIndex = (view, getPos) => {
134
134
  * @returns boolean if it meets definition
135
135
  */
136
136
  export const supportedHeaderRow = (node, rowIndex = 0) => {
137
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true) && rowIndex !== 0) {
137
+ if (rowIndex !== 0) {
138
138
  return false;
139
139
  }
140
140
  const allHeaders = mapChildren(node, child => child.type.name === 'tableHeader').every(Boolean);
@@ -103,17 +103,11 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
103
103
  if (pos) {
104
104
  var $pos = view.state.doc.resolve(pos);
105
105
  _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)($pos) > 1;
106
- // Resolve rowIndex only when the flag is on — otherwise it's unused
107
- if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true) && !expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
108
- rowIndex = $pos.index();
109
- }
110
106
  }
111
107
  } catch (_unused) {
112
108
  // Intentionally swallowed — getPos can return stale positions during AI streaming
113
109
  }
114
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
115
- rowIndex = getTableRowIndex(view, getPos);
116
- }
110
+ rowIndex = getTableRowIndex(view, getPos);
117
111
  _this.isHeaderRow = supportedHeaderRow(node, rowIndex);
118
112
  if (_this.isHeaderRow) {
119
113
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -160,20 +154,7 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
160
154
 
161
155
  // see if we're changing into a header row or
162
156
  // changing away from one
163
- var rowIndex = 0;
164
- if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
165
- try {
166
- var pos = this.getPos();
167
- if (pos) {
168
- rowIndex = this.view.state.doc.resolve(pos).index();
169
- }
170
- } catch (_unused2) {
171
- // Intentionally swallowed — getPos can return stale positions during AI streaming
172
- }
173
- }
174
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
175
- rowIndex = getTableRowIndex(this.view, this.getPos);
176
- }
157
+ var rowIndex = getTableRowIndex(this.view, this.getPos);
177
158
  var newNodeIsHeaderRow = supportedHeaderRow(node, rowIndex);
178
159
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
179
160
  return false; // re-create nodeview
@@ -509,7 +490,7 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
509
490
  return false;
510
491
  }
511
492
  }
512
- } catch (_unused3) {
493
+ } catch (_unused2) {
513
494
  // getPos can return stale positions during AI streaming — fall back to non-sticky
514
495
  return false;
515
496
  }
@@ -102,12 +102,8 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
102
102
  _this.disableNativeSticky = false;
103
103
  }
104
104
  });
105
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
106
- var rowIndex = getTableRowIndex(view, getPos);
107
- _this.isHeaderRow = supportedHeaderRow(node, rowIndex);
108
- } else {
109
- _this.isHeaderRow = supportedHeaderRow(node);
110
- }
105
+ var rowIndex = getTableRowIndex(view, getPos);
106
+ _this.isHeaderRow = supportedHeaderRow(node, rowIndex);
111
107
  if (_this.isHeaderRow && expValEquals('platform_editor_table_q4_patch_4', 'isEnabled', true)) {
112
108
  _this.isSingleRowTable = _this.checkIsSingleRowTable();
113
109
  }
@@ -200,19 +196,7 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
200
196
 
201
197
  // see if we're changing into a header row or
202
198
  // changing away from one
203
- var rowIndex = 0;
204
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true)) {
205
- rowIndex = getTableRowIndex(this.view, this.getPos);
206
- } else if (expValEquals('platform_editor_fix_sticky_header_row', 'isEnabled', true)) {
207
- try {
208
- var pos = this.getPos();
209
- if (pos) {
210
- rowIndex = this.view.state.doc.resolve(pos).index();
211
- }
212
- } catch (_unused2) {
213
- // Intentionally swallowed — getPos can return stale positions during AI streaming
214
- }
215
- }
199
+ var rowIndex = getTableRowIndex(this.view, this.getPos);
216
200
  var newNodeIsHeaderRow = supportedHeaderRow(node, rowIndex);
217
201
  if (this.isHeaderRow !== newNodeIsHeaderRow) {
218
202
  if (!newNodeIsHeaderRow && this.isHeaderRow) {
@@ -749,7 +733,7 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
749
733
  return false;
750
734
  }
751
735
  }
752
- } catch (_unused3) {
736
+ } catch (_unused2) {
753
737
  // getPos can return stale positions during AI streaming — fall back to non-sticky
754
738
  return false;
755
739
  }
@@ -929,7 +913,7 @@ var TableRowNativeStickyWithFallback = /*#__PURE__*/function (_TableNodeView) {
929
913
  return node.type === _this1.view.state.schema.nodes.table;
930
914
  })) === null || _findParentNodeCloses3 === void 0 ? void 0 : _findParentNodeCloses3.node;
931
915
  return (tableNode === null || tableNode === void 0 ? void 0 : tableNode.childCount) === 1;
932
- } catch (_unused4) {
916
+ } catch (_unused3) {
933
917
  // getPos can return stale positions during AI streaming. Preserve the original sticky
934
918
  // header behaviour when the containing table cannot be determined.
935
919
  return false;
@@ -146,7 +146,7 @@ export var getTableRowIndex = function getTableRowIndex(view, getPos) {
146
146
 
147
147
  /**
148
148
  * Check if a given node is a header row with this definition:
149
- * - the row is the first row when platform_editor_table_q4_patch_5 is enabled
149
+ * - the row is the first row
150
150
  * - all children are tableHeader cells
151
151
  * - no table cells have been merged with other table row cells (rowspan > 1)
152
152
  * - no table cells have been merged with other table column cells (colspan > 1),
@@ -160,7 +160,7 @@ export var getTableRowIndex = function getTableRowIndex(view, getPos) {
160
160
  */
161
161
  export var supportedHeaderRow = function supportedHeaderRow(node) {
162
162
  var rowIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
163
- if (expValEquals('platform_editor_table_q4_patch_5', 'isEnabled', true) && rowIndex !== 0) {
163
+ if (rowIndex !== 0) {
164
164
  return false;
165
165
  }
166
166
  var allHeaders = mapChildren(node, function (child) {
@@ -21,7 +21,7 @@ export declare const isTableNestedUnderBodiedSyncBlock: (state: EditorState, tab
21
21
  export declare const getTableRowIndex: (view: EditorView, getPos: () => number | undefined) => number;
22
22
  /**
23
23
  * Check if a given node is a header row with this definition:
24
- * - the row is the first row when platform_editor_table_q4_patch_5 is enabled
24
+ * - the row is the first row
25
25
  * - all children are tableHeader cells
26
26
  * - no table cells have been merged with other table row cells (rowspan > 1)
27
27
  * - no table cells have been merged with other table column cells (colspan > 1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "28.0.7",
3
+ "version": "28.0.8",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-batch-attribute-updates": "^16.0.0",
30
30
  "@atlaskit/editor-plugin-content-insertion": "^16.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^18.0.0",
32
- "@atlaskit/editor-plugin-extension": "19.0.5",
32
+ "@atlaskit/editor-plugin-extension": "19.0.6",
33
33
  "@atlaskit/editor-plugin-guideline": "^16.0.0",
34
34
  "@atlaskit/editor-plugin-interaction": "^27.0.0",
35
35
  "@atlaskit/editor-plugin-limited-mode": "^13.0.0",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.1.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.1.0",
55
55
  "@atlaskit/primitives": "^22.4.0",
56
- "@atlaskit/tmp-editor-statsig": "^165.0.0",
56
+ "@atlaskit/tmp-editor-statsig": "^166.0.0",
57
57
  "@atlaskit/toggle": "^17.2.0",
58
58
  "@atlaskit/tokens": "^16.8.0",
59
59
  "@atlaskit/tooltip": "^24.2.0",