@iyulab/router 0.11.0 → 0.11.2
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 +32 -0
- package/dist/components/UErrorPage.d.ts +9 -0
- package/dist/components/ULink.d.ts +14 -0
- package/dist/index.js +10 -6
- package/dist/react.js +1 -1
- package/dist/share-Ds0NYHr-.js +1167 -0
- package/package.json +3 -2
- package/skills/iyulab-router/references/components.md +20 -0
- package/dist/share-BaGC5VOl.js +0 -245
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.11.2] - 2026-08-25
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`aria-current`/`aria-label` set on `<u-link>` never reached the accessibility tree.** The
|
|
8
|
+
host attribute was present, but the actual interactive node exposed to assistive technology
|
|
9
|
+
is the native `<a>` rendered inside the shadow root — ARIA content attributes on a shadow
|
|
10
|
+
host do not cross the shadow boundary to label or mark current a descendant. Navigation
|
|
11
|
+
links relying on `aria-current="page"` to announce the active item, or on `aria-label` for
|
|
12
|
+
their accessible name, were exposed with neither. `render()` now forwards both host
|
|
13
|
+
attributes onto the internal `<a>`, and changes made after connection are observed and
|
|
14
|
+
re-rendered.
|
|
15
|
+
|
|
16
|
+
## [0.11.1] - 2026-08-20
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **Route matching threw `ReferenceError: URLPattern is not defined` on browsers that ship
|
|
21
|
+
without the URL Pattern API.** The router constructs routes with the global `URLPattern`
|
|
22
|
+
constructor directly; browsers that have not yet shipped it (older Safari and Firefox
|
|
23
|
+
releases are still common in the field) failed synchronously in `new Router(...)`, before
|
|
24
|
+
any route could render. A guarded polyfill (`urlpattern-polyfill`, self-installs only when
|
|
25
|
+
`globalThis.URLPattern` is absent) is now imported by the router's internals, so browsers
|
|
26
|
+
without native support get a working fallback and browsers with native support are
|
|
27
|
+
unaffected at runtime.
|
|
28
|
+
|
|
29
|
+
### Internal
|
|
30
|
+
|
|
31
|
+
- Router's own `URLPattern` construction now runs through a small local type shim — the
|
|
32
|
+
polyfill package's bundled types have not yet caught up to the constructor's `options`
|
|
33
|
+
argument (`ignoreCase`), even though its runtime implementation already supports it.
|
|
34
|
+
|
|
3
35
|
## [0.11.0] - 2026-08-07
|
|
4
36
|
|
|
5
37
|
### Added
|
|
@@ -3,6 +3,15 @@ import { RouteError } from '../types/RouteError.js';
|
|
|
3
3
|
import { TemplateResult } from 'lit-html';
|
|
4
4
|
/**
|
|
5
5
|
* 라우팅 중 발생한 에러 정보를 사용자에게 전달하기 위한 기본 컴포넌트 입니다.
|
|
6
|
+
*
|
|
7
|
+
* `Router`가 `fallback`을 지정하지 않았을 때 내부적으로 그리는 기본 화면이라
|
|
8
|
+
* `src/index.ts`에서 공개 export되지 않는다 — 직접 import해 쓰는 컴포넌트가
|
|
9
|
+
* 아니다. 다만 라우팅 실패 시 실제 DOM에 렌더되므로, 기본 화면의 색만 가볍게
|
|
10
|
+
* 맞추고 싶은 소비자를 위해 세 색상 훅을 남겨 둔다(전체 교체는 `fallback.render`).
|
|
11
|
+
*
|
|
12
|
+
* @cssprop --error-icon-color - 아이콘 색. 기본값 없음(미지정 시 상속된 색 사용)
|
|
13
|
+
* @cssprop --error-code-color - 에러 코드 텍스트 색. 기본값 없음(미지정 시 상속된 색 사용)
|
|
14
|
+
* @cssprop --error-message-color - 에러 메시지 텍스트 색. 기본값 없음(미지정 시 상속된 색 사용)
|
|
6
15
|
*/
|
|
7
16
|
export declare class UErrorPage extends LitElement {
|
|
8
17
|
constructor(error?: RouteError);
|
|
@@ -61,6 +61,20 @@ export declare class ULink extends LitElement {
|
|
|
61
61
|
navigate?: "router" | "document";
|
|
62
62
|
connectedCallback(): void;
|
|
63
63
|
disconnectedCallback(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 호스트에 세팅된 `aria-current`/`aria-label`은 실제 접근 가능한(포커스 대상)
|
|
66
|
+
* 엘리먼트가 아니라 — 그 안쪽 shadow DOM 의 네이티브 `<a>`다. 섀도우 경계를
|
|
67
|
+
* 넘지 않으므로 접근성 트리에 자동 반영되지 않는다(docket #45 실측 — 속성은
|
|
68
|
+
* 붙어 있는데 접근성 트리의 `aria-current`는 계속 비어 있음). `render()`가 이
|
|
69
|
+
* 값을 읽어 내부 `<a>`에 직접 옮긴다.
|
|
70
|
+
*
|
|
71
|
+
* 둘 다 Lit 리액티브 프로퍼티로 선언돼 있지 않아 `observedAttributes`에 없다 —
|
|
72
|
+
* 그 목록에 없는 속성은 `attributeChangedCallback` 자체가 호출되지 않는다
|
|
73
|
+
* (커스텀 엘리먼트 표준 동작). 초기 렌더는 되지만 연결 후 동적 변경은 반영되지
|
|
74
|
+
* 않았다 — 목록에 명시적으로 추가해야 한다.
|
|
75
|
+
*/
|
|
76
|
+
static get observedAttributes(): string[];
|
|
77
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
64
78
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
65
79
|
render(): TemplateResult<1>;
|
|
66
80
|
/** a 태그에 주입할 href 값을 계산합니다. */
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isExternalUrl, i as absolutePath, n as __decorate, o as parseUrl, r as __decorateMetadata, s as UOutlet, t as ULink } from "./share-
|
|
1
|
+
import { a as isExternalUrl, i as absolutePath, n as __decorate, o as parseUrl, r as __decorateMetadata, s as UOutlet, t as ULink } from "./share-Ds0NYHr-.js";
|
|
2
2
|
import { LitElement, css, html } from "lit";
|
|
3
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
4
|
//#region src/types/RouteError.ts
|
|
@@ -289,6 +289,12 @@ function findAnchorFrom(event) {
|
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/internals/route-helpers.ts
|
|
291
291
|
/**
|
|
292
|
+
* `urlpattern-polyfill`의 번들 타입 선언이 `options` 인자를 아직 반영하지 않는다(런타임
|
|
293
|
+
* 구현은 WHATWG 스펙대로 `ignoreCase`를 지원한다 — `dist/index.js`의 3항 생성자 실측
|
|
294
|
+
* 확인됨). 그 타입 공백만 좁혀서 캐스트한다.
|
|
295
|
+
*/
|
|
296
|
+
var createURLPattern = URLPattern;
|
|
297
|
+
/**
|
|
292
298
|
* 라우트들을 다음 사항에 따라 재귀적으로 재설정합니다.
|
|
293
299
|
* - 각 라우트에 고유 `id`를 랜덤하게 부여합니다.
|
|
294
300
|
* - `path`를 URLPattern 객체로 변환합니다.
|
|
@@ -303,13 +309,11 @@ function setRoutes(routes, basepath) {
|
|
|
303
309
|
route.id ||= getRandomID();
|
|
304
310
|
route.ignoreCase ||= false;
|
|
305
311
|
if (route.index === true) {
|
|
306
|
-
route.path = new
|
|
312
|
+
route.path = new createURLPattern({ pathname: `${basepath}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
307
313
|
route.force ||= true;
|
|
308
314
|
} else {
|
|
309
|
-
if (typeof route.path === "string") {
|
|
310
|
-
|
|
311
|
-
route.path = new URLPattern({ pathname: `${absolutePathStr}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
312
|
-
} else if (route.path instanceof URLPattern) {} else route.path = new URLPattern({ pathname: `${basepath}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
315
|
+
if (typeof route.path === "string") route.path = new createURLPattern({ pathname: `${absolutePath(basepath, route.path)}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
316
|
+
else if (route.path instanceof URLPattern) {} else route.path = new createURLPattern({ pathname: `${basepath}{/}?` }, { ignoreCase: route.ignoreCase });
|
|
313
317
|
if (route.children && route.children.length > 0) {
|
|
314
318
|
const childBasepath = route.path.pathname.replace("{/}?", "");
|
|
315
319
|
route.children = setRoutes(route.children, childBasepath);
|
package/dist/react.js
CHANGED