@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.
Files changed (208) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/README.md +133 -16
  3. package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.122.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 +10 -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/UFileBlock.styles.js +128 -0
  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 +52 -0
  23. package/dist/components/blocks/UTableBlock.js +198 -0
  24. package/dist/components/blocks/UTableBlock.styles.js +133 -0
  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/intents/UQuestionIntent.d.ts +22 -0
  44. package/dist/components/intents/UQuestionIntent.js +41 -0
  45. package/dist/components/intents/UQuestionIntent.styles.js +43 -0
  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 +42 -15
  49. package/dist/components/prompt/UPrompt.d.ts +32 -2
  50. package/dist/components/prompt/UPrompt.js +118 -2
  51. package/dist/components/prompt/UPrompt.styles.js +43 -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/views/UChartView.d.ts +39 -0
  62. package/dist/components/views/UChartView.js +167 -0
  63. package/dist/components/views/UChartView.styles.js +86 -0
  64. package/dist/components/views/UImagesView.d.ts +33 -0
  65. package/dist/components/views/UImagesView.js +144 -0
  66. package/dist/components/views/UImagesView.styles.d.ts +1 -0
  67. package/dist/components/views/UImagesView.styles.js +219 -0
  68. package/dist/components/views/UMapView.d.ts +24 -0
  69. package/dist/components/views/UMapView.js +45 -0
  70. package/dist/components/views/UMapView.styles.d.ts +1 -0
  71. package/dist/components/views/UMapView.styles.js +47 -0
  72. package/dist/components/views/UVideoView.d.ts +25 -0
  73. package/dist/components/views/UVideoView.js +81 -0
  74. package/dist/components/views/UVideoView.styles.d.ts +1 -0
  75. package/dist/components/views/UVideoView.styles.js +36 -0
  76. package/dist/components/views/UView.d.ts +46 -0
  77. package/dist/components/views/UView.js +113 -0
  78. package/dist/components/views/UView.styles.d.ts +1 -0
  79. package/dist/components/views/UView.styles.js +33 -0
  80. package/dist/events/AttachEvent.d.ts +9 -0
  81. package/dist/events/ChoiceEvent.d.ts +9 -0
  82. package/dist/events/SendEvent.d.ts +7 -0
  83. package/dist/events/StopEvent.d.ts +7 -0
  84. package/dist/index.d.ts +15 -6
  85. package/dist/index.js +28 -38
  86. package/dist/react/UAttachButton.d.ts +11 -0
  87. package/dist/react/UAttachButton.js +12 -0
  88. package/dist/react/UChartView.d.ts +9 -0
  89. package/dist/react/UChartView.js +10 -0
  90. package/dist/react/UCodeBlock.d.ts +9 -0
  91. package/dist/react/UCodeBlock.js +10 -0
  92. package/dist/react/UCopyButton.d.ts +9 -0
  93. package/dist/react/UCopyButton.js +10 -0
  94. package/dist/react/UFileBlock.d.ts +11 -0
  95. package/dist/react/UFileBlock.js +12 -0
  96. package/dist/react/UImagesView.d.ts +9 -0
  97. package/dist/react/UImagesView.js +10 -0
  98. package/dist/react/UJsonBlock.d.ts +9 -0
  99. package/dist/react/UJsonBlock.js +10 -0
  100. package/dist/react/UMapView.d.ts +9 -0
  101. package/dist/react/UMapView.js +10 -0
  102. package/dist/react/UMarkedBlock.d.ts +9 -0
  103. package/dist/react/UMarkedBlock.js +10 -0
  104. package/dist/react/UMessage.d.ts +9 -0
  105. package/dist/react/UMessage.js +10 -0
  106. package/dist/react/UPrompt.d.ts +13 -0
  107. package/dist/react/UPrompt.js +13 -0
  108. package/dist/react/UQuestionIntent.d.ts +11 -0
  109. package/dist/react/UQuestionIntent.js +12 -0
  110. package/dist/react/URefBlock.d.ts +9 -0
  111. package/dist/react/URefBlock.js +10 -0
  112. package/dist/react/URefCard.d.ts +9 -0
  113. package/dist/react/URefCard.js +10 -0
  114. package/dist/react/URefCardGroup.d.ts +9 -0
  115. package/dist/react/URefCardGroup.js +10 -0
  116. package/dist/react/URefTag.d.ts +9 -0
  117. package/dist/react/URefTag.js +10 -0
  118. package/dist/react/UTableBlock.d.ts +9 -0
  119. package/dist/react/UTableBlock.js +10 -0
  120. package/dist/react/UTextBlock.d.ts +9 -0
  121. package/dist/react/UTextBlock.js +10 -0
  122. package/dist/react/UThinkBlock.d.ts +9 -0
  123. package/dist/react/UThinkBlock.js +10 -0
  124. package/dist/react/UToolBlock.d.ts +9 -0
  125. package/dist/react/UToolBlock.js +10 -0
  126. package/dist/react/UVideoView.d.ts +9 -0
  127. package/dist/react/UVideoView.js +10 -0
  128. package/dist/react/UView.d.ts +9 -0
  129. package/dist/react/UView.js +10 -0
  130. package/dist/react/UVoteButton.d.ts +9 -0
  131. package/dist/react/UVoteButton.js +10 -0
  132. package/dist/react/index.d.ts +23 -0
  133. package/dist/react/index.js +23 -0
  134. package/dist/types/BlockItem.d.ts +21 -1
  135. package/dist/types/Intents.d.ts +26 -0
  136. package/dist/types/Intents.js +30 -0
  137. package/dist/types/JsonSchema.d.ts +59 -0
  138. package/dist/types/Views.d.ts +34 -0
  139. package/dist/types/Views.js +150 -0
  140. package/dist/utilities/IntentPromptBuilder.d.ts +40 -0
  141. package/dist/utilities/IntentPromptBuilder.js +95 -0
  142. package/dist/utilities/ViewPromptBuilder.d.ts +28 -0
  143. package/dist/utilities/ViewPromptBuilder.js +76 -0
  144. package/dist/utilities/dom-agent/DOMAgent.d.ts +74 -0
  145. package/dist/utilities/dom-agent/DOMController.d.ts +78 -0
  146. package/dist/utilities/dom-agent/DOMPromptBuilder.d.ts +54 -0
  147. package/dist/utilities/dom-agent/DOMScanner.d.ts +83 -0
  148. package/dist/utilities/dom-agent/index.d.ts +9 -0
  149. package/dist/utilities/dom-agent/types.d.ts +209 -0
  150. package/package.json +34 -18
  151. package/dist/components/blocks/UCodeBlock.component.d.ts +0 -23
  152. package/dist/components/blocks/UCodeBlock.component.js +0 -76
  153. package/dist/components/blocks/UJsonBlock.component.d.ts +0 -45
  154. package/dist/components/blocks/UJsonBlock.component.js +0 -140
  155. package/dist/components/blocks/UMarkedBlock.component.d.ts +0 -45
  156. package/dist/components/blocks/UMarkedBlock.component.js +0 -129
  157. package/dist/components/blocks/URefBlock.component.d.ts +0 -17
  158. package/dist/components/blocks/URefBlock.component.js +0 -74
  159. package/dist/components/blocks/UTextBlock.component.d.ts +0 -37
  160. package/dist/components/blocks/UTextBlock.component.js +0 -123
  161. package/dist/components/blocks/UThinkBlock.component.d.ts +0 -23
  162. package/dist/components/blocks/UThinkBlock.component.js +0 -90
  163. package/dist/components/blocks/UToolBlock.component.d.ts +0 -20
  164. package/dist/components/blocks/UToolBlock.component.js +0 -80
  165. package/dist/components/buttons/UAttachButton.component.d.ts +0 -22
  166. package/dist/components/buttons/UAttachButton.component.js +0 -89
  167. package/dist/components/buttons/UCopyButton.component.d.ts +0 -20
  168. package/dist/components/buttons/UCopyButton.component.js +0 -81
  169. package/dist/components/buttons/UReportButton.component.d.ts +0 -9
  170. package/dist/components/buttons/UReportButton.component.js +0 -36
  171. package/dist/components/buttons/UReportButton.d.ts +0 -7
  172. package/dist/components/buttons/UReportButton.js +0 -5
  173. package/dist/components/buttons/UReportButton.styles.js +0 -14
  174. package/dist/components/buttons/URetryButton.component.d.ts +0 -11
  175. package/dist/components/buttons/URetryButton.component.js +0 -53
  176. package/dist/components/buttons/URetryButton.d.ts +0 -7
  177. package/dist/components/buttons/URetryButton.js +0 -5
  178. package/dist/components/buttons/URetryButton.styles.js +0 -26
  179. package/dist/components/buttons/UShareButton.component.d.ts +0 -9
  180. package/dist/components/buttons/UShareButton.component.js +0 -36
  181. package/dist/components/buttons/UShareButton.d.ts +0 -7
  182. package/dist/components/buttons/UShareButton.js +0 -5
  183. package/dist/components/buttons/UShareButton.styles.js +0 -14
  184. package/dist/components/buttons/UVoteButton.component.d.ts +0 -15
  185. package/dist/components/buttons/UVoteButton.component.js +0 -70
  186. package/dist/components/loaders/UDotLoader.component.d.ts +0 -9
  187. package/dist/components/loaders/UDotLoader.component.js +0 -23
  188. package/dist/components/loaders/UDotLoader.d.ts +0 -7
  189. package/dist/components/loaders/UDotLoader.js +0 -5
  190. package/dist/components/loaders/UDotLoader.styles.js +0 -50
  191. package/dist/components/message/UMessage.component.d.ts +0 -19
  192. package/dist/components/message/UMessage.component.js +0 -90
  193. package/dist/components/prompt/UPrompt.component.d.ts +0 -25
  194. package/dist/components/prompt/UPrompt.component.js +0 -113
  195. package/dist/components/references/URefCard.component.d.ts +0 -24
  196. package/dist/components/references/URefCard.component.js +0 -105
  197. package/dist/components/references/URefCardGroup.component.d.ts +0 -25
  198. package/dist/components/references/URefCardGroup.component.js +0 -88
  199. package/dist/components/references/URefTag.component.d.ts +0 -13
  200. package/dist/components/references/URefTag.component.js +0 -54
  201. package/dist/events/UCancelEvent.d.ts +0 -6
  202. package/dist/events/USubmitEvent.d.ts +0 -6
  203. package/dist/utilities/converters.d.ts +0 -9
  204. package/dist/utilities/converters.js +0 -19
  205. /package/dist/components/{buttons/UReportButton.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
  206. /package/dist/components/{buttons/URetryButton.styles.d.ts → blocks/UTableBlock.styles.d.ts} +0 -0
  207. /package/dist/components/{buttons/UShareButton.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
  208. /package/dist/components/{loaders/UDotLoader.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
@@ -1,20 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- import { JsonNode } from '../../types/JsonNode.js';
3
- /**
4
- * 툴 사용 블록 컴포넌트입니다.
5
- */
6
- export declare class UToolBlock extends BaseElement {
7
- static styles: import('lit').CSSResultGroup[];
8
- static dependencies: Record<string, typeof BaseElement>;
9
- /** 로딩 상태 */
10
- loading: boolean;
11
- /** 블록 접힘 여부 */
12
- collapsed: boolean;
13
- /** 헤딩 텍스트 */
14
- heading?: string;
15
- /** 입력 데이터 (JSON Object) */
16
- input?: JsonNode;
17
- /** 출력 데이터 (JSON Object) */
18
- output?: JsonNode;
19
- render(): import('lit-html').TemplateResult<1>;
20
- }
@@ -1,80 +0,0 @@
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 { USpinner } from '@iyulab/components/dist/components/spinner/USpinner.component.js';
6
- import { UJsonBlock } from './UJsonBlock.component.js';
7
- import { jsonAttrConverter } from '../../utilities/converters.js';
8
- import { styles } from './UToolBlock.styles.js';
9
-
10
- var __defProp = Object.defineProperty;
11
- var __decorateClass = (decorators, target, key, kind) => {
12
- var result = void 0 ;
13
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
- if (decorator = decorators[i])
15
- result = (decorator(target, key, result) ) || result;
16
- if (result) __defProp(target, key, result);
17
- return result;
18
- };
19
- class UToolBlock extends BaseElement {
20
- constructor() {
21
- super(...arguments);
22
- this.loading = false;
23
- this.collapsed = true;
24
- }
25
- static {
26
- this.styles = [super.styles, styles];
27
- }
28
- static {
29
- this.dependencies = {
30
- "u-icon": UIcon,
31
- "u-spinner": USpinner,
32
- "u-json-block": UJsonBlock
33
- };
34
- }
35
- render() {
36
- return html`
37
- <div class="header" @click=${() => this.collapsed = !this.collapsed}>
38
- ${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon lib="internal" name="tools"></u-icon>`}
39
- <div class="title">
40
- ${this.heading || "Tool Usage"}
41
- </div>
42
- <u-icon
43
- lib="internal"
44
- name=${this.collapsed ? "plus-lg" : "dash-lg"}
45
- ></u-icon>
46
- </div>
47
-
48
- <div class="body" part="body" scrollable ?hidden=${this.collapsed}>
49
- <div class="input-view" ?hidden=${!this.input}>
50
- <u-json-block
51
- .value=${this.input || {}}
52
- ></u-json-block>
53
- </div>
54
- <div class="output-view" ?hidden=${!this.output}>
55
- <u-icon lib="internal" name="chevron-down"></u-icon>
56
- <u-json-block
57
- .value=${this.output || {}}
58
- ></u-json-block>
59
- </div>
60
- </div>
61
- `;
62
- }
63
- }
64
- __decorateClass([
65
- property({ type: Boolean, reflect: true })
66
- ], UToolBlock.prototype, "loading");
67
- __decorateClass([
68
- property({ type: Boolean, reflect: true })
69
- ], UToolBlock.prototype, "collapsed");
70
- __decorateClass([
71
- property({ type: String })
72
- ], UToolBlock.prototype, "heading");
73
- __decorateClass([
74
- property({ type: Object, converter: jsonAttrConverter })
75
- ], UToolBlock.prototype, "input");
76
- __decorateClass([
77
- property({ type: Object, converter: jsonAttrConverter })
78
- ], UToolBlock.prototype, "output");
79
-
80
- export { UToolBlock };
@@ -1,22 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * 파일 첨부 버튼 컴포넌트입니다.
4
- */
5
- export declare class UAttachButton extends BaseElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof BaseElement>;
8
- input?: HTMLInputElement;
9
- /** 첨부 파일 유형 제한, 컴마로 구분된 MIME 타입 문자열 (예: "image/*,application/pdf") */
10
- accept?: string;
11
- /** 다중 파일 선택 가능 여부 */
12
- multiple: boolean;
13
- render(): import('lit-html').TemplateResult<1>;
14
- /**
15
- * 버튼 클릭 핸들러
16
- */
17
- private handleButtonClick;
18
- /**
19
- * 파일 선택 이벤트 핸들러
20
- */
21
- private handleInputChange;
22
- }
@@ -1,89 +0,0 @@
1
- import { html } from 'lit';
2
- import { query, 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 './UAttachButton.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 UAttachButton extends BaseElement {
19
- constructor() {
20
- super(...arguments);
21
- this.multiple = false;
22
- /**
23
- * 버튼 클릭 핸들러
24
- */
25
- this.handleButtonClick = () => {
26
- if (!this.input) return;
27
- this.input.click();
28
- };
29
- /**
30
- * 파일 선택 이벤트 핸들러
31
- */
32
- this.handleInputChange = (e) => {
33
- e.preventDefault();
34
- e.stopPropagation();
35
- const target = e.target;
36
- const files = target.files;
37
- if (!files || files.length === 0) return;
38
- this.emit("u-change", {
39
- files: Array.from(files)
40
- });
41
- target.value = "";
42
- };
43
- }
44
- static {
45
- this.styles = [super.styles, styles];
46
- }
47
- static {
48
- this.dependencies = {
49
- "u-icon": UIcon,
50
- "u-button": UButton,
51
- "u-tooltip": UTooltip
52
- };
53
- }
54
- render() {
55
- return html`
56
- <u-button part="base"
57
- variant="borderless"
58
- @click=${this.handleButtonClick}>
59
- <u-icon part="icon"
60
- lib="internal"
61
- name="paperclip"
62
- ></u-icon>
63
- </u-button>
64
-
65
- <u-tooltip for="u-button" placement="bottom" distance="8">
66
- <slot></slot>
67
- </u-tooltip>
68
-
69
- <input
70
- hidden
71
- type="file"
72
- ?multiple=${this.multiple}
73
- .accept=${this.accept || "*"}
74
- @change=${this.handleInputChange}
75
- />
76
- `;
77
- }
78
- }
79
- __decorateClass([
80
- query('input[type="file"]')
81
- ], UAttachButton.prototype, "input");
82
- __decorateClass([
83
- property({ type: String })
84
- ], UAttachButton.prototype, "accept");
85
- __decorateClass([
86
- property({ type: Boolean })
87
- ], UAttachButton.prototype, "multiple");
88
-
89
- export { UAttachButton };
@@ -1,20 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * 클릭 시 클립보드에 텍스트를 복사하는 버튼입니다. 복사 상태를 표시하기 위해 아이콘이 변경됩니다.
4
- */
5
- export declare class UCopyButton extends BaseElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof BaseElement>;
8
- /** 클립보드 복사 상태를 나타내는 플래그입니다. */
9
- isCopied: boolean;
10
- /** 클립보드 복사 후 재사용 대기 시간 (ms) */
11
- delay: number;
12
- /** 복사할 텍스트를 설정합니다. */
13
- value?: string;
14
- render(): import('lit-html').TemplateResult<1>;
15
- /**
16
- * 클립보드에 텍스트를 복사하는 메서드입니다.
17
- * 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
18
- */
19
- private copyToClipboard;
20
- }
@@ -1,81 +0,0 @@
1
- import { html } from 'lit';
2
- import { state, 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 './UCopyButton.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 UCopyButton extends BaseElement {
19
- constructor() {
20
- super(...arguments);
21
- this.isCopied = false;
22
- this.delay = 1e3;
23
- /**
24
- * 클립보드에 텍스트를 복사하는 메서드입니다.
25
- * 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
26
- */
27
- this.copyToClipboard = async () => {
28
- if (!this.value) return;
29
- if (this.isCopied) return;
30
- try {
31
- await window.navigator.clipboard.writeText(this.value);
32
- if (this.delay <= 0) return;
33
- this.isCopied = true;
34
- setTimeout(() => {
35
- this.isCopied = false;
36
- }, this.delay);
37
- } catch (error) {
38
- console.error("Failed to copy text to clipboard:", error);
39
- this.isCopied = false;
40
- }
41
- };
42
- }
43
- static {
44
- this.styles = [super.styles, styles];
45
- }
46
- static {
47
- this.dependencies = {
48
- "u-icon": UIcon,
49
- "u-button": UButton,
50
- "u-tooltip": UTooltip
51
- };
52
- }
53
- render() {
54
- return html`
55
- <u-button part="base"
56
- variant="borderless"
57
- ?disabled=${this.isCopied}
58
- @click=${this.copyToClipboard}>
59
- <u-icon part="icon"
60
- lib="internal"
61
- name=${this.isCopied ? "check-lg" : "copy"}
62
- ></u-icon>
63
- </u-button>
64
-
65
- <u-tooltip for="u-button" placement="bottom" distance="8">
66
- <slot></slot>
67
- </u-tooltip>
68
- `;
69
- }
70
- }
71
- __decorateClass([
72
- state()
73
- ], UCopyButton.prototype, "isCopied");
74
- __decorateClass([
75
- property({ type: Number })
76
- ], UCopyButton.prototype, "delay");
77
- __decorateClass([
78
- property({ type: String })
79
- ], UCopyButton.prototype, "value");
80
-
81
- export { UCopyButton };
@@ -1,9 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * 메시지 신고 버튼 컴포넌트입니다.
4
- */
5
- export declare class UReportButton extends BaseElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof BaseElement>;
8
- render(): import('lit-html').TemplateResult<1>;
9
- }
@@ -1,36 +0,0 @@
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 './UReportButton.styles.js';
7
-
8
- class UReportButton 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="flag"
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 { UReportButton };
@@ -1,7 +0,0 @@
1
- import { UReportButton } from './UReportButton.component.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'u-report-button': UReportButton;
5
- }
6
- }
7
- export { UReportButton };
@@ -1,5 +0,0 @@
1
- import { UReportButton } from './UReportButton.component.js';
2
-
3
- UReportButton.define("u-report-button");
4
-
5
- export { UReportButton };
@@ -1,14 +0,0 @@
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 };
@@ -1,11 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * 메시지 재시도 버튼 컴포넌트입니다.
4
- */
5
- export declare class URetryButton extends BaseElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof BaseElement>;
8
- /** 재생성 중인지 여부 */
9
- loading: boolean;
10
- render(): import('lit-html').TemplateResult<1>;
11
- }
@@ -1,53 +0,0 @@
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 './URetryButton.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 URetryButton extends BaseElement {
19
- constructor() {
20
- super(...arguments);
21
- this.loading = false;
22
- }
23
- static {
24
- this.styles = [super.styles, styles];
25
- }
26
- static {
27
- this.dependencies = {
28
- "u-icon": UIcon,
29
- "u-button": UButton,
30
- "u-tooltip": UTooltip
31
- };
32
- }
33
- render() {
34
- return html`
35
- <u-button part="base"
36
- variant="borderless">
37
- <u-icon part="icon"
38
- lib="internal"
39
- name="arrow-repeat"
40
- ></u-icon>
41
- </u-button>
42
-
43
- <u-tooltip for="u-button" placement="bottom" distance="8">
44
- <slot></slot>
45
- </u-tooltip>
46
- `;
47
- }
48
- }
49
- __decorateClass([
50
- property({ type: Boolean, reflect: true })
51
- ], URetryButton.prototype, "loading");
52
-
53
- export { URetryButton };
@@ -1,7 +0,0 @@
1
- import { URetryButton } from './URetryButton.component.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'u-retry-button': URetryButton;
5
- }
6
- }
7
- export { URetryButton };
@@ -1,5 +0,0 @@
1
- import { URetryButton } from './URetryButton.component.js';
2
-
3
- URetryButton.define("u-retry-button");
4
-
5
- export { URetryButton };
@@ -1,26 +0,0 @@
1
- import { css } from 'lit';
2
-
3
- const styles = css`
4
- :host(:empty) u-tooltip {
5
- display: none;
6
- }
7
- :host([loading]) u-icon {
8
- animation: spin 1s linear infinite;
9
- }
10
-
11
- u-button {
12
- color: var(--u-txt-color-weak);
13
- font-size: 16px;
14
- }
15
-
16
- @keyframes spin {
17
- from {
18
- transform: rotate(0deg);
19
- }
20
- to {
21
- transform: rotate(360deg);
22
- }
23
- }
24
- `;
25
-
26
- export { styles };
@@ -1,9 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /**
3
- * 메시지 공유하기 버튼 컴포넌트입니다.
4
- */
5
- export declare class UShareButton extends BaseElement {
6
- static styles: import('lit').CSSResultGroup[];
7
- static dependencies: Record<string, typeof BaseElement>;
8
- render(): import('lit-html').TemplateResult<1>;
9
- }
@@ -1,36 +0,0 @@
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 };
@@ -1,7 +0,0 @@
1
- import { UShareButton } from './UShareButton.component.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'u-share-button': UShareButton;
5
- }
6
- }
7
- export { UShareButton };
@@ -1,5 +0,0 @@
1
- import { UShareButton } from './UShareButton.component.js';
2
-
3
- UShareButton.define("u-share-button");
4
-
5
- export { UShareButton };
@@ -1,14 +0,0 @@
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 };
@@ -1,15 +0,0 @@
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
- }
@@ -1,70 +0,0 @@
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 };