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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +33 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisichatbot",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
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 with input
96
- if (type === 'bot' && hasInput && stepNumber !== null) {
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
- editIcon.setAttribute('data-chat-step', stepNumber);
100
- editIcon.onclick = () => editStep(stepNumber);
101
- editIcon.style.display = 'inline-block';
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;