lisichatbot 2.0.7 → 2.0.8

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 +16 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/index.js CHANGED
@@ -900,7 +900,15 @@ function renderCustomSelectOptions(options, field, customConfig) {
900
900
  const hasOverride = chatState.prefillOverrideFields && chatState.prefillOverrideFields.includes(field);
901
901
  const disablePrefill = currentStep?.disableInputValuePrefill === true && !hasOverride;
902
902
 
903
+ console.log(`\nšŸ” === PREFILL DEBUG for field: ${field} ===`);
904
+ console.log(` disableInputValuePrefill:`, currentStep?.disableInputValuePrefill);
905
+ console.log(` prefillOverrideFields:`, chatState.prefillOverrideFields);
906
+ console.log(` hasOverride:`, hasOverride);
907
+ console.log(` disablePrefill:`, disablePrefill);
908
+ console.log(` chatState.data[${field}]:`, chatState.data[field]);
909
+
903
910
  const existingData = disablePrefill ? null : chatState.data[field];
911
+ console.log(` āœ… existingData:`, existingData);
904
912
 
905
913
  if (disablePrefill) {
906
914
  console.log(`ā­ļø Pre-fill disabled for ${field} (custom) - starting fresh`);
@@ -944,15 +952,17 @@ function renderCustomSelectOptions(options, field, customConfig) {
944
952
  const shouldBeChecked = existingData !== undefined &&
945
953
  JSON.stringify(existingData) === JSON.stringify(optionValue);
946
954
 
955
+ console.log(` šŸ” Option "${optionName}": existingData=${JSON.stringify(existingData)} vs optionValue=${JSON.stringify(optionValue)} → shouldBeChecked=${shouldBeChecked}`);
956
+
947
957
  if (shouldBeChecked) {
948
958
  clone.classList.add('cf-checked');
949
- clone.style.backgroundColor = config.selectedBackground;
959
+ clone.style.setProperty('background-color', config.selectedBackground, 'important'); // āœ… Use !important
950
960
  console.log(` āœ… Pre-selected: ${optionName}`);
951
961
  hasPreselectedOption = true; // āœ… Mark that we have a pre-selection
952
962
  hasMatchingNormalOption = true; // āœ… A normal option matched
953
963
  } else {
954
964
  clone.classList.remove('cf-checked');
955
- clone.style.backgroundColor = 'transparent';
965
+ clone.style.setProperty('background-color', 'transparent', 'important'); // āœ… Use !important
956
966
  }
957
967
 
958
968
  clone.setAttribute('data-chat-element', 'single-select-input');
@@ -971,7 +981,7 @@ function renderCustomSelectOptions(options, field, customConfig) {
971
981
 
972
982
  const tickIcon = clone.querySelector('[data-chat-input-element="tick-icon"]');
973
983
  if (tickIcon) {
974
- tickIcon.style.display = shouldBeChecked ? 'block' : 'none';
984
+ tickIcon.style.setProperty('display', shouldBeChecked ? 'block' : 'none', 'important'); // āœ… Use !important
975
985
  }
976
986
 
977
987
  const textElement = clone.querySelector('[data-chat-input-element="text"]');
@@ -994,12 +1004,12 @@ function renderCustomSelectOptions(options, field, customConfig) {
994
1004
 
995
1005
  if (isCustomSelected) {
996
1006
  customClone.classList.add('cf-checked');
997
- customClone.style.backgroundColor = config.selectedBackground;
1007
+ customClone.style.setProperty('background-color', config.selectedBackground, 'important'); // āœ… Use !important
998
1008
  console.log(` āœ… Pre-selected: Custom Range [${existingData[0]}, ${existingData[1]}]`);
999
1009
  hasPreselectedOption = true; // āœ… Mark that custom is pre-selected
1000
1010
  } else {
1001
1011
  customClone.classList.remove('cf-checked');
1002
- customClone.style.backgroundColor = 'transparent';
1012
+ customClone.style.setProperty('background-color', 'transparent', 'important'); // āœ… Use !important
1003
1013
  }
1004
1014
 
1005
1015
  customClone.setAttribute('data-chat-element', 'single-select-input');
@@ -1017,7 +1027,7 @@ function renderCustomSelectOptions(options, field, customConfig) {
1017
1027
 
1018
1028
  const customTickIcon = customClone.querySelector('[data-chat-input-element="tick-icon"]');
1019
1029
  if (customTickIcon) {
1020
- customTickIcon.style.display = isCustomSelected ? 'block' : 'none';
1030
+ customTickIcon.style.setProperty('display', isCustomSelected ? 'block' : 'none', 'important'); // āœ… Use !important
1021
1031
  }
1022
1032
 
1023
1033
  const customTextElement = customClone.querySelector('[data-chat-input-element="text"]');