lisichatbot 1.1.8 → 1.1.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 +11 -8
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -110,15 +110,18 @@ function addMessage(content, type = 'bot', hasInput = false, stepNumber = null)
|
|
|
110
110
|
editIcon.style.setProperty('display', 'none', 'important');
|
|
111
111
|
console.log(' ✓ Edit icon hidden (display: none !important)');
|
|
112
112
|
|
|
113
|
-
// Only show if this step has input
|
|
114
|
-
if (hasInput && stepNumber !== null) {
|
|
113
|
+
// Only show if this step has input AND it's a PREVIOUS step (not current)
|
|
114
|
+
if (hasInput && stepNumber !== null && stepNumber < chatState.step) {
|
|
115
115
|
editIcon.setAttribute('data-chat-step', stepNumber);
|
|
116
116
|
editIcon.onclick = (e) => {
|
|
117
117
|
e.stopPropagation();
|
|
118
118
|
editStep(stepNumber);
|
|
119
119
|
};
|
|
120
120
|
editIcon.style.setProperty('display', 'block', 'important');
|
|
121
|
-
|
|
121
|
+
editIcon.style.setProperty('margin-left', '8px', 'important');
|
|
122
|
+
console.log(` ✏️ Edit icon SHOWN (step ${stepNumber} is previous step with input)`);
|
|
123
|
+
} else if (hasInput && stepNumber === chatState.step) {
|
|
124
|
+
console.log(` ⏸️ Edit icon HIDDEN (step ${stepNumber} is CURRENT step)`);
|
|
122
125
|
} else {
|
|
123
126
|
console.log(` ⚪ Edit icon HIDDEN (step ${stepNumber || 'N/A'} has no input)`);
|
|
124
127
|
}
|
|
@@ -146,15 +149,15 @@ function addMessage(content, type = 'bot', hasInput = false, stepNumber = null)
|
|
|
146
149
|
editIconAfterAppend.style.setProperty('display', 'none', 'important');
|
|
147
150
|
editIconAfterAppend.style.setProperty('margin-left', '8px', 'important');
|
|
148
151
|
|
|
149
|
-
// Only show if has input
|
|
150
|
-
if (hasInput && stepNumber !== null) {
|
|
151
|
-
editIconAfterAppend.style.setProperty('display', '
|
|
152
|
+
// Only show if has input AND it's a previous step
|
|
153
|
+
if (hasInput && stepNumber !== null && stepNumber < chatState.step) {
|
|
154
|
+
editIconAfterAppend.style.setProperty('display', 'block', 'important');
|
|
152
155
|
|
|
153
156
|
// Debug: Check spacing
|
|
154
157
|
setTimeout(() => {
|
|
155
158
|
const computedMargin = window.getComputedStyle(editIconAfterAppend).marginLeft;
|
|
156
|
-
const
|
|
157
|
-
console.log(` 📏
|
|
159
|
+
const computedDisplay = window.getComputedStyle(editIconAfterAppend).display;
|
|
160
|
+
console.log(` 📏 Edit icon - Display: ${computedDisplay}, Margin: ${computedMargin}`);
|
|
158
161
|
}, 100);
|
|
159
162
|
}
|
|
160
163
|
}
|