@atlaskit/react-ufo 3.4.9 → 3.4.11

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/create-payload/utils/get-vc-metrics.js +24 -6
  3. package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +81 -0
  4. package/dist/cjs/vc/vc-observer/index.js +119 -117
  5. package/dist/cjs/vc/vc-observer/observers/index.js +19 -7
  6. package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +9 -18
  7. package/dist/cjs/vc/vc-observer/revisions/revisions.js +13 -12
  8. package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  9. package/dist/es2019/create-payload/utils/get-vc-metrics.js +23 -10
  10. package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +76 -0
  11. package/dist/es2019/vc/vc-observer/index.js +96 -93
  12. package/dist/es2019/vc/vc-observer/observers/index.js +19 -7
  13. package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +7 -16
  14. package/dist/es2019/vc/vc-observer/revisions/revisions.js +13 -14
  15. package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  16. package/dist/esm/create-payload/utils/get-vc-metrics.js +24 -6
  17. package/dist/esm/vc/vc-observer/getVCRevisionsData.js +74 -0
  18. package/dist/esm/vc/vc-observer/index.js +119 -117
  19. package/dist/esm/vc/vc-observer/observers/index.js +19 -7
  20. package/dist/esm/vc/vc-observer/revisions/fy25_02.js +9 -18
  21. package/dist/esm/vc/vc-observer/revisions/revisions.js +13 -12
  22. package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +27 -5
  23. package/dist/types/config/index.d.ts +1 -0
  24. package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
  25. package/dist/types-ts4.5/config/index.d.ts +1 -0
  26. package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +35 -0
  27. package/package.json +10 -10
@@ -1,6 +1,7 @@
1
1
  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; } } }; }
2
2
  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; } }
3
3
  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; }
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  export default function createMutationObserver(_ref) {
5
6
  var onAttributeMutation = _ref.onAttributeMutation,
6
7
  onChildListMutation = _ref.onChildListMutation,
@@ -21,11 +22,32 @@ export default function createMutationObserver(_ref) {
21
22
  continue;
22
23
  }
23
24
  if (mut.type === 'attributes') {
24
- var _mut$attributeName;
25
- onAttributeMutation({
26
- target: mut.target,
27
- attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
28
- });
25
+ if (fg('platform_ufo_vc_ignore_same_value_mutation')) {
26
+ var _mut$oldValue;
27
+ /*
28
+ "MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
29
+ I think it might have been something along the lines that for consistency every setAttribute call should create a record.
30
+ Conceptually there is after all a mutation: there is an old value replaced with a new one,
31
+ and whether or not they are the same doesn't really matter.
32
+ And Custom elements should work the same way as MutationObserver."
33
+ https://github.com/whatwg/dom/issues/520#issuecomment-336574796
34
+ */
35
+ var oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
36
+ var newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
37
+ if (oldValue !== newValue) {
38
+ var _mut$attributeName;
39
+ onAttributeMutation({
40
+ target: mut.target,
41
+ attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
42
+ });
43
+ }
44
+ } else {
45
+ var _mut$attributeName2;
46
+ onAttributeMutation({
47
+ target: mut.target,
48
+ attributeName: (_mut$attributeName2 = mut.attributeName) !== null && _mut$attributeName2 !== void 0 ? _mut$attributeName2 : 'unknown'
49
+ });
50
+ }
29
51
  continue;
30
52
  } else if (mut.type === 'childList') {
31
53
  var _mut$addedNodes, _mut$removedNodes;
@@ -92,6 +92,7 @@ export type Config = {
92
92
  readonly manuallyTrackReactProfilerMounts?: boolean;
93
93
  readonly enableEditorLnvHandler?: boolean;
94
94
  /**
95
+ * @private
95
96
  * @deprecated setting this will do nothing now
96
97
  */
97
98
  readonly enableCompleteUsingDoubleRAF?: boolean;
@@ -0,0 +1,35 @@
1
+ import { InteractionMetrics } from '../../common/common/types';
2
+ import type { MultiRevisionHeatmap } from './heatmap/heatmap';
3
+ type CalculatedVC = {
4
+ VC: {
5
+ [key: string]: number | null;
6
+ };
7
+ VCBox: {
8
+ [key: string]: string[] | null;
9
+ };
10
+ };
11
+ export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, }: {
12
+ fullPrefix?: string;
13
+ interaction: Pick<InteractionMetrics, 'start' | 'end'>;
14
+ isVCClean: boolean;
15
+ isEventAborted: boolean;
16
+ multiHeatmap: MultiRevisionHeatmap | null;
17
+ calculatedVC: CalculatedVC;
18
+ calculatedVCNext: CalculatedVC;
19
+ ssr?: number;
20
+ }): {
21
+ [x: string]: import("../../common").MultiHeatmapPayload;
22
+ } | {
23
+ [x: string]: {
24
+ revision: string;
25
+ clean: boolean;
26
+ 'metric:vc90': number | null;
27
+ vcDetails: {
28
+ [k: string]: {
29
+ t: number | null;
30
+ e: string[];
31
+ };
32
+ };
33
+ }[];
34
+ } | null;
35
+ export {};
@@ -92,6 +92,7 @@ export type Config = {
92
92
  readonly manuallyTrackReactProfilerMounts?: boolean;
93
93
  readonly enableEditorLnvHandler?: boolean;
94
94
  /**
95
+ * @private
95
96
  * @deprecated setting this will do nothing now
96
97
  */
97
98
  readonly enableCompleteUsingDoubleRAF?: boolean;
@@ -0,0 +1,35 @@
1
+ import { InteractionMetrics } from '../../common/common/types';
2
+ import type { MultiRevisionHeatmap } from './heatmap/heatmap';
3
+ type CalculatedVC = {
4
+ VC: {
5
+ [key: string]: number | null;
6
+ };
7
+ VCBox: {
8
+ [key: string]: string[] | null;
9
+ };
10
+ };
11
+ export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, }: {
12
+ fullPrefix?: string;
13
+ interaction: Pick<InteractionMetrics, 'start' | 'end'>;
14
+ isVCClean: boolean;
15
+ isEventAborted: boolean;
16
+ multiHeatmap: MultiRevisionHeatmap | null;
17
+ calculatedVC: CalculatedVC;
18
+ calculatedVCNext: CalculatedVC;
19
+ ssr?: number;
20
+ }): {
21
+ [x: string]: import("../../common").MultiHeatmapPayload;
22
+ } | {
23
+ [x: string]: {
24
+ revision: string;
25
+ clean: boolean;
26
+ 'metric:vc90': number | null;
27
+ vcDetails: {
28
+ [k: string]: {
29
+ t: number | null;
30
+ e: string[];
31
+ };
32
+ };
33
+ }[];
34
+ } | null;
35
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.4.9",
3
+ "version": "3.4.11",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -136,21 +136,12 @@
136
136
  "platform_editor_ed-25937_ignore_mutations_for_ttvc": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform-ufo-invisible-element-vc-calculations": {
140
- "type": "boolean"
141
- },
142
- "platform-ufo-vc-observe-attributes": {
143
- "type": "boolean"
144
- },
145
139
  "enable-react-ufo-payload-segment-compressed": {
146
140
  "type": "boolean"
147
141
  },
148
142
  "ufo_capture_stylesheet_metrics": {
149
143
  "type": "boolean"
150
144
  },
151
- "ufo-remove-vc-component-observations-after-ttai": {
152
- "type": "boolean"
153
- },
154
145
  "ufo-calc-speed-index": {
155
146
  "type": "boolean"
156
147
  },
@@ -186,6 +177,15 @@
186
177
  },
187
178
  "platform_ufo_ssr_placeholder_round_rect_size_check": {
188
179
  "type": "boolean"
180
+ },
181
+ "platform_ufo_vc_ignore_same_value_mutation": {
182
+ "type": "boolean"
183
+ },
184
+ "platform_ufo_fix_v2_reported_vc90": {
185
+ "type": "boolean"
186
+ },
187
+ "platform_ufo_disable_ttvc_v1": {
188
+ "type": "boolean"
189
189
  }
190
190
  }
191
191
  }