@iyulab/chat-components 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/assets/action-prompt.md.js +3 -0
- package/dist/assets/widget-prompt.md.js +3 -0
- package/dist/components/actions/UQuestionAction.component.d.ts +18 -0
- package/dist/components/actions/UQuestionAction.component.js +58 -0
- package/dist/components/actions/UQuestionAction.d.ts +7 -0
- package/dist/components/actions/UQuestionAction.js +5 -0
- package/dist/components/actions/UQuestionAction.styles.js +45 -0
- package/dist/components/blocks/UCodeBlock.component.d.ts +5 -3
- package/dist/components/blocks/UCodeBlock.component.js +14 -2
- package/dist/components/blocks/UCodeBlock.styles.js +6 -0
- package/dist/components/blocks/UFilesBlock.component.d.ts +22 -0
- package/dist/components/blocks/UFilesBlock.component.js +192 -0
- package/dist/components/blocks/UFilesBlock.d.ts +7 -0
- package/dist/components/blocks/UFilesBlock.js +5 -0
- package/dist/components/blocks/UFilesBlock.styles.d.ts +1 -0
- package/dist/components/blocks/UFilesBlock.styles.js +206 -0
- package/dist/components/blocks/UJsonBlock.component.d.ts +3 -3
- package/dist/components/blocks/UJsonBlock.component.js +2 -2
- package/dist/components/blocks/UMarkedBlock.component.d.ts +17 -22
- package/dist/components/blocks/UMarkedBlock.component.js +92 -62
- package/dist/components/blocks/URefBlock.component.d.ts +3 -3
- package/dist/components/blocks/URefBlock.component.js +6 -7
- package/dist/components/blocks/UTableBlock.component.d.ts +49 -0
- package/dist/components/blocks/UTableBlock.component.js +228 -0
- package/dist/components/blocks/UTableBlock.d.ts +7 -0
- package/dist/components/blocks/UTableBlock.js +5 -0
- package/dist/components/blocks/UTableBlock.styles.d.ts +1 -0
- package/dist/components/blocks/UTableBlock.styles.js +134 -0
- package/dist/components/blocks/UTextBlock.component.d.ts +3 -3
- package/dist/components/blocks/UTextBlock.component.js +2 -2
- package/dist/components/blocks/UThinkBlock.component.d.ts +3 -3
- package/dist/components/blocks/UThinkBlock.component.js +2 -2
- package/dist/components/blocks/UToolBlock.component.d.ts +3 -3
- package/dist/components/blocks/UToolBlock.component.js +2 -2
- package/dist/components/buttons/UAttachButton.component.d.ts +3 -3
- package/dist/components/buttons/UAttachButton.component.js +2 -2
- package/dist/components/buttons/UCopyButton.component.d.ts +3 -3
- package/dist/components/buttons/UCopyButton.component.js +2 -2
- package/dist/components/buttons/UReportButton.component.d.ts +3 -3
- package/dist/components/buttons/UReportButton.component.js +2 -2
- package/dist/components/buttons/URetryButton.component.d.ts +3 -3
- package/dist/components/buttons/URetryButton.component.js +2 -2
- package/dist/components/buttons/UShareButton.component.d.ts +3 -3
- package/dist/components/buttons/UShareButton.component.js +2 -2
- package/dist/components/buttons/UVoteButton.component.d.ts +3 -3
- package/dist/components/buttons/UVoteButton.component.js +7 -4
- package/dist/components/message/UMessage.component.d.ts +7 -7
- package/dist/components/message/UMessage.component.js +16 -50
- package/dist/components/message/UMessage.styles.js +38 -11
- package/dist/components/prompt/UPrompt.component.d.ts +3 -3
- package/dist/components/prompt/UPrompt.component.js +2 -2
- package/dist/components/prompt/UPrompt.styles.js +28 -0
- package/dist/components/references/URefCard.component.d.ts +9 -6
- package/dist/components/references/URefCard.component.js +14 -10
- package/dist/components/references/URefCardGroup.component.d.ts +4 -3
- package/dist/components/references/URefCardGroup.component.js +3 -3
- package/dist/components/references/URefTag.component.d.ts +3 -3
- package/dist/components/references/URefTag.component.js +2 -2
- package/dist/components/widgets/UChartWidget.component.d.ts +36 -0
- package/dist/components/widgets/UChartWidget.component.js +180 -0
- package/dist/components/widgets/UChartWidget.d.ts +7 -0
- package/dist/components/widgets/UChartWidget.js +5 -0
- package/dist/components/widgets/UChartWidget.styles.d.ts +1 -0
- package/dist/components/widgets/UChartWidget.styles.js +86 -0
- package/dist/components/widgets/UImagesWidget.component.d.ts +30 -0
- package/dist/components/widgets/UImagesWidget.component.js +164 -0
- package/dist/components/widgets/UImagesWidget.d.ts +7 -0
- package/dist/components/widgets/UImagesWidget.js +5 -0
- package/dist/components/widgets/UImagesWidget.styles.d.ts +1 -0
- package/dist/components/widgets/UImagesWidget.styles.js +218 -0
- package/dist/components/widgets/UMapWidget.component.d.ts +20 -0
- package/dist/components/widgets/UMapWidget.component.js +65 -0
- package/dist/components/widgets/UMapWidget.d.ts +7 -0
- package/dist/components/widgets/UMapWidget.js +5 -0
- package/dist/components/widgets/UMapWidget.styles.d.ts +1 -0
- package/dist/components/widgets/UMapWidget.styles.js +47 -0
- package/dist/components/widgets/UVideoWidget.component.d.ts +21 -0
- package/dist/components/widgets/UVideoWidget.component.js +106 -0
- package/dist/components/widgets/UVideoWidget.d.ts +7 -0
- package/dist/components/widgets/UVideoWidget.js +5 -0
- package/dist/components/widgets/UVideoWidget.styles.d.ts +1 -0
- package/dist/components/widgets/UVideoWidget.styles.js +36 -0
- package/dist/components/widgets/UWidget.component.d.ts +43 -0
- package/dist/components/widgets/UWidget.component.js +140 -0
- package/dist/components/widgets/UWidget.d.ts +7 -0
- package/dist/components/widgets/UWidget.js +5 -0
- package/dist/components/widgets/UWidget.styles.d.ts +1 -0
- package/dist/components/widgets/UWidget.styles.js +33 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +20 -2
- package/dist/types/Actions.d.ts +24 -0
- package/dist/types/Actions.js +34 -0
- package/dist/types/BlockItem.d.ts +32 -1
- package/dist/types/JsonSchema.d.ts +59 -0
- package/dist/types/Widgets.d.ts +34 -0
- package/dist/types/Widgets.js +115 -0
- package/dist/utilities/ActionPromptBuilder.d.ts +40 -0
- package/dist/utilities/ActionPromptBuilder.js +93 -0
- package/dist/utilities/WidgetPromptBuilder.d.ts +28 -0
- package/dist/utilities/WidgetPromptBuilder.js +87 -0
- package/package.json +12 -12
- package/dist/components/loaders/UDotLoader.component.d.ts +0 -9
- package/dist/components/loaders/UDotLoader.component.js +0 -23
- package/dist/components/loaders/UDotLoader.d.ts +0 -7
- package/dist/components/loaders/UDotLoader.js +0 -5
- package/dist/components/loaders/UDotLoader.styles.js +0 -50
- /package/dist/components/{loaders/UDotLoader.styles.d.ts → actions/UQuestionAction.styles.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
3
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
4
4
|
import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
|
|
5
5
|
import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
|
|
6
6
|
import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
|
|
@@ -15,7 +15,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
if (result) __defProp(target, key, result);
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
|
-
class UVoteButton extends
|
|
18
|
+
class UVoteButton extends UElement {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.value = "none";
|
|
@@ -57,8 +57,11 @@ class UVoteButton extends BaseElement {
|
|
|
57
57
|
></u-icon>
|
|
58
58
|
</u-button>
|
|
59
59
|
|
|
60
|
-
<u-tooltip for="
|
|
61
|
-
<slot></slot>
|
|
60
|
+
<u-tooltip for=".up-btn" placement="bottom" distance="8">
|
|
61
|
+
<slot name="up"></slot>
|
|
62
|
+
</u-tooltip>
|
|
63
|
+
<u-tooltip for=".down-btn" placement="bottom" distance="8">
|
|
64
|
+
<slot name="down"></slot>
|
|
62
65
|
</u-tooltip>
|
|
63
66
|
`;
|
|
64
67
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BlockItem } from '../../types/BlockItem';
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
2
|
/** 메시지 variant 타입 */
|
|
4
3
|
export type MessageVariant = 'default' | 'bubble';
|
|
5
4
|
/** 메시지 위치 타입 */
|
|
6
5
|
export type MessagePosition = 'left' | 'right';
|
|
6
|
+
/** 메시지 너비 타입 */
|
|
7
|
+
export type MessageFit = 'full' | 'auto';
|
|
7
8
|
/**
|
|
8
9
|
* 채팅 메시지 컴포넌트입니다.
|
|
9
|
-
* 다양한
|
|
10
|
+
* 슬롯을 통해 다양한 블록 컴포넌트를 자유롭게 배치할 수 있습니다.
|
|
10
11
|
*/
|
|
11
|
-
export declare class UMessage extends
|
|
12
|
+
export declare class UMessage extends UElement {
|
|
12
13
|
static styles: import('lit').CSSResultGroup[];
|
|
13
|
-
static dependencies: Record<string, typeof
|
|
14
|
+
static dependencies: Record<string, typeof UElement>;
|
|
15
|
+
loading: boolean;
|
|
14
16
|
variant: MessageVariant;
|
|
15
17
|
position: MessagePosition;
|
|
16
|
-
loading: boolean;
|
|
17
|
-
items?: BlockItem[];
|
|
18
18
|
render(): import('lit-html').TemplateResult<1>;
|
|
19
19
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
4
|
-
import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
|
|
5
|
-
import { UTextBlock } from '../blocks/UTextBlock.component.js';
|
|
6
|
-
import { UMarkedBlock } from '../blocks/UMarkedBlock.component.js';
|
|
7
|
-
import { UThinkBlock } from '../blocks/UThinkBlock.component.js';
|
|
8
|
-
import { UToolBlock } from '../blocks/UToolBlock.component.js';
|
|
9
|
-
import { URefBlock } from '../blocks/URefBlock.component.js';
|
|
10
|
-
import { UDotLoader } from '../loaders/UDotLoader.component.js';
|
|
3
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
11
4
|
import { styles } from './UMessage.styles.js';
|
|
12
5
|
|
|
13
6
|
var __defProp = Object.defineProperty;
|
|
@@ -19,72 +12,45 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
19
12
|
if (result) __defProp(target, key, result);
|
|
20
13
|
return result;
|
|
21
14
|
};
|
|
22
|
-
class UMessage extends
|
|
15
|
+
class UMessage extends UElement {
|
|
23
16
|
constructor() {
|
|
24
17
|
super(...arguments);
|
|
18
|
+
this.loading = false;
|
|
25
19
|
this.variant = "default";
|
|
26
20
|
this.position = "left";
|
|
27
|
-
this.loading = false;
|
|
28
21
|
}
|
|
29
22
|
static {
|
|
30
23
|
this.styles = [super.styles, styles];
|
|
31
24
|
}
|
|
32
25
|
static {
|
|
33
|
-
this.dependencies = {
|
|
34
|
-
"u-text-block": UTextBlock,
|
|
35
|
-
"u-marked-block": UMarkedBlock,
|
|
36
|
-
"u-think-block": UThinkBlock,
|
|
37
|
-
"u-tool-block": UToolBlock,
|
|
38
|
-
"u-ref-block": URefBlock,
|
|
39
|
-
"u-dot-loader": UDotLoader
|
|
40
|
-
};
|
|
26
|
+
this.dependencies = {};
|
|
41
27
|
}
|
|
42
28
|
render() {
|
|
43
29
|
return html`
|
|
44
30
|
<slot name="header"></slot>
|
|
45
|
-
|
|
31
|
+
|
|
46
32
|
<div class="body" part="body" variant=${this.variant} position=${this.position}>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
></u-marked-block>` : item.type === "thinking" ? html`
|
|
55
|
-
<u-think-block
|
|
56
|
-
.value=${item.value}
|
|
57
|
-
></u-think-block>` : item.type === "tool" ? html`
|
|
58
|
-
<u-tool-block
|
|
59
|
-
index=${idx}
|
|
60
|
-
.heading=${item.title}
|
|
61
|
-
.input=${item.input}
|
|
62
|
-
.output=${item.output}
|
|
63
|
-
></u-tool-block>` : item.type === "reference" ? html`
|
|
64
|
-
<u-ref-block
|
|
65
|
-
.heading=${"References"}
|
|
66
|
-
.sources=${item.sources}
|
|
67
|
-
></u-ref-block>` : nothing)}
|
|
68
|
-
<u-dot-loader
|
|
69
|
-
?hidden=${!this.loading}
|
|
70
|
-
></u-dot-loader>
|
|
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>
|
|
71
40
|
</div>
|
|
72
41
|
|
|
73
42
|
<slot name="footer" ?hidden=${this.loading}></slot>
|
|
74
43
|
`;
|
|
75
44
|
}
|
|
76
45
|
}
|
|
46
|
+
__decorateClass([
|
|
47
|
+
property({ type: Boolean, reflect: true })
|
|
48
|
+
], UMessage.prototype, "loading");
|
|
77
49
|
__decorateClass([
|
|
78
50
|
property({ type: String, reflect: true })
|
|
79
51
|
], UMessage.prototype, "variant");
|
|
80
52
|
__decorateClass([
|
|
81
53
|
property({ type: String, reflect: true })
|
|
82
54
|
], UMessage.prototype, "position");
|
|
83
|
-
__decorateClass([
|
|
84
|
-
property({ type: Boolean, reflect: true })
|
|
85
|
-
], UMessage.prototype, "loading");
|
|
86
|
-
__decorateClass([
|
|
87
|
-
property({ type: Array })
|
|
88
|
-
], UMessage.prototype, "items");
|
|
89
55
|
|
|
90
56
|
export { UMessage };
|
|
@@ -2,17 +2,11 @@ import { css } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
const styles = css`
|
|
4
4
|
:host {
|
|
5
|
+
width: auto;
|
|
6
|
+
max-width: 100%;
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
}
|
|
8
|
-
:host([variant="default"]) {
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
:host([variant="bubble"]) {
|
|
12
|
-
width: auto;
|
|
13
|
-
min-width: 40px;
|
|
14
|
-
max-width: 80%;
|
|
15
|
-
}
|
|
16
10
|
:host([position="left"]) {
|
|
17
11
|
align-self: flex-start;
|
|
18
12
|
align-items: flex-start;
|
|
@@ -44,9 +38,42 @@ const styles = css`
|
|
|
44
38
|
border-bottom-right-radius: 4px;
|
|
45
39
|
}
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
.dot-loader {
|
|
42
|
+
width: 24px;
|
|
43
|
+
height: 24px;
|
|
44
|
+
fill: var(--u-neutral-800, #6b7280);
|
|
45
|
+
}
|
|
46
|
+
.dot-loader circle {
|
|
47
|
+
animation: bounce 1.05s infinite;
|
|
48
|
+
transform-box: fill-box;
|
|
49
|
+
transform-origin: center;
|
|
50
|
+
}
|
|
51
|
+
.dot-loader circle.d1 {
|
|
52
|
+
animation-delay: 0.1s;
|
|
53
|
+
}
|
|
54
|
+
.dot-loader circle.d2 {
|
|
55
|
+
animation-delay: 0.2s;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (prefers-reduced-motion: reduce) {
|
|
59
|
+
.dot-loader circle {
|
|
60
|
+
animation: none;
|
|
61
|
+
transform: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes bounce {
|
|
66
|
+
0%,57.14% {
|
|
67
|
+
animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
|
|
68
|
+
transform: translateY(0);
|
|
69
|
+
}
|
|
70
|
+
28.57% {
|
|
71
|
+
animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
|
|
72
|
+
transform: translateY(-6px);
|
|
73
|
+
}
|
|
74
|
+
100% {
|
|
75
|
+
transform: translateY(0);
|
|
76
|
+
}
|
|
50
77
|
}
|
|
51
78
|
`;
|
|
52
79
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
2
|
/**
|
|
3
3
|
* 채팅 입력 컴포넌트입니다.
|
|
4
4
|
* 텍스트 입력 영역과 우측에 액션 버튼을 배치할 수 있는 슬롯을 제공합니다.
|
|
5
5
|
*/
|
|
6
|
-
export declare class UPrompt extends
|
|
6
|
+
export declare class UPrompt extends UElement {
|
|
7
7
|
static styles: import('lit').CSSResultGroup[];
|
|
8
|
-
static dependencies: Record<string, typeof
|
|
8
|
+
static dependencies: Record<string, typeof UElement>;
|
|
9
9
|
/** 로딩 상태 여부 */
|
|
10
10
|
loading: boolean;
|
|
11
11
|
/** 최소 행 수 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
3
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
4
4
|
import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
|
|
5
5
|
import { UButton } from '@iyulab/components/dist/components/button/UButton.component.js';
|
|
6
6
|
import { UTextBlock } from '../blocks/UTextBlock.component.js';
|
|
@@ -15,7 +15,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
if (result) __defProp(target, key, result);
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
|
-
class UPrompt extends
|
|
18
|
+
class UPrompt extends UElement {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.loading = false;
|
|
@@ -2,6 +2,7 @@ import { css } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
const styles = css`
|
|
4
4
|
:host {
|
|
5
|
+
position: relative;
|
|
5
6
|
display: flex;
|
|
6
7
|
flex-direction: column;
|
|
7
8
|
padding: 12px;
|
|
@@ -14,6 +15,28 @@ const styles = css`
|
|
|
14
15
|
border-color: var(--u-neutral-400, #9ca3af);
|
|
15
16
|
box-shadow: 0 0 0 1px var(--u-neutral-200, #9ca3af);
|
|
16
17
|
}
|
|
18
|
+
:host([loading])::before {
|
|
19
|
+
content: '';
|
|
20
|
+
position: absolute;
|
|
21
|
+
inset: -2px;
|
|
22
|
+
border-radius: 10px;
|
|
23
|
+
padding: 2px;
|
|
24
|
+
background: linear-gradient(90deg,
|
|
25
|
+
transparent 0%,
|
|
26
|
+
transparent 25%,
|
|
27
|
+
#f9a8d4 45%,
|
|
28
|
+
#fbbf24 55%,
|
|
29
|
+
transparent 75%,
|
|
30
|
+
transparent 100%
|
|
31
|
+
);
|
|
32
|
+
background-size: 300% 100%;
|
|
33
|
+
animation: border-shimmer 2s linear infinite;
|
|
34
|
+
-webkit-mask:
|
|
35
|
+
linear-gradient(#fff 0 0) content-box,
|
|
36
|
+
linear-gradient(#fff 0 0);
|
|
37
|
+
-webkit-mask-composite: xor;
|
|
38
|
+
mask-composite: exclude;
|
|
39
|
+
}
|
|
17
40
|
|
|
18
41
|
u-text-block {
|
|
19
42
|
flex: 1;
|
|
@@ -37,6 +60,11 @@ const styles = css`
|
|
|
37
60
|
opacity: 0.5;
|
|
38
61
|
cursor: not-allowed;
|
|
39
62
|
}
|
|
63
|
+
|
|
64
|
+
@keyframes border-shimmer {
|
|
65
|
+
0% { background-position: 100% 0; }
|
|
66
|
+
100% { background-position: 0% 0; }
|
|
67
|
+
}
|
|
40
68
|
`;
|
|
41
69
|
|
|
42
70
|
export { styles };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
import { UJsonElement } from '@iyulab/components/dist/components/UJsonElement.js';
|
|
2
3
|
/**
|
|
3
4
|
* 참조 소스를 카드 형태로 표시하는 공통 컴포넌트입니다.
|
|
4
5
|
* Web과 Document 타입 모두 지원합니다.
|
|
5
6
|
*/
|
|
6
|
-
export declare class URefCard extends
|
|
7
|
-
static styles: import('lit').CSSResultGroup[];
|
|
8
|
-
static dependencies: Record<string, typeof
|
|
7
|
+
export declare class URefCard extends UJsonElement {
|
|
8
|
+
static styles: (import('lit').CSSResult | import('lit').CSSResultGroup[])[];
|
|
9
|
+
static dependencies: Record<string, typeof UElement>;
|
|
9
10
|
/** 카드 타입 (web 또는 document) */
|
|
10
11
|
type: 'web' | 'document';
|
|
11
12
|
/** 외부 링크 URL */
|
|
12
|
-
|
|
13
|
+
url?: string;
|
|
13
14
|
/** 카드 타이틀 */
|
|
14
|
-
|
|
15
|
+
title: string;
|
|
16
|
+
/** 카드 본문 스니펫 */
|
|
17
|
+
snippet?: string;
|
|
15
18
|
/** 태그 목록 */
|
|
16
19
|
tags?: string[];
|
|
17
20
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -2,7 +2,7 @@ import { html } from 'lit';
|
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
4
|
import { arrayAttrConverter } from '@iyulab/components/dist/utilities/converters.js';
|
|
5
|
-
import {
|
|
5
|
+
import { UJsonElement } from '@iyulab/components/dist/components/UJsonElement.js';
|
|
6
6
|
import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
|
|
7
7
|
import { styles } from './URefCard.styles.js';
|
|
8
8
|
|
|
@@ -15,10 +15,11 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
if (result) __defProp(target, key, result);
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
|
-
class URefCard extends
|
|
18
|
+
class URefCard extends UJsonElement {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.type = "web";
|
|
22
|
+
this.title = "";
|
|
22
23
|
}
|
|
23
24
|
static {
|
|
24
25
|
this.styles = [super.styles, styles];
|
|
@@ -30,15 +31,15 @@ class URefCard extends BaseElement {
|
|
|
30
31
|
}
|
|
31
32
|
render() {
|
|
32
33
|
return html`
|
|
33
|
-
<a href="${ifDefined(this.
|
|
34
|
+
<a href="${ifDefined(this.url)}" target="_blank" rel="noopener noreferrer"
|
|
34
35
|
@click=${this.handleAnchorClick}>
|
|
35
36
|
<div class="header">
|
|
36
37
|
<img class="favicon"
|
|
37
|
-
src="${this.getFaviconUrl(this.
|
|
38
|
+
src="${this.getFaviconUrl(this.url)}"
|
|
38
39
|
alt="favicon"
|
|
39
40
|
/>
|
|
40
|
-
<div class="title"
|
|
41
|
-
${this.
|
|
41
|
+
<div class="title">
|
|
42
|
+
${this.title || this.getDomainName(this.url)}
|
|
42
43
|
</div>
|
|
43
44
|
|
|
44
45
|
<div style="flex: 1;"></div>
|
|
@@ -53,7 +54,7 @@ class URefCard extends BaseElement {
|
|
|
53
54
|
</div>
|
|
54
55
|
|
|
55
56
|
<div class="body">
|
|
56
|
-
|
|
57
|
+
${this.snippet}
|
|
57
58
|
</div>
|
|
58
59
|
|
|
59
60
|
<div class="footer" ?hidden=${!this.tags || this.tags.length === 0}>
|
|
@@ -64,7 +65,7 @@ class URefCard extends BaseElement {
|
|
|
64
65
|
}
|
|
65
66
|
/** 링크 클릭 핸들러 */
|
|
66
67
|
handleAnchorClick(e) {
|
|
67
|
-
if (!this.
|
|
68
|
+
if (!this.url) {
|
|
68
69
|
e.preventDefault();
|
|
69
70
|
e.stopPropagation();
|
|
70
71
|
}
|
|
@@ -94,10 +95,13 @@ __decorateClass([
|
|
|
94
95
|
], URefCard.prototype, "type");
|
|
95
96
|
__decorateClass([
|
|
96
97
|
property({ type: String })
|
|
97
|
-
], URefCard.prototype, "
|
|
98
|
+
], URefCard.prototype, "url");
|
|
98
99
|
__decorateClass([
|
|
99
100
|
property({ type: String })
|
|
100
|
-
], URefCard.prototype, "
|
|
101
|
+
], URefCard.prototype, "title");
|
|
102
|
+
__decorateClass([
|
|
103
|
+
property({ type: String })
|
|
104
|
+
], URefCard.prototype, "snippet");
|
|
101
105
|
__decorateClass([
|
|
102
106
|
property({ type: Array, converter: arrayAttrConverter((v) => v) })
|
|
103
107
|
], URefCard.prototype, "tags");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
2
|
import { URefCard } from './URefCard.component.js';
|
|
3
3
|
/**
|
|
4
4
|
* 여러 참조 카드를 그룹으로 표시하는 컴포넌트입니다.
|
|
5
5
|
* 페이지네이션 기능을 제공하여 각 카드를 하나씩 탐색할 수 있습니다.
|
|
6
|
+
* 카드가 1개 이하인 경우 페이지네이션 UI는 자동으로 숨겨집니다.
|
|
6
7
|
*/
|
|
7
|
-
export declare class URefCardGroup extends
|
|
8
|
+
export declare class URefCardGroup extends UElement {
|
|
8
9
|
static styles: import('lit').CSSResultGroup[];
|
|
9
|
-
static dependencies: Record<string, typeof
|
|
10
|
+
static dependencies: Record<string, typeof UElement>;
|
|
10
11
|
/** slot으로 받은 카드 엘리먼트들 */
|
|
11
12
|
cards: URefCard[];
|
|
12
13
|
/** 현재 표시 중인 카드의 인덱스 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { state } from 'lit/decorators.js';
|
|
3
|
-
import {
|
|
3
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
4
4
|
import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
|
|
5
5
|
import { URefCard } from './URefCard.component.js';
|
|
6
6
|
import { styles } from './URefCardGroup.styles.js';
|
|
@@ -14,7 +14,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14
14
|
if (result) __defProp(target, key, result);
|
|
15
15
|
return result;
|
|
16
16
|
};
|
|
17
|
-
class URefCardGroup extends
|
|
17
|
+
class URefCardGroup extends UElement {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
this.cards = [];
|
|
@@ -31,7 +31,7 @@ class URefCardGroup extends BaseElement {
|
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
33
|
return html`
|
|
34
|
-
<div class="header">
|
|
34
|
+
<div class="header" ?hidden=${this.cards.length <= 1}>
|
|
35
35
|
<button class="nav-button"
|
|
36
36
|
@click=${this.handlePreviousButtonClick}>
|
|
37
37
|
<u-icon lib="internal" name="chevron-left"></u-icon>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
2
|
/**
|
|
3
3
|
* 인용 태그 컴포넌트입니다.
|
|
4
4
|
*/
|
|
5
|
-
export declare class URefTag extends
|
|
5
|
+
export declare class URefTag extends UElement {
|
|
6
6
|
static styles: import('lit').CSSResultGroup[];
|
|
7
|
-
static dependencies: Record<string, typeof
|
|
7
|
+
static dependencies: Record<string, typeof UElement>;
|
|
8
8
|
/** 인용 출처 소스 데이터 */
|
|
9
9
|
href?: string;
|
|
10
10
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
-
import {
|
|
4
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
5
5
|
import { UTooltip } from '@iyulab/components/dist/components/tooltip/UTooltip.component.js';
|
|
6
6
|
import { UIcon } from '@iyulab/components/dist/components/icon/UIcon.component.js';
|
|
7
7
|
import { styles } from './URefTag.styles.js';
|
|
@@ -15,7 +15,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
if (result) __defProp(target, key, result);
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
|
-
class URefTag extends
|
|
18
|
+
class URefTag extends UElement {
|
|
19
19
|
static {
|
|
20
20
|
this.styles = [super.styles, styles];
|
|
21
21
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { nothing, PropertyValues } from 'lit';
|
|
2
|
+
import { ChartType, ChartData, ChartOptions } from 'chart.js/auto';
|
|
3
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
4
|
+
/**
|
|
5
|
+
* 차트 위젯 컴포넌트
|
|
6
|
+
* Chart.js를 사용하여 다양한 차트를 렌더링
|
|
7
|
+
*/
|
|
8
|
+
export declare class UChartWidget extends UElement {
|
|
9
|
+
static styles: import('lit').CSSResultGroup[];
|
|
10
|
+
static dependencies: Record<string, typeof UElement>;
|
|
11
|
+
/** 차트 유형 (bar, line, pie 등) */
|
|
12
|
+
type?: ChartType;
|
|
13
|
+
/** 차트 데이터 */
|
|
14
|
+
data?: ChartData;
|
|
15
|
+
/** 차트 옵션 */
|
|
16
|
+
options?: ChartOptions;
|
|
17
|
+
private canvas?;
|
|
18
|
+
private viewport?;
|
|
19
|
+
/** 차트 생성 에러 메시지 */
|
|
20
|
+
private error;
|
|
21
|
+
private chartjs;
|
|
22
|
+
private observer?;
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
disconnectedCallback(): void;
|
|
25
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
26
|
+
render(): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
27
|
+
/** Chart.js로 차트 생성 */
|
|
28
|
+
private createChart;
|
|
29
|
+
/** 기존 차트 인스턴스 제거 */
|
|
30
|
+
private destroyChart;
|
|
31
|
+
/** 현재 테마의 CSS 변수를 읽어 Chart.defaults에 전역 적용 */
|
|
32
|
+
private applyTheme;
|
|
33
|
+
private handleDownloadPNG;
|
|
34
|
+
private handleDownloadJSON;
|
|
35
|
+
private handleFullscreen;
|
|
36
|
+
}
|