lisichatbot 1.9.9 → 2.0.0
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/package.json +1 -1
- package/src/index.js +5 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -35,6 +35,7 @@ let config = {
|
|
|
35
35
|
autoAdvanceDelay: 2000,
|
|
36
36
|
enableAnimations: true,
|
|
37
37
|
showCancelButton: false, // ✅ NEW: Control cancel button visibility
|
|
38
|
+
nextButtonText: null, // ✅ NEW: Global next button text (null = use original)
|
|
38
39
|
customRangeErrors: {
|
|
39
40
|
minRequired: 'Minimum value is required',
|
|
40
41
|
maxRequired: 'Maximum value is required',
|
|
@@ -3189,9 +3190,9 @@ async function showNextStep() {
|
|
|
3189
3190
|
// Step-level override takes highest priority
|
|
3190
3191
|
buttonText = nextStep.nextButtonText;
|
|
3191
3192
|
console.log(` 📝 Next button text: "${buttonText}" (step-level)`);
|
|
3192
|
-
} else if (
|
|
3193
|
+
} else if (config.nextButtonText) {
|
|
3193
3194
|
// Global config nextButtonText
|
|
3194
|
-
buttonText =
|
|
3195
|
+
buttonText = config.nextButtonText;
|
|
3195
3196
|
console.log(` 📝 Next button text: "${buttonText}" (global config)`);
|
|
3196
3197
|
} else {
|
|
3197
3198
|
// Fall back to original
|
|
@@ -3200,7 +3201,7 @@ async function showNextStep() {
|
|
|
3200
3201
|
}
|
|
3201
3202
|
|
|
3202
3203
|
nextBtnTextElement.textContent = buttonText;
|
|
3203
|
-
} else if (nextStep.nextButtonText ||
|
|
3204
|
+
} else if (nextStep.nextButtonText || config.nextButtonText) {
|
|
3204
3205
|
console.warn(` ⚠️ nextButtonText specified but next-button-text element not found`);
|
|
3205
3206
|
console.warn(' Add <span data-chat-element="next-button-text">Next</span> inside your next-button');
|
|
3206
3207
|
}
|
|
@@ -3322,7 +3323,7 @@ function init(flowName, flowConfig, options = {}) {
|
|
|
3322
3323
|
selectedBackground: config.selectedBackground,
|
|
3323
3324
|
autoAdvanceDelay: config.autoAdvanceDelay,
|
|
3324
3325
|
showCancelButton: config.showCancelButton,
|
|
3325
|
-
nextButtonText:
|
|
3326
|
+
nextButtonText: config.nextButtonText || 'not set',
|
|
3326
3327
|
customRangeErrors: config.customRangeErrors
|
|
3327
3328
|
});
|
|
3328
3329
|
|