@iyulab/modern-app 0.42.1 → 0.42.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.42.2] - 2026-10-07
4
+
5
+ ### Fixed
6
+
7
+ - The sidebar layout registers the `u-progress-bar` it renders with an explicit import. It imported `UProgressBar` for
8
+ a type only, and the published module kept the import by accident (decorator metadata).
9
+
3
10
  ## [0.42.1] - 2026-10-07
4
11
 
5
12
  ### Fixed
@@ -24,16 +24,16 @@ import "@iyulab/components/dist/components/menu-item/UMenuItem.js";
24
24
  import { createDevWarner as v } from "@iyulab/components/dist/utilities/devWarning.js";
25
25
  import { isFocusCandidate as y, querySelectorDeep as b } from "@iyulab/components/dist/utilities/elements.js";
26
26
  import { OverlayManager as x } from "@iyulab/components/dist/utilities/OverlayManager.js";
27
- import { UProgressBar as S } from "@iyulab/components/dist/components/progress-bar/UProgressBar.js";
27
+ import "@iyulab/components/dist/components/progress-bar/UProgressBar.js";
28
28
  //#region src/layouts/SidebarLayout.ts
29
- var C, w = v("@iyulab/modern-app"), T = 0;
30
- function E(e) {
29
+ var S, C = v("@iyulab/modern-app"), w = 0;
30
+ function T(e) {
31
31
  let t = e.tagName;
32
32
  if (t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable) return !0;
33
33
  let n = e.getAttribute("role");
34
34
  return n === "textbox" || n === "searchbox" || n === "combobox" || n === "spinbutton";
35
35
  }
36
- var D = /* @__PURE__ */ new Set([
36
+ var E = /* @__PURE__ */ new Set([
37
37
  "button",
38
38
  "link",
39
39
  "checkbox",
@@ -46,27 +46,27 @@ var D = /* @__PURE__ */ new Set([
46
46
  "tab",
47
47
  "treeitem"
48
48
  ]);
49
- function O(e) {
49
+ function D(e) {
50
50
  let t = e.tagName;
51
- return t === "BUTTON" || t === "SUMMARY" || t === "A" && e.hasAttribute("href") ? !0 : D.has(e.getAttribute("role") ?? "");
51
+ return t === "BUTTON" || t === "SUMMARY" || t === "A" && e.hasAttribute("href") ? !0 : E.has(e.getAttribute("role") ?? "");
52
52
  }
53
- function k(e) {
53
+ function O(e) {
54
54
  let t = getComputedStyle(e);
55
55
  return (t.overflowY === "auto" || t.overflowY === "scroll") && e.scrollHeight > e.clientHeight;
56
56
  }
57
- function A(e, t) {
57
+ function k(e, t) {
58
58
  for (let n of e) if (n instanceof HTMLElement) {
59
- if (k(n)) return n === t;
59
+ if (O(n)) return n === t;
60
60
  if (n === t) break;
61
61
  }
62
62
  return !0;
63
63
  }
64
- function j() {
64
+ function A() {
65
65
  let e = document.activeElement;
66
66
  for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
67
67
  return e;
68
68
  }
69
- function M(e, t) {
69
+ function j(e, t) {
70
70
  let n = t;
71
71
  for (; n;) {
72
72
  if (n === e) return !0;
@@ -74,12 +74,12 @@ function M(e, t) {
74
74
  }
75
75
  return !1;
76
76
  }
77
- var N = class extends i {
77
+ var M = class extends i {
78
78
  static {
79
- C = this;
79
+ S = this;
80
80
  }
81
81
  constructor(...t) {
82
- super(...t), this.state = "default", this.counts = {}, this.locale = "", this.hasOverlay = !1, this.openMenu = null, this.menuIds = /* @__PURE__ */ new WeakMap(), this.hasNotice = !1, this.routeLoading = !1, this.mainTabStop = !1, this.overlayTrigger = null, this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : void 0, this.currentPath = null, this.unsizedWarnKey = `unsized:${++T}`, this.isMatchedLink = (e) => this.currentPath === null || !e ? !1 : (e = typeof e == "string" ? new URLPattern(e, window.location.origin) : e, e.test(this.currentPath, window.location.origin)), this.handleToggleButtonClick = () => {
82
+ super(...t), this.state = "default", this.counts = {}, this.locale = "", this.hasOverlay = !1, this.openMenu = null, this.menuIds = /* @__PURE__ */ new WeakMap(), this.hasNotice = !1, this.routeLoading = !1, this.mainTabStop = !1, this.overlayTrigger = null, this.internals = typeof this.attachInternals == "function" ? this.attachInternals() : void 0, this.currentPath = null, this.unsizedWarnKey = `unsized:${++w}`, this.isMatchedLink = (e) => this.currentPath === null || !e ? !1 : (e = typeof e == "string" ? new URLPattern(e, window.location.origin) : e, e.test(this.currentPath, window.location.origin)), this.handleToggleButtonClick = () => {
83
83
  let t = this.screenSize ?? e.screen ?? "large";
84
84
  t === "large" ? this.state = this.state === "default" ? "slim" : "default" : t === "medium" ? this.state = this.state === "slim" ? "modal" : "slim" : t === "small" ? this.state = this.state === "mobile" ? "mobile-open" : "mobile" : console.warn("Unknown screen size:", t);
85
85
  }, this.handleBackdropClick = () => {
@@ -112,7 +112,7 @@ var N = class extends i {
112
112
  }, this.handleOverlaySlotChange = (e) => {
113
113
  let t = o(e.target);
114
114
  if (t && !this.hasOverlay) {
115
- let e = j();
115
+ let e = A();
116
116
  this.overlayTrigger = e && e !== document.body ? e : null;
117
117
  }
118
118
  this.hasOverlay = t;
@@ -126,9 +126,9 @@ var N = class extends i {
126
126
  }, this._handleMainKeydown = (e) => {
127
127
  if (e.defaultPrevented) return;
128
128
  let t = e.composedPath()[0];
129
- if (t instanceof HTMLElement && E(t) || e.key === " " && t instanceof HTMLElement && O(t)) return;
129
+ if (t instanceof HTMLElement && T(t) || e.key === " " && t instanceof HTMLElement && D(t)) return;
130
130
  let n = this.shadowRoot?.querySelector(".main");
131
- if (!n || !A(e.composedPath(), n)) return;
131
+ if (!n || !k(e.composedPath(), n)) return;
132
132
  let r = n.clientHeight;
133
133
  switch (e.key) {
134
134
  case " ":
@@ -186,7 +186,7 @@ var N = class extends i {
186
186
  process.env.NODE_ENV !== "production" && requestAnimationFrame(() => {
187
187
  if (!this.isConnected) return;
188
188
  let e = this.getBoundingClientRect().height;
189
- e >= 200 || w(this.unsizedWarnKey, `u-sidebar-layout is only ${Math.round(e)}px tall — its height: 100% found no sized ancestor, so the shell sits at its own chrome height and the route area has almost no room. Give the root element a height (e.g. #app { height: 100vh } — app.load() does this for document.body).`);
189
+ e >= 200 || C(this.unsizedWarnKey, `u-sidebar-layout is only ${Math.round(e)}px tall — its height: 100% found no sized ancestor, so the shell sits at its own chrome height and the route area has almost no room. Give the root element a height (e.g. #app { height: 100vh } — app.load() does this for document.body).`);
190
190
  });
191
191
  }
192
192
  render() {
@@ -277,7 +277,7 @@ var N = class extends i {
277
277
  }
278
278
  renderMenu(e) {
279
279
  let t = this.menuIds.get(e);
280
- t || (t = `u-sidebar-menu-${++C.menuSeq}`, this.menuIds.set(e, t));
280
+ t || (t = `u-sidebar-menu-${++S.menuSeq}`, this.menuIds.set(e, t));
281
281
  let n = t, r = this.state === "mobile" || this.state === "mobile-open" ? "bottom-start" : "right-start";
282
282
  return u`
283
283
  <u-sidebar-button
@@ -312,8 +312,8 @@ var N = class extends i {
312
312
  }
313
313
  handleMenuHide(e, t) {
314
314
  this.openMenu === t && (this.openMenu = null);
315
- let n = e.currentTarget, r = j();
316
- r && M(n, r) && this.shadowRoot?.querySelector(`#${t}`)?.focus();
315
+ let n = e.currentTarget, r = A();
316
+ r && j(n, r) && this.shadowRoot?.querySelector(`#${t}`)?.focus();
317
317
  }
318
318
  renderItem(e) {
319
319
  if (!e) return d;
@@ -386,7 +386,7 @@ var N = class extends i {
386
386
  };
387
387
  }
388
388
  icon(e) {
389
- return this.config?.icons?.[e] ?? C.DEFAULT_ICONS[e];
389
+ return this.config?.icons?.[e] ?? S.DEFAULT_ICONS[e];
390
390
  }
391
391
  renderLogo() {
392
392
  let e = this.config?.logo, t = this.config?.title ?? "Home";
@@ -439,14 +439,14 @@ var N = class extends i {
439
439
  async focusRoute(e) {
440
440
  let t = this.routeContent();
441
441
  if (await Promise.all(t.map((e) => e.updateComplete)), this.hasOverlay || !e.isConnected) return;
442
- let n = j();
443
- n && t.some((e) => M(e, n)) || this.focusContentStart(t, e);
442
+ let n = A();
443
+ n && t.some((e) => j(e, n)) || this.focusContentStart(t, e);
444
444
  }
445
445
  focusContentStart(e, t) {
446
446
  let n = b(e, "[autofocus]", y);
447
447
  n?.focus();
448
- let r = j();
449
- n && r && M(n, r) || t.focus({ preventScroll: !0 });
448
+ let r = A();
449
+ n && r && j(n, r) || t.focus({ preventScroll: !0 });
450
450
  }
451
451
  overlayPanels() {
452
452
  return (this.shadowRoot?.querySelector("slot[name=\"overlay\"]"))?.assignedElements({ flatten: !0 }) ?? [];
@@ -454,19 +454,19 @@ var N = class extends i {
454
454
  async focusOverlay() {
455
455
  let e = this.overlayPanels();
456
456
  if (await Promise.all(e.map((e) => e.updateComplete)), !this.hasOverlay) return;
457
- let t = j();
458
- t && e.some((e) => M(e, t)) || (b(e, "[autofocus]", y) ?? b(e, "input, select, textarea, u-input, u-textarea, u-select, u-checkbox, u-radio, u-switch, u-slider", y) ?? this.shadowRoot?.querySelector(".overlay-close"))?.focus();
457
+ let t = A();
458
+ t && e.some((e) => j(e, t)) || (b(e, "[autofocus]", y) ?? b(e, "input, select, textarea, u-input, u-textarea, u-select, u-checkbox, u-radio, u-switch, u-slider", y) ?? this.shadowRoot?.querySelector(".overlay-close"))?.focus();
459
459
  }
460
460
  restoreOverlayFocus() {
461
461
  let e = this.overlayTrigger;
462
462
  this.overlayTrigger = null;
463
- let t = j();
463
+ let t = A();
464
464
  t && t !== document.body || (e?.isConnected ? e.focus() : this.mainElement?.focus({ preventScroll: !0 }));
465
465
  }
466
466
  };
467
467
  r([p({
468
468
  type: String,
469
469
  reflect: !0
470
- }), n("design:type", Object)], N.prototype, "state", void 0), r([p({ type: Object }), n("design:type", Object)], N.prototype, "config", void 0), r([p({ type: Object }), n("design:type", typeof Record > "u" ? Object : Record)], N.prototype, "counts", void 0), r([p({ type: String }), n("design:type", Object)], N.prototype, "locale", void 0), r([m("u-progress-bar"), n("design:type", S === void 0 ? Object : S)], N.prototype, "progressBarEl", void 0), r([h(), n("design:type", Object)], N.prototype, "hasOverlay", void 0), r([h(), n("design:type", Object)], N.prototype, "openMenu", void 0), r([h(), n("design:type", Object)], N.prototype, "hasNotice", void 0), r([h(), n("design:type", Object)], N.prototype, "routeLoading", void 0), r([h(), n("design:type", Object)], N.prototype, "mainTabStop", void 0), r([h(), n("design:type", Object)], N.prototype, "currentPath", void 0), N = C = r([f("u-sidebar-layout")], N);
470
+ }), n("design:type", Object)], M.prototype, "state", void 0), r([p({ type: Object }), n("design:type", Object)], M.prototype, "config", void 0), r([p({ type: Object }), n("design:type", typeof Record > "u" ? Object : Record)], M.prototype, "counts", void 0), r([p({ type: String }), n("design:type", Object)], M.prototype, "locale", void 0), r([m("u-progress-bar"), n("design:type", Object)], M.prototype, "progressBarEl", void 0), r([h(), n("design:type", Object)], M.prototype, "hasOverlay", void 0), r([h(), n("design:type", Object)], M.prototype, "openMenu", void 0), r([h(), n("design:type", Object)], M.prototype, "hasNotice", void 0), r([h(), n("design:type", Object)], M.prototype, "routeLoading", void 0), r([h(), n("design:type", Object)], M.prototype, "mainTabStop", void 0), r([h(), n("design:type", Object)], M.prototype, "currentPath", void 0), M = S = r([f("u-sidebar-layout")], M);
471
471
  //#endregion
472
- export { N as SidebarLayout };
472
+ export { M as SidebarLayout };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/modern-app",
3
3
  "description": "web-framework by iyulab based on lit-element",
4
- "version": "0.42.1",
4
+ "version": "0.42.2",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",