@iyulab/components 1.40.0 → 1.40.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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.40.1] - 2026-09-13
4
+
5
+ ### Added
6
+
7
+ - **Development-mode warnings for two states that were silently wrong.** Both are one-shot,
8
+ namespaced `[@iyulab/components]`, and compiled out of production builds (`import.meta.env.DEV`).
9
+ - `u-icon`: when a `name` does not resolve (404, unknown `lib`, unparsable SVG) the icon still
10
+ draws its `fallback` — that is intended — but now says so once per name, with what to check.
11
+ Thirty menu items rendering the same cube with no signal is how this was found.
12
+ - `u-split-panel`: when the host has no height of its own it sits at one line of content (18px
13
+ measured) and anything sized 100% inside its panels collapses; it now says so once and tells
14
+ you to size the host or its parent.
15
+
3
16
  ## [1.40.0] - 2026-09-10
4
17
 
5
18
  ### Changed
@@ -2,6 +2,7 @@ import { UElement } from "../UElement.js";
2
2
  import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorateMetadata.js";
3
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/decorate.js";
4
4
  import { IconRegistry, getDefaultBaseUrl } from "../../utilities/icons.js";
5
+ import "../../utilities/devWarning.js";
5
6
  import { styles } from "./UIcon.styles.js";
6
7
  import { nothing } from "lit";
7
8
  import { customElement, property } from "lit/decorators.js";
@@ -26,12 +27,18 @@ var UIcon = class UIcon extends UElement {
26
27
  }
27
28
  async resolve(name) {
28
29
  let html;
29
- if (this.lib) html = await IconRegistry.resolve(this.lib, name);
30
- else {
30
+ let where;
31
+ if (this.lib) {
32
+ html = await IconRegistry.resolve(this.lib, name);
33
+ where = IconRegistry.has(this.lib) ? `lib "${this.lib}"` : `lib "${this.lib}" (not registered)`;
34
+ } else {
31
35
  const url = `${getDefaultBaseUrl().replace(/\/$/, "")}/${name}.svg`;
32
36
  html = await IconRegistry.resolveUrl(url);
37
+ where = `${url} (no lib given — the default base URL)`;
33
38
  }
34
- return this.sanitize(html);
39
+ const svg = this.sanitize(html);
40
+ if (svg === void 0) `${this.lib ?? ""}${name}`, `${name}${where}`, this.fallback;
41
+ return svg;
35
42
  }
36
43
  sanitize(html) {
37
44
  if (!html) return void 0;
@@ -52,6 +52,12 @@ export declare class USplitPanel extends UElement {
52
52
  protected willUpdate(changedProperties: PropertyValues): void;
53
53
  render(): import('lit-html').TemplateResult<1>;
54
54
  private handleSlotChange;
55
+ /**
56
+ * 호스트에 높이(또는 세로 분할이면 폭) 제약이 없으면 이 컴포넌트는 손잡이 두께로 붕괴한다 —
57
+ * 실측 18px(cycle-565). 호스트가 `overflow: hidden` 이라 패널 내용에 닿을 방법이 없고,
58
+ * 오류도 없다. 첫 배치 뒤 한 번 재서 개발 모드에서 알린다(HD-61 ⒝).
59
+ */
60
+ private warnIfCollapsed;
55
61
  private handleSplitterSlotChange;
56
62
  private appendSplitters;
57
63
  private createSplitter;
@@ -33,6 +33,7 @@ var USplitPanel = class USplitPanel extends UElement {
33
33
  this.panels = slot.assignedElements({ flatten: true }).filter((el) => el instanceof HTMLElement);
34
34
  this.appendSplitters();
35
35
  this.updatePanelLayout();
36
+ this.warnIfCollapsed();
36
37
  };
37
38
  this.handleSplitterSlotChange = (e) => {
38
39
  const slot = e.target;
@@ -241,6 +242,12 @@ var USplitPanel = class USplitPanel extends UElement {
241
242
  </div>
242
243
  `;
243
244
  }
245
+ /**
246
+ * 호스트에 높이(또는 세로 분할이면 폭) 제약이 없으면 이 컴포넌트는 손잡이 두께로 붕괴한다 —
247
+ * 실측 18px(cycle-565). 호스트가 `overflow: hidden` 이라 패널 내용에 닿을 방법이 없고,
248
+ * 오류도 없다. 첫 배치 뒤 한 번 재서 개발 모드에서 알린다(HD-61 ⒝).
249
+ */
250
+ warnIfCollapsed() {}
244
251
  appendSplitters() {
245
252
  const root = this.renderRoot;
246
253
  if (!root) return;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 개발 모드 «사용 안내» 경고 — 오류 경로가 아닌, ***조용히 틀리는*** 상태를 한 번 알린다.
3
+ *
4
+ * 이 패키지에는 같은 모양의 경고가 이미 있다(`UElement.warnIfTokensMissing` — 토큰 시트 부재).
5
+ * 공통 규약: `[@iyulab/components]` 네임스페이스 · 개발 모드에서만(`import.meta.env.DEV`) ·
6
+ * 같은 키로는 **한 번만** · 무엇이 틀렸는지가 아니라 **무엇을 하면 되는지**를 적는다.
7
+ *
8
+ * 이 파일이 생긴 계기: 소비앱의 메뉴 30개가 해석되지 않는 아이콘 이름으로 **한꺼번에 같은
9
+ * 큐브 폴백**을 그렸는데 신호가 0 이었다(docket #265 R3). 폴백은 의도된 것이라(접힌 사이드바에서
10
+ * 아이콘이 없으면 메뉴가 «높이만 있는 빈 줄» 이 된다) 제거가 답이 아니다 — **없는 것은 경고다.**
11
+ * 같은 부류가 셋 더 있었다: 높이 제약이 없어 18px 로 붕괴하는 `u-split-panel`, 가상화가 꺼지는
12
+ * `flex-table`, 133px 로 앉는 `modern-app` 셸 — 모두 «에러 없이 틀린 화면» 이다(HD-61 ⒝).
13
+ */
14
+ /** `key` 당 한 번만, 개발 모드에서만 `console.warn` 한다. 프로덕션 빌드에서는 호출 자체가 no-op 이다. */
15
+ export declare function devWarnOnce(key: string, message: string): void;
16
+ /** 테스트용 — 가드를 비운다. */
17
+ export declare function resetDevWarnings(): void;
@@ -0,0 +1,5 @@
1
+ //#region src/utilities/devWarning.ts
2
+ /** `key` 당 한 번만, 개발 모드에서만 `console.warn` 한다. 프로덕션 빌드에서는 호출 자체가 no-op 이다. */
3
+ function devWarnOnce(key, message) {}
4
+ //#endregion
5
+ export { devWarnOnce };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/components",
3
3
  "description": "web-components library based on lit-element made by iyulab",
4
- "version": "1.40.0",
4
+ "version": "1.40.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "components",