@jskit-ai/shell-web 0.2.13 → 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.
- package/CHANGELOG.md +16 -0
- package/fixtures/adaptive-shell/src/ActionsFormPage.vue +22 -0
- package/fixtures/adaptive-shell/src/ActionsPage.vue +74 -0
- package/fixtures/adaptive-shell/src/App.vue +1 -0
- package/fixtures/adaptive-shell/src/ButtonStatesPage.vue +63 -0
- package/fixtures/adaptive-shell/src/ButtonsPage.vue +33 -3
- package/fixtures/adaptive-shell/src/ComponentsPage.vue +178 -0
- package/fixtures/adaptive-shell/src/FeedbackPage.vue +59 -0
- package/fixtures/adaptive-shell/src/ReportsPage.vue +29 -0
- package/fixtures/adaptive-shell/src/StatusButton.vue +17 -0
- package/fixtures/adaptive-shell/src/TitleClaim.vue +17 -0
- package/fixtures/adaptive-shell/src/main.js +131 -5
- package/fixtures/production-build/index.html +15 -0
- package/fixtures/production-build/package.json +5 -0
- package/fixtures/production-build/src/App.vue +27 -0
- package/fixtures/production-build/src/componentChunk.css +5 -0
- package/fixtures/production-build/src/main.js +10 -0
- package/fixtures/production-build/vite.config.mjs +12 -0
- package/locales/en.json +1 -0
- package/package.json +9 -5
- package/patterns/application-shell/PATTERN.md +11 -6
- package/patterns/application-shell/example/src/components/menus/SectionTabLinkItem.vue +42 -0
- package/patterns/application-shell/example/src/pages/home.vue +1 -1
- package/patterns/application-shell/example/src/views/NotFound.vue +1 -1
- package/patterns/page-and-placement/PATTERN.md +6 -0
- package/patterns/page-and-placement/example/src/pages/home/reports.vue +9 -4
- package/patterns/page-and-placement/example/src/placementTopology.js +5 -3
- package/src/client/components/ShellErrorHost.vue +20 -1
- package/src/client/components/ShellLayout.vue +42 -27
- package/src/client/components/ShellNavigationItem.vue +8 -3
- package/src/client/components/ShellNavigationScope.vue +1 -1
- package/src/client/components/ShellOutlet.vue +12 -1
- package/src/client/components/ShellPageAction.vue +107 -28
- package/src/client/components/ShellPageActionsTarget.vue +81 -2
- package/src/client/components/ShellPrimaryAction.vue +69 -0
- package/src/client/components/ShellSectionTabLinkItem.vue +104 -0
- package/src/client/components/ShellTabLinkItem.vue +18 -3
- package/src/client/components/ShellUpButton.vue +13 -8
- package/src/client/composables/useShellAppBar.js +10 -1
- package/src/client/composables/useShellPageClose.js +18 -0
- package/src/client/index.js +3 -0
- package/src/client/navigation/shellNavigationRuntime.js +50 -11
- package/src/client/navigation/usePaths.js +13 -0
- package/src/client/navigation/useShellNavigation.js +2 -0
- package/src/client/support/drawerPresentation.js +23 -6
- package/src/client/support/navigationPresentation.js +1 -1
- package/src/client/support/pageActions.js +126 -0
- package/src/test/adaptiveShellSmoke.js +31 -16
- package/test/adaptiveShell.browser.test.js +1019 -334
- package/test/drawerPresentation.test.js +20 -2
- package/test/linkResolver.test.js +4 -0
- package/test/materialBaselines.browser.test.js +142 -27
- package/test/packageRouteParent.test.js +41 -0
- package/test/pageActions.test.js +84 -0
- package/test/productionBuild.browser.test.js +98 -0
- package/test/settingsPlacementContract.test.js +11 -4
- package/test/shellNavigationRuntime.test.js +181 -0
|
@@ -9,16 +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";
|
|
12
15
|
import ButtonsPage from "./ButtonsPage.vue";
|
|
16
|
+
import ComponentsPage from "./ComponentsPage.vue";
|
|
13
17
|
import { adminTheme, theme } from "./theme/index.js";
|
|
14
18
|
import RecordListPage from "./RecordListPage.vue";
|
|
15
19
|
import RecordPage from "./RecordPage.vue";
|
|
20
|
+
import FeedbackPage from "./FeedbackPage.vue";
|
|
21
|
+
import ReportsPage from "./ReportsPage.vue";
|
|
16
22
|
import ScreenPage from "./ScreenPage.vue";
|
|
17
23
|
import StudioPage from "./StudioPage.vue";
|
|
18
24
|
import SettingsPage from "./SettingsPage.vue";
|
|
25
|
+
import StatusButton from "./StatusButton.vue";
|
|
19
26
|
import ShellMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellMenuLinkItem";
|
|
20
27
|
import ShellSurfaceAwareMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellSurfaceAwareMenuLinkItem";
|
|
21
28
|
import ShellTabLinkItem from "@jskit-ai/shell-web/client/components/ShellTabLinkItem";
|
|
29
|
+
import ShellSectionTabLinkItem from "@jskit-ai/shell-web/client/components/ShellSectionTabLinkItem";
|
|
22
30
|
import { useShellLayoutStore } from "../../../src/client/stores/useShellLayoutStore.js";
|
|
23
31
|
import { createWebPlacementRuntime } from "../../../src/client/placement/runtime.js";
|
|
24
32
|
import { SHELL_WEB_PLACEMENT_RUNTIME_KEY } from "../../../src/client/placement/inject.js";
|
|
@@ -37,7 +45,9 @@ import { silentLogger } from "@jskit-ai/kernel/shared/support/silentLogger";
|
|
|
37
45
|
const COMPONENTS = new Map([
|
|
38
46
|
["fixture.menu-link", ShellMenuLinkItem],
|
|
39
47
|
["fixture.surface-menu-link", ShellSurfaceAwareMenuLinkItem],
|
|
40
|
-
["fixture.tab-link", ShellTabLinkItem]
|
|
48
|
+
["fixture.tab-link", ShellTabLinkItem],
|
|
49
|
+
["fixture.section-tab-link", ShellSectionTabLinkItem],
|
|
50
|
+
["fixture.status-button", StatusButton]
|
|
41
51
|
]);
|
|
42
52
|
|
|
43
53
|
// Main navigation as literal data, one placement per destination, as jskit check reads it.
|
|
@@ -122,12 +132,74 @@ const placements = [
|
|
|
122
132
|
order: 50,
|
|
123
133
|
props: { label: "Rostering", surface: "admin", scopedSuffix: "/rostering", unscopedSuffix: "/rostering" }
|
|
124
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,
|
|
161
|
+
props: {
|
|
162
|
+
label: "Quarterly performance",
|
|
163
|
+
surface: "home",
|
|
164
|
+
scopedSuffix: "/reports/quarterly",
|
|
165
|
+
unscopedSuffix: "/reports/quarterly"
|
|
166
|
+
}
|
|
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
|
+
},
|
|
125
196
|
{
|
|
126
197
|
id: "fixture.help",
|
|
127
198
|
target: "shell.secondary-nav",
|
|
128
199
|
kind: "link",
|
|
129
200
|
componentToken: "fixture.menu-link",
|
|
130
|
-
|
|
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"],
|
|
131
203
|
order: 100,
|
|
132
204
|
props: {
|
|
133
205
|
label: "Help and support",
|
|
@@ -136,8 +208,24 @@ const placements = [
|
|
|
136
208
|
}
|
|
137
209
|
];
|
|
138
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
|
+
|
|
139
226
|
const menuRenderers = Object.freeze({ link: "fixture.surface-menu-link" });
|
|
140
227
|
const tabRenderers = Object.freeze({ link: "fixture.tab-link" });
|
|
228
|
+
const sectionTabRenderers = Object.freeze({ link: "fixture.section-tab-link" });
|
|
141
229
|
const placementTopology = [
|
|
142
230
|
{
|
|
143
231
|
id: "shell.primary-nav",
|
|
@@ -157,22 +245,52 @@ const placementTopology = [
|
|
|
157
245
|
medium: { outlet: "shell-layout:secondary-menu", renderers: menuRenderers },
|
|
158
246
|
expanded: { outlet: "shell-layout:secondary-menu", renderers: menuRenderers }
|
|
159
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
|
+
}
|
|
160
277
|
}
|
|
161
278
|
];
|
|
162
279
|
|
|
163
280
|
const placementRuntime = createWebPlacementRuntime({ components: COMPONENTS, logger: silentLogger });
|
|
164
|
-
placementRuntime.replacePlacements(placements);
|
|
281
|
+
placementRuntime.replacePlacements([...placements, ...statusPlacements]);
|
|
165
282
|
placementRuntime.replacePlacementTopology(placementTopology);
|
|
166
283
|
placementRuntime.setContext({
|
|
167
284
|
surfaceConfig: {
|
|
168
285
|
tenancyMode: "path",
|
|
169
286
|
defaultSurfaceId: "home",
|
|
170
|
-
enabledSurfaceIds: ["home", "admin", "account"],
|
|
287
|
+
enabledSurfaceIds: ["home", "admin", "account", "solo"],
|
|
171
288
|
surfacesById: {
|
|
172
289
|
home: { id: "home", routeBase: "/home", enabled: true },
|
|
173
290
|
admin: { id: "admin", routeBase: "/w/:workspaceSlug/admin", enabled: true },
|
|
174
291
|
// A surface whose shell has no navigation, as an account page's.
|
|
175
|
-
account: { id: "account", routeBase: "/account", enabled: true }
|
|
292
|
+
account: { id: "account", routeBase: "/account", enabled: true },
|
|
293
|
+
solo: { id: "solo", routeBase: "/solo", enabled: true }
|
|
176
294
|
}
|
|
177
295
|
}
|
|
178
296
|
});
|
|
@@ -217,12 +335,20 @@ const routes = [
|
|
|
217
335
|
meta: { kind: "suppliers", jskit: { parent: "/suppliers" } }
|
|
218
336
|
},
|
|
219
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" } } },
|
|
220
342
|
// A layout that draws its own top app bar from the shell's pieces.
|
|
221
343
|
{ path: "/home/studio", component: StudioPage, meta: { ownBar: true, jskit: { title: "Studio" } } },
|
|
222
344
|
{ path: "/home/studio/:id", component: StudioPage, meta: { ownBar: true, jskit: { parent: "/studio" } } },
|
|
223
345
|
{ path: "/home/:section?", component: ScreenPage, meta: { title: "Home surface" } },
|
|
224
346
|
{ path: "/w/:workspaceSlug/admin/:section?", component: ScreenPage, meta: { title: "Admin surface" } },
|
|
225
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" } } },
|
|
226
352
|
{
|
|
227
353
|
path: "/account",
|
|
228
354
|
component: ScreenPage,
|
|
@@ -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,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,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
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/shell-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"test": "
|
|
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.
|
|
49
|
+
"@jskit-ai/architecture-inspector": "0.1.9"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@jskit-ai/material-web": "0.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.
|
|
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
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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>
|
|
@@ -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"
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
});
|
|
@@ -72,9 +72,14 @@ const {
|
|
|
72
72
|
</div>
|
|
73
73
|
</div>
|
|
74
74
|
|
|
75
|
+
<!-- Material 3 keeps a snackbar clear of the actions it reports on. Vuetify places it inside the layout, above the
|
|
76
|
+
navigation bar and a FAB that takes layout room (`<v-fab app layout>`). On a phone it is centred there; on
|
|
77
|
+
wider windows it starts at the content's start edge and takes at most half its width, clear of end-aligned
|
|
78
|
+
FABs and form actions (Save), so a person can press Save again while it shows. -->
|
|
75
79
|
<v-snackbar
|
|
76
80
|
:model-value="snackbarOpen"
|
|
77
|
-
|
|
81
|
+
class="shell-error-host__snackbar"
|
|
82
|
+
location="bottom start"
|
|
78
83
|
:timeout="resolveTimeout(displayedSnackbarEntry)"
|
|
79
84
|
:vertical="actionsFor(displayedSnackbarEntry).length > 1"
|
|
80
85
|
@update:model-value="onSnackbarModelValue"
|
|
@@ -181,6 +186,20 @@ const {
|
|
|
181
186
|
font-size: 20px;
|
|
182
187
|
}
|
|
183
188
|
|
|
189
|
+
/* The snackbar is teleported out of this component, so its rules are written for its own classes. Compact windows
|
|
190
|
+
(below 600dp) centre it; wider ones keep it at the start, at most half the content's width. */
|
|
191
|
+
@media (max-width: 599.98px) {
|
|
192
|
+
:global(.shell-error-host__snackbar.v-snackbar--start) {
|
|
193
|
+
justify-content: center;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media (min-width: 600px) {
|
|
198
|
+
:global(.shell-error-host__snackbar .v-snackbar__wrapper) {
|
|
199
|
+
max-width: min(672px, 50%);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
184
203
|
@media (max-width: 600px) {
|
|
185
204
|
.shell-error-host__banners {
|
|
186
205
|
padding: 8px;
|