@atlaskit/react-ufo 4.1.9 → 4.1.10

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
+ ## 4.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#193091](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193091)
8
+ [`7e879ace28cec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e879ace28cec) -
9
+ AFO-4081 cleanup ttvc v3 ff
10
+
3
11
  ## 4.1.9
4
12
 
5
13
  ### Patch Changes
@@ -10,7 +10,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
13
  var _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
15
14
  var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
16
15
  var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
@@ -55,21 +54,18 @@ var createElementMutationsWatcher = function createElementMutationsWatcher(remov
55
54
  return function (_ref) {
56
55
  var target = _ref.target,
57
56
  rect = _ref.rect;
58
- var isNoLsMarkerEnabled = (0, _platformFeatureFlags.fg)('platform_vc_ignore_no_ls_mutation_marker');
59
57
  var isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(target);
60
- if (!isInIgnoreLsMarker && isNoLsMarkerEnabled) {
58
+ if (!isInIgnoreLsMarker) {
61
59
  return 'mutation:element';
62
60
  }
63
61
  var isRLLPlaceholder = _rllPlaceholders.RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
64
- if (isRLLPlaceholder && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
62
+ if (isRLLPlaceholder && isInIgnoreLsMarker) {
65
63
  return 'mutation:rll-placeholder';
66
64
  }
67
65
  var wasDeleted = removedNodeRects.some(function (nr) {
68
66
  return sameRectDimensions(nr, rect);
69
67
  });
70
- // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
71
- // no layout shift mutation is excluded as per existing fy25.03 logic
72
- if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
68
+ if (wasDeleted && isInIgnoreLsMarker) {
73
69
  return 'mutation:element-replacement';
74
70
  }
75
71
  return 'mutation:element';
@@ -125,7 +121,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
125
121
  _context2.prev = 4;
126
122
  _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
127
123
  var _this$intersectionObs8;
128
- var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, isNoLsMarkerEnabled, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
124
+ var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
129
125
  return _regenerator.default.wrap(function _loop$(_context) {
130
126
  while (1) switch (_context.prev = _context.next) {
131
127
  case 0:
@@ -137,7 +133,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
137
133
  }
138
134
  return _context.abrupt("return", 0);
139
135
  case 4:
140
- if (!(_this.getSSRState && (0, _platformFeatureFlags.fg)('platform_ufo_vc_v3_ssr_placeholder'))) {
136
+ if (!_this.getSSRState) {
141
137
  _context.next = 19;
142
138
  break;
143
139
  }
@@ -172,7 +168,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
172
168
  case 18:
173
169
  ssrState.state = SSRStateEnum.normal;
174
170
  case 19:
175
- if (!(_this.getSSRPlaceholderHandler && (0, _platformFeatureFlags.fg)('platform_ufo_vc_v3_ssr_placeholder'))) {
171
+ if (!_this.getSSRPlaceholderHandler) {
176
172
  _context.next = 36;
177
173
  break;
178
174
  }
@@ -219,32 +215,30 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
219
215
  return n.isEqualNode(addedNode);
220
216
  });
221
217
  isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(addedNode);
222
- isNoLsMarkerEnabled = (0, _platformFeatureFlags.fg)('platform_vc_ignore_no_ls_mutation_marker'); // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
223
- // no layout shift mutation is excluded as per existing fy25.03 logic
224
- if (!(sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker))) {
225
- _context.next = 42;
218
+ if (!(sameDeletedNode && isInIgnoreLsMarker)) {
219
+ _context.next = 41;
226
220
  break;
227
221
  }
228
222
  (_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
229
223
  return _context.abrupt("return", 0);
230
- case 42:
224
+ case 41:
231
225
  if (!(0, _vcUtils.isContainedWithinMediaWrapper)(addedNode)) {
232
- _context.next = 45;
226
+ _context.next = 44;
233
227
  break;
234
228
  }
235
229
  (_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
236
230
  return _context.abrupt("return", 0);
237
- case 45:
231
+ case 44:
238
232
  _checkWithinComponent = (0, _checkWithinComponentAndExtractChildProps.default)(addedNode, 'UFOThirdPartySegment'), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
239
233
  if (!isWithinThirdPartySegment) {
240
- _context.next = 49;
234
+ _context.next = 48;
241
235
  break;
242
236
  }
243
237
  (_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
244
238
  return _context.abrupt("return", 0);
245
- case 49:
239
+ case 48:
246
240
  (_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
247
- case 50:
241
+ case 49:
248
242
  case "end":
249
243
  return _context.stop();
250
244
  }
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
4
3
  import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
5
4
  import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
@@ -41,19 +40,16 @@ const createElementMutationsWatcher = removedNodeRects => ({
41
40
  target,
42
41
  rect
43
42
  }) => {
44
- const isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker');
45
43
  const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(target);
46
- if (!isInIgnoreLsMarker && isNoLsMarkerEnabled) {
44
+ if (!isInIgnoreLsMarker) {
47
45
  return 'mutation:element';
48
46
  }
49
47
  const isRLLPlaceholder = RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
50
- if (isRLLPlaceholder && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
48
+ if (isRLLPlaceholder && isInIgnoreLsMarker) {
51
49
  return 'mutation:rll-placeholder';
52
50
  }
53
51
  const wasDeleted = removedNodeRects.some(nr => sameRectDimensions(nr, rect));
54
- // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
55
- // no layout shift mutation is excluded as per existing fy25.03 logic
56
- if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
52
+ if (wasDeleted && isInIgnoreLsMarker) {
57
53
  return 'mutation:element-replacement';
58
54
  }
59
55
  return 'mutation:element';
@@ -111,7 +107,7 @@ export default class ViewportObserver {
111
107
  }
112
108
 
113
109
  // SSR hydration logic
114
- if (this.getSSRState && fg('platform_ufo_vc_v3_ssr_placeholder')) {
110
+ if (this.getSSRState) {
115
111
  const ssrState = this.getSSRState();
116
112
  const SSRStateEnum = {
117
113
  normal: 1,
@@ -140,7 +136,7 @@ export default class ViewportObserver {
140
136
  }
141
137
 
142
138
  // SSR placeholder logic - check and handle with await
143
- if (this.getSSRPlaceholderHandler && fg('platform_ufo_vc_v3_ssr_placeholder')) {
139
+ if (this.getSSRPlaceholderHandler) {
144
140
  const ssrPlaceholderHandler = this.getSSRPlaceholderHandler();
145
141
  if (ssrPlaceholderHandler) {
146
142
  if (ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
@@ -171,11 +167,7 @@ export default class ViewportObserver {
171
167
  return n.isEqualNode(addedNode);
172
168
  });
173
169
  const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
174
- const isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker');
175
-
176
- // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
177
- // no layout shift mutation is excluded as per existing fy25.03 logic
178
- if (sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
170
+ if (sameDeletedNode && isInIgnoreLsMarker) {
179
171
  var _this$intersectionObs5;
180
172
  (_this$intersectionObs5 = this.intersectionObserver) === null || _this$intersectionObs5 === void 0 ? void 0 : _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
181
173
  continue;
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
7
7
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
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
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
11
10
  import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
12
11
  import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
@@ -48,21 +47,18 @@ var createElementMutationsWatcher = function createElementMutationsWatcher(remov
48
47
  return function (_ref) {
49
48
  var target = _ref.target,
50
49
  rect = _ref.rect;
51
- var isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker');
52
50
  var isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(target);
53
- if (!isInIgnoreLsMarker && isNoLsMarkerEnabled) {
51
+ if (!isInIgnoreLsMarker) {
54
52
  return 'mutation:element';
55
53
  }
56
54
  var isRLLPlaceholder = RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
57
- if (isRLLPlaceholder && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
55
+ if (isRLLPlaceholder && isInIgnoreLsMarker) {
58
56
  return 'mutation:rll-placeholder';
59
57
  }
60
58
  var wasDeleted = removedNodeRects.some(function (nr) {
61
59
  return sameRectDimensions(nr, rect);
62
60
  });
63
- // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
64
- // no layout shift mutation is excluded as per existing fy25.03 logic
65
- if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
61
+ if (wasDeleted && isInIgnoreLsMarker) {
66
62
  return 'mutation:element-replacement';
67
63
  }
68
64
  return 'mutation:element';
@@ -118,7 +114,7 @@ var ViewportObserver = /*#__PURE__*/function () {
118
114
  _context2.prev = 4;
119
115
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
120
116
  var _this$intersectionObs8;
121
- var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, isNoLsMarkerEnabled, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
117
+ var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
122
118
  return _regeneratorRuntime.wrap(function _loop$(_context) {
123
119
  while (1) switch (_context.prev = _context.next) {
124
120
  case 0:
@@ -130,7 +126,7 @@ var ViewportObserver = /*#__PURE__*/function () {
130
126
  }
131
127
  return _context.abrupt("return", 0);
132
128
  case 4:
133
- if (!(_this.getSSRState && fg('platform_ufo_vc_v3_ssr_placeholder'))) {
129
+ if (!_this.getSSRState) {
134
130
  _context.next = 19;
135
131
  break;
136
132
  }
@@ -165,7 +161,7 @@ var ViewportObserver = /*#__PURE__*/function () {
165
161
  case 18:
166
162
  ssrState.state = SSRStateEnum.normal;
167
163
  case 19:
168
- if (!(_this.getSSRPlaceholderHandler && fg('platform_ufo_vc_v3_ssr_placeholder'))) {
164
+ if (!_this.getSSRPlaceholderHandler) {
169
165
  _context.next = 36;
170
166
  break;
171
167
  }
@@ -212,32 +208,30 @@ var ViewportObserver = /*#__PURE__*/function () {
212
208
  return n.isEqualNode(addedNode);
213
209
  });
214
210
  isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
215
- isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker'); // When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
216
- // no layout shift mutation is excluded as per existing fy25.03 logic
217
- if (!(sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker))) {
218
- _context.next = 42;
211
+ if (!(sameDeletedNode && isInIgnoreLsMarker)) {
212
+ _context.next = 41;
219
213
  break;
220
214
  }
221
215
  (_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
222
216
  return _context.abrupt("return", 0);
223
- case 42:
217
+ case 41:
224
218
  if (!isContainedWithinMediaWrapper(addedNode)) {
225
- _context.next = 45;
219
+ _context.next = 44;
226
220
  break;
227
221
  }
228
222
  (_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
229
223
  return _context.abrupt("return", 0);
230
- case 45:
224
+ case 44:
231
225
  _checkWithinComponent = checkWithinComponentAndExtractChildProps(addedNode, 'UFOThirdPartySegment'), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
232
226
  if (!isWithinThirdPartySegment) {
233
- _context.next = 49;
227
+ _context.next = 48;
234
228
  break;
235
229
  }
236
230
  (_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
237
231
  return _context.abrupt("return", 0);
238
- case 49:
232
+ case 48:
239
233
  (_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
240
- case 50:
234
+ case 49:
241
235
  case "end":
242
236
  return _context.stop();
243
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.1.9",
3
+ "version": "4.1.10",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -180,12 +180,6 @@
180
180
  "platform_ufo_add_type_for_3p_segments": {
181
181
  "type": "boolean"
182
182
  },
183
- "platform_vc_ignore_no_ls_mutation_marker": {
184
- "type": "boolean"
185
- },
186
- "platform_ufo_vc_v3_ssr_placeholder": {
187
- "type": "boolean"
188
- },
189
183
  "platform_ufo_enable_vc_press_interactions": {
190
184
  "type": "boolean"
191
185
  },