frosty 0.0.42 → 0.0.43

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/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var common = require('./internals/common-Da9gnaMF.js');
3
+ var common = require('./internals/common-P5AZ4-Yt.js');
4
4
  require('lodash');
5
5
  require('myers.js');
6
6
  require('./internals/component-BiP3XIPe.js');
package/dist/dom.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _DOMRenderer } from './internals/common-1tFNfKXg.mjs';
1
+ import { _ as _DOMRenderer } from './internals/common-Cmc9qJmA.mjs';
2
2
  import 'lodash';
3
3
  import 'myers.js';
4
4
  import './internals/component-BzurKp_J.mjs';
@@ -3920,9 +3920,10 @@ class _DOMRenderer extends _Renderer {
3920
3920
  /** @internal */
3921
3921
  _afterUpdate() {
3922
3922
  this._tracked_style.select(this._tracked_style_names);
3923
+ const head = this.document.head ?? this.document.createElementNS(HTML_NS, 'head');
3923
3924
  if (this._tracked_style.isEmpty) {
3924
3925
  if (this._server) {
3925
- this.__replaceChildren(this.document.head, this._tracked_head_children);
3926
+ this.__replaceChildren(head, this._tracked_head_children);
3926
3927
  }
3927
3928
  }
3928
3929
  else {
@@ -3930,12 +3931,15 @@ class _DOMRenderer extends _Renderer {
3930
3931
  styleElem.setAttribute('data-frosty-style', '');
3931
3932
  styleElem.textContent = this._tracked_style.css;
3932
3933
  if (this._server) {
3933
- this.__replaceChildren(this.document.head, [...this._tracked_head_children, styleElem]);
3934
+ this.__replaceChildren(head, [...this._tracked_head_children, styleElem]);
3934
3935
  }
3935
- else if (styleElem.parentNode !== this.document.head) {
3936
- this.document.head.appendChild(styleElem);
3936
+ else if (styleElem.parentNode !== head) {
3937
+ head.appendChild(styleElem);
3937
3938
  }
3938
3939
  }
3940
+ if (!this.document.head) {
3941
+ this.document.documentElement.insertBefore(head, this.document.body);
3942
+ }
3939
3943
  }
3940
3944
  /** @internal */
3941
3945
  _createElement(node, stack) {
@@ -4139,4 +4143,4 @@ class _DOMRenderer extends _Renderer {
4139
4143
  }
4140
4144
 
4141
4145
  export { DOMNativeNode as D, _DOMRenderer as _ };
4142
- //# sourceMappingURL=common-1tFNfKXg.mjs.map
4146
+ //# sourceMappingURL=common-Cmc9qJmA.mjs.map