@atlaskit/react-ufo 3.4.8 → 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,13 @@
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
+
3
11
  ## 3.4.8
4
12
 
5
13
  ### Patch Changes
@@ -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",
@@ -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;
@@ -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.8",
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",
@@ -183,6 +183,9 @@
183
183
  },
184
184
  "ufo_payload_use_idle_callback": {
185
185
  "type": "boolean"
186
+ },
187
+ "platform_ufo_ssr_placeholder_round_rect_size_check": {
188
+ "type": "boolean"
186
189
  }
187
190
  }
188
191
  }