lisichatbot 1.1.5 → 1.1.6
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 +31 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -78,6 +78,12 @@ function addMessage(content, type = 'bot', hasInput = false, stepNumber = null)
|
|
|
78
78
|
|
|
79
79
|
// Clone the existing wrapper
|
|
80
80
|
const clone = existingWrapper.cloneNode(true);
|
|
81
|
+
|
|
82
|
+
// Immediately hide any edit icons in the clone (regardless of template state)
|
|
83
|
+
const allEditIcons = clone.querySelectorAll('[data-chat-element="bot-edit-icon"]');
|
|
84
|
+
allEditIcons.forEach(icon => {
|
|
85
|
+
icon.style.setProperty('display', 'none', 'important');
|
|
86
|
+
});
|
|
81
87
|
|
|
82
88
|
// Add step number if provided
|
|
83
89
|
if (stepNumber !== null) {
|
|
@@ -133,6 +139,30 @@ function addMessage(content, type = 'bot', hasInput = false, stepNumber = null)
|
|
|
133
139
|
|
|
134
140
|
// Append to messages container
|
|
135
141
|
elements.messages.appendChild(clone);
|
|
142
|
+
|
|
143
|
+
// IMPORTANT: Set edit icon display AFTER appending to DOM
|
|
144
|
+
// This ensures our styles override any CSS rules
|
|
145
|
+
if (type === 'bot') {
|
|
146
|
+
const editIconAfterAppend = clone.querySelector('[data-chat-element="bot-edit-icon"]');
|
|
147
|
+
if (editIconAfterAppend) {
|
|
148
|
+
// Force hide with !important AFTER append
|
|
149
|
+
editIconAfterAppend.style.setProperty('display', 'none', 'important');
|
|
150
|
+
editIconAfterAppend.style.setProperty('margin-left', '8px', 'important');
|
|
151
|
+
|
|
152
|
+
// Only show if has input
|
|
153
|
+
if (hasInput && stepNumber !== null) {
|
|
154
|
+
editIconAfterAppend.style.setProperty('display', 'inline', 'important');
|
|
155
|
+
|
|
156
|
+
// Debug: Check spacing
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
const computedMargin = window.getComputedStyle(editIconAfterAppend).marginLeft;
|
|
159
|
+
const computedGap = window.getComputedStyle(clone).gap;
|
|
160
|
+
console.log(` 📏 Spacing check - Margin: ${computedMargin}, Gap: ${computedGap}`);
|
|
161
|
+
}, 100);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
136
166
|
scrollToBottom();
|
|
137
167
|
}
|
|
138
168
|
|
|
@@ -789,6 +819,7 @@ function injectStyles() {
|
|
|
789
819
|
/* Bot edit icon styling */
|
|
790
820
|
[data-chat-element="bot-edit-icon"] {
|
|
791
821
|
display: none;
|
|
822
|
+
margin-left: 8px !important;
|
|
792
823
|
cursor: pointer;
|
|
793
824
|
opacity: 0.6;
|
|
794
825
|
transition: opacity 0.2s ease;
|