mol_dump_lib 0.0.4 → 0.0.6

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/web.mjs CHANGED
@@ -1772,6 +1772,15 @@ var $;
1772
1772
  let all = [];
1773
1773
  let el = null;
1774
1774
  let timer = null;
1775
+ function $mol_style_attach_force() {
1776
+ if (all.length) {
1777
+ el.innerHTML += '\n' + all.join('\n\n');
1778
+ all = [];
1779
+ }
1780
+ timer = null;
1781
+ return el;
1782
+ }
1783
+ $.$mol_style_attach_force = $mol_style_attach_force;
1775
1784
  function $mol_style_attach(id, text) {
1776
1785
  all.push(`/* ${id} */\n\n${text}`);
1777
1786
  if (timer)
@@ -1782,12 +1791,7 @@ var $;
1782
1791
  el = doc.createElement('style');
1783
1792
  el.id = `$mol_style_attach`;
1784
1793
  doc.head.appendChild(el);
1785
- timer = new $mol_after_tick(() => {
1786
- el.innerHTML = '\n' + all.join('\n\n');
1787
- all = [];
1788
- el = null;
1789
- timer = null;
1790
- });
1794
+ timer = new $mol_after_tick($mol_style_attach_force);
1791
1795
  return el;
1792
1796
  }
1793
1797
  $.$mol_style_attach = $mol_style_attach;
@@ -2456,7 +2460,7 @@ var $;
2456
2460
  this.attachShadow({ mode: 'open' });
2457
2461
  const node = this.view.dom_node();
2458
2462
  node.setAttribute('mol_view_root', '');
2459
- this.shadowRoot.append(document.getElementById(`$mol_style_attach`).cloneNode(true), node);
2463
+ this.shadowRoot.append($mol_style_attach_force().cloneNode(true), node);
2460
2464
  }
2461
2465
  this.root = $mol_wire_auto();
2462
2466
  try {
@@ -2499,6 +2503,7 @@ var $;
2499
2503
  }
2500
2504
  attributes_observe(View.prototype);
2501
2505
  customElements.define(Component.tag, Component);
2506
+ return Component;
2502
2507
  }
2503
2508
  $.$mol_view_component = $mol_view_component;
2504
2509
  })($ || ($ = {}));