@iyulab/modern-app 0.49.0 → 0.50.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,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.50.0] - 2026-10-12
4
+
5
+ ### Added
6
+
7
+ - **The shell returns to where you were reading.** `app.load()` turns on `@iyulab/router`'s scroll restoration with
8
+ the sidebar layout's main box — the shell scrolls that box, not the document, so the browser's own restoration
9
+ never reached it. Back, Forward and a reload bring a screen back at the position you left it, waiting for content
10
+ that grows after rendering; a new navigation starts at the top. `AppConfig.scrollRestoration: false` turns it off,
11
+ and a layout `scrollBehavior` hook keeps scrolling to itself (restoration is then off).
12
+
13
+ ### Changed
14
+
15
+ - Requires `@iyulab/router` 0.22. Route contexts carry `navigation` (`{ type, entryKey }` — `push`, `replace`,
16
+ `reload`, `traverse`), so a hand-built `RouteContext` needs one. `<u-link>` asks the router to navigate instead of
17
+ pushing an entry and dispatching a synthetic `popstate`, so a `popstate` the app hears is a real Back or Forward;
18
+ code without the router navigates with `navigate()` from `@iyulab/router`.
19
+ - The `u-group-box` reference says where its width comes from: it folds by its own width, so where a box sizes to
20
+ its content (a flex row item without `flex: 1`, `inline-block`, a grid `auto` column) give the card a width.
21
+
22
+ ## [0.49.1] - 2026-10-12
23
+
24
+ ### Fixed
25
+
26
+ - `u-group-box` is no longer a size container itself; the query container for its narrow layout is a box inside its
27
+ shadow root of the same width. In Chromium a card whose content changed in the same commit that disabled a sibling
28
+ `<fieldset>` could stay collapsed to its border (2px tall) until something forced a relayout, and the host's
29
+ `container-type` was the ingredient. Narrow-width rules — the card's own header, and unnamed `@container` queries
30
+ in slotted content — resolve to the same width as before.
31
+
3
32
  ## [0.49.0] - 2026-10-09
4
33
 
5
34
  ### Added
package/dist/App.js CHANGED
@@ -94,7 +94,8 @@ var d = class c {
94
94
  fallback: o.fallback ?? t,
95
95
  enter: o.enter,
96
96
  initialLoad: o.initialLoad,
97
- useIntercept: o.useIntercept
97
+ useIntercept: o.useIntercept,
98
+ scrollRestoration: o.scrollRestoration !== !1 && !o.layout.scrollBehavior && { container: () => this._layout?.mainElement }
98
99
  });
99
100
  }
100
101
  syncLanguage() {
@@ -33,7 +33,7 @@ var f, p = {
33
33
  }
34
34
  render() {
35
35
  let e = !!this.title || !!this.description || this.hasActions;
36
- return a`
36
+ return a`<div class="frame">
37
37
  <div class="header ${this.divider ? "divider" : ""} ${e ? "" : "empty"}" part="header">
38
38
  <div class="titles">
39
39
  ${u`<${p[this.headingLevel]} class="title" part="title">${this.title}${this.title && this.meta ? a` <span class="meta" part="meta">${this.meta}</span>` : ""}</${p[this.headingLevel]}>`}
@@ -46,7 +46,7 @@ var f, p = {
46
46
  </div>
47
47
  </div>
48
48
  <div class="body ${this.flush ? "flush" : ""}" part="body"><slot></slot></div>
49
- `;
49
+ </div>`;
50
50
  }
51
51
  };
52
52
  t([c({ type: String }), e("design:type", Object)], m.prototype, "title", void 0), t([c({ type: String }), e("design:type", String)], m.prototype, "meta", void 0), t([c({ type: String }), e("design:type", String)], m.prototype, "description", void 0), t([c({ type: Boolean }), e("design:type", Object)], m.prototype, "divider", void 0), t([c({ type: Boolean }), e("design:type", Object)], m.prototype, "flush", void 0), t([c({
@@ -6,16 +6,23 @@ var t = e`
6
6
 
7
7
 
8
8
 
9
- container-type: inline-size;
10
-
11
-
12
-
13
9
  background-color: var(--u-panel-bg-color, #FFFFFF);
14
10
  border: 1px solid var(--u-border-color, #E0E0E0);
15
11
  border-radius: var(--u-radius-xl, 8px);
16
12
  box-shadow: var(--u-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04));
17
13
  }
18
14
 
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ .frame {
23
+ container-type: inline-size;
24
+ }
25
+
19
26
  .header {
20
27
  display: flex;
21
28
  align-items: center;
@@ -82,6 +82,12 @@ export interface AppConfig {
82
82
  * @default true
83
83
  */
84
84
  useIntercept?: boolean;
85
+ /**
86
+ * 뒤로·앞으로 가기와 새로 고침으로 돌아온 화면을 보던 자리로 되돌린다(라우터의 `scrollRestoration` — 셸의 본문 상자를 굴린다).
87
+ * 새 이동은 맨 위로. 레이아웃의 `scrollBehavior` 를 주면 그 훅이 스크롤을 맡고 이것은 꺼진다.
88
+ * @default true
89
+ */
90
+ scrollRestoration?: boolean;
85
91
  /**
86
92
  * 애플리케이션이 렌더링될 루트 HTML 요소
87
93
  * @default document.body
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.49.0",
4
+ "version": "0.50.0",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
@@ -60,7 +60,7 @@
60
60
  "test:react-types": "tsc -p tsconfig.react-smoke.json"
61
61
  },
62
62
  "dependencies": {
63
- "@iyulab/router": "^0.21.0",
63
+ "@iyulab/router": "^0.22.0",
64
64
  "i18next": "^26.3.6",
65
65
  "lit": "^3.3.3"
66
66
  },
@@ -34,6 +34,12 @@ interface AppConfig {
34
34
  /** Intercept `<a>` tag clicks for client-side routing. Default: true */
35
35
  useIntercept?: boolean;
36
36
 
37
+ /**
38
+ * Back / Forward / reload return to where you were in the shell's main box; a new navigation starts at
39
+ * the top. Off when the layout has a `scrollBehavior` hook. Default: true
40
+ */
41
+ scrollRestoration?: boolean;
42
+
37
43
  /** Layout configuration. Currently only 'sidebar' is supported. */
38
44
  layout: LayoutConfig;
39
45
 
@@ -169,6 +175,13 @@ interface RouteContext {
169
175
  /** Metadata merged parent → child from the matched route chain. */
170
176
  metadata: Record<string, unknown>;
171
177
 
178
+ /**
179
+ * How this screen was reached. `type` is `push` (a new entry), `replace`, `reload`, or `traverse`
180
+ * (Back/Forward returned to an existing entry). `entryKey` names the history entry — the same value
181
+ * when you come back to it, so per-entry memory (scroll, selection) keys on it.
182
+ */
183
+ navigation: { type: 'push' | 'replace' | 'reload' | 'traverse'; entryKey: string };
184
+
172
185
  /**
173
186
  * Report loading progress (0–100).
174
187
  * Drives the progress bar shown in the layout header.
@@ -18,6 +18,13 @@ up different on every screen.
18
18
  The body is a flex column with token spacing, so block children get vertical rhythm and share
19
19
  a left edge without any consumer CSS.
20
20
 
21
+ **Width comes from outside.** The card folds by its own width (at 480px or less the header
22
+ actions move under the title), so its content is a size query container and does not size the
23
+ card. In normal flow and in grid `1fr` columns that is invisible; where a box sizes to its
24
+ content — a flex row item without `flex: 1`, `inline-block`, a grid `auto` column — give the card
25
+ a width (`flex: 1 1 20rem`, `width: …`), or it shrinks to its border. Unnamed `@container`
26
+ queries in your slotted content resolve to the card's width.
27
+
21
28
  ## Slots
22
29
 
23
30
  | Name | Description |