@allurereport/web-commons 3.14.2 → 3.15.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/dist/charts/types.d.ts
CHANGED
package/dist/sanitize.d.ts
CHANGED
package/dist/sanitize.js
CHANGED
|
@@ -4,3 +4,14 @@ const IFRAME_SANITIZE_CONFIG = {
|
|
|
4
4
|
USE_PROFILES: { html: true },
|
|
5
5
|
};
|
|
6
6
|
export const sanitizeIframeHtml = (html) => sanitize(html, IFRAME_SANITIZE_CONFIG);
|
|
7
|
+
const HTML_DOCUMENT_SANITIZE_CONFIG = {
|
|
8
|
+
WHOLE_DOCUMENT: true,
|
|
9
|
+
ADD_TAGS: ["meta", "link", "title"],
|
|
10
|
+
ADD_ATTR: ["charset", "http-equiv", "content", "name", "rel", "href", "media", "property"],
|
|
11
|
+
FORBID_TAGS: ["base"],
|
|
12
|
+
FORBID_ATTR: ["http-equiv"],
|
|
13
|
+
};
|
|
14
|
+
export const sanitizeHtmlDocument = (html) => {
|
|
15
|
+
const sanitized = sanitize(html, HTML_DOCUMENT_SANITIZE_CONFIG);
|
|
16
|
+
return sanitized ? `<!DOCTYPE html>${sanitized}` : sanitized;
|
|
17
|
+
};
|
|
@@ -32,13 +32,8 @@ export const isSameDocumentUrl = (url, currentHref = getCurrentUrl()) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
export const toSameDocumentHistoryUrl = (url) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
if (url.hash) {
|
|
39
|
-
return url.hash;
|
|
40
|
-
}
|
|
41
|
-
return url.pathname.split("/").pop() || ".";
|
|
35
|
+
const fileName = url.pathname.split("/").pop() || ".";
|
|
36
|
+
return `${fileName}${url.search}${url.hash}`;
|
|
42
37
|
};
|
|
43
38
|
export const getHistoryUrl = (to, currentHref = getCurrentUrl()) => {
|
|
44
39
|
const url = getUrl(to);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-commons",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Collection of utilities used across the web Allure reports",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"lint:fix": "oxlint --import-plugin --fix src test features stories"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@allurereport/aql": "3.
|
|
30
|
-
"@allurereport/charts-api": "3.
|
|
31
|
-
"@allurereport/core-api": "3.
|
|
32
|
-
"@allurereport/plugin-api": "3.
|
|
29
|
+
"@allurereport/aql": "3.15.0",
|
|
30
|
+
"@allurereport/charts-api": "3.15.0",
|
|
31
|
+
"@allurereport/core-api": "3.15.0",
|
|
32
|
+
"@allurereport/plugin-api": "3.15.0",
|
|
33
33
|
"@preact/signals": "^2.6.1",
|
|
34
34
|
"@preact/signals-core": "^1.12.2",
|
|
35
35
|
"ansi-to-html": "^0.7.2",
|