lisichatbot 2.0.5 → 2.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -912,8 +912,16 @@ function renderCustomSelectOptions(options, field, customConfig) {
912
912
  }
913
913
  }
914
914
 
915
+ // ✅ NEW: Remove any existing options-wrapper for this field
916
+ const existingWrapper = elements.messages.querySelector(`[data-chat-element="options-wrapper"][data-field="${field}"]`);
917
+ if (existingWrapper) {
918
+ existingWrapper.remove();
919
+ console.log(` 🗑️ Removed existing options-wrapper for field: ${field}`);
920
+ }
921
+
915
922
  const optionsWrapper = document.createElement('div');
916
923
  optionsWrapper.setAttribute('data-chat-element', 'options-wrapper');
924
+ optionsWrapper.setAttribute('data-field', field); // ✅ Add field attribute for identification
917
925
  optionsWrapper.style.display = 'flex';
918
926
  optionsWrapper.style.flexDirection = 'row';
919
927
  optionsWrapper.style.flexWrap = 'wrap';
@@ -3625,6 +3633,13 @@ function goToStep(stepNumber) {
3625
3633
  chatState.step = stepNumber;
3626
3634
  chatState.currentSelection = null;
3627
3635
 
3636
+ // ✅ NEW: When editing, override disableInputValuePrefill for this step's field
3637
+ const targetStep = flowData.flow[stepNumber];
3638
+ if (targetStep?.input?.field && chatState.data[targetStep.input.field] !== undefined) {
3639
+ chatState.prefillOverrideFields = [targetStep.input.field];
3640
+ console.log(` 🔓 Set prefill override for field: ${targetStep.input.field}`);
3641
+ }
3642
+
3628
3643
  console.log(` Keeping messages visible (not clearing)...`);
3629
3644
 
3630
3645
  console.log(` Disabling next button and calling showNextStep()...`);