@iyulab/chat-components 0.9.1 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.11.0] - 2026-08-04
4
+
5
+ ### Changed
6
+
7
+ - **로딩 자리표시자를 `u-skeleton[lines]` 로 회수했다** (표 블록 · 엘리먼트 블록).
8
+ 폭만 다른 막대 **9줄을 손으로 반복**하던 자리이며, 렌더 결과는 같다(마지막 줄이 짧아지는
9
+ 것은 종전 마크업도 그렇게 적고 있었다). `@iyulab/components >= 1.23.0` 이 필요하다.
10
+
11
+ - ⚠**차트 오류 문구가 «영어 기본 + 로케일 레지스트리»로 이주했다.** `Canvas 2D context` 실패
12
+ 안내가 한국어 리터럴이었다 — 화면에 그대로 뜨는 문자열이다.
13
+
14
+ ```ts
15
+ import { Locale } from '@iyulab/components';
16
+ import { messages } from '@iyulab/chat-components';
17
+
18
+ Locale.set('ko'); // 한국어 환경은 종전 문구를 본다
19
+ messages.register('ja', { canvasUnavailable: '…' });
20
+ ```
21
+
22
+ ⚠**한 키뿐인데 레지스트리를 둔 이유**: 영어 리터럴만으로는 한국어 앱이 그 문구를 되돌릴
23
+ 방법이 없다. 표준은 *"영어 기본 **+ 레지스트리**"* 다.
24
+
25
+ ### Requires
26
+
27
+ - `@iyulab/components >= 1.23.0` (`Locale.namespace`) — 의존 하한을 올렸다.
28
+
29
+ ## [0.10.0] - 2026-08-03
30
+
31
+ ### Fixed
32
+
33
+ - ★**Firefox·Safari 에서 다크 코드블록·다크 마크다운이 적용된 적이 없던 문제.**
34
+
35
+ 두 컴포넌트의 다크 팔레트(구문 강조 15색 · 마크다운 11색)가
36
+ `:host-context([theme="dark"])` **단독**으로 선언돼 있었다. 그 선택자는 크로미움
37
+ 전용이라, 나머지 두 엔진에서는 어두운 코드블록 위에 **라이트용 색이 그대로** 남았다.
38
+
39
+ ```
40
+ u-code-block 구문 강조 15색
41
+ u-marked-block 본문·테두리·강조 11색
42
+ ```
43
+
44
+ 섀도 루트 안에서 문서 루트의 테마를 읽는 수단 중 **상속되는 것은 `color-scheme`** 이고,
45
+ `light-dark()` 가 그 값을 따른다. 테마 시트가 `:root[theme="dark"] { color-scheme: dark }`
46
+ 를 이미 선언하므로 별도 배선이 필요 없다.
47
+
48
+ ⚠**소비자 조치**: 테마 시트를 로드하지 않고 `theme` 속성만 세우고 있다면 다크가
49
+ 적용되지 않는다 — 문서 루트에 `color-scheme: dark` 를 함께 선언할 것.
50
+ `@supports` 가드가 있어 `light-dark()` 미지원 브라우저는 **라이트로 떨어진다**
51
+ (종전 Firefox·Safari 와 같은 결과 — 회귀가 아니다).
52
+
53
+ - **참조 카드 헤더의 포커스 링이 팔레트에 없는 색이었다** — `rgba(100, 150, 250, .6)`
54
+ 를 굽고 있었다. 다른 컴포넌트의 포커스 링과 색이 달랐고 브랜드를 따라오지 않았다.
55
+ 역할 토큰(`--u-primary-color-strong`)을 읽도록 고쳤다 — 디자인 시스템의 전역 포커스 링과
56
+ 같은 값이다.
57
+
58
+ ### Added
59
+
60
+ - **섀도 안 테마 해석 회귀 테스트** — 실제 크로미움에서 `color-scheme` 을 뒤집어
61
+ 구문색·본문색이 따라오는지 확인한다. 커스텀 프로퍼티를 직접 읽지 않고 **그것을 소비하는
62
+ 선언의 계산색**을 재는데, `getComputedStyle().getPropertyValue()` 는 해석된 색이 아니라
63
+ `light-dark(...)` 문자열 그대로를 돌려주기 때문이다.
64
+
3
65
  ## [0.9.1] - 2026-08-02
4
66
 
5
67
  ### Fixed
@@ -18,22 +18,40 @@ var styles = css`
18
18
  --hljs-deletion-color: #b31d28;
19
19
  --hljs-deletion-bg-color: #ffeef0;
20
20
  }
21
- :host-context([theme="dark"]) {
22
- --hljs-text-color: #c9d1d9;
23
- --hljs-background-color: #0d1117;
24
- --hljs-keyword-color: #ff7b72;
25
- --hljs-entity-color: #d2a8ff;
26
- --hljs-constant-color: #79c0ff;
27
- --hljs-string-color: #a5d6ff;
28
- --hljs-variable-color: #ffa657;
29
- --hljs-comment-color: #8b949e;
30
- --hljs-entity-tag-color: #7ee787;
31
- --hljs-markup-heading-color: #1f6feb;
32
- --hljs-markup-list-color: #f2cc60;
33
- --hljs-addition-color: #aff5b4;
34
- --hljs-addition-bg-color: #033a16;
35
- --hljs-deletion-color: #ffdcd7;
36
- --hljs-deletion-bg-color: #67060c;
21
+ /* ★다크 팔레트는 light-dark() 로 싣는다 — 종전에는 :host-context([theme="dark"]) 였고,
22
+ 그 선택자는 **Firefox·Safari 에서 미지원**이라 두 브라우저에서 다크 구문 강조가 적용된
23
+ 적이 없다(라이트용 색이 어두운 코드블록 위에 그대로 남았다).
24
+
25
+ 왜 light-dark() 인가: 테마 표시(theme 속성)는 문서 루트에 있고 이 팔레트는 섀도 루트
26
+ 안에 있다. 그 경계를 넘는 수단 중 상속되는 것은 color-scheme 뿐이고, 토큰 시트가
27
+ :root[theme="dark"] { color-scheme: dark } 로 이미 선언한다 — 상속 프로퍼티라
28
+ 섀도 안까지 닿는다.
29
+
30
+ ⚠**:host 에 color-scheme 을 선언하지 말 것.** 선언하면 루트에서 상속받은 값을 덮어
31
+ OS 선호를 따르게 되어, 앱이 라이트인데 OS 가 다크면 코드블록만 어두워진다.
32
+
33
+ ⚠**이 방식을 --u-* 디자인 토큰으로 확대하지 말 것.** getComputedStyle 로 읽는 소비자
34
+ (같은 패키지의 UChartBlock 이 Chart.js 기본값을 그렇게 세팅한다)에게는 해석된 색이
35
+ 아니라 light-dark(...) **문자열 그대로** 돌아온다. 여기 팔레트는 CSS 안에서만 쓰이므로
36
+ 안전하다. */
37
+ @supports (color: light-dark(#000, #fff)) {
38
+ :host {
39
+ --hljs-text-color: light-dark(#24292e, #c9d1d9);
40
+ --hljs-background-color: light-dark(#ffffff, #0d1117);
41
+ --hljs-keyword-color: light-dark(#d73a49, #ff7b72);
42
+ --hljs-entity-color: light-dark(#6f42c1, #d2a8ff);
43
+ --hljs-constant-color: light-dark(#005cc5, #79c0ff);
44
+ --hljs-string-color: light-dark(#032f62, #a5d6ff);
45
+ --hljs-variable-color: light-dark(#e36209, #ffa657);
46
+ --hljs-comment-color: light-dark(#6a737d, #8b949e);
47
+ --hljs-entity-tag-color: light-dark(#22863a, #7ee787);
48
+ --hljs-markup-heading-color: light-dark(#005cc5, #1f6feb);
49
+ --hljs-markup-list-color: light-dark(#735c0f, #f2cc60);
50
+ --hljs-addition-color: light-dark(#22863a, #aff5b4);
51
+ --hljs-addition-bg-color: light-dark(#f0fff4, #033a16);
52
+ --hljs-deletion-color: light-dark(#b31d28, #ffdcd7);
53
+ --hljs-deletion-bg-color: light-dark(#ffeef0, #67060c);
54
+ }
37
55
  }
38
56
 
39
57
  :host {
@@ -39,11 +39,7 @@ var UElementBlock = class UElementBlock extends UDataElement {
39
39
  <u-skeleton effect="shimmer" width="40%" height="0.75em" shape="rounded"></u-skeleton>
40
40
  </div>
41
41
  <div class="sk-doc">
42
- <u-skeleton effect="shimmer" width="40%" height="0.75em" shape="rounded"></u-skeleton>
43
- <u-skeleton effect="shimmer" width="80%" height="0.75em" shape="rounded"></u-skeleton>
44
- <u-skeleton effect="shimmer" width="60%" height="0.8em" shape="rounded"></u-skeleton>
45
- <u-skeleton effect="shimmer" width="100%" height="0.8em" shape="rounded"></u-skeleton>
46
- <u-skeleton effect="shimmer" width="80%" height="0.8em" shape="rounded"></u-skeleton>
42
+ <u-skeleton effect="shimmer" lines="5" height="0.8em" shape="rounded"></u-skeleton>
47
43
  </div>
48
44
  </div>`;
49
45
  if (this.element != null) return this.element;
@@ -25,18 +25,23 @@ var styles = css`
25
25
  --borderColor-muted: #d1d9e0b3;
26
26
  --borderColor-neutral-muted: #d1d9e0b3;
27
27
  }
28
- :host-context([theme="dark"]) {
29
- --focus-outlineColor: #1f6feb;
30
- --fgColor-default: #f0f6fc;
31
- --fgColor-muted: #9198a1;
32
- --fgColor-accent: #4493f8;
33
- --bgColor-default: #0d1117;
34
- --bgColor-muted: #151b23;
35
- --bgColor-neutral-muted: #656c7633;
36
- --bgColor-attention-muted: #bb800926;
37
- --borderColor-default: #3d444d;
38
- --borderColor-muted: #3d444db3;
39
- --borderColor-neutral-muted: #3d444db3;
28
+ /* ★다크 팔레트는 light-dark() 로 — 근거는 UCodeBlock.styles.ts 의 같은 자리 주석 참조.
29
+ :host-context() 가 Firefox·Safari 미지원이라 두 브라우저에서 마크다운 본문의 다크가
30
+ 적용된 적이 없다. */
31
+ @supports (color: light-dark(#000, #fff)) {
32
+ :host {
33
+ --focus-outlineColor: light-dark(#0969da, #1f6feb);
34
+ --fgColor-default: light-dark(#1f2328, #f0f6fc);
35
+ --fgColor-muted: light-dark(#59636e, #9198a1);
36
+ --fgColor-accent: light-dark(#0969da, #4493f8);
37
+ --bgColor-default: light-dark(#ffffff, #0d1117);
38
+ --bgColor-muted: light-dark(#f6f8fa, #151b23);
39
+ --bgColor-neutral-muted: light-dark(#818b981f, #656c7633);
40
+ --bgColor-attention-muted: light-dark(#fff8c5, #bb800926);
41
+ --borderColor-default: light-dark(#d1d9e0, #3d444d);
42
+ --borderColor-muted: light-dark(#d1d9e0b3, #3d444db3);
43
+ --borderColor-neutral-muted: light-dark(#d1d9e0b3, #3d444db3);
44
+ }
40
45
  }
41
46
 
42
47
  :host {
@@ -23,7 +23,7 @@ var styles = css`
23
23
  color: var(--u-txt-color-hover);
24
24
  }
25
25
  .header:focus-visible {
26
- outline: 2px solid rgba(100, 150, 250, 0.6);
26
+ outline: 2px solid var(--u-primary-color-strong, #1565C0);
27
27
  outline-offset: 2px;
28
28
  }
29
29
 
@@ -83,10 +83,7 @@ var UTableBlock = class UTableBlock extends UDataElement {
83
83
  ${this.loading ? html`
84
84
  <tr>
85
85
  <td colspan=${this.headers.length || 1}>
86
- <u-skeleton width="80%" height="1.2em"></u-skeleton>
87
- <u-skeleton width="60%" height="1.2em"></u-skeleton>
88
- <u-skeleton width="70%" height="1.2em"></u-skeleton>
89
- <u-skeleton width="50%" height="1.2em"></u-skeleton>
86
+ <u-skeleton lines="4" height="1.2em"></u-skeleton>
90
87
  </td>
91
88
  </tr>
92
89
  ` : repeat(rows, (_, i) => i, (row) => html`
@@ -51,7 +51,6 @@ var styles = css`
51
51
  visibility: hidden;
52
52
  position: relative;
53
53
  display: block;
54
- color: red;
55
54
 
56
55
  /* 동일 스타일 크기 싱크 */
57
56
  margin: 0;
@@ -1,6 +1,7 @@
1
1
  import "../utilities/icons.js";
2
2
  import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/decorateMetadata.js";
3
3
  import __decorate from "../_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/decorate.js";
4
+ import { messages } from "../utilities/messages.js";
4
5
  import { styles } from "./UChartBlock.styles.js";
5
6
  import { html, nothing } from "lit";
6
7
  import { customElement, property, query, state } from "lit/decorators.js";
@@ -77,7 +78,7 @@ var UChartBlock = class UChartBlock extends UElement {
77
78
  this.error = null;
78
79
  const ctx = this.canvas.getContext("2d");
79
80
  if (!ctx) {
80
- this.error = "Canvas 2D context를 가져올 수 없습니다.";
81
+ this.error = messages.text("canvasUnavailable");
81
82
  return;
82
83
  }
83
84
  try {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `@iyulab/chat-components` 의 화면 문자열 — **영어 기본 + 로케일 레지스트리**.
3
+ *
4
+ * ⚠**지금 한 키뿐이다.** 그래도 리터럴을 영어로 바꾸는 대신 레지스트리를 두는 이유는,
5
+ * 이 리포가 채택한 표준이 *"영어 기본 **+ 레지스트리**"* 이기 때문이다 — 영어 리터럴만으로는
6
+ * 한국어 앱이 그 문구를 되돌릴 방법이 없다. 다음 문자열은 여기로 온다.
7
+ */
8
+ export type ChatMessageKey = 'canvasUnavailable';
9
+ export declare const messages: import('@iyulab/components/dist/utilities/Locale.js').LocaleNamespace<"canvasUnavailable">;
@@ -0,0 +1,7 @@
1
+ import { Locale } from "@iyulab/components/dist/utilities/Locale.js";
2
+ //#region src/utilities/messages.ts
3
+ var messages = Locale.namespace("@iyulab/chat-components");
4
+ messages.register("en", { canvasUnavailable: "Canvas 2D context is unavailable." });
5
+ messages.register("ko", { canvasUnavailable: "Canvas 2D context를 가져올 수 없습니다." });
6
+ //#endregion
7
+ export { messages };
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.9.1",
4
+ "version": "0.11.0",
5
5
  "author": "iyulab",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -45,7 +45,7 @@
45
45
  "lint:fix": "eslint src/ --fix"
46
46
  },
47
47
  "dependencies": {
48
- "@iyulab/components": "^1.8.0",
48
+ "@iyulab/components": "^1.23.0",
49
49
  "highlight.js": "^11.11.1",
50
50
  "katex": "^0.17.0",
51
51
  "lit": "^3.3.3",