@pure-ds/core 0.3.4 → 0.3.5

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.
@@ -5651,19 +5651,17 @@ export const ${name}CSS = \`${escapedCSS}\`;
5651
5651
  /**
5652
5652
  * Static method to apply styles to document
5653
5653
  * Creates a link element with BLOB URL
5654
- * @param {Generator} generator - The Generator instance with generated styles
5654
+ * @param {Generator} [generator] - Optional Generator instance (defaults to singleton)
5655
5655
  */
5656
5656
  static applyStyles(generator) {
5657
- if (!generator || typeof generator !== "object") {
5658
- generator?.options?.log?.(
5659
- "error",
5660
- "[Generator] applyStyles requires a generator object"
5661
- );
5657
+ const target = generator || _Generator.instance;
5658
+ if (!target || typeof target !== "object") {
5659
+ console.error("[Generator] applyStyles requires a generator object or active singleton");
5662
5660
  return;
5663
5661
  }
5664
- const cssText = generator.layeredCSS || generator.css || "";
5662
+ const cssText = target.layeredCSS || target.css || "";
5665
5663
  if (!cssText) {
5666
- generator?.options?.log?.(
5664
+ target.options?.log?.(
5667
5665
  "warn",
5668
5666
  "[Generator] No CSS available on designer to apply"
5669
5667
  );
@@ -5765,9 +5763,6 @@ function createStylesheet(css) {
5765
5763
  sheet.replaceSync(css);
5766
5764
  return sheet;
5767
5765
  }
5768
- function isLiveMode() {
5769
- return registry.isLive;
5770
- }
5771
5766
 
5772
5767
  // src/js/pds-core/pds-config.js
5773
5768
  var presets = {
@@ -9481,7 +9476,7 @@ async function live(config2) {
9481
9476
  generatorConfig?.log?.("log", "PDS live with custom config");
9482
9477
  }
9483
9478
  if (applyGlobalStyles) {
9484
- await PDS2.Generator.applyStyles(generator);
9479
+ await PDS2.Generator.applyStyles();
9485
9480
  if (typeof window !== "undefined") {
9486
9481
  setTimeout(() => {
9487
9482
  const criticalStyle = document.head.querySelector(
@@ -9682,10 +9677,10 @@ async function setTheme(theme, options = {}) {
9682
9677
  if (currentGenerator && currentGenerator.configure) {
9683
9678
  const newConfig = { ...currentGenerator.config, theme: resolvedTheme };
9684
9679
  currentGenerator.configure(newConfig);
9685
- await PDS2.Generator.applyStyles(currentDesigner);
9680
+ await PDS2.Generator.applyStyles();
9686
9681
  }
9687
9682
  } catch (error) {
9688
- currentDesigner?.options?.log?.("warn", "Failed to update styles for new theme:", error);
9683
+ console.warn("Failed to update styles for new theme:", error);
9689
9684
  }
9690
9685
  }
9691
9686
  PDS2.dispatchEvent(