@atlaskit/react-ufo 2.0.0 → 2.0.1

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
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#156904](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156904)
8
+ [`285da5f8a4b0b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/285da5f8a4b0b) -
9
+ use weakref for VC observer debug elements
10
+
3
11
  ## 2.0.0
4
12
 
5
13
  ### Major Changes
@@ -214,7 +214,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
214
214
  _this.componentsLog[time] = [];
215
215
  }
216
216
  _this.componentsLog[time].push({
217
- __debug__element: _this.devToolsEnabled ? element : null,
217
+ __debug__element: _this.devToolsEnabled ? new WeakRef(element) : null,
218
218
  intersectionRect: intersectionRect,
219
219
  targetName: targetName,
220
220
  ignoreReason: ignoreReason
@@ -464,7 +464,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
464
464
  if (ssr !== UNUSED_SECTOR) {
465
465
  var _window$document;
466
466
  var element = {
467
- __debug__element: (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body,
467
+ __debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
468
468
  intersectionRect: {
469
469
  top: 0,
470
470
  left: 0,
@@ -228,7 +228,7 @@ export class VCObserver {
228
228
  this.componentsLog[time] = [];
229
229
  }
230
230
  this.componentsLog[time].push({
231
- __debug__element: this.devToolsEnabled ? element : null,
231
+ __debug__element: this.devToolsEnabled ? new WeakRef(element) : null,
232
232
  intersectionRect,
233
233
  targetName,
234
234
  ignoreReason
@@ -363,7 +363,7 @@ export class VCObserver {
363
363
  if (ssr !== UNUSED_SECTOR) {
364
364
  var _window$document;
365
365
  const element = {
366
- __debug__element: (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body,
366
+ __debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
367
367
  intersectionRect: {
368
368
  top: 0,
369
369
  left: 0,
@@ -207,7 +207,7 @@ export var VCObserver = /*#__PURE__*/function () {
207
207
  _this.componentsLog[time] = [];
208
208
  }
209
209
  _this.componentsLog[time].push({
210
- __debug__element: _this.devToolsEnabled ? element : null,
210
+ __debug__element: _this.devToolsEnabled ? new WeakRef(element) : null,
211
211
  intersectionRect: intersectionRect,
212
212
  targetName: targetName,
213
213
  ignoreReason: ignoreReason
@@ -457,7 +457,7 @@ export var VCObserver = /*#__PURE__*/function () {
457
457
  if (ssr !== UNUSED_SECTOR) {
458
458
  var _window$document;
459
459
  var element = {
460
- __debug__element: (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body,
460
+ __debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
461
461
  intersectionRect: {
462
462
  top: 0,
463
463
  left: 0,
@@ -38,7 +38,7 @@ export type VCEntryType = {
38
38
  export type VCIgnoreReason = 'image' | 'ssr-hydration' | '';
39
39
  export type ComponentsLogEntry = {
40
40
  targetName: string;
41
- __debug__element: Element | null;
41
+ __debug__element: WeakRef<Element> | null;
42
42
  intersectionRect: DOMRectReadOnly;
43
43
  ignoreReason?: VCIgnoreReason;
44
44
  };
@@ -38,7 +38,7 @@ export type VCEntryType = {
38
38
  export type VCIgnoreReason = 'image' | 'ssr-hydration' | '';
39
39
  export type ComponentsLogEntry = {
40
40
  targetName: string;
41
- __debug__element: Element | null;
41
+ __debug__element: WeakRef<Element> | null;
42
42
  intersectionRect: DOMRectReadOnly;
43
43
  ignoreReason?: VCIgnoreReason;
44
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",