@atlaskit/react-ufo 3.14.12 → 3.14.14
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 +16 -0
- package/dist/cjs/trace-interaction/index.js +6 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js +23 -9
- package/dist/es2019/trace-interaction/index.js +6 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js +21 -7
- package/dist/esm/trace-interaction/index.js +6 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -1
- package/dist/esm/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js +23 -9
- package/dist/types/trace-interaction/index.d.ts +7 -1
- package/dist/types-ts4.5/trace-interaction/index.d.ts +7 -1
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.14.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#184795](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184795)
|
|
8
|
+
[`ce7944d6a2a96`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ce7944d6a2a96) -
|
|
9
|
+
centrally exclude all data-test\* attribute mutations for TTVC v3
|
|
10
|
+
|
|
11
|
+
## 3.14.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#184565](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184565)
|
|
16
|
+
[`c08127cbd5494`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c08127cbd5494) -
|
|
17
|
+
Fix the third party elements excluded from metric logic for non-react rendered components
|
|
18
|
+
|
|
3
19
|
## 3.14.12
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -13,6 +13,12 @@ Object.defineProperty(exports, "UNSAFE__DO_NOT_USE_traceUFOInteraction", {
|
|
|
13
13
|
exports.default = void 0;
|
|
14
14
|
var _mapToInteractionType = _interopRequireDefault(require("./internal/map-to-interaction-type"));
|
|
15
15
|
var _traceUfoInteraction = _interopRequireDefault(require("./internal/trace-ufo-interaction"));
|
|
16
|
+
/**
|
|
17
|
+
* *Warning* Currently this only supports the events with the following types
|
|
18
|
+
* ```ts
|
|
19
|
+
* 'click' | 'dblclick' | 'mousedown' | 'mouseenter' | 'mouseover'
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
16
22
|
function traceUFOInteraction(name, event) {
|
|
17
23
|
if (!event || !event.isTrusted) {
|
|
18
24
|
return;
|
|
@@ -56,7 +56,7 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
|
|
|
56
56
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
|
-
if (attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && (0, _platformFeatureFlags.fg)('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
59
|
+
if (attributeName.startsWith('data-test') && (0, _platformFeatureFlags.fg)('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && (0, _platformFeatureFlags.fg)('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
return true;
|
package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js
CHANGED
|
@@ -9,21 +9,35 @@ exports.checkWithinComponentAndExtractChildProps = checkWithinComponentAndExtrac
|
|
|
9
9
|
exports.createMutationTypeWithIgnoredReason = createMutationTypeWithIgnoredReason;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
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; }
|
|
13
14
|
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) { (0, _defineProperty2.default)(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; }
|
|
15
|
+
// Helper function to find React fiber on an element
|
|
16
|
+
var findReactFiber = function findReactFiber(element) {
|
|
17
|
+
var key = Object.keys(element).find(function (key) {
|
|
18
|
+
return key.startsWith('__reactFiber$') || key.startsWith('__reactInternalInstance$');
|
|
19
|
+
});
|
|
20
|
+
return key ? element[key] : null;
|
|
21
|
+
};
|
|
22
|
+
|
|
14
23
|
// Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
|
|
15
24
|
// and extract child component props if needed.
|
|
16
25
|
function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
var fiber = null;
|
|
27
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_handle_non_react_element_for_3p')) {
|
|
28
|
+
// Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
|
|
29
|
+
var currentElement = node;
|
|
30
|
+
while (currentElement && !fiber) {
|
|
31
|
+
fiber = findReactFiber(currentElement);
|
|
32
|
+
if (!fiber) {
|
|
33
|
+
currentElement = currentElement.parentElement;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
fiber = findReactFiber(node);
|
|
25
38
|
}
|
|
26
|
-
|
|
39
|
+
|
|
40
|
+
// If no React fiber found, return false
|
|
27
41
|
if (!fiber) {
|
|
28
42
|
return {
|
|
29
43
|
isWithin: false
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import mapToInteractionType from './internal/map-to-interaction-type';
|
|
2
2
|
import internal_traceUFOInteraction from './internal/trace-ufo-interaction';
|
|
3
3
|
export { default as UNSAFE__DO_NOT_USE_traceUFOInteraction } from './internal/trace-ufo-interaction';
|
|
4
|
+
/**
|
|
5
|
+
* *Warning* Currently this only supports the events with the following types
|
|
6
|
+
* ```ts
|
|
7
|
+
* 'click' | 'dblclick' | 'mousedown' | 'mouseenter' | 'mouseover'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
4
10
|
function traceUFOInteraction(name, event) {
|
|
5
11
|
if (!event || !event.isTrusted) {
|
|
6
12
|
return;
|
|
@@ -38,7 +38,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
38
38
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
-
if (attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
41
|
+
if (attributeName.startsWith('data-test') && fg('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
return true;
|
package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
// Helper function to find React fiber on an element
|
|
3
|
+
const findReactFiber = element => {
|
|
4
|
+
const key = Object.keys(element).find(key => key.startsWith('__reactFiber$') || key.startsWith('__reactInternalInstance$'));
|
|
5
|
+
return key ? element[key] : null;
|
|
6
|
+
};
|
|
7
|
+
|
|
1
8
|
// Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
|
|
2
9
|
// and extract child component props if needed.
|
|
3
10
|
export function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
let fiber = null;
|
|
12
|
+
if (fg('platform_ufo_handle_non_react_element_for_3p')) {
|
|
13
|
+
// Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
|
|
14
|
+
let currentElement = node;
|
|
15
|
+
while (currentElement && !fiber) {
|
|
16
|
+
fiber = findReactFiber(currentElement);
|
|
17
|
+
if (!fiber) {
|
|
18
|
+
currentElement = currentElement.parentElement;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
fiber = findReactFiber(node);
|
|
10
23
|
}
|
|
11
|
-
|
|
24
|
+
|
|
25
|
+
// If no React fiber found, return false
|
|
12
26
|
if (!fiber) {
|
|
13
27
|
return {
|
|
14
28
|
isWithin: false
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import mapToInteractionType from './internal/map-to-interaction-type';
|
|
2
2
|
import internal_traceUFOInteraction from './internal/trace-ufo-interaction';
|
|
3
3
|
export { default as UNSAFE__DO_NOT_USE_traceUFOInteraction } from './internal/trace-ufo-interaction';
|
|
4
|
+
/**
|
|
5
|
+
* *Warning* Currently this only supports the events with the following types
|
|
6
|
+
* ```ts
|
|
7
|
+
* 'click' | 'dblclick' | 'mousedown' | 'mouseenter' | 'mouseover'
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
4
10
|
function traceUFOInteraction(name, event) {
|
|
5
11
|
if (!event || !event.isTrusted) {
|
|
6
12
|
return;
|
|
@@ -49,7 +49,7 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
|
49
49
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
|
-
if (attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
52
|
+
if (attributeName.startsWith('data-test') && fg('platform_ufo_ttvc_exclude_data_test_attribute') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || (attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck') && fg('platform_ufo_ignore_extra_attributes') || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName)) {
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
55
|
return true;
|
package/dist/esm/vc/vc-observer-new/viewport-observer/utils/get-component-name-and-child-props.js
CHANGED
|
@@ -2,19 +2,33 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
// Helper function to find React fiber on an element
|
|
7
|
+
var findReactFiber = function findReactFiber(element) {
|
|
8
|
+
var key = Object.keys(element).find(function (key) {
|
|
9
|
+
return key.startsWith('__reactFiber$') || key.startsWith('__reactInternalInstance$');
|
|
10
|
+
});
|
|
11
|
+
return key ? element[key] : null;
|
|
12
|
+
};
|
|
13
|
+
|
|
5
14
|
// Using the React Fiber tree to traverse up the DOM and check if a node is within a specific component
|
|
6
15
|
// and extract child component props if needed.
|
|
7
16
|
export function checkWithinComponentAndExtractChildProps(node, targetComponentName, childComponentConfig) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
var fiber = null;
|
|
18
|
+
if (fg('platform_ufo_handle_non_react_element_for_3p')) {
|
|
19
|
+
// Walk up the DOM tree to find React fiber (handles non-React-rendered elements)
|
|
20
|
+
var currentElement = node;
|
|
21
|
+
while (currentElement && !fiber) {
|
|
22
|
+
fiber = findReactFiber(currentElement);
|
|
23
|
+
if (!fiber) {
|
|
24
|
+
currentElement = currentElement.parentElement;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
fiber = findReactFiber(node);
|
|
16
29
|
}
|
|
17
|
-
|
|
30
|
+
|
|
31
|
+
// If no React fiber found, return false
|
|
18
32
|
if (!fiber) {
|
|
19
33
|
return {
|
|
20
34
|
isWithin: false
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { UIEvent } from 'react';
|
|
2
2
|
export { default as UNSAFE__DO_NOT_USE_traceUFOInteraction } from './internal/trace-ufo-interaction';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* *Warning* Currently this only supports the events with the following types
|
|
5
|
+
* ```ts
|
|
6
|
+
* 'click' | 'dblclick' | 'mousedown' | 'mouseenter' | 'mouseover'
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
declare function traceUFOInteraction(name: string, event: Event | UIEvent): void;
|
|
4
10
|
export default traceUFOInteraction;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { UIEvent } from 'react';
|
|
2
2
|
export { default as UNSAFE__DO_NOT_USE_traceUFOInteraction } from './internal/trace-ufo-interaction';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* *Warning* Currently this only supports the events with the following types
|
|
5
|
+
* ```ts
|
|
6
|
+
* 'click' | 'dblclick' | 'mousedown' | 'mouseenter' | 'mouseover'
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
declare function traceUFOInteraction(name: string, event: Event | UIEvent): void;
|
|
4
10
|
export default traceUFOInteraction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.14",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -145,6 +145,9 @@
|
|
|
145
145
|
"ufo_return_relative_request_start": {
|
|
146
146
|
"type": "boolean"
|
|
147
147
|
},
|
|
148
|
+
"platform_ufo_ttvc_exclude_data_test_attribute": {
|
|
149
|
+
"type": "boolean"
|
|
150
|
+
},
|
|
148
151
|
"enable_ufo_devtools_api_for_extra_events": {
|
|
149
152
|
"type": "boolean"
|
|
150
153
|
},
|
|
@@ -213,6 +216,9 @@
|
|
|
213
216
|
},
|
|
214
217
|
"platform_ufo_abort_measurement_fix": {
|
|
215
218
|
"type": "boolean"
|
|
219
|
+
},
|
|
220
|
+
"platform_ufo_handle_non_react_element_for_3p": {
|
|
221
|
+
"type": "boolean"
|
|
216
222
|
}
|
|
217
223
|
}
|
|
218
224
|
}
|