@atlaskit/editor-plugin-table 10.9.11 → 10.9.12

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,15 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.9.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#148537](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148537)
8
+ [`3df3e55411ffd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3df3e55411ffd) -
9
+ EDITOR-328 Clean up nested table bugfix feature gate
10
+ `platform_editor_nested_tables_bottom_sentinel`
11
+ - Updated dependencies
12
+
3
13
  ## 10.9.11
4
14
 
5
15
  ### Patch Changes
@@ -273,13 +273,10 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
273
273
  // Multiple bottom sentinels may be found if there are nested tables.
274
274
  // We need to make sure we get the last one which will belong to the parent table.
275
275
  var bottomSentinels = tableContainer && tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM);
276
- // Ignored via go/ees005
277
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
278
- return (0, _platformFeatureFlags.fg)('platform_editor_nested_tables_bottom_sentinel') ?
279
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
280
- bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1) : tableContainer &&
281
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
282
- tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
276
+ return (
277
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
278
+ bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1)
279
+ );
283
280
  };
284
281
  var sentinelsInDom = function sentinelsInDom() {
285
282
  return getSentinelTop() !== null && getSentinelBottom() !== null;
@@ -72,8 +72,7 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
72
72
  value: function createIntersectionObserver() {
73
73
  var _this2 = this,
74
74
  _this$wrapper,
75
- _this$wrapper2,
76
- _this$wrapper3;
75
+ _this$wrapper2;
77
76
  this.editorScrollableElement =
78
77
  // Ignored via go/ees005
79
78
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -107,13 +106,13 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
107
106
 
108
107
  // Multiple bottom sentinels may be found if there are nested tables. We need to make sure we get the last one which will belong to the parent table.
109
108
  var bottomSentinels = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM);
110
- this.sentinels.bottom = (0, _platformFeatureFlags.fg)('platform_editor_nested_tables_bottom_sentinel') ? // eslint-disable-next-line @atlaskit/editor/no-as-casting
111
- bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1) : // eslint-disable-next-line @atlaskit/editor/no-as-casting
112
- (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
109
+
110
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
111
+ this.sentinels.bottom = bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1);
113
112
 
114
113
  // Ignored via go/ees005
115
114
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
116
- this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.item(0);
115
+ this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
117
116
  [this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
118
117
  if (el !== null && _this2.intersectionObserver) {
119
118
  _this2.intersectionObserver.observe(el);
@@ -241,13 +241,10 @@ export default class TableRow extends TableNodeView {
241
241
  // Multiple bottom sentinels may be found if there are nested tables.
242
242
  // We need to make sure we get the last one which will belong to the parent table.
243
243
  const bottomSentinels = tableContainer && tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM);
244
- // Ignored via go/ees005
245
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
246
- return fg('platform_editor_nested_tables_bottom_sentinel') ?
247
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
248
- bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1) : tableContainer &&
249
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
250
- tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
244
+ return (
245
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
246
+ bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1)
247
+ );
251
248
  };
252
249
  const sentinelsInDom = () => getSentinelTop() !== null && getSentinelBottom() !== null;
253
250
  const observeStickySentinels = () => {
@@ -51,7 +51,7 @@ export class TableStickyScrollbar {
51
51
  this.createIntersectionObserver();
52
52
  }
53
53
  createIntersectionObserver() {
54
- var _this$wrapper, _this$wrapper$parentE2, _this$wrapper2, _this$wrapper2$parent, _this$wrapper2$parent2, _this$wrapper3, _this$wrapper3$parent, _this$wrapper3$parent2;
54
+ var _this$wrapper, _this$wrapper$parentE2, _this$wrapper2, _this$wrapper2$parent, _this$wrapper2$parent2;
55
55
  this.editorScrollableElement =
56
56
  // Ignored via go/ees005
57
57
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -85,13 +85,13 @@ export class TableStickyScrollbar {
85
85
 
86
86
  // Multiple bottom sentinels may be found if there are nested tables. We need to make sure we get the last one which will belong to the parent table.
87
87
  const bottomSentinels = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 ? void 0 : (_this$wrapper$parentE2 = _this$wrapper.parentElement) === null || _this$wrapper$parentE2 === void 0 ? void 0 : _this$wrapper$parentE2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM);
88
- this.sentinels.bottom = fg('platform_editor_nested_tables_bottom_sentinel') ? // eslint-disable-next-line @atlaskit/editor/no-as-casting
89
- bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1) : // eslint-disable-next-line @atlaskit/editor/no-as-casting
90
- (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : (_this$wrapper2$parent2 = _this$wrapper2$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper2$parent2 === void 0 ? void 0 : _this$wrapper2$parent2.item(0);
88
+
89
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
90
+ this.sentinels.bottom = bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1);
91
91
 
92
92
  // Ignored via go/ees005
93
93
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
94
- this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 ? void 0 : (_this$wrapper3$parent = _this$wrapper3.parentElement) === null || _this$wrapper3$parent === void 0 ? void 0 : (_this$wrapper3$parent2 = _this$wrapper3$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3$parent2 === void 0 ? void 0 : _this$wrapper3$parent2.item(0);
94
+ this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 ? void 0 : (_this$wrapper2$parent = _this$wrapper2.parentElement) === null || _this$wrapper2$parent === void 0 ? void 0 : (_this$wrapper2$parent2 = _this$wrapper2$parent.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2$parent2 === void 0 ? void 0 : _this$wrapper2$parent2.item(0);
95
95
  [this.sentinels.bottom, this.sentinels.top].forEach(el => {
96
96
  if (el !== null && this.intersectionObserver) {
97
97
  this.intersectionObserver.observe(el);
@@ -266,13 +266,10 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
266
266
  // Multiple bottom sentinels may be found if there are nested tables.
267
267
  // We need to make sure we get the last one which will belong to the parent table.
268
268
  var bottomSentinels = tableContainer && tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM);
269
- // Ignored via go/ees005
270
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
271
- return fg('platform_editor_nested_tables_bottom_sentinel') ?
272
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
273
- bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1) : tableContainer &&
274
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
275
- tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
269
+ return (
270
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
271
+ bottomSentinels && bottomSentinels.item(bottomSentinels.length - 1)
272
+ );
276
273
  };
277
274
  var sentinelsInDom = function sentinelsInDom() {
278
275
  return getSentinelTop() !== null && getSentinelBottom() !== null;
@@ -65,8 +65,7 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
65
65
  value: function createIntersectionObserver() {
66
66
  var _this2 = this,
67
67
  _this$wrapper,
68
- _this$wrapper2,
69
- _this$wrapper3;
68
+ _this$wrapper2;
70
69
  this.editorScrollableElement =
71
70
  // Ignored via go/ees005
72
71
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -100,13 +99,13 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
100
99
 
101
100
  // Multiple bottom sentinels may be found if there are nested tables. We need to make sure we get the last one which will belong to the parent table.
102
101
  var bottomSentinels = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM);
103
- this.sentinels.bottom = fg('platform_editor_nested_tables_bottom_sentinel') ? // eslint-disable-next-line @atlaskit/editor/no-as-casting
104
- bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1) : // eslint-disable-next-line @atlaskit/editor/no-as-casting
105
- (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
102
+
103
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
104
+ this.sentinels.bottom = bottomSentinels === null || bottomSentinels === void 0 ? void 0 : bottomSentinels.item(bottomSentinels.length - 1);
106
105
 
107
106
  // Ignored via go/ees005
108
107
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
109
- this.sentinels.top = (_this$wrapper3 = this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.item(0);
108
+ this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
110
109
  [this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
111
110
  if (el !== null && _this2.intersectionObserver) {
112
111
  _this2.intersectionObserver.observe(el);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.9.11",
3
+ "version": "10.9.12",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/adf-schema": "^47.6.0",
33
33
  "@atlaskit/button": "^23.0.0",
34
34
  "@atlaskit/custom-steps": "^0.11.0",
35
- "@atlaskit/editor-common": "^103.20.0",
35
+ "@atlaskit/editor-common": "^103.21.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/editor-shared-styles": "^3.4.0",
48
48
  "@atlaskit/editor-tables": "^2.9.0",
49
49
  "@atlaskit/icon": "^25.6.0",
50
- "@atlaskit/menu": "^4.0.0",
50
+ "@atlaskit/menu": "^5.0.0",
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
@@ -144,9 +144,6 @@
144
144
  "platform_editor_nested_tables_view_mode_sort": {
145
145
  "type": "boolean"
146
146
  },
147
- "platform_editor_nested_tables_bottom_sentinel": {
148
- "type": "boolean"
149
- },
150
147
  "platform_editor_nested_tables_bodied_extension_fix": {
151
148
  "type": "boolean"
152
149
  },
@@ -314,16 +314,11 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
314
314
  const bottomSentinels =
315
315
  tableContainer &&
316
316
  tableContainer.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM);
317
- // Ignored via go/ees005
318
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
319
- return fg('platform_editor_nested_tables_bottom_sentinel')
320
- ? // eslint-disable-next-line @atlaskit/editor/no-as-casting
321
- bottomSentinels && (bottomSentinels.item(bottomSentinels.length - 1) as HTMLElement)
322
- : tableContainer &&
323
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
324
- (tableContainer
325
- .getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM)
326
- .item(0) as HTMLElement);
317
+
318
+ return (
319
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
320
+ bottomSentinels && (bottomSentinels.item(bottomSentinels.length - 1) as HTMLElement)
321
+ );
327
322
  };
328
323
 
329
324
  const sentinelsInDom = () => getSentinelTop() !== null && getSentinelBottom() !== null;
@@ -113,13 +113,8 @@ export class TableStickyScrollbar {
113
113
  ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM,
114
114
  );
115
115
 
116
- this.sentinels.bottom = fg('platform_editor_nested_tables_bottom_sentinel')
117
- ? // eslint-disable-next-line @atlaskit/editor/no-as-casting
118
- (bottomSentinels?.item(bottomSentinels.length - 1) as HTMLElement)
119
- : // eslint-disable-next-line @atlaskit/editor/no-as-casting
120
- (this.wrapper?.parentElement
121
- ?.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)
122
- ?.item(0) as HTMLElement);
116
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
117
+ this.sentinels.bottom = bottomSentinels?.item(bottomSentinels.length - 1) as HTMLElement;
123
118
 
124
119
  // Ignored via go/ees005
125
120
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -107,7 +107,7 @@ export const ColumnControls = ({
107
107
  const hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
108
108
 
109
109
  const rowControlStickyTop = 45;
110
- const marginTop = hasHeaderRow && stickyTop !== undefined ? (rowControlStickyTop ?? 0) : 0;
110
+ const marginTop = hasHeaderRow && stickyTop !== undefined ? rowControlStickyTop ?? 0 : 0;
111
111
 
112
112
  const handleClick = useCallback(
113
113
  (event: MouseEvent) => {