lisichatbot 1.9.8 → 1.9.9
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 +18 -6
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3182,15 +3182,26 @@ async function showNextStep() {
|
|
|
3182
3182
|
const nextBtnTextElement = elements.nextBtn.querySelector('[data-chat-element="next-button-text"]');
|
|
3183
3183
|
|
|
3184
3184
|
if (nextBtnTextElement) {
|
|
3185
|
+
// ✅ Priority: step-level > global config > original
|
|
3186
|
+
let buttonText;
|
|
3187
|
+
|
|
3185
3188
|
if (nextStep.nextButtonText) {
|
|
3186
|
-
|
|
3187
|
-
|
|
3189
|
+
// Step-level override takes highest priority
|
|
3190
|
+
buttonText = nextStep.nextButtonText;
|
|
3191
|
+
console.log(` 📝 Next button text: "${buttonText}" (step-level)`);
|
|
3192
|
+
} else if (flowData.nextButtonText) {
|
|
3193
|
+
// Global config nextButtonText
|
|
3194
|
+
buttonText = flowData.nextButtonText;
|
|
3195
|
+
console.log(` 📝 Next button text: "${buttonText}" (global config)`);
|
|
3188
3196
|
} else {
|
|
3189
|
-
|
|
3190
|
-
|
|
3197
|
+
// Fall back to original
|
|
3198
|
+
buttonText = elements.originalNextBtnText;
|
|
3199
|
+
console.log(` 📝 Next button text: "${buttonText}" (original)`);
|
|
3191
3200
|
}
|
|
3192
|
-
|
|
3193
|
-
|
|
3201
|
+
|
|
3202
|
+
nextBtnTextElement.textContent = buttonText;
|
|
3203
|
+
} else if (nextStep.nextButtonText || flowData.nextButtonText) {
|
|
3204
|
+
console.warn(` ⚠️ nextButtonText specified but next-button-text element not found`);
|
|
3194
3205
|
console.warn(' Add <span data-chat-element="next-button-text">Next</span> inside your next-button');
|
|
3195
3206
|
}
|
|
3196
3207
|
}
|
|
@@ -3311,6 +3322,7 @@ function init(flowName, flowConfig, options = {}) {
|
|
|
3311
3322
|
selectedBackground: config.selectedBackground,
|
|
3312
3323
|
autoAdvanceDelay: config.autoAdvanceDelay,
|
|
3313
3324
|
showCancelButton: config.showCancelButton,
|
|
3325
|
+
nextButtonText: flowConfig.nextButtonText || 'not set',
|
|
3314
3326
|
customRangeErrors: config.customRangeErrors
|
|
3315
3327
|
});
|
|
3316
3328
|
|