@atlaskit/react-ufo 2.10.0 → 2.11.0

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.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#103452](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103452)
8
+ [`4bd40c1e5fb42`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4bd40c1e5fb42) -
9
+ Replaced feature gate for editor lazy node view with config option
10
+
3
11
  ## 2.10.0
4
12
 
5
13
  ### Minor Changes
@@ -15,6 +15,7 @@ exports.getRemovePageSegmentsUFOPrefixes = getRemovePageSegmentsUFOPrefixes;
15
15
  exports.getTypingPerformanceTracingMethod = getTypingPerformanceTracingMethod;
16
16
  exports.getUfoNameOverrides = getUfoNameOverrides;
17
17
  exports.setUFOConfig = setUFOConfig;
18
+ exports.shouldHandleEditorLnv = shouldHandleEditorLnv;
18
19
  var config;
19
20
 
20
21
  // Defensively typed, since this is directly user-editable
@@ -241,4 +242,12 @@ function getDoNotAbortActivePressInteractionOnTransition() {
241
242
  } catch (e) {
242
243
  return undefined;
243
244
  }
245
+ }
246
+ function shouldHandleEditorLnv() {
247
+ try {
248
+ var _config$enableEditorL, _config11;
249
+ return (_config$enableEditorL = (_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.enableEditorLnvHandler) !== null && _config$enableEditorL !== void 0 ? _config$enableEditorL : false;
250
+ } catch (e) {
251
+ return false;
252
+ }
244
253
  }
@@ -9,6 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _config = require("../../../config");
12
13
  var _vcUtils = require("../media-wrapper/vc-utils");
13
14
  var _editorLnv = require("./editor-lnv");
14
15
  var _ssrPlaceholders = require("./ssr-placeholders");
@@ -140,6 +141,7 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
140
141
  key: "getMutationObserver",
141
142
  value: function getMutationObserver() {
142
143
  var _this2 = this;
144
+ var shouldHandleEditorLnvLocal = (0, _config.shouldHandleEditorLnv)();
143
145
  return this.isBrowserSupported() ? new MutationObserver(function (mutations) {
144
146
  _this2.measureStart();
145
147
  mutations.forEach(function (mutation) {
@@ -185,7 +187,7 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
185
187
  });
186
188
  return;
187
189
  }
188
- if ((0, _platformFeatureFlags.fg)('platform_editor_ed-25557_lnv_add_ssr_placeholder')) {
190
+ if (shouldHandleEditorLnvLocal) {
189
191
  if (_this2.editorLnvHandler.shouldHandleAddedNode(node)) {
190
192
  _this2.editorLnvHandler.handleAddedNode(node).then(function (_ref) {
191
193
  var shouldIgnore = _ref.shouldIgnore;
@@ -234,4 +234,12 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
234
234
  } catch (e) {
235
235
  return undefined;
236
236
  }
237
+ }
238
+ export function shouldHandleEditorLnv() {
239
+ try {
240
+ var _config$enableEditorL, _config;
241
+ return (_config$enableEditorL = (_config = config) === null || _config === void 0 ? void 0 : _config.enableEditorLnvHandler) !== null && _config$enableEditorL !== void 0 ? _config$enableEditorL : false;
242
+ } catch (e) {
243
+ return false;
244
+ }
237
245
  }
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { shouldHandleEditorLnv } from '../../../config';
3
4
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
4
5
  import { EditorLnvHandler } from './editor-lnv';
5
6
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
@@ -111,6 +112,7 @@ export class Observers {
111
112
  this.ssr.renderStop = stopTime;
112
113
  }
113
114
  getMutationObserver() {
115
+ const shouldHandleEditorLnvLocal = shouldHandleEditorLnv();
114
116
  return this.isBrowserSupported() ? new MutationObserver(mutations => {
115
117
  this.measureStart();
116
118
  mutations.forEach(mutation => {
@@ -156,7 +158,7 @@ export class Observers {
156
158
  });
157
159
  return;
158
160
  }
159
- if (fg('platform_editor_ed-25557_lnv_add_ssr_placeholder')) {
161
+ if (shouldHandleEditorLnvLocal) {
160
162
  if (this.editorLnvHandler.shouldHandleAddedNode(node)) {
161
163
  this.editorLnvHandler.handleAddedNode(node).then(({
162
164
  shouldIgnore
@@ -224,4 +224,12 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
224
224
  } catch (e) {
225
225
  return undefined;
226
226
  }
227
+ }
228
+ export function shouldHandleEditorLnv() {
229
+ try {
230
+ var _config$enableEditorL, _config11;
231
+ return (_config$enableEditorL = (_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.enableEditorLnvHandler) !== null && _config$enableEditorL !== void 0 ? _config$enableEditorL : false;
232
+ } catch (e) {
233
+ return false;
234
+ }
227
235
  }
@@ -4,6 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { shouldHandleEditorLnv } from '../../../config';
7
8
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
8
9
  import { EditorLnvHandler } from './editor-lnv';
9
10
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
@@ -133,6 +134,7 @@ export var Observers = /*#__PURE__*/function () {
133
134
  key: "getMutationObserver",
134
135
  value: function getMutationObserver() {
135
136
  var _this2 = this;
137
+ var shouldHandleEditorLnvLocal = shouldHandleEditorLnv();
136
138
  return this.isBrowserSupported() ? new MutationObserver(function (mutations) {
137
139
  _this2.measureStart();
138
140
  mutations.forEach(function (mutation) {
@@ -178,7 +180,7 @@ export var Observers = /*#__PURE__*/function () {
178
180
  });
179
181
  return;
180
182
  }
181
- if (fg('platform_editor_ed-25557_lnv_add_ssr_placeholder')) {
183
+ if (shouldHandleEditorLnvLocal) {
182
184
  if (_this2.editorLnvHandler.shouldHandleAddedNode(node)) {
183
185
  _this2.editorLnvHandler.handleAddedNode(node).then(function (_ref) {
184
186
  var shouldIgnore = _ref.shouldIgnore;
@@ -78,6 +78,7 @@ export type Config = {
78
78
  readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
79
79
  readonly timeWindowForLateMutationsInMilliseconds?: number;
80
80
  readonly manuallyTrackReactProfilerMounts?: boolean;
81
+ readonly enableEditorLnvHandler?: boolean;
81
82
  /**
82
83
  * @deprecated setting this will do nothing now
83
84
  */
@@ -97,4 +98,5 @@ export declare function getRemoveInteractionsUFOPrefixes(): boolean;
97
98
  export declare function getUfoNameOverrides(): UFONameOverride | undefined;
98
99
  export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
99
100
  export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
101
+ export declare function shouldHandleEditorLnv(): boolean;
100
102
  export {};
@@ -78,6 +78,7 @@ export type Config = {
78
78
  readonly shouldCalculateLighthouseMetricsFromTTAI?: boolean;
79
79
  readonly timeWindowForLateMutationsInMilliseconds?: number;
80
80
  readonly manuallyTrackReactProfilerMounts?: boolean;
81
+ readonly enableEditorLnvHandler?: boolean;
81
82
  /**
82
83
  * @deprecated setting this will do nothing now
83
84
  */
@@ -101,4 +102,5 @@ export declare function getRemoveInteractionsUFOPrefixes(): boolean;
101
102
  export declare function getUfoNameOverrides(): UFONameOverride | undefined;
102
103
  export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
103
104
  export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
105
+ export declare function shouldHandleEditorLnv(): boolean;
104
106
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -123,9 +123,6 @@
123
123
  }
124
124
  },
125
125
  "platform-feature-flags": {
126
- "platform_editor_ed-25557_lnv_add_ssr_placeholder": {
127
- "type": "boolean"
128
- },
129
126
  "platform_editor_ed-25937_ignore_mutations_for_ttvc": {
130
127
  "type": "boolean"
131
128
  },