@iyulab/chat-components 0.9.0 → 0.10.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,54 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0] - 2026-08-03
4
+
5
+ ### Fixed
6
+
7
+ - ★**Firefox·Safari 에서 다크 코드블록·다크 마크다운이 적용된 적이 없던 문제.**
8
+
9
+ 두 컴포넌트의 다크 팔레트(구문 강조 15색 · 마크다운 11색)가
10
+ `:host-context([theme="dark"])` **단독**으로 선언돼 있었다. 그 선택자는 크로미움
11
+ 전용이라, 나머지 두 엔진에서는 어두운 코드블록 위에 **라이트용 색이 그대로** 남았다.
12
+
13
+ ```
14
+ u-code-block 구문 강조 15색
15
+ u-marked-block 본문·테두리·강조 11색
16
+ ```
17
+
18
+ 섀도 루트 안에서 문서 루트의 테마를 읽는 수단 중 **상속되는 것은 `color-scheme`** 이고,
19
+ `light-dark()` 가 그 값을 따른다. 테마 시트가 `:root[theme="dark"] { color-scheme: dark }`
20
+ 를 이미 선언하므로 별도 배선이 필요 없다.
21
+
22
+ ⚠**소비자 조치**: 테마 시트를 로드하지 않고 `theme` 속성만 세우고 있다면 다크가
23
+ 적용되지 않는다 — 문서 루트에 `color-scheme: dark` 를 함께 선언할 것.
24
+ `@supports` 가드가 있어 `light-dark()` 미지원 브라우저는 **라이트로 떨어진다**
25
+ (종전 Firefox·Safari 와 같은 결과 — 회귀가 아니다).
26
+
27
+ - **참조 카드 헤더의 포커스 링이 팔레트에 없는 색이었다** — `rgba(100, 150, 250, .6)`
28
+ 를 굽고 있었다. 다른 컴포넌트의 포커스 링과 색이 달랐고 브랜드를 따라오지 않았다.
29
+ 역할 토큰(`--u-primary-color-strong`)을 읽도록 고쳤다 — 디자인 시스템의 전역 포커스 링과
30
+ 같은 값이다.
31
+
32
+ ### Added
33
+
34
+ - **섀도 안 테마 해석 회귀 테스트** — 실제 크로미움에서 `color-scheme` 을 뒤집어
35
+ 구문색·본문색이 따라오는지 확인한다. 커스텀 프로퍼티를 직접 읽지 않고 **그것을 소비하는
36
+ 선언의 계산색**을 재는데, `getComputedStyle().getPropertyValue()` 는 해석된 색이 아니라
37
+ `light-dark(...)` 문자열 그대로를 돌려주기 때문이다.
38
+
39
+ ## [0.9.1] - 2026-08-02
40
+
41
+ ### Fixed
42
+
43
+ - **토큰 폴백 리터럴 9곳이 정본 시트와 어긋나 있던 문제.**
44
+ `var(--u-danger-color, #E53935)` 처럼 배선된 리터럴은 **시트 값의 복제**여야 하는데,
45
+ ⑴ `@iyulab/components` 1.16.0 의 역할 단 재매핑을 받지 못한 값(6곳)과
46
+ ⑵ 애초에 시트에 없던 임의 값(`#4a90e2`·`#f3f4f6`·`rgba(0,0,0,0.02)` — 3곳)이 섞여 있었다.
47
+
48
+ ⚠**이 결함은 개발 환경에서 절대 드러나지 않는다.** 토큰 시트가 있으면 폴백은 아예
49
+ 평가되지 않는다 — 깨지는 곳은 시트를 로드하지 않은 소비자의 화면이고, 우리가 보지
50
+ 못하는 자리다. 모노레포 루트의 `npm run tokens:sync` 가 이제 정본 시트와 대조한다.
51
+
3
52
  ## [0.9.0] - 2026-08-01
4
53
 
5
54
  ### Changed
@@ -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 {
@@ -110,7 +110,7 @@ var styles = css`
110
110
  pointer-events: auto;
111
111
  }
112
112
  .remove-btn:hover {
113
- background-color: var(--u-danger-color, #E53935);
113
+ background-color: var(--u-danger-color, #D32F2F);
114
114
  }
115
115
 
116
116
  /* ─── 미리보기 오버레이 ─── */
@@ -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
 
@@ -41,7 +41,11 @@ var styles = css`
41
41
  font-size: 1em;
42
42
  line-height: 1.5;
43
43
  font-weight: 600;
44
- color: var(--u-text-color-weak);
44
+ /* 여기 color: var(--u-text-color-weak) 가 있었다 — 그런 토큰은 없다
45
+ (올바른 이름은 --u-txt-color-weak). 폴백도 없어 선언이 통째로 무효가 됐고,
46
+ 그래서 위의 color: inherit 과 결과가 같았다. 즉 한 번도 적용된 적이 없는
47
+ 선언이다. 형제 .count 도 inherit 이므로 현재 렌더를 유지하며 죽은 선언만
48
+ 걷는다. 제목을 약한 회색으로 하려던 의도였다면 이름을 고쳐 되살릴 것. */
45
49
  }
46
50
 
47
51
  .count {
@@ -89,7 +89,7 @@ var styles = css`
89
89
  opacity: 0.7;
90
90
  }
91
91
  th[active] {
92
- color: var(--u-primary-color, #4a90e2);
92
+ color: var(--u-primary-color, #1976D2);
93
93
  }
94
94
  th[active] .sort-icon {
95
95
  opacity: 1;
@@ -107,7 +107,7 @@ var styles = css`
107
107
  background-color: var(--u-neutral-0);
108
108
  }
109
109
  tbody tr:hover td {
110
- background-color: var(--u-neutral-50, rgba(0,0,0,0.02));
110
+ background-color: var(--u-neutral-50, #FAFAFA);
111
111
  }
112
112
  tbody tr:last-child td {
113
113
  border-bottom: none;
@@ -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;
@@ -29,7 +29,7 @@ var styles = css`
29
29
  .body[variant="bubble"] {
30
30
  padding: 12px 18px;
31
31
  border-radius: 18px;
32
- background-color: var(--u-neutral-200, #f3f4f6);
32
+ background-color: var(--u-neutral-200, #EEEEEE);
33
33
  }
34
34
  .body[variant="bubble"][position="left"] {
35
35
  border-bottom-left-radius: 4px;
@@ -19,7 +19,7 @@ var styles = css`
19
19
  transition: all 0.2s ease;
20
20
  }
21
21
  a:hover {
22
- color: var(--u-txt-color-hover, #1E88E5);
22
+ color: var(--u-txt-color-hover, #1565C0);
23
23
  background-color: var(--u-neutral-50);
24
24
  }
25
25
 
@@ -59,11 +59,11 @@ var styles = css`
59
59
  white-space: nowrap;
60
60
  }
61
61
  .badge[type="web"] {
62
- color: var(--u-info-color-strong, #1976D2);
62
+ color: var(--u-info-color-strong, #1565C0);
63
63
  background: var(--u-blue-0);
64
64
  }
65
65
  .badge[type="document"] {
66
- color: var(--u-success-color-strong, #388E3C);
66
+ color: var(--u-success-color-strong, #1B5E20);
67
67
  background: var(--u-green-0);
68
68
  }
69
69
  .badge u-icon {
@@ -72,13 +72,13 @@ var styles = css`
72
72
  background: var(--u-red-0);
73
73
  border: 1px solid var(--u-danger-color-weakest, #EF9A9A);
74
74
  border-radius: 6px;
75
- color: var(--u-danger-color-strong, #D32F2F);
75
+ color: var(--u-danger-color-strong, #C62828);
76
76
  font-size: 12px;
77
77
  pointer-events: none;
78
78
  }
79
79
 
80
80
  .error-overlay u-icon {
81
- color: var(--u-danger-color, #E53935);
81
+ color: var(--u-danger-color, #D32F2F);
82
82
  flex-shrink: 0;
83
83
  }
84
84
  `;
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.0",
4
+ "version": "0.10.0",
5
5
  "author": "iyulab",
6
6
  "license": "MIT",
7
7
  "keywords": [