@iyulab/chat-components 0.3.0 → 0.5.0
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/CHANGELOG.md +146 -0
- package/README.md +133 -16
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js +6 -0
- package/dist/_virtual/_glob-assets_raw/intent-prompt.md.1907474e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/view-prompt.md.e0dbcffe.js +4 -0
- package/dist/components/blocks/UCodeBlock.d.ts +24 -2
- package/dist/components/blocks/UCodeBlock.js +65 -2
- package/dist/components/blocks/UCodeBlock.styles.js +10 -4
- package/dist/components/blocks/UFileBlock.d.ts +33 -0
- package/dist/components/blocks/UFileBlock.js +154 -0
- package/dist/components/blocks/UFileBlock.styles.js +128 -0
- package/dist/components/blocks/UJsonBlock.d.ts +44 -2
- package/dist/components/blocks/UJsonBlock.js +128 -3
- package/dist/components/blocks/UJsonBlock.styles.js +4 -4
- package/dist/components/blocks/UMarkedBlock.d.ts +44 -2
- package/dist/components/blocks/UMarkedBlock.js +154 -4
- package/dist/components/blocks/UMarkedBlock.styles.js +4 -4
- package/dist/components/blocks/URefBlock.d.ts +16 -2
- package/dist/components/blocks/URefBlock.js +58 -3
- package/dist/components/blocks/URefBlock.styles.js +4 -4
- package/dist/components/blocks/UTableBlock.d.ts +52 -0
- package/dist/components/blocks/UTableBlock.js +198 -0
- package/dist/components/blocks/UTableBlock.styles.js +133 -0
- package/dist/components/blocks/UTextBlock.d.ts +36 -2
- package/dist/components/blocks/UTextBlock.js +94 -4
- package/dist/components/blocks/UTextBlock.styles.js +4 -4
- package/dist/components/blocks/UThinkBlock.d.ts +30 -2
- package/dist/components/blocks/UThinkBlock.js +86 -4
- package/dist/components/blocks/UThinkBlock.styles.js +4 -4
- package/dist/components/blocks/UToolBlock.d.ts +19 -2
- package/dist/components/blocks/UToolBlock.js +68 -3
- package/dist/components/blocks/UToolBlock.styles.js +4 -4
- package/dist/components/buttons/UAttachButton.d.ts +21 -2
- package/dist/components/buttons/UAttachButton.js +61 -3
- package/dist/components/buttons/UAttachButton.styles.js +4 -4
- package/dist/components/buttons/UCopyButton.d.ts +19 -2
- package/dist/components/buttons/UCopyButton.js +57 -3
- package/dist/components/buttons/UCopyButton.styles.js +4 -4
- package/dist/components/buttons/UVoteButton.d.ts +14 -3
- package/dist/components/buttons/UVoteButton.js +62 -3
- package/dist/components/buttons/UVoteButton.styles.js +4 -4
- package/dist/components/intents/UQuestionIntent.d.ts +22 -0
- package/dist/components/intents/UQuestionIntent.js +41 -0
- package/dist/components/intents/UQuestionIntent.styles.js +43 -0
- package/dist/components/message/UMessage.d.ts +18 -2
- package/dist/components/message/UMessage.js +47 -2
- package/dist/components/message/UMessage.styles.js +42 -15
- package/dist/components/prompt/UPrompt.d.ts +32 -2
- package/dist/components/prompt/UPrompt.js +118 -2
- package/dist/components/prompt/UPrompt.styles.js +43 -5
- package/dist/components/references/URefCard.d.ts +30 -2
- package/dist/components/references/URefCard.js +97 -2
- package/dist/components/references/URefCard.styles.js +4 -4
- package/dist/components/references/URefCardGroup.d.ts +25 -2
- package/dist/components/references/URefCardGroup.js +69 -4
- package/dist/components/references/URefCardGroup.styles.js +4 -4
- package/dist/components/references/URefTag.d.ts +12 -2
- package/dist/components/references/URefTag.js +37 -2
- package/dist/components/references/URefTag.styles.js +4 -4
- package/dist/components/views/UChartView.d.ts +39 -0
- package/dist/components/views/UChartView.js +167 -0
- package/dist/components/views/UChartView.styles.js +86 -0
- package/dist/components/views/UImagesView.d.ts +33 -0
- package/dist/components/views/UImagesView.js +144 -0
- package/dist/components/views/UImagesView.styles.d.ts +1 -0
- package/dist/components/views/UImagesView.styles.js +219 -0
- package/dist/components/views/UMapView.d.ts +24 -0
- package/dist/components/views/UMapView.js +45 -0
- package/dist/components/views/UMapView.styles.d.ts +1 -0
- package/dist/components/views/UMapView.styles.js +47 -0
- package/dist/components/views/UVideoView.d.ts +25 -0
- package/dist/components/views/UVideoView.js +81 -0
- package/dist/components/views/UVideoView.styles.d.ts +1 -0
- package/dist/components/views/UVideoView.styles.js +36 -0
- package/dist/components/views/UView.d.ts +46 -0
- package/dist/components/views/UView.js +113 -0
- package/dist/components/views/UView.styles.d.ts +1 -0
- package/dist/components/views/UView.styles.js +33 -0
- package/dist/events/AttachEvent.d.ts +9 -0
- package/dist/events/ChoiceEvent.d.ts +9 -0
- package/dist/events/SendEvent.d.ts +7 -0
- package/dist/events/StopEvent.d.ts +7 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.js +28 -38
- package/dist/react/UAttachButton.d.ts +11 -0
- package/dist/react/UAttachButton.js +12 -0
- package/dist/react/UChartView.d.ts +9 -0
- package/dist/react/UChartView.js +10 -0
- package/dist/react/UCodeBlock.d.ts +9 -0
- package/dist/react/UCodeBlock.js +10 -0
- package/dist/react/UCopyButton.d.ts +9 -0
- package/dist/react/UCopyButton.js +10 -0
- package/dist/react/UFileBlock.d.ts +11 -0
- package/dist/react/UFileBlock.js +12 -0
- package/dist/react/UImagesView.d.ts +9 -0
- package/dist/react/UImagesView.js +10 -0
- package/dist/react/UJsonBlock.d.ts +9 -0
- package/dist/react/UJsonBlock.js +10 -0
- package/dist/react/UMapView.d.ts +9 -0
- package/dist/react/UMapView.js +10 -0
- package/dist/react/UMarkedBlock.d.ts +9 -0
- package/dist/react/UMarkedBlock.js +10 -0
- package/dist/react/UMessage.d.ts +9 -0
- package/dist/react/UMessage.js +10 -0
- package/dist/react/UPrompt.d.ts +13 -0
- package/dist/react/UPrompt.js +13 -0
- package/dist/react/UQuestionIntent.d.ts +11 -0
- package/dist/react/UQuestionIntent.js +12 -0
- package/dist/react/URefBlock.d.ts +9 -0
- package/dist/react/URefBlock.js +10 -0
- package/dist/react/URefCard.d.ts +9 -0
- package/dist/react/URefCard.js +10 -0
- package/dist/react/URefCardGroup.d.ts +9 -0
- package/dist/react/URefCardGroup.js +10 -0
- package/dist/react/URefTag.d.ts +9 -0
- package/dist/react/URefTag.js +10 -0
- package/dist/react/UTableBlock.d.ts +9 -0
- package/dist/react/UTableBlock.js +10 -0
- package/dist/react/UTextBlock.d.ts +9 -0
- package/dist/react/UTextBlock.js +10 -0
- package/dist/react/UThinkBlock.d.ts +9 -0
- package/dist/react/UThinkBlock.js +10 -0
- package/dist/react/UToolBlock.d.ts +9 -0
- package/dist/react/UToolBlock.js +10 -0
- package/dist/react/UVideoView.d.ts +9 -0
- package/dist/react/UVideoView.js +10 -0
- package/dist/react/UView.d.ts +9 -0
- package/dist/react/UView.js +10 -0
- package/dist/react/UVoteButton.d.ts +9 -0
- package/dist/react/UVoteButton.js +10 -0
- package/dist/react/index.d.ts +23 -0
- package/dist/react/index.js +23 -0
- package/dist/types/BlockItem.d.ts +21 -1
- package/dist/types/Intents.d.ts +26 -0
- package/dist/types/Intents.js +30 -0
- package/dist/types/JsonSchema.d.ts +59 -0
- package/dist/types/Views.d.ts +34 -0
- package/dist/types/Views.js +150 -0
- package/dist/utilities/IntentPromptBuilder.d.ts +40 -0
- package/dist/utilities/IntentPromptBuilder.js +95 -0
- package/dist/utilities/ViewPromptBuilder.d.ts +28 -0
- package/dist/utilities/ViewPromptBuilder.js +76 -0
- package/dist/utilities/dom-agent/DOMAgent.d.ts +74 -0
- package/dist/utilities/dom-agent/DOMController.d.ts +78 -0
- package/dist/utilities/dom-agent/DOMPromptBuilder.d.ts +54 -0
- package/dist/utilities/dom-agent/DOMScanner.d.ts +83 -0
- package/dist/utilities/dom-agent/index.d.ts +9 -0
- package/dist/utilities/dom-agent/types.d.ts +209 -0
- package/package.json +34 -18
- package/dist/components/blocks/UCodeBlock.component.d.ts +0 -23
- package/dist/components/blocks/UCodeBlock.component.js +0 -76
- package/dist/components/blocks/UJsonBlock.component.d.ts +0 -45
- package/dist/components/blocks/UJsonBlock.component.js +0 -140
- package/dist/components/blocks/UMarkedBlock.component.d.ts +0 -45
- package/dist/components/blocks/UMarkedBlock.component.js +0 -129
- package/dist/components/blocks/URefBlock.component.d.ts +0 -17
- package/dist/components/blocks/URefBlock.component.js +0 -74
- package/dist/components/blocks/UTextBlock.component.d.ts +0 -37
- package/dist/components/blocks/UTextBlock.component.js +0 -123
- package/dist/components/blocks/UThinkBlock.component.d.ts +0 -23
- package/dist/components/blocks/UThinkBlock.component.js +0 -90
- package/dist/components/blocks/UToolBlock.component.d.ts +0 -20
- package/dist/components/blocks/UToolBlock.component.js +0 -80
- package/dist/components/buttons/UAttachButton.component.d.ts +0 -22
- package/dist/components/buttons/UAttachButton.component.js +0 -89
- package/dist/components/buttons/UCopyButton.component.d.ts +0 -20
- package/dist/components/buttons/UCopyButton.component.js +0 -81
- package/dist/components/buttons/UReportButton.component.d.ts +0 -9
- package/dist/components/buttons/UReportButton.component.js +0 -36
- package/dist/components/buttons/UReportButton.d.ts +0 -7
- package/dist/components/buttons/UReportButton.js +0 -5
- package/dist/components/buttons/UReportButton.styles.js +0 -14
- package/dist/components/buttons/URetryButton.component.d.ts +0 -11
- package/dist/components/buttons/URetryButton.component.js +0 -53
- package/dist/components/buttons/URetryButton.d.ts +0 -7
- package/dist/components/buttons/URetryButton.js +0 -5
- package/dist/components/buttons/URetryButton.styles.js +0 -26
- package/dist/components/buttons/UShareButton.component.d.ts +0 -9
- package/dist/components/buttons/UShareButton.component.js +0 -36
- package/dist/components/buttons/UShareButton.d.ts +0 -7
- package/dist/components/buttons/UShareButton.js +0 -5
- package/dist/components/buttons/UShareButton.styles.js +0 -14
- package/dist/components/buttons/UVoteButton.component.d.ts +0 -15
- package/dist/components/buttons/UVoteButton.component.js +0 -70
- package/dist/components/loaders/UDotLoader.component.d.ts +0 -9
- package/dist/components/loaders/UDotLoader.component.js +0 -23
- package/dist/components/loaders/UDotLoader.d.ts +0 -7
- package/dist/components/loaders/UDotLoader.js +0 -5
- package/dist/components/loaders/UDotLoader.styles.js +0 -50
- package/dist/components/message/UMessage.component.d.ts +0 -19
- package/dist/components/message/UMessage.component.js +0 -90
- package/dist/components/prompt/UPrompt.component.d.ts +0 -25
- package/dist/components/prompt/UPrompt.component.js +0 -113
- package/dist/components/references/URefCard.component.d.ts +0 -24
- package/dist/components/references/URefCard.component.js +0 -105
- package/dist/components/references/URefCardGroup.component.d.ts +0 -25
- package/dist/components/references/URefCardGroup.component.js +0 -88
- package/dist/components/references/URefTag.component.d.ts +0 -13
- package/dist/components/references/URefTag.component.js +0 -54
- package/dist/events/UCancelEvent.d.ts +0 -6
- package/dist/events/USubmitEvent.d.ts +0 -6
- package/dist/utilities/converters.d.ts +0 -9
- package/dist/utilities/converters.js +0 -19
- /package/dist/components/{buttons/UReportButton.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
- /package/dist/components/{buttons/URetryButton.styles.d.ts → blocks/UTableBlock.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UShareButton.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
- /package/dist/components/{loaders/UDotLoader.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
import { JsonNode } from '../../types/JsonNode.js';
|
|
3
|
+
/**
|
|
4
|
+
* 툴 사용 블록 컴포넌트입니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UToolBlock extends UElement {
|
|
7
|
+
static styles: import('lit').CSSResultGroup[];
|
|
8
|
+
/** 로딩 상태 */
|
|
9
|
+
loading: boolean;
|
|
10
|
+
/** 블록 접힘 여부 */
|
|
11
|
+
collapsed: boolean;
|
|
12
|
+
/** 헤딩 텍스트 */
|
|
13
|
+
title: string;
|
|
14
|
+
/** 입력 데이터 (JSON Object) */
|
|
15
|
+
input?: JsonNode;
|
|
16
|
+
/** 출력 데이터 (JSON Object) */
|
|
17
|
+
output?: JsonNode;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
2
20
|
declare global {
|
|
3
21
|
interface HTMLElementTagNameMap {
|
|
4
22
|
"u-tool-block": UToolBlock;
|
|
5
23
|
}
|
|
6
24
|
}
|
|
7
|
-
export { UToolBlock };
|
|
@@ -1,5 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import "./UJsonBlock.js";
|
|
4
|
+
import { styles } from "./UToolBlock.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { customElement, property } from "lit/decorators.js";
|
|
7
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
|
+
import "@iyulab/components/dist/components/spinner/USpinner.js";
|
|
9
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
10
|
+
import { jsonAttrConverter } from "@iyulab/components/dist/utilities/converters.js";
|
|
11
|
+
//#region src/components/blocks/UToolBlock.ts
|
|
12
|
+
var UToolBlock = class UToolBlock extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.loading = false;
|
|
16
|
+
this.collapsed = true;
|
|
17
|
+
this.title = "";
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
this.styles = [super.styles, styles];
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return html`
|
|
24
|
+
<div class="header" @click=${() => this.collapsed = !this.collapsed}>
|
|
25
|
+
${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon lib="bootstrap" name="tools"></u-icon>`}
|
|
26
|
+
<div class="title">
|
|
27
|
+
${this.title || "Tool Usage"}
|
|
28
|
+
</div>
|
|
29
|
+
<u-icon
|
|
30
|
+
lib="internal"
|
|
31
|
+
name=${this.collapsed ? "plus-lg" : "dash-lg"}
|
|
32
|
+
></u-icon>
|
|
33
|
+
</div>
|
|
4
34
|
|
|
35
|
+
<div class="body" part="body" scrollable ?hidden=${this.collapsed}>
|
|
36
|
+
<div class="input-view" ?hidden=${!this.input}>
|
|
37
|
+
<u-json-block
|
|
38
|
+
.value=${this.input || {}}
|
|
39
|
+
></u-json-block>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="output-view" ?hidden=${!this.output}>
|
|
42
|
+
<u-icon lib="internal" name="chevron-down"></u-icon>
|
|
43
|
+
<u-json-block
|
|
44
|
+
.value=${this.output || {}}
|
|
45
|
+
></u-json-block>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([property({
|
|
52
|
+
type: Boolean,
|
|
53
|
+
reflect: true
|
|
54
|
+
}), __decorateMetadata("design:type", Boolean)], UToolBlock.prototype, "loading", void 0);
|
|
55
|
+
__decorate([property({
|
|
56
|
+
type: Boolean,
|
|
57
|
+
reflect: true
|
|
58
|
+
}), __decorateMetadata("design:type", Boolean)], UToolBlock.prototype, "collapsed", void 0);
|
|
59
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UToolBlock.prototype, "title", void 0);
|
|
60
|
+
__decorate([property({
|
|
61
|
+
type: Object,
|
|
62
|
+
converter: jsonAttrConverter()
|
|
63
|
+
}), __decorateMetadata("design:type", Object)], UToolBlock.prototype, "input", void 0);
|
|
64
|
+
__decorate([property({
|
|
65
|
+
type: Object,
|
|
66
|
+
converter: jsonAttrConverter()
|
|
67
|
+
}), __decorateMetadata("design:type", Object)], UToolBlock.prototype, "output", void 0);
|
|
68
|
+
UToolBlock = __decorate([customElement("u-tool-block")], UToolBlock);
|
|
69
|
+
//#endregion
|
|
5
70
|
export { UToolBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UToolBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
@@ -62,5 +62,5 @@ const styles = css`
|
|
|
62
62
|
flex-direction: column;
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
|
-
|
|
65
|
+
//#endregion
|
|
66
66
|
export { styles };
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 파일 첨부 버튼 컴포넌트입니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UAttachButton extends UElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
/** 첨부 파일 유형 제한, 컴마로 구분된 MIME 타입 문자열 (예: "image/*,application/pdf") */
|
|
8
|
+
accept?: string;
|
|
9
|
+
/** 다중 파일 선택 가능 여부 */
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
input?: HTMLInputElement;
|
|
12
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
13
|
+
/**
|
|
14
|
+
* 버튼 클릭 핸들러
|
|
15
|
+
*/
|
|
16
|
+
private handleButtonClick;
|
|
17
|
+
/**
|
|
18
|
+
* 파일 선택 이벤트 핸들러
|
|
19
|
+
*/
|
|
20
|
+
private handleInputChange;
|
|
21
|
+
}
|
|
2
22
|
declare global {
|
|
3
23
|
interface HTMLElementTagNameMap {
|
|
4
24
|
"u-attach-button": UAttachButton;
|
|
5
25
|
}
|
|
6
26
|
}
|
|
7
|
-
export { UAttachButton };
|
|
@@ -1,5 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UAttachButton.
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UAttachButton.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
7
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
8
|
+
import "@iyulab/components/dist/components/tooltip/UTooltip.js";
|
|
9
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
10
|
+
//#region src/components/buttons/UAttachButton.ts
|
|
11
|
+
var _ref;
|
|
12
|
+
var UAttachButton = class UAttachButton extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.multiple = false;
|
|
16
|
+
this.handleButtonClick = () => {
|
|
17
|
+
if (!this.input) return;
|
|
18
|
+
this.input.click();
|
|
19
|
+
};
|
|
20
|
+
this.handleInputChange = (e) => {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
const target = e.target;
|
|
24
|
+
const files = target.files;
|
|
25
|
+
if (!files || files.length === 0) return;
|
|
26
|
+
this.fire("attach", { detail: { files: Array.from(files) } });
|
|
27
|
+
target.value = "";
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = [super.styles, styles];
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html`
|
|
35
|
+
<u-button part="base"
|
|
36
|
+
variant="ghost"
|
|
37
|
+
@click=${this.handleButtonClick}>
|
|
38
|
+
<u-icon part="icon"
|
|
39
|
+
lib="bootstrap"
|
|
40
|
+
name="paperclip"
|
|
41
|
+
></u-icon>
|
|
42
|
+
</u-button>
|
|
4
43
|
|
|
44
|
+
<u-tooltip for="u-button" placement="bottom" distance="8">
|
|
45
|
+
<slot></slot>
|
|
46
|
+
</u-tooltip>
|
|
47
|
+
|
|
48
|
+
<input
|
|
49
|
+
hidden
|
|
50
|
+
type="file"
|
|
51
|
+
?multiple=${this.multiple}
|
|
52
|
+
.accept=${this.accept || "*"}
|
|
53
|
+
@change=${this.handleInputChange}
|
|
54
|
+
/>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UAttachButton.prototype, "accept", void 0);
|
|
59
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UAttachButton.prototype, "multiple", void 0);
|
|
60
|
+
__decorate([query("input[type=\"file\"]"), __decorateMetadata("design:type", typeof (_ref = typeof HTMLInputElement !== "undefined" && HTMLInputElement) === "function" ? _ref : Object)], UAttachButton.prototype, "input", void 0);
|
|
61
|
+
UAttachButton = __decorate([customElement("u-attach-button")], UAttachButton);
|
|
62
|
+
//#endregion
|
|
5
63
|
export { UAttachButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/buttons/UAttachButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host(:empty) u-tooltip {
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
@@ -10,5 +10,5 @@ const styles = css`
|
|
|
10
10
|
font-size: 16px;
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
13
|
-
|
|
13
|
+
//#endregion
|
|
14
14
|
export { styles };
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 클릭 시 클립보드에 텍스트를 복사하는 버튼입니다. 복사 상태를 표시하기 위해 아이콘이 변경됩니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UCopyButton extends UElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
/** 클립보드 복사 후 재사용 대기 시간 (ms) */
|
|
8
|
+
delay: number;
|
|
9
|
+
/** 복사할 텍스트를 설정합니다. */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** 클립보드 복사 상태를 나타내는 플래그입니다. */
|
|
12
|
+
isCopied: boolean;
|
|
13
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
14
|
+
/**
|
|
15
|
+
* 클립보드에 텍스트를 복사하는 메서드입니다.
|
|
16
|
+
* 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
|
|
17
|
+
*/
|
|
18
|
+
private copyToClipboard;
|
|
19
|
+
}
|
|
2
20
|
declare global {
|
|
3
21
|
interface HTMLElementTagNameMap {
|
|
4
22
|
"u-copy-button": UCopyButton;
|
|
5
23
|
}
|
|
6
24
|
}
|
|
7
|
-
export { UCopyButton };
|
|
@@ -1,5 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { styles } from "./UCopyButton.styles.js";
|
|
2
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
7
|
+
import "@iyulab/components/dist/components/icon-button/UIconButton.js";
|
|
8
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
9
|
+
import "@iyulab/components/dist/components/tooltip/UTooltip.js";
|
|
10
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
11
|
+
//#region src/components/buttons/UCopyButton.ts
|
|
12
|
+
var UCopyButton = class UCopyButton extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.delay = 1e3;
|
|
16
|
+
this.isCopied = false;
|
|
17
|
+
this.copyToClipboard = async () => {
|
|
18
|
+
if (!this.value) return;
|
|
19
|
+
if (this.isCopied) return;
|
|
20
|
+
try {
|
|
21
|
+
await window.navigator.clipboard.writeText(this.value);
|
|
22
|
+
if (this.delay <= 0) return;
|
|
23
|
+
this.isCopied = true;
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
this.isCopied = false;
|
|
26
|
+
}, this.delay);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error("Failed to copy text to clipboard:", error);
|
|
29
|
+
this.isCopied = false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.styles = [super.styles, styles];
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return html`
|
|
38
|
+
<u-button part="base"
|
|
39
|
+
variant="ghost"
|
|
40
|
+
?disabled=${this.isCopied}
|
|
41
|
+
@click=${this.copyToClipboard}>
|
|
42
|
+
<u-icon part="icon"
|
|
43
|
+
lib="bootstrap"
|
|
44
|
+
name=${this.isCopied ? "check-lg" : "copy"}
|
|
45
|
+
></u-icon>
|
|
46
|
+
</u-button>
|
|
4
47
|
|
|
48
|
+
<u-tooltip for="u-button" placement="bottom" distance="8">
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</u-tooltip>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UCopyButton.prototype, "delay", void 0);
|
|
55
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCopyButton.prototype, "value", void 0);
|
|
56
|
+
__decorate([state(), __decorateMetadata("design:type", Boolean)], UCopyButton.prototype, "isCopied", void 0);
|
|
57
|
+
UCopyButton = __decorate([customElement("u-copy-button")], UCopyButton);
|
|
58
|
+
//#endregion
|
|
5
59
|
export { UCopyButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/buttons/UCopyButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host(:empty) u-tooltip {
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
@@ -14,5 +14,5 @@ const styles = css`
|
|
|
14
14
|
color: var(--u-green-500);
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
|
-
|
|
17
|
+
//#endregion
|
|
18
18
|
export { styles };
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/** 투표 상태 타입 */
|
|
3
|
+
export type VoteValue = 'none' | 'up' | 'down';
|
|
4
|
+
/**
|
|
5
|
+
* 투표 버튼 컴포넌트입니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UVoteButton extends UElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
/** 현재 투표 상태 */
|
|
10
|
+
value: VoteValue;
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
private handleUpButtonClick;
|
|
13
|
+
private handleDownButtonClick;
|
|
14
|
+
}
|
|
2
15
|
declare global {
|
|
3
16
|
interface HTMLElementTagNameMap {
|
|
4
17
|
'u-vote-button': UVoteButton;
|
|
5
18
|
}
|
|
6
19
|
}
|
|
7
|
-
export { UVoteButton };
|
|
8
|
-
export type { VoteValue } from './UVoteButton.component.js';
|
|
@@ -1,5 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UVoteButton.
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UVoteButton.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
7
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
8
|
+
import "@iyulab/components/dist/components/tooltip/UTooltip.js";
|
|
9
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
10
|
+
//#region src/components/buttons/UVoteButton.ts
|
|
11
|
+
var UVoteButton = class UVoteButton extends UElement {
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.value = "none";
|
|
15
|
+
this.handleUpButtonClick = () => {
|
|
16
|
+
this.value = this.value === "up" ? "none" : "up";
|
|
17
|
+
this.dispatchEvent(new Event("change", {
|
|
18
|
+
bubbles: true,
|
|
19
|
+
composed: true
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
this.handleDownButtonClick = () => {
|
|
23
|
+
this.value = this.value === "down" ? "none" : "down";
|
|
24
|
+
this.dispatchEvent(new Event("change", {
|
|
25
|
+
bubbles: true,
|
|
26
|
+
composed: true
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = [super.styles, styles];
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html`
|
|
35
|
+
<u-button class="up-btn" part="up-btn"
|
|
36
|
+
variant="ghost"
|
|
37
|
+
@click=${this.handleUpButtonClick}>
|
|
38
|
+
<u-icon part="icon"
|
|
39
|
+
lib="bootstrap"
|
|
40
|
+
name=${this.value === "up" ? "hand-thumbs-up-fill" : "hand-thumbs-up"}
|
|
41
|
+
></u-icon>
|
|
42
|
+
</u-button>
|
|
43
|
+
<u-button class="down-btn" part="down-btn"
|
|
44
|
+
variant="ghost"
|
|
45
|
+
@click=${this.handleDownButtonClick}>
|
|
46
|
+
<u-icon part="icon"
|
|
47
|
+
lib="bootstrap"
|
|
48
|
+
name=${this.value === "down" ? "hand-thumbs-down-fill" : "hand-thumbs-down"}
|
|
49
|
+
></u-icon>
|
|
50
|
+
</u-button>
|
|
4
51
|
|
|
52
|
+
<u-tooltip for=".up-btn" placement="bottom" distance="8">
|
|
53
|
+
<slot name="up"></slot>
|
|
54
|
+
</u-tooltip>
|
|
55
|
+
<u-tooltip for=".down-btn" placement="bottom" distance="8">
|
|
56
|
+
<slot name="down"></slot>
|
|
57
|
+
</u-tooltip>
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", Object)], UVoteButton.prototype, "value", void 0);
|
|
62
|
+
UVoteButton = __decorate([customElement("u-vote-button")], UVoteButton);
|
|
63
|
+
//#endregion
|
|
5
64
|
export { UVoteButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/buttons/UVoteButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: row;
|
|
@@ -15,5 +15,5 @@ const styles = css`
|
|
|
15
15
|
font-size: 16px;
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
|
-
|
|
18
|
+
//#endregion
|
|
19
19
|
export { styles };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* 질문/선택지 제안 블록 컴포넌트
|
|
5
|
+
*
|
|
6
|
+
* LLM이 질문 텍스트(`question`)와 클릭 선택지(`choices`)를 제시하고,
|
|
7
|
+
* `input: true`일 때는 사용자가 직접 텍스트를 입력할 수도 있습니다.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UQuestionIntent extends UElement {
|
|
10
|
+
static styles: import('lit').CSSResultGroup[];
|
|
11
|
+
/** LLM이 제시하는 질문 텍스트 */
|
|
12
|
+
question?: string;
|
|
13
|
+
/** 클릭 가능한 선택지 목록 */
|
|
14
|
+
choices: string[];
|
|
15
|
+
render(): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
16
|
+
private handleChoiceClick;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
"u-question-intent": UQuestionIntent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UQuestionIntent.styles.js";
|
|
4
|
+
import { html, nothing } from "lit";
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
7
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
8
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
9
|
+
//#region src/components/intents/UQuestionIntent.ts
|
|
10
|
+
var UQuestionIntent = class UQuestionIntent extends UElement {
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.choices = [];
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [super.styles, styles];
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
if (!this.choices || this.choices.length === 0) return nothing;
|
|
20
|
+
return html`
|
|
21
|
+
<p class="question" ?hidden=${!this.question}>${this.question}</p>
|
|
22
|
+
<div class="choices">
|
|
23
|
+
${repeat(this.choices, (value, index) => html`
|
|
24
|
+
<u-button @click=${() => this.handleChoiceClick(index)}>
|
|
25
|
+
${value}
|
|
26
|
+
</u-button>
|
|
27
|
+
`)}
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
handleChoiceClick(index) {
|
|
32
|
+
const value = this.choices[index];
|
|
33
|
+
if (!value) return;
|
|
34
|
+
this.fire("choice", { detail: { value } });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UQuestionIntent.prototype, "question", void 0);
|
|
38
|
+
__decorate([property({ type: Array }), __decorateMetadata("design:type", Array)], UQuestionIntent.prototype, "choices", void 0);
|
|
39
|
+
UQuestionIntent = __decorate([customElement("u-question-intent")], UQuestionIntent);
|
|
40
|
+
//#endregion
|
|
41
|
+
export { UQuestionIntent };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/intents/UQuestionIntent.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 0.5em;
|
|
8
|
+
margin: 0.75em 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.question {
|
|
12
|
+
margin: 0 0 0.25em;
|
|
13
|
+
font-size: 0.9em;
|
|
14
|
+
color: var(--u-txt-color-weak);
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.choices {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 0.4em;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
u-button {
|
|
25
|
+
display: block;
|
|
26
|
+
width: fit-content;
|
|
27
|
+
padding: 0.5em 0.75em;
|
|
28
|
+
font-size: 0.875em;
|
|
29
|
+
justify-content: flex-start;
|
|
30
|
+
line-height: 1.4;
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
box-shadow: 0 1px 2px var(--u-shadow-color-weaker);
|
|
33
|
+
transition: all 0.15s ease;
|
|
34
|
+
}
|
|
35
|
+
u-button:hover {
|
|
36
|
+
transform: translateY(-1px);
|
|
37
|
+
}
|
|
38
|
+
u-button:active {
|
|
39
|
+
transform: translateY(0);
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { styles };
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/** 메시지 variant 타입 */
|
|
3
|
+
export type MessageVariant = 'default' | 'bubble';
|
|
4
|
+
/** 메시지 위치 타입 */
|
|
5
|
+
export type MessagePosition = 'left' | 'right';
|
|
6
|
+
/** 메시지 너비 타입 */
|
|
7
|
+
export type MessageFit = 'full' | 'auto';
|
|
8
|
+
/**
|
|
9
|
+
* 채팅 메시지 컴포넌트입니다.
|
|
10
|
+
* 슬롯을 통해 다양한 블록 컴포넌트를 자유롭게 배치할 수 있습니다.
|
|
11
|
+
*/
|
|
12
|
+
export declare class UMessage extends UElement {
|
|
13
|
+
static styles: import('lit').CSSResultGroup[];
|
|
14
|
+
loading: boolean;
|
|
15
|
+
variant: MessageVariant;
|
|
16
|
+
position: MessagePosition;
|
|
17
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
18
|
+
}
|
|
2
19
|
declare global {
|
|
3
20
|
interface HTMLElementTagNameMap {
|
|
4
21
|
"u-message": UMessage;
|
|
5
22
|
}
|
|
6
23
|
}
|
|
7
|
-
export { UMessage };
|
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UMessage.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
7
|
+
//#region src/components/message/UMessage.ts
|
|
8
|
+
var UMessage = class UMessage extends UElement {
|
|
9
|
+
constructor(..._args) {
|
|
10
|
+
super(..._args);
|
|
11
|
+
this.loading = false;
|
|
12
|
+
this.variant = "default";
|
|
13
|
+
this.position = "left";
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.styles = [super.styles, styles];
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html`
|
|
20
|
+
<slot name="header"></slot>
|
|
2
21
|
|
|
3
|
-
|
|
22
|
+
<div class="body" part="body" variant=${this.variant} position=${this.position}>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
<svg class="dot-loader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
|
|
25
|
+
?hidden=${!this.loading}>
|
|
26
|
+
<circle class="d0" cx="4" cy="12" r="3" />
|
|
27
|
+
<circle class="d1" cx="12" cy="12" r="3" />
|
|
28
|
+
<circle class="d2" cx="20" cy="12" r="3" />
|
|
29
|
+
</svg>
|
|
30
|
+
</div>
|
|
4
31
|
|
|
32
|
+
<slot name="footer" ?hidden=${this.loading}></slot>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
__decorate([property({
|
|
37
|
+
type: Boolean,
|
|
38
|
+
reflect: true
|
|
39
|
+
}), __decorateMetadata("design:type", Boolean)], UMessage.prototype, "loading", void 0);
|
|
40
|
+
__decorate([property({
|
|
41
|
+
type: String,
|
|
42
|
+
reflect: true
|
|
43
|
+
}), __decorateMetadata("design:type", Object)], UMessage.prototype, "variant", void 0);
|
|
44
|
+
__decorate([property({
|
|
45
|
+
type: String,
|
|
46
|
+
reflect: true
|
|
47
|
+
}), __decorateMetadata("design:type", Object)], UMessage.prototype, "position", void 0);
|
|
48
|
+
UMessage = __decorate([customElement("u-message")], UMessage);
|
|
49
|
+
//#endregion
|
|
5
50
|
export { UMessage };
|