@docgenlab.com/chat-widget 0.2.4 → 0.5.1

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/dist/types.d.ts CHANGED
@@ -66,6 +66,24 @@ export interface ChatWidgetConfig {
66
66
  * — without it, your customer chats are still anonymous-attributed.
67
67
  */
68
68
  endUserHash?: string;
69
+ /**
70
+ * End-user's email — used to pre-fill the support-ticket form when the
71
+ * user clicks "Raise a ticket" on a refusal message. The user can still
72
+ * edit it before submitting. Recommended for authenticated SaaS flows
73
+ * so the user doesn't have to re-type their address.
74
+ */
75
+ endUserEmail?: string;
76
+ /**
77
+ * End-user's phone — same idea as endUserEmail but for SMS-first support
78
+ * workflows. Optional everywhere.
79
+ */
80
+ endUserPhone?: string;
81
+ /**
82
+ * Disable the in-widget "Raise a ticket" flow entirely (even when the
83
+ * org has a configured connector). Useful for embeds where ticket
84
+ * creation isn't desired. Default: false (offering is allowed).
85
+ */
86
+ disableTicketing?: boolean;
69
87
  }
70
88
  export interface Citation {
71
89
  chunk_id: string;
@@ -108,17 +126,57 @@ export type StreamEvent = {
108
126
  } | {
109
127
  type: 'refused';
110
128
  content: string;
129
+ } | {
130
+ type: 'ticket_offer';
131
+ conversation_id: string;
132
+ connector_type: string;
133
+ connector_name: string;
134
+ } | {
135
+ type: 'ticket_existing';
136
+ ticket_id: string;
137
+ external_ticket_number: string | null;
138
+ external_url: string | null;
139
+ status: string;
140
+ } | {
141
+ type: 'ticket_status_card';
142
+ ticket_id: string;
143
+ external_number: string | null;
144
+ external_url: string | null;
145
+ status: string;
146
+ title: string;
147
+ priority: string;
148
+ last_update: string | null;
149
+ assigned_to: string | null;
150
+ created_at: string | null;
111
151
  } | {
112
152
  type: 'done';
113
153
  message_id?: string;
114
154
  cache_hit?: boolean;
115
155
  refused?: boolean;
116
156
  model?: string;
157
+ ticket_id?: string;
117
158
  } | {
118
159
  type: 'error';
119
160
  error: string;
120
161
  code?: string;
121
162
  };
163
+ /** Returned by POST /public/kb/conversations/{id}/raise-ticket and
164
+ * GET /public/kb/tickets. Same shape as the dashboard's KbTicket. */
165
+ export interface TicketRef {
166
+ id: string;
167
+ conversation_id?: string;
168
+ agent_id?: string;
169
+ external_ticket_id?: string | null;
170
+ external_ticket_number: string | null;
171
+ external_url: string | null;
172
+ status: string;
173
+ title: string;
174
+ priority: string;
175
+ end_user_email?: string | null;
176
+ created_at?: string;
177
+ last_synced_at?: string | null;
178
+ extra_meta?: Record<string, any>;
179
+ }
122
180
  export interface AgentInfo {
123
181
  id: string;
124
182
  name: string;
@@ -136,4 +194,38 @@ export interface ChatMessage {
136
194
  streaming?: boolean;
137
195
  refused?: boolean;
138
196
  cacheHit?: boolean;
197
+ /** Set when the backend emits ticket_offer on this turn. Widget renders
198
+ * a "Raise a ticket" chip alongside the refusal bubble. */
199
+ ticketOffer?: {
200
+ conversationId: string;
201
+ connectorType: string;
202
+ connectorName: string;
203
+ };
204
+ /** Set after the user successfully raised a ticket from this turn. */
205
+ ticketCreated?: {
206
+ id: string;
207
+ externalNumber: string | null;
208
+ externalUrl: string | null;
209
+ };
210
+ /** Set when the conversation already has an open ticket and the user
211
+ * is signalling dissatisfaction. Renders a reassurance card. */
212
+ ticketExisting?: {
213
+ ticketId: string;
214
+ externalNumber: string | null;
215
+ externalUrl: string | null;
216
+ status: string;
217
+ };
218
+ /** Set when the user asked "what's my ticket status?" — replaces the
219
+ * streamed text reply with a rich Jira-style card. */
220
+ ticketStatus?: {
221
+ ticketId: string;
222
+ externalNumber: string | null;
223
+ externalUrl: string | null;
224
+ status: string;
225
+ title: string;
226
+ priority: string;
227
+ lastUpdate: string | null;
228
+ assignedTo: string | null;
229
+ createdAt: string | null;
230
+ };
139
231
  }
package/dist/widget.css CHANGED
@@ -1 +1 @@
1
- .dgl-root{position:fixed;z-index:2147483000;bottom:20px;font-family:var(--dgl-font);color-scheme:light;--dgl-bg: #ffffff;--dgl-fg: #1f2937;--dgl-muted: #6b7280;--dgl-border: #e5e7eb;--dgl-bubble-assistant: #f3f4f6}.dgl-pos-bottom-right{right:20px}.dgl-pos-bottom-left{left:20px}.dgl-launcher{background:var(--dgl-primary);color:var(--dgl-primary-text);border:none;width:56px;height:56px;border-radius:50%;cursor:pointer;box-shadow:0 6px 20px #0000002e,0 0 color-mix(in srgb,var(--dgl-primary) 40%,transparent);display:flex;align-items:center;justify-content:center;overflow:hidden;transition:transform .18s cubic-bezier(.34,1.56,.64,1),box-shadow .18s ease;animation:dgl-launcher-pulse 2.4s ease-in-out infinite}@keyframes dgl-launcher-pulse{0%,to{box-shadow:0 6px 20px #0000002e,0 0 color-mix(in srgb,var(--dgl-primary) 40%,transparent)}50%{box-shadow:0 6px 20px #0000002e,0 0 0 10px color-mix(in srgb,var(--dgl-primary) 0%,transparent)}}.dgl-launcher:hover{transform:scale(1.08) translateY(-2px);box-shadow:0 12px 28px #00000040,0 0 0 6px color-mix(in srgb,var(--dgl-primary) 25%,transparent);animation:none}.dgl-launcher:active{transform:scale(.96)}.dgl-launcher:focus-visible{outline:3px solid color-mix(in srgb,var(--dgl-primary) 50%,transparent);outline-offset:2px}.dgl-launcher-avatar{width:100%;height:100%;object-fit:cover;border-radius:50%}.dgl-panel{position:absolute;bottom:72px;width:380px;height:min(720px,85dvh);max-height:calc(100dvh - 32px);background:var(--dgl-bg);color:var(--dgl-fg);border:1px solid var(--dgl-border);border-radius:var(--dgl-radius);box-shadow:0 20px 50px #0003;display:flex;flex-direction:column;overflow:hidden;animation:dgl-pop .18s ease-out;transition:width .22s ease,height .22s ease;text-align:left}.dgl-panel.dgl-panel-expanded{width:min(720px,calc(100vw - 32px));height:min(900px,calc(100dvh - 48px));max-height:calc(100dvh - 32px)}.dgl-hide-on-mobile{display:flex}@media (max-width: 480px){.dgl-hide-on-mobile{display:none}}.dgl-pos-bottom-right .dgl-panel{right:0}.dgl-pos-bottom-left .dgl-panel{left:0}@keyframes dgl-pop{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dgl-header{background:var(--dgl-primary);color:var(--dgl-primary-text);padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:8px}.dgl-header-info{display:flex;align-items:center;gap:10px;min-width:0}.dgl-header-text{min-width:0}.dgl-title{font-weight:600;font-size:14px;line-height:1.2}.dgl-subtitle{font-size:11px;opacity:.85;margin-top:2px}.dgl-header-actions{display:flex;gap:4px}.dgl-avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;flex-shrink:0}.dgl-avatar-fallback{background:#fff3;color:var(--dgl-primary-text);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}.dgl-avatar-fallback-light{background:color-mix(in srgb,var(--dgl-primary) 14%,transparent);color:var(--dgl-primary)}.dgl-icon-btn{background:transparent;border:none;color:inherit;width:28px;height:28px;border-radius:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.85;transition:background .12s ease,opacity .12s ease}.dgl-icon-btn:hover{background:#0000000f;opacity:1}.dgl-icon-btn:disabled{cursor:not-allowed;opacity:.4}.dgl-header .dgl-icon-btn:hover{background:#ffffff26}.dgl-messages{flex:1;overflow-y:auto;padding:14px;background:#fafbfc;display:flex;flex-direction:column;gap:10px}.dgl-empty{margin:auto 0;text-align:center;color:var(--dgl-muted);padding:24px 20px;display:flex;flex-direction:column;align-items:center;gap:8px}.dgl-empty-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--dgl-primary) 18%,white);color:var(--dgl-primary);display:flex;align-items:center;justify-content:center;margin-bottom:4px}.dgl-empty-icon svg{width:22px;height:22px}.dgl-empty-text{font-size:15px;font-weight:600;color:var(--dgl-fg);line-height:1.3}.dgl-empty-sub{font-size:12.5px;line-height:1.5;max-width:280px}.dgl-error{margin:auto 0;text-align:center;color:#b91c1c;background:#fee2e2;padding:10px;border-radius:8px;font-size:12px}.dgl-msg{display:flex;gap:8px;animation:dgl-msg-in .22s ease-out}@keyframes dgl-msg-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.dgl-msg-user{justify-content:flex-end}.dgl-msg-assistant{justify-content:flex-start}.dgl-msg-assistant .dgl-avatar{width:26px;height:26px;align-self:flex-start;margin-top:2px}.dgl-msg-body{flex:1;min-width:0;max-width:88%}.dgl-bubble{padding:9px 12px;border-radius:14px;font-size:13.5px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}.dgl-bubble-user{background:var(--dgl-primary);color:var(--dgl-primary-text);border-bottom-right-radius:4px;max-width:78%}.dgl-assistant-text{color:var(--dgl-fg);font-size:13.5px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}.dgl-refused{background:#fef3c7;border:1px solid #fde68a;color:#92400e;padding:8px 12px;border-radius:12px;font-size:13px}.dgl-user-image-link{display:block;margin-bottom:6px}.dgl-user-image{max-width:100%;max-height:200px;border-radius:8px;border:1px solid rgba(255,255,255,.2);background:#ffffff1a;object-fit:contain}.dgl-typing-cursor{color:var(--dgl-muted);animation:dgl-blink 1s steps(2) infinite}@keyframes dgl-blink{50%{opacity:0}}.dgl-thinking{display:inline-flex;gap:4px;align-items:center;padding:6px 0}.dgl-thinking-dot{width:6px;height:6px;border-radius:50%;background:var(--dgl-muted);animation:dgl-bounce 1.2s infinite ease-in-out}.dgl-thinking-dot:nth-child(2){animation-delay:.15s}.dgl-thinking-dot:nth-child(3){animation-delay:.3s}@keyframes dgl-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dgl-md-p{margin:6px 0;line-height:1.55;word-wrap:break-word}.dgl-md-p:first-child{margin-top:0}.dgl-md-p:last-child{margin-bottom:0}.dgl-md-list{margin:6px 0;padding-left:20px}.dgl-md-list li{margin:3px 0;line-height:1.5}.dgl-md-ul{list-style:disc}.dgl-md-ol{list-style:decimal}.dgl-md-code{background:#f3f4f6;color:#1f2937;padding:1px 5px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px}.dgl-md-link{color:var(--dgl-primary);text-decoration:underline}.dgl-citations{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;align-items:flex-start}.dgl-citation-wrap{position:relative}.dgl-citation{font-size:10.5px;background:color-mix(in srgb,var(--dgl-primary) 8%,white);color:color-mix(in srgb,var(--dgl-primary) 80%,#1f2937);padding:3px 9px;border-radius:999px;border:1px solid color-mix(in srgb,var(--dgl-primary) 22%,white);cursor:pointer;font-family:inherit;transition:background .12s ease,border-color .12s ease,transform .08s ease;display:inline-flex;align-items:center;gap:3px}.dgl-citation:hover{background:color-mix(in srgb,var(--dgl-primary) 16%,white);border-color:color-mix(in srgb,var(--dgl-primary) 36%,white)}.dgl-citation:active{transform:scale(.97)}.dgl-citation-open{background:color-mix(in srgb,var(--dgl-primary) 20%,white);border-color:color-mix(in srgb,var(--dgl-primary) 45%,white)}.dgl-citation-icon{font-size:8px;opacity:.65}.dgl-citation-stamp{opacity:.7;font-weight:500}.dgl-citation-more{font-size:10.5px;color:var(--dgl-muted);font-style:italic;padding:3px 4px;align-self:center}.dgl-citation-popover{margin-top:6px;width:100%;background:#fff;border:1px solid var(--dgl-border);border-radius:10px;padding:8px;box-shadow:0 4px 16px #0000000f;animation:dgl-pop .14s ease-out}.dgl-citation-frame-link{display:block;margin-bottom:6px}.dgl-citation-frame{width:100%;max-height:140px;object-fit:contain;border-radius:6px;border:1px solid var(--dgl-border);background:#fafbfc}.dgl-citation-frame-loading{width:100%;height:100px;border-radius:6px;background:linear-gradient(90deg,#f3f4f6,#e5e7eb,#f3f4f6);background-size:200% 100%;animation:dgl-shimmer 1.4s linear infinite;margin-bottom:6px}@keyframes dgl-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.dgl-citation-breadcrumb{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--dgl-muted);margin-bottom:4px}.dgl-citation-snippet{font-size:11.5px;color:var(--dgl-fg);line-height:1.5;max-height:140px;overflow-y:auto}.dgl-followups{margin-top:10px}.dgl-followups-label{font-size:9.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--dgl-muted);margin-bottom:5px}.dgl-followups-list{display:flex;flex-wrap:wrap;gap:4px}.dgl-followup-chip{font-size:11.5px;background:#fff;color:var(--dgl-fg);border:1px solid var(--dgl-border);padding:4px 10px;border-radius:999px;cursor:pointer;transition:background .12s ease,border-color .12s ease;font-family:inherit;text-align:left}.dgl-followup-chip:hover{background:#eef2ff;border-color:#c7d2fe;color:var(--dgl-primary)}.dgl-composer{border-top:1px solid var(--dgl-border);padding:10px 12px 8px;background:#fff}.dgl-staged-image{display:flex;align-items:center;gap:6px;margin-bottom:8px;padding:4px 6px;background:#f3f4f6;border-radius:8px;border:1px solid var(--dgl-border);position:relative}.dgl-staged-image img{width:42px;height:42px;object-fit:cover;border-radius:4px}.dgl-staged-remove{background:#0009;color:#fff;border:none;width:18px;height:18px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;margin-left:auto}.dgl-composer-row{display:flex;align-items:center;gap:6px;border:1px solid var(--dgl-border);border-radius:10px;padding:4px 6px;transition:border-color .12s ease}.dgl-composer-row:focus-within{border-color:var(--dgl-primary)}.dgl-input{flex:1;border:none;outline:none;background:transparent;color:var(--dgl-fg);font:inherit;font-size:13.5px;padding:6px 4px}.dgl-input::placeholder{color:var(--dgl-muted)}.dgl-send-btn{background:var(--dgl-primary);color:var(--dgl-primary-text);border:none;width:32px;height:32px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center}.dgl-send-btn:disabled{background:#d1d5db;cursor:not-allowed}.dgl-branding{margin-top:6px;font-size:10px;color:var(--dgl-muted);text-align:center}.dgl-branding a{color:var(--dgl-muted);text-decoration:none}.dgl-branding a:hover{text-decoration:underline}.dgl-spin{animation:dgl-spin .9s linear infinite}@keyframes dgl-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 480px){.dgl-panel{position:fixed;bottom:0;left:0!important;right:0!important;width:100vw;height:90dvh;max-height:90dvh;border-radius:var(--dgl-radius) var(--dgl-radius) 0 0}.dgl-panel.dgl-panel-expanded{position:fixed;inset:0;inset:0!important;width:100vw;height:100dvh!important;max-height:100dvh!important;border-radius:0}.dgl-launcher{width:52px;height:52px;bottom:16px}.dgl-root{bottom:16px}.dgl-pos-bottom-right{right:16px}.dgl-pos-bottom-left{left:16px}.dgl-messages{padding:12px}.dgl-composer{padding:8px 10px}}@media (min-width: 481px) and (max-width: 768px){.dgl-panel{width:min(340px,calc(100vw - 32px));height:min(560px,calc(100dvh - 100px))}.dgl-panel-expanded{width:min(560px,calc(100vw - 32px));height:min(720px,calc(100dvh - 80px))}}@media (max-height: 600px) and (min-width: 380px){.dgl-panel{position:absolute;bottom:64px;height:calc(100dvh - 84px);max-height:calc(100dvh - 84px);width:min(340px,calc(100vw - 40px));border-radius:var(--dgl-radius)}.dgl-pos-bottom-right .dgl-panel{right:0;left:auto!important}.dgl-pos-bottom-left .dgl-panel{left:0;right:auto!important}.dgl-launcher{width:48px;height:48px}}@media (max-width: 360px){.dgl-launcher{width:48px;height:48px;bottom:12px}.dgl-pos-bottom-right{right:12px}.dgl-pos-bottom-left{left:12px}.dgl-header{padding:10px 12px}.dgl-title{font-size:13px}}@media (hover: none) and (pointer: coarse){.dgl-icon-btn{width:32px;height:32px}.dgl-send-btn{width:36px;height:36px}.dgl-followup-chip{padding:6px 12px;font-size:12px}}.dgl-lightbox{position:fixed;inset:0;z-index:2147483647;background:#000000d1;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:16px;animation:dgl-fade-in .15s ease-out;cursor:zoom-out}@keyframes dgl-fade-in{0%{opacity:0}to{opacity:1}}.dgl-lightbox-img{max-width:min(92vw,1200px);max-height:90vh;object-fit:contain;border-radius:8px;box-shadow:0 20px 60px #00000080;cursor:default}.dgl-lightbox-close{position:absolute;top:14px;right:14px;width:40px;height:40px;border-radius:50%;background:#ffffff1f;border:none;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s ease}.dgl-lightbox-close:hover{background:#ffffff38}.dgl-user-image-btn{display:block;margin-bottom:6px;padding:0;border:none;background:transparent;cursor:zoom-in}.dgl-user-image-btn:hover .dgl-user-image{opacity:.92}
1
+ .dgl-root{position:fixed;z-index:2147483000;bottom:20px;font-family:var(--dgl-font);color-scheme:light;--dgl-bg: #ffffff;--dgl-fg: #1f2937;--dgl-muted: #6b7280;--dgl-border: #e5e7eb;--dgl-bubble-assistant: #f3f4f6}.dgl-pos-bottom-right{right:20px}.dgl-pos-bottom-left{left:20px}.dgl-launcher{background:var(--dgl-primary);color:var(--dgl-primary-text);border:none;width:56px;height:56px;border-radius:50%;cursor:pointer;box-shadow:0 6px 20px #0000002e,0 0 color-mix(in srgb,var(--dgl-primary) 40%,transparent);display:flex;align-items:center;justify-content:center;overflow:hidden;transition:transform .18s cubic-bezier(.34,1.56,.64,1),box-shadow .18s ease;animation:dgl-launcher-pulse 2.4s ease-in-out infinite}@keyframes dgl-launcher-pulse{0%,to{box-shadow:0 6px 20px #0000002e,0 0 color-mix(in srgb,var(--dgl-primary) 40%,transparent)}50%{box-shadow:0 6px 20px #0000002e,0 0 0 10px color-mix(in srgb,var(--dgl-primary) 0%,transparent)}}.dgl-launcher:hover{transform:scale(1.08) translateY(-2px);box-shadow:0 12px 28px #00000040,0 0 0 6px color-mix(in srgb,var(--dgl-primary) 25%,transparent);animation:none}.dgl-launcher:active{transform:scale(.96)}.dgl-launcher:focus-visible{outline:3px solid color-mix(in srgb,var(--dgl-primary) 50%,transparent);outline-offset:2px}.dgl-launcher-avatar{width:100%;height:100%;object-fit:cover;border-radius:50%}.dgl-panel{position:absolute;bottom:72px;width:420px;height:min(720px,calc(100dvh - 100px));max-height:calc(100dvh - 100px);background:var(--dgl-bg);color:var(--dgl-fg);border:1px solid var(--dgl-border);border-radius:var(--dgl-radius);box-shadow:0 20px 50px #0003;display:flex;flex-direction:column;overflow:hidden;animation:dgl-pop .18s ease-out;transition:width .22s ease,height .22s ease;text-align:left}.dgl-panel.dgl-panel-expanded{width:min(800px,calc(100vw - 32px));height:min(900px,calc(100dvh - 80px));max-height:calc(100dvh - 80px)}.dgl-hide-on-mobile{display:flex}@media (max-width: 480px){.dgl-hide-on-mobile{display:none}}.dgl-pos-bottom-right .dgl-panel{right:0}.dgl-pos-bottom-left .dgl-panel{left:0}@keyframes dgl-pop{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.dgl-header{background:var(--dgl-primary);color:var(--dgl-primary-text);padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:8px}.dgl-header-info{display:flex;align-items:center;gap:10px;min-width:0}.dgl-header-text{min-width:0}.dgl-title{font-weight:600;font-size:14px;line-height:1.2}.dgl-subtitle{font-size:11px;opacity:.85;margin-top:2px}.dgl-header-actions{display:flex;gap:4px}.dgl-avatar{width:32px;height:32px;border-radius:50%;object-fit:cover;flex-shrink:0}.dgl-avatar-fallback{background:#fff3;color:var(--dgl-primary-text);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px}.dgl-avatar-fallback-light{background:color-mix(in srgb,var(--dgl-primary) 14%,transparent);color:var(--dgl-primary)}.dgl-icon-btn{background:transparent;border:none;color:inherit;width:28px;height:28px;border-radius:6px;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:.85;transition:background .12s ease,opacity .12s ease}.dgl-icon-btn:hover{background:#0000000f;opacity:1}.dgl-icon-btn:disabled{cursor:not-allowed;opacity:.4}.dgl-header .dgl-icon-btn:hover{background:#ffffff26}.dgl-icon-btn-with-badge{position:relative}.dgl-icon-badge{position:absolute;top:-2px;right:-2px;min-width:15px;height:15px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;font:700 9.5px var(--dgl-font);line-height:15px;text-align:center;box-shadow:0 0 0 1.5px var(--dgl-primary);pointer-events:none}.dgl-messages{flex:1;overflow-y:auto;padding:14px;background:#fafbfc;display:flex;flex-direction:column;gap:10px}.dgl-empty{margin:auto 0;text-align:center;color:var(--dgl-muted);padding:24px 20px;display:flex;flex-direction:column;align-items:center;gap:8px}.dgl-empty-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--dgl-primary) 18%,white);color:var(--dgl-primary);display:flex;align-items:center;justify-content:center;margin-bottom:4px}.dgl-empty-icon svg{width:22px;height:22px}.dgl-empty-text{font-size:15px;font-weight:600;color:var(--dgl-fg);line-height:1.3}.dgl-empty-sub{font-size:12.5px;line-height:1.5;max-width:280px}.dgl-error{margin:auto 0;text-align:center;color:#b91c1c;background:#fee2e2;padding:10px;border-radius:8px;font-size:12px}.dgl-msg{display:flex;gap:8px;animation:dgl-msg-in .22s ease-out}@keyframes dgl-msg-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.dgl-msg-user{justify-content:flex-end}.dgl-msg-assistant{justify-content:flex-start}.dgl-msg-assistant .dgl-avatar{width:26px;height:26px;align-self:flex-start;margin-top:2px}.dgl-msg-body{flex:1;min-width:0;max-width:88%}.dgl-bubble{padding:9px 12px;border-radius:14px;font-size:13.5px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}.dgl-bubble-user{background:var(--dgl-primary);color:var(--dgl-primary-text);border-bottom-right-radius:4px;max-width:78%}.dgl-assistant-text{color:var(--dgl-fg);font-size:13.5px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}.dgl-refused{background:#fef3c7;border:1px solid #fde68a;color:#92400e;padding:8px 12px;border-radius:12px;font-size:13px}.dgl-user-image-link{display:block;margin-bottom:6px}.dgl-user-image{max-width:100%;max-height:200px;border-radius:8px;border:1px solid rgba(255,255,255,.2);background:#ffffff1a;object-fit:contain}.dgl-typing-cursor{color:var(--dgl-muted);animation:dgl-blink 1s steps(2) infinite}@keyframes dgl-blink{50%{opacity:0}}.dgl-thinking{display:inline-flex;gap:4px;align-items:center;padding:6px 0}.dgl-thinking-dot{width:6px;height:6px;border-radius:50%;background:var(--dgl-muted);animation:dgl-bounce 1.2s infinite ease-in-out}.dgl-thinking-dot:nth-child(2){animation-delay:.15s}.dgl-thinking-dot:nth-child(3){animation-delay:.3s}@keyframes dgl-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}.dgl-md-p{margin:6px 0;line-height:1.55;word-wrap:break-word}.dgl-md-p:first-child{margin-top:0}.dgl-md-p:last-child{margin-bottom:0}.dgl-md-list{margin:6px 0;padding-left:20px}.dgl-md-list li{margin:3px 0;line-height:1.5}.dgl-md-ul{list-style:disc}.dgl-md-ol{list-style:decimal}.dgl-md-code{background:#f3f4f6;color:#1f2937;padding:1px 5px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px}.dgl-md-link{color:var(--dgl-primary);text-decoration:underline}.dgl-citations{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px;align-items:flex-start}.dgl-citation-wrap{position:relative}.dgl-citation{font-size:10.5px;background:color-mix(in srgb,var(--dgl-primary) 8%,white);color:color-mix(in srgb,var(--dgl-primary) 80%,#1f2937);padding:3px 9px;border-radius:999px;border:1px solid color-mix(in srgb,var(--dgl-primary) 22%,white);cursor:pointer;font-family:inherit;transition:background .12s ease,border-color .12s ease,transform .08s ease;display:inline-flex;align-items:center;gap:3px}.dgl-citation:hover{background:color-mix(in srgb,var(--dgl-primary) 16%,white);border-color:color-mix(in srgb,var(--dgl-primary) 36%,white)}.dgl-citation:active{transform:scale(.97)}.dgl-citation-open{background:color-mix(in srgb,var(--dgl-primary) 20%,white);border-color:color-mix(in srgb,var(--dgl-primary) 45%,white)}.dgl-citation-icon{font-size:8px;opacity:.65}.dgl-citation-stamp{opacity:.7;font-weight:500}.dgl-citation-more{font-size:10.5px;color:var(--dgl-muted);font-style:italic;padding:3px 4px;align-self:center}.dgl-citation-popover{margin-top:6px;width:100%;background:#fff;border:1px solid var(--dgl-border);border-radius:10px;padding:8px;box-shadow:0 4px 16px #0000000f;animation:dgl-pop .14s ease-out}.dgl-citation-frame-link{display:block;margin-bottom:6px}.dgl-citation-frame{width:100%;max-height:140px;object-fit:contain;border-radius:6px;border:1px solid var(--dgl-border);background:#fafbfc}.dgl-citation-frame-loading{width:100%;height:100px;border-radius:6px;background:linear-gradient(90deg,#f3f4f6,#e5e7eb,#f3f4f6);background-size:200% 100%;animation:dgl-shimmer 1.4s linear infinite;margin-bottom:6px}@keyframes dgl-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.dgl-citation-breadcrumb{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--dgl-muted);margin-bottom:4px}.dgl-citation-snippet{font-size:11.5px;color:var(--dgl-fg);line-height:1.5;max-height:140px;overflow-y:auto}.dgl-followups{margin-top:10px}.dgl-followups-label{font-size:9.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--dgl-muted);margin-bottom:5px}.dgl-followups-list{display:flex;flex-wrap:wrap;gap:4px}.dgl-followup-chip{font-size:11.5px;background:#fff;color:var(--dgl-fg);border:1px solid var(--dgl-border);padding:4px 10px;border-radius:999px;cursor:pointer;transition:background .12s ease,border-color .12s ease;font-family:inherit;text-align:left}.dgl-followup-chip:hover{background:#eef2ff;border-color:#c7d2fe;color:var(--dgl-primary)}.dgl-composer{border-top:1px solid var(--dgl-border);padding:10px 12px 8px;background:#fff}.dgl-staged-image{display:flex;align-items:center;gap:6px;margin-bottom:8px;padding:4px 6px;background:#f3f4f6;border-radius:8px;border:1px solid var(--dgl-border);position:relative}.dgl-staged-image img{width:42px;height:42px;object-fit:cover;border-radius:4px}.dgl-staged-remove{background:#0009;color:#fff;border:none;width:18px;height:18px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;margin-left:auto}.dgl-composer-row{display:flex;align-items:center;gap:6px;border:1px solid var(--dgl-border);border-radius:10px;padding:4px 6px;transition:border-color .12s ease}.dgl-composer-row:focus-within{border-color:var(--dgl-primary)}.dgl-input{flex:1;border:none;outline:none;background:transparent;color:var(--dgl-fg);font:inherit;font-size:13.5px;padding:6px 4px}.dgl-input::placeholder{color:var(--dgl-muted)}.dgl-send-btn{background:var(--dgl-primary);color:var(--dgl-primary-text);border:none;width:32px;height:32px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center}.dgl-send-btn:disabled{background:#d1d5db;cursor:not-allowed}.dgl-branding{margin-top:6px;font-size:10px;color:var(--dgl-muted);text-align:center}.dgl-branding a{color:var(--dgl-muted);text-decoration:none}.dgl-branding a:hover{text-decoration:underline}.dgl-branding-version{margin-left:6px;padding-left:6px;border-left:1px solid rgba(0,0,0,.08);opacity:.65;font-size:9.5px;letter-spacing:.01em}.dgl-spin{animation:dgl-spin .9s linear infinite}@keyframes dgl-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (max-width: 480px){.dgl-panel{position:fixed;bottom:0;left:0!important;right:0!important;width:100vw;height:90dvh;max-height:90dvh;border-radius:var(--dgl-radius) var(--dgl-radius) 0 0}.dgl-panel.dgl-panel-expanded{position:fixed;inset:0;inset:0!important;width:100vw;height:100dvh!important;max-height:100dvh!important;border-radius:0}.dgl-launcher{width:52px;height:52px;bottom:16px}.dgl-root{bottom:16px}.dgl-pos-bottom-right{right:16px}.dgl-pos-bottom-left{left:16px}.dgl-messages{padding:12px}.dgl-composer{padding:8px 10px}}@media (min-width: 481px) and (max-width: 768px){.dgl-panel{width:min(340px,calc(100vw - 32px));height:min(560px,calc(100dvh - 100px))}.dgl-panel-expanded{width:min(560px,calc(100vw - 32px));height:min(720px,calc(100dvh - 80px))}}@media (max-height: 600px) and (min-width: 380px){.dgl-panel{position:absolute;bottom:64px;height:calc(100dvh - 84px);max-height:calc(100dvh - 84px);width:min(340px,calc(100vw - 40px));border-radius:var(--dgl-radius)}.dgl-pos-bottom-right .dgl-panel{right:0;left:auto!important}.dgl-pos-bottom-left .dgl-panel{left:0;right:auto!important}.dgl-launcher{width:48px;height:48px}}@media (max-width: 360px){.dgl-launcher{width:48px;height:48px;bottom:12px}.dgl-pos-bottom-right{right:12px}.dgl-pos-bottom-left{left:12px}.dgl-header{padding:10px 12px}.dgl-title{font-size:13px}}@media (hover: none) and (pointer: coarse){.dgl-icon-btn{width:32px;height:32px}.dgl-send-btn{width:36px;height:36px}.dgl-followup-chip{padding:6px 12px;font-size:12px}}.dgl-lightbox{position:fixed;inset:0;z-index:2147483647;background:#000000d1;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:16px;animation:dgl-fade-in .15s ease-out;cursor:zoom-out}@keyframes dgl-fade-in{0%{opacity:0}to{opacity:1}}.dgl-lightbox-img{max-width:min(92vw,1200px);max-height:90vh;object-fit:contain;border-radius:8px;box-shadow:0 20px 60px #00000080;cursor:default}.dgl-lightbox-close{position:absolute;top:14px;right:14px;width:40px;height:40px;border-radius:50%;background:#ffffff1f;border:none;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s ease}.dgl-lightbox-close:hover{background:#ffffff38}.dgl-user-image-btn{display:block;margin-bottom:6px;padding:0;border:none;background:transparent;cursor:zoom-in}.dgl-user-image-btn:hover .dgl-user-image{opacity:.92}.dgl-ticket-card{margin-top:10px;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 1px 3px #0000000f;overflow:hidden;max-width:100%;transition:box-shadow .15s ease,border-color .12s ease}.dgl-ticket-card:hover{box-shadow:0 4px 12px #00000014}.dgl-ticket-card-stripe{height:3px;width:100%}.dgl-ticket-card-body{padding:12px 14px}.dgl-ticket-card-head{display:flex;align-items:flex-start;gap:10px}.dgl-ticket-card-icon{width:34px;height:34px;border-radius:8px;color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 6px #0000001f}.dgl-ticket-card-icon svg{width:16px;height:16px}.dgl-ticket-card-titles{flex:1;min-width:0}.dgl-ticket-card-eyebrow{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#64748b;line-height:1.2}.dgl-ticket-card-title{font:700 13px var(--dgl-font);color:#0f172a;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dgl-ticket-open-btn{flex-shrink:0;display:inline-flex;align-items:center;gap:3px;padding:5px 9px;background:#fff;border:1px solid #e5e7eb;border-radius:6px;color:#475569;font:600 10.5px var(--dgl-font);text-decoration:none;transition:background .12s ease,border-color .12s ease}.dgl-ticket-open-btn:hover{background:#f8fafc;border-color:#cbd5e1}.dgl-ticket-pills{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:10px}.dgl-ticket-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:999px;font:700 9.5px var(--dgl-font);text-transform:uppercase;letter-spacing:.04em;border:1px solid transparent}.dgl-ticket-pill-dot{width:6px;height:6px;border-radius:50%;display:inline-block}.dgl-ticket-card-desc{font-size:12px;color:#475569;line-height:1.5;margin-top:10px}.dgl-ticket-card-body-title{font-size:12.5px;color:#1e293b;line-height:1.4;margin-top:10px}.dgl-ticket-meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid #f1f5f9}.dgl-ticket-meta-label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8}.dgl-ticket-meta-value{font-size:11.5px;color:#334155;margin-top:2px}.dgl-ticket-form-grid{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid #f1f5f9}@media (max-width: 360px){.dgl-ticket-form-grid{grid-template-columns:1fr}}.dgl-ticket-form-grid>div{min-width:0}.dgl-ticket-form-grid .dgl-ticket-email-link{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}select.dgl-ticket-input{appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:24px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center}.dgl-ticket-field-label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;margin-bottom:4px}.dgl-ticket-input{width:100%;height:30px;box-sizing:border-box;padding:0 8px;font:12.5px var(--dgl-font);color:#1e293b;background:#fff;border:1px solid #cbd5e1;border-radius:6px;outline:none;transition:border-color .12s ease}.dgl-ticket-input:focus{border-color:var(--dgl-primary)}.dgl-ticket-email-link{background:transparent;border:none;padding:0;font:600 12.5px var(--dgl-font);color:#0f172a;cursor:pointer;text-align:left;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:30px;display:inline-flex;align-items:center;gap:4px}.dgl-ticket-email-link:hover{color:var(--dgl-primary)}.dgl-ticket-email-change{font-weight:400;color:#94a3b8;font-size:10px}.dgl-ticket-error{margin-top:8px;padding:6px 10px;border-radius:6px;background:#fee2e2;color:#991b1b;border:1px solid #fecaca;font-size:11px;line-height:1.4}.dgl-ticket-card-footer{margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:10px}.dgl-ticket-hint{font-size:10.5px;color:#94a3b8;line-height:1.4}.dgl-ticket-submit{border:none;background:var(--dgl-primary);color:var(--dgl-primary-text);padding:6px 12px;border-radius:8px;font:600 11.5px var(--dgl-font);cursor:pointer;display:inline-flex;align-items:center;gap:5px;box-shadow:0 2px 6px color-mix(in srgb,var(--dgl-primary) 25%,transparent);transition:opacity .12s,box-shadow .15s;flex-shrink:0}.dgl-ticket-submit:hover:not(:disabled){box-shadow:0 4px 10px color-mix(in srgb,var(--dgl-primary) 35%,transparent)}.dgl-ticket-submit:disabled{opacity:.5;cursor:not-allowed}.dgl-ticket-submit svg{width:12px;height:12px}.dgl-ticket-diff-link{margin-top:10px;background:transparent;border:none;padding:0;cursor:pointer;color:var(--dgl-primary);font:600 11.5px var(--dgl-font);text-align:left;display:inline-flex}.dgl-ticket-diff-link:hover{text-decoration:underline}.dgl-ticket-diff-form{margin-top:10px;padding-top:10px;border-top:1px solid #f1f5f9}.dgl-ticket-diff-cancel{background:transparent;border:none;padding:0;cursor:pointer;color:#94a3b8;font:500 11.5px var(--dgl-font)}.dgl-ticket-diff-cancel:hover{color:#475569}.dgl-tix-btn{background:transparent;border:none;color:inherit;height:28px;padding:0 8px;border-radius:6px;cursor:pointer;font:600 11px var(--dgl-font);display:inline-flex;align-items:center;gap:4px;opacity:.85;transition:background .12s,opacity .12s}.dgl-tix-btn:hover{background:#ffffff2e;opacity:1}.dgl-tix-btn-badge{background:#ffffff40;border-radius:999px;min-width:16px;padding:0 5px;font:700 9.5px var(--dgl-font);text-align:center;line-height:14px}.dgl-tix-modal-backdrop{position:absolute;inset:0;background:#0f172a80;z-index:10;display:flex;align-items:stretch;animation:dgl-fade-in .15s ease-out}.dgl-tix-modal{background:#fff;width:100%;display:flex;flex-direction:column;color:#1f2937}.dgl-tix-modal-header{padding:12px 14px;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}.dgl-tix-modal-title{font:700 14px var(--dgl-font);color:#0f172a}.dgl-tix-modal-sub{font-size:11px;color:#64748b;margin-top:2px}.dgl-tix-modal-list{flex:1;overflow-y:auto;padding:8px}.dgl-tix-row{padding:10px 12px;border-radius:10px;background:#f8fafc;margin-bottom:6px;border:1px solid #e2e8f0}.dgl-tix-row-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.dgl-tix-row-num{font:700 12.5px var(--dgl-font);color:#0f172a}.dgl-tix-row-title{font-size:12px;color:#334155;margin-top:4px;line-height:1.4}.dgl-tix-row-meta{font-size:10.5px;color:#94a3b8;margin-top:4px}.dgl-tix-empty{text-align:center;color:#94a3b8;padding:40px 16px;font-size:12px}.dgl-chat-row{width:100%;text-align:left;padding:10px 12px;border-radius:10px;background:#f8fafc;margin-bottom:6px;border:1px solid #e2e8f0;cursor:pointer;display:block;transition:background .12s,border-color .12s}.dgl-chat-row:hover{background:#f1f5f9;border-color:#cbd5e1}.dgl-chat-row-current{background:#eff6ff;border-color:#bfdbfe}.dgl-chat-row-current:hover{background:#dbeafe;border-color:#93c5fd}.dgl-chat-row-title{font:600 12.5px var(--dgl-font);color:#0f172a;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.dgl-chat-row-meta{font-size:10.5px;color:#94a3b8;margin-top:4px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docgenlab.com/chat-widget",
3
- "version": "0.2.4",
3
+ "version": "0.5.1",
4
4
  "description": "Embeddable AI knowledge chat widget for DocGenLab — drop into any site to give end-users a grounded RAG assistant.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",