@skyvexsoftware/stratos-sdk 0.1.15 → 0.2.0

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.
@@ -30,12 +30,13 @@ export function cssInject() {
30
30
  const jsEntry = Object.values(bundle).find((chunk) => chunk.type === "chunk" && chunk.isEntry);
31
31
  if (!jsEntry || jsEntry.type !== "chunk")
32
32
  return;
33
- // Prepend CSS injection code to the JS entry
33
+ // Export the CSS as __STRATOS_PLUGIN_CSS__ so the shell's PluginHost
34
+ // can inject it into <head> wrapped in @layer plugin on mount.
34
35
  const escaped = cssContent
35
36
  .replace(/\\/g, "\\\\")
36
37
  .replace(/`/g, "\\`")
37
38
  .replace(/\$/g, "\\$");
38
- const injection = `(function(){try{var s=document.createElement("style");s.textContent=\`${escaped}\`;document.head.appendChild(s)}catch(e){}})();\n`;
39
+ const injection = `export const __STRATOS_PLUGIN_CSS__ = \`${escaped}\`;\n`;
39
40
  jsEntry.code = injection + jsEntry.code;
40
41
  // Remove the separate CSS files
41
42
  for (const name of cssAssets) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyvexsoftware/stratos-sdk",
3
- "version": "0.1.15",
3
+ "version": "0.2.0",
4
4
  "description": "Plugin SDK for Stratos — types, hooks, and UI components",
5
5
  "author": {
6
6
  "name": "Skyvex Software",