@wcstack/router 4.28.0 → 4.30.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/dist/index.esm.js CHANGED
@@ -78,7 +78,7 @@ function setConfig(partialConfig) {
78
78
  }
79
79
 
80
80
  var name = "@wcstack/router";
81
- var version = "4.28.0";
81
+ var version = "4.30.0";
82
82
  var pkg = {
83
83
  name: name,
84
84
  version: version};
@@ -4186,7 +4186,7 @@ class Router extends HTMLElement {
4186
4186
  const MIRRORED_ATTRIBUTES = ['title', 'rel', 'target', 'download', 'hreflang', 'lang', 'dir'];
4187
4187
  class Link extends HTMLElement {
4188
4188
  static get observedAttributes() {
4189
- return ['to', 'match', 'query-keys', ...MIRRORED_ATTRIBUTES];
4189
+ return ['to', 'match', 'query-keys', 'current', ...MIRRORED_ATTRIBUTES];
4190
4190
  }
4191
4191
  _childNodeArray = [];
4192
4192
  _uuid = getUUID();
@@ -4444,7 +4444,7 @@ class Link extends HTMLElement {
4444
4444
  this._router = null;
4445
4445
  }
4446
4446
  attributeChangedCallback(name, oldValue, newValue) {
4447
- if ((name === 'match' || name === 'query-keys') && oldValue !== newValue) {
4447
+ if ((name === 'match' || name === 'query-keys' || name === 'current') && oldValue !== newValue) {
4448
4448
  // anchor 生成前(upgrade の属性の通知 — まだ router の下に居ないことがある)は接続時の判定に任せる
4449
4449
  if (this._anchorElement) {
4450
4450
  this._updateActiveState();
@@ -4518,7 +4518,10 @@ class Link extends HTMLElement {
4518
4518
  this._anchorElement.classList.add('active');
4519
4519
  // 修理・既定オン(docs/a11y-design.md §3-3): active class と同じ事実の ARIA 表現。
4520
4520
  // 鮮度保証は active class と同一(同じ分岐・同じ呼び出し経路)。
4521
- this._anchorElement.setAttribute('aria-current', exact ? 'page' : 'true');
4521
+ // `current`: active のときに付ける aria-current の値を名指す("page" なら、下のパスでも「現在のページ」—
4522
+ // 「一覧」のリンクを詳細のページでもそう読ませたいナビ。docs/seam-apps.md、street-reports)。無ければ
4523
+ // 今までどおり: そのページそのものは "page"、下のパスや query-keys の一致は "true"
4524
+ this._anchorElement.setAttribute('aria-current', this.getAttribute('current') || (exact ? 'page' : 'true'));
4522
4525
  }
4523
4526
  else {
4524
4527
  this._anchorElement.classList.remove('active');