@iyulab/chat-components 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -52
- package/README.md +133 -16
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorateMetadata.js +6 -0
- package/dist/_virtual/_glob-assets_raw/intent-prompt.md.1907474e.js +4 -0
- package/dist/_virtual/_glob-assets_raw/view-prompt.md.e0dbcffe.js +4 -0
- package/dist/components/blocks/UCodeBlock.d.ts +24 -2
- package/dist/components/blocks/UCodeBlock.js +65 -2
- package/dist/components/blocks/UCodeBlock.styles.js +4 -4
- package/dist/components/blocks/UFileBlock.d.ts +33 -0
- package/dist/components/blocks/UFileBlock.js +154 -0
- package/dist/components/blocks/{UFilesBlock.styles.js → UFileBlock.styles.js} +12 -90
- package/dist/components/blocks/UJsonBlock.d.ts +44 -2
- package/dist/components/blocks/UJsonBlock.js +128 -3
- package/dist/components/blocks/UJsonBlock.styles.js +4 -4
- package/dist/components/blocks/UMarkedBlock.d.ts +44 -2
- package/dist/components/blocks/UMarkedBlock.js +154 -4
- package/dist/components/blocks/UMarkedBlock.styles.js +4 -4
- package/dist/components/blocks/URefBlock.d.ts +16 -2
- package/dist/components/blocks/URefBlock.js +58 -3
- package/dist/components/blocks/URefBlock.styles.js +4 -4
- package/dist/components/blocks/UTableBlock.d.ts +47 -2
- package/dist/components/blocks/UTableBlock.js +197 -4
- package/dist/components/blocks/UTableBlock.styles.js +4 -5
- package/dist/components/blocks/UTextBlock.d.ts +36 -2
- package/dist/components/blocks/UTextBlock.js +94 -4
- package/dist/components/blocks/UTextBlock.styles.js +4 -4
- package/dist/components/blocks/UThinkBlock.d.ts +30 -2
- package/dist/components/blocks/UThinkBlock.js +86 -4
- package/dist/components/blocks/UThinkBlock.styles.js +4 -4
- package/dist/components/blocks/UToolBlock.d.ts +19 -2
- package/dist/components/blocks/UToolBlock.js +68 -3
- package/dist/components/blocks/UToolBlock.styles.js +4 -4
- package/dist/components/buttons/UAttachButton.d.ts +21 -2
- package/dist/components/buttons/UAttachButton.js +61 -3
- package/dist/components/buttons/UAttachButton.styles.js +4 -4
- package/dist/components/buttons/UCopyButton.d.ts +19 -2
- package/dist/components/buttons/UCopyButton.js +57 -3
- package/dist/components/buttons/UCopyButton.styles.js +4 -4
- package/dist/components/buttons/UVoteButton.d.ts +14 -3
- package/dist/components/buttons/UVoteButton.js +62 -3
- package/dist/components/buttons/UVoteButton.styles.js +4 -4
- package/dist/components/{actions/UQuestionAction.component.d.ts → intents/UQuestionIntent.d.ts} +6 -2
- package/dist/components/intents/UQuestionIntent.js +41 -0
- package/dist/components/{actions/UQuestionAction.styles.js → intents/UQuestionIntent.styles.js} +4 -6
- package/dist/components/message/UMessage.d.ts +18 -2
- package/dist/components/message/UMessage.js +47 -2
- package/dist/components/message/UMessage.styles.js +4 -4
- package/dist/components/prompt/UPrompt.d.ts +37 -2
- package/dist/components/prompt/UPrompt.js +139 -2
- package/dist/components/prompt/UPrompt.styles.js +15 -5
- package/dist/components/references/URefCard.d.ts +30 -2
- package/dist/components/references/URefCard.js +97 -2
- package/dist/components/references/URefCard.styles.js +4 -4
- package/dist/components/references/URefCardGroup.d.ts +25 -2
- package/dist/components/references/URefCardGroup.js +69 -4
- package/dist/components/references/URefCardGroup.styles.js +4 -4
- package/dist/components/references/URefTag.d.ts +12 -2
- package/dist/components/references/URefTag.js +37 -2
- package/dist/components/references/URefTag.styles.js +4 -4
- package/dist/components/{widgets/UChartWidget.component.d.ts → views/UChartView.d.ts} +7 -4
- package/dist/components/views/UChartView.js +167 -0
- package/dist/components/{widgets/UChartWidget.styles.js → views/UChartView.styles.js} +4 -4
- package/dist/components/{widgets/UImagesWidget.component.d.ts → views/UImagesView.d.ts} +7 -4
- package/dist/components/views/UImagesView.js +144 -0
- package/dist/components/{widgets/UImagesWidget.styles.js → views/UImagesView.styles.js} +6 -5
- package/dist/components/{widgets/UMapWidget.component.d.ts → views/UMapView.d.ts} +7 -3
- package/dist/components/views/UMapView.js +45 -0
- package/dist/components/{widgets/UMapWidget.styles.js → views/UMapView.styles.js} +4 -4
- package/dist/components/{widgets/UVideoWidget.component.d.ts → views/UVideoView.d.ts} +7 -3
- package/dist/components/views/UVideoView.js +81 -0
- package/dist/components/{widgets/UVideoWidget.styles.js → views/UVideoView.styles.js} +4 -4
- package/dist/components/{widgets/UWidget.component.d.ts → views/UView.d.ts} +8 -5
- package/dist/components/views/UView.js +113 -0
- package/dist/components/{widgets/UWidget.styles.js → views/UView.styles.js} +4 -4
- package/dist/events/AttachEvent.d.ts +9 -0
- package/dist/events/ChoiceEvent.d.ts +9 -0
- package/dist/events/SendEvent.d.ts +21 -0
- package/dist/events/StopEvent.d.ts +17 -0
- package/dist/index.d.ts +13 -16
- package/dist/index.js +28 -56
- package/dist/react/UAttachButton.d.ts +11 -0
- package/dist/react/UAttachButton.js +12 -0
- package/dist/react/UChartView.d.ts +9 -0
- package/dist/react/UChartView.js +10 -0
- package/dist/react/UCodeBlock.d.ts +9 -0
- package/dist/react/UCodeBlock.js +10 -0
- package/dist/react/UCopyButton.d.ts +9 -0
- package/dist/react/UCopyButton.js +10 -0
- package/dist/react/UFileBlock.d.ts +11 -0
- package/dist/react/UFileBlock.js +12 -0
- package/dist/react/UImagesView.d.ts +9 -0
- package/dist/react/UImagesView.js +10 -0
- package/dist/react/UJsonBlock.d.ts +9 -0
- package/dist/react/UJsonBlock.js +10 -0
- package/dist/react/UMapView.d.ts +9 -0
- package/dist/react/UMapView.js +10 -0
- package/dist/react/UMarkedBlock.d.ts +9 -0
- package/dist/react/UMarkedBlock.js +10 -0
- package/dist/react/UMessage.d.ts +9 -0
- package/dist/react/UMessage.js +10 -0
- package/dist/react/UPrompt.d.ts +13 -0
- package/dist/react/UPrompt.js +13 -0
- package/dist/react/UQuestionIntent.d.ts +11 -0
- package/dist/react/UQuestionIntent.js +12 -0
- package/dist/react/URefBlock.d.ts +9 -0
- package/dist/react/URefBlock.js +10 -0
- package/dist/react/URefCard.d.ts +9 -0
- package/dist/react/URefCard.js +10 -0
- package/dist/react/URefCardGroup.d.ts +9 -0
- package/dist/react/URefCardGroup.js +10 -0
- package/dist/react/URefTag.d.ts +9 -0
- package/dist/react/URefTag.js +10 -0
- package/dist/react/UTableBlock.d.ts +9 -0
- package/dist/react/UTableBlock.js +10 -0
- package/dist/react/UTextBlock.d.ts +9 -0
- package/dist/react/UTextBlock.js +10 -0
- package/dist/react/UThinkBlock.d.ts +9 -0
- package/dist/react/UThinkBlock.js +10 -0
- package/dist/react/UToolBlock.d.ts +9 -0
- package/dist/react/UToolBlock.js +10 -0
- package/dist/react/UVideoView.d.ts +9 -0
- package/dist/react/UVideoView.js +10 -0
- package/dist/react/UView.d.ts +9 -0
- package/dist/react/UView.js +10 -0
- package/dist/react/UVoteButton.d.ts +9 -0
- package/dist/react/UVoteButton.js +10 -0
- package/dist/react/index.d.ts +23 -0
- package/dist/react/index.js +23 -0
- package/dist/types/BlockItem.d.ts +21 -32
- package/dist/types/Intents.d.ts +26 -0
- package/dist/types/Intents.js +30 -0
- package/dist/types/{Widgets.d.ts → Views.d.ts} +8 -8
- package/dist/types/Views.js +150 -0
- package/dist/utilities/IntentPromptBuilder.d.ts +40 -0
- package/dist/utilities/IntentPromptBuilder.js +95 -0
- package/dist/utilities/ViewPromptBuilder.d.ts +28 -0
- package/dist/utilities/ViewPromptBuilder.js +76 -0
- package/dist/utilities/dom-agent/DOMAgent.d.ts +74 -0
- package/dist/utilities/dom-agent/DOMController.d.ts +78 -0
- package/dist/utilities/dom-agent/DOMPromptBuilder.d.ts +54 -0
- package/dist/utilities/dom-agent/DOMScanner.d.ts +83 -0
- package/dist/utilities/dom-agent/index.d.ts +9 -0
- package/dist/utilities/dom-agent/types.d.ts +209 -0
- package/package.json +33 -16
- package/skills/iyulab-chat-components/SKILL.md +107 -0
- package/skills/iyulab-chat-components/references/components/attach-button.md +69 -0
- package/skills/iyulab-chat-components/references/components/chart-view.md +65 -0
- package/skills/iyulab-chat-components/references/components/code-block.md +42 -0
- package/skills/iyulab-chat-components/references/components/copy-button.md +46 -0
- package/skills/iyulab-chat-components/references/components/file-block.md +64 -0
- package/skills/iyulab-chat-components/references/components/images-view.md +63 -0
- package/skills/iyulab-chat-components/references/components/json-block.md +41 -0
- package/skills/iyulab-chat-components/references/components/map-view.md +54 -0
- package/skills/iyulab-chat-components/references/components/marked-block.md +53 -0
- package/skills/iyulab-chat-components/references/components/message.md +60 -0
- package/skills/iyulab-chat-components/references/components/prompt.md +102 -0
- package/skills/iyulab-chat-components/references/components/question-intent.md +75 -0
- package/skills/iyulab-chat-components/references/components/ref-block.md +45 -0
- package/skills/iyulab-chat-components/references/components/ref-card-group.md +41 -0
- package/skills/iyulab-chat-components/references/components/ref-card.md +48 -0
- package/skills/iyulab-chat-components/references/components/ref-tag.md +40 -0
- package/skills/iyulab-chat-components/references/components/table-block.md +63 -0
- package/skills/iyulab-chat-components/references/components/text-block.md +59 -0
- package/skills/iyulab-chat-components/references/components/think-block.md +48 -0
- package/skills/iyulab-chat-components/references/components/tool-block.md +57 -0
- package/skills/iyulab-chat-components/references/components/video-view.md +55 -0
- package/skills/iyulab-chat-components/references/components/view.md +51 -0
- package/skills/iyulab-chat-components/references/components/vote-button.md +60 -0
- package/skills/iyulab-chat-components/references/types.md +115 -0
- package/skills/iyulab-chat-components/references/usage.md +254 -0
- package/skills/iyulab-chat-components/references/utilities/intent-prompt-builder.md +123 -0
- package/skills/iyulab-chat-components/references/utilities/view-prompt-builder.md +112 -0
- package/dist/assets/action-prompt.md.js +0 -3
- package/dist/assets/widget-prompt.md.js +0 -3
- package/dist/components/actions/UQuestionAction.component.js +0 -58
- package/dist/components/actions/UQuestionAction.d.ts +0 -7
- package/dist/components/actions/UQuestionAction.js +0 -5
- package/dist/components/blocks/UCodeBlock.component.d.ts +0 -25
- package/dist/components/blocks/UCodeBlock.component.js +0 -88
- package/dist/components/blocks/UFilesBlock.component.d.ts +0 -22
- package/dist/components/blocks/UFilesBlock.component.js +0 -192
- package/dist/components/blocks/UFilesBlock.d.ts +0 -7
- package/dist/components/blocks/UFilesBlock.js +0 -5
- package/dist/components/blocks/UJsonBlock.component.d.ts +0 -45
- package/dist/components/blocks/UJsonBlock.component.js +0 -140
- package/dist/components/blocks/UMarkedBlock.component.d.ts +0 -40
- package/dist/components/blocks/UMarkedBlock.component.js +0 -159
- package/dist/components/blocks/URefBlock.component.d.ts +0 -17
- package/dist/components/blocks/URefBlock.component.js +0 -73
- package/dist/components/blocks/UTableBlock.component.d.ts +0 -49
- package/dist/components/blocks/UTableBlock.component.js +0 -228
- package/dist/components/blocks/UTextBlock.component.d.ts +0 -37
- package/dist/components/blocks/UTextBlock.component.js +0 -123
- package/dist/components/blocks/UThinkBlock.component.d.ts +0 -23
- package/dist/components/blocks/UThinkBlock.component.js +0 -90
- package/dist/components/blocks/UToolBlock.component.d.ts +0 -20
- package/dist/components/blocks/UToolBlock.component.js +0 -80
- package/dist/components/buttons/UAttachButton.component.d.ts +0 -22
- package/dist/components/buttons/UAttachButton.component.js +0 -89
- package/dist/components/buttons/UCopyButton.component.d.ts +0 -20
- package/dist/components/buttons/UCopyButton.component.js +0 -81
- package/dist/components/buttons/UReportButton.component.d.ts +0 -9
- package/dist/components/buttons/UReportButton.component.js +0 -36
- package/dist/components/buttons/UReportButton.d.ts +0 -7
- package/dist/components/buttons/UReportButton.js +0 -5
- package/dist/components/buttons/UReportButton.styles.js +0 -14
- package/dist/components/buttons/URetryButton.component.d.ts +0 -11
- package/dist/components/buttons/URetryButton.component.js +0 -53
- package/dist/components/buttons/URetryButton.d.ts +0 -7
- package/dist/components/buttons/URetryButton.js +0 -5
- package/dist/components/buttons/URetryButton.styles.js +0 -26
- package/dist/components/buttons/UShareButton.component.d.ts +0 -9
- package/dist/components/buttons/UShareButton.component.js +0 -36
- package/dist/components/buttons/UShareButton.d.ts +0 -7
- package/dist/components/buttons/UShareButton.js +0 -5
- package/dist/components/buttons/UShareButton.styles.js +0 -14
- package/dist/components/buttons/UVoteButton.component.d.ts +0 -15
- package/dist/components/buttons/UVoteButton.component.js +0 -73
- package/dist/components/message/UMessage.component.d.ts +0 -19
- package/dist/components/message/UMessage.component.js +0 -56
- package/dist/components/prompt/UPrompt.component.d.ts +0 -25
- package/dist/components/prompt/UPrompt.component.js +0 -113
- package/dist/components/references/URefCard.component.d.ts +0 -27
- package/dist/components/references/URefCard.component.js +0 -109
- package/dist/components/references/URefCardGroup.component.d.ts +0 -26
- package/dist/components/references/URefCardGroup.component.js +0 -88
- package/dist/components/references/URefTag.component.d.ts +0 -13
- package/dist/components/references/URefTag.component.js +0 -54
- package/dist/components/widgets/UChartWidget.component.js +0 -180
- package/dist/components/widgets/UChartWidget.d.ts +0 -7
- package/dist/components/widgets/UChartWidget.js +0 -5
- package/dist/components/widgets/UImagesWidget.component.js +0 -164
- package/dist/components/widgets/UImagesWidget.d.ts +0 -7
- package/dist/components/widgets/UImagesWidget.js +0 -5
- package/dist/components/widgets/UMapWidget.component.js +0 -65
- package/dist/components/widgets/UMapWidget.d.ts +0 -7
- package/dist/components/widgets/UMapWidget.js +0 -5
- package/dist/components/widgets/UMapWidget.styles.d.ts +0 -1
- package/dist/components/widgets/UVideoWidget.component.js +0 -106
- package/dist/components/widgets/UVideoWidget.d.ts +0 -7
- package/dist/components/widgets/UVideoWidget.js +0 -5
- package/dist/components/widgets/UVideoWidget.styles.d.ts +0 -1
- package/dist/components/widgets/UWidget.component.js +0 -140
- package/dist/components/widgets/UWidget.d.ts +0 -7
- package/dist/components/widgets/UWidget.js +0 -5
- package/dist/components/widgets/UWidget.styles.d.ts +0 -1
- package/dist/events/UCancelEvent.d.ts +0 -6
- package/dist/events/USubmitEvent.d.ts +0 -6
- package/dist/types/Actions.d.ts +0 -24
- package/dist/types/Actions.js +0 -34
- package/dist/types/Widgets.js +0 -115
- package/dist/utilities/ActionPromptBuilder.d.ts +0 -40
- package/dist/utilities/ActionPromptBuilder.js +0 -93
- package/dist/utilities/WidgetPromptBuilder.d.ts +0 -28
- package/dist/utilities/WidgetPromptBuilder.js +0 -87
- package/dist/utilities/converters.d.ts +0 -9
- package/dist/utilities/converters.js +0 -19
- /package/dist/components/{actions/UQuestionAction.styles.d.ts → blocks/UFileBlock.styles.d.ts} +0 -0
- /package/dist/components/{blocks/UFilesBlock.styles.d.ts → intents/UQuestionIntent.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UReportButton.styles.d.ts → views/UChartView.styles.d.ts} +0 -0
- /package/dist/components/{buttons/URetryButton.styles.d.ts → views/UImagesView.styles.d.ts} +0 -0
- /package/dist/components/{buttons/UShareButton.styles.d.ts → views/UMapView.styles.d.ts} +0 -0
- /package/dist/components/{widgets/UChartWidget.styles.d.ts → views/UVideoView.styles.d.ts} +0 -0
- /package/dist/components/{widgets/UImagesWidget.styles.d.ts → views/UView.styles.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,80 +1,111 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
4
|
-
|
|
5
|
-
### Breaking Changes
|
|
6
|
-
- `UMessage`의 `items` prop이 제거됨 — slot 방식으로 블록 컴포넌트를 직접 삽입해야 함
|
|
7
|
-
- `UMessage`의 `BaseElement` 의존성이 `UElement`로 변경됨
|
|
3
|
+
## [0.5.1] - 2026-04-15
|
|
8
4
|
|
|
9
5
|
### Added
|
|
6
|
+
- `UPrompt`: 0.4.x 호환을 위해 `u-submit`/`u-cancel` legacy 이벤트가 `send`/`stop`과 **동시에** 발사됩니다. 0.6.0에서 제거 예정 (`@deprecated`).
|
|
7
|
+
- `SendEventDetail`을 `{ value: string; files?: FileBlockItem[] }`로 타입 구체화. `UPrompt.submit()`이 detail에 실제 값을 채워 발행합니다.
|
|
8
|
+
- `StopEventDetail`을 interface로 정의 (현재 빈 객체, 향후 확장 대비).
|
|
9
|
+
- `MIGRATION.md` 추가: 0.4.x → 0.5.x 전환 가이드 및 Breaking Change 정책 문서화.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- `
|
|
13
|
-
- `UImagesWidget` - 이미지 갤러리 위젯 (스크롤 가능한 이미지 목록 표시)
|
|
14
|
-
- `UVideoWidget` - 비디오 임베드 위젯 (YouTube, Vimeo, 직접 URL 지원)
|
|
15
|
-
- `UMapWidget` - OpenStreetMap 기반 지도 위젯 (위경도 좌표 및 마커 표시)
|
|
16
|
-
- `UChartWidget` - Chart.js 기반 차트 위젯 (bar, line, pie, doughnut 등 8가지 타입, PNG/JSON 다운로드, 전체화면, 다크모드 테마 자동 감지)
|
|
11
|
+
### Fixed
|
|
12
|
+
- 0.5.0에서 DOM 이벤트 문자열 (`u-submit`/`u-cancel` → `send`/`stop`)이 CHANGELOG에 타입 rename (`USubmitEvent` → `SendEvent`)으로만 표기되어 vanilla DOM 소비자가 silent failure로 깨지던 문제를 alias 도입으로 완화.
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
- `UQuestionAction` - 클릭 가능한 선택지를 제공하는 질문 액션 컴포넌트 (action-json 블록 기반)
|
|
14
|
+
## [0.5.0] - 2026-04-01
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
16
|
+
### Added
|
|
17
|
+
- `AttachEvent` (`attach`) — file attach event (`detail.files: File[]`)
|
|
18
|
+
- `ChoiceEvent` (`choice`) — choice selection event (`detail.value: string`)
|
|
19
|
+
- DOM Agent utilities (`src/utilities/dom-agent/`) — experimental LLM web automation suite: `DOMScanner`, `DOMController`, `DOMAgent`, `DOMPromptBuilder` (currently excluded from main index export)
|
|
20
|
+
- `./react` package export entry point; `@lit/react` and `react` added as optional `peerDependencies`
|
|
21
|
+
- `html2canvas` dependency for screenshot capture support
|
|
22
|
+
- `ThinkingBlockItem.loading?: boolean` and `ToolBlockItem.loading?: boolean` fields
|
|
23
|
+
- `skills/iyulab-chat-components/` — full component reference and utility documentation
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- `ActionDefinition
|
|
28
|
-
-
|
|
29
|
-
- `FilesBlockItem
|
|
30
|
-
- `
|
|
25
|
+
### Changed
|
|
26
|
+
- **Breaking:** Widget System renamed to View System: `UWidget` → `UView`, `UImagesWidget` → `UImagesView`, `UVideoWidget` → `UVideoView`, `UMapWidget` → `UMapView`, `UChartWidget` → `UChartView`; `WidgetDefinition` / `PresetWidget` → `ViewDefinition` / `PresetView`; `WidgetPromptBuilder` → `ViewPromptBuilder`
|
|
27
|
+
- **Breaking:** Action System renamed to Intent System: `UQuestionAction` → `UQuestionIntent`; `ActionDefinition` → `IntentDefinition`; `ActionPromptBuilder` → `IntentPromptBuilder`; `types/Actions.ts` → `types/Intents.ts`; `types/Widgets.ts` → `types/Views.ts`
|
|
28
|
+
- **Breaking:** `UCancelEvent` → `StopEvent`; `USubmitEvent` → `SendEvent`
|
|
29
|
+
- **Breaking:** `UFilesBlock` → `UFileBlock`; `FilesBlockItem` + `FileItem` → `FileBlockItem`; `FileUploadStatus` type removed — replaced by inline `status?: "idle" | "uploading" | "error"` field
|
|
30
|
+
- **Breaking:** `UToolBlock.heading` property renamed to `title`
|
|
31
|
+
- **Breaking:** `package.json` exports simplified from `./dist/*` to direct `./src/*` mapping; `chart.js` moved from `dependencies` to optional `peerDependencies`
|
|
32
|
+
- Component file structure consolidated: `.component.ts` + `.ts` split merged into single `.ts` file; registration switched to `@customElement()` decorator
|
|
33
|
+
- `UThinkBlock`: added `auto-scroll` attribute, public `scrollToBottom()` method, wheel/touch scroll interruption
|
|
34
|
+
- Updated dependencies: `@iyulab/components` ^0.4.0 → ^1.0.1, `marked` ^17.0.3 → ^17.0.5, `vite` ^7.3.1 → ^8.0.3, `openai` (dev) ^6.25.0 → ^6.33.0
|
|
35
|
+
- `README.md` fully rewritten; new `docs/` pages added (architecture, block system, events, intent system, view system)
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- `UTableBlock`: inline markdown (`**bold**`, `` `code` ``, `<br>`, etc.) inside table cells now renders correctly using `Parser.parseInline()` instead of displaying as raw text
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
- `
|
|
34
|
-
- `
|
|
40
|
+
### Removed
|
|
41
|
+
- `UReportButton`, `URetryButton`, `UShareButton`
|
|
42
|
+
- `UCancelEvent`, `USubmitEvent` (replaced by `StopEvent`, `SendEvent`)
|
|
43
|
+
- `UQuestionAction` (replaced by `UQuestionIntent`)
|
|
44
|
+
- `UWidget`, `UImagesWidget`, `UVideoWidget`, `UMapWidget`, `UChartWidget` (replaced by View equivalents)
|
|
45
|
+
- `ActionPromptBuilder`, `WidgetPromptBuilder` (replaced by `IntentPromptBuilder`, `ViewPromptBuilder`)
|
|
46
|
+
- `types/Actions.ts`, `types/Widgets.ts` (replaced by `types/Intents.ts`, `types/Views.ts`)
|
|
47
|
+
- `utilities/converters.ts` (moved to `@iyulab/components`)
|
|
48
|
+
- All `.component.ts` split files
|
|
49
|
+
|
|
50
|
+
## [0.4.0] - 2026-03-03
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- Widget System: `UWidget`, `UImagesWidget`, `UVideoWidget`, `UMapWidget`, `UChartWidget`
|
|
54
|
+
- Action System: `UQuestionAction` for clickable question choices (rendered from `action-json` block)
|
|
55
|
+
- New block types: `UFilesBlock` (file attachment list), `UTableBlock` (table display)
|
|
56
|
+
- `JsonSchema` types for LLM use (`BooleanJsonSchema`, `StringJsonSchema`, `NumberJsonSchema`, `ArrayJsonSchema`, `ObjectJsonSchema`)
|
|
57
|
+
- `ActionDefinition`, `ActionSchema`, `PresetAction`, `WidgetDefinition`, `PresetWidget` types
|
|
58
|
+
- `FilesBlockItem`, `FileItem`, `MessageFit` types
|
|
59
|
+
- `ActionPromptBuilder`, `WidgetPromptBuilder` LLM prompt generation utilities
|
|
35
60
|
|
|
36
61
|
### Changed
|
|
37
|
-
- `UMessage
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
62
|
+
- **Breaking:** `UMessage.items` prop removed — block components must now be inserted via slots
|
|
63
|
+
- **Breaking:** `UMessage` base class changed from `BaseElement` to `UElement`; added `fit` attribute (`MessageFit`)
|
|
64
|
+
- `UMarkedBlock`: markdown rendering logic fully reworked
|
|
65
|
+
- `UPrompt`: style improvements
|
|
40
66
|
|
|
41
67
|
### Removed
|
|
42
|
-
- `UDotLoader`
|
|
68
|
+
- `UDotLoader` component
|
|
43
69
|
|
|
44
|
-
|
|
70
|
+
## [0.3.0] - 2026-01-22
|
|
45
71
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- Renamed `TextBlockReference` to `ReferenceCitation` and field `name` to `label`
|
|
49
|
-
- Updated `url` field in `ReferenceSource` to be optiona
|
|
50
|
-
- Added `URefBlock` component for displaying multiple reference sources
|
|
72
|
+
### Added
|
|
73
|
+
- `URefBlock` component for displaying multiple reference sources
|
|
51
74
|
- Enhanced `URefCard` and `URefTag` components with improved functionality
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
### Changed
|
|
77
|
+
- `TextBlockReference` renamed to `ReferenceCitation`; field `name` renamed to `label`
|
|
78
|
+
- `url` field in `ReferenceSource` changed to optional
|
|
79
|
+
|
|
80
|
+
## [0.2.0] - 2026-01-16
|
|
54
81
|
|
|
55
82
|
### Added
|
|
56
|
-
-
|
|
57
|
-
- Reference components: `URefCard`, `URefCardGroup`, `URefTag`
|
|
58
|
-
-
|
|
59
|
-
- `UCancelEvent`
|
|
83
|
+
- `UPrompt`, `UDotLoader` components for enhanced chat UI
|
|
84
|
+
- Reference components: `URefCard`, `URefCardGroup`, `URefTag`
|
|
85
|
+
- Button components: `UReportButton`, `URetryButton`, `UShareButton`, `UVoteButton`
|
|
86
|
+
- `UCancelEvent` replacing `UStopEvent`
|
|
60
87
|
- Type definitions: `BlockItem`, `BlockReference`, `JsonNode`
|
|
61
88
|
- Utility converters for data transformation
|
|
62
|
-
- Test utilities: generator.ts
|
|
89
|
+
- Test utilities: `generator.ts`, `messages.ts`
|
|
63
90
|
|
|
64
91
|
### Changed
|
|
65
|
-
-
|
|
92
|
+
- `UJsonViewer` renamed to `UJsonBlock`
|
|
66
93
|
- Enhanced styling and functionality across multiple block components
|
|
67
|
-
- Updated
|
|
68
|
-
- Improved UMessage component structure and styling
|
|
94
|
+
- Updated `UAttachButton` and `UCopyButton` styling and behavior
|
|
95
|
+
- Improved `UMessage` component structure and styling
|
|
69
96
|
|
|
70
97
|
### Removed
|
|
71
|
-
-
|
|
72
|
-
- UStopEvent (replaced by UCancelEvent)
|
|
73
|
-
- UMessage.types.ts (types moved to dedicated types directory)
|
|
74
|
-
- Internal date-helpers utility
|
|
98
|
+
- `USendButton`, `UThinkButton`
|
|
99
|
+
- `UStopEvent` (replaced by `UCancelEvent`)
|
|
100
|
+
- `UMessage.types.ts` (types moved to dedicated types directory)
|
|
101
|
+
- Internal `date-helpers` utility
|
|
75
102
|
|
|
76
|
-
## 0.1.1
|
|
77
|
-
- Update package.json exports field with correct paths
|
|
103
|
+
## [0.1.1] - 2025-12-19
|
|
78
104
|
|
|
79
|
-
|
|
80
|
-
-
|
|
105
|
+
### Fixed
|
|
106
|
+
- Fixed `package.json` exports field with correct paths
|
|
107
|
+
|
|
108
|
+
## [0.1.0] - 2025-12-19
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
- Initial release
|
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
# @iyulab/chat-components
|
|
1
|
+
# @iyulab/chat-components
|
|
2
2
|
|
|
3
|
-
LLM
|
|
3
|
+
Web component library for building LLM chat interfaces — works in any framework or vanilla HTML.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@iyulab/chat-components)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
4
9
|
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
@@ -8,29 +13,141 @@ LLM 채팅 인터페이스를 위한 웹 컴포넌트 라이브러리
|
|
|
8
13
|
npm install @iyulab/chat-components
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
12
19
|
|
|
13
|
-
```
|
|
20
|
+
```ts
|
|
14
21
|
import '@iyulab/chat-components';
|
|
15
22
|
```
|
|
16
23
|
|
|
24
|
+
```html
|
|
25
|
+
<u-message>
|
|
26
|
+
<u-marked-block value="# Hello This is **markdown**."></u-marked-block>
|
|
27
|
+
</u-message>
|
|
28
|
+
|
|
29
|
+
<u-prompt placeholder="Type a message...">
|
|
30
|
+
<u-attach-button slot="left-actions" multiple>Attach</u-attach-button>
|
|
31
|
+
</u-prompt>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const prompt = document.querySelector('u-prompt');
|
|
36
|
+
|
|
37
|
+
prompt.addEventListener('send', () => {
|
|
38
|
+
console.log('value:', prompt.value);
|
|
39
|
+
console.log('files:', prompt.files);
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> For a complete setup guide, see **[docs/getting-started.md](./docs/getting-started.md)**.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Skills Usage
|
|
48
|
+
|
|
49
|
+
Skills for LLM coding agents (Claude Code, GitHub Copilot, Cursor, etc.).
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Install from GitHub
|
|
53
|
+
npx skills add iyulab/node-chat-components
|
|
54
|
+
|
|
55
|
+
# Reference locally after package install
|
|
56
|
+
npx skills add ./node_modules/@iyulab/chat-components
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
17
61
|
## Components
|
|
18
62
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
63
|
+
### Message & Input
|
|
64
|
+
|
|
65
|
+
| Tag | Description |
|
|
66
|
+
|-----|-------------|
|
|
67
|
+
| `u-message` | Chat message wrapper. Slot-based block layout, loading animation, bubble/default styles |
|
|
68
|
+
| `u-prompt` | Chat input. Auto-resize textarea, file attachment preview, integrated send/stop button |
|
|
69
|
+
|
|
70
|
+
### Content Blocks
|
|
71
|
+
|
|
72
|
+
| Tag | Description |
|
|
73
|
+
|-----|-------------|
|
|
74
|
+
| `u-marked-block` | Markdown renderer — KaTeX, code highlighting, citation injection, view-json/intent-json handling |
|
|
75
|
+
| `u-code-block` | Syntax-highlighted code block (Highlight.js) with language label and copy button |
|
|
76
|
+
| `u-text-block` | Plain text display or editable textarea |
|
|
77
|
+
| `u-think-block` | LLM reasoning block — collapse/expand, auto-scroll |
|
|
78
|
+
| `u-tool-block` | Tool call input/output display — collapse/expand |
|
|
79
|
+
| `u-file-block` | File card — type icon, upload status, download, remove |
|
|
80
|
+
| `u-ref-block` | Reference source group — collapse/expand, card grid |
|
|
81
|
+
| `u-json-block` | Collapsible JSON tree |
|
|
82
|
+
| `u-table-block` | Table — column sort, search, CSV/XLS download |
|
|
83
|
+
|
|
84
|
+
### Action Buttons
|
|
85
|
+
|
|
86
|
+
| Tag | Description |
|
|
87
|
+
|-----|-------------|
|
|
88
|
+
| `u-copy-button` | Copies text to clipboard; icon confirms copy |
|
|
89
|
+
| `u-vote-button` | Thumbs-up / thumbs-down vote pair |
|
|
90
|
+
| `u-attach-button` | Opens file picker; fires `attach` event |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Intent & View Systems
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { IntentPromptBuilder, ViewPromptBuilder, PresetIntent, PresetView } from '@iyulab/chat-components';
|
|
98
|
+
|
|
99
|
+
// Build system prompt instructions
|
|
100
|
+
const intentInstructions = IntentPromptBuilder.instance.use(PresetIntent.Questions).build();
|
|
101
|
+
const viewInstructions = ViewPromptBuilder.instance.use(PresetView.All).build();
|
|
102
|
+
|
|
103
|
+
const systemPrompt = `You are a helpful assistant.\n\n${intentInstructions}\n\n${viewInstructions}`;
|
|
104
|
+
|
|
105
|
+
// Parse LLM response
|
|
106
|
+
const [intents, cleanText] = IntentPromptBuilder.instance.parse(llmResponse);
|
|
107
|
+
markedBlock.value = cleanText; // view-json blocks inside are rendered automatically
|
|
108
|
+
|
|
109
|
+
for (const intent of intents) {
|
|
110
|
+
if (intent.type === 'question') {
|
|
111
|
+
const el = document.createElement('u-question-intent') as any;
|
|
112
|
+
el.question = intent.properties?.question;
|
|
113
|
+
el.choices = intent.properties?.choices ?? [];
|
|
114
|
+
el.addEventListener('choice', (e: any) => { prompt.value = e.detail.value; prompt.submit(); });
|
|
115
|
+
msg.appendChild(el);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
> - Intent system details: **[docs/intent-system.md](./docs/intent-system.md)**
|
|
121
|
+
> - View system details: **[docs/view-system.md](./docs/view-system.md)**
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Events
|
|
126
|
+
|
|
127
|
+
| Event | Source | Detail | Description |
|
|
128
|
+
|-------|--------|--------|-------------|
|
|
129
|
+
| `send` | `u-prompt` | — | Send button clicked or Enter pressed |
|
|
130
|
+
| `stop` | `u-prompt` | — | Stop button clicked while loading |
|
|
131
|
+
| `attach` | `u-attach-button` | `{ files: File[] }` | File selection completed |
|
|
132
|
+
| `choice` | `u-question-intent` | `{ value: string }` | Choice button clicked |
|
|
133
|
+
| `change` | `u-vote-button` | — | Vote state changed |
|
|
134
|
+
| `remove` | `u-file-block` | — | Remove button clicked |
|
|
135
|
+
|
|
136
|
+
---
|
|
29
137
|
|
|
30
138
|
## Documentation
|
|
31
139
|
|
|
32
|
-
|
|
140
|
+
| File | Description |
|
|
141
|
+
|------|-------------|
|
|
142
|
+
| [docs/getting-started.md](./docs/getting-started.md) | Installation, basic chat UI, streaming, history rendering |
|
|
143
|
+
| [docs/architecture.md](./docs/architecture.md) | Package structure, class hierarchy, rendering pipeline |
|
|
144
|
+
| [docs/block-system.md](./docs/block-system.md) | Block components and `BlockItem` types in depth |
|
|
145
|
+
| [docs/intent-system.md](./docs/intent-system.md) | Intent system setup and custom intents |
|
|
146
|
+
| [docs/view-system.md](./docs/view-system.md) | View system setup and custom views |
|
|
147
|
+
| [docs/events.md](./docs/events.md) | Full event reference |
|
|
148
|
+
|
|
149
|
+
---
|
|
33
150
|
|
|
34
151
|
## License
|
|
35
152
|
|
|
36
|
-
MIT
|
|
153
|
+
MIT © iyulab
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
|
|
2
|
+
function __decorate(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { __decorate };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region \0glob-assets_raw/intent-prompt.md.1907474e
|
|
2
|
+
var intent_prompt_md_default = "## Interactive Intents\n\nYou can guide the user with interactive intents by appending `intent-json` fenced code blocks at the end of your response. These intents can suggest follow-up questions, offer buttons to click, or provide other interactive elements that help the user continue the conversation.\n\n**Output format (the fence language must be `intent-json`):**\n```intent-json\n{\n \"type\": \"intent-type-here\",\n \"properties\" : {\n \"key\": \"value\"\n }\n}\n```\n\n**Rules — follow these STRICTLY. Violation means the feature will not work:**\n1. The fenced block language identifier must be `intent-json`, not `json` or anything else.\n2. `type` must be one of the exact strings listed below. Do not invent new types.\n3. place ALL intent blocks at the very end of your response, after all prose content.\n4. Output valid JSON only — no comments, no trailing commas, etc.\n\n---\n\n{{INTENT_DOCS}}\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { intent_prompt_md_default as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region \0glob-assets_raw/view-prompt.md.e0dbcffe
|
|
2
|
+
var view_prompt_md_default = "## Renderable Views\n\nYou can render interactive visual views inside your response.\nWhen a view would make your answer clearer or more useful, output a `view-json` fenced code block.\n\n**Output format (the fence language must be `view-json`):**\n```view-json\n{\n \"tag\": \"view-tag-here\",\n \"properties\": {\n \"key\": \"value\"\n }\n}\n```\n\n**Rules — follow these strictly:**\n1. The fenced block language identifier must be `view-json`, not `json` or anything else.\n2. `tag` must be one of the exact strings listed below. Never invent a tag.\n3. Output valid JSON — no comments, no trailing commas.\n\n---\n\n{{VIEW_DOCS}}\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { view_prompt_md_default as default };
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 코드 블록을 렌더링하는 컴포넌트입니다.
|
|
4
|
+
* 언어와 코드를 받아 syntax highlighting을 적용합니다.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UCodeBlock extends UElement {
|
|
7
|
+
static styles: import('lit').CSSResultGroup[];
|
|
8
|
+
/** 코드 블록이 로딩 중인지 여부를 나타냅니다. */
|
|
9
|
+
loading: boolean;
|
|
10
|
+
/** 코드 블록의 헤더를 숨길지 여부를 지정합니다. */
|
|
11
|
+
headless: boolean;
|
|
12
|
+
/** 코드 언어를 지정합니다. */
|
|
13
|
+
lang: string;
|
|
14
|
+
/** 표시할 코드 내용입니다. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** 클립보드 복사 상태를 나타내는 플래그입니다. */
|
|
17
|
+
isCopied: boolean;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
/**
|
|
20
|
+
* slot에 할당된 코드를 value로 설정합니다.
|
|
21
|
+
* 이 기능을 통해 HTML 내에 직접 코드를 작성할 수 있습니다.
|
|
22
|
+
*/
|
|
23
|
+
private handleSlotChange;
|
|
24
|
+
}
|
|
2
25
|
declare global {
|
|
3
26
|
interface HTMLElementTagNameMap {
|
|
4
27
|
"u-code-block": UCodeBlock;
|
|
5
28
|
}
|
|
6
29
|
}
|
|
7
|
-
export { UCodeBlock };
|
|
@@ -1,5 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorateMetadata.js";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
3
|
+
import "../buttons/UCopyButton.js";
|
|
4
|
+
import { styles } from "./UCodeBlock.styles.js";
|
|
5
|
+
import { html } from "lit";
|
|
6
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
7
|
+
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
8
|
+
import hljs from "highlight.js";
|
|
9
|
+
import "@iyulab/components/dist/components/icon/UIcon.js";
|
|
10
|
+
import "@iyulab/components/dist/components/spinner/USpinner.js";
|
|
11
|
+
import { UElement } from "@iyulab/components/dist/components/UElement.js";
|
|
12
|
+
//#region src/components/blocks/UCodeBlock.ts
|
|
13
|
+
var UCodeBlock = class UCodeBlock extends UElement {
|
|
14
|
+
constructor(..._args) {
|
|
15
|
+
super(..._args);
|
|
16
|
+
this.loading = false;
|
|
17
|
+
this.headless = false;
|
|
18
|
+
this.lang = "plaintext";
|
|
19
|
+
this.isCopied = false;
|
|
20
|
+
this.handleSlotChange = (e) => {
|
|
21
|
+
this.value = e.target.assignedNodes({ flatten: true }).map((node) => node.textContent).join("\n\n");
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
this.styles = [super.styles, styles];
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
const lang = hljs.getLanguage(this.lang) ? this.lang : "plaintext";
|
|
29
|
+
const value = this.value || "";
|
|
30
|
+
return html`
|
|
31
|
+
<div class="header" ?hidden=${this.headless}>
|
|
32
|
+
<span class="status">
|
|
33
|
+
${this.loading ? html`<u-spinner></u-spinner>` : html`<u-icon lib="bootstrap" name="code-slash"></u-icon>`}
|
|
34
|
+
</span>
|
|
35
|
+
<span class="lang">
|
|
36
|
+
${lang}
|
|
37
|
+
</span>
|
|
38
|
+
<div style="flex: 1"></div>
|
|
39
|
+
<u-copy-button
|
|
40
|
+
.value=${value}
|
|
41
|
+
></u-copy-button>
|
|
42
|
+
</div>
|
|
2
43
|
|
|
3
|
-
|
|
44
|
+
<pre class="hljs">${unsafeHTML(hljs.highlight(value, { language: lang }).value)}</pre>
|
|
4
45
|
|
|
46
|
+
<div hidden aria-hidden="true">
|
|
47
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
__decorate([property({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: true
|
|
55
|
+
}), __decorateMetadata("design:type", Boolean)], UCodeBlock.prototype, "loading", void 0);
|
|
56
|
+
__decorate([property({
|
|
57
|
+
type: Boolean,
|
|
58
|
+
reflect: true
|
|
59
|
+
}), __decorateMetadata("design:type", Boolean)], UCodeBlock.prototype, "headless", void 0);
|
|
60
|
+
__decorate([property({
|
|
61
|
+
type: String,
|
|
62
|
+
reflect: true
|
|
63
|
+
}), __decorateMetadata("design:type", String)], UCodeBlock.prototype, "lang", void 0);
|
|
64
|
+
__decorate([property({ type: String }), __decorateMetadata("design:type", String)], UCodeBlock.prototype, "value", void 0);
|
|
65
|
+
__decorate([state(), __decorateMetadata("design:type", Boolean)], UCodeBlock.prototype, "isCopied", void 0);
|
|
66
|
+
UCodeBlock = __decorate([customElement("u-code-block")], UCodeBlock);
|
|
67
|
+
//#endregion
|
|
5
68
|
export { UCodeBlock };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { css } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
//#region src/components/blocks/UCodeBlock.styles.ts
|
|
3
|
+
var styles = css`
|
|
4
4
|
:host {
|
|
5
5
|
--hljs-text-color: #24292e;
|
|
6
6
|
--hljs-background-color: #ffffff;
|
|
@@ -178,5 +178,5 @@ const styles = css`
|
|
|
178
178
|
color: currentColor;
|
|
179
179
|
}
|
|
180
180
|
`;
|
|
181
|
-
|
|
181
|
+
//#endregion
|
|
182
182
|
export { styles };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UElement } from '@iyulab/components/dist/components/UElement.js';
|
|
2
|
+
/**
|
|
3
|
+
* 단일 파일을 표시하는 블록 컴포넌트입니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare class UFileBlock extends UElement {
|
|
6
|
+
static styles: import('lit').CSSResultGroup[];
|
|
7
|
+
/** 삭제 버튼 표시 */
|
|
8
|
+
removable: boolean;
|
|
9
|
+
/** 파일 상태 */
|
|
10
|
+
status?: 'idle' | 'uploading' | 'error';
|
|
11
|
+
/** 파일 이름 */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** MIME 타입 */
|
|
14
|
+
type?: string;
|
|
15
|
+
/** 파일 크기 (bytes) */
|
|
16
|
+
size?: number;
|
|
17
|
+
/** 다운로드 URL */
|
|
18
|
+
url?: string;
|
|
19
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
20
|
+
private handleDownloadClick;
|
|
21
|
+
private handleRemoveClick;
|
|
22
|
+
/** MIME 타입 → Bootstrap Icon 이름 */
|
|
23
|
+
private resolveIcon;
|
|
24
|
+
/** 파일명 또는 MIME 타입에서 확장자를 추출합니다. */
|
|
25
|
+
private resolveExt;
|
|
26
|
+
/** bytes → 읽기 좋은 크기 문자열 */
|
|
27
|
+
private formatSize;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
"u-file-block": UFileBlock;
|
|
32
|
+
}
|
|
33
|
+
}
|