@vanduo-oss/framework 1.2.7 → 1.2.9

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/vanduo.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Vanduo v1.2.7 | Built: 2026-03-12T16:17:38.253Z | git:2c1277a | development */
1
+ /*! Vanduo v1.2.9 | Built: 2026-03-14T18:56:04.214Z | git:800b9f0 | development */
2
2
  (() => {
3
3
  // js/utils/lifecycle.js
4
4
  (function() {
@@ -107,7 +107,7 @@
107
107
  // js/vanduo.js
108
108
  (function() {
109
109
  "use strict";
110
- const VANDUO_VERSION = true ? "1.2.7" : "0.0.0-dev";
110
+ const VANDUO_VERSION = true ? "1.2.9" : "0.0.0-dev";
111
111
  const Vanduo2 = {
112
112
  version: VANDUO_VERSION,
113
113
  components: {},
@@ -3877,7 +3877,9 @@
3877
3877
  if (!this.THEME_MODES.includes(mode)) {
3878
3878
  mode = this.DEFAULTS.THEME;
3879
3879
  }
3880
- const oldDefault = this.getDefaultPrimary(this.state.theme);
3880
+ this._isApplying = true;
3881
+ const currentMode = this.state.theme;
3882
+ const oldDefault = this.getDefaultPrimary(currentMode);
3881
3883
  if (this.state.primary === oldDefault) {
3882
3884
  const newDefault = this.getDefaultPrimary(mode);
3883
3885
  if (newDefault !== this.state.primary) {
@@ -3893,10 +3895,17 @@
3893
3895
  this.savePreference(this.STORAGE_KEYS.THEME, mode);
3894
3896
  if (window.Vanduo && window.Vanduo.components.themeSwitcher) {
3895
3897
  const themeSwitcher = window.Vanduo.components.themeSwitcher;
3896
- if (themeSwitcher.state) {
3898
+ if (themeSwitcher.state && themeSwitcher.state.preference !== mode) {
3897
3899
  themeSwitcher.state.preference = mode;
3900
+ if (typeof themeSwitcher.setStorageValue === "function") {
3901
+ themeSwitcher.setStorageValue(themeSwitcher.STORAGE_KEY, mode);
3902
+ }
3903
+ if (typeof themeSwitcher.updateUI === "function") {
3904
+ themeSwitcher.updateUI();
3905
+ }
3898
3906
  }
3899
3907
  }
3908
+ this._isApplying = false;
3900
3909
  this.dispatchEvent("mode-change", { mode });
3901
3910
  },
3902
3911
  /**
@@ -4312,6 +4321,9 @@
4312
4321
  this.state.preference = pref;
4313
4322
  this.setStorageValue(this.STORAGE_KEY, pref);
4314
4323
  this.applyTheme();
4324
+ if (window.ThemeCustomizer && window.ThemeCustomizer.applyTheme && !window.ThemeCustomizer._isApplying) {
4325
+ window.ThemeCustomizer.applyTheme(pref);
4326
+ }
4315
4327
  this.updateUI();
4316
4328
  },
4317
4329
  getStorageValue: function(key, fallback) {