@percy/dom 1.28.0 → 1.28.1-alpha.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.
Files changed (2) hide show
  1. package/dist/bundle.js +12 -3
  2. 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
- const shadowRoot = template.parentNode.attachShadow({ mode });
469
- shadowRoot.appendChild(template.content);
470
- template.remove();
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-alpha.1",
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": "latest"
12
+ "tag": "alpha"
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": "9d95f18e45e37aa3683e5b8276fd85cf07dba8cb"
38
+ "gitHead": "a8ac47269d65a7cf88658c8899c61bef1808c2d0"
39
39
  }