@atlaskit/react-ufo 4.2.0 → 4.2.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 +7 -0
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +29 -1
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +29 -1
- package/dist/esm/vc/vc-observer-new/get-element-name.js +29 -1
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e4fd6ff836b97`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e4fd6ff836b97) -
|
|
8
|
+
Update `error` selector return by TTVC offenders reporting
|
|
9
|
+
|
|
3
10
|
## 4.2.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -4,10 +4,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var nameCache = new WeakMap();
|
|
8
9
|
function getElementName(selectorConfig, element) {
|
|
9
10
|
if (!(element instanceof HTMLElement)) {
|
|
10
|
-
|
|
11
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_report_non_htmlelement_selectors')) {
|
|
12
|
+
var elementInstance = 'Unknown';
|
|
13
|
+
|
|
14
|
+
// Types of elements according to LLM
|
|
15
|
+
if (element instanceof Document) {
|
|
16
|
+
elementInstance = 'Document';
|
|
17
|
+
} else if (element instanceof DocumentFragment) {
|
|
18
|
+
elementInstance = 'DocumentFragment';
|
|
19
|
+
} else if (element instanceof Text) {
|
|
20
|
+
elementInstance = 'Text';
|
|
21
|
+
} else if (element instanceof Comment) {
|
|
22
|
+
elementInstance = 'Comment';
|
|
23
|
+
} else if (element instanceof ProcessingInstruction) {
|
|
24
|
+
elementInstance = 'ProcessingInstruction';
|
|
25
|
+
} else if (element instanceof Attr) {
|
|
26
|
+
elementInstance = 'Attr';
|
|
27
|
+
} else if (element instanceof CDATASection) {
|
|
28
|
+
elementInstance = 'CDATASection';
|
|
29
|
+
}
|
|
30
|
+
if (element.parentElement && element.parentElement instanceof HTMLElement) {
|
|
31
|
+
var parentElementSelector = getElementName(selectorConfig, element.parentElement);
|
|
32
|
+
return "".concat(parentElementSelector, " > ").concat(elementInstance);
|
|
33
|
+
} else {
|
|
34
|
+
return elementInstance;
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
return 'error';
|
|
38
|
+
}
|
|
11
39
|
}
|
|
12
40
|
var cachedName = nameCache.get(element);
|
|
13
41
|
if (cachedName) {
|
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
const nameCache = new WeakMap();
|
|
2
3
|
function getElementName(selectorConfig, element) {
|
|
3
4
|
if (!(element instanceof HTMLElement)) {
|
|
4
|
-
|
|
5
|
+
if (fg('platform_ufo_report_non_htmlelement_selectors')) {
|
|
6
|
+
let elementInstance = 'Unknown';
|
|
7
|
+
|
|
8
|
+
// Types of elements according to LLM
|
|
9
|
+
if (element instanceof Document) {
|
|
10
|
+
elementInstance = 'Document';
|
|
11
|
+
} else if (element instanceof DocumentFragment) {
|
|
12
|
+
elementInstance = 'DocumentFragment';
|
|
13
|
+
} else if (element instanceof Text) {
|
|
14
|
+
elementInstance = 'Text';
|
|
15
|
+
} else if (element instanceof Comment) {
|
|
16
|
+
elementInstance = 'Comment';
|
|
17
|
+
} else if (element instanceof ProcessingInstruction) {
|
|
18
|
+
elementInstance = 'ProcessingInstruction';
|
|
19
|
+
} else if (element instanceof Attr) {
|
|
20
|
+
elementInstance = 'Attr';
|
|
21
|
+
} else if (element instanceof CDATASection) {
|
|
22
|
+
elementInstance = 'CDATASection';
|
|
23
|
+
}
|
|
24
|
+
if (element.parentElement && element.parentElement instanceof HTMLElement) {
|
|
25
|
+
const parentElementSelector = getElementName(selectorConfig, element.parentElement);
|
|
26
|
+
return `${parentElementSelector} > ${elementInstance}`;
|
|
27
|
+
} else {
|
|
28
|
+
return elementInstance;
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
return 'error';
|
|
32
|
+
}
|
|
5
33
|
}
|
|
6
34
|
const cachedName = nameCache.get(element);
|
|
7
35
|
if (cachedName) {
|
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
var nameCache = new WeakMap();
|
|
2
3
|
function getElementName(selectorConfig, element) {
|
|
3
4
|
if (!(element instanceof HTMLElement)) {
|
|
4
|
-
|
|
5
|
+
if (fg('platform_ufo_report_non_htmlelement_selectors')) {
|
|
6
|
+
var elementInstance = 'Unknown';
|
|
7
|
+
|
|
8
|
+
// Types of elements according to LLM
|
|
9
|
+
if (element instanceof Document) {
|
|
10
|
+
elementInstance = 'Document';
|
|
11
|
+
} else if (element instanceof DocumentFragment) {
|
|
12
|
+
elementInstance = 'DocumentFragment';
|
|
13
|
+
} else if (element instanceof Text) {
|
|
14
|
+
elementInstance = 'Text';
|
|
15
|
+
} else if (element instanceof Comment) {
|
|
16
|
+
elementInstance = 'Comment';
|
|
17
|
+
} else if (element instanceof ProcessingInstruction) {
|
|
18
|
+
elementInstance = 'ProcessingInstruction';
|
|
19
|
+
} else if (element instanceof Attr) {
|
|
20
|
+
elementInstance = 'Attr';
|
|
21
|
+
} else if (element instanceof CDATASection) {
|
|
22
|
+
elementInstance = 'CDATASection';
|
|
23
|
+
}
|
|
24
|
+
if (element.parentElement && element.parentElement instanceof HTMLElement) {
|
|
25
|
+
var parentElementSelector = getElementName(selectorConfig, element.parentElement);
|
|
26
|
+
return "".concat(parentElementSelector, " > ").concat(elementInstance);
|
|
27
|
+
} else {
|
|
28
|
+
return elementInstance;
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
return 'error';
|
|
32
|
+
}
|
|
5
33
|
}
|
|
6
34
|
var cachedName = nameCache.get(element);
|
|
7
35
|
if (cachedName) {
|
|
@@ -15,7 +15,7 @@ export declare class SSRPlaceholderHandlers {
|
|
|
15
15
|
private intersectionObserver;
|
|
16
16
|
private EQUALITY_THRESHOLD;
|
|
17
17
|
private enablePageLayoutPlaceholder;
|
|
18
|
-
constructor({ enablePageLayoutPlaceholder
|
|
18
|
+
constructor({ enablePageLayoutPlaceholder }: SSRPlaceholderHandlersConfig);
|
|
19
19
|
private getPlaceholderId;
|
|
20
20
|
private getPlaceholderReplacementId;
|
|
21
21
|
clear(): void;
|
|
@@ -15,7 +15,7 @@ export declare class SSRPlaceholderHandlers {
|
|
|
15
15
|
private intersectionObserver;
|
|
16
16
|
private EQUALITY_THRESHOLD;
|
|
17
17
|
private enablePageLayoutPlaceholder;
|
|
18
|
-
constructor({ enablePageLayoutPlaceholder
|
|
18
|
+
constructor({ enablePageLayoutPlaceholder }: SSRPlaceholderHandlersConfig);
|
|
19
19
|
private getPlaceholderId;
|
|
20
20
|
private getPlaceholderReplacementId;
|
|
21
21
|
clear(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -197,6 +197,9 @@
|
|
|
197
197
|
},
|
|
198
198
|
"platform_ufo_post_interaction_check_name": {
|
|
199
199
|
"type": "boolean"
|
|
200
|
+
},
|
|
201
|
+
"platform_ufo_report_non_htmlelement_selectors": {
|
|
202
|
+
"type": "boolean"
|
|
200
203
|
}
|
|
201
204
|
}
|
|
202
205
|
}
|