leanweb 3.10.1 → 3.10.2

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/commands/build.js CHANGED
@@ -54,7 +54,7 @@ const buildModule = (projectPath) => {
54
54
  imports.push(url);
55
55
  return '';
56
56
  });
57
- const jsModule = `const sheet = new CSSStyleSheet();\nsheet.replaceSync(${JSON.stringify(inlineCss)});\nglobalThis.__lw_globalStyleSheet = sheet;\nglobalThis.__lw_globalStyleImports = ${JSON.stringify(imports)};\n`;
57
+ const jsModule = `globalThis.leanweb = globalThis.leanweb ?? {};\nconst sheet = new CSSStyleSheet();\nsheet.replaceSync(${JSON.stringify(inlineCss)});\nglobalThis.leanweb.__lw_globalStyleSheet = sheet;\nglobalThis.leanweb.__lw_globalStyleImports = ${JSON.stringify(imports)};\n`;
58
58
  utils.writeIfChanged(`${utils.dirs.build}/global-styles.js`, jsModule);
59
59
  };
60
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "3.10.1",
3
+ "version": "3.10.2",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -110,8 +110,8 @@ export default class LWElement extends HTMLElement {
110
110
  componentSheet.replaceSync(ast.css);
111
111
  node.innerHTML = ast.html;
112
112
  this.attachShadow({ mode: 'open' }).appendChild(node.content);
113
- this.shadowRoot.adoptedStyleSheets = [globalThis.__lw_globalStyleSheet, componentSheet];
114
- globalThis.__lw_globalStyleImports?.forEach(url => {
113
+ this.shadowRoot.adoptedStyleSheets = [globalThis.leanweb.__lw_globalStyleSheet, componentSheet];
114
+ globalThis.leanweb.__lw_globalStyleImports?.forEach(url => {
115
115
  const link = document.createElement('link');
116
116
  link.rel = 'stylesheet';
117
117
  link.href = url;