@atlaskit/editor-plugin-table 10.4.3 → 10.4.4

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
+ ## 10.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#128159](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128159)
8
+ [`fa48f40aa6143`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa48f40aa6143) -
9
+ ED-26887 Fix flickering in create issue modal when scrolling slowly and there is table inside it
10
+ - Updated dependencies
11
+
3
12
  ## 10.4.3
4
13
 
5
14
  ### Patch Changes
@@ -133,16 +133,21 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
133
133
  }, {
134
134
  key: "sentinelBottomCallback",
135
135
  value: function sentinelBottomCallback(entry) {
136
- var _entry$rootBounds2;
137
- var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
136
+ var _entry$rootBounds2, _entry$rootBounds3;
137
+ var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0) ||
138
+ // When editorScrollableElement is the root document or inside modal,
139
+ // so the boundingClientRect.top will never be less than the rootBounds.top,
140
+ // so we need to check if the boundingClientRect.top is less than 20% of the rootBounds.height
141
+ // to determine if the bottom sentinel is above the scroll area
142
+ entry.boundingClientRect.top < (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.height) || 0) * 0.2 && (0, _platformFeatureFlags.fg)('platform_editor_scroll_table_flickering_fix');
138
143
  this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
139
144
  this.toggle();
140
145
  }
141
146
  }, {
142
147
  key: "sentinelTopCallback",
143
148
  value: function sentinelTopCallback(entry) {
144
- var _entry$rootBounds3;
145
- var sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
149
+ var _entry$rootBounds4;
150
+ var sentinelIsBelowScrollArea = (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.bottom) || 0) < entry.boundingClientRect.top;
146
151
  this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
147
152
  this.toggle();
148
153
  }
@@ -107,14 +107,19 @@ export class TableStickyScrollbar {
107
107
  }
108
108
  }
109
109
  sentinelBottomCallback(entry) {
110
- var _entry$rootBounds2;
111
- const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
110
+ var _entry$rootBounds2, _entry$rootBounds3;
111
+ const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0) ||
112
+ // When editorScrollableElement is the root document or inside modal,
113
+ // so the boundingClientRect.top will never be less than the rootBounds.top,
114
+ // so we need to check if the boundingClientRect.top is less than 20% of the rootBounds.height
115
+ // to determine if the bottom sentinel is above the scroll area
116
+ entry.boundingClientRect.top < (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.height) || 0) * 0.2 && fg('platform_editor_scroll_table_flickering_fix');
112
117
  this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
113
118
  this.toggle();
114
119
  }
115
120
  sentinelTopCallback(entry) {
116
- var _entry$rootBounds3;
117
- const sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
121
+ var _entry$rootBounds4;
122
+ const sentinelIsBelowScrollArea = (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.bottom) || 0) < entry.boundingClientRect.top;
118
123
  this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
119
124
  this.toggle();
120
125
  }
@@ -126,16 +126,21 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
126
126
  }, {
127
127
  key: "sentinelBottomCallback",
128
128
  value: function sentinelBottomCallback(entry) {
129
- var _entry$rootBounds2;
130
- var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0);
129
+ var _entry$rootBounds2, _entry$rootBounds3;
130
+ var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.top) || 0) ||
131
+ // When editorScrollableElement is the root document or inside modal,
132
+ // so the boundingClientRect.top will never be less than the rootBounds.top,
133
+ // so we need to check if the boundingClientRect.top is less than 20% of the rootBounds.height
134
+ // to determine if the bottom sentinel is above the scroll area
135
+ entry.boundingClientRect.top < (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.height) || 0) * 0.2 && fg('platform_editor_scroll_table_flickering_fix');
131
136
  this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
132
137
  this.toggle();
133
138
  }
134
139
  }, {
135
140
  key: "sentinelTopCallback",
136
141
  value: function sentinelTopCallback(entry) {
137
- var _entry$rootBounds3;
138
- var sentinelIsBelowScrollArea = (((_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.bottom) || 0) < entry.boundingClientRect.top;
142
+ var _entry$rootBounds4;
143
+ var sentinelIsBelowScrollArea = (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.bottom) || 0) < entry.boundingClientRect.top;
139
144
  this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
140
145
  this.toggle();
141
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.4.3",
3
+ "version": "10.4.4",
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": "^21.1.0",
34
34
  "@atlaskit/custom-steps": "^0.11.0",
35
- "@atlaskit/editor-common": "^102.9.0",
35
+ "@atlaskit/editor-common": "^102.10.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",
@@ -193,6 +193,9 @@
193
193
  },
194
194
  "platform_editor_number_column_sticky_header_bug": {
195
195
  "type": "boolean"
196
+ },
197
+ "platform_editor_scroll_table_flickering_fix": {
198
+ "type": "boolean"
196
199
  }
197
200
  }
198
201
  }
@@ -144,7 +144,14 @@ export class TableStickyScrollbar {
144
144
  }
145
145
 
146
146
  private sentinelBottomCallback(entry: IntersectionObserverEntry) {
147
- const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (entry.rootBounds?.top || 0);
147
+ const sentinelIsAboveScrollArea =
148
+ entry.boundingClientRect.top < (entry.rootBounds?.top || 0) ||
149
+ // When editorScrollableElement is the root document or inside modal,
150
+ // so the boundingClientRect.top will never be less than the rootBounds.top,
151
+ // so we need to check if the boundingClientRect.top is less than 20% of the rootBounds.height
152
+ // to determine if the bottom sentinel is above the scroll area
153
+ (entry.boundingClientRect.top < ((entry.rootBounds?.height || 0) * 0.2) &&
154
+ fg('platform_editor_scroll_table_flickering_fix'));
148
155
 
149
156
  this.bottomSentinelState = sentinelIsAboveScrollArea
150
157
  ? 'above'
@@ -159,6 +166,7 @@ export class TableStickyScrollbar {
159
166
  const sentinelIsBelowScrollArea =
160
167
  (entry.rootBounds?.bottom || 0) < entry.boundingClientRect.top;
161
168
 
169
+
162
170
  this.topSentinelState = sentinelIsBelowScrollArea
163
171
  ? 'below'
164
172
  : entry.isIntersecting