@iyulab/chat-components 0.1.1 → 0.3.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.
Files changed (115) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/dist/components/blocks/UCodeBlock.component.d.ts +7 -8
  3. package/dist/components/blocks/UCodeBlock.component.js +32 -21
  4. package/dist/components/blocks/UCodeBlock.styles.js +7 -6
  5. package/dist/components/{json-viewer/UJsonViewer.component.d.ts → blocks/UJsonBlock.component.d.ts} +5 -4
  6. package/dist/components/{json-viewer/UJsonViewer.component.js → blocks/UJsonBlock.component.js} +20 -17
  7. package/dist/components/blocks/UJsonBlock.d.ts +7 -0
  8. package/dist/components/blocks/UJsonBlock.js +5 -0
  9. package/dist/components/blocks/UMarkedBlock.component.d.ts +30 -9
  10. package/dist/components/blocks/UMarkedBlock.component.js +75 -26
  11. package/dist/components/blocks/UMarkedBlock.styles.js +288 -949
  12. package/dist/components/blocks/URefBlock.component.d.ts +17 -0
  13. package/dist/components/blocks/URefBlock.component.js +74 -0
  14. package/dist/components/blocks/URefBlock.d.ts +7 -0
  15. package/dist/components/blocks/URefBlock.js +5 -0
  16. package/dist/components/blocks/URefBlock.styles.js +75 -0
  17. package/dist/components/blocks/UThinkBlock.component.d.ts +3 -8
  18. package/dist/components/blocks/UThinkBlock.component.js +28 -22
  19. package/dist/components/blocks/UThinkBlock.styles.js +35 -54
  20. package/dist/components/blocks/UToolBlock.component.d.ts +13 -9
  21. package/dist/components/blocks/UToolBlock.component.js +30 -76
  22. package/dist/components/blocks/UToolBlock.styles.js +21 -62
  23. package/dist/components/buttons/UAttachButton.component.d.ts +3 -5
  24. package/dist/components/buttons/UAttachButton.component.js +30 -19
  25. package/dist/components/buttons/UAttachButton.styles.js +5 -12
  26. package/dist/components/buttons/UCopyButton.component.d.ts +3 -8
  27. package/dist/components/buttons/UCopyButton.component.js +29 -53
  28. package/dist/components/buttons/UCopyButton.styles.js +8 -37
  29. package/dist/components/buttons/UReportButton.component.d.ts +9 -0
  30. package/dist/components/buttons/UReportButton.component.js +36 -0
  31. package/dist/components/buttons/UReportButton.d.ts +7 -0
  32. package/dist/components/buttons/UReportButton.js +5 -0
  33. package/dist/components/buttons/UReportButton.styles.js +14 -0
  34. package/dist/components/buttons/URetryButton.component.d.ts +11 -0
  35. package/dist/components/buttons/{USendButton.component.js → URetryButton.component.js} +21 -14
  36. package/dist/components/buttons/URetryButton.d.ts +7 -0
  37. package/dist/components/buttons/URetryButton.js +5 -0
  38. package/dist/components/buttons/URetryButton.styles.d.ts +1 -0
  39. package/dist/components/buttons/URetryButton.styles.js +26 -0
  40. package/dist/components/buttons/UShareButton.component.d.ts +9 -0
  41. package/dist/components/buttons/UShareButton.component.js +36 -0
  42. package/dist/components/buttons/UShareButton.d.ts +7 -0
  43. package/dist/components/buttons/UShareButton.js +5 -0
  44. package/dist/components/buttons/UShareButton.styles.d.ts +1 -0
  45. package/dist/components/buttons/UShareButton.styles.js +14 -0
  46. package/dist/components/buttons/UVoteButton.component.d.ts +15 -0
  47. package/dist/components/buttons/UVoteButton.component.js +70 -0
  48. package/dist/components/buttons/UVoteButton.d.ts +8 -0
  49. package/dist/components/buttons/UVoteButton.js +5 -0
  50. package/dist/components/buttons/UVoteButton.styles.d.ts +1 -0
  51. package/dist/components/buttons/UVoteButton.styles.js +19 -0
  52. package/dist/components/loaders/UDotLoader.component.d.ts +9 -0
  53. package/dist/components/loaders/UDotLoader.component.js +23 -0
  54. package/dist/components/loaders/UDotLoader.d.ts +7 -0
  55. package/dist/components/loaders/UDotLoader.js +5 -0
  56. package/dist/components/loaders/UDotLoader.styles.d.ts +1 -0
  57. package/dist/components/loaders/UDotLoader.styles.js +50 -0
  58. package/dist/components/message/UMessage.component.d.ts +12 -6
  59. package/dist/components/message/UMessage.component.js +45 -59
  60. package/dist/components/message/UMessage.d.ts +0 -1
  61. package/dist/components/message/UMessage.styles.js +30 -49
  62. package/dist/components/prompt/UPrompt.component.d.ts +25 -0
  63. package/dist/components/prompt/UPrompt.component.js +113 -0
  64. package/dist/components/prompt/UPrompt.d.ts +7 -0
  65. package/dist/components/prompt/UPrompt.js +5 -0
  66. package/dist/components/prompt/UPrompt.styles.d.ts +1 -0
  67. package/dist/components/prompt/UPrompt.styles.js +42 -0
  68. package/dist/components/references/URefCard.component.d.ts +24 -0
  69. package/dist/components/references/URefCard.component.js +105 -0
  70. package/dist/components/references/URefCard.d.ts +7 -0
  71. package/dist/components/references/URefCard.js +5 -0
  72. package/dist/components/references/URefCard.styles.d.ts +1 -0
  73. package/dist/components/references/URefCard.styles.js +103 -0
  74. package/dist/components/references/URefCardGroup.component.d.ts +25 -0
  75. package/dist/components/references/URefCardGroup.component.js +88 -0
  76. package/dist/components/references/URefCardGroup.d.ts +7 -0
  77. package/dist/components/references/URefCardGroup.js +5 -0
  78. package/dist/components/references/URefCardGroup.styles.d.ts +1 -0
  79. package/dist/components/references/URefCardGroup.styles.js +69 -0
  80. package/dist/components/references/URefTag.component.d.ts +13 -0
  81. package/dist/components/references/URefTag.component.js +54 -0
  82. package/dist/components/references/URefTag.d.ts +7 -0
  83. package/dist/components/references/URefTag.js +5 -0
  84. package/dist/components/references/URefTag.styles.d.ts +1 -0
  85. package/dist/components/references/URefTag.styles.js +51 -0
  86. package/dist/events/UCancelEvent.d.ts +6 -0
  87. package/dist/index.d.ts +16 -5
  88. package/dist/index.js +25 -9
  89. package/dist/types/BlockItem.d.ts +42 -0
  90. package/dist/types/JsonNode.d.ts +20 -0
  91. package/dist/types/References.d.ts +28 -0
  92. package/dist/utilities/converters.d.ts +9 -0
  93. package/dist/utilities/converters.js +19 -0
  94. package/package.json +10 -11
  95. package/dist/components/buttons/USendButton.component.d.ts +0 -13
  96. package/dist/components/buttons/USendButton.d.ts +0 -7
  97. package/dist/components/buttons/USendButton.js +0 -5
  98. package/dist/components/buttons/USendButton.styles.js +0 -23
  99. package/dist/components/buttons/UThinkButton.component.d.ts +0 -19
  100. package/dist/components/buttons/UThinkButton.component.js +0 -73
  101. package/dist/components/buttons/UThinkButton.d.ts +0 -7
  102. package/dist/components/buttons/UThinkButton.js +0 -5
  103. package/dist/components/buttons/UThinkButton.styles.js +0 -72
  104. package/dist/components/json-viewer/UJsonViewer.d.ts +0 -7
  105. package/dist/components/json-viewer/UJsonViewer.js +0 -5
  106. package/dist/components/json-viewer/UJsonViewer.lib.d.ts +0 -16
  107. package/dist/components/json-viewer/UJsonViewer.lib.js +0 -28
  108. package/dist/components/message/UMessage.types.d.ts +0 -21
  109. package/dist/events/UStopEvent.d.ts +0 -6
  110. package/dist/internals/date-helpers.d.ts +0 -8
  111. package/dist/internals/date-helpers.js +0 -27
  112. /package/dist/components/{buttons/USendButton.styles.d.ts → blocks/UJsonBlock.styles.d.ts} +0 -0
  113. /package/dist/components/{json-viewer/UJsonViewer.styles.js → blocks/UJsonBlock.styles.js} +0 -0
  114. /package/dist/components/{buttons/UThinkButton.styles.d.ts → blocks/URefBlock.styles.d.ts} +0 -0
  115. /package/dist/components/{json-viewer/UJsonViewer.styles.d.ts → buttons/UReportButton.styles.d.ts} +0 -0
@@ -0,0 +1,36 @@
1
+ import { html } from 'lit';
2
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
+ import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
4
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
5
+ import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
6
+ import { styles } from './UShareButton.styles.js';
7
+
8
+ class UShareButton extends BaseElement {
9
+ static {
10
+ this.styles = [super.styles, styles];
11
+ }
12
+ static {
13
+ this.dependencies = {
14
+ "u-icon": UIcon,
15
+ "u-button": UButton,
16
+ "u-tooltip": UTooltip
17
+ };
18
+ }
19
+ render() {
20
+ return html`
21
+ <u-button part="base"
22
+ variant="borderless">
23
+ <u-icon part="icon"
24
+ lib="internal"
25
+ name="share"
26
+ ></u-icon>
27
+ </u-button>
28
+
29
+ <u-tooltip for="u-button" placement="bottom" distance="8">
30
+ <slot></slot>
31
+ </u-tooltip>
32
+ `;
33
+ }
34
+ }
35
+
36
+ export { UShareButton };
@@ -0,0 +1,7 @@
1
+ import { UShareButton } from './UShareButton.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'u-share-button': UShareButton;
5
+ }
6
+ }
7
+ export { UShareButton };
@@ -0,0 +1,5 @@
1
+ import { UShareButton } from './UShareButton.component.js';
2
+
3
+ UShareButton.define("u-share-button");
4
+
5
+ export { UShareButton };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,14 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host(:empty) u-tooltip {
5
+ display: none;
6
+ }
7
+
8
+ u-button {
9
+ color: var(--u-txt-color-weak);
10
+ font-size: 16px;
11
+ }
12
+ `;
13
+
14
+ export { styles };
@@ -0,0 +1,15 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /** 투표 상태 타입 */
3
+ export type VoteValue = 'none' | 'up' | 'down';
4
+ /**
5
+ * 투표 버튼 컴포넌트입니다.
6
+ */
7
+ export declare class UVoteButton extends BaseElement {
8
+ static styles: import('lit').CSSResultGroup[];
9
+ static dependencies: Record<string, typeof BaseElement>;
10
+ /** 현재 투표 상태 */
11
+ value: VoteValue;
12
+ render(): import('lit-html').TemplateResult<1>;
13
+ private handleUpButtonClick;
14
+ private handleDownButtonClick;
15
+ }
@@ -0,0 +1,70 @@
1
+ import { html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
4
+ import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
5
+ import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
6
+ import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
7
+ import { styles } from './UVoteButton.styles.js';
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __decorateClass = (decorators, target, key, kind) => {
11
+ var result = void 0 ;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (decorator(target, key, result) ) || result;
15
+ if (result) __defProp(target, key, result);
16
+ return result;
17
+ };
18
+ class UVoteButton extends BaseElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.value = "none";
22
+ this.handleUpButtonClick = () => {
23
+ this.value = this.value === "up" ? "none" : "up";
24
+ this.emit("u-change", { value: this.value });
25
+ };
26
+ this.handleDownButtonClick = () => {
27
+ this.value = this.value === "down" ? "none" : "down";
28
+ this.emit("u-change", { value: this.value });
29
+ };
30
+ }
31
+ static {
32
+ this.styles = [super.styles, styles];
33
+ }
34
+ static {
35
+ this.dependencies = {
36
+ "u-icon": UIcon,
37
+ "u-button": UButton,
38
+ "u-tooltip": UTooltip
39
+ };
40
+ }
41
+ render() {
42
+ return html`
43
+ <u-button class="up-btn" part="up-btn"
44
+ variant="borderless"
45
+ @click=${this.handleUpButtonClick}>
46
+ <u-icon part="icon"
47
+ lib="internal"
48
+ name=${this.value === "up" ? "hand-thumbs-up-fill" : "hand-thumbs-up"}
49
+ ></u-icon>
50
+ </u-button>
51
+ <u-button class="down-btn" part="down-btn"
52
+ variant="borderless"
53
+ @click=${this.handleDownButtonClick}>
54
+ <u-icon part="icon"
55
+ lib="internal"
56
+ name=${this.value === "down" ? "hand-thumbs-down-fill" : "hand-thumbs-down"}
57
+ ></u-icon>
58
+ </u-button>
59
+
60
+ <u-tooltip for="u-button" placement="bottom" distance="8">
61
+ <slot></slot>
62
+ </u-tooltip>
63
+ `;
64
+ }
65
+ }
66
+ __decorateClass([
67
+ property({ type: String })
68
+ ], UVoteButton.prototype, "value");
69
+
70
+ export { UVoteButton };
@@ -0,0 +1,8 @@
1
+ import { UVoteButton } from './UVoteButton.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'u-vote-button': UVoteButton;
5
+ }
6
+ }
7
+ export { UVoteButton };
8
+ export type { VoteValue } from './UVoteButton.component.js';
@@ -0,0 +1,5 @@
1
+ import { UVoteButton } from './UVoteButton.component.js';
2
+
3
+ UVoteButton.define("u-vote-button");
4
+
5
+ export { UVoteButton };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,19 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host {
5
+ display: flex;
6
+ flex-direction: row;
7
+ align-items: center;
8
+ }
9
+ :host(:empty) u-tooltip {
10
+ display: none;
11
+ }
12
+
13
+ u-button {
14
+ color: var(--u-txt-color-weak);
15
+ font-size: 16px;
16
+ }
17
+ `;
18
+
19
+ export { styles };
@@ -0,0 +1,9 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /**
3
+ * 점 3개 로더 컴포넌트입니다.
4
+ */
5
+ export declare class UDotLoader extends BaseElement {
6
+ static styles: import('lit').CSSResultGroup[];
7
+ static dependencies: Record<string, typeof BaseElement>;
8
+ render(): import('lit-html').TemplateResult<1>;
9
+ }
@@ -0,0 +1,23 @@
1
+ import { html } from 'lit';
2
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
+ import { styles } from './UDotLoader.styles.js';
4
+
5
+ class UDotLoader extends BaseElement {
6
+ static {
7
+ this.styles = [super.styles, styles];
8
+ }
9
+ static {
10
+ this.dependencies = {};
11
+ }
12
+ render() {
13
+ return html`
14
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
15
+ <circle class="d0" cx="4" cy="12" r="3" />
16
+ <circle class="d1" cx="12" cy="12" r="3" />
17
+ <circle class="d2" cx="20" cy="12" r="3" />
18
+ </svg>
19
+ `;
20
+ }
21
+ }
22
+
23
+ export { UDotLoader };
@@ -0,0 +1,7 @@
1
+ import { UDotLoader } from './UDotLoader.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'u-dot-loader': UDotLoader;
5
+ }
6
+ }
7
+ export { UDotLoader };
@@ -0,0 +1,5 @@
1
+ import { UDotLoader } from './UDotLoader.component.js';
2
+
3
+ UDotLoader.define("u-dot-loader");
4
+
5
+ export { UDotLoader };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,50 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ svg {
5
+ width: 1em;
6
+ height: 1em;
7
+ fill: currentColor;
8
+ display: inline-block;
9
+ vertical-align: middle;
10
+ }
11
+
12
+ circle {
13
+ animation: bounce 1.05s infinite;
14
+ transform-box: fill-box;
15
+ transform-origin: center;
16
+ }
17
+
18
+ circle.d1 {
19
+ animation-delay: 0.1s;
20
+ }
21
+
22
+ circle.d2 {
23
+ animation-delay: 0.2s;
24
+ }
25
+
26
+ @media (prefers-reduced-motion: reduce) {
27
+ circle {
28
+ animation: none;
29
+ transform: none;
30
+ }
31
+ }
32
+
33
+ @keyframes bounce {
34
+ 0%,57.14% {
35
+ animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
36
+ transform: translateY(0);
37
+ }
38
+
39
+ 28.57% {
40
+ animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
41
+ transform: translateY(-6px);
42
+ }
43
+
44
+ 100% {
45
+ transform: translateY(0);
46
+ }
47
+ }
48
+ `;
49
+
50
+ export { styles };
@@ -1,13 +1,19 @@
1
1
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- import { BlockItem } from './UMessage.types.js';
2
+ import { BlockItem } from '../../types/BlockItem';
3
+ /** 메시지 variant 타입 */
4
+ export type MessageVariant = 'default' | 'bubble';
5
+ /** 메시지 위치 타입 */
6
+ export type MessagePosition = 'left' | 'right';
7
+ /**
8
+ * 채팅 메시지 컴포넌트입니다.
9
+ * 다양한 유형의 블록 아이템과 인용 출처를 렌더링할 수 있습니다.
10
+ */
3
11
  export declare class UMessage extends BaseElement {
4
12
  static styles: import('lit').CSSResultGroup[];
5
13
  static dependencies: Record<string, typeof BaseElement>;
14
+ variant: MessageVariant;
15
+ position: MessagePosition;
16
+ loading: boolean;
6
17
  items?: BlockItem[];
7
- timestamp?: string;
8
18
  render(): import('lit-html').TemplateResult<1>;
9
- /**
10
- * 텍스트 및 마크다운 블록의 내용을 모아서 하나의 문자열로 반환합니다.
11
- */
12
- private getTextValue;
13
19
  }
@@ -2,12 +2,12 @@ import { nothing, html } from 'lit';
2
2
  import { property } from 'lit/decorators.js';
3
3
  import { repeat } from 'lit/directives/repeat.js';
4
4
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
5
- import { UCopyButton } from '../buttons/UCopyButton.component.js';
6
5
  import { UTextBlock } from '../blocks/UTextBlock.component.js';
7
6
  import { UMarkedBlock } from '../blocks/UMarkedBlock.component.js';
8
7
  import { UThinkBlock } from '../blocks/UThinkBlock.component.js';
9
8
  import { UToolBlock } from '../blocks/UToolBlock.component.js';
10
- import { format } from '../../internals/date-helpers.js';
9
+ import { URefBlock } from '../blocks/URefBlock.component.js';
10
+ import { UDotLoader } from '../loaders/UDotLoader.component.js';
11
11
  import { styles } from './UMessage.styles.js';
12
12
 
13
13
  var __defProp = Object.defineProperty;
@@ -22,18 +22,9 @@ var __decorateClass = (decorators, target, key, kind) => {
22
22
  class UMessage extends BaseElement {
23
23
  constructor() {
24
24
  super(...arguments);
25
- /**
26
- * 텍스트 및 마크다운 블록의 내용을 모아서 하나의 문자열로 반환합니다.
27
- */
28
- this.getTextValue = (items) => {
29
- if (!items) return "";
30
- return items.reduce((acc, item) => {
31
- if (item.type === "text" || item.type === "markdown") {
32
- return acc ? acc + "\n" + (item.value || "") : item.value || "";
33
- }
34
- return acc;
35
- }, "");
36
- };
25
+ this.variant = "default";
26
+ this.position = "left";
27
+ this.loading = false;
37
28
  }
38
29
  static {
39
30
  this.styles = [super.styles, styles];
@@ -44,61 +35,56 @@ class UMessage extends BaseElement {
44
35
  "u-marked-block": UMarkedBlock,
45
36
  "u-think-block": UThinkBlock,
46
37
  "u-tool-block": UToolBlock,
47
- "u-copy-button": UCopyButton
38
+ "u-ref-block": URefBlock,
39
+ "u-dot-loader": UDotLoader
48
40
  };
49
41
  }
50
42
  render() {
51
43
  return html`
52
- <div class="container">
53
- <div class="header" part="header">
54
- <slot name="header"></slot>
55
- </div>
56
- <div class="body" part="body">
57
- ${this.items && this.items.length > 0 ? repeat(this.items, (_, idx) => idx, (item, idx) => {
58
- return item.type === "text" ? html`
59
- <u-text-block
60
- .value=${item.value}
61
- ></u-text-block>` : item.type === "markdown" ? html`
62
- <u-marked-block
63
- .value=${item.value}
64
- ></u-marked-block>` : item.type === "thinking" ? html`
65
- <u-think-block
66
- ?loading=${this.items?.length === (idx || 0) + 1}
67
- .value=${item.value}
68
- ></u-think-block>` : item.type === "tool" ? html`
69
- <u-tool-block
70
- .index=${idx}
71
- .status=${item.status}
72
- .name=${item.name}
73
- .input=${item.input}
74
- .output=${item.output}
75
- ></u-tool-block>` : nothing;
76
- }) : html`
77
- <svg class="loader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
78
- <circle class="dot" cx="4" cy="12" r="3"/>
79
- <circle class="dot d1" cx="12" cy="12" r="3"/>
80
- <circle class="dot d2" cx="20" cy="12" r="3"/>
81
- </svg>`}
82
- </div>
83
- <div class="footer" part="footer">
84
- <u-copy-button
85
- .value=${this.getTextValue(this.items)}
86
- ></u-copy-button>
87
- <slot name="footer"></slot>
88
- <div style="flex:1;"></div>
89
- <div class="timestamp">
90
- ${format(this.timestamp)}
91
- </div>
92
- </div>
44
+ <slot name="header"></slot>
45
+
46
+ <div class="body" part="body" variant=${this.variant} position=${this.position}>
47
+ ${repeat(this.items || [], (_, idx) => idx, (item, idx) => item.type === "text" ? html`
48
+ <u-text-block
49
+ .value=${item.value}
50
+ ></u-text-block>` : item.type === "markdown" ? html`
51
+ <u-marked-block
52
+ .value=${item.value}
53
+ .refs=${item.refs}
54
+ ></u-marked-block>` : item.type === "thinking" ? html`
55
+ <u-think-block
56
+ .value=${item.value}
57
+ ></u-think-block>` : item.type === "tool" ? html`
58
+ <u-tool-block
59
+ index=${idx}
60
+ .heading=${item.title}
61
+ .input=${item.input}
62
+ .output=${item.output}
63
+ ></u-tool-block>` : item.type === "reference" ? html`
64
+ <u-ref-block
65
+ .heading=${"References"}
66
+ .sources=${item.sources}
67
+ ></u-ref-block>` : nothing)}
68
+ <u-dot-loader
69
+ ?hidden=${!this.loading}
70
+ ></u-dot-loader>
93
71
  </div>
72
+
73
+ <slot name="footer" ?hidden=${this.loading}></slot>
94
74
  `;
95
75
  }
96
76
  }
77
+ __decorateClass([
78
+ property({ type: String, reflect: true })
79
+ ], UMessage.prototype, "variant");
80
+ __decorateClass([
81
+ property({ type: String, reflect: true })
82
+ ], UMessage.prototype, "position");
83
+ __decorateClass([
84
+ property({ type: Boolean, reflect: true })
85
+ ], UMessage.prototype, "loading");
97
86
  __decorateClass([
98
87
  property({ type: Array })
99
88
  ], UMessage.prototype, "items");
100
- __decorateClass([
101
- property({ type: String })
102
- ], UMessage.prototype, "timestamp");
103
89
 
104
90
  export { UMessage };
@@ -5,4 +5,3 @@ declare global {
5
5
  }
6
6
  }
7
7
  export { UMessage };
8
- export type * from './UMessage.types';
@@ -2,70 +2,51 @@ import { css } from 'lit';
2
2
 
3
3
  const styles = css`
4
4
  :host {
5
- display: block;
6
- font-family: 'Roboto', sans-serif;
7
- font-size: 14px;
8
- line-height: 1.5;
9
- }
10
-
11
- .container {
12
5
  display: flex;
13
6
  flex-direction: column;
14
7
  }
15
-
16
- .header {
17
- display: flex;
18
- flex-direction: row;
19
- align-items: center;
8
+ :host([variant="default"]) {
9
+ width: 100%;
10
+ }
11
+ :host([variant="bubble"]) {
12
+ width: auto;
13
+ min-width: 40px;
14
+ max-width: 80%;
15
+ }
16
+ :host([position="left"]) {
17
+ align-self: flex-start;
18
+ align-items: flex-start;
19
+ }
20
+ :host([position="right"]) {
21
+ align-self: flex-end;
22
+ align-items: flex-end;
20
23
  }
21
24
 
22
25
  .body {
26
+ width: 100%;
23
27
  display: flex;
24
28
  flex-direction: column;
25
29
  gap: 12px;
26
- padding: 8px;
27
- border: none;
28
- border-radius: 8px;
29
30
  }
30
-
31
- .footer {
32
- display: flex;
33
- flex-direction: row;
34
- align-items: center;
35
- justify-content: space-between;
36
- padding: 8px 0px;
37
- gap: 12px;
38
- font-size: 12px;
31
+ .body[variant="default"] {
32
+ padding: 12px;
33
+ background-color: transparent;
39
34
  }
40
-
41
- .loader {
42
- width: 1em;
43
- height: 1em;
44
- fill: currentColor;
45
- }
46
-
47
- .dot {
48
- animation: bounce_action 1.05s infinite
35
+ .body[variant="bubble"] {
36
+ padding: 12px 18px;
37
+ border-radius: 18px;
38
+ background-color: var(--u-neutral-200, #f3f4f6);
49
39
  }
50
- .d1 {
51
- animation-delay:.1s
40
+ .body[variant="bubble"][position="left"] {
41
+ border-bottom-left-radius: 4px;
52
42
  }
53
- .d2 {
54
- animation-delay:.2s
43
+ .body[variant="bubble"][position="right"] {
44
+ border-bottom-right-radius: 4px;
55
45
  }
56
46
 
57
- @keyframes bounce_action {
58
- 0%,57.14% {
59
- animation-timing-function: cubic-bezier(0.33,.66,.66,1);
60
- transform: translate(0);
61
- }
62
- 28.57% {
63
- animation-timing-function: cubic-bezier(0.33,0,.66,.33);
64
- transform: translateY(-6px);
65
- }
66
- 100% {
67
- transform: translate(0);
68
- }
47
+ u-dot-loader {
48
+ font-size: 24px;
49
+ color: var(--u-neutral-800, #6b7280);
69
50
  }
70
51
  `;
71
52
 
@@ -0,0 +1,25 @@
1
+ import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
+ /**
3
+ * 채팅 입력 컴포넌트입니다.
4
+ * 텍스트 입력 영역과 우측에 액션 버튼을 배치할 수 있는 슬롯을 제공합니다.
5
+ */
6
+ export declare class UPrompt extends BaseElement {
7
+ static styles: import('lit').CSSResultGroup[];
8
+ static dependencies: Record<string, typeof BaseElement>;
9
+ /** 로딩 상태 여부 */
10
+ loading: boolean;
11
+ /** 최소 행 수 */
12
+ minRows: number;
13
+ /** 최대 행 수 */
14
+ maxRows: number;
15
+ /** 입력 필드의 플레이스홀더 텍스트 */
16
+ placeholder?: string;
17
+ /** 입력 필드의 값 */
18
+ value?: string;
19
+ connectedCallback(): void;
20
+ render(): import('lit-html').TemplateResult<1>;
21
+ send(): void;
22
+ private handleTextBlockInput;
23
+ private handleTextBlockKeydown;
24
+ private handleSendButtonClick;
25
+ }