mount-observer 0.0.26 → 0.0.27

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/Synthesizer.js +11 -3
  2. package/package.json +1 -1
package/Synthesizer.js CHANGED
@@ -57,9 +57,17 @@ export class Synthesizer extends HTMLElement {
57
57
  return;
58
58
  const parentShadowRealm = host.getRootNode();
59
59
  const { localName } = this;
60
- const parentScopeSynthesizer = parentShadowRealm.querySelector(localName);
61
- if (parentScopeSynthesizer === null)
62
- throw 404;
60
+ let parentScopeSynthesizer = parentShadowRealm.querySelector(localName);
61
+ if (parentScopeSynthesizer === null) {
62
+ parentScopeSynthesizer = document.createElement(localName);
63
+ if (parentShadowRealm === document) {
64
+ document.head.appendChild(parentScopeSynthesizer);
65
+ }
66
+ else {
67
+ parentShadowRealm.appendChild(parentScopeSynthesizer);
68
+ }
69
+ }
70
+ ;
63
71
  const { mountObserverElements } = parentScopeSynthesizer;
64
72
  for (const moe of mountObserverElements) {
65
73
  this.import(moe);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",