@jskit-ai/shell-web 0.2.12 → 0.2.14

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/fixtures/adaptive-shell/src/ActionsFormPage.vue +22 -0
  3. package/fixtures/adaptive-shell/src/ActionsPage.vue +74 -0
  4. package/fixtures/adaptive-shell/src/App.vue +7 -3
  5. package/fixtures/adaptive-shell/src/ButtonStatesPage.vue +63 -0
  6. package/fixtures/adaptive-shell/src/ButtonsPage.vue +61 -0
  7. package/fixtures/adaptive-shell/src/ComponentsPage.vue +178 -0
  8. package/fixtures/adaptive-shell/src/FeedbackPage.vue +59 -0
  9. package/fixtures/adaptive-shell/src/OwnBarLayout.vue +13 -1
  10. package/fixtures/adaptive-shell/src/ReportsPage.vue +29 -0
  11. package/fixtures/adaptive-shell/src/StatusButton.vue +17 -0
  12. package/fixtures/adaptive-shell/src/TitleClaim.vue +17 -0
  13. package/fixtures/adaptive-shell/src/main.js +223 -37
  14. package/fixtures/production-build/index.html +15 -0
  15. package/fixtures/production-build/package.json +5 -0
  16. package/fixtures/production-build/src/App.vue +27 -0
  17. package/fixtures/production-build/src/componentChunk.css +5 -0
  18. package/fixtures/production-build/src/main.js +10 -0
  19. package/fixtures/production-build/vite.config.mjs +12 -0
  20. package/locales/en.json +1 -0
  21. package/package.json +9 -5
  22. package/patterns/application-shell/PATTERN.md +11 -6
  23. package/patterns/application-shell/example/src/components/menus/SectionTabLinkItem.vue +42 -0
  24. package/patterns/application-shell/example/src/pages/home.vue +1 -1
  25. package/patterns/application-shell/example/src/views/NotFound.vue +1 -1
  26. package/patterns/page-and-placement/PATTERN.md +6 -0
  27. package/patterns/page-and-placement/example/src/pages/home/reports.vue +9 -4
  28. package/patterns/page-and-placement/example/src/placementTopology.js +5 -3
  29. package/src/client/components/ShellErrorHost.vue +20 -1
  30. package/src/client/components/ShellLayout.vue +64 -28
  31. package/src/client/components/ShellNavigationItem.vue +8 -3
  32. package/src/client/components/ShellNavigationScope.vue +1 -1
  33. package/src/client/components/ShellOutlet.vue +12 -49
  34. package/src/client/components/ShellPageAction.vue +107 -28
  35. package/src/client/components/ShellPageActionsTarget.vue +81 -2
  36. package/src/client/components/ShellPageTitle.vue +6 -3
  37. package/src/client/components/ShellPrimaryAction.vue +69 -0
  38. package/src/client/components/ShellSectionTabLinkItem.vue +104 -0
  39. package/src/client/components/ShellTabLinkItem.vue +18 -3
  40. package/src/client/components/ShellUpButton.vue +13 -8
  41. package/src/client/composables/useShellAppBar.js +10 -1
  42. package/src/client/composables/useShellOutletPlacements.js +49 -0
  43. package/src/client/composables/useShellPageClose.js +18 -0
  44. package/src/client/index.js +3 -0
  45. package/src/client/navigation/documentNavigation.js +6 -3
  46. package/src/client/navigation/linkResolver.js +22 -11
  47. package/src/client/navigation/shellNavigationRuntime.js +50 -11
  48. package/src/client/navigation/usePaths.js +13 -0
  49. package/src/client/navigation/useShellNavigation.js +2 -0
  50. package/src/client/support/drawerPresentation.js +30 -1
  51. package/src/client/support/navigationPresentation.js +1 -1
  52. package/src/client/support/pageActions.js +126 -0
  53. package/src/test/adaptiveShellSmoke.js +31 -16
  54. package/test/adaptiveShell.browser.test.js +1046 -227
  55. package/test/documentNavigation.test.js +44 -0
  56. package/test/drawerPresentation.test.js +31 -1
  57. package/test/linkResolver.test.js +54 -1
  58. package/test/materialBaselines.browser.test.js +142 -27
  59. package/test/packageRouteParent.test.js +41 -0
  60. package/test/pageActions.test.js +84 -0
  61. package/test/productionBuild.browser.test.js +98 -0
  62. package/test/settingsPlacementContract.test.js +11 -4
  63. package/test/shellNavigationRuntime.test.js +181 -0
@@ -9,15 +9,24 @@ import "@jskit-ai/material-web/client/material.css";
9
9
  import { materialThemes, createMaterialVuetifyOptions } from "@jskit-ai/material-web/client";
10
10
  import { shellScrollBehavior } from "@jskit-ai/kernel/client";
11
11
  import App from "./App.vue";
12
+ import ActionsFormPage from "./ActionsFormPage.vue";
13
+ import ActionsPage from "./ActionsPage.vue";
14
+ import ButtonStatesPage from "./ButtonStatesPage.vue";
15
+ import ButtonsPage from "./ButtonsPage.vue";
16
+ import ComponentsPage from "./ComponentsPage.vue";
12
17
  import { adminTheme, theme } from "./theme/index.js";
13
18
  import RecordListPage from "./RecordListPage.vue";
14
19
  import RecordPage from "./RecordPage.vue";
20
+ import FeedbackPage from "./FeedbackPage.vue";
21
+ import ReportsPage from "./ReportsPage.vue";
15
22
  import ScreenPage from "./ScreenPage.vue";
16
23
  import StudioPage from "./StudioPage.vue";
17
24
  import SettingsPage from "./SettingsPage.vue";
25
+ import StatusButton from "./StatusButton.vue";
18
26
  import ShellMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellMenuLinkItem";
19
27
  import ShellSurfaceAwareMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellSurfaceAwareMenuLinkItem";
20
28
  import ShellTabLinkItem from "@jskit-ai/shell-web/client/components/ShellTabLinkItem";
29
+ import ShellSectionTabLinkItem from "@jskit-ai/shell-web/client/components/ShellSectionTabLinkItem";
21
30
  import { useShellLayoutStore } from "../../../src/client/stores/useShellLayoutStore.js";
22
31
  import { createWebPlacementRuntime } from "../../../src/client/placement/runtime.js";
23
32
  import { SHELL_WEB_PLACEMENT_RUNTIME_KEY } from "../../../src/client/placement/inject.js";
@@ -36,51 +45,161 @@ import { silentLogger } from "@jskit-ai/kernel/shared/support/silentLogger";
36
45
  const COMPONENTS = new Map([
37
46
  ["fixture.menu-link", ShellMenuLinkItem],
38
47
  ["fixture.surface-menu-link", ShellSurfaceAwareMenuLinkItem],
39
- ["fixture.tab-link", ShellTabLinkItem]
48
+ ["fixture.tab-link", ShellTabLinkItem],
49
+ ["fixture.section-tab-link", ShellSectionTabLinkItem],
50
+ ["fixture.status-button", StatusButton]
40
51
  ]);
41
52
 
42
- function createSurfacePlacement(surface, order, label, suffix) {
43
- return {
44
- id: `fixture.${surface}.${label.toLowerCase()}`,
53
+ // Main navigation as literal data, one placement per destination, as jskit check reads it.
54
+ const placements = [
55
+ {
56
+ id: "fixture.home.home",
57
+ target: "shell.primary-nav",
58
+ kind: "link",
59
+ surfaces: ["home"],
60
+ order: 10,
61
+ props: { label: "Home", surface: "home", scopedSuffix: "/", unscopedSuffix: "/", exact: true }
62
+ },
63
+ {
64
+ id: "fixture.home.settings",
45
65
  target: "shell.primary-nav",
46
66
  kind: "link",
47
- surfaces: [surface],
48
- order,
67
+ surfaces: ["home"],
68
+ order: 20,
69
+ props: { label: "Settings", surface: "home", scopedSuffix: "/settings", unscopedSuffix: "/settings" }
70
+ },
71
+ {
72
+ id: "fixture.home.contacts",
73
+ target: "shell.primary-nav",
74
+ kind: "link",
75
+ surfaces: ["home"],
76
+ order: 30,
77
+ props: { label: "Contacts", surface: "home", scopedSuffix: "/contacts", unscopedSuffix: "/contacts" }
78
+ },
79
+ {
80
+ id: "fixture.home.suppliers",
81
+ target: "shell.primary-nav",
82
+ kind: "link",
83
+ surfaces: ["home"],
84
+ order: 40,
85
+ props: { label: "Suppliers", surface: "home", scopedSuffix: "/suppliers", unscopedSuffix: "/suppliers" }
86
+ },
87
+ {
88
+ id: "fixture.home.bookings",
89
+ target: "shell.primary-nav",
90
+ kind: "link",
91
+ surfaces: ["home"],
92
+ order: 50,
93
+ props: { label: "Bookings", surface: "home", scopedSuffix: "/bookings", unscopedSuffix: "/bookings" }
94
+ },
95
+ {
96
+ id: "fixture.admin.home",
97
+ target: "shell.primary-nav",
98
+ kind: "link",
99
+ surfaces: ["admin"],
100
+ order: 10,
101
+ props: { label: "Home", surface: "admin", scopedSuffix: "/", unscopedSuffix: "/", exact: true }
102
+ },
103
+ {
104
+ id: "fixture.admin.assistant",
105
+ target: "shell.primary-nav",
106
+ kind: "link",
107
+ surfaces: ["admin"],
108
+ order: 20,
109
+ props: { label: "Assistant", surface: "admin", scopedSuffix: "/assistant", unscopedSuffix: "/assistant" }
110
+ },
111
+ {
112
+ id: "fixture.admin.contacts",
113
+ target: "shell.primary-nav",
114
+ kind: "link",
115
+ surfaces: ["admin"],
116
+ order: 30,
117
+ props: { label: "Contacts", surface: "admin", scopedSuffix: "/contacts", unscopedSuffix: "/contacts" }
118
+ },
119
+ {
120
+ id: "fixture.admin.bookings",
121
+ target: "shell.primary-nav",
122
+ kind: "link",
123
+ surfaces: ["admin"],
124
+ order: 40,
125
+ props: { label: "Bookings", surface: "admin", scopedSuffix: "/bookings", unscopedSuffix: "/bookings" }
126
+ },
127
+ {
128
+ id: "fixture.admin.rostering",
129
+ target: "shell.primary-nav",
130
+ kind: "link",
131
+ surfaces: ["admin"],
132
+ order: 50,
133
+ props: { label: "Rostering", surface: "admin", scopedSuffix: "/rostering", unscopedSuffix: "/rostering" }
134
+ },
135
+ // A page's section tabs (page.section-nav), with a long label that scrolls the row rather than squashing a tab.
136
+ {
137
+ id: "fixture.reports.overview",
138
+ target: "page.section-nav",
139
+ owner: "reports",
140
+ kind: "link",
141
+ surfaces: ["home"],
142
+ order: 10,
143
+ props: { label: "Overview", surface: "home", scopedSuffix: "/reports/overview", unscopedSuffix: "/reports/overview" }
144
+ },
145
+ {
146
+ id: "fixture.reports.activity",
147
+ target: "page.section-nav",
148
+ owner: "reports",
149
+ kind: "link",
150
+ surfaces: ["home"],
151
+ order: 20,
152
+ props: { label: "Activity", surface: "home", scopedSuffix: "/reports/activity", unscopedSuffix: "/reports/activity" }
153
+ },
154
+ {
155
+ id: "fixture.reports.quarterly",
156
+ target: "page.section-nav",
157
+ owner: "reports",
158
+ kind: "link",
159
+ surfaces: ["home"],
160
+ order: 30,
49
161
  props: {
50
- label,
51
- surface,
52
- scopedSuffix: suffix,
53
- unscopedSuffix: suffix,
54
- exact: suffix === "/"
162
+ label: "Quarterly performance",
163
+ surface: "home",
164
+ scopedSuffix: "/reports/quarterly",
165
+ unscopedSuffix: "/reports/quarterly"
55
166
  }
56
- };
57
- }
58
-
59
- function createSurfacePlacements(surface) {
60
- return [
61
- createSurfacePlacement(surface, 10, "Home", "/"),
62
- surface === "home"
63
- ? createSurfacePlacement(surface, 20, "Settings", "/settings")
64
- : createSurfacePlacement(surface, 20, "Assistant", "/assistant"),
65
- createSurfacePlacement(surface, 30, "Contacts", "/contacts"),
66
- surface === "home"
67
- ? createSurfacePlacement(surface, 40, "Suppliers", "/suppliers")
68
- : createSurfacePlacement(surface, 40, "Bookings", "/bookings"),
69
- surface === "home"
70
- ? createSurfacePlacement(surface, 50, "Bookings", "/bookings")
71
- : createSurfacePlacement(surface, 50, "Rostering", "/rostering")
72
- ];
73
- }
74
-
75
- const placements = [
76
- ...createSurfacePlacements("home"),
77
- ...createSurfacePlacements("admin"),
167
+ },
168
+ // The same tabs given to the navigation bar's renderer, as an app did: in a page it draws section tabs too.
169
+ {
170
+ id: "fixture.reports-views.overview",
171
+ target: "page.section-nav",
172
+ owner: "reports-views",
173
+ kind: "link",
174
+ surfaces: ["home"],
175
+ order: 10,
176
+ props: { label: "Overview", surface: "home", scopedSuffix: "/reports/overview", unscopedSuffix: "/reports/overview" }
177
+ },
178
+ {
179
+ id: "fixture.reports-views.activity",
180
+ target: "page.section-nav",
181
+ owner: "reports-views",
182
+ kind: "link",
183
+ surfaces: ["home"],
184
+ order: 20,
185
+ props: { label: "Activity", surface: "home", scopedSuffix: "/reports/activity", unscopedSuffix: "/reports/activity" }
186
+ },
187
+ // A surface with Home alone: nowhere to go, so no navigation.
188
+ {
189
+ id: "fixture.solo.home",
190
+ target: "shell.primary-nav",
191
+ kind: "link",
192
+ surfaces: ["solo"],
193
+ order: 10,
194
+ props: { label: "Home", surface: "solo", scopedSuffix: "/", unscopedSuffix: "/", exact: true }
195
+ },
78
196
  {
79
197
  id: "fixture.help",
80
198
  target: "shell.secondary-nav",
81
199
  kind: "link",
82
200
  componentToken: "fixture.menu-link",
83
- surfaces: ["*"],
201
+ // Only home has a secondary destination, so on a phone admin's are all in the navigation bar and it has no drawer.
202
+ surfaces: ["home"],
84
203
  order: 100,
85
204
  props: {
86
205
  label: "Help and support",
@@ -89,8 +208,24 @@ const placements = [
89
208
  }
90
209
  ];
91
210
 
211
+ // `?topRight=3` gives the top app bar three items of its own, as an app's tools, status and avatar.
212
+ const statusPlacements = [
213
+ ["$settings", "Tools"],
214
+ ["$notifications", "Status"],
215
+ ["$accountCircle", "Account"]
216
+ ].slice(0, Number(new URLSearchParams(window.location.search).get("topRight")) || 0).map(([icon, label], index) => ({
217
+ id: `fixture.status.${index}`,
218
+ target: "shell.status",
219
+ kind: "component",
220
+ componentToken: "fixture.status-button",
221
+ surfaces: ["home", "admin"],
222
+ order: 10 + index,
223
+ props: { icon, label }
224
+ }));
225
+
92
226
  const menuRenderers = Object.freeze({ link: "fixture.surface-menu-link" });
93
227
  const tabRenderers = Object.freeze({ link: "fixture.tab-link" });
228
+ const sectionTabRenderers = Object.freeze({ link: "fixture.section-tab-link" });
94
229
  const placementTopology = [
95
230
  {
96
231
  id: "shell.primary-nav",
@@ -110,20 +245,52 @@ const placementTopology = [
110
245
  medium: { outlet: "shell-layout:secondary-menu", renderers: menuRenderers },
111
246
  expanded: { outlet: "shell-layout:secondary-menu", renderers: menuRenderers }
112
247
  }
248
+ },
249
+ {
250
+ id: "page.section-nav",
251
+ owner: "reports",
252
+ surfaces: ["home"],
253
+ variants: {
254
+ compact: { outlet: "reports:section-nav", renderers: sectionTabRenderers },
255
+ medium: { outlet: "reports:section-nav", renderers: sectionTabRenderers },
256
+ expanded: { outlet: "reports:section-nav", renderers: sectionTabRenderers }
257
+ }
258
+ },
259
+ {
260
+ id: "page.section-nav",
261
+ owner: "reports-views",
262
+ surfaces: ["home"],
263
+ variants: {
264
+ compact: { outlet: "reports-views:section-nav", renderers: tabRenderers },
265
+ medium: { outlet: "reports-views:section-nav", renderers: tabRenderers },
266
+ expanded: { outlet: "reports-views:section-nav", renderers: tabRenderers }
267
+ }
268
+ },
269
+ {
270
+ id: "shell.status",
271
+ surfaces: ["*"],
272
+ variants: {
273
+ compact: { outlet: "shell-layout:top-right" },
274
+ medium: { outlet: "shell-layout:top-right" },
275
+ expanded: { outlet: "shell-layout:top-right" }
276
+ }
113
277
  }
114
278
  ];
115
279
 
116
280
  const placementRuntime = createWebPlacementRuntime({ components: COMPONENTS, logger: silentLogger });
117
- placementRuntime.replacePlacements(placements);
281
+ placementRuntime.replacePlacements([...placements, ...statusPlacements]);
118
282
  placementRuntime.replacePlacementTopology(placementTopology);
119
283
  placementRuntime.setContext({
120
284
  surfaceConfig: {
121
285
  tenancyMode: "path",
122
286
  defaultSurfaceId: "home",
123
- enabledSurfaceIds: ["home", "admin"],
287
+ enabledSurfaceIds: ["home", "admin", "account", "solo"],
124
288
  surfacesById: {
125
289
  home: { id: "home", routeBase: "/home", enabled: true },
126
- admin: { id: "admin", routeBase: "/w/:workspaceSlug/admin", enabled: true }
290
+ admin: { id: "admin", routeBase: "/w/:workspaceSlug/admin", enabled: true },
291
+ // A surface whose shell has no navigation, as an account page's.
292
+ account: { id: "account", routeBase: "/account", enabled: true },
293
+ solo: { id: "solo", routeBase: "/solo", enabled: true }
127
294
  }
128
295
  }
129
296
  });
@@ -155,6 +322,11 @@ const routes = [
155
322
  beforeEnter: refuseBlockedRecord,
156
323
  meta: { kind: "contacts", jskit: { parent: "/contacts" } }
157
324
  },
325
+ {
326
+ path: "/home/contacts/:id/edit",
327
+ component: ScreenPage,
328
+ meta: { title: "Edit contact", jskit: { title: "Edit contact", parent: "/contacts/:id" } }
329
+ },
158
330
  { path: "/home/suppliers", component: RecordListPage, meta: { kind: "suppliers", jskit: { title: "Suppliers" } } },
159
331
  {
160
332
  path: "/home/suppliers/:id",
@@ -162,12 +334,26 @@ const routes = [
162
334
  beforeEnter: refuseBlockedRecord,
163
335
  meta: { kind: "suppliers", jskit: { parent: "/suppliers" } }
164
336
  },
337
+ { path: "/home/buttons", component: ButtonsPage, meta: { jskit: { title: "Buttons" } } },
338
+ { path: "/home/button-states", component: ButtonStatesPage, meta: { jskit: { title: "Button states" } } },
339
+ { path: "/home/components", component: ComponentsPage, meta: { jskit: { title: "Components" } } },
340
+ { path: "/home/actions", component: ActionsPage, meta: { jskit: { title: "Actions" } } },
341
+ { path: "/home/actions/new", component: ActionsFormPage, meta: { jskit: { title: "New entry", parent: "/actions" } } },
165
342
  // A layout that draws its own top app bar from the shell's pieces.
166
343
  { path: "/home/studio", component: StudioPage, meta: { ownBar: true, jskit: { title: "Studio" } } },
167
344
  { path: "/home/studio/:id", component: StudioPage, meta: { ownBar: true, jskit: { parent: "/studio" } } },
168
345
  { path: "/home/:section?", component: ScreenPage, meta: { title: "Home surface" } },
169
346
  { path: "/w/:workspaceSlug/admin/:section?", component: ScreenPage, meta: { title: "Admin surface" } },
170
347
  { path: "/help", component: ScreenPage, meta: { title: "Help and support" } },
348
+ { path: "/solo", component: ScreenPage, meta: { title: "Solo", jskit: { title: "Solo" } } },
349
+ { path: "/home/reports", redirect: "/home/reports/overview" },
350
+ { path: "/home/reports/:section", component: ReportsPage, meta: { jskit: { title: "Reports" } } },
351
+ { path: "/home/feedback", component: FeedbackPage, meta: { jskit: { title: "Integration" } } },
352
+ {
353
+ path: "/account",
354
+ component: ScreenPage,
355
+ meta: { title: "Account", jskit: { title: "Account", parent: { surface: "home", path: "/" } } }
356
+ },
171
357
  { path: "/sign-in", component: ScreenPage, meta: { title: "Sign in", bare: true } }
172
358
  ];
173
359
  const router = createRouter({ history: createWebHistory(), routes, scrollBehavior: shellScrollBehavior });
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>JSKIT production build contract</title>
7
+ <!-- Stands for the shared component chunks' stylesheets a production build links before the entry's: each opens
8
+ with @layer vuetify-components, so it names that layer before vuetify/styles names vuetify-core. -->
9
+ <link rel="stylesheet" href="/src/componentChunk.css">
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ <script type="module" src="/src/main.js"></script>
14
+ </body>
15
+ </html>
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "shell-web-production-build-fixture",
3
+ "private": true,
4
+ "type": "module"
5
+ }
@@ -0,0 +1,27 @@
1
+ <script setup>
2
+ import { ref } from "vue";
3
+
4
+ const name = ref("");
5
+ const notes = ref("");
6
+ const size = ref("Medium");
7
+ </script>
8
+
9
+ <template>
10
+ <v-app class="production-build-fixture">
11
+ <v-main>
12
+ <section class="pa-4">
13
+ <v-btn data-testid="button-control">Save</v-btn>
14
+ <v-btn data-testid="link-control" href="#saved">Open</v-btn>
15
+ <!-- State layers: a rail's menu button, a profile menu's avatar activator, a disabled button. -->
16
+ <v-btn data-testid="icon-control" icon="$menu" variant="text" aria-label="Menu" />
17
+ <v-btn data-testid="avatar-control" icon variant="text" aria-label="Profile">
18
+ <v-avatar size="32" color="primary-container">A</v-avatar>
19
+ </v-btn>
20
+ <v-btn data-testid="disabled-control" disabled>Reset password</v-btn>
21
+ <v-text-field v-model="name" label="Name" data-testid="input-control" />
22
+ <v-textarea v-model="notes" label="Notes" data-testid="textarea-control" />
23
+ <v-select v-model="size" label="Size" :items="['Small', 'Medium', 'Large']" data-testid="select-control" />
24
+ </section>
25
+ </v-main>
26
+ </v-app>
27
+ </template>
@@ -0,0 +1,5 @@
1
+ @layer vuetify-components {
2
+ .production-build-fixture {
3
+ min-height: 100dvh;
4
+ }
5
+ }
@@ -0,0 +1,10 @@
1
+ import { createApp } from "vue";
2
+ import { createVuetify } from "vuetify";
3
+ import * as components from "vuetify/components";
4
+ import * as directives from "vuetify/directives";
5
+ import "vuetify/styles";
6
+ import "@jskit-ai/material-web/client/material.css";
7
+ import { createMaterialVuetifyOptions } from "@jskit-ai/material-web/client";
8
+ import App from "./App.vue";
9
+
10
+ createApp(App).use(createVuetify({ components, directives, ...createMaterialVuetifyOptions() })).mount("#app");
@@ -0,0 +1,12 @@
1
+ import { fileURLToPath, URL } from "node:url";
2
+ import { defineConfig } from "vite";
3
+ import vue from "@vitejs/plugin-vue";
4
+ import { createJskitClientBootstrapPlugin } from "@jskit-ai/kernel/client/vite";
5
+
6
+ // A JSKIT app's Vite setup, as the shell-foundation pattern has it: built for production by the browser test.
7
+ export default defineConfig({
8
+ root: fileURLToPath(new URL(".", import.meta.url)),
9
+ plugins: [createJskitClientBootstrapPlugin(), vue()],
10
+ server: { host: "127.0.0.1" },
11
+ preview: { host: "127.0.0.1" }
12
+ });
package/locales/en.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "back": "Back",
6
6
  "close": "Close",
7
7
  "dismiss": "Dismiss",
8
+ "more": "More actions",
8
9
  "reload": "Reload",
9
10
  "retry": "Retry"
10
11
  },
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@jskit-ai/shell-web",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "test": "node --test --test-concurrency=1"
6
+ "test": "jskit test"
7
7
  },
8
8
  "exports": {
9
9
  "./client": "./src/client/index.js",
@@ -25,8 +25,10 @@
25
25
  "./client/components/ShellMenuLinkItem": "./src/client/components/ShellMenuLinkItem.vue",
26
26
  "./client/components/ShellSurfaceAwareMenuLinkItem": "./src/client/components/ShellSurfaceAwareMenuLinkItem.vue",
27
27
  "./client/components/ShellTabLinkItem": "./src/client/components/ShellTabLinkItem.vue",
28
+ "./client/components/ShellSectionTabLinkItem": "./src/client/components/ShellSectionTabLinkItem.vue",
28
29
  "./client/components/ShellPageActions": "./src/client/components/ShellPageActions.vue",
29
30
  "./client/components/ShellPageAction": "./src/client/components/ShellPageAction.vue",
31
+ "./client/components/ShellPrimaryAction": "./src/client/components/ShellPrimaryAction.vue",
30
32
  "./client/components/ShellListDetail": "./src/client/components/ShellListDetail.vue",
31
33
  "./client/components/ShellUpButton": "./src/client/components/ShellUpButton.vue",
32
34
  "./client/components/ShellPageTitle": "./src/client/components/ShellPageTitle.vue",
@@ -34,6 +36,7 @@
34
36
  "./client/composables/useShellAppBar": "./src/client/composables/useShellAppBar.js",
35
37
  "./client/composables/useShellLayoutState": "./src/client/composables/useShellLayoutState.js",
36
38
  "./client/composables/useShellPageTitle": "./src/client/composables/useShellPageTitle.js",
39
+ "./client/composables/useShellPageClose": "./src/client/composables/useShellPageClose.js",
37
40
  "./client/composables/useShellWindowSizeClass": "./src/client/composables/useShellWindowSizeClass.js",
38
41
  "./client/providers/ShellWebClientProvider": "./src/client/providers/ShellWebClientProvider.js",
39
42
  "./client/types": "./src/client/types.js",
@@ -43,14 +46,14 @@
43
46
  "./locales/en.json": "./locales/en.json"
44
47
  },
45
48
  "dependencies": {
46
- "@jskit-ai/architecture-inspector": "0.1.8"
49
+ "@jskit-ai/architecture-inspector": "0.1.9"
47
50
  },
48
51
  "devDependencies": {
49
- "@jskit-ai/material-web": "0.1.1",
52
+ "@jskit-ai/material-web": "0.1.3",
50
53
  "@vue/compiler-sfc": "3.5.44"
51
54
  },
52
55
  "peerDependencies": {
53
- "@jskit-ai/kernel": "0.2.10",
56
+ "@jskit-ai/kernel": "0.2.11",
54
57
  "pinia": "^4.0.3",
55
58
  "vue": "^3.5.44",
56
59
  "vue-router": "^5.3.1",
@@ -94,6 +97,7 @@
94
97
  "@jskit-ai/shell-web/client/navigation/documentNavigation",
95
98
  "@jskit-ai/shell-web/client/composables/useShellAppBar",
96
99
  "@jskit-ai/shell-web/client/composables/useShellLayoutState",
100
+ "@jskit-ai/shell-web/client/composables/useShellPageClose",
97
101
  "@jskit-ai/shell-web/client/composables/useShellPageTitle",
98
102
  "@jskit-ai/shell-web/client/composables/useShellWindowSizeClass",
99
103
  "@jskit-ai/shell-web/client/types"
@@ -55,12 +55,17 @@ placement registry, topology, and adaptive smoke helper exported by
55
55
  border widths to `0` and gives navigation a tonal surface, for example
56
56
  `rgb(var(--v-theme-surface-container-low))` when the theme defines it.
57
57
  - `createShellRouter()` from `@jskit-ai/kernel/client` installs
58
- `shellScrollBehavior`: a new screen opens at the top (or its hash target),
59
- Back/Forward restore the saved position, and query, hash, tab or sub-view
60
- changes within the same page keep it. A tab or sub-view is the same page when
61
- both locations share a parent page record below the surface root. Pass
62
- `scrollBehavior` to replace it, or `scrollBehavior: false` to disable it; do
63
- not wrap the router or reset scroll in page components.
58
+ `shellScrollBehavior`: a new screen opens at the top (or its hash target,
59
+ below the target's `scroll-margin-top`), Back/Forward restore the saved
60
+ position, and query, hash, tab or sub-view changes within the same page keep
61
+ it. A tab or sub-view is the same page when both locations share a parent
62
+ page record below the surface root that draws a component, a layout hosting
63
+ the tabs; a folder's component-less record, as file routing creates for
64
+ `bookings/`, makes its pages different pages. Pass `scrollBehavior` to replace it
65
+ (calling `shellScrollBehavior` for what it leaves to the shell), or
66
+ `scrollBehavior: false` to disable it. A `createRouter` that replaces the
67
+ behaviour it is given throws, so never set one there; do not wrap the router
68
+ or reset scroll in page components.
64
69
  - The adaptive browser check closes navigation through its public close control.
65
70
 
66
71
  ## Example files
@@ -0,0 +1,42 @@
1
+ <script setup>
2
+ import ShellSectionTabLinkItem from "@jskit-ai/shell-web/client/components/ShellSectionTabLinkItem";
3
+
4
+ const props = defineProps({
5
+ label: {
6
+ type: String,
7
+ default: ""
8
+ },
9
+ to: {
10
+ type: String,
11
+ default: ""
12
+ },
13
+ icon: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ surface: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ scopedSuffix: {
22
+ type: String,
23
+ default: "/"
24
+ },
25
+ unscopedSuffix: {
26
+ type: String,
27
+ default: "/"
28
+ },
29
+ disabled: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+ exact: {
34
+ type: Boolean,
35
+ default: false
36
+ }
37
+ });
38
+ </script>
39
+
40
+ <template>
41
+ <ShellSectionTabLinkItem v-bind="props" />
42
+ </template>
@@ -14,7 +14,7 @@ import { RouterView } from "vue-router";
14
14
  </script>
15
15
 
16
16
  <template>
17
- <ShellLayout title="" subtitle="">
17
+ <ShellLayout>
18
18
  <RouterView />
19
19
  </ShellLayout>
20
20
  </template>
@@ -6,7 +6,7 @@ const message = "The page you requested does not exist.";
6
6
 
7
7
  <template>
8
8
  <!-- The shell's top app bar carries the title, and its navigation leads back into the app. -->
9
- <ShellLayout title="Not Found" subtitle="">
9
+ <ShellLayout title="Not Found">
10
10
  <section class="d-flex flex-column align-center text-center on-surface-variant py-16">
11
11
  <v-icon icon="$searchOff" size="48" />
12
12
  <p class="text-body-large mt-4 mb-0">{{ message }}</p>
@@ -35,6 +35,12 @@ a filename alone.
35
35
  - Child links share an explicit section owner.
36
36
  - Topology maps each semantic placement to concrete responsive outlets.
37
37
  - Placed components are registered by token through a client provider.
38
+ - Section navigation is Material 3 primary tabs: the section's `page.section-nav`
39
+ topology names a section-tab renderer (`ShellSectionTabLinkItem`, registered as
40
+ `local.main.ui.section-tab-link-item`), and the page draws the tab row (one
41
+ row over a 1dp `outline-variant` divider that scrolls sideways). A navigation
42
+ bar destination (`ShellTabLinkItem`) belongs to the shell's navigation bar
43
+ only; placed in a page it draws a section tab.
38
44
  - Compact navigation controls remain accessible and at least 48 CSS pixels.
39
45
  - Application source has no generated-file marker, receipt, or overwrite state.
40
46
 
@@ -8,10 +8,9 @@ definePage({ meta: { jskit: { title: "Reports" } } });
8
8
 
9
9
  <template>
10
10
  <section class="reports-section d-flex flex-column ga-4">
11
- <nav aria-label="Report sections">
12
- <v-tabs>
13
- <ShellOutlet target="reports:section-nav" />
14
- </v-tabs>
11
+ <!-- Material 3 primary tabs: one row over a divider, scrolling sideways when the tabs don't fit. -->
12
+ <nav class="reports-section__tabs" aria-label="Report sections">
13
+ <ShellOutlet target="reports:section-nav" />
15
14
  </nav>
16
15
 
17
16
  <div class="reports-section__content">
@@ -25,4 +24,10 @@ definePage({ meta: { jskit: { title: "Reports" } } });
25
24
  .reports-section__content {
26
25
  min-width: 0;
27
26
  }
27
+
28
+ .reports-section__tabs {
29
+ border-bottom: 1px solid rgb(var(--v-theme-outline-variant));
30
+ display: flex;
31
+ overflow-x: auto;
32
+ }
28
33
  </style>
@@ -4,6 +4,8 @@ function addPlacementTopology(value = {}) {
4
4
  placements.push(value);
5
5
  }
6
6
 
7
+ // The section's tabs: Material 3 primary tabs at every width (the shell's section-tab renderer), never navigation bar
8
+ // destinations, which belong to the shell's navigation bar alone.
7
9
  addPlacementTopology({
8
10
  id: "page.section-nav",
9
11
  owner: "reports",
@@ -12,15 +14,15 @@ addPlacementTopology({
12
14
  variants: {
13
15
  compact: {
14
16
  outlet: "reports:section-nav",
15
- renderers: { link: "local.main.ui.tab-link-item" }
17
+ renderers: { link: "local.main.ui.section-tab-link-item" }
16
18
  },
17
19
  medium: {
18
20
  outlet: "reports:section-nav",
19
- renderers: { link: "local.main.ui.tab-link-item" }
21
+ renderers: { link: "local.main.ui.section-tab-link-item" }
20
22
  },
21
23
  expanded: {
22
24
  outlet: "reports:section-nav",
23
- renderers: { link: "local.main.ui.tab-link-item" }
25
+ renderers: { link: "local.main.ui.section-tab-link-item" }
24
26
  }
25
27
  }
26
28
  });