@blockquote-web-components/blockquote-base-style-helpers 1.4.22 → 1.4.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote-web-components/blockquote-base-style-helpers",
3
- "version": "1.4.22",
3
+ "version": "1.4.24",
4
4
  "description": "Webcomponent blockquote-base-style-helpers following open-wc recommendations",
5
5
  "keywords": [
6
6
  "lit",
@@ -118,16 +118,16 @@
118
118
  ]
119
119
  },
120
120
  "dependencies": {
121
- "@blockquote-web-components/blockquote-base-meta": "^1.5.22"
121
+ "@blockquote-web-components/blockquote-base-meta": "^1.5.24"
122
122
  },
123
123
  "devDependencies": {
124
- "@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.12.4",
125
- "@blockquote-web-components/blockquote-base-embedded-webview": "^1.13.10",
124
+ "@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.12.6",
125
+ "@blockquote-web-components/blockquote-base-embedded-webview": "^1.13.12",
126
126
  "lit": "^3.3.1"
127
127
  },
128
128
  "publishConfig": {
129
129
  "access": "public"
130
130
  },
131
131
  "customElements": "custom-elements.json",
132
- "gitHead": "a4f4bb25384f98b527af20f9fb94a77aa11b462d"
132
+ "gitHead": "f21ba4d9dc0f21f50eb164c105277027b03fc5b0"
133
133
  }
@@ -1,4 +1,5 @@
1
- const globalThisOrWindow = globalThis /* c8 ignore next */ || window;
1
+ /* c8 ignore next */
2
+ const globalThisOrWindow = globalThis || window;
2
3
 
3
4
  /**
4
5
  * Checks if the current environment supports adopting style sheets.
@@ -7,8 +8,7 @@ const globalThisOrWindow = globalThis /* c8 ignore next */ || window;
7
8
  const supportsAdoptingStyleSheets =
8
9
  globalThisOrWindow.ShadowRoot &&
9
10
  // @ts-ignore
10
- (globalThisOrWindow.ShadyCSS === undefined /* c8 ignore next */ ||
11
- globalThisOrWindow.ShadyCSS.nativeShadow) &&
11
+ (globalThisOrWindow.ShadyCSS === undefined || globalThisOrWindow.ShadyCSS.nativeShadow) &&
12
12
  'adoptedStyleSheets' in Document.prototype &&
13
13
  'replace' in CSSStyleSheet.prototype;
14
14
 
@@ -22,15 +22,15 @@ const renderDocumentRoot = supportsAdoptingStyleSheets
22
22
 
23
23
  /**
24
24
  * Flattens the styles array.
25
- * @param {Array} styles - The styles to flatten.
26
- * @returns {Array} The flattened styles.
25
+ * @param {Array<*>} styles - The styles to flatten.
26
+ * @returns {Array<*>} The flattened styles.
27
27
  */
28
28
  const flattenStyles = (styles) => (Array.isArray(styles) ? styles.flat(Infinity) : [styles]);
29
29
 
30
30
  /**
31
31
  * Adopts the given styles into the render root.
32
32
  * @param {Document | HTMLElement} renderRoot - The root element where styles will be rendered.
33
- * @param {Array} styles - The styles to adopt.
33
+ * @param {Array<*>} styles - The styles to adopt.
34
34
  */
35
35
  export const adoptDocumentStyles = (renderRoot, styles) => {
36
36
  if (supportsAdoptingStyleSheets) {
@@ -41,6 +41,7 @@ export const adoptDocumentStyles = (renderRoot, styles) => {
41
41
  ...styles.map((s) => (s instanceof CSSStyleSheet ? s : s.styleSheet)),
42
42
  ];
43
43
  } else {
44
+ /* c8 ignore next */
44
45
  styles.forEach((s) => {
45
46
  const style = document.createElement('style');
46
47
  style.textContent = s.cssText;