@dssp/project 1.0.0-alpha.47 → 1.0.0-alpha.49
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-client/pages/lib/chatbot-widget.js +8 -8
- package/dist-client/pages/lib/chatbot-widget.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -263,7 +263,7 @@ ChatbotWidget.styles = css `
|
|
|
263
263
|
.chatbot-icon {
|
|
264
264
|
width: 60px;
|
|
265
265
|
height: 60px;
|
|
266
|
-
background: linear-gradient(135deg, #
|
|
266
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
267
267
|
border-radius: 50%;
|
|
268
268
|
display: flex;
|
|
269
269
|
align-items: center;
|
|
@@ -312,7 +312,7 @@ ChatbotWidget.styles = css `
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
.chat-header {
|
|
315
|
-
background: linear-gradient(135deg, #
|
|
315
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
316
316
|
color: white;
|
|
317
317
|
padding: 15px 20px;
|
|
318
318
|
display: flex;
|
|
@@ -381,7 +381,7 @@ ChatbotWidget.styles = css `
|
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
.message.user .message-bubble {
|
|
384
|
-
background: linear-gradient(135deg, #
|
|
384
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
385
385
|
color: white;
|
|
386
386
|
border-bottom-right-radius: 4px;
|
|
387
387
|
}
|
|
@@ -405,7 +405,7 @@ ChatbotWidget.styles = css `
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
.message.user .message-avatar {
|
|
408
|
-
background: linear-gradient(135deg, #
|
|
408
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
409
409
|
color: white;
|
|
410
410
|
}
|
|
411
411
|
|
|
@@ -433,14 +433,14 @@ ChatbotWidget.styles = css `
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
.message-input:focus {
|
|
436
|
-
border-color:
|
|
436
|
+
border-color: var(--md-sys-color-primary);
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
.send-btn {
|
|
440
440
|
width: 40px;
|
|
441
441
|
height: 40px;
|
|
442
442
|
border-radius: 50%;
|
|
443
|
-
background: linear-gradient(135deg, #
|
|
443
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
444
444
|
border: none;
|
|
445
445
|
color: white;
|
|
446
446
|
cursor: pointer;
|
|
@@ -476,7 +476,7 @@ ChatbotWidget.styles = css `
|
|
|
476
476
|
width: 6px;
|
|
477
477
|
height: 6px;
|
|
478
478
|
border-radius: 50%;
|
|
479
|
-
background:
|
|
479
|
+
background: var(--md-sys-color-primary);
|
|
480
480
|
animation: loading 1.4s infinite ease-in-out;
|
|
481
481
|
}
|
|
482
482
|
|
|
@@ -572,7 +572,7 @@ ChatbotWidget.styles = css `
|
|
|
572
572
|
|
|
573
573
|
.overlay-header {
|
|
574
574
|
padding: 14px 16px;
|
|
575
|
-
background: linear-gradient(135deg, #
|
|
575
|
+
background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);
|
|
576
576
|
color: #ffffff;
|
|
577
577
|
display: flex;
|
|
578
578
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-widget.js","sourceRoot":"","sources":["../../../client/pages/lib/chatbot-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA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itElement, html, css } from 'lit'\n\n// API 상수\nconst CHATBOT_API_URL = 'https://korea-uni-chat-ui.ettisoft.com/chat'\n\ninterface SourceItem {\n title: string\n url: string\n}\n\ninterface ChatMessage {\n id: string\n text: string\n isUser: boolean\n timestamp: Date\n sources?: SourceItem[]\n}\n\nexport class ChatbotWidget extends LitElement {\n static styles = css`\n :host {\n position: fixed;\n bottom: 40px;\n right: 20px;\n z-index: 1000;\n }\n\n .chatbot-container {\n position: relative;\n }\n\n .chatbot-icon {\n width: 60px;\n height: 60px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n transition: all 0.3s ease;\n border: none;\n outline: none;\n }\n\n .chatbot-icon:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);\n }\n\n .chatbot-icon svg {\n width: 28px;\n height: 28px;\n fill: white;\n }\n\n .chat-window {\n position: absolute;\n bottom: 80px;\n right: 0;\n width: 350px;\n height: 500px;\n background: white;\n border-radius: 20px;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n transform: translateY(20px) scale(0.95);\n opacity: 0;\n transition: all 0.3s ease;\n border: 1px solid #e1e5e9;\n pointer-events: none; /* 닫혀있을 때 클릭 차단 해제 */\n }\n\n .chat-window.open {\n transform: translateY(0) scale(1);\n opacity: 1;\n pointer-events: auto; /* 열렸을 때 클릭 가능 */\n }\n\n .chat-header {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 15px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .chat-header h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n }\n\n .close-btn {\n background: none;\n border: none;\n color: white;\n cursor: pointer;\n font-size: 32px;\n padding: 0;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .close-btn:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .messages-container {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 15px;\n }\n\n .message {\n display: flex;\n align-items: flex-end;\n gap: 10px;\n max-width: 80%;\n }\n\n .message.user {\n align-self: flex-end;\n flex-direction: row-reverse;\n }\n\n .message.bot {\n align-self: flex-start;\n }\n\n .message-bubble {\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.4;\n word-wrap: break-word;\n position: relative;\n }\n\n .message.user .message-bubble {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border-bottom-right-radius: 4px;\n }\n\n .message.bot .message-bubble {\n background: #f1f3f4;\n color: #333;\n border-bottom-left-radius: 4px;\n }\n\n .message-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 600;\n flex-shrink: 0;\n }\n\n .message.user .message-avatar {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n }\n\n .message.bot .message-avatar {\n background: #e8eaf0;\n color: #666;\n }\n\n .input-container {\n padding: 20px;\n border-top: 1px solid #e1e5e9;\n display: flex;\n gap: 10px;\n align-items: center;\n }\n\n .message-input {\n flex: 1;\n border: 1px solid #e1e5e9;\n border-radius: 25px;\n padding: 12px 16px;\n font-size: 14px;\n outline: none;\n transition: border-color 0.2s ease;\n }\n\n .message-input:focus {\n border-color: #667eea;\n }\n\n .send-btn {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n color: white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n }\n\n .send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .loading-indicator {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #666;\n font-size: 12px;\n }\n\n .loading-dots {\n display: flex;\n gap: 4px;\n }\n\n .loading-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: #667eea;\n animation: loading 1.4s infinite ease-in-out;\n }\n\n .loading-dot:nth-child(1) {\n animation-delay: -0.32s;\n }\n .loading-dot:nth-child(2) {\n animation-delay: -0.16s;\n }\n\n @keyframes loading {\n 0%,\n 80%,\n 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1);\n }\n }\n\n /* 스크롤바 스타일링 */\n .messages-container::-webkit-scrollbar {\n width: 6px;\n }\n\n .messages-container::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 3px;\n }\n\n .messages-container::-webkit-scrollbar-thumb {\n background: #c1c1c1;\n border-radius: 3px;\n }\n\n .messages-container::-webkit-scrollbar-thumb:hover {\n background: #a8a8a8;\n }\n\n /* 근거 버튼 */\n .evidence-btn {\n margin-top: 8px;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #d6daf0;\n background: #ffffff;\n color: #3b4cca;\n border-radius: 14px;\n padding: 6px 10px;\n font-size: 12px;\n cursor: pointer;\n transition:\n background-color 0.2s ease,\n border-color 0.2s ease;\n }\n\n .evidence-btn:hover {\n background-color: #f4f6ff;\n border-color: #c2c8ef;\n }\n\n /* 오버레이 */\n .overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.35);\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1100; /* 챗봇보다 위 */\n }\n\n .overlay.open {\n opacity: 1;\n pointer-events: auto;\n }\n\n .overlay-panel {\n width: min(520px, calc(100vw - 40px));\n max-height: min(70vh, 560px);\n background: #ffffff;\n border-radius: 14px;\n box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .overlay-header {\n padding: 14px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: #ffffff;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .overlay-title {\n font-weight: 600;\n font-size: 16px;\n }\n\n .overlay-close {\n background: none;\n border: none;\n color: #ffffff;\n font-size: 26px;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n cursor: pointer;\n }\n\n .overlay-body {\n padding: 12px 16px 16px 16px;\n overflow-y: auto;\n }\n\n .source-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .source-item {\n border: 1px solid #e6e9f2;\n border-radius: 10px;\n padding: 10px 12px;\n background: #f9fafc;\n }\n\n .source-link {\n color: #1e3a8a;\n text-decoration: none;\n display: block;\n word-break: break-all;\n }\n\n .source-link:hover {\n text-decoration: underline;\n }\n `\n\n static get properties() {\n return {\n isOpen: { type: Boolean },\n messages: { type: Array },\n inputValue: { type: String },\n isLoading: { type: Boolean },\n isSourcesOpen: { type: Boolean },\n currentSources: { type: Array }\n }\n }\n\n isOpen = false\n messages: ChatMessage[] = []\n inputValue = ''\n isLoading = false\n isSourcesOpen = false\n currentSources: SourceItem[] = []\n\n render() {\n return html`\n <div class=\"chatbot-container\">\n <!-- 챗봇 아이콘 -->\n <button class=\"chatbot-icon\" @click=\"${this.toggleChat}\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"\n />\n </svg>\n </button>\n\n <!-- 대화창 -->\n <div class=\"chat-window ${this.isOpen ? 'open' : ''}\">\n <!-- 헤더 -->\n <div class=\"chat-header\">\n <h3>챗봇 도우미</h3>\n <button class=\"close-btn\" @click=\"${this.toggleChat}\">×</button>\n </div>\n\n <!-- 메시지 영역 -->\n <div class=\"messages-container\">\n ${this.messages.length === 0\n ? html`\n <div class=\"message bot\">\n <div class=\"message-avatar\">🤖</div>\n <div class=\"message-bubble\">안녕하세요! 무엇을 도와드릴까요?</div>\n </div>\n `\n : ''}\n ${this.messages.map(\n message => html`\n <div class=\"message ${message.isUser ? 'user' : 'bot'}\">\n <div class=\"message-avatar\">${message.isUser ? '👤' : '🤖'}</div>\n <div class=\"message-bubble\">\n ${message.text}\n ${!message.isUser && message.sources && message.sources.length\n ? html`\n <div>\n <button class=\"evidence-btn\" @click=\"${() => this.openSourcesOverlay(message.sources || [])}\">\n 근거 ${message.sources.length}개 보기\n </button>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n )}\n ${this.isLoading\n ? html`\n <div class=\"message bot\">\n <div class=\"message-avatar\">🤖</div>\n <div class=\"message-bubble\">\n <div class=\"loading-indicator\">\n <span>답변 중</span>\n <div class=\"loading-dots\">\n <div class=\"loading-dot\"></div>\n <div class=\"loading-dot\"></div>\n <div class=\"loading-dot\"></div>\n </div>\n </div>\n </div>\n </div>\n `\n : ''}\n </div>\n\n <!-- 입력 영역 -->\n <div class=\"input-container\">\n <input\n class=\"message-input\"\n type=\"text\"\n placeholder=\"메시지를 입력하세요...\"\n .value=\"${this.inputValue}\"\n @input=\"${(e: Event) => (this.inputValue = (e.target as HTMLInputElement).value)}\"\n @keypress=\"${this.handleKeyPress}\"\n ?disabled=\"${this.isLoading}\"\n />\n <button class=\"send-btn\" @click=\"${this.sendMessage}\" ?disabled=\"${this.isLoading || !this.inputValue.trim()}\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n </button>\n </div>\n </div>\n <!-- 근거 오버레이 -->\n <div class=\"overlay ${this.isSourcesOpen ? 'open' : ''}\" @click=\"${this.closeSourcesOverlay}\">\n <div class=\"overlay-panel\" @click=\"${(e: Event) => e.stopPropagation()}\">\n <div class=\"overlay-header\">\n <div class=\"overlay-title\">근거 ${this.currentSources.length}개</div>\n <button class=\"overlay-close\" @click=\"${this.closeSourcesOverlay}\">×</button>\n </div>\n <div class=\"overlay-body\">\n <ul class=\"source-list\">\n ${this.currentSources.map(\n (s, idx) =>\n html` <li class=\"source-item\">\n <a class=\"source-link\" href=\"${s.url}\" target=\"_blank\" rel=\"noopener noreferrer\"\n >[#${idx + 1}] ${s.title}</a\n >\n </li>`\n )}\n </ul>\n </div>\n </div>\n </div>\n </div>\n `\n }\n\n private boundHandleEscapeKey = this.handleEscapeKey.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // 컴포넌트가 제거될 때 이벤트 리스너 정리\n document.removeEventListener('keydown', this.boundHandleEscapeKey)\n }\n\n handleEscapeKey(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (this.isSourcesOpen) {\n this.isSourcesOpen = false\n } else if (this.isOpen) {\n this.isOpen = false\n }\n }\n }\n\n toggleChat() {\n this.isOpen = !this.isOpen\n if (this.isOpen) {\n // 챗봇이 열릴 때 ESC 키 이벤트 리스너 추가\n document.addEventListener('keydown', this.boundHandleEscapeKey)\n // 챗봇이 열릴 때 스크롤을 맨 아래로\n this.requestUpdate()\n setTimeout(() => this.scrollToBottom(), 100)\n } else {\n // 챗봇이 닫힐 때 ESC 키 이벤트 리스너 제거\n document.removeEventListener('keydown', this.boundHandleEscapeKey)\n this.isSourcesOpen = false\n this.currentSources = []\n }\n }\n\n scrollToBottom() {\n const messagesContainer = this.shadowRoot?.querySelector('.messages-container') as HTMLElement\n if (messagesContainer) {\n messagesContainer.scrollTop = messagesContainer.scrollHeight\n }\n }\n\n async sendMessage() {\n if (!this.inputValue.trim() || this.isLoading) return\n\n const userMessage: ChatMessage = {\n id: Date.now().toString(),\n text: this.inputValue.trim(),\n isUser: true,\n timestamp: new Date()\n }\n\n this.messages = [...this.messages, userMessage]\n const messageText = this.inputValue.trim()\n this.inputValue = ''\n this.isLoading = true\n\n // 사용자 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n\n // 포커스 유지를 위해 input 요소 참조 저장\n const input = this.shadowRoot?.querySelector('.message-input') as HTMLInputElement\n\n try {\n // API 호출\n const response = await fetch(CHATBOT_API_URL, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ query: messageText, top_k: 6 })\n })\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}`)\n }\n\n const data = await response.json()\n\n const botMessage: ChatMessage = {\n id: (Date.now() + 1).toString(),\n text: data?.answer?.trim() || '죄송합니다. 응답을 처리할 수 없습니다.',\n isUser: false,\n timestamp: new Date(),\n sources: data?.sources || []\n }\n\n this.messages = [...this.messages, botMessage]\n // 봇 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n } catch (error) {\n const errorMessage: ChatMessage = {\n id: (Date.now() + 1).toString(),\n text: '죄송합니다. 일시적인 오류가 발생했습니다. 잠시 후 다시 시도해주세요.',\n isUser: false,\n timestamp: new Date()\n }\n this.messages = [...this.messages, errorMessage]\n // 에러 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n } finally {\n this.isLoading = false\n // 로딩 완료 후 포커스 복원\n setTimeout(() => {\n if (input) {\n input.focus()\n }\n }, 100)\n }\n }\n\n openSourcesOverlay(sources: SourceItem[]) {\n if (!sources || sources.length === 0) return\n this.currentSources = sources\n this.isSourcesOpen = true\n }\n\n closeSourcesOverlay() {\n this.isSourcesOpen = false\n this.currentSources = []\n }\n\n handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n this.sendMessage()\n }\n }\n}\n\ncustomElements.define('chatbot-widget', ChatbotWidget)\n"]}
|
|
1
|
+
{"version":3,"file":"chatbot-widget.js","sourceRoot":"","sources":["../../../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,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import { LitElement, html, css } from 'lit'\n\n// API 상수\nconst CHATBOT_API_URL = 'https://korea-uni-chat-ui.ettisoft.com/chat'\n\ninterface SourceItem {\n title: string\n url: string\n}\n\ninterface ChatMessage {\n id: string\n text: string\n isUser: boolean\n timestamp: Date\n sources?: SourceItem[]\n}\n\nexport class ChatbotWidget extends LitElement {\n static styles = css`\n :host {\n position: fixed;\n bottom: 40px;\n right: 20px;\n z-index: 1000;\n }\n\n .chatbot-container {\n position: relative;\n }\n\n .chatbot-icon {\n width: 60px;\n height: 60px;\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n transition: all 0.3s ease;\n border: none;\n outline: none;\n }\n\n .chatbot-icon:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);\n }\n\n .chatbot-icon svg {\n width: 28px;\n height: 28px;\n fill: white;\n }\n\n .chat-window {\n position: absolute;\n bottom: 80px;\n right: 0;\n width: 350px;\n height: 500px;\n background: white;\n border-radius: 20px;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n transform: translateY(20px) scale(0.95);\n opacity: 0;\n transition: all 0.3s ease;\n border: 1px solid #e1e5e9;\n pointer-events: none; /* 닫혀있을 때 클릭 차단 해제 */\n }\n\n .chat-window.open {\n transform: translateY(0) scale(1);\n opacity: 1;\n pointer-events: auto; /* 열렸을 때 클릭 가능 */\n }\n\n .chat-header {\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n color: white;\n padding: 15px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .chat-header h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n }\n\n .close-btn {\n background: none;\n border: none;\n color: white;\n cursor: pointer;\n font-size: 32px;\n padding: 0;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n }\n\n .close-btn:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .messages-container {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 15px;\n }\n\n .message {\n display: flex;\n align-items: flex-end;\n gap: 10px;\n max-width: 80%;\n }\n\n .message.user {\n align-self: flex-end;\n flex-direction: row-reverse;\n }\n\n .message.bot {\n align-self: flex-start;\n }\n\n .message-bubble {\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.4;\n word-wrap: break-word;\n position: relative;\n }\n\n .message.user .message-bubble {\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n color: white;\n border-bottom-right-radius: 4px;\n }\n\n .message.bot .message-bubble {\n background: #f1f3f4;\n color: #333;\n border-bottom-left-radius: 4px;\n }\n\n .message-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 600;\n flex-shrink: 0;\n }\n\n .message.user .message-avatar {\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n color: white;\n }\n\n .message.bot .message-avatar {\n background: #e8eaf0;\n color: #666;\n }\n\n .input-container {\n padding: 20px;\n border-top: 1px solid #e1e5e9;\n display: flex;\n gap: 10px;\n align-items: center;\n }\n\n .message-input {\n flex: 1;\n border: 1px solid #e1e5e9;\n border-radius: 25px;\n padding: 12px 16px;\n font-size: 14px;\n outline: none;\n transition: border-color 0.2s ease;\n }\n\n .message-input:focus {\n border-color: var(--md-sys-color-primary);\n }\n\n .send-btn {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n border: none;\n color: white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n }\n\n .send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .loading-indicator {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #666;\n font-size: 12px;\n }\n\n .loading-dots {\n display: flex;\n gap: 4px;\n }\n\n .loading-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--md-sys-color-primary);\n animation: loading 1.4s infinite ease-in-out;\n }\n\n .loading-dot:nth-child(1) {\n animation-delay: -0.32s;\n }\n .loading-dot:nth-child(2) {\n animation-delay: -0.16s;\n }\n\n @keyframes loading {\n 0%,\n 80%,\n 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1);\n }\n }\n\n /* 스크롤바 스타일링 */\n .messages-container::-webkit-scrollbar {\n width: 6px;\n }\n\n .messages-container::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 3px;\n }\n\n .messages-container::-webkit-scrollbar-thumb {\n background: #c1c1c1;\n border-radius: 3px;\n }\n\n .messages-container::-webkit-scrollbar-thumb:hover {\n background: #a8a8a8;\n }\n\n /* 근거 버튼 */\n .evidence-btn {\n margin-top: 8px;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #d6daf0;\n background: #ffffff;\n color: #3b4cca;\n border-radius: 14px;\n padding: 6px 10px;\n font-size: 12px;\n cursor: pointer;\n transition:\n background-color 0.2s ease,\n border-color 0.2s ease;\n }\n\n .evidence-btn:hover {\n background-color: #f4f6ff;\n border-color: #c2c8ef;\n }\n\n /* 오버레이 */\n .overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.35);\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1100; /* 챗봇보다 위 */\n }\n\n .overlay.open {\n opacity: 1;\n pointer-events: auto;\n }\n\n .overlay-panel {\n width: min(520px, calc(100vw - 40px));\n max-height: min(70vh, 560px);\n background: #ffffff;\n border-radius: 14px;\n box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .overlay-header {\n padding: 14px 16px;\n background: linear-gradient(135deg, var(--md-sys-color-tertiary, #b85d5a) 0%, var(--md-sys-color-primary) 100%);\n color: #ffffff;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .overlay-title {\n font-weight: 600;\n font-size: 16px;\n }\n\n .overlay-close {\n background: none;\n border: none;\n color: #ffffff;\n font-size: 26px;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n cursor: pointer;\n }\n\n .overlay-body {\n padding: 12px 16px 16px 16px;\n overflow-y: auto;\n }\n\n .source-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .source-item {\n border: 1px solid #e6e9f2;\n border-radius: 10px;\n padding: 10px 12px;\n background: #f9fafc;\n }\n\n .source-link {\n color: #1e3a8a;\n text-decoration: none;\n display: block;\n word-break: break-all;\n }\n\n .source-link:hover {\n text-decoration: underline;\n }\n `\n\n static get properties() {\n return {\n isOpen: { type: Boolean },\n messages: { type: Array },\n inputValue: { type: String },\n isLoading: { type: Boolean },\n isSourcesOpen: { type: Boolean },\n currentSources: { type: Array }\n }\n }\n\n isOpen = false\n messages: ChatMessage[] = []\n inputValue = ''\n isLoading = false\n isSourcesOpen = false\n currentSources: SourceItem[] = []\n\n render() {\n return html`\n <div class=\"chatbot-container\">\n <!-- 챗봇 아이콘 -->\n <button class=\"chatbot-icon\" @click=\"${this.toggleChat}\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"\n />\n </svg>\n </button>\n\n <!-- 대화창 -->\n <div class=\"chat-window ${this.isOpen ? 'open' : ''}\">\n <!-- 헤더 -->\n <div class=\"chat-header\">\n <h3>챗봇 도우미</h3>\n <button class=\"close-btn\" @click=\"${this.toggleChat}\">×</button>\n </div>\n\n <!-- 메시지 영역 -->\n <div class=\"messages-container\">\n ${this.messages.length === 0\n ? html`\n <div class=\"message bot\">\n <div class=\"message-avatar\">🤖</div>\n <div class=\"message-bubble\">안녕하세요! 무엇을 도와드릴까요?</div>\n </div>\n `\n : ''}\n ${this.messages.map(\n message => html`\n <div class=\"message ${message.isUser ? 'user' : 'bot'}\">\n <div class=\"message-avatar\">${message.isUser ? '👤' : '🤖'}</div>\n <div class=\"message-bubble\">\n ${message.text}\n ${!message.isUser && message.sources && message.sources.length\n ? html`\n <div>\n <button class=\"evidence-btn\" @click=\"${() => this.openSourcesOverlay(message.sources || [])}\">\n 근거 ${message.sources.length}개 보기\n </button>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n )}\n ${this.isLoading\n ? html`\n <div class=\"message bot\">\n <div class=\"message-avatar\">🤖</div>\n <div class=\"message-bubble\">\n <div class=\"loading-indicator\">\n <span>답변 중</span>\n <div class=\"loading-dots\">\n <div class=\"loading-dot\"></div>\n <div class=\"loading-dot\"></div>\n <div class=\"loading-dot\"></div>\n </div>\n </div>\n </div>\n </div>\n `\n : ''}\n </div>\n\n <!-- 입력 영역 -->\n <div class=\"input-container\">\n <input\n class=\"message-input\"\n type=\"text\"\n placeholder=\"메시지를 입력하세요...\"\n .value=\"${this.inputValue}\"\n @input=\"${(e: Event) => (this.inputValue = (e.target as HTMLInputElement).value)}\"\n @keypress=\"${this.handleKeyPress}\"\n ?disabled=\"${this.isLoading}\"\n />\n <button class=\"send-btn\" @click=\"${this.sendMessage}\" ?disabled=\"${this.isLoading || !this.inputValue.trim()}\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n </button>\n </div>\n </div>\n <!-- 근거 오버레이 -->\n <div class=\"overlay ${this.isSourcesOpen ? 'open' : ''}\" @click=\"${this.closeSourcesOverlay}\">\n <div class=\"overlay-panel\" @click=\"${(e: Event) => e.stopPropagation()}\">\n <div class=\"overlay-header\">\n <div class=\"overlay-title\">근거 ${this.currentSources.length}개</div>\n <button class=\"overlay-close\" @click=\"${this.closeSourcesOverlay}\">×</button>\n </div>\n <div class=\"overlay-body\">\n <ul class=\"source-list\">\n ${this.currentSources.map(\n (s, idx) =>\n html` <li class=\"source-item\">\n <a class=\"source-link\" href=\"${s.url}\" target=\"_blank\" rel=\"noopener noreferrer\"\n >[#${idx + 1}] ${s.title}</a\n >\n </li>`\n )}\n </ul>\n </div>\n </div>\n </div>\n </div>\n `\n }\n\n private boundHandleEscapeKey = this.handleEscapeKey.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n // 컴포넌트가 제거될 때 이벤트 리스너 정리\n document.removeEventListener('keydown', this.boundHandleEscapeKey)\n }\n\n handleEscapeKey(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (this.isSourcesOpen) {\n this.isSourcesOpen = false\n } else if (this.isOpen) {\n this.isOpen = false\n }\n }\n }\n\n toggleChat() {\n this.isOpen = !this.isOpen\n if (this.isOpen) {\n // 챗봇이 열릴 때 ESC 키 이벤트 리스너 추가\n document.addEventListener('keydown', this.boundHandleEscapeKey)\n // 챗봇이 열릴 때 스크롤을 맨 아래로\n this.requestUpdate()\n setTimeout(() => this.scrollToBottom(), 100)\n } else {\n // 챗봇이 닫힐 때 ESC 키 이벤트 리스너 제거\n document.removeEventListener('keydown', this.boundHandleEscapeKey)\n this.isSourcesOpen = false\n this.currentSources = []\n }\n }\n\n scrollToBottom() {\n const messagesContainer = this.shadowRoot?.querySelector('.messages-container') as HTMLElement\n if (messagesContainer) {\n messagesContainer.scrollTop = messagesContainer.scrollHeight\n }\n }\n\n async sendMessage() {\n if (!this.inputValue.trim() || this.isLoading) return\n\n const userMessage: ChatMessage = {\n id: Date.now().toString(),\n text: this.inputValue.trim(),\n isUser: true,\n timestamp: new Date()\n }\n\n this.messages = [...this.messages, userMessage]\n const messageText = this.inputValue.trim()\n this.inputValue = ''\n this.isLoading = true\n\n // 사용자 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n\n // 포커스 유지를 위해 input 요소 참조 저장\n const input = this.shadowRoot?.querySelector('.message-input') as HTMLInputElement\n\n try {\n // API 호출\n const response = await fetch(CHATBOT_API_URL, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ query: messageText, top_k: 6 })\n })\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}`)\n }\n\n const data = await response.json()\n\n const botMessage: ChatMessage = {\n id: (Date.now() + 1).toString(),\n text: data?.answer?.trim() || '죄송합니다. 응답을 처리할 수 없습니다.',\n isUser: false,\n timestamp: new Date(),\n sources: data?.sources || []\n }\n\n this.messages = [...this.messages, botMessage]\n // 봇 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n } catch (error) {\n const errorMessage: ChatMessage = {\n id: (Date.now() + 1).toString(),\n text: '죄송합니다. 일시적인 오류가 발생했습니다. 잠시 후 다시 시도해주세요.',\n isUser: false,\n timestamp: new Date()\n }\n this.messages = [...this.messages, errorMessage]\n // 에러 메시지 추가 후 스크롤을 맨 아래로\n setTimeout(() => this.scrollToBottom(), 50)\n } finally {\n this.isLoading = false\n // 로딩 완료 후 포커스 복원\n setTimeout(() => {\n if (input) {\n input.focus()\n }\n }, 100)\n }\n }\n\n openSourcesOverlay(sources: SourceItem[]) {\n if (!sources || sources.length === 0) return\n this.currentSources = sources\n this.isSourcesOpen = true\n }\n\n closeSourcesOverlay() {\n this.isSourcesOpen = false\n this.currentSources = []\n }\n\n handleKeyPress(event: KeyboardEvent) {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault()\n this.sendMessage()\n }\n }\n}\n\ncustomElements.define('chatbot-widget', ChatbotWidget)\n"]}
|
package/dist-client/route.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function route(page: string): "project-
|
|
1
|
+
export default function route(page: string): "project-list" | "project-detail" | "project-completed-list" | "project-task-list" | "project-task" | "project-setting-list" | "project-update" | "project-plan-management" | "worker-type-management" | "construction-type-management" | "inspection-drawing-type-management" | "resource-list" | "task-resource-list" | undefined;
|