@kodaris/krubble-app-components 1.0.149 → 1.0.151

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.
@@ -3799,6 +3799,12 @@
3799
3799
  }
3800
3800
  catch { /* sessionStorage not available */ }
3801
3801
  }
3802
+ /**
3803
+ * The floating widget and inline embeds persist to separate localStorage keys so
3804
+ * they can't clobber each other — an inline chat is always `opened`, and writing
3805
+ * that into the floating widget's state would pop its panel open on the next
3806
+ * page. Floating keeps the original key so existing saved layouts survive.
3807
+ */
3802
3808
  _saveState() {
3803
3809
  try {
3804
3810
  // `toolDetail` is a transient peek, not a saved view — persist only the two
@@ -3836,13 +3842,21 @@
3836
3842
  state.position = s.position;
3837
3843
  }
3838
3844
  }
3839
- localStorage.setItem('kr-chatbot-state', JSON.stringify(state));
3845
+ let storageKey = 'kr-chatbot-state';
3846
+ if (this.variant === 'inline') {
3847
+ storageKey = 'kr-chatbot-state-inline';
3848
+ }
3849
+ localStorage.setItem(storageKey, JSON.stringify(state));
3840
3850
  }
3841
3851
  catch { /* localStorage not available */ }
3842
3852
  }
3843
3853
  _restoreState() {
3844
3854
  try {
3845
- const raw = localStorage.getItem('kr-chatbot-state');
3855
+ let storageKey = 'kr-chatbot-state';
3856
+ if (this.variant === 'inline') {
3857
+ storageKey = 'kr-chatbot-state-inline';
3858
+ }
3859
+ const raw = localStorage.getItem(storageKey);
3846
3860
  if (!raw) {
3847
3861
  return;
3848
3862
  }
@@ -3887,7 +3901,11 @@
3887
3901
  }
3888
3902
  _applyStoredLayout() {
3889
3903
  try {
3890
- const raw = localStorage.getItem('kr-chatbot-state');
3904
+ let storageKey = 'kr-chatbot-state';
3905
+ if (this.variant === 'inline') {
3906
+ storageKey = 'kr-chatbot-state-inline';
3907
+ }
3908
+ const raw = localStorage.getItem(storageKey);
3891
3909
  if (!raw || !this._panelEl) {
3892
3910
  return;
3893
3911
  }