@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.
- package/CHANGELOG.md +83 -52
- package/README.md +133 -16
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.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 +4 -4
- package/dist/components/blocks/UFileBlock.d.ts +33 -0
- package/dist/components/blocks/UFileBlock.js +154 -0
- package/dist/components/blocks/{UFilesBlock.styles.js → UFileBlock.styles.js} +12 -90
- 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 +47 -2
- package/dist/components/blocks/UTableBlock.js +197 -4
- package/dist/components/blocks/UTableBlock.styles.js +4 -5
- 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/{actions/UQuestionAction.component.d.ts → intents/UQuestionIntent.d.ts} +6 -2
- package/dist/components/intents/UQuestionIntent.js +41 -0
- package/dist/components/{actions/UQuestionAction.styles.js → intents/UQuestionIntent.styles.js} +4 -6
- package/dist/components/message/UMessage.d.ts +18 -2
- package/dist/components/message/UMessage.js +47 -2
- package/dist/components/message/UMessage.styles.js +4 -4
- package/dist/components/prompt/UPrompt.d.ts +37 -2
- package/dist/components/prompt/UPrompt.js +139 -2
- package/dist/components/prompt/UPrompt.styles.js +15 -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/{widgets/UChartWidget.component.d.ts → views/UChartView.d.ts} +7 -4
- package/dist/components/views/UChartView.js +167 -0
- package/dist/components/{widgets/UChartWidget.styles.js → views/UChartView.styles.js} +4 -4
- package/dist/components/{widgets/UImagesWidget.component.d.ts → views/UImagesView.d.ts} +7 -4
- package/dist/components/views/UImagesView.js +144 -0
- package/dist/components/{widgets/UImagesWidget.styles.js → views/UImagesView.styles.js} +6 -5
- package/dist/components/{widgets/UMapWidget.component.d.ts → views/UMapView.d.ts} +7 -3
- package/dist/components/views/UMapView.js +45 -0
- package/dist/components/{widgets/UMapWidget.styles.js → views/UMapView.styles.js} +4 -4
- package/dist/components/{widgets/UVideoWidget.component.d.ts → views/UVideoView.d.ts} +7 -3
- package/dist/components/views/UVideoView.js +81 -0
- package/dist/components/{widgets/UVideoWidget.styles.js → views/UVideoView.styles.js} +4 -4
- package/dist/components/{widgets/UWidget.component.d.ts → views/UView.d.ts} +8 -5
- package/dist/components/views/UView.js +113 -0
- package/dist/components/{widgets/UWidget.styles.js → views/UView.styles.js} +4 -4
- package/dist/events/AttachEvent.d.ts +9 -0
- package/dist/events/ChoiceEvent.d.ts +9 -0
- package/dist/events/SendEvent.d.ts +21 -0
- package/dist/events/StopEvent.d.ts +17 -0
- package/dist/index.d.ts +13 -16
- package/dist/index.js +28 -56
- 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 -32
- package/dist/types/Intents.d.ts +26 -0
- package/dist/types/Intents.js +30 -0
- package/dist/types/{Widgets.d.ts → Views.d.ts} +8 -8
- 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 +33 -16
- package/skills/iyulab-chat-components/SKILL.md +107 -0
- package/skills/iyulab-chat-components/references/components/attach-button.md +69 -0
- package/skills/iyulab-chat-components/references/components/chart-view.md +65 -0
- package/skills/iyulab-chat-components/references/components/code-block.md +42 -0
- package/skills/iyulab-chat-components/references/components/copy-button.md +46 -0
- package/skills/iyulab-chat-components/references/components/file-block.md +64 -0
- package/skills/iyulab-chat-components/references/components/images-view.md +63 -0
- package/skills/iyulab-chat-components/references/components/json-block.md +41 -0
- package/skills/iyulab-chat-components/references/components/map-view.md +54 -0
- package/skills/iyulab-chat-components/references/components/marked-block.md +53 -0
- package/skills/iyulab-chat-components/references/components/message.md +60 -0
- package/skills/iyulab-chat-components/references/components/prompt.md +102 -0
- package/skills/iyulab-chat-components/references/components/question-intent.md +75 -0
- package/skills/iyulab-chat-components/references/components/ref-block.md +45 -0
- package/skills/iyulab-chat-components/references/components/ref-card-group.md +41 -0
- package/skills/iyulab-chat-components/references/components/ref-card.md +48 -0
- package/skills/iyulab-chat-components/references/components/ref-tag.md +40 -0
- package/skills/iyulab-chat-components/references/components/table-block.md +63 -0
- package/skills/iyulab-chat-components/references/components/text-block.md +59 -0
- package/skills/iyulab-chat-components/references/components/think-block.md +48 -0
- package/skills/iyulab-chat-components/references/components/tool-block.md +57 -0
- package/skills/iyulab-chat-components/references/components/video-view.md +55 -0
- package/skills/iyulab-chat-components/references/components/view.md +51 -0
- package/skills/iyulab-chat-components/references/components/vote-button.md +60 -0
- package/skills/iyulab-chat-components/references/types.md +115 -0
- package/skills/iyulab-chat-components/references/usage.md +254 -0
- package/skills/iyulab-chat-components/references/utilities/intent-prompt-builder.md +123 -0
- package/skills/iyulab-chat-components/references/utilities/view-prompt-builder.md +112 -0
- package/dist/assets/action-prompt.md.js +0 -3
- package/dist/assets/widget-prompt.md.js +0 -3
- package/dist/components/actions/UQuestionAction.component.js +0 -58
- package/dist/components/actions/UQuestionAction.d.ts +0 -7
- package/dist/components/actions/UQuestionAction.js +0 -5
- package/dist/components/blocks/UCodeBlock.component.d.ts +0 -25
- package/dist/components/blocks/UCodeBlock.component.js +0 -88
- package/dist/components/blocks/UFilesBlock.component.d.ts +0 -22
- package/dist/components/blocks/UFilesBlock.component.js +0 -192
- package/dist/components/blocks/UFilesBlock.d.ts +0 -7
- package/dist/components/blocks/UFilesBlock.js +0 -5
- 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 -40
- package/dist/components/blocks/UMarkedBlock.component.js +0 -159
- package/dist/components/blocks/URefBlock.component.d.ts +0 -17
- package/dist/components/blocks/URefBlock.component.js +0 -73
- package/dist/components/blocks/UTableBlock.component.d.ts +0 -49
- package/dist/components/blocks/UTableBlock.component.js +0 -228
- 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 -73
- package/dist/components/message/UMessage.component.d.ts +0 -19
- package/dist/components/message/UMessage.component.js +0 -56
- 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 -27
- package/dist/components/references/URefCard.component.js +0 -109
- package/dist/components/references/URefCardGroup.component.d.ts +0 -26
- 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/components/widgets/UChartWidget.component.js +0 -180
- package/dist/components/widgets/UChartWidget.d.ts +0 -7
- package/dist/components/widgets/UChartWidget.js +0 -5
- package/dist/components/widgets/UImagesWidget.component.js +0 -164
- package/dist/components/widgets/UImagesWidget.d.ts +0 -7
- package/dist/components/widgets/UImagesWidget.js +0 -5
- package/dist/components/widgets/UMapWidget.component.js +0 -65
- package/dist/components/widgets/UMapWidget.d.ts +0 -7
- package/dist/components/widgets/UMapWidget.js +0 -5
- package/dist/components/widgets/UMapWidget.styles.d.ts +0 -1
- package/dist/components/widgets/UVideoWidget.component.js +0 -106
- package/dist/components/widgets/UVideoWidget.d.ts +0 -7
- package/dist/components/widgets/UVideoWidget.js +0 -5
- package/dist/components/widgets/UVideoWidget.styles.d.ts +0 -1
- package/dist/components/widgets/UWidget.component.js +0 -140
- package/dist/components/widgets/UWidget.d.ts +0 -7
- package/dist/components/widgets/UWidget.js +0 -5
- package/dist/components/widgets/UWidget.styles.d.ts +0 -1
- package/dist/events/UCancelEvent.d.ts +0 -6
- package/dist/events/USubmitEvent.d.ts +0 -6
- package/dist/types/Actions.d.ts +0 -24
- package/dist/types/Actions.js +0 -34
- package/dist/types/Widgets.js +0 -115
- package/dist/utilities/ActionPromptBuilder.d.ts +0 -40
- package/dist/utilities/ActionPromptBuilder.js +0 -93
- package/dist/utilities/WidgetPromptBuilder.d.ts +0 -28
- package/dist/utilities/WidgetPromptBuilder.js +0 -87
- package/dist/utilities/converters.d.ts +0 -9
- package/dist/utilities/converters.js +0 -19
- /package/dist/components/{actions/UQuestionAction.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
- /package/dist/components/{blocks/UFilesBlock.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UReportButton.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
- /package/dist/components/{buttons/URetryButton.styles.d.ts → views/UImagesView.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UShareButton.styles.d.ts → views/UMapView.styles.d.ts} +0 -0
- /package/dist/components/{widgets/UChartWidget.styles.d.ts → views/UVideoView.styles.d.ts} +0 -0
- /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 };
|