lisichatbot 1.1.3 ā 1.1.5
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 +33 -6
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -92,14 +92,40 @@ 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
|
+
console.log(`\nš Processing bot message - Step ${stepNumber || 'N/A'}, hasInput: ${hasInput}`);
|
|
98
|
+
|
|
97
99
|
const editIcon = clone.querySelector('[data-chat-element="bot-edit-icon"]');
|
|
98
100
|
if (editIcon) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
console.log(' ā Edit icon element found');
|
|
102
|
+
|
|
103
|
+
// ALWAYS hide first with !important to override any CSS
|
|
104
|
+
editIcon.style.setProperty('display', 'none', 'important');
|
|
105
|
+
console.log(' ā Edit icon hidden (display: none !important)');
|
|
106
|
+
|
|
107
|
+
// Only show if this step has input
|
|
108
|
+
if (hasInput && stepNumber !== null) {
|
|
109
|
+
editIcon.setAttribute('data-chat-step', stepNumber);
|
|
110
|
+
editIcon.onclick = (e) => {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
editStep(stepNumber);
|
|
113
|
+
};
|
|
114
|
+
editIcon.style.setProperty('display', 'inline', 'important');
|
|
115
|
+
console.log(` āļø Edit icon SHOWN (step ${stepNumber} has input)`);
|
|
116
|
+
} else {
|
|
117
|
+
console.log(` āŖ Edit icon HIDDEN (step ${stepNumber || 'N/A'} has no input)`);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
console.warn(' ā ļø Edit icon element not found in bot-message-wrapper!');
|
|
121
|
+
console.warn(' ā Make sure you have: <span data-chat-element="bot-edit-icon">āļø</span>');
|
|
102
122
|
}
|
|
123
|
+
|
|
124
|
+
// Ensure wrapper has correct flex properties for spacing
|
|
125
|
+
clone.style.setProperty('display', 'inline-flex', 'important');
|
|
126
|
+
clone.style.setProperty('align-items', 'center', 'important');
|
|
127
|
+
clone.style.setProperty('gap', '8px', 'important');
|
|
128
|
+
console.log(' ā Wrapper flex properties set (gap: 8px)');
|
|
103
129
|
}
|
|
104
130
|
|
|
105
131
|
// Make clone visible
|
|
@@ -708,6 +734,8 @@ function injectStyles() {
|
|
|
708
734
|
[data-chat-element="bot-message-wrapper"] {
|
|
709
735
|
margin-bottom: 16px;
|
|
710
736
|
display: inline-flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
gap: 8px;
|
|
711
739
|
max-width: 70%;
|
|
712
740
|
align-self: flex-start;
|
|
713
741
|
}
|
|
@@ -760,7 +788,6 @@ function injectStyles() {
|
|
|
760
788
|
|
|
761
789
|
/* Bot edit icon styling */
|
|
762
790
|
[data-chat-element="bot-edit-icon"] {
|
|
763
|
-
margin-left: 8px;
|
|
764
791
|
display: none;
|
|
765
792
|
cursor: pointer;
|
|
766
793
|
opacity: 0.6;
|