@iyulab/chat-components 0.5.1 → 0.6.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 (42) hide show
  1. package/CHANGELOG.md +37 -5
  2. package/dist/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/decorate.js +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.124.0 → _@oxc-project_runtime@0.130.0}/helpers/decorateMetadata.js +1 -1
  4. package/dist/chart.d.ts +1 -0
  5. package/dist/chart.js +2 -0
  6. package/dist/components/blocks/UCodeBlock.js +4 -3
  7. package/dist/components/blocks/UFileBlock.js +2 -2
  8. package/dist/components/blocks/UJsonBlock.js +2 -2
  9. package/dist/components/blocks/UMarkedBlock.js +3 -27
  10. package/dist/components/blocks/URefBlock.js +2 -2
  11. package/dist/components/blocks/UTableBlock.js +4 -3
  12. package/dist/components/blocks/UTextBlock.js +2 -2
  13. package/dist/components/blocks/UThinkBlock.js +2 -2
  14. package/dist/components/blocks/UToolBlock.js +2 -2
  15. package/dist/components/buttons/UAttachButton.js +2 -2
  16. package/dist/components/buttons/UCopyButton.js +2 -2
  17. package/dist/components/buttons/UVoteButton.js +2 -2
  18. package/dist/components/intents/UQuestionIntent.js +2 -2
  19. package/dist/components/message/UMessage.js +2 -2
  20. package/dist/components/prompt/UPrompt.js +4 -3
  21. package/dist/components/references/URefCard.js +2 -2
  22. package/dist/components/references/URefCardGroup.js +4 -3
  23. package/dist/components/references/URefTag.js +2 -2
  24. package/dist/components/views/UChartView.js +2 -2
  25. package/dist/components/views/UImagesView.js +2 -2
  26. package/dist/components/views/UMapView.js +2 -2
  27. package/dist/components/views/UVideoView.js +2 -2
  28. package/dist/components/views/UView.js +2 -2
  29. package/dist/index.d.ts +0 -1
  30. package/dist/index.js +1 -2
  31. package/dist/react/index.d.ts +0 -1
  32. package/dist/react/index.js +0 -1
  33. package/dist/types/Intents.js +2 -2
  34. package/dist/types/Views.d.ts +2 -2
  35. package/dist/types/Views.js +8 -10
  36. package/dist/utilities/HtmlPlaceholder.d.ts +11 -0
  37. package/dist/utilities/HtmlPlaceholder.js +26 -0
  38. package/dist/utilities/ViewPromptBuilder.js +4 -2
  39. package/package.json +17 -12
  40. package/skills/iyulab-chat-components/SKILL.md +1 -1
  41. package/dist/react/UChartView.d.ts +0 -9
  42. package/dist/react/UChartView.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,15 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0] - 2026-05-21
4
+
5
+ ### Changed
6
+
7
+ - **Breaking:** `UChartView` removed from main entrypoint. Consumers must now explicitly import from the `@iyulab/chat-components/chart` subpath.
8
+
9
+ **Migration:**
10
+ ```ts
11
+ // Before (0.5.x)
12
+ import { UChartView } from '@iyulab/chat-components';
13
+
14
+ // After (0.6.0)
15
+ import '@iyulab/chat-components/chart'; // element registration only
16
+ import { UChartView } from '@iyulab/chat-components/chart'; // + class export
17
+ ```
18
+
19
+ `PresetView.Chart` and `PRESET_VIEW_DEFINITIONS` remain in the main entrypoint — calling `ViewPromptBuilder.use(PresetView.Chart)` still works, but `UChartView` must be registered separately via the chart subpath.
20
+
21
+ - `ViewDefinition.element` is now optional. Definitions without `element` (e.g. chart) skip the custom element conflict check in `ViewPromptBuilder.add()`.
22
+
23
+ ### Why
24
+
25
+ Bundlers that perform static analysis of dynamic imports (e.g. Turbopack / Next.js 16+) would fail at build time with `Can't resolve 'chart.js/auto'` even when `chart.js` is declared as an optional peer dependency, because `UChartView` was reachable from the main `index.js` barrel. Moving it to a separate subpath eliminates the static-analysis path for projects that don't use charts.
26
+
27
+ > **Note:** The `./react` subpath (`@iyulab/chat-components/react`) still re-exports `UChartView` due to a limitation in the react-wrapper build plugin. React consumers that don't use charts and target Turbopack should avoid the `./react` barrel import and import individual wrappers instead (e.g. `@iyulab/chat-components/react/UMarkedBlock`), or install `chart.js`.
28
+
29
+ ## [0.5.2] - 2026-05-08
30
+
31
+ ### Changed
32
+ - Updated runtime dependencies to newer patch/minor releases, including `@iyulab/components` (`^1.0.3` -> `^1.0.5`) and markdown stack updates (`marked` `^17.0.5` -> `^18.0.3`, `marked-katex-extension` `^5.1.7` -> `^5.1.8`).
33
+ - Refactored markdown HTML placeholder logic by extracting it from `UMarkedBlock` into a dedicated utility (`HtmlPlaceholder`) without changing public API behavior.
34
+
3
35
  ## [0.5.1] - 2026-04-15
4
36
 
5
37
  ### 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 정책 문서화.
38
+ - `UPrompt`: restored 0.4.x compatibility by emitting legacy `u-submit`/`u-cancel` events **alongside** `send`/`stop`; scheduled for removal in 0.6.0 (`@deprecated`).
39
+ - Refined `SendEventDetail` to `{ value: string; files?: FileBlockItem[] }`; `UPrompt.submit()` now emits the actual value in `detail`.
40
+ - Added `StopEventDetail` as an interface (currently empty, reserved for future extension).
41
+ - Added `MIGRATION.md` with a 0.4.x -> 0.5.x migration guide and documented breaking-change policy.
10
42
 
11
43
  ### Fixed
12
- - 0.5.0에서 DOM 이벤트 문자열 (`u-submit`/`u-cancel` → `send`/`stop`)이 CHANGELOG에 타입 rename (`USubmitEvent` → `SendEvent`)으로만 표기되어 vanilla DOM 소비자가 silent failure로 깨지던 문제를 alias 도입으로 완화.
44
+ - Mitigated silent failures for vanilla DOM consumers in 0.5.0 by introducing aliases for event-name changes (`u-submit`/`u-cancel` -> `send`/`stop`), which had previously been documented only as type renames (`USubmitEvent` -> `SendEvent`).
13
45
 
14
46
  ## [0.5.0] - 2026-04-01
15
47
 
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorate.js
1
+ //#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
2
2
  function __decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.124.0/helpers/decorateMetadata.js
1
+ //#region \0@oxc-project+runtime@0.130.0/helpers/decorateMetadata.js
2
2
  function __decorateMetadata(k, v) {
3
3
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4
4
  }
@@ -0,0 +1 @@
1
+ export * from './components/views/UChartView.js';
package/dist/chart.js ADDED
@@ -0,0 +1,2 @@
1
+ import { UChartView } from "./components/views/UChartView.js";
2
+ export { UChartView };
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "../buttons/UCopyButton.js";
4
4
  import { styles } from "./UCodeBlock.styles.js";
5
5
  import { html } from "lit";
@@ -18,7 +18,8 @@ var UCodeBlock = class UCodeBlock extends UElement {
18
18
  this.lang = "plaintext";
19
19
  this.isCopied = false;
20
20
  this.handleSlotChange = (e) => {
21
- this.value = e.target.assignedNodes({ flatten: true }).map((node) => node.textContent).join("\n\n");
21
+ const nodes = e.target.assignedNodes({ flatten: true });
22
+ this.value = nodes.map((node) => node.textContent).join("\n\n");
22
23
  };
23
24
  }
24
25
  static {
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UFileBlock.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UJsonBlock.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
@@ -1,11 +1,12 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "./UCodeBlock.js";
4
4
  import "../references/URefTag.js";
5
5
  import { URefCard } from "../references/URefCard.js";
6
6
  import "../references/URefCardGroup.js";
7
7
  import { UTableBlock } from "./UTableBlock.js";
8
8
  import { UView } from "../views/UView.js";
9
+ import { HtmlPlaceholder } from "../../utilities/HtmlPlaceholder.js";
9
10
  import { styles } from "./UMarkedBlock.styles.js";
10
11
  import { nothing } from "lit";
11
12
  import { customElement, property } from "lit/decorators.js";
@@ -126,30 +127,5 @@ var UMarkedBlock = class UMarkedBlock extends UElement {
126
127
  __decorate([property({ type: String }), __decorateMetadata("design:type", String)], UMarkedBlock.prototype, "value", void 0);
127
128
  __decorate([property({ type: Array }), __decorateMetadata("design:type", Array)], UMarkedBlock.prototype, "refs", void 0);
128
129
  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
130
  //#endregion
155
131
  export { UMarkedBlock };
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "../references/URefCard.js";
4
4
  import { styles } from "./URefBlock.styles.js";
5
5
  import { html } from "lit";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UTableBlock.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
@@ -137,7 +137,8 @@ var UTableBlock = class UTableBlock extends UDataElement {
137
137
  });
138
138
  }
139
139
  handleSearchInput(e) {
140
- this.searchCache = e.target.value || "";
140
+ const input = e.target;
141
+ this.searchCache = input.value || "";
141
142
  if (this.searchTimer !== null) window.clearTimeout(this.searchTimer);
142
143
  this.loading = true;
143
144
  this.searchTimer = window.setTimeout(() => {
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UTextBlock.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property, query } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "./UMarkedBlock.js";
4
4
  import { styles } from "./UThinkBlock.styles.js";
5
5
  import { html } from "lit";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "./UJsonBlock.js";
4
4
  import { styles } from "./UToolBlock.styles.js";
5
5
  import { html } from "lit";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UAttachButton.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property, query } from "lit/decorators.js";
@@ -1,6 +1,6 @@
1
1
  import { styles } from "./UCopyButton.styles.js";
2
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorateMetadata.js";
3
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
3
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
6
6
  import "@iyulab/components/dist/components/icon/UIcon.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UVoteButton.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UQuestionIntent.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UMessage.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import "../blocks/UFileBlock.js";
4
4
  import { styles } from "./UPrompt.styles.js";
5
5
  import { html } from "lit";
@@ -119,7 +119,8 @@ var UPrompt = class UPrompt extends UElement {
119
119
  }
120
120
  handleTextBlockInput(e) {
121
121
  e.preventDefault();
122
- this.value = e.target.value;
122
+ const target = e.target;
123
+ this.value = target.value;
123
124
  }
124
125
  handleTextBlockKeydown(e) {
125
126
  if (e.key === "Enter" && !e.shiftKey) {
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./URefCard.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { URefCard } from "./URefCard.js";
4
4
  import { styles } from "./URefCardGroup.styles.js";
5
5
  import { html } from "lit";
@@ -59,7 +59,8 @@ var URefCardGroup = class URefCardGroup extends UElement {
59
59
  }
60
60
  /** slot 내용이 변경될 때 호출됩니다. */
61
61
  handleSlotChange(e) {
62
- this.cards = e.target.assignedElements({ flatten: true }).filter((el) => el instanceof URefCard);
62
+ const elements = e.target.assignedElements({ flatten: true });
63
+ this.cards = elements.filter((el) => el instanceof URefCard);
63
64
  this.switch(0);
64
65
  }
65
66
  };
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./URefTag.styles.js";
4
4
  import { html } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UChartView.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property, query, state } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UImagesView.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UMapView.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UVideoView.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
@@ -1,5 +1,5 @@
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";
1
+ import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorateMetadata.js";
2
+ import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { styles } from "./UView.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property, state } from "lit/decorators.js";
package/dist/index.d.ts CHANGED
@@ -19,7 +19,6 @@ export * from './components/intents/UQuestionIntent.js';
19
19
  export * from './components/views/UImagesView.js';
20
20
  export * from './components/views/UVideoView.js';
21
21
  export * from './components/views/UMapView.js';
22
- export * from './components/views/UChartView.js';
23
22
  export * from './components/views/UView.js';
24
23
  export type * from './types/BlockItem';
25
24
  export type * from './types/JsonNode';
package/dist/index.js CHANGED
@@ -20,9 +20,8 @@ import { UQuestionIntent } from "./components/intents/UQuestionIntent.js";
20
20
  import { UImagesView } from "./components/views/UImagesView.js";
21
21
  import { UVideoView } from "./components/views/UVideoView.js";
22
22
  import { UMapView } from "./components/views/UMapView.js";
23
- import { UChartView } from "./components/views/UChartView.js";
24
23
  import { PRESET_INTENT_DEFINITIONS, PRESET_INTENT_LIST, PresetIntent } from "./types/Intents.js";
25
24
  import { PRESET_VIEW_DEFINITIONS, PRESET_VIEW_LIST, PresetView } from "./types/Views.js";
26
25
  import { IntentPromptBuilder } from "./utilities/IntentPromptBuilder.js";
27
26
  import { ViewPromptBuilder } from "./utilities/ViewPromptBuilder.js";
28
- export { IntentPromptBuilder, PRESET_INTENT_DEFINITIONS, PRESET_INTENT_LIST, PRESET_VIEW_DEFINITIONS, PRESET_VIEW_LIST, PresetIntent, PresetView, UAttachButton, UChartView, UCodeBlock, UCopyButton, UFileBlock, UImagesView, UJsonBlock, UMapView, UMarkedBlock, UMessage, UPrompt, UQuestionIntent, URefBlock, URefCard, URefCardGroup, URefTag, UTableBlock, UTextBlock, UThinkBlock, UToolBlock, UVideoView, UView, UVoteButton, ViewPromptBuilder };
27
+ export { IntentPromptBuilder, PRESET_INTENT_DEFINITIONS, PRESET_INTENT_LIST, PRESET_VIEW_DEFINITIONS, PRESET_VIEW_LIST, PresetIntent, PresetView, UAttachButton, UCodeBlock, UCopyButton, UFileBlock, UImagesView, UJsonBlock, UMapView, UMarkedBlock, UMessage, UPrompt, UQuestionIntent, URefBlock, URefCard, URefCardGroup, URefTag, UTableBlock, UTextBlock, UThinkBlock, UToolBlock, UVideoView, UView, UVoteButton, ViewPromptBuilder };
@@ -2,7 +2,6 @@ export { UView, UViewProps } from './UView';
2
2
  export { UVideoView, UVideoViewProps } from './UVideoView';
3
3
  export { UMapView, UMapViewProps } from './UMapView';
4
4
  export { UImagesView, UImagesViewProps } from './UImagesView';
5
- export { UChartView, UChartViewProps } from './UChartView';
6
5
  export { URefTag, URefTagProps } from './URefTag';
7
6
  export { URefCardGroup, URefCardGroupProps } from './URefCardGroup';
8
7
  export { URefCard, URefCardProps } from './URefCard';
@@ -2,7 +2,6 @@ export { UView } from './UView.js';
2
2
  export { UVideoView } from './UVideoView.js';
3
3
  export { UMapView } from './UMapView.js';
4
4
  export { UImagesView } from './UImagesView.js';
5
- export { UChartView } from './UChartView.js';
6
5
  export { URefTag } from './URefTag.js';
7
6
  export { URefCardGroup } from './URefCardGroup.js';
8
7
  export { URefCard } from './URefCard.js';
@@ -6,9 +6,9 @@ var PresetIntent = /* @__PURE__ */ function(PresetIntent) {
6
6
  return PresetIntent;
7
7
  }({});
8
8
  /** 프리셋 Intent 목록 (비트 플래그 순서대로) */
9
- var PRESET_INTENT_LIST = [PresetIntent.Questions];
9
+ var PRESET_INTENT_LIST = [1];
10
10
  /** 프리셋 Intent 정의 매핑 */
11
- var PRESET_INTENT_DEFINITIONS = new Map([[PresetIntent.Questions, {
11
+ var PRESET_INTENT_DEFINITIONS = new Map([[1, {
12
12
  type: "question",
13
13
  description: "Present a question to the user with clickable choices",
14
14
  properties: {
@@ -3,8 +3,8 @@ import { JsonSchema } from './JsonSchema.js';
3
3
  * View를 정의하는 구조체
4
4
  */
5
5
  export interface ViewDefinition {
6
- /** 등록할 커스텀 엘리먼트 클래스 */
7
- element: CustomElementConstructor;
6
+ /** 커스텀 엘리먼트 클래스 (optional: chart처럼 별도 서브패스로 분리된 경우 생략 가능) */
7
+ element?: CustomElementConstructor;
8
8
  /** 등록할 커스텀 엘리먼트 태그명 */
9
9
  tag: string;
10
10
  /** LLM용 설명 */
@@ -1,7 +1,6 @@
1
1
  import { UImagesView } from "../components/views/UImagesView.js";
2
2
  import { UVideoView } from "../components/views/UVideoView.js";
3
3
  import { UMapView } from "../components/views/UMapView.js";
4
- import { UChartView } from "../components/views/UChartView.js";
5
4
  //#region src/types/Views.ts
6
5
  /**
7
6
  * 프리셋 View 비트 플래그
@@ -18,16 +17,16 @@ var PresetView = /* @__PURE__ */ function(PresetView) {
18
17
  * 전체 프리셋 View 플래그 목록
19
18
  */
20
19
  var PRESET_VIEW_LIST = [
21
- PresetView.Images,
22
- PresetView.Video,
23
- PresetView.Map,
24
- PresetView.Chart
20
+ 1,
21
+ 2,
22
+ 8,
23
+ 16
25
24
  ];
26
25
  /**
27
26
  * 프리셋 View 정의
28
27
  */
29
28
  var PRESET_VIEW_DEFINITIONS = new Map([
30
- [PresetView.Images, {
29
+ [1, {
31
30
  element: UImagesView,
32
31
  tag: "u-images-view",
33
32
  description: "Display multiple images in a scrollable gallery",
@@ -56,7 +55,7 @@ var PRESET_VIEW_DEFINITIONS = new Map([
56
55
  } },
57
56
  required: ["items"]
58
57
  }],
59
- [PresetView.Video, {
58
+ [2, {
60
59
  element: UVideoView,
61
60
  tag: "u-video-view",
62
61
  description: "Embed video from YouTube, Vimeo, or Others. Provide a direct video file URL or a platform URL.",
@@ -82,7 +81,7 @@ var PRESET_VIEW_DEFINITIONS = new Map([
82
81
  },
83
82
  required: ["src"]
84
83
  }],
85
- [PresetView.Map, {
84
+ [8, {
86
85
  element: UMapView,
87
86
  tag: "u-map-view",
88
87
  description: "Display a map showing a single location",
@@ -113,8 +112,7 @@ var PRESET_VIEW_DEFINITIONS = new Map([
113
112
  },
114
113
  required: ["lat", "lng"]
115
114
  }],
116
- [PresetView.Chart, {
117
- element: UChartView,
115
+ [16, {
118
116
  tag: "u-chart-view",
119
117
  description: "Display charts using Chart.js v4 format. Use standard Chart.js configuration (type, data, options). The View accepts the exact same structure as Chart.js - no conversion needed.",
120
118
  properties: {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Marked 파싱 중 HTML이 GFM에 의해 오염되는 것을 방지하기 위해
3
+ * HTML을 주석 플레이스홀더로 치환하고, 나중에 원래 HTML로 복원하는 유틸입니다.
4
+ */
5
+ export declare class HtmlPlaceholder {
6
+ private map;
7
+ private idx;
8
+ reset(): void;
9
+ store(html: string): string;
10
+ restore(html: string): string;
11
+ }
@@ -0,0 +1,26 @@
1
+ //#region src/utilities/HtmlPlaceholder.ts
2
+ /**
3
+ * Marked 파싱 중 HTML이 GFM에 의해 오염되는 것을 방지하기 위해
4
+ * HTML을 주석 플레이스홀더로 치환하고, 나중에 원래 HTML로 복원하는 유틸입니다.
5
+ */
6
+ var HtmlPlaceholder = class {
7
+ constructor() {
8
+ this.map = {};
9
+ this.idx = 0;
10
+ }
11
+ reset() {
12
+ this.map = {};
13
+ this.idx = 0;
14
+ }
15
+ store(html) {
16
+ const key = `<!--ref:${this.idx++}-->`;
17
+ this.map[key] = html;
18
+ return key;
19
+ }
20
+ restore(html) {
21
+ if (this.idx === 0) return html;
22
+ return html.replace(/<!--ref:\d+-->/g, (key) => this.map[key] ?? "");
23
+ }
24
+ };
25
+ //#endregion
26
+ export { HtmlPlaceholder };
@@ -21,8 +21,10 @@ var ViewPromptBuilder = class ViewPromptBuilder {
21
21
  */
22
22
  add(definition) {
23
23
  if (this.views.has(definition.tag)) throw new Error(`View with tag "${definition.tag}" is already registered.`);
24
- const constructor = customElements.get(definition.tag);
25
- if (constructor && constructor !== definition.element) throw new Error(`Custom element with tag "${definition.tag}" is already defined to a different class.`);
24
+ if (definition.element) {
25
+ const constructor = customElements.get(definition.tag);
26
+ if (constructor && constructor !== definition.element) throw new Error(`Custom element with tag "${definition.tag}" is already defined to a different class.`);
27
+ }
26
28
  this.views.set(definition.tag, definition);
27
29
  return this;
28
30
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/chat-components",
3
3
  "description": "llm chat components for building chat interfaces",
4
- "version": "0.5.1",
4
+ "version": "0.6.0",
5
5
  "author": "iyulab",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -32,6 +32,10 @@
32
32
  "types": "./dist/index.d.ts",
33
33
  "import": "./dist/index.js"
34
34
  },
35
+ "./chart": {
36
+ "types": "./dist/chart.d.ts",
37
+ "import": "./dist/chart.js"
38
+ },
35
39
  "./dist/*": "./dist/*",
36
40
  "./react": "./dist/react/index.js",
37
41
  "./react/*": "./dist/react/*"
@@ -41,12 +45,13 @@
41
45
  "build": "eslint && vite build"
42
46
  },
43
47
  "dependencies": {
44
- "@iyulab/components": "^1.0.3",
48
+ "@iyulab/components": "^1.0.6",
45
49
  "highlight.js": "^11.11.1",
46
50
  "html2canvas": "^1.4.1",
47
- "lit": "^3.3.2",
48
- "marked": "^17.0.5",
49
- "marked-katex-extension": "^5.1.7"
51
+ "katex": "^0.16.0",
52
+ "lit": "^3.3.3",
53
+ "marked": "^18.0.3",
54
+ "marked-katex-extension": "^5.1.8"
50
55
  },
51
56
  "peerDependencies": {
52
57
  "@lit/react": ">=1.0.8",
@@ -66,16 +71,16 @@
66
71
  },
67
72
  "devDependencies": {
68
73
  "@eslint/js": "^9.39.4",
69
- "@types/node": "^25.5.0",
74
+ "@types/node": "^25.8.0",
70
75
  "chart.js": "^4.5.1",
71
76
  "eslint": "^9.39.4",
72
- "eslint-plugin-lit": "^2.2.1",
77
+ "eslint-plugin-lit": "^2.3.1",
73
78
  "glob": "^13.0.6",
74
- "globals": "^17.4.0",
75
- "openai": "^6.33.0",
79
+ "globals": "^17.6.0",
80
+ "openai": "^6.37.0",
76
81
  "typescript": "^5.9.3",
77
- "typescript-eslint": "^8.58.0",
78
- "vite": "^8.0.3",
79
- "vite-plugin-dts": "^4.5.4"
82
+ "typescript-eslint": "^8.59.3",
83
+ "vite": "^8.0.13",
84
+ "vite-plugin-dts": "^5.0.0"
80
85
  }
81
86
  }
@@ -4,7 +4,7 @@ description: LLM chat UI component library. Covers all u-* custom elements for b
4
4
  license: MIT
5
5
  metadata:
6
6
  author: iyulab
7
- version: "0.5.0"
7
+ version: "0.5.2"
8
8
  ---
9
9
 
10
10
  # @iyulab/chat-components
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { UChartView as UChartViewElement } from '../components/views/UChartView';
3
-
4
- export declare const UChartView: React.ForwardRefExoticComponent<
5
- Partial<UChartViewElement> & React.HTMLAttributes<UChartViewElement> & {
6
- }
7
- >;
8
-
9
- export type UChartViewProps = React.ComponentProps<typeof UChartView>;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { createComponent } from '@lit/react';
3
- import { UChartView } from '../components/views/UChartView.js';
4
-
5
- export const UChartView = createComponent({
6
- react: React,
7
- tagName: 'u-chart-view',
8
- elementClass: UChartView,
9
- events: {},
10
- });