@iyulab/chat-components 0.5.2 → 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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/_virtual/{_@oxc-project_runtime@0.128.0 → _@oxc-project_runtime@0.130.0}/helpers/decorate.js +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.128.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 +2 -2
  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 +2 -2
  10. package/dist/components/blocks/URefBlock.js +2 -2
  11. package/dist/components/blocks/UTableBlock.js +2 -2
  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 +2 -2
  21. package/dist/components/references/URefCard.js +2 -2
  22. package/dist/components/references/URefCardGroup.js +2 -2
  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 +3 -3
  34. package/dist/types/Views.d.ts +2 -2
  35. package/dist/types/Views.js +9 -11
  36. package/dist/utilities/ViewPromptBuilder.js +4 -2
  37. package/package.json +12 -7
  38. package/dist/react/UChartView.d.ts +0 -9
  39. package/dist/react/UChartView.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
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
+
3
29
  ## [0.5.2] - 2026-05-08
4
30
 
5
31
  ### Changed
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.128.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.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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";
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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";
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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";
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
3
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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";
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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";
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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.128.0/helpers/decorateMetadata.js";
2
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.128.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';
@@ -2,13 +2,13 @@
2
2
  /** 프리셋 Intent 비트 플래그 */
3
3
  var PresetIntent = /* @__PURE__ */ function(PresetIntent) {
4
4
  PresetIntent[PresetIntent["Questions"] = 1] = "Questions";
5
- PresetIntent[PresetIntent["All"] = PresetIntent.Questions] = "All";
5
+ PresetIntent[PresetIntent["All"] = 1] = "All";
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 비트 플래그
@@ -11,23 +10,23 @@ var PresetView = /* @__PURE__ */ function(PresetView) {
11
10
  PresetView[PresetView["Video"] = 2] = "Video";
12
11
  PresetView[PresetView["Map"] = 8] = "Map";
13
12
  PresetView[PresetView["Chart"] = 16] = "Chart";
14
- PresetView[PresetView["All"] = PresetView.Images | PresetView.Video | PresetView.Map | PresetView.Chart] = "All";
13
+ PresetView[PresetView["All"] = 27] = "All";
15
14
  return PresetView;
16
15
  }({});
17
16
  /**
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: {
@@ -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.2",
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,10 +45,11 @@
41
45
  "build": "eslint && vite build"
42
46
  },
43
47
  "dependencies": {
44
- "@iyulab/components": "^1.0.5",
48
+ "@iyulab/components": "^1.0.6",
45
49
  "highlight.js": "^11.11.1",
46
50
  "html2canvas": "^1.4.1",
47
- "lit": "^3.3.2",
51
+ "katex": "^0.16.0",
52
+ "lit": "^3.3.3",
48
53
  "marked": "^18.0.3",
49
54
  "marked-katex-extension": "^5.1.8"
50
55
  },
@@ -66,16 +71,16 @@
66
71
  },
67
72
  "devDependencies": {
68
73
  "@eslint/js": "^9.39.4",
69
- "@types/node": "^25.6.2",
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
79
  "globals": "^17.6.0",
75
80
  "openai": "^6.37.0",
76
81
  "typescript": "^5.9.3",
77
- "typescript-eslint": "^8.59.2",
78
- "vite": "^8.0.11",
82
+ "typescript-eslint": "^8.59.3",
83
+ "vite": "^8.0.13",
79
84
  "vite-plugin-dts": "^5.0.0"
80
85
  }
81
86
  }
@@ -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
- });