@percy/dom 1.28.0 → 1.28.1-beta.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/bundle.js +12 -3
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -462,12 +462,21 @@
|
|
|
462
462
|
scriptEl.setAttribute('id', '__percy_shadowdom_helper');
|
|
463
463
|
scriptEl.setAttribute('data-percy-injected', true);
|
|
464
464
|
scriptEl.innerHTML = `
|
|
465
|
+
function attachShadow(template, mode){
|
|
466
|
+
const shadowRoot = template.parentNode.attachShadow({ mode });
|
|
467
|
+
shadowRoot.appendChild(template.content);
|
|
468
|
+
template.remove();
|
|
469
|
+
}
|
|
470
|
+
|
|
465
471
|
function reversePolyFill(root=document){
|
|
466
472
|
root.querySelectorAll('template[shadowroot]').forEach(template => {
|
|
467
473
|
const mode = template.getAttribute('shadowroot');
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
474
|
+
attachShadow(template, mode);
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
root.querySelectorAll('template[shadowrootmode]').forEach(template => {
|
|
478
|
+
const mode = template.getAttribute('shadowrootmode');
|
|
479
|
+
attachShadow(template, mode);
|
|
471
480
|
});
|
|
472
481
|
|
|
473
482
|
root.querySelectorAll('[data-percy-shadow-host]').forEach(shadowHost => reversePolyFill(shadowHost.shadowRoot));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/dom",
|
|
3
|
-
"version": "1.28.0",
|
|
3
|
+
"version": "1.28.1-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
12
|
+
"tag": "beta"
|
|
13
13
|
},
|
|
14
14
|
"main": "dist/bundle.js",
|
|
15
15
|
"browser": "dist/bundle.js",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"interactor.js": "^2.0.0-beta.10"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "648f81742ebf8c6f29ccdfdff77df124e4e1668d"
|
|
39
39
|
}
|