@developpement/tp-chatbot-widget 0.0.12 → 0.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developpement/tp-chatbot-widget",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Chatbot widget for TravelPlanet / Makitizy",
5
5
  "main": "src/chatbot.js",
6
6
  "files": [
package/src/chatbot.css CHANGED
@@ -50,11 +50,7 @@
50
50
  transition: all 0.25s ease;
51
51
  }
52
52
 
53
- .tp-chatbot-window.open {
54
- opacity: 1;
55
- transform: translateY(0) scale(1);
56
- pointer-events: all;
57
- }
53
+ .tp-chatbot-window.open { opacity: 1; visibility: visible; transform: scale(1) translateY(0); pointer-events: all; }
58
54
 
59
55
  /* ─── Header ─────────────────────────────────────────────────────────────── */
60
56
 
package/src/chatbot.js CHANGED
@@ -37,8 +37,8 @@
37
37
  style.textContent = `
38
38
  tp-chatbot * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
39
39
  .tp-chatbot-host { position: fixed; bottom: 24px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; width: 380px; }
40
- .tp-chatbot-window { position: absolute; bottom: 72px; left: 0; right: auto; width: 380px; height: 580px; background: #fff; border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.14); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: scale(0.92) translateY(12px); pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease; }
41
- .tp-chatbot-window.open { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }
40
+ .tp-chatbot-window { position: absolute; bottom: 72px; left: 0; right: auto; width: 380px; height: 580px; background: #fff; border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.14); display: none; flex-direction: column; overflow: hidden; opacity: 0; transform: scale(0.92) translateY(12px); pointer-events: none; z-index: 9999; transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease; }
41
+ .tp-chatbot-window.open { opacity: 1; visibility: visible; transform: scale(1) translateY(0); pointer-events: all; }
42
42
  .tp-chatbot-bubble { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.18s, box-shadow 0.18s; margin-left: auto; flex-shrink: 0; }
43
43
  .tp-chatbot-bubble:hover { transform: scale(1.07); }
44
44
  .tp-header { padding: 14px 16px 0; color: white; }
@@ -939,23 +939,25 @@
939
939
  }
940
940
 
941
941
  toggleChat() {
942
- this.is_open = !this.is_open;
943
- const window_el = this.querySelector('#tp-window'),
944
- bubble = this.querySelector('#tp-bubble');
945
- if (this.is_open) {
946
- window_el.classList.add('open');
947
- bubble.innerHTML = icon('close', 22, 'color:white');
948
- if (this.is_minimized) {
949
- this.is_minimized = false;
950
- window_el.style.height = WINDOW_HEIGHT;
951
- window_el.style.overflow = 'hidden';
952
- }
953
- } else {
954
- window_el.classList.remove('open');
955
- bubble.innerHTML = icon('msg', 22, 'color:white');
956
- if (this.is_fullscreen) this.exitFullscreen(true);
957
- }
942
+ this.is_open = !this.is_open;
943
+ const window_el = this.querySelector('#tp-window');
944
+ const bubble = this.querySelector('#tp-bubble');
945
+ if (this.is_open) {
946
+ window_el.style.display = 'flex';
947
+ setTimeout(() => window_el.classList.add('open'), 10);
948
+ bubble.innerHTML = icon('close', 22, 'color:white');
949
+ if (this.is_minimized) {
950
+ this.is_minimized = false;
951
+ window_el.style.height = WINDOW_HEIGHT;
952
+ window_el.style.overflow = 'hidden';
958
953
  }
954
+ } else {
955
+ window_el.classList.remove('open');
956
+ setTimeout(() => { window_el.style.display = 'none'; }, 250);
957
+ bubble.innerHTML = icon('msg', 22, 'color:white');
958
+ if (this.is_fullscreen) this.exitFullscreen(true);
959
+ }
960
+ }
959
961
 
960
962
  getHeaders(content_type = false) {
961
963
  const headers = {};