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