@iyulab/chat-components 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +83 -52
  2. package/README.md +133 -16
  3. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorateMetadata.js +6 -0
  5. package/dist/_virtual/_glob-assets_raw/intent-prompt.md.1907474e.js +4 -0
  6. package/dist/_virtual/_glob-assets_raw/view-prompt.md.e0dbcffe.js +4 -0
  7. package/dist/components/blocks/UCodeBlock.d.ts +24 -2
  8. package/dist/components/blocks/UCodeBlock.js +65 -2
  9. package/dist/components/blocks/UCodeBlock.styles.js +4 -4
  10. package/dist/components/blocks/UFileBlock.d.ts +33 -0
  11. package/dist/components/blocks/UFileBlock.js +154 -0
  12. package/dist/components/blocks/{UFilesBlock.styles.js → UFileBlock.styles.js} +12 -90
  13. package/dist/components/blocks/UJsonBlock.d.ts +44 -2
  14. package/dist/components/blocks/UJsonBlock.js +128 -3
  15. package/dist/components/blocks/UJsonBlock.styles.js +4 -4
  16. package/dist/components/blocks/UMarkedBlock.d.ts +44 -2
  17. package/dist/components/blocks/UMarkedBlock.js +154 -4
  18. package/dist/components/blocks/UMarkedBlock.styles.js +4 -4
  19. package/dist/components/blocks/URefBlock.d.ts +16 -2
  20. package/dist/components/blocks/URefBlock.js +58 -3
  21. package/dist/components/blocks/URefBlock.styles.js +4 -4
  22. package/dist/components/blocks/UTableBlock.d.ts +47 -2
  23. package/dist/components/blocks/UTableBlock.js +197 -4
  24. package/dist/components/blocks/UTableBlock.styles.js +4 -5
  25. package/dist/components/blocks/UTextBlock.d.ts +36 -2
  26. package/dist/components/blocks/UTextBlock.js +94 -4
  27. package/dist/components/blocks/UTextBlock.styles.js +4 -4
  28. package/dist/components/blocks/UThinkBlock.d.ts +30 -2
  29. package/dist/components/blocks/UThinkBlock.js +86 -4
  30. package/dist/components/blocks/UThinkBlock.styles.js +4 -4
  31. package/dist/components/blocks/UToolBlock.d.ts +19 -2
  32. package/dist/components/blocks/UToolBlock.js +68 -3
  33. package/dist/components/blocks/UToolBlock.styles.js +4 -4
  34. package/dist/components/buttons/UAttachButton.d.ts +21 -2
  35. package/dist/components/buttons/UAttachButton.js +61 -3
  36. package/dist/components/buttons/UAttachButton.styles.js +4 -4
  37. package/dist/components/buttons/UCopyButton.d.ts +19 -2
  38. package/dist/components/buttons/UCopyButton.js +57 -3
  39. package/dist/components/buttons/UCopyButton.styles.js +4 -4
  40. package/dist/components/buttons/UVoteButton.d.ts +14 -3
  41. package/dist/components/buttons/UVoteButton.js +62 -3
  42. package/dist/components/buttons/UVoteButton.styles.js +4 -4
  43. package/dist/components/{actions/UQuestionAction.component.d.ts → intents/UQuestionIntent.d.ts} +6 -2
  44. package/dist/components/intents/UQuestionIntent.js +41 -0
  45. package/dist/components/{actions/UQuestionAction.styles.js → intents/UQuestionIntent.styles.js} +4 -6
  46. package/dist/components/message/UMessage.d.ts +18 -2
  47. package/dist/components/message/UMessage.js +47 -2
  48. package/dist/components/message/UMessage.styles.js +4 -4
  49. package/dist/components/prompt/UPrompt.d.ts +37 -2
  50. package/dist/components/prompt/UPrompt.js +139 -2
  51. package/dist/components/prompt/UPrompt.styles.js +15 -5
  52. package/dist/components/references/URefCard.d.ts +30 -2
  53. package/dist/components/references/URefCard.js +97 -2
  54. package/dist/components/references/URefCard.styles.js +4 -4
  55. package/dist/components/references/URefCardGroup.d.ts +25 -2
  56. package/dist/components/references/URefCardGroup.js +69 -4
  57. package/dist/components/references/URefCardGroup.styles.js +4 -4
  58. package/dist/components/references/URefTag.d.ts +12 -2
  59. package/dist/components/references/URefTag.js +37 -2
  60. package/dist/components/references/URefTag.styles.js +4 -4
  61. package/dist/components/{widgets/UChartWidget.component.d.ts → views/UChartView.d.ts} +7 -4
  62. package/dist/components/views/UChartView.js +167 -0
  63. package/dist/components/{widgets/UChartWidget.styles.js → views/UChartView.styles.js} +4 -4
  64. package/dist/components/{widgets/UImagesWidget.component.d.ts → views/UImagesView.d.ts} +7 -4
  65. package/dist/components/views/UImagesView.js +144 -0
  66. package/dist/components/{widgets/UImagesWidget.styles.js → views/UImagesView.styles.js} +6 -5
  67. package/dist/components/{widgets/UMapWidget.component.d.ts → views/UMapView.d.ts} +7 -3
  68. package/dist/components/views/UMapView.js +45 -0
  69. package/dist/components/{widgets/UMapWidget.styles.js → views/UMapView.styles.js} +4 -4
  70. package/dist/components/{widgets/UVideoWidget.component.d.ts → views/UVideoView.d.ts} +7 -3
  71. package/dist/components/views/UVideoView.js +81 -0
  72. package/dist/components/{widgets/UVideoWidget.styles.js → views/UVideoView.styles.js} +4 -4
  73. package/dist/components/{widgets/UWidget.component.d.ts → views/UView.d.ts} +8 -5
  74. package/dist/components/views/UView.js +113 -0
  75. package/dist/components/{widgets/UWidget.styles.js → views/UView.styles.js} +4 -4
  76. package/dist/events/AttachEvent.d.ts +9 -0
  77. package/dist/events/ChoiceEvent.d.ts +9 -0
  78. package/dist/events/SendEvent.d.ts +21 -0
  79. package/dist/events/StopEvent.d.ts +17 -0
  80. package/dist/index.d.ts +13 -16
  81. package/dist/index.js +28 -56
  82. package/dist/react/UAttachButton.d.ts +11 -0
  83. package/dist/react/UAttachButton.js +12 -0
  84. package/dist/react/UChartView.d.ts +9 -0
  85. package/dist/react/UChartView.js +10 -0
  86. package/dist/react/UCodeBlock.d.ts +9 -0
  87. package/dist/react/UCodeBlock.js +10 -0
  88. package/dist/react/UCopyButton.d.ts +9 -0
  89. package/dist/react/UCopyButton.js +10 -0
  90. package/dist/react/UFileBlock.d.ts +11 -0
  91. package/dist/react/UFileBlock.js +12 -0
  92. package/dist/react/UImagesView.d.ts +9 -0
  93. package/dist/react/UImagesView.js +10 -0
  94. package/dist/react/UJsonBlock.d.ts +9 -0
  95. package/dist/react/UJsonBlock.js +10 -0
  96. package/dist/react/UMapView.d.ts +9 -0
  97. package/dist/react/UMapView.js +10 -0
  98. package/dist/react/UMarkedBlock.d.ts +9 -0
  99. package/dist/react/UMarkedBlock.js +10 -0
  100. package/dist/react/UMessage.d.ts +9 -0
  101. package/dist/react/UMessage.js +10 -0
  102. package/dist/react/UPrompt.d.ts +13 -0
  103. package/dist/react/UPrompt.js +13 -0
  104. package/dist/react/UQuestionIntent.d.ts +11 -0
  105. package/dist/react/UQuestionIntent.js +12 -0
  106. package/dist/react/URefBlock.d.ts +9 -0
  107. package/dist/react/URefBlock.js +10 -0
  108. package/dist/react/URefCard.d.ts +9 -0
  109. package/dist/react/URefCard.js +10 -0
  110. package/dist/react/URefCardGroup.d.ts +9 -0
  111. package/dist/react/URefCardGroup.js +10 -0
  112. package/dist/react/URefTag.d.ts +9 -0
  113. package/dist/react/URefTag.js +10 -0
  114. package/dist/react/UTableBlock.d.ts +9 -0
  115. package/dist/react/UTableBlock.js +10 -0
  116. package/dist/react/UTextBlock.d.ts +9 -0
  117. package/dist/react/UTextBlock.js +10 -0
  118. package/dist/react/UThinkBlock.d.ts +9 -0
  119. package/dist/react/UThinkBlock.js +10 -0
  120. package/dist/react/UToolBlock.d.ts +9 -0
  121. package/dist/react/UToolBlock.js +10 -0
  122. package/dist/react/UVideoView.d.ts +9 -0
  123. package/dist/react/UVideoView.js +10 -0
  124. package/dist/react/UView.d.ts +9 -0
  125. package/dist/react/UView.js +10 -0
  126. package/dist/react/UVoteButton.d.ts +9 -0
  127. package/dist/react/UVoteButton.js +10 -0
  128. package/dist/react/index.d.ts +23 -0
  129. package/dist/react/index.js +23 -0
  130. package/dist/types/BlockItem.d.ts +21 -32
  131. package/dist/types/Intents.d.ts +26 -0
  132. package/dist/types/Intents.js +30 -0
  133. package/dist/types/{Widgets.d.ts → Views.d.ts} +8 -8
  134. package/dist/types/Views.js +150 -0
  135. package/dist/utilities/IntentPromptBuilder.d.ts +40 -0
  136. package/dist/utilities/IntentPromptBuilder.js +95 -0
  137. package/dist/utilities/ViewPromptBuilder.d.ts +28 -0
  138. package/dist/utilities/ViewPromptBuilder.js +76 -0
  139. package/dist/utilities/dom-agent/DOMAgent.d.ts +74 -0
  140. package/dist/utilities/dom-agent/DOMController.d.ts +78 -0
  141. package/dist/utilities/dom-agent/DOMPromptBuilder.d.ts +54 -0
  142. package/dist/utilities/dom-agent/DOMScanner.d.ts +83 -0
  143. package/dist/utilities/dom-agent/index.d.ts +9 -0
  144. package/dist/utilities/dom-agent/types.d.ts +209 -0
  145. package/package.json +33 -16
  146. package/skills/iyulab-chat-components/SKILL.md +107 -0
  147. package/skills/iyulab-chat-components/references/components/attach-button.md +69 -0
  148. package/skills/iyulab-chat-components/references/components/chart-view.md +65 -0
  149. package/skills/iyulab-chat-components/references/components/code-block.md +42 -0
  150. package/skills/iyulab-chat-components/references/components/copy-button.md +46 -0
  151. package/skills/iyulab-chat-components/references/components/file-block.md +64 -0
  152. package/skills/iyulab-chat-components/references/components/images-view.md +63 -0
  153. package/skills/iyulab-chat-components/references/components/json-block.md +41 -0
  154. package/skills/iyulab-chat-components/references/components/map-view.md +54 -0
  155. package/skills/iyulab-chat-components/references/components/marked-block.md +53 -0
  156. package/skills/iyulab-chat-components/references/components/message.md +60 -0
  157. package/skills/iyulab-chat-components/references/components/prompt.md +102 -0
  158. package/skills/iyulab-chat-components/references/components/question-intent.md +75 -0
  159. package/skills/iyulab-chat-components/references/components/ref-block.md +45 -0
  160. package/skills/iyulab-chat-components/references/components/ref-card-group.md +41 -0
  161. package/skills/iyulab-chat-components/references/components/ref-card.md +48 -0
  162. package/skills/iyulab-chat-components/references/components/ref-tag.md +40 -0
  163. package/skills/iyulab-chat-components/references/components/table-block.md +63 -0
  164. package/skills/iyulab-chat-components/references/components/text-block.md +59 -0
  165. package/skills/iyulab-chat-components/references/components/think-block.md +48 -0
  166. package/skills/iyulab-chat-components/references/components/tool-block.md +57 -0
  167. package/skills/iyulab-chat-components/references/components/video-view.md +55 -0
  168. package/skills/iyulab-chat-components/references/components/view.md +51 -0
  169. package/skills/iyulab-chat-components/references/components/vote-button.md +60 -0
  170. package/skills/iyulab-chat-components/references/types.md +115 -0
  171. package/skills/iyulab-chat-components/references/usage.md +254 -0
  172. package/skills/iyulab-chat-components/references/utilities/intent-prompt-builder.md +123 -0
  173. package/skills/iyulab-chat-components/references/utilities/view-prompt-builder.md +112 -0
  174. package/dist/assets/action-prompt.md.js +0 -3
  175. package/dist/assets/widget-prompt.md.js +0 -3
  176. package/dist/components/actions/UQuestionAction.component.js +0 -58
  177. package/dist/components/actions/UQuestionAction.d.ts +0 -7
  178. package/dist/components/actions/UQuestionAction.js +0 -5
  179. package/dist/components/blocks/UCodeBlock.component.d.ts +0 -25
  180. package/dist/components/blocks/UCodeBlock.component.js +0 -88
  181. package/dist/components/blocks/UFilesBlock.component.d.ts +0 -22
  182. package/dist/components/blocks/UFilesBlock.component.js +0 -192
  183. package/dist/components/blocks/UFilesBlock.d.ts +0 -7
  184. package/dist/components/blocks/UFilesBlock.js +0 -5
  185. package/dist/components/blocks/UJsonBlock.component.d.ts +0 -45
  186. package/dist/components/blocks/UJsonBlock.component.js +0 -140
  187. package/dist/components/blocks/UMarkedBlock.component.d.ts +0 -40
  188. package/dist/components/blocks/UMarkedBlock.component.js +0 -159
  189. package/dist/components/blocks/URefBlock.component.d.ts +0 -17
  190. package/dist/components/blocks/URefBlock.component.js +0 -73
  191. package/dist/components/blocks/UTableBlock.component.d.ts +0 -49
  192. package/dist/components/blocks/UTableBlock.component.js +0 -228
  193. package/dist/components/blocks/UTextBlock.component.d.ts +0 -37
  194. package/dist/components/blocks/UTextBlock.component.js +0 -123
  195. package/dist/components/blocks/UThinkBlock.component.d.ts +0 -23
  196. package/dist/components/blocks/UThinkBlock.component.js +0 -90
  197. package/dist/components/blocks/UToolBlock.component.d.ts +0 -20
  198. package/dist/components/blocks/UToolBlock.component.js +0 -80
  199. package/dist/components/buttons/UAttachButton.component.d.ts +0 -22
  200. package/dist/components/buttons/UAttachButton.component.js +0 -89
  201. package/dist/components/buttons/UCopyButton.component.d.ts +0 -20
  202. package/dist/components/buttons/UCopyButton.component.js +0 -81
  203. package/dist/components/buttons/UReportButton.component.d.ts +0 -9
  204. package/dist/components/buttons/UReportButton.component.js +0 -36
  205. package/dist/components/buttons/UReportButton.d.ts +0 -7
  206. package/dist/components/buttons/UReportButton.js +0 -5
  207. package/dist/components/buttons/UReportButton.styles.js +0 -14
  208. package/dist/components/buttons/URetryButton.component.d.ts +0 -11
  209. package/dist/components/buttons/URetryButton.component.js +0 -53
  210. package/dist/components/buttons/URetryButton.d.ts +0 -7
  211. package/dist/components/buttons/URetryButton.js +0 -5
  212. package/dist/components/buttons/URetryButton.styles.js +0 -26
  213. package/dist/components/buttons/UShareButton.component.d.ts +0 -9
  214. package/dist/components/buttons/UShareButton.component.js +0 -36
  215. package/dist/components/buttons/UShareButton.d.ts +0 -7
  216. package/dist/components/buttons/UShareButton.js +0 -5
  217. package/dist/components/buttons/UShareButton.styles.js +0 -14
  218. package/dist/components/buttons/UVoteButton.component.d.ts +0 -15
  219. package/dist/components/buttons/UVoteButton.component.js +0 -73
  220. package/dist/components/message/UMessage.component.d.ts +0 -19
  221. package/dist/components/message/UMessage.component.js +0 -56
  222. package/dist/components/prompt/UPrompt.component.d.ts +0 -25
  223. package/dist/components/prompt/UPrompt.component.js +0 -113
  224. package/dist/components/references/URefCard.component.d.ts +0 -27
  225. package/dist/components/references/URefCard.component.js +0 -109
  226. package/dist/components/references/URefCardGroup.component.d.ts +0 -26
  227. package/dist/components/references/URefCardGroup.component.js +0 -88
  228. package/dist/components/references/URefTag.component.d.ts +0 -13
  229. package/dist/components/references/URefTag.component.js +0 -54
  230. package/dist/components/widgets/UChartWidget.component.js +0 -180
  231. package/dist/components/widgets/UChartWidget.d.ts +0 -7
  232. package/dist/components/widgets/UChartWidget.js +0 -5
  233. package/dist/components/widgets/UImagesWidget.component.js +0 -164
  234. package/dist/components/widgets/UImagesWidget.d.ts +0 -7
  235. package/dist/components/widgets/UImagesWidget.js +0 -5
  236. package/dist/components/widgets/UMapWidget.component.js +0 -65
  237. package/dist/components/widgets/UMapWidget.d.ts +0 -7
  238. package/dist/components/widgets/UMapWidget.js +0 -5
  239. package/dist/components/widgets/UMapWidget.styles.d.ts +0 -1
  240. package/dist/components/widgets/UVideoWidget.component.js +0 -106
  241. package/dist/components/widgets/UVideoWidget.d.ts +0 -7
  242. package/dist/components/widgets/UVideoWidget.js +0 -5
  243. package/dist/components/widgets/UVideoWidget.styles.d.ts +0 -1
  244. package/dist/components/widgets/UWidget.component.js +0 -140
  245. package/dist/components/widgets/UWidget.d.ts +0 -7
  246. package/dist/components/widgets/UWidget.js +0 -5
  247. package/dist/components/widgets/UWidget.styles.d.ts +0 -1
  248. package/dist/events/UCancelEvent.d.ts +0 -6
  249. package/dist/events/USubmitEvent.d.ts +0 -6
  250. package/dist/types/Actions.d.ts +0 -24
  251. package/dist/types/Actions.js +0 -34
  252. package/dist/types/Widgets.js +0 -115
  253. package/dist/utilities/ActionPromptBuilder.d.ts +0 -40
  254. package/dist/utilities/ActionPromptBuilder.js +0 -93
  255. package/dist/utilities/WidgetPromptBuilder.d.ts +0 -28
  256. package/dist/utilities/WidgetPromptBuilder.js +0 -87
  257. package/dist/utilities/converters.d.ts +0 -9
  258. package/dist/utilities/converters.js +0 -19
  259. /package/dist/components/{actions/UQuestionAction.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
  260. /package/dist/components/{blocks/UFilesBlock.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
  261. /package/dist/components/{buttons/UReportButton.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
  262. /package/dist/components/{buttons/URetryButton.styles.d.ts → views/UImagesView.styles.d.ts} +0 -0
  263. /package/dist/components/{buttons/UShareButton.styles.d.ts → views/UMapView.styles.d.ts} +0 -0
  264. /package/dist/components/{widgets/UChartWidget.styles.d.ts → views/UVideoView.styles.d.ts} +0 -0
  265. /package/dist/components/{widgets/UImagesWidget.styles.d.ts → views/UView.styles.d.ts} +0 -0
@@ -1,56 +0,0 @@
1
- import { html } from 'lit';
2
- import { property } from 'lit/decorators.js';
3
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
4
- import { styles } from './UMessage.styles.js';
5
-
6
- var __defProp = Object.defineProperty;
7
- var __decorateClass = (decorators, target, key, kind) => {
8
- var result = void 0 ;
9
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
- if (decorator = decorators[i])
11
- result = (decorator(target, key, result) ) || result;
12
- if (result) __defProp(target, key, result);
13
- return result;
14
- };
15
- class UMessage extends UElement {
16
- constructor() {
17
- super(...arguments);
18
- this.loading = false;
19
- this.variant = "default";
20
- this.position = "left";
21
- }
22
- static {
23
- this.styles = [super.styles, styles];
24
- }
25
- static {
26
- this.dependencies = {};
27
- }
28
- render() {
29
- return html`
30
- <slot name="header"></slot>
31
-
32
- <div class="body" part="body" variant=${this.variant} position=${this.position}>
33
- <slot></slot>
34
- <svg class="dot-loader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
35
- ?hidden=${!this.loading}>
36
- <circle class="d0" cx="4" cy="12" r="3" />
37
- <circle class="d1" cx="12" cy="12" r="3" />
38
- <circle class="d2" cx="20" cy="12" r="3" />
39
- </svg>
40
- </div>
41
-
42
- <slot name="footer" ?hidden=${this.loading}></slot>
43
- `;
44
- }
45
- }
46
- __decorateClass([
47
- property({ type: Boolean, reflect: true })
48
- ], UMessage.prototype, "loading");
49
- __decorateClass([
50
- property({ type: String, reflect: true })
51
- ], UMessage.prototype, "variant");
52
- __decorateClass([
53
- property({ type: String, reflect: true })
54
- ], UMessage.prototype, "position");
55
-
56
- export { UMessage };
@@ -1,25 +0,0 @@
1
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
2
- /**
3
- * 채팅 입력 컴포넌트입니다.
4
- * 텍스트 입력 영역과 우측에 액션 버튼을 배치할 수 있는 슬롯을 제공합니다.
5
- */
6
- export declare class UPrompt extends UElement {
7
- static styles: import('lit').CSSResultGroup[];
8
- static dependencies: Record<string, typeof UElement>;
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
- }
@@ -1,113 +0,0 @@
1
- import { html } from 'lit';
2
- import { property } from 'lit/decorators.js';
3
- import { UElement } from '@iyulab/components/dist/components/UElement.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 { UTextBlock } from '../blocks/UTextBlock.component.js';
7
- import { styles } from './UPrompt.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 UPrompt extends UElement {
19
- constructor() {
20
- super(...arguments);
21
- this.loading = false;
22
- this.minRows = 1;
23
- this.maxRows = 10;
24
- this.handleSendButtonClick = (e) => {
25
- e.preventDefault();
26
- e.stopPropagation();
27
- this.send();
28
- };
29
- }
30
- static {
31
- this.styles = [super.styles, styles];
32
- }
33
- static {
34
- this.dependencies = {
35
- "u-icon": UIcon,
36
- "u-button": UButton,
37
- "u-text-block": UTextBlock
38
- };
39
- }
40
- connectedCallback() {
41
- super.connectedCallback();
42
- this.setAttribute("tabindex", "0");
43
- }
44
- render() {
45
- return html`
46
- <slot name="header"></slot>
47
-
48
- <u-text-block part="input"
49
- editable
50
- .minRows=${this.minRows}
51
- .maxRows=${this.maxRows}
52
- .value=${this.value}
53
- .placeholder=${this.placeholder}
54
- @input=${this.handleTextBlockInput}
55
- @keydown=${this.handleTextBlockKeydown}
56
- ></u-text-block>
57
-
58
- <div class="control" part="control">
59
- <slot name="left-actions"></slot>
60
- <div style="flex: 1;"></div>
61
- <slot name="right-actions"></slot>
62
-
63
- <u-button class="send-btn" part="send-btn"
64
- ?disabled=${!this.loading && !this.value}
65
- @click=${this.handleSendButtonClick}>
66
- <u-icon
67
- lib="internal"
68
- name=${this.loading ? "stop-circle" : "arrow-up"}
69
- ></u-icon>
70
- </u-button>
71
- </div>
72
-
73
- <slot name="footer"></slot>
74
- `;
75
- }
76
- send() {
77
- const value = this.value?.trim();
78
- if (this.loading) {
79
- this.emit("u-cancel");
80
- } else if (value) {
81
- this.emit("u-submit", { value: this.value });
82
- this.value = "";
83
- } else ;
84
- }
85
- handleTextBlockInput(e) {
86
- e.preventDefault();
87
- const target = e.target;
88
- this.value = target.value;
89
- }
90
- handleTextBlockKeydown(e) {
91
- if (e.key === "Enter" && !e.shiftKey) {
92
- e.preventDefault();
93
- this.send();
94
- }
95
- }
96
- }
97
- __decorateClass([
98
- property({ type: Boolean, reflect: true })
99
- ], UPrompt.prototype, "loading");
100
- __decorateClass([
101
- property({ type: Number })
102
- ], UPrompt.prototype, "minRows");
103
- __decorateClass([
104
- property({ type: Number })
105
- ], UPrompt.prototype, "maxRows");
106
- __decorateClass([
107
- property({ type: String })
108
- ], UPrompt.prototype, "placeholder");
109
- __decorateClass([
110
- property({ type: String })
111
- ], UPrompt.prototype, "value");
112
-
113
- export { UPrompt };
@@ -1,27 +0,0 @@
1
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
2
- import { UJsonElement } from '@iyulab/components/dist/components/UJsonElement.js';
3
- /**
4
- * 참조 소스를 카드 형태로 표시하는 공통 컴포넌트입니다.
5
- * Web과 Document 타입 모두 지원합니다.
6
- */
7
- export declare class URefCard extends UJsonElement {
8
- static styles: (import('lit').CSSResult | import('lit').CSSResultGroup[])[];
9
- static dependencies: Record<string, typeof UElement>;
10
- /** 카드 타입 (web 또는 document) */
11
- type: 'web' | 'document';
12
- /** 외부 링크 URL */
13
- url?: string;
14
- /** 카드 타이틀 */
15
- title: string;
16
- /** 카드 본문 스니펫 */
17
- snippet?: string;
18
- /** 태그 목록 */
19
- tags?: string[];
20
- render(): import('lit-html').TemplateResult<1>;
21
- /** 링크 클릭 핸들러 */
22
- private handleAnchorClick;
23
- /** URL에서 Google의 파비콘 URL을 반환합니다. */
24
- private getFaviconUrl;
25
- /** URL에서 도메인 사이트 주소를 반환합니다. */
26
- private getDomainName;
27
- }
@@ -1,109 +0,0 @@
1
- import { html } from 'lit';
2
- import { property } from 'lit/decorators.js';
3
- import { ifDefined } from 'lit/directives/if-defined.js';
4
- import { arrayAttrConverter } from '@iyulab/components/dist/utilities/converters.js';
5
- import { UJsonElement } from '@iyulab/components/dist/components/UJsonElement.js';
6
- import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
7
- import { styles } from './URefCard.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 URefCard extends UJsonElement {
19
- constructor() {
20
- super(...arguments);
21
- this.type = "web";
22
- this.title = "";
23
- }
24
- static {
25
- this.styles = [super.styles, styles];
26
- }
27
- static {
28
- this.dependencies = {
29
- "u-icon": UIcon
30
- };
31
- }
32
- render() {
33
- return html`
34
- <a href="${ifDefined(this.url)}" target="_blank" rel="noopener noreferrer"
35
- @click=${this.handleAnchorClick}>
36
- <div class="header">
37
- <img class="favicon"
38
- src="${this.getFaviconUrl(this.url)}"
39
- alt="favicon"
40
- />
41
- <div class="title">
42
- ${this.title || this.getDomainName(this.url)}
43
- </div>
44
-
45
- <div style="flex: 1;"></div>
46
-
47
- <div class="badge" type=${this.type}>
48
- <u-icon
49
- lib="internal"
50
- name=${this.type === "web" ? "globe" : "file-earmark"}
51
- ></u-icon>
52
- ${this.type.toUpperCase()}
53
- </div>
54
- </div>
55
-
56
- <div class="body">
57
- ${this.snippet}
58
- </div>
59
-
60
- <div class="footer" ?hidden=${!this.tags || this.tags.length === 0}>
61
- ${this.tags?.map((tag) => html`<span class="tag">${tag}</span>`)}
62
- </div>
63
- </a>
64
- `;
65
- }
66
- /** 링크 클릭 핸들러 */
67
- handleAnchorClick(e) {
68
- if (!this.url) {
69
- e.preventDefault();
70
- e.stopPropagation();
71
- }
72
- }
73
- /** URL에서 Google의 파비콘 URL을 반환합니다. */
74
- getFaviconUrl(url) {
75
- if (!url) return `/favicon.ico`;
76
- try {
77
- const hostname = new URL(url).hostname;
78
- return `https://www.google.com/s2/favicons?sz=64&domain=${hostname}`;
79
- } catch {
80
- return `/favicon.ico`;
81
- }
82
- }
83
- /** URL에서 도메인 사이트 주소를 반환합니다. */
84
- getDomainName(url) {
85
- if (!url) return "";
86
- try {
87
- return new URL(url).hostname;
88
- } catch {
89
- return "";
90
- }
91
- }
92
- }
93
- __decorateClass([
94
- property({ type: String, reflect: true })
95
- ], URefCard.prototype, "type");
96
- __decorateClass([
97
- property({ type: String })
98
- ], URefCard.prototype, "url");
99
- __decorateClass([
100
- property({ type: String })
101
- ], URefCard.prototype, "title");
102
- __decorateClass([
103
- property({ type: String })
104
- ], URefCard.prototype, "snippet");
105
- __decorateClass([
106
- property({ type: Array, converter: arrayAttrConverter((v) => v) })
107
- ], URefCard.prototype, "tags");
108
-
109
- export { URefCard };
@@ -1,26 +0,0 @@
1
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
2
- import { URefCard } from './URefCard.component.js';
3
- /**
4
- * 여러 참조 카드를 그룹으로 표시하는 컴포넌트입니다.
5
- * 페이지네이션 기능을 제공하여 각 카드를 하나씩 탐색할 수 있습니다.
6
- * 카드가 1개 이하인 경우 페이지네이션 UI는 자동으로 숨겨집니다.
7
- */
8
- export declare class URefCardGroup extends UElement {
9
- static styles: import('lit').CSSResultGroup[];
10
- static dependencies: Record<string, typeof UElement>;
11
- /** slot으로 받은 카드 엘리먼트들 */
12
- cards: URefCard[];
13
- /** 현재 표시 중인 카드의 인덱스 */
14
- currentIndex: number;
15
- render(): import('lit-html').TemplateResult<1>;
16
- /**
17
- * 해당하는 인덱스에 해당하는 카드로 변경합니다.
18
- */
19
- switch(index: number): void;
20
- /** 이전 카드로 이동합니다. */
21
- private handlePreviousButtonClick;
22
- /** 다음 카드로 이동합니다. */
23
- private handleNextButtonClick;
24
- /** slot 내용이 변경될 때 호출됩니다. */
25
- private handleSlotChange;
26
- }
@@ -1,88 +0,0 @@
1
- import { html } from 'lit';
2
- import { state } from 'lit/decorators.js';
3
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
4
- import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
5
- import { URefCard } from './URefCard.component.js';
6
- import { styles } from './URefCardGroup.styles.js';
7
-
8
- var __defProp = Object.defineProperty;
9
- var __decorateClass = (decorators, target, key, kind) => {
10
- var result = void 0 ;
11
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
- if (decorator = decorators[i])
13
- result = (decorator(target, key, result) ) || result;
14
- if (result) __defProp(target, key, result);
15
- return result;
16
- };
17
- class URefCardGroup extends UElement {
18
- constructor() {
19
- super(...arguments);
20
- this.cards = [];
21
- this.currentIndex = 0;
22
- }
23
- static {
24
- this.styles = [super.styles, styles];
25
- }
26
- static {
27
- this.dependencies = {
28
- "u-icon": UIcon,
29
- "u-ref-card": URefCard
30
- };
31
- }
32
- render() {
33
- return html`
34
- <div class="header" ?hidden=${this.cards.length <= 1}>
35
- <button class="nav-button"
36
- @click=${this.handlePreviousButtonClick}>
37
- <u-icon lib="internal" name="chevron-left"></u-icon>
38
- </button>
39
-
40
- <span class="page-indicator">
41
- ${this.currentIndex + 1} / ${this.cards.length}
42
- </span>
43
-
44
- <button class="nav-button"
45
- @click=${this.handleNextButtonClick}>
46
- <u-icon lib="internal" name="chevron-right"></u-icon>
47
- </button>
48
- </div>
49
-
50
- <div class="viewport">
51
- <div class="track" style=${`transform: translateX(-${this.currentIndex * 100}%);`}>
52
- <slot @slotchange=${this.handleSlotChange}></slot>
53
- </div>
54
- </div>
55
- `;
56
- }
57
- /**
58
- * 해당하는 인덱스에 해당하는 카드로 변경합니다.
59
- */
60
- switch(index) {
61
- const len = this.cards.length;
62
- if (len === 0) return;
63
- this.currentIndex = index < 0 ? len - 1 : index >= len ? 0 : index;
64
- }
65
- /** 이전 카드로 이동합니다. */
66
- handlePreviousButtonClick() {
67
- this.switch(this.currentIndex - 1);
68
- }
69
- /** 다음 카드로 이동합니다. */
70
- handleNextButtonClick() {
71
- this.switch(this.currentIndex + 1);
72
- }
73
- /** slot 내용이 변경될 때 호출됩니다. */
74
- handleSlotChange(e) {
75
- const slot = e.target;
76
- const elements = slot.assignedElements({ flatten: true });
77
- this.cards = elements.filter((el) => el instanceof URefCard);
78
- this.switch(0);
79
- }
80
- }
81
- __decorateClass([
82
- state()
83
- ], URefCardGroup.prototype, "cards");
84
- __decorateClass([
85
- state()
86
- ], URefCardGroup.prototype, "currentIndex");
87
-
88
- export { URefCardGroup };
@@ -1,13 +0,0 @@
1
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
2
- /**
3
- * 인용 태그 컴포넌트입니다.
4
- */
5
- export declare class URefTag extends UElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof UElement>;
8
- /** 인용 출처 소스 데이터 */
9
- href?: string;
10
- render(): import('lit-html').TemplateResult<1>;
11
- /** 링크 클릭 핸들러 */
12
- private handleAnchorClick;
13
- }
@@ -1,54 +0,0 @@
1
- import { html } from 'lit';
2
- import { property } from 'lit/decorators.js';
3
- import { ifDefined } from 'lit/directives/if-defined.js';
4
- import { UElement } from '@iyulab/components/dist/components/UElement.js';
5
- import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
6
- import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
7
- import { styles } from './URefTag.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 URefTag extends UElement {
19
- static {
20
- this.styles = [super.styles, styles];
21
- }
22
- static {
23
- this.dependencies = {
24
- "u-icon": UIcon,
25
- "u-tooltip": UTooltip
26
- };
27
- }
28
- render() {
29
- return html`
30
- <a href="${ifDefined(this.href)}" target="_blank" rel="noopener noreferrer"
31
- @click=${this.handleAnchorClick}>
32
- <slot></slot>
33
- </a>
34
-
35
- <u-icon lib="internal" name="box-arrow-up-right"></u-icon>
36
-
37
- <u-tooltip interactive placement="bottom" distance="4">
38
- <slot name="tooltip"></slot>
39
- </u-tooltip>
40
- `;
41
- }
42
- /** 링크 클릭 핸들러 */
43
- handleAnchorClick(e) {
44
- if (!this.href) {
45
- e.preventDefault();
46
- e.stopPropagation();
47
- }
48
- }
49
- }
50
- __decorateClass([
51
- property({ type: String })
52
- ], URefTag.prototype, "href");
53
-
54
- export { URefTag };