@iyulab/chat-components 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +146 -0
- 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 +10 -4
- package/dist/components/blocks/UFileBlock.d.ts +33 -0
- package/dist/components/blocks/UFileBlock.js +154 -0
- package/dist/components/blocks/UFileBlock.styles.js +128 -0
- 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 +52 -0
- package/dist/components/blocks/UTableBlock.js +198 -0
- package/dist/components/blocks/UTableBlock.styles.js +133 -0
- 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/intents/UQuestionIntent.d.ts +22 -0
- package/dist/components/intents/UQuestionIntent.js +41 -0
- package/dist/components/intents/UQuestionIntent.styles.js +43 -0
- package/dist/components/message/UMessage.d.ts +18 -2
- package/dist/components/message/UMessage.js +47 -2
- package/dist/components/message/UMessage.styles.js +42 -15
- package/dist/components/prompt/UPrompt.d.ts +32 -2
- package/dist/components/prompt/UPrompt.js +118 -2
- package/dist/components/prompt/UPrompt.styles.js +43 -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/views/UChartView.d.ts +39 -0
- package/dist/components/views/UChartView.js +167 -0
- package/dist/components/views/UChartView.styles.js +86 -0
- package/dist/components/views/UImagesView.d.ts +33 -0
- package/dist/components/views/UImagesView.js +144 -0
- package/dist/components/views/UImagesView.styles.d.ts +1 -0
- package/dist/components/views/UImagesView.styles.js +219 -0
- package/dist/components/views/UMapView.d.ts +24 -0
- package/dist/components/views/UMapView.js +45 -0
- package/dist/components/views/UMapView.styles.d.ts +1 -0
- package/dist/components/views/UMapView.styles.js +47 -0
- package/dist/components/views/UVideoView.d.ts +25 -0
- package/dist/components/views/UVideoView.js +81 -0
- package/dist/components/views/UVideoView.styles.d.ts +1 -0
- package/dist/components/views/UVideoView.styles.js +36 -0
- package/dist/components/views/UView.d.ts +46 -0
- package/dist/components/views/UView.js +113 -0
- package/dist/components/views/UView.styles.d.ts +1 -0
- package/dist/components/views/UView.styles.js +33 -0
- 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 +15 -6
- package/dist/index.js +28 -38
- 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 -1
- package/dist/types/Intents.d.ts +26 -0
- package/dist/types/Intents.js +30 -0
- package/dist/types/JsonSchema.d.ts +59 -0
- package/dist/types/Views.d.ts +34 -0
- 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 +34 -18
- package/dist/components/blocks/UCodeBlock.component.d.ts +0 -23
- package/dist/components/blocks/UCodeBlock.component.js +0 -76
- 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 -45
- package/dist/components/blocks/UMarkedBlock.component.js +0 -129
- package/dist/components/blocks/URefBlock.component.d.ts +0 -17
- package/dist/components/blocks/URefBlock.component.js +0 -74
- 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 -70
- 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/message/UMessage.component.d.ts +0 -19
- package/dist/components/message/UMessage.component.js +0 -90
- 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 -24
- package/dist/components/references/URefCard.component.js +0 -105
- package/dist/components/references/URefCardGroup.component.d.ts +0 -25
- 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/events/UCancelEvent.d.ts +0 -6
- package/dist/events/USubmitEvent.d.ts +0 -6
- package/dist/utilities/converters.d.ts +0 -9
- package/dist/utilities/converters.js +0 -19
- /package/dist/components/{buttons/UReportButton.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
- /package/dist/components/{buttons/URetryButton.styles.d.ts → blocks/UTableBlock.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UShareButton.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
- /package/dist/components/{loaders/UDotLoader.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UFileBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
|
+
:host {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
align-items: center;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
max-width: 200px;
|
|
11
|
+
gap: 10px;
|
|
12
|
+
padding: 8px 10px;
|
|
13
|
+
border: 1px solid var(--u-border-color);
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
background-color: var(--u-neutral-50);
|
|
16
|
+
overflow: visible;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: background-color 0.12s ease, border-color 0.12s ease;
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
}
|
|
21
|
+
:host(:hover) {
|
|
22
|
+
background-color: var(--u-neutral-100);
|
|
23
|
+
border-color: var(--u-border-color-strong);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
u-icon[name="file-earmark-x"] {
|
|
27
|
+
color: var(--u-red-600);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.thumbnail {
|
|
31
|
+
position: relative;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
width: 36px;
|
|
34
|
+
height: 36px;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
color: var(--u-icon-color);
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
border-radius: 6px;
|
|
41
|
+
background-color: var(--u-neutral-200);
|
|
42
|
+
transition: background 0.15s ease;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.info {
|
|
47
|
+
flex: 1;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.name {
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
color: var(--u-txt-color-strong);
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.meta {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 6px;
|
|
68
|
+
color: var(--u-txt-color-weak);
|
|
69
|
+
font-size: 10px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.type {
|
|
73
|
+
padding: 1px 5px;
|
|
74
|
+
border-radius: 4px;
|
|
75
|
+
background-color: var(--u-neutral-200);
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
letter-spacing: 0.04em;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.size {
|
|
82
|
+
font-variant-numeric: tabular-nums;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.download-btn {
|
|
86
|
+
position: absolute;
|
|
87
|
+
inset: 0;
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
color: var(--u-neutral-0);
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
border-radius: 6px;
|
|
93
|
+
background-color: color-mix(in srgb, var(--u-neutral-900) 70%, transparent);
|
|
94
|
+
opacity: 0;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
transition: opacity 0.15s ease;
|
|
97
|
+
}
|
|
98
|
+
.thumbnail:hover .download-btn {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
pointer-events: auto;
|
|
101
|
+
}
|
|
102
|
+
.download-btn:hover {
|
|
103
|
+
background-color: color-mix(in srgb, var(--u-neutral-900) 85%, transparent);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.remove-btn {
|
|
107
|
+
position: absolute;
|
|
108
|
+
z-index: 10;
|
|
109
|
+
top: -8px;
|
|
110
|
+
right: -8px;
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
font-size: 10px;
|
|
113
|
+
background-color: var(--u-neutral-600);
|
|
114
|
+
color: var(--u-neutral-0);
|
|
115
|
+
opacity: 0;
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
transition: opacity 0.12s ease, background-color 0.12s ease;
|
|
118
|
+
}
|
|
119
|
+
:host(:hover) .remove-btn {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
pointer-events: auto;
|
|
122
|
+
}
|
|
123
|
+
.remove-btn:hover {
|
|
124
|
+
background-color: var(--u-red-600);
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { styles };
|
|
@@ -1,7 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
|
+
import { JsonNode } from '../../types/JsonNode.js';
|
|
4
|
+
/**
|
|
5
|
+
* json 데이터를 트리 형태로 시각화하는 컴포넌트입니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class UJsonBlock extends UElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
/** 초기 확장 상태를 관리하는 속성입니다. */
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
/** JSON 데이터 (속성으로 전달 가능) */
|
|
12
|
+
value: JsonNode;
|
|
13
|
+
state: Record<string, boolean>;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
16
|
+
render(): TemplateResult<1>;
|
|
17
|
+
/**
|
|
18
|
+
* JsonNode를 렌더링합니다.
|
|
19
|
+
* @param value - JsonNode (JsonObject, JsonArray, 또는 JsonValue)
|
|
20
|
+
* @param parent - 부모 노드의 경로
|
|
21
|
+
*/
|
|
22
|
+
private renderNode;
|
|
23
|
+
/**
|
|
24
|
+
* JsonValue를 렌더링합니다.
|
|
25
|
+
* @param node - JsonValue (string, number, boolean, null 등)
|
|
26
|
+
*/
|
|
27
|
+
private renderValue;
|
|
28
|
+
/**
|
|
29
|
+
* JsonObject 또는 JsonArray를 렌더링합니다.
|
|
30
|
+
* @param node - JsonObject 또는 JsonArray
|
|
31
|
+
* @param depth - 현재 깊이
|
|
32
|
+
*/
|
|
33
|
+
private renderObject;
|
|
34
|
+
/**
|
|
35
|
+
* 노드의 미리보기를 렌더링합니다.
|
|
36
|
+
* @param node - JsonObject 또는 JsonArray
|
|
37
|
+
*/
|
|
38
|
+
private renderPreview;
|
|
39
|
+
/** JSON 데이터를 순회하며 각 경로의 확장 상태를 설정합니다. */
|
|
40
|
+
private setState;
|
|
41
|
+
private isValueType;
|
|
42
|
+
/** 노드 확장/축소 클릭 핸들러 */
|
|
43
|
+
private handlePropertyKeyClick;
|
|
44
|
+
}
|
|
2
45
|
declare global {
|
|
3
46
|
interface HTMLElementTagNameMap {
|
|
4
47
|
'u-json-block': UJsonBlock;
|
|
5
48
|
}
|
|
6
49
|
}
|
|
7
|
-
export { UJsonBlock };
|
|
@@ -1,5 +1,130 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UJsonBlock.
|
|
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 "./UJsonBlock.styles.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
6
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
7
|
+
import { map } from "lit/directives/map.js";
|
|
8
|
+
import { when } from "lit/directives/when.js";
|
|
9
|
+
import { jsonAttrConverter } from "@iyulab/components/dist/utilities/converters.js";
|
|
10
|
+
//#region src/components/blocks/UJsonBlock.ts
|
|
11
|
+
var _ref;
|
|
12
|
+
var UJsonBlock = class UJsonBlock extends UElement {
|
|
13
|
+
constructor(..._args) {
|
|
14
|
+
super(..._args);
|
|
15
|
+
this.expanded = true;
|
|
16
|
+
this.value = {};
|
|
17
|
+
this.state = {};
|
|
18
|
+
this.isValueType = (value) => {
|
|
19
|
+
return value !== Object(value);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.styles = [super.styles, styles];
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback();
|
|
27
|
+
this.setAttribute("tabindex", "0");
|
|
28
|
+
}
|
|
29
|
+
willUpdate(changedProperties) {
|
|
30
|
+
super.willUpdate(changedProperties);
|
|
31
|
+
if (changedProperties.has("value") || changedProperties.has("expanded")) this.state = this.setState(this.value);
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html`
|
|
35
|
+
<div part="base">
|
|
36
|
+
${this.renderNode(this.value)}
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* JsonNode를 렌더링합니다.
|
|
42
|
+
* @param value - JsonNode (JsonObject, JsonArray, 또는 JsonValue)
|
|
43
|
+
* @param parent - 부모 노드의 경로
|
|
44
|
+
*/
|
|
45
|
+
renderNode(value, parent = "") {
|
|
46
|
+
return this.isValueType(value) ? this.renderValue(value) : this.renderObject(value, parent);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* JsonValue를 렌더링합니다.
|
|
50
|
+
* @param node - JsonValue (string, number, boolean, null 등)
|
|
51
|
+
*/
|
|
52
|
+
renderValue(node) {
|
|
53
|
+
const type = node === null ? "null" : Array.isArray(node) ? "array" : typeof node === "object" ? "object" : typeof node;
|
|
54
|
+
return html`
|
|
55
|
+
<span part="${type}" class="${type}" role="treeitem">
|
|
56
|
+
${JSON.stringify(node)}
|
|
57
|
+
</span>
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* JsonObject 또는 JsonArray를 렌더링합니다.
|
|
62
|
+
* @param node - JsonObject 또는 JsonArray
|
|
63
|
+
* @param depth - 현재 깊이
|
|
64
|
+
*/
|
|
65
|
+
renderObject(node, parent) {
|
|
66
|
+
return html`
|
|
67
|
+
<ul part="object" role="group">
|
|
68
|
+
${map(Object.entries(node), ([key, value]) => {
|
|
69
|
+
const path = parent ? `${parent}.${key}` : key;
|
|
70
|
+
const isValue = this.isValueType(value);
|
|
71
|
+
const isExpanded = this.state[path] ?? this.expanded;
|
|
72
|
+
return html`
|
|
73
|
+
<li part="property" role="treeitem"
|
|
74
|
+
data-path="${path}"
|
|
75
|
+
aria-expanded="${isExpanded ? "true" : "false"}">
|
|
76
|
+
<span part="key"
|
|
77
|
+
class="key"
|
|
78
|
+
?collapsable="${!isValue}"
|
|
79
|
+
?collapsed="${!isValue && !isExpanded}"
|
|
80
|
+
@click=${!isValue ? () => this.handlePropertyKeyClick(path) : null}>
|
|
81
|
+
${key}:
|
|
82
|
+
${when(!isValue && !isExpanded, () => this.renderPreview(value))}
|
|
83
|
+
</span>
|
|
4
84
|
|
|
85
|
+
${when(isValue || isExpanded, () => this.renderNode(value, path))}
|
|
86
|
+
</li>`;
|
|
87
|
+
})}
|
|
88
|
+
</ul>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 노드의 미리보기를 렌더링합니다.
|
|
93
|
+
* @param node - JsonObject 또는 JsonArray
|
|
94
|
+
*/
|
|
95
|
+
renderPreview(node) {
|
|
96
|
+
return html`
|
|
97
|
+
<span part="preview" class="preview">
|
|
98
|
+
${Array.isArray(node) ? node.length === 0 ? "[ ]" : `[ ${node.length} items ]` : Object.keys(node).length === 0 ? "{ }" : `{ ${Object.keys(node).length} properties }`}
|
|
99
|
+
</span>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
/** JSON 데이터를 순회하며 각 경로의 확장 상태를 설정합니다. */
|
|
103
|
+
setState(value, parent = "") {
|
|
104
|
+
if (typeof value !== "object" || value === null) return {};
|
|
105
|
+
const state = {};
|
|
106
|
+
Object.entries(value).forEach(([key, item]) => {
|
|
107
|
+
const path = parent ? `${parent}.${key}` : key;
|
|
108
|
+
state[path] = this.expanded;
|
|
109
|
+
Object.assign(state, this.setState(item, path));
|
|
110
|
+
});
|
|
111
|
+
return state;
|
|
112
|
+
}
|
|
113
|
+
/** 노드 확장/축소 클릭 핸들러 */
|
|
114
|
+
handlePropertyKeyClick(path) {
|
|
115
|
+
const isExpanded = this.state[path] ?? false;
|
|
116
|
+
this.state = {
|
|
117
|
+
...this.state,
|
|
118
|
+
[path]: !isExpanded
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
__decorate([property({ type: Boolean }), __decorateMetadata("design:type", Boolean)], UJsonBlock.prototype, "expanded", void 0);
|
|
123
|
+
__decorate([property({
|
|
124
|
+
type: Object,
|
|
125
|
+
converter: jsonAttrConverter()
|
|
126
|
+
}), __decorateMetadata("design:type", Object)], UJsonBlock.prototype, "value", void 0);
|
|
127
|
+
__decorate([state(), __decorateMetadata("design:type", typeof (_ref = typeof Record !== "undefined" && Record) === "function" ? _ref : Object)], UJsonBlock.prototype, "state", void 0);
|
|
128
|
+
UJsonBlock = __decorate([customElement("u-json-block")], UJsonBlock);
|
|
129
|
+
//#endregion
|
|
5
130
|
export { UJsonBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UJsonBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--indent-size: 2em;
|
|
6
6
|
|
|
@@ -111,5 +111,5 @@ const styles = css`
|
|
|
111
111
|
bottom: 0.2em;
|
|
112
112
|
}
|
|
113
113
|
`;
|
|
114
|
-
|
|
114
|
+
//#endregion
|
|
115
115
|
export { styles };
|
|
@@ -1,7 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
3
|
+
import { ReferenceCitation } from '../../types/References.js';
|
|
4
|
+
/**
|
|
5
|
+
* 마크다운 컨텐츠를 렌더링하는 컴포넌트입니다.
|
|
6
|
+
*
|
|
7
|
+
* 주의:
|
|
8
|
+
* - refs로 삽입되는 커스텀 태그(u-ref-*)는 속성/내용을 모두 escape하여 XSS를 방지합니다.
|
|
9
|
+
* - 코드블록 내부는 HTML을 전부 텍스트로 취급(escape)하며, refs 태그는 통째 제거합니다.
|
|
10
|
+
* - 인덱스 기반 삽입(ref.endIndex)이 깨지지 않도록 "normalize(제로폭 제거)"를 insertRefs 전에 1회 수행합니다.
|
|
11
|
+
*/
|
|
12
|
+
export declare class UMarkedBlock extends UElement {
|
|
13
|
+
static styles: import('lit').CSSResultGroup[];
|
|
14
|
+
/** 마크다운 컨텐츠를 렌더링할 때 사용할 값입니다. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** 컨텐츠의 인용 출처들입니다. */
|
|
17
|
+
refs?: ReferenceCitation[];
|
|
18
|
+
private parser;
|
|
19
|
+
private placeholder;
|
|
20
|
+
private queued;
|
|
21
|
+
private timer?;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
protected shouldUpdate(_changedProperties: PropertyValues): boolean;
|
|
24
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
25
|
+
render(): import('lit-html/directive.js').DirectiveResult<typeof import('lit-html/directives/unsafe-html.js').UnsafeHTMLDirective>;
|
|
26
|
+
/**
|
|
27
|
+
* 코드블록은 별도의 컴포넌트로 렌더링 합니다.
|
|
28
|
+
*/
|
|
29
|
+
private renderCode;
|
|
30
|
+
/**
|
|
31
|
+
* 테이블은 JSON 데이터로 변환하여 별도의 컴포넌트로 렌더링합니다.
|
|
32
|
+
* 셀 내부의 인라인 마크다운(볼드, 코드, br 등)도 HTML로 변환합니다.
|
|
33
|
+
*/
|
|
34
|
+
private renderTable;
|
|
35
|
+
/**
|
|
36
|
+
* 인용/출처 참조객체가 있을때 ref 태그 HTML을 this.placeholder에 보관하고
|
|
37
|
+
* 마크다운 문자열의 해당 위치에 주석 플레이스홀더를 삽입합니다.
|
|
38
|
+
*/
|
|
39
|
+
private insertRefs;
|
|
40
|
+
/**
|
|
41
|
+
* 코드블록 내부의 <!--ref:idx--> 플레이스홀더와 그 외 refs 태그를 모두 제거하여 HTML이 코드로 렌더링되도록 합니다.
|
|
42
|
+
*/
|
|
43
|
+
private removeRefs;
|
|
44
|
+
}
|
|
2
45
|
declare global {
|
|
3
46
|
interface HTMLElementTagNameMap {
|
|
4
47
|
"u-marked-block": UMarkedBlock;
|
|
5
48
|
}
|
|
6
49
|
}
|
|
7
|
-
export { UMarkedBlock };
|
|
@@ -1,5 +1,155 @@
|
|
|
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 "./UCodeBlock.js";
|
|
4
|
+
import "../references/URefTag.js";
|
|
5
|
+
import { URefCard } from "../references/URefCard.js";
|
|
6
|
+
import "../references/URefCardGroup.js";
|
|
7
|
+
import { UTableBlock } from "./UTableBlock.js";
|
|
8
|
+
import { UView } from "../views/UView.js";
|
|
9
|
+
import { styles } from "./UMarkedBlock.styles.js";
|
|
10
|
+
import { nothing } from "lit";
|
|
11
|
+
import { customElement, property } from "lit/decorators.js";
|
|
12
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
14
|
+
import { Marked, Parser } from "marked";
|
|
15
|
+
import markedKatex from "marked-katex-extension";
|
|
16
|
+
import { escapeHtmlText, stripZeroWidth } from "@iyulab/components/dist/utilities/sanitizers.js";
|
|
17
|
+
import { buildElementHTML } from "@iyulab/components/dist/utilities/elements.js";
|
|
18
|
+
//#region src/components/blocks/UMarkedBlock.ts
|
|
19
|
+
var UMarkedBlock = class UMarkedBlock extends UElement {
|
|
20
|
+
constructor(..._args) {
|
|
21
|
+
super(..._args);
|
|
22
|
+
this.parser = new Marked({
|
|
23
|
+
pedantic: false,
|
|
24
|
+
gfm: true,
|
|
25
|
+
breaks: true,
|
|
26
|
+
silent: true,
|
|
27
|
+
renderer: {
|
|
28
|
+
code: (token) => this.renderCode(token),
|
|
29
|
+
table: (token) => this.renderTable(token)
|
|
30
|
+
}
|
|
31
|
+
}).use(markedKatex({ output: "mathml" }));
|
|
32
|
+
this.placeholder = new HtmlPlaceholder();
|
|
33
|
+
this.queued = false;
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
this.styles = [super.styles, styles];
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
clearTimeout(this.timer);
|
|
40
|
+
super.disconnectedCallback();
|
|
41
|
+
}
|
|
42
|
+
shouldUpdate(_changedProperties) {
|
|
43
|
+
if (this.queued) return false;
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
willUpdate(changedProperties) {
|
|
47
|
+
super.willUpdate(changedProperties);
|
|
48
|
+
if (changedProperties.has("value")) {
|
|
49
|
+
if (this.queued) return;
|
|
50
|
+
this.queued = true;
|
|
51
|
+
this.timer = window.setTimeout(() => {
|
|
52
|
+
this.queued = false;
|
|
53
|
+
this.requestUpdate();
|
|
54
|
+
}, 80);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
let value = this.value;
|
|
59
|
+
if (!value) return nothing;
|
|
60
|
+
this.placeholder.reset();
|
|
61
|
+
value = stripZeroWidth(value);
|
|
62
|
+
if (this.refs?.length) value = this.insertRefs(value, this.refs);
|
|
63
|
+
let html = this.parser.parse(value, { async: false });
|
|
64
|
+
return unsafeHTML(this.placeholder.restore(html));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 코드블록은 별도의 컴포넌트로 렌더링 합니다.
|
|
68
|
+
*/
|
|
69
|
+
renderCode(token) {
|
|
70
|
+
const lang = token.lang ?? "plaintext";
|
|
71
|
+
const trimmed = token.raw.trimEnd();
|
|
72
|
+
const isClosed = trimmed.endsWith("```") || trimmed.endsWith("~~~");
|
|
73
|
+
if (lang === "view-json") return UView.buildHTML(token.text, { loading: !isClosed });
|
|
74
|
+
if (lang === "intent-json") return "";
|
|
75
|
+
const safeText = this.removeRefs(token.text);
|
|
76
|
+
return buildElementHTML("u-code-block", {
|
|
77
|
+
lang,
|
|
78
|
+
loading: !isClosed
|
|
79
|
+
}, safeText);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 테이블은 JSON 데이터로 변환하여 별도의 컴포넌트로 렌더링합니다.
|
|
83
|
+
* 셀 내부의 인라인 마크다운(볼드, 코드, br 등)도 HTML로 변환합니다.
|
|
84
|
+
*/
|
|
85
|
+
renderTable(token) {
|
|
86
|
+
const headers = token.header.map((h) => ({
|
|
87
|
+
text: h.tokens ? Parser.parseInline(h.tokens) : h.text,
|
|
88
|
+
align: h.align
|
|
89
|
+
}));
|
|
90
|
+
const rows = token.rows.map((row) => row.map((cell) => ({
|
|
91
|
+
text: cell.tokens ? Parser.parseInline(cell.tokens) : cell.text,
|
|
92
|
+
align: cell.align
|
|
93
|
+
})));
|
|
94
|
+
return UTableBlock.buildHTML({
|
|
95
|
+
headers,
|
|
96
|
+
rows
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 인용/출처 참조객체가 있을때 ref 태그 HTML을 this.placeholder에 보관하고
|
|
101
|
+
* 마크다운 문자열의 해당 위치에 주석 플레이스홀더를 삽입합니다.
|
|
102
|
+
*/
|
|
103
|
+
insertRefs(value, refs) {
|
|
104
|
+
const sorted = [...refs].sort((a, b) => b.endIndex - a.endIndex);
|
|
105
|
+
for (const ref of sorted) {
|
|
106
|
+
const sources = ref.sources ?? [];
|
|
107
|
+
const label = escapeHtmlText(ref.label ?? `[${refs.indexOf(ref) + 1}]`);
|
|
108
|
+
const link = sources.at(0)?.url;
|
|
109
|
+
let tooltip = "";
|
|
110
|
+
if (sources.length > 0) tooltip = buildElementHTML("u-ref-card-group", { slot: "tooltip" }, sources.map((s) => URefCard.buildHTML(s)).join(""));
|
|
111
|
+
const html = buildElementHTML("u-ref-tag", { href: link }, label + tooltip);
|
|
112
|
+
const key = this.placeholder.store(html);
|
|
113
|
+
value = value.slice(0, ref.endIndex) + key + value.slice(ref.endIndex);
|
|
114
|
+
}
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 코드블록 내부의 <!--ref:idx--> 플레이스홀더와 그 외 refs 태그를 모두 제거하여 HTML이 코드로 렌더링되도록 합니다.
|
|
119
|
+
*/
|
|
120
|
+
removeRefs(value) {
|
|
121
|
+
value = value.replace(/<u-ref-tag\b[^>]*>[\s\S]*?<\/u-ref-tag>/gi, "");
|
|
122
|
+
value = value.replace(/<!--ref:\d+-->/g, "");
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UMarkedBlock.prototype, "value", void 0);
|
|
127
|
+
__decorate([property({ type: Array }), __decorateMetadata("design:type", Array)], UMarkedBlock.prototype, "refs", void 0);
|
|
128
|
+
UMarkedBlock = __decorate([customElement("u-marked-block")], UMarkedBlock);
|
|
129
|
+
/**
|
|
130
|
+
* Marked 파싱 중 HTML이 GFM에 의해 오염되는 것을 방지하기 위해
|
|
131
|
+
* HTML을 주석 플레이스홀더로 치환하고, 나중에 원래 HTML로 복원하는 유틸입니다.
|
|
132
|
+
*/
|
|
133
|
+
var HtmlPlaceholder = class {
|
|
134
|
+
constructor() {
|
|
135
|
+
this.map = {};
|
|
136
|
+
this.idx = 0;
|
|
137
|
+
}
|
|
138
|
+
reset() {
|
|
139
|
+
this.map = {};
|
|
140
|
+
this.idx = 0;
|
|
141
|
+
}
|
|
142
|
+
/** html을 저장하고 대응하는 플레이스홀더 키를 반환합니다. */
|
|
143
|
+
store(html) {
|
|
144
|
+
const key = `<!--ref:${this.idx++}-->`;
|
|
145
|
+
this.map[key] = html;
|
|
146
|
+
return key;
|
|
147
|
+
}
|
|
148
|
+
/** html 안의 등록된 모든 플레이스홀더를 원래 HTML로 복원합니다. */
|
|
149
|
+
restore(html) {
|
|
150
|
+
if (this.idx === 0) return html;
|
|
151
|
+
return html.replace(/<!--ref:\d+-->/g, (key) => this.map[key] ?? "");
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
//#endregion
|
|
5
155
|
export { UMarkedBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UMarkedBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
/* github-markdown styles */
|
|
5
5
|
:host {
|
|
6
6
|
--fontStack-monospace: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
|
|
@@ -575,5 +575,5 @@ const styles = css`
|
|
|
575
575
|
margin: 0 -1.6em .25em .2em;
|
|
576
576
|
}
|
|
577
577
|
`;
|
|
578
|
-
|
|
578
|
+
//#endregion
|
|
579
579
|
export { styles };
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
import { ReferenceSource } from '../../types/References.js';
|
|
3
|
+
/**
|
|
4
|
+
* 레퍼런스 정보를 블록 형태로 표시하는 컴포넌트입니다.
|
|
5
|
+
* 단일 또는 다중 레퍼런스 카드를 그리드 레이아웃으로 표시합니다.
|
|
6
|
+
*/
|
|
7
|
+
export declare class URefBlock extends UElement {
|
|
8
|
+
static styles: import('lit').CSSResultGroup[];
|
|
9
|
+
/** 접힘 상태 @default: true */
|
|
10
|
+
collapsed: boolean;
|
|
11
|
+
/** 블록 제목 */
|
|
12
|
+
title: string;
|
|
13
|
+
/** 출처 목록 */
|
|
14
|
+
sources?: ReferenceSource[];
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|
|
2
17
|
declare global {
|
|
3
18
|
interface HTMLElementTagNameMap {
|
|
4
19
|
"u-ref-block": URefBlock;
|
|
5
20
|
}
|
|
6
21
|
}
|
|
7
|
-
export { URefBlock };
|
|
@@ -1,5 +1,60 @@
|
|
|
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 "../references/URefCard.js";
|
|
4
|
+
import { styles } from "./URefBlock.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { customElement, property } from "lit/decorators.js";
|
|
7
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
8
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
9
|
+
//#region src/components/blocks/URefBlock.ts
|
|
10
|
+
var URefBlock = class URefBlock extends UElement {
|
|
11
|
+
constructor(..._args) {
|
|
12
|
+
super(..._args);
|
|
13
|
+
this.collapsed = true;
|
|
14
|
+
this.title = "";
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.styles = [super.styles, styles];
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return html`
|
|
21
|
+
<button class="header" @click=${() => this.collapsed = !this.collapsed}>
|
|
22
|
+
<u-icon
|
|
23
|
+
?collapsed=${this.collapsed}
|
|
24
|
+
lib="internal"
|
|
25
|
+
name="chevron-down"
|
|
26
|
+
></u-icon>
|
|
27
|
+
<div class="title">
|
|
28
|
+
${this.title || "References"}
|
|
29
|
+
</div>
|
|
30
|
+
<div style="flex: 1;"></div>
|
|
31
|
+
<div class="count">
|
|
32
|
+
${this.sources ? this.sources.length : 0}
|
|
33
|
+
</div>
|
|
34
|
+
</button>
|
|
4
35
|
|
|
36
|
+
<div class="body" ?collapsed=${this.collapsed}>
|
|
37
|
+
${repeat(this.sources || [], (_, idx) => idx, (source) => {
|
|
38
|
+
return html`
|
|
39
|
+
<u-ref-card
|
|
40
|
+
.type=${source.type}
|
|
41
|
+
.url=${source.url}
|
|
42
|
+
.title=${source.title || ""}
|
|
43
|
+
.snippet=${source.snippet || ""}
|
|
44
|
+
.tags=${source.tags}
|
|
45
|
+
></u-ref-card>
|
|
46
|
+
`;
|
|
47
|
+
})}
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
__decorate([property({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: true
|
|
55
|
+
}), __decorateMetadata("design:type", Boolean)], URefBlock.prototype, "collapsed", void 0);
|
|
56
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], URefBlock.prototype, "title", void 0);
|
|
57
|
+
__decorate([property({ type: Array }), __decorateMetadata("design:type", Array)], URefBlock.prototype, "sources", void 0);
|
|
58
|
+
URefBlock = __decorate([customElement("u-ref-block")], URefBlock);
|
|
59
|
+
//#endregion
|
|
5
60
|
export { URefBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/URefBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
@@ -71,5 +71,5 @@ const styles = css`
|
|
|
71
71
|
width: 100%;
|
|
72
72
|
}
|
|
73
73
|
`;
|
|
74
|
-
|
|
74
|
+
//#endregion
|
|
75
75
|
export { styles };
|