@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.
Files changed (108) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/assets/action-prompt.md.js +3 -0
  3. package/dist/assets/widget-prompt.md.js +3 -0
  4. package/dist/components/actions/UQuestionAction.component.d.ts +18 -0
  5. package/dist/components/actions/UQuestionAction.component.js +58 -0
  6. package/dist/components/actions/UQuestionAction.d.ts +7 -0
  7. package/dist/components/actions/UQuestionAction.js +5 -0
  8. package/dist/components/actions/UQuestionAction.styles.js +45 -0
  9. package/dist/components/blocks/UCodeBlock.component.d.ts +5 -3
  10. package/dist/components/blocks/UCodeBlock.component.js +14 -2
  11. package/dist/components/blocks/UCodeBlock.styles.js +6 -0
  12. package/dist/components/blocks/UFilesBlock.component.d.ts +22 -0
  13. package/dist/components/blocks/UFilesBlock.component.js +192 -0
  14. package/dist/components/blocks/UFilesBlock.d.ts +7 -0
  15. package/dist/components/blocks/UFilesBlock.js +5 -0
  16. package/dist/components/blocks/UFilesBlock.styles.d.ts +1 -0
  17. package/dist/components/blocks/UFilesBlock.styles.js +206 -0
  18. package/dist/components/blocks/UJsonBlock.component.d.ts +3 -3
  19. package/dist/components/blocks/UJsonBlock.component.js +2 -2
  20. package/dist/components/blocks/UMarkedBlock.component.d.ts +17 -22
  21. package/dist/components/blocks/UMarkedBlock.component.js +92 -62
  22. package/dist/components/blocks/URefBlock.component.d.ts +3 -3
  23. package/dist/components/blocks/URefBlock.component.js +6 -7
  24. package/dist/components/blocks/UTableBlock.component.d.ts +49 -0
  25. package/dist/components/blocks/UTableBlock.component.js +228 -0
  26. package/dist/components/blocks/UTableBlock.d.ts +7 -0
  27. package/dist/components/blocks/UTableBlock.js +5 -0
  28. package/dist/components/blocks/UTableBlock.styles.d.ts +1 -0
  29. package/dist/components/blocks/UTableBlock.styles.js +134 -0
  30. package/dist/components/blocks/UTextBlock.component.d.ts +3 -3
  31. package/dist/components/blocks/UTextBlock.component.js +2 -2
  32. package/dist/components/blocks/UThinkBlock.component.d.ts +3 -3
  33. package/dist/components/blocks/UThinkBlock.component.js +2 -2
  34. package/dist/components/blocks/UToolBlock.component.d.ts +3 -3
  35. package/dist/components/blocks/UToolBlock.component.js +2 -2
  36. package/dist/components/buttons/UAttachButton.component.d.ts +3 -3
  37. package/dist/components/buttons/UAttachButton.component.js +2 -2
  38. package/dist/components/buttons/UCopyButton.component.d.ts +3 -3
  39. package/dist/components/buttons/UCopyButton.component.js +2 -2
  40. package/dist/components/buttons/UReportButton.component.d.ts +3 -3
  41. package/dist/components/buttons/UReportButton.component.js +2 -2
  42. package/dist/components/buttons/URetryButton.component.d.ts +3 -3
  43. package/dist/components/buttons/URetryButton.component.js +2 -2
  44. package/dist/components/buttons/UShareButton.component.d.ts +3 -3
  45. package/dist/components/buttons/UShareButton.component.js +2 -2
  46. package/dist/components/buttons/UVoteButton.component.d.ts +3 -3
  47. package/dist/components/buttons/UVoteButton.component.js +7 -4
  48. package/dist/components/message/UMessage.component.d.ts +7 -7
  49. package/dist/components/message/UMessage.component.js +16 -50
  50. package/dist/components/message/UMessage.styles.js +38 -11
  51. package/dist/components/prompt/UPrompt.component.d.ts +3 -3
  52. package/dist/components/prompt/UPrompt.component.js +2 -2
  53. package/dist/components/prompt/UPrompt.styles.js +28 -0
  54. package/dist/components/references/URefCard.component.d.ts +9 -6
  55. package/dist/components/references/URefCard.component.js +14 -10
  56. package/dist/components/references/URefCardGroup.component.d.ts +4 -3
  57. package/dist/components/references/URefCardGroup.component.js +3 -3
  58. package/dist/components/references/URefTag.component.d.ts +3 -3
  59. package/dist/components/references/URefTag.component.js +2 -2
  60. package/dist/components/widgets/UChartWidget.component.d.ts +36 -0
  61. package/dist/components/widgets/UChartWidget.component.js +180 -0
  62. package/dist/components/widgets/UChartWidget.d.ts +7 -0
  63. package/dist/components/widgets/UChartWidget.js +5 -0
  64. package/dist/components/widgets/UChartWidget.styles.d.ts +1 -0
  65. package/dist/components/widgets/UChartWidget.styles.js +86 -0
  66. package/dist/components/widgets/UImagesWidget.component.d.ts +30 -0
  67. package/dist/components/widgets/UImagesWidget.component.js +164 -0
  68. package/dist/components/widgets/UImagesWidget.d.ts +7 -0
  69. package/dist/components/widgets/UImagesWidget.js +5 -0
  70. package/dist/components/widgets/UImagesWidget.styles.d.ts +1 -0
  71. package/dist/components/widgets/UImagesWidget.styles.js +218 -0
  72. package/dist/components/widgets/UMapWidget.component.d.ts +20 -0
  73. package/dist/components/widgets/UMapWidget.component.js +65 -0
  74. package/dist/components/widgets/UMapWidget.d.ts +7 -0
  75. package/dist/components/widgets/UMapWidget.js +5 -0
  76. package/dist/components/widgets/UMapWidget.styles.d.ts +1 -0
  77. package/dist/components/widgets/UMapWidget.styles.js +47 -0
  78. package/dist/components/widgets/UVideoWidget.component.d.ts +21 -0
  79. package/dist/components/widgets/UVideoWidget.component.js +106 -0
  80. package/dist/components/widgets/UVideoWidget.d.ts +7 -0
  81. package/dist/components/widgets/UVideoWidget.js +5 -0
  82. package/dist/components/widgets/UVideoWidget.styles.d.ts +1 -0
  83. package/dist/components/widgets/UVideoWidget.styles.js +36 -0
  84. package/dist/components/widgets/UWidget.component.d.ts +43 -0
  85. package/dist/components/widgets/UWidget.component.js +140 -0
  86. package/dist/components/widgets/UWidget.d.ts +7 -0
  87. package/dist/components/widgets/UWidget.js +5 -0
  88. package/dist/components/widgets/UWidget.styles.d.ts +1 -0
  89. package/dist/components/widgets/UWidget.styles.js +33 -0
  90. package/dist/index.d.ts +13 -1
  91. package/dist/index.js +20 -2
  92. package/dist/types/Actions.d.ts +24 -0
  93. package/dist/types/Actions.js +34 -0
  94. package/dist/types/BlockItem.d.ts +32 -1
  95. package/dist/types/JsonSchema.d.ts +59 -0
  96. package/dist/types/Widgets.d.ts +34 -0
  97. package/dist/types/Widgets.js +115 -0
  98. package/dist/utilities/ActionPromptBuilder.d.ts +40 -0
  99. package/dist/utilities/ActionPromptBuilder.js +93 -0
  100. package/dist/utilities/WidgetPromptBuilder.d.ts +28 -0
  101. package/dist/utilities/WidgetPromptBuilder.js +87 -0
  102. package/package.json +12 -12
  103. package/dist/components/loaders/UDotLoader.component.d.ts +0 -9
  104. package/dist/components/loaders/UDotLoader.component.js +0 -23
  105. package/dist/components/loaders/UDotLoader.d.ts +0 -7
  106. package/dist/components/loaders/UDotLoader.js +0 -5
  107. package/dist/components/loaders/UDotLoader.styles.js +0 -50
  108. /package/dist/components/{loaders/UDotLoader.styles.d.ts → actions/UQuestionAction.styles.d.ts} +0 -0
@@ -0,0 +1,218 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host {
5
+ display: block;
6
+ width: 100%;
7
+ margin: 0.75em 0;
8
+ }
9
+
10
+ .slide {
11
+ position: relative;
12
+ border-radius: 10px;
13
+ overflow: hidden;
14
+ cursor: pointer;
15
+ aspect-ratio: 4 / 3;
16
+ }
17
+ .slide img {
18
+ display: block;
19
+ width: 100%;
20
+ height: 100%;
21
+ object-fit: cover;
22
+ pointer-events: none;
23
+ transition: filter 0.2s ease;
24
+ }
25
+ .slide:hover img {
26
+ filter: brightness(0.92);
27
+ }
28
+
29
+ .caption {
30
+ position: absolute;
31
+ bottom: 0;
32
+ left: 0;
33
+ right: 0;
34
+ padding: 20px 10px 8px;
35
+ color: white;
36
+ font-size: 0.8em;
37
+ line-height: 1.3;
38
+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
39
+ }
40
+
41
+ /* ─── 라이트박스 UI ─── */
42
+
43
+ /* 루트 오버레이: flex column 전체 화면 */
44
+ .lb-overlay {
45
+ position: fixed;
46
+ inset: 0;
47
+ z-index: 9999;
48
+ display: flex;
49
+ flex-direction: column;
50
+ background: rgba(0, 0, 0, 0.92);
51
+ animation: overlay-fadeIn 0.2s ease;
52
+ }
53
+
54
+ /* 상단 헤더: 카운터(중앙) + 닫기(우측) */
55
+ .lb-header {
56
+ height: 56px;
57
+ position: relative;
58
+ flex-shrink: 0;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ }
63
+
64
+ .lb-counter {
65
+ color: rgba(255, 255, 255, 0.75);
66
+ font-size: 0.875em;
67
+ font-variant-numeric: tabular-nums;
68
+ background: rgba(0, 0, 0, 0.35);
69
+ padding: 3px 12px;
70
+ border-radius: 20px;
71
+ backdrop-filter: blur(4px);
72
+ }
73
+
74
+ .lb-close {
75
+ position: absolute;
76
+ right: 16px;
77
+ top: 50%;
78
+ transform: translateY(-50%);
79
+ width: 36px;
80
+ height: 36px;
81
+ border: none;
82
+ border-radius: 12px;
83
+ background: transparent;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ cursor: pointer;
88
+ transition: background 0.2s;
89
+ }
90
+ .lb-close:hover {
91
+ background: rgba(255, 255, 255, 0.18);
92
+ }
93
+ .lb-close:active {
94
+ background: rgba(255, 255, 255, 0.28);
95
+ }
96
+
97
+ .lb-close u-icon {
98
+ color: white;
99
+ font-size: 1.25em;
100
+ }
101
+
102
+ /* 중앙 본문: 뷰포트 + 이전/다음 버튼(absolute 오버레이) */
103
+ .lb-body {
104
+ position: relative;
105
+ flex: 1;
106
+ min-height: 0;
107
+ }
108
+
109
+ .lb-viewport {
110
+ position: relative;
111
+ width: 100%;
112
+ height: 100%;
113
+ overflow: hidden;
114
+ }
115
+
116
+ .lb-track {
117
+ position: absolute;
118
+ inset: 0;
119
+ display: flex;
120
+ flex-direction: row;
121
+ align-items: center;
122
+ gap: 16px;
123
+ transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
124
+ will-change: transform;
125
+ }
126
+
127
+ .lb-slide {
128
+ flex: 0 0 70vw;
129
+ height: 100%;
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ opacity: 0.5;
134
+ transform: scale(0.9);
135
+ transition: opacity 0.4s ease, transform 0.4s ease;
136
+ }
137
+ .lb-slide[active] {
138
+ opacity: 1;
139
+ transform: scale(1);
140
+ }
141
+ .lb-slide img {
142
+ max-width: 100%;
143
+ max-height: 100%;
144
+ object-fit: contain;
145
+ border-radius: 6px;
146
+ user-select: none;
147
+ pointer-events: none;
148
+ }
149
+
150
+ .lb-nav {
151
+ position: absolute;
152
+ top: 0;
153
+ bottom: 0;
154
+ z-index: 100;
155
+ width: 80px;
156
+ border: none;
157
+ background: transparent;
158
+ display: flex;
159
+ align-items: center;
160
+ justify-content: center;
161
+ cursor: pointer;
162
+ transition: background 0.25s;
163
+ }
164
+ .lb-nav.prev {
165
+ left: 0;
166
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.28), transparent);
167
+ }
168
+ .lb-nav.next {
169
+ right: 0;
170
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.28), transparent);
171
+ }
172
+ .lb-nav.prev:hover {
173
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
174
+ }
175
+ .lb-nav.next:hover {
176
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);
177
+ }
178
+
179
+ .lb-nav u-icon {
180
+ display: flex;
181
+ align-items: center;
182
+ justify-content: center;
183
+ color: white;
184
+ font-size: 1.5em;
185
+ padding: 12px;
186
+ border-radius: 50%;
187
+ background: rgba(255, 255, 255, 0.15);
188
+ transition: background 0.2s, transform 0.15s;
189
+ }
190
+ .lb-nav:hover u-icon {
191
+ background: rgba(255, 255, 255, 0.3);
192
+ transform: scale(1.1);
193
+ }
194
+
195
+ /* 하단 푸터: 캡션 */
196
+ .lb-footer {
197
+ position: relative;
198
+ flex-shrink: 0;
199
+ padding: 24px;
200
+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
201
+ }
202
+
203
+ .lb-caption {
204
+ margin: 0;
205
+ color: white;
206
+ font-size: 1.05em;
207
+ line-height: 1.5;
208
+ text-align: center;
209
+ text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
210
+ }
211
+
212
+ @keyframes overlay-fadeIn {
213
+ from { opacity: 0; }
214
+ to { opacity: 1; }
215
+ }
216
+ `;
217
+
218
+ export { styles };
@@ -0,0 +1,20 @@
1
+ import { nothing } from 'lit';
2
+ import { UElement } from '@iyulab/components/dist/components/UElement.js';
3
+ /**
4
+ * 지도 위젯 컴포넌트 (OpenStreetMap embed)
5
+ */
6
+ export declare class UMapWidget extends UElement {
7
+ static styles: import('lit').CSSResultGroup[];
8
+ static dependencies: Record<string, typeof UElement>;
9
+ /** 위도 (latitude) */
10
+ lat?: number;
11
+ /** 경도 (longitude) */
12
+ lng?: number;
13
+ /** 지도 확대 레벨 (zoom level, 기본값: 15) */
14
+ zoom: number;
15
+ /** 지도 마커 라벨 */
16
+ label?: string;
17
+ /** 지도 마커 설명 */
18
+ description?: string;
19
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
20
+ }
@@ -0,0 +1,65 @@
1
+ import { nothing, html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { UElement } from '@iyulab/components/dist/components/UElement.js';
4
+ import { styles } from './UMapWidget.styles.js';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = void 0 ;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (decorator(target, key, result) ) || result;
12
+ if (result) __defProp(target, key, result);
13
+ return result;
14
+ };
15
+ class UMapWidget extends UElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.zoom = 15;
19
+ }
20
+ static {
21
+ this.styles = [super.styles, styles];
22
+ }
23
+ static {
24
+ this.dependencies = {};
25
+ }
26
+ render() {
27
+ if (this.lat == null || this.lng == null) return nothing;
28
+ const offset = 360 / Math.pow(2, this.zoom);
29
+ const bbox = `${this.lng - offset},${this.lat - offset},${this.lng + offset},${this.lat + offset}`;
30
+ const embedUrl = `https://www.openstreetmap.org/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${this.lat},${this.lng}`;
31
+ const linkUrl = `https://www.openstreetmap.org/?mlat=${this.lat}&mlon=${this.lng}#map=${this.zoom}/${this.lat}/${this.lng}`;
32
+ return html`
33
+ <iframe
34
+ src="${embedUrl}"
35
+ loading="lazy"
36
+ ></iframe>
37
+ <a class="caption"
38
+ ?hidden=${!this.label && !this.description}
39
+ href="${linkUrl}"
40
+ target="_blank"
41
+ rel="noopener"
42
+ >
43
+ <strong>${this.label}</strong>
44
+ <span>${this.description}</span>
45
+ </a>
46
+ `;
47
+ }
48
+ }
49
+ __decorateClass([
50
+ property({ type: Number })
51
+ ], UMapWidget.prototype, "lat");
52
+ __decorateClass([
53
+ property({ type: Number })
54
+ ], UMapWidget.prototype, "lng");
55
+ __decorateClass([
56
+ property({ type: Number })
57
+ ], UMapWidget.prototype, "zoom");
58
+ __decorateClass([
59
+ property({ type: String })
60
+ ], UMapWidget.prototype, "label");
61
+ __decorateClass([
62
+ property({ type: String })
63
+ ], UMapWidget.prototype, "description");
64
+
65
+ export { UMapWidget };
@@ -0,0 +1,7 @@
1
+ import { UMapWidget } from './UMapWidget.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-map-widget": UMapWidget;
5
+ }
6
+ }
7
+ export { UMapWidget };
@@ -0,0 +1,5 @@
1
+ import { UMapWidget } from './UMapWidget.component.js';
2
+
3
+ UMapWidget.define("u-map-widget");
4
+
5
+ export { UMapWidget };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,47 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host {
5
+ position: relative;
6
+ display: block;
7
+ width: 100%;
8
+ border-radius: 8px;
9
+ overflow: hidden;
10
+ margin: 0.75em 0;
11
+ }
12
+
13
+ iframe {
14
+ width: 100%;
15
+ height: 300px;
16
+ display: block;
17
+ border: none;
18
+ }
19
+
20
+ .caption {
21
+ text-decoration: none;
22
+ max-width: 60%;
23
+ position: absolute;
24
+ top: 8px;
25
+ right: 8px;
26
+ display: flex;
27
+ flex-direction: column;
28
+ gap: 0.25em;
29
+ padding: 0.25em 0.5em;
30
+ color: #fff;
31
+ background: rgba(0, 0, 0, 0.6);
32
+ border-radius: 6px;
33
+ backdrop-filter: blur(4px);
34
+ }
35
+ .caption:hover {
36
+ background: rgba(0, 0, 0, 0.8);
37
+ }
38
+ .caption strong {
39
+ font-size: 0.8em;
40
+ }
41
+ .caption span {
42
+ font-size: 0.7em;
43
+ opacity: 0.8;
44
+ }
45
+ `;
46
+
47
+ export { styles };
@@ -0,0 +1,21 @@
1
+ import { nothing, PropertyValues } from 'lit';
2
+ import { UElement } from '@iyulab/components/dist/components/UElement.js';
3
+ /**
4
+ * 비디오 플레이어 위젯 컴포넌트
5
+ */
6
+ export declare class UVideoWidget extends UElement {
7
+ static styles: import('lit').CSSResultGroup[];
8
+ static dependencies: Record<string, typeof UElement>;
9
+ /** 비디오 URL (YouTube, Vimeo, 직접 파일) */
10
+ src?: string;
11
+ /** 포스터 이미지 URL */
12
+ poster?: string;
13
+ /** 비디오 비율 */
14
+ ratio: '16:9' | '4:3' | '1:1';
15
+ protected updated(changedProperties: PropertyValues): void;
16
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
17
+ private isYouTube;
18
+ private isVimeo;
19
+ private extractYouTubeId;
20
+ private extractVimeoId;
21
+ }
@@ -0,0 +1,106 @@
1
+ import { nothing, html } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
+ import { UElement } from '@iyulab/components/dist/components/UElement.js';
5
+ import { styles } from './UVideoWidget.styles.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = void 0 ;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (decorator(target, key, result) ) || result;
13
+ if (result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ class UVideoWidget extends UElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.ratio = "16:9";
20
+ }
21
+ static {
22
+ this.styles = [super.styles, styles];
23
+ }
24
+ static {
25
+ this.dependencies = {};
26
+ }
27
+ updated(changedProperties) {
28
+ super.updated(changedProperties);
29
+ if (changedProperties.has("ratio")) {
30
+ this.style.setProperty("--video-ratio", this.ratio.replace(":", " / "));
31
+ }
32
+ }
33
+ render() {
34
+ if (!this.src) return nothing;
35
+ if (this.isYouTube(this.src)) {
36
+ const videoId = this.extractYouTubeId(this.src);
37
+ if (videoId) {
38
+ return html`
39
+ <div class="video-wrapper">
40
+ <iframe
41
+ src="https://www.youtube.com/embed/${videoId}"
42
+ loading="lazy"
43
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
44
+ allowfullscreen
45
+ ></iframe>
46
+ </div>
47
+ `;
48
+ }
49
+ }
50
+ if (this.isVimeo(this.src)) {
51
+ const videoId = this.extractVimeoId(this.src);
52
+ if (videoId) {
53
+ return html`
54
+ <div class="video-wrapper">
55
+ <iframe
56
+ src="https://player.vimeo.com/video/${videoId}"
57
+ loading="lazy"
58
+ allow="autoplay; fullscreen; picture-in-picture"
59
+ allowfullscreen
60
+ ></iframe>
61
+ </div>
62
+ `;
63
+ }
64
+ }
65
+ return html`
66
+ <video
67
+ src=${this.src}
68
+ poster=${ifDefined(this.poster)}
69
+ controls
70
+ playsinline
71
+ ></video>
72
+ `;
73
+ }
74
+ isYouTube(url) {
75
+ return /youtube\.com|youtu\.be/i.test(url);
76
+ }
77
+ isVimeo(url) {
78
+ return /vimeo\.com/i.test(url);
79
+ }
80
+ extractYouTubeId(url) {
81
+ const patterns = [
82
+ /(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\s]+)/,
83
+ /youtube\.com\/embed\/([^&\s]+)/
84
+ ];
85
+ for (const pattern of patterns) {
86
+ const match = url.match(pattern);
87
+ if (match && match[1]) return match[1];
88
+ }
89
+ return null;
90
+ }
91
+ extractVimeoId(url) {
92
+ const match = url.match(/vimeo\.com\/(\d+)/);
93
+ return match ? match[1] : null;
94
+ }
95
+ }
96
+ __decorateClass([
97
+ property({ type: String })
98
+ ], UVideoWidget.prototype, "src");
99
+ __decorateClass([
100
+ property({ type: String })
101
+ ], UVideoWidget.prototype, "poster");
102
+ __decorateClass([
103
+ property({ type: String })
104
+ ], UVideoWidget.prototype, "ratio");
105
+
106
+ export { UVideoWidget };
@@ -0,0 +1,7 @@
1
+ import { UVideoWidget } from './UVideoWidget.component.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ "u-video-widget": UVideoWidget;
5
+ }
6
+ }
7
+ export { UVideoWidget };
@@ -0,0 +1,5 @@
1
+ import { UVideoWidget } from './UVideoWidget.component.js';
2
+
3
+ UVideoWidget.define("u-video-widget");
4
+
5
+ export { UVideoWidget };
@@ -0,0 +1 @@
1
+ export declare const styles: import('lit').CSSResult;
@@ -0,0 +1,36 @@
1
+ import { css } from 'lit';
2
+
3
+ const styles = css`
4
+ :host {
5
+ --video-ratio: 16 / 9;
6
+ }
7
+
8
+ :host {
9
+ display: block;
10
+ position: relative;
11
+ width: 100%;
12
+ max-width: 800px;
13
+ margin: 0.75em auto;
14
+ }
15
+
16
+ video {
17
+ width: 100%;
18
+ aspect-ratio: var(--video-ratio);
19
+ border-radius: 8px;
20
+ background: #000;
21
+ }
22
+
23
+ .video-wrapper {
24
+ width: 100%;
25
+ aspect-ratio: var(--video-ratio);
26
+ }
27
+
28
+ .video-wrapper iframe {
29
+ width: 100%;
30
+ height: 100%;
31
+ border: none;
32
+ border-radius: 8px;
33
+ }
34
+ `;
35
+
36
+ export { styles };
@@ -0,0 +1,43 @@
1
+ import { nothing, PropertyValues } from 'lit';
2
+ import { UElement } from '@iyulab/components/dist/components/UElement.js';
3
+ import { UJsonElement } from '@iyulab/components/dist/components/UJsonElement.js';
4
+ /**
5
+ * 위젯 파싱/렌더링 오류를 표시하는 컴포넌트입니다.
6
+ */
7
+ export declare class UWidget extends UJsonElement {
8
+ static styles: (import('lit').CSSResult | import('lit').CSSResultGroup[])[];
9
+ static dependencies: Record<string, typeof UElement>;
10
+ /** 로딩 상태입니다. `true`인 경우, 위젯이 로딩 중임을 나타냅니다. */
11
+ loading: boolean;
12
+ /** `tag` 프로퍼티에 등록된 커스텀 엘리먼트를 렌더링하는 컴포넌트입니다. */
13
+ tag?: string;
14
+ /** `properties` 객체의 키가 렌더링된 엘리먼트의 프로퍼티 이름과 일치하면 자동으로 할당됩니다. */
15
+ properties?: Record<string, unknown>;
16
+ /** `properties` 객체에서 위험한 프로퍼티 이름을 지정하여 차단할 수 있습니다. */
17
+ blacklist: string[];
18
+ /** 실제 렌더링된 엘리먼트입니다. `tag` 프로퍼티가 변경될 때마다 업데이트됩니다. */
19
+ private element;
20
+ protected willUpdate(changedProperties: PropertyValues): void;
21
+ render(): HTMLElement | import('lit-html').TemplateResult<1> | typeof nothing;
22
+ /**
23
+ * `loading`이 `true`인 경우, 에러 UI로 대체하지 않습니다.
24
+ */
25
+ protected error(error: Error): Promise<void>;
26
+ /**
27
+ * `tag` 프로퍼티에 등록된 커스텀 엘리먼트를 렌더링하는 컴포넌트입니다.
28
+ * `tag`가 변경될 때마다 등록된 커스텀 엘리먼트를 새로 생성하여 렌더링합니다.
29
+ * `tag`가 유효하지 않거나 등록된 커스텀 엘리먼트가 아닌 경우, 에러 처리합니다.
30
+ */
31
+ private updateElement;
32
+ /**
33
+ * `properties` 객체의 키가 렌더링된 엘리먼트의 프로퍼티 이름과 일치하면 자동으로 할당됩니다.
34
+ * `properties` 객체에 위험한 프로퍼티가 포함되어 있는지 검증하여, 유효한 경우에만 할당합니다.
35
+ * 할당 중 오류가 발생한 경우, 에러 처리합니다.
36
+ */
37
+ private updateProperties;
38
+ /**
39
+ * `properties` 객체에 위험한 프로퍼티가 포함되어 있는지 검증합니다.
40
+ * DOM 조작이나 이벤트 핸들러로 악용될 수 있는 프로퍼티를 최소한으로 차단합니다.
41
+ */
42
+ private validateProperties;
43
+ }