@atlaskit/react-ufo 3.4.7 → 3.4.9

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,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.4.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#134300](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134300)
8
+ [`5fb9bf529d095`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5fb9bf529d095) -
9
+ SSR placeholder rectangle size comparison to ignore decimal places
10
+
11
+ ## 3.4.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [#133350](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/133350)
16
+ [`9873ae0c37080`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9873ae0c37080) -
17
+ clean up LCP featrue flags
18
+
3
19
  ## 3.4.7
4
20
 
5
21
  ### Patch Changes
@@ -209,20 +209,15 @@ var getPaintMetrics = /*#__PURE__*/function () {
209
209
  metrics['metric:fcp'] = Math.round(entry.startTime);
210
210
  }
211
211
  });
212
- if (!(0, _platformFeatureFlags.fg)('ufo_lcp')) {
213
- _context.next = 9;
214
- break;
215
- }
216
- _context.next = 7;
212
+ _context.next = 6;
217
213
  return getLCP(end);
218
- case 7:
214
+ case 6:
219
215
  lcp = _context.sent;
220
216
  if (lcp) {
221
217
  metrics['metric:lcp'] = Math.round(lcp);
222
218
  }
223
- case 9:
224
219
  return _context.abrupt("return", metrics);
225
- case 10:
220
+ case 9:
226
221
  case "end":
227
222
  return _context.stop();
228
223
  }
@@ -8,7 +8,7 @@ exports.SSRPlaceholderHandlers = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var EQUALITY_THRESHOLD = 0.1;
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
12
  var ANCESTOR_LOOKUP_LIMIT = 10;
13
13
  var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/function () {
14
14
  function SSRPlaceholderHandlers() {
@@ -18,6 +18,7 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
18
18
  (0, _defineProperty2.default)(this, "callbacks", new Map());
19
19
  (0, _defineProperty2.default)(this, "getSizeCallbacks", new Map());
20
20
  (0, _defineProperty2.default)(this, "reactValidateCallbacks", new Map());
21
+ (0, _defineProperty2.default)(this, "EQUALITY_THRESHOLD", (0, _platformFeatureFlags.fg)('platform_ufo_ssr_placeholder_round_rect_size_check') ? 1 : 0.1);
21
22
  (0, _defineProperty2.default)(this, "intersectionObserverCallback", function (_ref) {
22
23
  var _this$intersectionObs;
23
24
  var target = _ref.target,
@@ -197,7 +198,7 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
197
198
  }, {
198
199
  key: "hasSameSizePosition",
199
200
  value: function hasSameSizePosition(rect, boundingClientRect) {
200
- return rect && Math.abs(rect.x - boundingClientRect.x) < EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < EQUALITY_THRESHOLD || false;
201
+ return rect && Math.abs(rect.x - boundingClientRect.x) < this.EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < this.EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < this.EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < this.EQUALITY_THRESHOLD || false;
201
202
  }
202
203
  }, {
203
204
  key: "isDummyRect",
@@ -173,11 +173,9 @@ const getPaintMetrics = async (type, end) => {
173
173
  metrics['metric:fcp'] = Math.round(entry.startTime);
174
174
  }
175
175
  });
176
- if (fg('ufo_lcp')) {
177
- const lcp = await getLCP(end);
178
- if (lcp) {
179
- metrics['metric:lcp'] = Math.round(lcp);
180
- }
176
+ const lcp = await getLCP(end);
177
+ if (lcp) {
178
+ metrics['metric:lcp'] = Math.round(lcp);
181
179
  }
182
180
  return metrics;
183
181
  };
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- const EQUALITY_THRESHOLD = 0.1;
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  const ANCESTOR_LOOKUP_LIMIT = 10;
4
4
  export class SSRPlaceholderHandlers {
5
5
  constructor() {
@@ -7,6 +7,7 @@ export class SSRPlaceholderHandlers {
7
7
  _defineProperty(this, "callbacks", new Map());
8
8
  _defineProperty(this, "getSizeCallbacks", new Map());
9
9
  _defineProperty(this, "reactValidateCallbacks", new Map());
10
+ _defineProperty(this, "EQUALITY_THRESHOLD", fg('platform_ufo_ssr_placeholder_round_rect_size_check') ? 1 : 0.1);
10
11
  _defineProperty(this, "intersectionObserverCallback", ({
11
12
  target,
12
13
  boundingClientRect
@@ -162,7 +163,7 @@ export class SSRPlaceholderHandlers {
162
163
  });
163
164
  }
164
165
  hasSameSizePosition(rect, boundingClientRect) {
165
- return rect && Math.abs(rect.x - boundingClientRect.x) < EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < EQUALITY_THRESHOLD || false;
166
+ return rect && Math.abs(rect.x - boundingClientRect.x) < this.EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < this.EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < this.EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < this.EQUALITY_THRESHOLD || false;
166
167
  }
167
168
  isDummyRect(rect) {
168
169
  return rect && rect.width < 0 && rect.height < 0 || false;
@@ -198,20 +198,15 @@ var getPaintMetrics = /*#__PURE__*/function () {
198
198
  metrics['metric:fcp'] = Math.round(entry.startTime);
199
199
  }
200
200
  });
201
- if (!fg('ufo_lcp')) {
202
- _context.next = 9;
203
- break;
204
- }
205
- _context.next = 7;
201
+ _context.next = 6;
206
202
  return getLCP(end);
207
- case 7:
203
+ case 6:
208
204
  lcp = _context.sent;
209
205
  if (lcp) {
210
206
  metrics['metric:lcp'] = Math.round(lcp);
211
207
  }
212
- case 9:
213
208
  return _context.abrupt("return", metrics);
214
- case 10:
209
+ case 9:
215
210
  case "end":
216
211
  return _context.stop();
217
212
  }
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var EQUALITY_THRESHOLD = 0.1;
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
5
  var ANCESTOR_LOOKUP_LIMIT = 10;
6
6
  export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
7
7
  function SSRPlaceholderHandlers() {
@@ -11,6 +11,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
11
11
  _defineProperty(this, "callbacks", new Map());
12
12
  _defineProperty(this, "getSizeCallbacks", new Map());
13
13
  _defineProperty(this, "reactValidateCallbacks", new Map());
14
+ _defineProperty(this, "EQUALITY_THRESHOLD", fg('platform_ufo_ssr_placeholder_round_rect_size_check') ? 1 : 0.1);
14
15
  _defineProperty(this, "intersectionObserverCallback", function (_ref) {
15
16
  var _this$intersectionObs;
16
17
  var target = _ref.target,
@@ -190,7 +191,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
190
191
  }, {
191
192
  key: "hasSameSizePosition",
192
193
  value: function hasSameSizePosition(rect, boundingClientRect) {
193
- return rect && Math.abs(rect.x - boundingClientRect.x) < EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < EQUALITY_THRESHOLD || false;
194
+ return rect && Math.abs(rect.x - boundingClientRect.x) < this.EQUALITY_THRESHOLD && Math.abs(rect.y - boundingClientRect.y) < this.EQUALITY_THRESHOLD && Math.abs(rect.width - boundingClientRect.width) < this.EQUALITY_THRESHOLD && Math.abs(rect.height - boundingClientRect.height) < this.EQUALITY_THRESHOLD || false;
194
195
  }
195
196
  }, {
196
197
  key: "isDummyRect",
@@ -10,6 +10,7 @@ export declare class SSRPlaceholderHandlers {
10
10
  private getSizeCallbacks;
11
11
  private reactValidateCallbacks;
12
12
  private intersectionObserver;
13
+ private EQUALITY_THRESHOLD;
13
14
  constructor();
14
15
  clear(): void;
15
16
  isPlaceholder(element: HTMLElement): boolean;
@@ -10,6 +10,7 @@ export declare class SSRPlaceholderHandlers {
10
10
  private getSizeCallbacks;
11
11
  private reactValidateCallbacks;
12
12
  private intersectionObserver;
13
+ private EQUALITY_THRESHOLD;
13
14
  constructor();
14
15
  clear(): void;
15
16
  isPlaceholder(element: HTMLElement): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.4.7",
3
+ "version": "3.4.9",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -181,10 +181,10 @@
181
181
  "platform_ufo_segment_list_mode": {
182
182
  "type": "boolean"
183
183
  },
184
- "ufo_lcp": {
184
+ "ufo_payload_use_idle_callback": {
185
185
  "type": "boolean"
186
186
  },
187
- "ufo_payload_use_idle_callback": {
187
+ "platform_ufo_ssr_placeholder_round_rect_size_check": {
188
188
  "type": "boolean"
189
189
  }
190
190
  }