@synopackageland/sdk 0.49.4 → 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/README.md CHANGED
@@ -195,13 +195,39 @@ This does not change the DSM window title bar or DSM's own Portal header.
195
195
  a `title` the App has already translated, and optionally an `icon`, a `group`
196
196
  label (pages with the same label sit together), a `badge`, a `component` to
197
197
  render while it is the current page, `hidden` (reachable through `v-model`
198
- but not in the sidebar), its own `description`, `placement: 'bottom'` for a
199
- page the sidebar lists last, after every group (an App's settings), and
200
- `header: false` for a page that draws its own header. `fill: true` gives the page's body the height under
201
- its header and notices; the page does not scroll, so the content scrolls
202
- itself (a treemap, a table paged by height, a log viewer). The shell then
203
- holds to `100dvh`, so a phone's address bar does not leave a gap. The built-in `'status'` and `'background'`
204
- may sit in the same list.
198
+ but not in the sidebar), `placement: 'bottom'` for a page the sidebar lists
199
+ last, after every group (an App's settings), `header` and `fill`. The built-in
200
+ `'status'` and `'background'` may sit in the same list.
201
+
202
+ ### Page title and actions
203
+
204
+ The sidebar already names the page, so a page shows no title of its own and no
205
+ subtitle. A visually hidden `h1` with the page's `title` still names it for
206
+ screen readers. The `#actions` slot, `PageActions`, the `#meta` slot and
207
+ `PageInfo` sit in a bar above the page: notes at the start, actions at the
208
+ end. The bar stays in place while the page scrolls and shows only while it
209
+ holds something. `header: true` shows the shell's `PageHeader` with the title
210
+ and puts the notes and actions on its line instead. `header: false` is for a
211
+ page that draws its own header: the shell adds no title, and its actions still
212
+ go to the bar.
213
+
214
+ ### Scrolling
215
+
216
+ The navigation, the page bar, a page's tabs and a settings footer stay in
217
+ place; only the content scrolls, so no scrollbar runs past them. A page
218
+ scrolls as a whole by default. A page that shows a `SettingsPage` or a
219
+ `SectionTabs fill` fills the height instead: the tab strip stays at the top,
220
+ the footer at the bottom edge of the window, and only the `SettingsPage` body
221
+ scrolls (a tab that is not a `SettingsPage` scrolls under the strip). This
222
+ works through the App's own wrappers, such as a template's
223
+ `.integration-app > [data-page]`, with no CSS in the App. A page that shows a
224
+ settings footer has no space under it, whether or not it sits in tabs.
225
+
226
+ `fill: true` makes any page fill: the page does not scroll and the content
227
+ scrolls itself (a treemap, a table paged by height, a log viewer). `fill: false`
228
+ keeps a page scrolling as a whole even when it shows a `SettingsPage`. A filling
229
+ shell holds to `100dvh`, so a phone's address bar does not leave a gap. On a
230
+ phone the same rules give one scrolling area, with the footer in view.
205
231
 
206
232
  ```vue
207
233
  <AppShell v-model="page" :ctx="ctx" :locale="ctx.locale" :pages="[
@@ -216,9 +242,10 @@ may sit in the same list.
216
242
  ```
217
243
 
218
244
  A page passed as `component` cannot fill the shell's `#actions` slot. It puts
219
- its own header buttons, such as its refresh, in `PageActions` anywhere in its
220
- template: they show in the page header before the App's `#actions` and leave
221
- with the page. Outside an `AppShell`, `PageActions` renders nothing.
245
+ its own buttons, such as its refresh, in `PageActions` anywhere in its
246
+ template: they show in the page bar (or the page header) before the App's
247
+ `#actions` and leave with the page. Outside an `AppShell`, `PageActions`
248
+ renders nothing.
222
249
 
223
250
  ```vue
224
251
  <!-- PackagesPage.vue -->
@@ -226,7 +253,8 @@ with the page. Outside an `AppShell`, `PageActions` renders nothing.
226
253
  ```
227
254
 
228
255
  A page's secondary notes take no row of their own: `PageInfo` puts them behind
229
- one info button on the title line, after the title and before the App's `#meta`.
256
+ one info button at the start of the page bar (on the title line with
257
+ `header: true`), before the App's `#meta`.
230
258
  The button is named "Notes (2)" in the shell's language (`label` names it
231
259
  otherwise); a click, or focus from the keyboard, opens the notes below it from
232
260
  its start, inside the App's window, and Escape closes them. The default slot
@@ -269,16 +297,32 @@ provide the no-surface/no-horizontal-gutter behavior. Other shell spacing,
269
297
  including the body bottom padding, stays unchanged.
270
298
 
271
299
  Moving to another page starts it at the top; `keep-scroll` keeps the
272
- position. The `toolbar` slot sits above the page (in `AppLayout`'s toolbar)
273
- and `notices` in the page, under its header and inside the same padding, and
274
- scrolls with it. `activePage(current, pages)` keeps a selection that still exists and
300
+ position. The `toolbar` slot sits above the page (in `AppLayout`'s toolbar,
301
+ above the page bar) and `notices` at the top of the page, inside the same
302
+ padding, and scrolls with it. `activePage(current, pages)` keeps a selection that still exists and
275
303
  otherwise picks the first page the sidebar shows. A router drives the shell
276
304
  through `v-model`:
277
305
  `:model-value="route.name" @update:model-value="name => router.push({name})"`.
278
306
 
307
+ ### Moving an existing App to these defaults
308
+
309
+ - A page that should keep its visible title sets `header: true`. Pages carry no
310
+ subtitle: drop `description` from the page entries (it is no longer shown).
311
+ - An App that set `header: false` only to hide the title, and added its own
312
+ hidden `h1`, can drop both: the shell now names the page itself. Buttons it
313
+ moved into its own `#toolbar` `AppToolbar` can go back to `#actions`.
314
+ - Remove CSS that passed the height to a settings page, such as
315
+ `.integration-app > [data-page][data-fill] { flex: 1 1 0%; min-height: 0 }`
316
+ and the same rule for its child, and CSS that removed the space under a
317
+ settings footer (`.app-page-content:has(...) { padding-bottom: 0 }`).
318
+ - Remove `fill: true` from pages whose content is a `SettingsPage` or a
319
+ `SectionTabs fill`; keep it for pages that scroll their own content, such as
320
+ a split view or a list paged by height. A page that must keep scrolling as a
321
+ whole while it shows a `SettingsPage` sets `fill: false`.
322
+
279
323
  Render the shell immediately, with [`EntryGuard`](../docs/app-entry.md) checking
280
324
  session/admin access in the background, and pass `loading` while startup reads
281
- run. The sidebar and title show immediately; the page body shows
325
+ run. The sidebar and the page bar show immediately; the page body shows
282
326
  its loading area and the actions slot waits. With the current CLI/SDK, use
283
327
  `ctx.batch` for independent startup reads so they share one HTTP request and
284
328
  App process:
@@ -0,0 +1,15 @@
1
+ const o = 3e5;
2
+ function a(e = 3e5) {
3
+ return e + 2e3;
4
+ }
5
+ function r(e) {
6
+ if (e.fullPage !== void 0) return e.fullPage;
7
+ if (!e.host) throw new Error("isFullPage: the context has neither fullPage nor host; pass fullPage (true for a page of its own), or a host (createStandaloneHost() outside DSM)");
8
+ const t = e.host.platform();
9
+ return t.host !== "dsm" || t.dsmStandalone === !0;
10
+ }
11
+ export {
12
+ o as D,
13
+ a as c,
14
+ r as i
15
+ };