@iyulab/chat-components 0.4.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.
- package/CHANGELOG.md +124 -21
- package/README.md +133 -16
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.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 +32 -2
- package/dist/components/prompt/UPrompt.js +118 -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 +7 -0
- package/dist/events/StopEvent.d.ts +7 -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 +32 -16
- 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,5 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UTextBlock.
|
|
4
|
-
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UTextBlock.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
6
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
7
|
+
//#region src/components/blocks/UTextBlock.ts
|
|
8
|
+
var _ref, _ref2;
|
|
9
|
+
var UTextBlock = class UTextBlock extends UElement {
|
|
10
|
+
constructor(..._args) {
|
|
11
|
+
super(..._args);
|
|
12
|
+
this.editable = false;
|
|
13
|
+
this.spellcheck = false;
|
|
14
|
+
this.minRows = 1;
|
|
15
|
+
this.updateValueFrom = (event) => {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
this.value = this.textareaEl.value;
|
|
18
|
+
this.dispatchEvent(new InputEvent("input", {
|
|
19
|
+
bubbles: true,
|
|
20
|
+
composed: true,
|
|
21
|
+
cancelable: true,
|
|
22
|
+
data: this.value,
|
|
23
|
+
inputType: event.inputType,
|
|
24
|
+
isComposing: event.isComposing,
|
|
25
|
+
dataTransfer: event.dataTransfer,
|
|
26
|
+
detail: event.detail,
|
|
27
|
+
targetRanges: event.getTargetRanges(),
|
|
28
|
+
view: event.view
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
this.styles = [super.styles, styles];
|
|
34
|
+
}
|
|
35
|
+
updated(changedProperties) {
|
|
36
|
+
super.updated(changedProperties);
|
|
37
|
+
if (changedProperties.has("minRows") && this.minRows > 0) {
|
|
38
|
+
const lineHeight = parseFloat(getComputedStyle(this.preEl).lineHeight);
|
|
39
|
+
this.preEl.style.minHeight = `${this.minRows * lineHeight}px`;
|
|
40
|
+
}
|
|
41
|
+
if (changedProperties.has("maxRows") && this.maxRows && this.maxRows > 0 && this.maxRows > this.minRows) {
|
|
42
|
+
const lineHeight = parseFloat(getComputedStyle(this.preEl).lineHeight);
|
|
43
|
+
this.preEl.style.maxHeight = `${this.maxRows * lineHeight}px`;
|
|
44
|
+
}
|
|
45
|
+
if (changedProperties.has("editable") && this.editable) requestAnimationFrame(() => {
|
|
46
|
+
this.textareaEl.focus();
|
|
47
|
+
this.textareaEl.setSelectionRange(this.value?.length || 0, this.value?.length || 0);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return html`
|
|
52
|
+
<div class="container">
|
|
53
|
+
<textarea
|
|
54
|
+
name="message"
|
|
55
|
+
placeholder=${this.placeholder || ""}
|
|
56
|
+
spellcheck=${this.spellcheck}
|
|
57
|
+
.readOnly=${!this.editable}
|
|
58
|
+
.value=${this.value || ""}
|
|
59
|
+
@input=${this.updateValueFrom}
|
|
60
|
+
></textarea>
|
|
61
|
+
<pre
|
|
62
|
+
.textContent=${this.normalizeValue(this.value)}
|
|
63
|
+
></pre>
|
|
64
|
+
</div>
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* textarea에 포커스를 줍니다.
|
|
69
|
+
*/
|
|
70
|
+
focus(options) {
|
|
71
|
+
this.textareaEl.focus(options);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* pre 엘리먼트에 주입될 값을 정규화합니다.
|
|
75
|
+
*/
|
|
76
|
+
normalizeValue(value) {
|
|
77
|
+
if (!value) return "";
|
|
78
|
+
if (value.endsWith("\n")) return value + "";
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
__decorate([property({
|
|
83
|
+
type: Boolean,
|
|
84
|
+
reflect: true
|
|
85
|
+
}), __decorateMetadata("design:type", Boolean)], UTextBlock.prototype, "editable", void 0);
|
|
86
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UTextBlock.prototype, "spellcheck", void 0);
|
|
87
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UTextBlock.prototype, "placeholder", void 0);
|
|
88
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UTextBlock.prototype, "minRows", void 0);
|
|
89
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UTextBlock.prototype, "maxRows", void 0);
|
|
90
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UTextBlock.prototype, "value", void 0);
|
|
91
|
+
__decorate([query("textarea"), __decorateMetadata("design:type", typeof (_ref = typeof HTMLTextAreaElement !== "undefined" && HTMLTextAreaElement) === "function" ? _ref : Object)], UTextBlock.prototype, "textareaEl", void 0);
|
|
92
|
+
__decorate([query("pre"), __decorateMetadata("design:type", typeof (_ref2 = typeof HTMLPreElement !== "undefined" && HTMLPreElement) === "function" ? _ref2 : Object)], UTextBlock.prototype, "preEl", void 0);
|
|
93
|
+
UTextBlock = __decorate([customElement("u-text-block")], UTextBlock);
|
|
94
|
+
//#endregion
|
|
5
95
|
export { UTextBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UTextBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
@@ -67,5 +67,5 @@ const styles = css`
|
|
|
67
67
|
min-height: 1.5em;
|
|
68
68
|
}
|
|
69
69
|
`;
|
|
70
|
-
|
|
70
|
+
//#endregion
|
|
71
71
|
export { styles };
|
|
@@ -1,7 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
|
+
/**
|
|
4
|
+
* 추론 내용을 표시하는 블록입니다.
|
|
5
|
+
* 로딩 중일 때는 "Thinking..." 메시지를 표시하고, 내용 펼치기/접기 기능을 제공합니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UThinkBlock extends UElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
/** 컨텐츠가 로딩 중인지 여부 */
|
|
10
|
+
loading: boolean;
|
|
11
|
+
/** 컨텐츠가 접혀있는지 여부 */
|
|
12
|
+
collapsed: boolean;
|
|
13
|
+
/** 컨텐츠 업데이트 시 자동으로 스크롤할지 여부 */
|
|
14
|
+
autoScroll: boolean;
|
|
15
|
+
/** 추론 컨텐츠의 내용 */
|
|
16
|
+
value?: string;
|
|
17
|
+
bodyEl: HTMLDivElement;
|
|
18
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
19
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
20
|
+
/**
|
|
21
|
+
* 컨텐츠 스크롤을 맨 아래로 이동
|
|
22
|
+
* @returns 스크롤 작업이 시작되었는지 여부 (bodyEl이 존재할 때만 true)
|
|
23
|
+
*/
|
|
24
|
+
scrollToBottom(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 사용자의 스크롤 인터럽트 처리
|
|
27
|
+
* 휠이나 터치 입력 시 자동 스크롤 중지
|
|
28
|
+
*/
|
|
29
|
+
private handleUserInterrupt;
|
|
30
|
+
}
|
|
2
31
|
declare global {
|
|
3
32
|
interface HTMLElementTagNameMap {
|
|
4
33
|
"u-think-block": UThinkBlock;
|
|
5
34
|
}
|
|
6
35
|
}
|
|
7
|
-
export { UThinkBlock };
|
|
@@ -1,5 +1,87 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import "./UMarkedBlock.js";
|
|
4
|
+
import { styles } from "./UThinkBlock.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
7
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
9
|
+
//#region src/components/blocks/UThinkBlock.ts
|
|
10
|
+
var _ref;
|
|
11
|
+
var UThinkBlock = class UThinkBlock extends UElement {
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.loading = false;
|
|
15
|
+
this.collapsed = true;
|
|
16
|
+
this.autoScroll = false;
|
|
17
|
+
this.handleUserInterrupt = () => {
|
|
18
|
+
if (this.autoScroll) this.autoScroll = false;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.styles = [super.styles, styles];
|
|
23
|
+
}
|
|
24
|
+
updated(changedProperties) {
|
|
25
|
+
super.updated(changedProperties);
|
|
26
|
+
if (changedProperties.has("value") && this.autoScroll) this.scrollToBottom();
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return html`
|
|
30
|
+
<div class="header" part="header"
|
|
31
|
+
@click=${() => this.collapsed = !this.collapsed}>
|
|
32
|
+
<u-icon class="prefix-icon"
|
|
33
|
+
?loading=${this.loading}
|
|
34
|
+
lib="bootstrap"
|
|
35
|
+
name="lightbulb-fill"
|
|
36
|
+
></u-icon>
|
|
37
|
+
<span class="title">
|
|
38
|
+
${this.loading ? "Thinking..." : "Thought"}
|
|
39
|
+
</span>
|
|
40
|
+
<u-icon class="suffix-icon"
|
|
41
|
+
lib="internal"
|
|
42
|
+
name=${this.collapsed ? "plus-lg" : "dash-lg"}
|
|
43
|
+
></u-icon>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="body" part="body" scrollable
|
|
47
|
+
?hidden=${this.collapsed}
|
|
48
|
+
@wheel=${this.handleUserInterrupt}
|
|
49
|
+
@touchstart=${this.handleUserInterrupt}>
|
|
50
|
+
<u-marked-block
|
|
51
|
+
.value=${this.value}
|
|
52
|
+
></u-marked-block>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 컨텐츠 스크롤을 맨 아래로 이동
|
|
58
|
+
* @returns 스크롤 작업이 시작되었는지 여부 (bodyEl이 존재할 때만 true)
|
|
59
|
+
*/
|
|
60
|
+
scrollToBottom() {
|
|
61
|
+
if (!this.bodyEl) return false;
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
this.bodyEl.scrollTo({
|
|
64
|
+
top: this.bodyEl.scrollHeight,
|
|
65
|
+
behavior: "smooth"
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
__decorate([property({
|
|
72
|
+
type: Boolean,
|
|
73
|
+
reflect: true
|
|
74
|
+
}), __decorateMetadata("design:type", Boolean)], UThinkBlock.prototype, "loading", void 0);
|
|
75
|
+
__decorate([property({
|
|
76
|
+
type: Boolean,
|
|
77
|
+
reflect: true
|
|
78
|
+
}), __decorateMetadata("design:type", Boolean)], UThinkBlock.prototype, "collapsed", void 0);
|
|
79
|
+
__decorate([property({
|
|
80
|
+
type: Boolean,
|
|
81
|
+
attribute: "auto-scroll"
|
|
82
|
+
}), __decorateMetadata("design:type", Boolean)], UThinkBlock.prototype, "autoScroll", void 0);
|
|
83
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UThinkBlock.prototype, "value", void 0);
|
|
84
|
+
__decorate([query(".body"), __decorateMetadata("design:type", typeof (_ref = typeof HTMLDivElement !== "undefined" && HTMLDivElement) === "function" ? _ref : Object)], UThinkBlock.prototype, "bodyEl", void 0);
|
|
85
|
+
UThinkBlock = __decorate([customElement("u-think-block")], UThinkBlock);
|
|
86
|
+
//#endregion
|
|
5
87
|
export { UThinkBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UThinkBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
@@ -70,5 +70,5 @@ const styles = css`
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
`;
|
|
73
|
-
|
|
73
|
+
//#endregion
|
|
74
74
|
export { styles };
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
import { JsonNode } from '../../types/JsonNode.js';
|
|
3
|
+
/**
|
|
4
|
+
* 툴 사용 블록 컴포넌트입니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UToolBlock extends UElement {
|
|
7
|
+
static styles: import('lit').CSSResultGroup[];
|
|
8
|
+
/** 로딩 상태 */
|
|
9
|
+
loading: boolean;
|
|
10
|
+
/** 블록 접힘 여부 */
|
|
11
|
+
collapsed: boolean;
|
|
12
|
+
/** 헤딩 텍스트 */
|
|
13
|
+
title: string;
|
|
14
|
+
/** 입력 데이터 (JSON Object) */
|
|
15
|
+
input?: JsonNode;
|
|
16
|
+
/** 출력 데이터 (JSON Object) */
|
|
17
|
+
output?: JsonNode;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
2
20
|
declare global {
|
|
3
21
|
interface HTMLElementTagNameMap {
|
|
4
22
|
"u-tool-block": UToolBlock;
|
|
5
23
|
}
|
|
6
24
|
}
|
|
7
|
-
export { UToolBlock };
|
|
@@ -1,5 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import "./UJsonBlock.js";
|
|
4
|
+
import { styles } from "./UToolBlock.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { customElement, property } from "lit/decorators.js";
|
|
7
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
8
|
+
import "@iyulab/components/dist/components/spinner/USpinner.js";
|
|
9
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
10
|
+
import { jsonAttrConverter } from "@iyulab/components/dist/utilities/converters.js";
|
|
11
|
+
//#region src/components/blocks/UToolBlock.ts
|
|
12
|
+
var UToolBlock = class UToolBlock extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.loading = false;
|
|
16
|
+
this.collapsed = true;
|
|
17
|
+
this.title = "";
|
|
18
|
+
}
|
|
19
|
+
static {
|
|
20
|
+
this.styles = [super.styles, styles];
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return html`
|
|
24
|
+
<div class="header" @click=${() => this.collapsed = !this.collapsed}>
|
|
25
|
+
${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon lib="bootstrap" name="tools"></u-icon>`}
|
|
26
|
+
<div class="title">
|
|
27
|
+
${this.title || "Tool Usage"}
|
|
28
|
+
</div>
|
|
29
|
+
<u-icon
|
|
30
|
+
lib="internal"
|
|
31
|
+
name=${this.collapsed ? "plus-lg" : "dash-lg"}
|
|
32
|
+
></u-icon>
|
|
33
|
+
</div>
|
|
4
34
|
|
|
35
|
+
<div class="body" part="body" scrollable ?hidden=${this.collapsed}>
|
|
36
|
+
<div class="input-view" ?hidden=${!this.input}>
|
|
37
|
+
<u-json-block
|
|
38
|
+
.value=${this.input || {}}
|
|
39
|
+
></u-json-block>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="output-view" ?hidden=${!this.output}>
|
|
42
|
+
<u-icon lib="internal" name="chevron-down"></u-icon>
|
|
43
|
+
<u-json-block
|
|
44
|
+
.value=${this.output || {}}
|
|
45
|
+
></u-json-block>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([property({
|
|
52
|
+
type: Boolean,
|
|
53
|
+
reflect: true
|
|
54
|
+
}), __decorateMetadata("design:type", Boolean)], UToolBlock.prototype, "loading", void 0);
|
|
55
|
+
__decorate([property({
|
|
56
|
+
type: Boolean,
|
|
57
|
+
reflect: true
|
|
58
|
+
}), __decorateMetadata("design:type", Boolean)], UToolBlock.prototype, "collapsed", void 0);
|
|
59
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UToolBlock.prototype, "title", void 0);
|
|
60
|
+
__decorate([property({
|
|
61
|
+
type: Object,
|
|
62
|
+
converter: jsonAttrConverter()
|
|
63
|
+
}), __decorateMetadata("design:type", Object)], UToolBlock.prototype, "input", void 0);
|
|
64
|
+
__decorate([property({
|
|
65
|
+
type: Object,
|
|
66
|
+
converter: jsonAttrConverter()
|
|
67
|
+
}), __decorateMetadata("design:type", Object)], UToolBlock.prototype, "output", void 0);
|
|
68
|
+
UToolBlock = __decorate([customElement("u-tool-block")], UToolBlock);
|
|
69
|
+
//#endregion
|
|
5
70
|
export { UToolBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UToolBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
@@ -62,5 +62,5 @@ const styles = css`
|
|
|
62
62
|
flex-direction: column;
|
|
63
63
|
}
|
|
64
64
|
`;
|
|
65
|
-
|
|
65
|
+
//#endregion
|
|
66
66
|
export { styles };
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 파일 첨부 버튼 컴포넌트입니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UAttachButton extends UElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
/** 첨부 파일 유형 제한, 컴마로 구분된 MIME 타입 문자열 (예: "image/*,application/pdf") */
|
|
8
|
+
accept?: string;
|
|
9
|
+
/** 다중 파일 선택 가능 여부 */
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
input?: HTMLInputElement;
|
|
12
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
13
|
+
/**
|
|
14
|
+
* 버튼 클릭 핸들러
|
|
15
|
+
*/
|
|
16
|
+
private handleButtonClick;
|
|
17
|
+
/**
|
|
18
|
+
* 파일 선택 이벤트 핸들러
|
|
19
|
+
*/
|
|
20
|
+
private handleInputChange;
|
|
21
|
+
}
|
|
2
22
|
declare global {
|
|
3
23
|
interface HTMLElementTagNameMap {
|
|
4
24
|
"u-attach-button": UAttachButton;
|
|
5
25
|
}
|
|
6
26
|
}
|
|
7
|
-
export { UAttachButton };
|
|
@@ -1,5 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UAttachButton.
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
3
|
+
import { styles } from "./UAttachButton.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
7
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
8
|
+
import "@iyulab/components/dist/components/tooltip/UTooltip.js";
|
|
9
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
10
|
+
//#region src/components/buttons/UAttachButton.ts
|
|
11
|
+
var _ref;
|
|
12
|
+
var UAttachButton = class UAttachButton extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.multiple = false;
|
|
16
|
+
this.handleButtonClick = () => {
|
|
17
|
+
if (!this.input) return;
|
|
18
|
+
this.input.click();
|
|
19
|
+
};
|
|
20
|
+
this.handleInputChange = (e) => {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
const target = e.target;
|
|
24
|
+
const files = target.files;
|
|
25
|
+
if (!files || files.length === 0) return;
|
|
26
|
+
this.fire("attach", { detail: { files: Array.from(files) } });
|
|
27
|
+
target.value = "";
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.styles = [super.styles, styles];
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html`
|
|
35
|
+
<u-button part="base"
|
|
36
|
+
variant="ghost"
|
|
37
|
+
@click=${this.handleButtonClick}>
|
|
38
|
+
<u-icon part="icon"
|
|
39
|
+
lib="bootstrap"
|
|
40
|
+
name="paperclip"
|
|
41
|
+
></u-icon>
|
|
42
|
+
</u-button>
|
|
4
43
|
|
|
44
|
+
<u-tooltip for="u-button" placement="bottom" distance="8">
|
|
45
|
+
<slot></slot>
|
|
46
|
+
</u-tooltip>
|
|
47
|
+
|
|
48
|
+
<input
|
|
49
|
+
hidden
|
|
50
|
+
type="file"
|
|
51
|
+
?multiple=${this.multiple}
|
|
52
|
+
.accept=${this.accept || "*"}
|
|
53
|
+
@change=${this.handleInputChange}
|
|
54
|
+
/>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UAttachButton.prototype, "accept", void 0);
|
|
59
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UAttachButton.prototype, "multiple", void 0);
|
|
60
|
+
__decorate([query("input[type=\"file\"]"), __decorateMetadata("design:type", typeof (_ref = typeof HTMLInputElement !== "undefined" && HTMLInputElement) === "function" ? _ref : Object)], UAttachButton.prototype, "input", void 0);
|
|
61
|
+
UAttachButton = __decorate([customElement("u-attach-button")], UAttachButton);
|
|
62
|
+
//#endregion
|
|
5
63
|
export { UAttachButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/buttons/UAttachButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host(:empty) u-tooltip {
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
@@ -10,5 +10,5 @@ const styles = css`
|
|
|
10
10
|
font-size: 16px;
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
13
|
-
|
|
13
|
+
//#endregion
|
|
14
14
|
export { styles };
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 클릭 시 클립보드에 텍스트를 복사하는 버튼입니다. 복사 상태를 표시하기 위해 아이콘이 변경됩니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UCopyButton extends UElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
/** 클립보드 복사 후 재사용 대기 시간 (ms) */
|
|
8
|
+
delay: number;
|
|
9
|
+
/** 복사할 텍스트를 설정합니다. */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** 클립보드 복사 상태를 나타내는 플래그입니다. */
|
|
12
|
+
isCopied: boolean;
|
|
13
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
14
|
+
/**
|
|
15
|
+
* 클립보드에 텍스트를 복사하는 메서드입니다.
|
|
16
|
+
* 복사 후 재사용 대기 시간이 설정되어 있으면, 일정 시간 후에 복사 가능 상태로 되돌립니다.
|
|
17
|
+
*/
|
|
18
|
+
private copyToClipboard;
|
|
19
|
+
}
|
|
2
20
|
declare global {
|
|
3
21
|
interface HTMLElementTagNameMap {
|
|
4
22
|
"u-copy-button": UCopyButton;
|
|
5
23
|
}
|
|
6
24
|
}
|
|
7
|
-
export { UCopyButton };
|
|
@@ -1,5 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { styles } from "./UCopyButton.styles.js";
|
|
2
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorateMetadata.js";
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
6
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
7
|
+
import "@iyulab/components/dist/components/icon-button/UIconButton.js";
|
|
8
|
+
import "@iyulab/components/dist/components/button/UButton.js";
|
|
9
|
+
import "@iyulab/components/dist/components/tooltip/UTooltip.js";
|
|
10
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
11
|
+
//#region src/components/buttons/UCopyButton.ts
|
|
12
|
+
var UCopyButton = class UCopyButton extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.delay = 1e3;
|
|
16
|
+
this.isCopied = false;
|
|
17
|
+
this.copyToClipboard = async () => {
|
|
18
|
+
if (!this.value) return;
|
|
19
|
+
if (this.isCopied) return;
|
|
20
|
+
try {
|
|
21
|
+
await window.navigator.clipboard.writeText(this.value);
|
|
22
|
+
if (this.delay <= 0) return;
|
|
23
|
+
this.isCopied = true;
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
this.isCopied = false;
|
|
26
|
+
}, this.delay);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error("Failed to copy text to clipboard:", error);
|
|
29
|
+
this.isCopied = false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.styles = [super.styles, styles];
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return html`
|
|
38
|
+
<u-button part="base"
|
|
39
|
+
variant="ghost"
|
|
40
|
+
?disabled=${this.isCopied}
|
|
41
|
+
@click=${this.copyToClipboard}>
|
|
42
|
+
<u-icon part="icon"
|
|
43
|
+
lib="bootstrap"
|
|
44
|
+
name=${this.isCopied ? "check-lg" : "copy"}
|
|
45
|
+
></u-icon>
|
|
46
|
+
</u-button>
|
|
4
47
|
|
|
48
|
+
<u-tooltip for="u-button" placement="bottom" distance="8">
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</u-tooltip>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
__decorate([property({ type: Number }), __decorateMetadata("design:type", Number)], UCopyButton.prototype, "delay", void 0);
|
|
55
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCopyButton.prototype, "value", void 0);
|
|
56
|
+
__decorate([state(), __decorateMetadata("design:type", Boolean)], UCopyButton.prototype, "isCopied", void 0);
|
|
57
|
+
UCopyButton = __decorate([customElement("u-copy-button")], UCopyButton);
|
|
58
|
+
//#endregion
|
|
5
59
|
export { UCopyButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/buttons/UCopyButton.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host(:empty) u-tooltip {
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
@@ -14,5 +14,5 @@ const styles = css`
|
|
|
14
14
|
color: var(--u-green-500);
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
|
-
|
|
17
|
+
//#endregion
|
|
18
18
|
export { styles };
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/** 투표 상태 타입 */
|
|
3
|
+
export type VoteValue = 'none' | 'up' | 'down';
|
|
4
|
+
/**
|
|
5
|
+
* 투표 버튼 컴포넌트입니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UVoteButton extends UElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
/** 현재 투표 상태 */
|
|
10
|
+
value: VoteValue;
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
private handleUpButtonClick;
|
|
13
|
+
private handleDownButtonClick;
|
|
14
|
+
}
|
|
2
15
|
declare global {
|
|
3
16
|
interface HTMLElementTagNameMap {
|
|
4
17
|
'u-vote-button': UVoteButton;
|
|
5
18
|
}
|
|
6
19
|
}
|
|
7
|
-
export { UVoteButton };
|
|
8
|
-
export type { VoteValue } from './UVoteButton.component.js';
|