@iyulab/chat-components 0.7.0 → 0.7.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.1] - 2026-07-12
4
+
5
+ ### Fixed
6
+
7
+ - `u-ref-card`: no longer logs a spurious `Missing <script type="application/json">` console error on every render when driven by property bindings (the pattern `u-ref-block` itself uses). `URefCard` now overrides `UDataElement.load()` to skip JSON loading gracefully when neither a `data` argument nor a `<script type="application/json">` child is present; the script-payload path (used by `u-marked-block` reference tooltips via `URefCard.buildHTML`) is unaffected. Cards always rendered correctly — the error was cosmetic console noise, but it fired once per reference card per message in downstream consoles. (Reported by the Filer project.)
8
+ - `URefCard`'s redundant `error()` override was removed — since 0.7.0 the `UDataElement` base logs to the console without rendering an error card, so the override duplicated base behavior. Genuine load errors now log as `failed to load data for [u-ref-card]` instead of `Error in URefCard:`.
9
+
10
+ ### Added
11
+
12
+ - Browser-mode regression tests (vitest + playwright, matching the `@iyulab/components` test setup) covering both `u-ref-card` data paths and the `u-ref-block` sources rendering acceptance criteria.
13
+
3
14
  ## [0.7.0] - 2026-07-07
4
15
 
5
16
  ### Changed
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
1
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/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.138.0/helpers/esm/decorateMetadata.js
1
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/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
  }
@@ -11,6 +11,10 @@ import { UElement } from '@iyulab/components/dist/components/UElement.js';
11
11
  * ```
12
12
  *
13
13
  * JSON 최상위 키가 컴포넌트의 프로퍼티 이름과 일치하면 자동으로 할당됩니다.
14
+ *
15
+ * script 페이로드 없이 property 바인딩만으로도 사용되는 서브클래스는
16
+ * `load()`를 오버라이드해 script 부재 시 조용히 건너뛰어야 합니다.
17
+ * (예: `URefCard` — URefBlock의 property 구동과 UMarkedBlock의 script 주입을 모두 지원)
14
18
  */
15
19
  export declare class UDataElement extends UElement {
16
20
  static styles: import('lit').CSSResultGroup;
@@ -13,6 +13,10 @@ import { UElement } from "@iyulab/components/dist/components/UElement.js";
13
13
  * ```
14
14
  *
15
15
  * JSON 최상위 키가 컴포넌트의 프로퍼티 이름과 일치하면 자동으로 할당됩니다.
16
+ *
17
+ * script 페이로드 없이 property 바인딩만으로도 사용되는 서브클래스는
18
+ * `load()`를 오버라이드해 script 부재 시 조용히 건너뛰어야 합니다.
19
+ * (예: `URefCard` — URefBlock의 property 구동과 UMarkedBlock의 script 주입을 모두 지원)
16
20
  */
17
21
  var UDataElement = class extends UElement {
18
22
  static {
@@ -1,7 +1,7 @@
1
1
  import "../../utilities/icons.js";
2
2
  import { styles } from "./UCodeBlock.styles.js";
3
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
4
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
3
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
4
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
5
5
  import { html } from "lit";
6
6
  import { customElement, property } from "lit/decorators.js";
7
7
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import { UDataElement } from "../UDataElement.js";
4
4
  import { styles } from "./UElementBlock.styles.js";
5
5
  import { html, nothing } from "lit";
@@ -1,6 +1,6 @@
1
1
  import "../../utilities/icons.js";
2
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import { styles } from "./UFileBlock.styles.js";
5
5
  import { html, nothing } from "lit";
6
6
  import { customElement, property, state } from "lit/decorators.js";
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import "./UCodeBlock.js";
4
4
  import { escapeHtmlText, stripZeroWidth } from "../../utilities/sanitizers.js";
5
5
  import { HtmlBuilder } from "../../utilities/HtmlBuilder.js";
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import "../references/URefCard.js";
4
4
  import { styles } from "./URefBlock.styles.js";
5
5
  import { html } from "lit";
@@ -1,6 +1,6 @@
1
1
  import "../../utilities/icons.js";
2
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import { UDataElement } from "../UDataElement.js";
5
5
  import { styles } from "./UTableBlock.styles.js";
6
6
  import { html } from "lit";
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/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.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/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,6 +1,6 @@
1
1
  import "../../utilities/icons.js";
2
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import "../blocks/UFileBlock.js";
5
5
  import { styles } from "./UPrompt.styles.js";
6
6
  import { html } from "lit";
@@ -17,10 +17,11 @@ export declare class URefCard extends UDataElement {
17
17
  tags?: string[];
18
18
  render(): import('lit-html').TemplateResult<1>;
19
19
  /**
20
- * UDataElement의 기본 동작을 오버라이드하여 에러를 처리합니다.
21
- * 콘솔 출력만 수행합니다.
20
+ * script-payload(UMarkedBlock 툴팁)와 property 바인딩(URefBlock) 두 사용
21
+ * 패턴을 모두 지원합니다. script 자식이 없으면 property 기반 렌더로
22
+ * 간주하고 조용히 건너뜁니다.
22
23
  */
23
- protected error(error: unknown): Promise<void>;
24
+ protected load(data?: object): Promise<void>;
24
25
  /** 링크 클릭 핸들러 */
25
26
  private handleAnchorClick;
26
27
  /** URL에서 Google의 파비콘 URL을 반환합니다. */
@@ -1,6 +1,6 @@
1
1
  import "../../utilities/icons.js";
2
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import { UDataElement } from "../UDataElement.js";
5
5
  import { styles } from "./URefCard.styles.js";
6
6
  import { html } from "lit";
@@ -53,11 +53,13 @@ var URefCard = class URefCard extends UDataElement {
53
53
  `;
54
54
  }
55
55
  /**
56
- * UDataElement의 기본 동작을 오버라이드하여 에러를 처리합니다.
57
- * 콘솔 출력만 수행합니다.
56
+ * script-payload(UMarkedBlock 툴팁)와 property 바인딩(URefBlock) 두 사용
57
+ * 패턴을 모두 지원합니다. script 자식이 없으면 property 기반 렌더로
58
+ * 간주하고 조용히 건너뜁니다.
58
59
  */
59
- error(error) {
60
- return Promise.resolve(console.error("Error in URefCard:", error));
60
+ async load(data) {
61
+ if (!data && !this.querySelector("script[type=\"application/json\"]")) return;
62
+ return super.load(data);
61
63
  }
62
64
  /** 링크 클릭 핸들러 */
63
65
  handleAnchorClick(e) {
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import { URefCard } from "./URefCard.js";
4
4
  import { styles } from "./URefCardGroup.styles.js";
5
5
  import { html } from "lit";
@@ -1,6 +1,6 @@
1
1
  import "../../utilities/icons.js";
2
- import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import { styles } from "./URefTag.styles.js";
5
5
  import { html } from "lit";
6
6
  import { customElement, property } from "lit/decorators.js";
@@ -1,6 +1,6 @@
1
1
  import "../utilities/icons.js";
2
- import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
3
- import __decorate from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
2
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
3
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
4
4
  import { styles } from "./UChartBlock.styles.js";
5
5
  import { html, nothing } from "lit";
6
6
  import { customElement, property, query, state } from "lit/decorators.js";
@@ -1,5 +1,5 @@
1
- import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import { styles } from "./UImagesBlock.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.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import { styles } from "./UMapBlock.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.138.0/helpers/esm/decorateMetadata.js";
2
- import __decorate from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
1
+ import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorateMetadata.js";
2
+ import __decorate from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
3
3
  import { styles } from "./UVideoBlock.styles.js";
4
4
  import { html, nothing } from "lit";
5
5
  import { customElement, property } from "lit/decorators.js";
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.7.0",
4
+ "version": "0.7.1",
5
5
  "author": "iyulab",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -38,7 +38,9 @@
38
38
  },
39
39
  "scripts": {
40
40
  "start": "vite",
41
- "build": "eslint && vite build"
41
+ "build": "eslint && vite build",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest"
42
44
  },
43
45
  "dependencies": {
44
46
  "@iyulab/components": "^1.5.0",
@@ -67,6 +69,7 @@
67
69
  "devDependencies": {
68
70
  "@eslint/js": "^9.39.4",
69
71
  "@types/node": "^26.1.0",
72
+ "@vitest/browser-playwright": "^4.1.10",
70
73
  "chart.js": "^4.5.1",
71
74
  "eslint": "^9.39.4",
72
75
  "eslint-plugin-lit": "^2.3.1",
@@ -76,6 +79,7 @@
76
79
  "typescript": "^5.9.3",
77
80
  "typescript-eslint": "^8.63.0",
78
81
  "vite": "^8.1.3",
79
- "vite-plugin-dts": "^5.0.3"
82
+ "vite-plugin-dts": "^5.0.3",
83
+ "vitest": "^4.1.10"
80
84
  }
81
85
  }