@atlaskit/react-ufo 4.13.0 → 4.13.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,12 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8dedd89369b84`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8dedd89369b84) -
8
+ Exclude 3p from attribute change behind feature gate
9
+
3
10
  ## 4.13.0
4
11
 
5
12
  ### Minor Changes
@@ -25,6 +25,7 @@ var getConsideredEntryTypes = function getConsideredEntryTypes(include3p) {
25
25
  // including the tags into the ConsideredEntryTypes so that it won't be ignored for TTVC calculation
26
26
  if (!(0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttvc') || include3p) {
27
27
  entryTypes.push('mutation:third-party-element');
28
+ entryTypes.push('mutation:third-party-attribute');
28
29
  }
29
30
  if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_media_for_ttvc_v3')) {
30
31
  entryTypes.push('mutation:media');
@@ -13,13 +13,12 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
15
  var _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
16
- var _isDndStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation"));
17
16
  var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
18
17
  var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
19
18
  var _intersectionObserver = require("./intersection-observer");
20
19
  var _mutationObserver = _interopRequireDefault(require("./mutation-observer"));
21
20
  var _performanceObserver = _interopRequireDefault(require("./performance-observer"));
22
- var _checkWithinComponent2 = _interopRequireWildcard(require("./utils/check-within-component"));
21
+ var _checkWithinComponent3 = _interopRequireWildcard(require("./utils/check-within-component"));
23
22
  var _getMutatedElements = require("./utils/get-mutated-elements");
24
23
  var _isElementVisible = require("./utils/is-element-visible");
25
24
  var _isInVcIgnoreIfNoLayoutShiftMarker = _interopRequireDefault(require("./utils/is-in-vc-ignore-if-no-layout-shift-marker"));
@@ -215,7 +214,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
215
214
  (_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(element, 'mutation:media');
216
215
  return _context.abrupt("return", 0);
217
216
  case 38:
218
- _ref6 = element instanceof HTMLElement ? (0, _checkWithinComponent2.default)(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
217
+ _ref6 = element instanceof HTMLElement ? (0, _checkWithinComponent3.default)(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
219
218
  isWithin: false
220
219
  }, isWithinThirdPartySegment = _ref6.isWithin;
221
220
  if (!isWithinThirdPartySegment) {
@@ -360,7 +359,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
360
359
  (_this$intersectionObs13 = _this.intersectionObserver) === null || _this$intersectionObs13 === void 0 || _this$intersectionObs13.watchAndTag(addedNode, 'mutation:media');
361
360
  return _context2.abrupt("return", 0);
362
361
  case 63:
363
- _checkWithinComponent = (0, _checkWithinComponent2.default)(addedNode, 'UFOThirdPartySegment', _this.mapIs3pResult), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
362
+ _checkWithinComponent = (0, _checkWithinComponent3.default)(addedNode, 'UFOThirdPartySegment', _this.mapIs3pResult), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
364
363
  if (!isWithinThirdPartySegment) {
365
364
  _context2.next = 67;
366
365
  break;
@@ -446,20 +445,19 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
446
445
  }
447
446
  };
448
447
  }
449
- if ((0, _isDndStyleMutation.default)({
450
- target: target,
451
- attributeName: attributeName,
452
- oldValue: oldValue,
453
- newValue: newValue
454
- })) {
455
- return {
456
- type: 'mutation:attribute:non-visual-style',
457
- mutationData: {
458
- attributeName: attributeName,
459
- oldValue: oldValue,
460
- newValue: newValue
461
- }
462
- };
448
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_attribute_changes')) {
449
+ var _checkWithinComponent2 = (0, _checkWithinComponent3.default)(target, 'UFOThirdPartySegment', _this.mapIs3pResult),
450
+ isWithinThirdPartySegment = _checkWithinComponent2.isWithin;
451
+ if (isWithinThirdPartySegment) {
452
+ return {
453
+ type: 'mutation:third-party-attribute',
454
+ mutationData: {
455
+ attributeName: attributeName,
456
+ oldValue: oldValue,
457
+ newValue: newValue
458
+ }
459
+ };
460
+ }
463
461
  }
464
462
  if ((0, _isNonVisualStyleMutation.default)({
465
463
  target: target,
@@ -597,7 +595,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
597
595
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
598
596
  this.isStarted = false;
599
597
  // Clean up caches when stopping
600
- (0, _checkWithinComponent2.cleanupCaches)(this.mapIs3pResult);
598
+ (0, _checkWithinComponent3.cleanupCaches)(this.mapIs3pResult);
601
599
  }
602
600
  }]);
603
601
  }();
@@ -11,6 +11,7 @@ const getConsideredEntryTypes = include3p => {
11
11
  // including the tags into the ConsideredEntryTypes so that it won't be ignored for TTVC calculation
12
12
  if (!fg('platform_ufo_exclude_3p_elements_from_ttvc') || include3p) {
13
13
  entryTypes.push('mutation:third-party-element');
14
+ entryTypes.push('mutation:third-party-attribute');
14
15
  }
15
16
  if (fg('platform_ufo_enable_media_for_ttvc_v3')) {
16
17
  entryTypes.push('mutation:media');
@@ -1,7 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
4
- import isDnDStyleMutation from '../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
5
4
  import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
6
5
  import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
7
6
  import { createIntersectionObserver } from './intersection-observer';
@@ -289,20 +288,20 @@ export default class ViewportObserver {
289
288
  }
290
289
  };
291
290
  }
292
- if (isDnDStyleMutation({
293
- target,
294
- attributeName,
295
- oldValue,
296
- newValue
297
- })) {
298
- return {
299
- type: 'mutation:attribute:non-visual-style',
300
- mutationData: {
301
- attributeName,
302
- oldValue,
303
- newValue
304
- }
305
- };
291
+ if (fg('platform_ufo_exclude_3p_attribute_changes')) {
292
+ const {
293
+ isWithin: isWithinThirdPartySegment
294
+ } = checkWithinComponent(target, 'UFOThirdPartySegment', this.mapIs3pResult);
295
+ if (isWithinThirdPartySegment) {
296
+ return {
297
+ type: 'mutation:third-party-attribute',
298
+ mutationData: {
299
+ attributeName,
300
+ oldValue,
301
+ newValue
302
+ }
303
+ };
304
+ }
306
305
  }
307
306
  if (isNonVisualStyleMutation({
308
307
  target,
@@ -18,6 +18,7 @@ var getConsideredEntryTypes = function getConsideredEntryTypes(include3p) {
18
18
  // including the tags into the ConsideredEntryTypes so that it won't be ignored for TTVC calculation
19
19
  if (!fg('platform_ufo_exclude_3p_elements_from_ttvc') || include3p) {
20
20
  entryTypes.push('mutation:third-party-element');
21
+ entryTypes.push('mutation:third-party-attribute');
21
22
  }
22
23
  if (fg('platform_ufo_enable_media_for_ttvc_v3')) {
23
24
  entryTypes.push('mutation:media');
@@ -8,7 +8,6 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
8
8
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
11
- import isDnDStyleMutation from '../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
12
11
  import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
13
12
  import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
14
13
  import { createIntersectionObserver } from './intersection-observer';
@@ -437,20 +436,19 @@ var ViewportObserver = /*#__PURE__*/function () {
437
436
  }
438
437
  };
439
438
  }
440
- if (isDnDStyleMutation({
441
- target: target,
442
- attributeName: attributeName,
443
- oldValue: oldValue,
444
- newValue: newValue
445
- })) {
446
- return {
447
- type: 'mutation:attribute:non-visual-style',
448
- mutationData: {
449
- attributeName: attributeName,
450
- oldValue: oldValue,
451
- newValue: newValue
452
- }
453
- };
439
+ if (fg('platform_ufo_exclude_3p_attribute_changes')) {
440
+ var _checkWithinComponent2 = checkWithinComponent(target, 'UFOThirdPartySegment', _this.mapIs3pResult),
441
+ isWithinThirdPartySegment = _checkWithinComponent2.isWithin;
442
+ if (isWithinThirdPartySegment) {
443
+ return {
444
+ type: 'mutation:third-party-attribute',
445
+ mutationData: {
446
+ attributeName: attributeName,
447
+ oldValue: oldValue,
448
+ newValue: newValue
449
+ }
450
+ };
451
+ }
454
452
  }
455
453
  if (isNonVisualStyleMutation({
456
454
  target: target,
@@ -1,6 +1,6 @@
1
1
  import type { AbortReasonType, InteractionType } from '../../common/common/types';
2
2
  import type { ObservedWindowEvent } from './window-event-observer';
3
- export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'layout-shift:same-rect' | 'window:event' | 'ssr-hydration' | 'unknown';
3
+ export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:third-party-attribute' | 'mutation:ssr-placeholder' | 'layout-shift' | 'layout-shift:same-rect' | 'window:event' | 'ssr-hydration' | 'unknown';
4
4
  export type ViewportEntryData = {
5
5
  readonly type: VCObserverEntryType;
6
6
  readonly elementName: string;
@@ -1,6 +1,6 @@
1
1
  import type { AbortReasonType, InteractionType } from '../../common/common/types';
2
2
  import type { ObservedWindowEvent } from './window-event-observer';
3
- export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'layout-shift:same-rect' | 'window:event' | 'ssr-hydration' | 'unknown';
3
+ export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:third-party-attribute' | 'mutation:ssr-placeholder' | 'layout-shift' | 'layout-shift:same-rect' | 'window:event' | 'ssr-hydration' | 'unknown';
4
4
  export type ViewportEntryData = {
5
5
  readonly type: VCObserverEntryType;
6
6
  readonly elementName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -169,6 +169,9 @@
169
169
  },
170
170
  "react_ufo_add_webdriver_info": {
171
171
  "type": "boolean"
172
+ },
173
+ "platform_ufo_exclude_3p_attribute_changes": {
174
+ "type": "boolean"
172
175
  }
173
176
  }
174
177
  }