lisichatbot 1.1.3 → 1.1.4
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 +21 -6
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -92,13 +92,27 @@ function addMessage(content, type = 'bot', hasInput = false, stepNumber = null)
|
|
|
92
92
|
console.error(`Element with data-chat-element="${type}-message-text" not found in wrapper`);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
// Handle edit icon for bot messages
|
|
96
|
-
if (type === 'bot'
|
|
95
|
+
// Handle edit icon for bot messages
|
|
96
|
+
if (type === 'bot') {
|
|
97
97
|
const editIcon = clone.querySelector('[data-chat-element="bot-edit-icon"]');
|
|
98
98
|
if (editIcon) {
|
|
99
|
-
|
|
100
|
-
editIcon.
|
|
101
|
-
|
|
99
|
+
// Always hide first
|
|
100
|
+
editIcon.style.display = 'none';
|
|
101
|
+
|
|
102
|
+
// Only show if this step has input
|
|
103
|
+
if (hasInput && stepNumber !== null) {
|
|
104
|
+
editIcon.setAttribute('data-chat-step', stepNumber);
|
|
105
|
+
editIcon.onclick = (e) => {
|
|
106
|
+
e.stopPropagation();
|
|
107
|
+
editStep(stepNumber);
|
|
108
|
+
};
|
|
109
|
+
editIcon.style.display = 'inline';
|
|
110
|
+
console.log(`✏️ Edit icon shown for step ${stepNumber} (has input)`);
|
|
111
|
+
} else {
|
|
112
|
+
console.log(`⚪ Edit icon hidden for step ${stepNumber} (no input)`);
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
console.warn('⚠️ Edit icon element not found in bot-message-wrapper');
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
@@ -708,6 +722,8 @@ function injectStyles() {
|
|
|
708
722
|
[data-chat-element="bot-message-wrapper"] {
|
|
709
723
|
margin-bottom: 16px;
|
|
710
724
|
display: inline-flex;
|
|
725
|
+
align-items: center;
|
|
726
|
+
gap: 8px;
|
|
711
727
|
max-width: 70%;
|
|
712
728
|
align-self: flex-start;
|
|
713
729
|
}
|
|
@@ -760,7 +776,6 @@ function injectStyles() {
|
|
|
760
776
|
|
|
761
777
|
/* Bot edit icon styling */
|
|
762
778
|
[data-chat-element="bot-edit-icon"] {
|
|
763
|
-
margin-left: 8px;
|
|
764
779
|
display: none;
|
|
765
780
|
cursor: pointer;
|
|
766
781
|
opacity: 0.6;
|