@jskit-ai/shell-web 0.2.10 → 0.2.11
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 +9 -0
- package/fixtures/adaptive-shell/src/App.vue +2 -0
- package/fixtures/adaptive-shell/src/RecordListPage.vue +22 -0
- package/fixtures/adaptive-shell/src/RecordPage.vue +30 -0
- package/fixtures/adaptive-shell/src/ScreenPage.vue +7 -3
- package/fixtures/adaptive-shell/src/SettingsPage.vue +24 -0
- package/fixtures/adaptive-shell/src/main.js +60 -55
- package/fixtures/adaptive-shell/src/records.js +13 -0
- package/fixtures/adaptive-shell/src/theme/index.js +3 -0
- package/locales/en.json +1 -0
- package/package.json +17 -5
- package/patterns/application-shell/PATTERN.md +3 -1
- package/patterns/application-shell/example/expected-existing/src/pages/home/index.vue +5 -18
- package/patterns/application-shell/example/expected-existing/src/views/NotFound.vue +14 -0
- package/patterns/application-shell/example/src/pages/home/index.vue +21 -57
- package/patterns/application-shell/example/src/pages/home/settings/general/index.vue +24 -19
- package/patterns/application-shell/example/src/pages/home/settings.vue +27 -84
- package/patterns/application-shell/example/src/views/NotFound.vue +15 -0
- package/patterns/page-and-placement/example/src/components/SyncStatusElement.vue +2 -2
- package/patterns/page-and-placement/example/src/pages/home/reports/activity.vue +1 -1
- package/patterns/page-and-placement/example/src/pages/home/reports/overview.vue +1 -1
- package/patterns/page-and-placement/example/src/pages/home/reports.vue +6 -3
- package/patterns/page-and-placement/example/src/placement.js +1 -1
- package/src/client/components/ShellErrorHost.vue +13 -15
- package/src/client/components/ShellLayout.vue +388 -186
- package/src/client/components/ShellListDetail.vue +77 -0
- package/src/client/components/ShellMenuLinkItem.vue +10 -24
- package/src/client/components/ShellNavigationItem.vue +175 -0
- package/src/client/components/ShellNavigationScope.vue +18 -0
- package/src/client/components/ShellOutlet.vue +1 -1
- package/src/client/components/ShellOutletMenuWidget.vue +2 -2
- package/src/client/components/ShellPageAction.vue +91 -0
- package/src/client/components/ShellPageActions.vue +32 -0
- package/src/client/components/ShellSurfaceAwareMenuLinkItem.vue +10 -24
- package/src/client/components/ShellTabLinkItem.vue +77 -3
- package/src/client/composables/useShellDrawer.js +28 -18
- package/src/client/composables/useShellPageTitle.js +15 -0
- package/src/client/composables/useShellRouteTransition.js +1 -1
- package/src/client/composables/useShellWindowSizeClass.js +21 -0
- package/src/client/error/presentation.js +3 -5
- package/src/client/index.js +7 -0
- package/src/client/lib/menuIcons.js +21 -65
- package/src/client/navigation/documentNavigation.js +38 -0
- package/src/client/navigation/shellNavigationRuntime.js +480 -0
- package/src/client/navigation/useShellNavigation.js +94 -0
- package/src/client/providers/ShellWebClientProvider.js +11 -0
- package/src/client/support/drawerPresentation.js +9 -4
- package/src/client/support/drawerWidth.js +18 -1
- package/src/client/support/navigationPresentation.js +40 -0
- package/src/client/support/shellLayoutClass.js +6 -25
- package/src/client/support/windowSizeClass.js +29 -0
- package/src/test/adaptiveShellSmoke.js +43 -16
- package/src/test/shellNavigation.js +32 -0
- package/test/adaptiveShell.browser.test.js +207 -111
- package/test/clientUpdate.test.js +6 -1
- package/test/drawerPresentation.test.js +7 -7
- package/test/errorPresentation.test.js +4 -5
- package/test/materialBaselines.browser.test.js +96 -0
- package/test/menuIcons.test.js +14 -22
- package/test/outletMenuWidgetContract.test.js +2 -3
- package/test/playwrightContract.test.js +3 -1
- package/test/provider.test.js +9 -1
- package/test/settingsPlacementContract.test.js +33 -28
- package/test/shellGestureSupport.test.js +21 -9
- package/test/translation.test.js +2 -2
- package/test/useShellDrawer.test.js +20 -5
- package/test/useShellRouteTransition.test.js +3 -3
- package/patterns/application-shell/example/src/pages/home/settings/index.vue +0 -7
- package/src/client/components/ShellNavigationTooltip.vue +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Exact Material 3 out of the box, in light and dark, with `@jskit-ai/material-web`: the top app bar carries the page's title (`meta.jskit.title`, or `useShellPageTitle()`), its Up arrow and its actions (`ShellPageActions` and `ShellPageAction`, one of them `primary`; `href` makes an action a link that leaves the app); window size classes (`useShellWindowSizeClass()`: compact, medium, expanded, large) pick the navigation bar, the navigation rail with a modal drawer, or the standard drawer; the active destination has a filled icon in its indicator; snackbars are inverse-surface, their actions 40dp text buttons without a fixed 48px height, and banners use their severity's container colours.
|
|
6
|
+
- Up navigation per the Material 3 navigation spec: a page declares the page it belongs to as `meta.jskit.parent` (a path on its surface, or `{ surface, path }`), and the shell's arrow returns to the page the person came from (with its scroll position, state and focus) or else to that parent; main destinations reset the trail and show no arrow, and a list-detail page shows none beside its list. `useShellNavigation()` gives `{ canGoUp, upTarget, up, finish, pageUnavailable }`: `finish(target)` leaves a finished form by replacing its history entry, and `pageUnavailable()` sends a page Up returned to and whose record is gone to its parent. `@jskit-ai/shell-web/test/shellNavigation` has the browser checks.
|
|
7
|
+
- The application-shell pattern's not-found view renders in the shell, so the top app bar carries its title and the navigation leads back into the app; the shell foundation has it too.
|
|
8
|
+
- `ShellListDetail` lays out list-detail pages such as settings: the list beside the open detail on expanded windows (with the landing child as the empty detail), one pane at a time on narrower ones. The foundation and shell patterns' settings pages use it instead of redirecting their landing page to the first section.
|
|
9
|
+
- The drawer is 360dp wide by default; `drawerWidth="content"` fits it to its labels. A modal drawer (compact and medium windows) opens over the app bar and closes from its scrim or Escape. The drawer's divider shows only between primary and secondary destinations. The `--shell-chrome-*` custom properties, the rail and drawer item tooltips and `@mdi/js` are gone.
|
|
10
|
+
- Upgrading: see the guide's [Move an app to the Material 3 defaults](https://mobily-enterprises.github.io/jskit-ai/guide/app-setup/material-3-migration).
|
|
11
|
+
|
|
3
12
|
## 0.2.0 - 2026-10-29
|
|
4
13
|
|
|
5
14
|
- Translation ready: every user-visible text is a message key with its English in `locales/en.json`, so an app translates it by supplying translation files only. With no translations, texts and behaviour are unchanged. See the guide "Translating a JSKIT app".
|
|
@@ -13,6 +13,7 @@ const surfaceLabel = computed(() => surface.value === "admin" ? "Admin" : "Home"
|
|
|
13
13
|
const themeMode = computed(() => route.query.theme === "dark" ? "dark" : "light");
|
|
14
14
|
const railWidth = computed(() => Number(route.query.railWidth) || undefined);
|
|
15
15
|
const navigationItemSpacing = computed(() => Number(route.query.navigationItemSpacing) || undefined);
|
|
16
|
+
const drawerWidth = computed(() => (route.query.drawerWidth === "content" ? "content" : undefined));
|
|
16
17
|
|
|
17
18
|
watchEffect(function applyFixtureTheme() {
|
|
18
19
|
const themeName = `${surface.value}-${themeMode.value}`;
|
|
@@ -31,6 +32,7 @@ watchEffect(function applyFixtureTheme() {
|
|
|
31
32
|
:surface-label="surfaceLabel"
|
|
32
33
|
:rail-width="railWidth"
|
|
33
34
|
:navigation-item-spacing="navigationItemSpacing"
|
|
35
|
+
:drawer-width="drawerWidth"
|
|
34
36
|
>
|
|
35
37
|
<RouterView />
|
|
36
38
|
</ShellLayout>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useRoute } from "vue-router";
|
|
4
|
+
import { usePaths } from "../../../src/client/navigation/usePaths.js";
|
|
5
|
+
import { records } from "./records.js";
|
|
6
|
+
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const paths = usePaths();
|
|
9
|
+
const kind = computed(() => String(route.meta.kind));
|
|
10
|
+
const items = computed(() => records[kind.value] || []);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<v-list lines="one" bg-color="transparent">
|
|
15
|
+
<v-list-item
|
|
16
|
+
v-for="item in items"
|
|
17
|
+
:key="item.id"
|
|
18
|
+
:to="paths.page(`/${kind}/${item.id}`)"
|
|
19
|
+
:title="item.name"
|
|
20
|
+
/>
|
|
21
|
+
</v-list>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { RouterLink, useRoute } from "vue-router";
|
|
4
|
+
import { useShellPageTitle } from "../../../src/client/composables/useShellPageTitle.js";
|
|
5
|
+
import { usePaths } from "../../../src/client/navigation/usePaths.js";
|
|
6
|
+
import { records } from "./records.js";
|
|
7
|
+
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const paths = usePaths();
|
|
10
|
+
const kind = computed(() => String(route.meta.kind));
|
|
11
|
+
const record = computed(() => (records[kind.value] || []).find((item) => item.id === route.params.id) || null);
|
|
12
|
+
const related = computed(() => {
|
|
13
|
+
if (!record.value) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return kind.value === "contacts"
|
|
17
|
+
? { label: "Supplier", to: paths.page(`/suppliers/${record.value.supplier}`) }
|
|
18
|
+
: { label: "Contact", to: paths.page(`/contacts/${record.value.contact}`) };
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
useShellPageTitle(() => record.value?.name || "Not found");
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<section>
|
|
26
|
+
<p v-if="related">
|
|
27
|
+
<RouterLink :to="related.to">{{ related.label }}</RouterLink>
|
|
28
|
+
</p>
|
|
29
|
+
</section>
|
|
30
|
+
</template>
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
3
|
import { useRoute } from "vue-router";
|
|
4
|
+
import { useShellPageTitle } from "../../../src/client/composables/useShellPageTitle.js";
|
|
4
5
|
|
|
5
6
|
const route = useRoute();
|
|
6
7
|
const title = computed(() => String(route.meta.title || "Shell fixture"));
|
|
8
|
+
const bare = computed(() => route.meta.bare === true);
|
|
7
9
|
const answer = ref("");
|
|
8
10
|
const validation = ref("");
|
|
11
|
+
|
|
12
|
+
useShellPageTitle(title);
|
|
9
13
|
</script>
|
|
10
14
|
|
|
11
15
|
<template>
|
|
12
|
-
<
|
|
13
|
-
<h1>{{ title }}</h1>
|
|
16
|
+
<section v-if="!route.meta.empty" tabindex="-1">
|
|
17
|
+
<h1 v-if="bare">{{ title }}</h1>
|
|
14
18
|
<p>Package-owned browser fixture for the adaptive shell contract.</p>
|
|
15
19
|
<form @submit.prevent="validation = 'Please review this answer.'">
|
|
16
20
|
<label>Unsaved answer <input v-model="answer" name="answer"></label>
|
|
@@ -21,5 +25,5 @@ const validation = ref("");
|
|
|
21
25
|
<button type="submit">Validate answer</button>
|
|
22
26
|
<p role="status">{{ validation }}</p>
|
|
23
27
|
</form>
|
|
24
|
-
</
|
|
28
|
+
</section>
|
|
25
29
|
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { RouterView, useRoute } from "vue-router";
|
|
4
|
+
import ShellListDetail from "../../../src/client/components/ShellListDetail.vue";
|
|
5
|
+
import ShellMenuLinkItem from "../../../src/client/components/ShellMenuLinkItem.vue";
|
|
6
|
+
import { usePaths } from "../../../src/client/navigation/usePaths.js";
|
|
7
|
+
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const paths = usePaths();
|
|
10
|
+
const detailOpen = computed(() => route.path !== "/home/settings");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<ShellListDetail :detail-open="detailOpen">
|
|
15
|
+
<template #list>
|
|
16
|
+
<v-list nav aria-label="Settings sections">
|
|
17
|
+
<ShellMenuLinkItem label="General" :to="paths.page('/settings/general')" />
|
|
18
|
+
</v-list>
|
|
19
|
+
</template>
|
|
20
|
+
<template #detail>
|
|
21
|
+
<RouterView />
|
|
22
|
+
</template>
|
|
23
|
+
</ShellListDetail>
|
|
24
|
+
</template>
|
|
@@ -4,10 +4,16 @@ import { createRouter, createWebHistory } from "vue-router";
|
|
|
4
4
|
import { createVuetify } from "vuetify";
|
|
5
5
|
import * as vuetifyComponents from "vuetify/components";
|
|
6
6
|
import * as vuetifyDirectives from "vuetify/directives";
|
|
7
|
-
import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
|
|
8
7
|
import "vuetify/styles";
|
|
8
|
+
import "@jskit-ai/material-web/client/material.css";
|
|
9
|
+
import { materialThemes, createMaterialVuetifyOptions } from "@jskit-ai/material-web/client";
|
|
10
|
+
import { shellScrollBehavior } from "@jskit-ai/kernel/client";
|
|
9
11
|
import App from "./App.vue";
|
|
12
|
+
import { adminTheme, theme } from "./theme/index.js";
|
|
13
|
+
import RecordListPage from "./RecordListPage.vue";
|
|
14
|
+
import RecordPage from "./RecordPage.vue";
|
|
10
15
|
import ScreenPage from "./ScreenPage.vue";
|
|
16
|
+
import SettingsPage from "./SettingsPage.vue";
|
|
11
17
|
import ShellMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellMenuLinkItem";
|
|
12
18
|
import ShellSurfaceAwareMenuLinkItem from "@jskit-ai/shell-web/client/components/ShellSurfaceAwareMenuLinkItem";
|
|
13
19
|
import ShellTabLinkItem from "@jskit-ai/shell-web/client/components/ShellTabLinkItem";
|
|
@@ -16,6 +22,10 @@ import { createWebPlacementRuntime } from "../../../src/client/placement/runtime
|
|
|
16
22
|
import { SHELL_WEB_PLACEMENT_RUNTIME_KEY } from "../../../src/client/placement/inject.js";
|
|
17
23
|
import { SHELL_WEB_ERROR_RUNTIME_KEY } from "../../../src/client/error/inject.js";
|
|
18
24
|
import { SHELL_WEB_REFRESH_RUNTIME_KEY } from "../../../src/client/runtime/refreshRuntime.js";
|
|
25
|
+
import {
|
|
26
|
+
SHELL_NAVIGATION_RUNTIME_KEY,
|
|
27
|
+
createShellNavigationRuntime
|
|
28
|
+
} from "../../../src/client/navigation/shellNavigationRuntime.js";
|
|
19
29
|
import { createErrorRuntime } from "../../../src/client/error/runtime.js";
|
|
20
30
|
import { createDefaultMaterialErrorPresenters } from "../../../src/client/error/presenters.js";
|
|
21
31
|
import { createErrorPresentationStore } from "../../../src/client/error/store.js";
|
|
@@ -52,8 +62,12 @@ function createSurfacePlacements(surface) {
|
|
|
52
62
|
? createSurfacePlacement(surface, 20, "Settings", "/settings")
|
|
53
63
|
: createSurfacePlacement(surface, 20, "Assistant", "/assistant"),
|
|
54
64
|
createSurfacePlacement(surface, 30, "Contacts", "/contacts"),
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
surface === "home"
|
|
66
|
+
? createSurfacePlacement(surface, 40, "Suppliers", "/suppliers")
|
|
67
|
+
: createSurfacePlacement(surface, 40, "Bookings", "/bookings"),
|
|
68
|
+
surface === "home"
|
|
69
|
+
? createSurfacePlacement(surface, 50, "Bookings", "/bookings")
|
|
70
|
+
: createSurfacePlacement(surface, 50, "Rostering", "/rostering")
|
|
57
71
|
];
|
|
58
72
|
}
|
|
59
73
|
|
|
@@ -113,72 +127,62 @@ placementRuntime.setContext({
|
|
|
113
127
|
}
|
|
114
128
|
});
|
|
115
129
|
|
|
130
|
+
// A record a test has marked unavailable (deleted, or no longer the person's to see) redirects, as a guard does.
|
|
131
|
+
function refuseBlockedRecord(to) {
|
|
132
|
+
return (window.__fixtureBlockedRecords || []).includes(String(to.params.id)) ? "/sign-in" : true;
|
|
133
|
+
}
|
|
134
|
+
|
|
116
135
|
const routes = [
|
|
117
136
|
{ path: "/", redirect: "/home" },
|
|
118
|
-
{
|
|
119
|
-
|
|
137
|
+
{
|
|
138
|
+
path: "/home/settings",
|
|
139
|
+
component: SettingsPage,
|
|
140
|
+
meta: { jskit: { title: "Settings" } },
|
|
141
|
+
children: [
|
|
142
|
+
{ path: "", component: ScreenPage, meta: { title: "Settings", empty: true } },
|
|
143
|
+
{
|
|
144
|
+
path: "general",
|
|
145
|
+
component: ScreenPage,
|
|
146
|
+
meta: { title: "General settings", jskit: { title: "General settings", parent: "/settings" } }
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{ path: "/home/contacts", component: RecordListPage, meta: { kind: "contacts", jskit: { title: "Contacts" } } },
|
|
151
|
+
{
|
|
152
|
+
path: "/home/contacts/:id",
|
|
153
|
+
component: RecordPage,
|
|
154
|
+
beforeEnter: refuseBlockedRecord,
|
|
155
|
+
meta: { kind: "contacts", jskit: { parent: "/contacts" } }
|
|
156
|
+
},
|
|
157
|
+
{ path: "/home/suppliers", component: RecordListPage, meta: { kind: "suppliers", jskit: { title: "Suppliers" } } },
|
|
158
|
+
{
|
|
159
|
+
path: "/home/suppliers/:id",
|
|
160
|
+
component: RecordPage,
|
|
161
|
+
beforeEnter: refuseBlockedRecord,
|
|
162
|
+
meta: { kind: "suppliers", jskit: { parent: "/suppliers" } }
|
|
163
|
+
},
|
|
120
164
|
{ path: "/home/:section?", component: ScreenPage, meta: { title: "Home surface" } },
|
|
121
165
|
{ path: "/w/:workspaceSlug/admin/:section?", component: ScreenPage, meta: { title: "Admin surface" } },
|
|
122
166
|
{ path: "/help", component: ScreenPage, meta: { title: "Help and support" } },
|
|
123
167
|
{ path: "/sign-in", component: ScreenPage, meta: { title: "Sign in", bare: true } }
|
|
124
168
|
];
|
|
125
|
-
const router = createRouter({ history: createWebHistory(), routes });
|
|
169
|
+
const router = createRouter({ history: createWebHistory(), routes, scrollBehavior: shellScrollBehavior });
|
|
170
|
+
const navigationRuntime = createShellNavigationRuntime({ router });
|
|
171
|
+
navigationRuntime.install();
|
|
126
172
|
const pinia = createPinia();
|
|
173
|
+
const material = createMaterialVuetifyOptions(theme);
|
|
174
|
+
const adminThemes = materialThemes(adminTheme.seed);
|
|
127
175
|
const vuetify = createVuetify({
|
|
176
|
+
...material,
|
|
128
177
|
components: vuetifyComponents,
|
|
129
178
|
directives: vuetifyDirectives,
|
|
130
|
-
icons: {
|
|
131
|
-
defaultSet: "mdi",
|
|
132
|
-
aliases,
|
|
133
|
-
sets: { mdi }
|
|
134
|
-
},
|
|
135
179
|
theme: {
|
|
136
180
|
defaultTheme: "home-light",
|
|
137
181
|
themes: {
|
|
138
|
-
"home-light":
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
surface: "#FFFFFF",
|
|
143
|
-
"on-surface": "#34413F",
|
|
144
|
-
"surface-variant": "#E2E8E5",
|
|
145
|
-
"on-surface-variant": "#52605F",
|
|
146
|
-
primary: "#006C51"
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
"admin-light": {
|
|
150
|
-
dark: false,
|
|
151
|
-
colors: {
|
|
152
|
-
background: "#F5F6F4",
|
|
153
|
-
surface: "#FFFFFF",
|
|
154
|
-
"on-surface": "#34413F",
|
|
155
|
-
"surface-variant": "#424242",
|
|
156
|
-
"on-surface-variant": "#52605F",
|
|
157
|
-
primary: "#006C51"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"home-dark": {
|
|
161
|
-
dark: true,
|
|
162
|
-
colors: {
|
|
163
|
-
background: "#101513",
|
|
164
|
-
surface: "#18201D",
|
|
165
|
-
"on-surface": "#E1E9E5",
|
|
166
|
-
"surface-variant": "#2B3632",
|
|
167
|
-
"on-surface-variant": "#BEC9C4",
|
|
168
|
-
primary: "#67DBB7"
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
"admin-dark": {
|
|
172
|
-
dark: true,
|
|
173
|
-
colors: {
|
|
174
|
-
background: "#111412",
|
|
175
|
-
surface: "#1A201D",
|
|
176
|
-
"on-surface": "#E2E8E4",
|
|
177
|
-
"surface-variant": "#333936",
|
|
178
|
-
"on-surface-variant": "#606864",
|
|
179
|
-
primary: "#67DBB7"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
+
"home-light": material.theme.themes.light,
|
|
183
|
+
"home-dark": material.theme.themes.dark,
|
|
184
|
+
"admin-light": adminThemes.light,
|
|
185
|
+
"admin-dark": adminThemes.dark
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
});
|
|
@@ -188,6 +192,7 @@ app.use(pinia);
|
|
|
188
192
|
app.use(router);
|
|
189
193
|
app.use(vuetify);
|
|
190
194
|
app.provide(SHELL_WEB_PLACEMENT_RUNTIME_KEY, placementRuntime);
|
|
195
|
+
app.provide(SHELL_NAVIGATION_RUNTIME_KEY, navigationRuntime);
|
|
191
196
|
const errorStore = createErrorPresentationStore();
|
|
192
197
|
const errorRuntime = createErrorRuntime({
|
|
193
198
|
presenters: createDefaultMaterialErrorPresenters({ store: errorStore }),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The fixture's records: enough contacts that the list scrolls, each pointing at a supplier and back.
|
|
2
|
+
const contacts = [
|
|
3
|
+
{ id: "ada", name: "Ada Lovelace", supplier: "acme" },
|
|
4
|
+
...Array.from({ length: 40 }, (_, index) => ({ id: `contact-${index + 1}`, name: `Contact ${index + 1}`, supplier: "globex" }))
|
|
5
|
+
];
|
|
6
|
+
const suppliers = [
|
|
7
|
+
{ id: "acme", name: "Acme Supplies", contact: "ada" },
|
|
8
|
+
{ id: "globex", name: "Globex", contact: "contact-1" }
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const records = Object.freeze({ contacts, suppliers });
|
|
12
|
+
|
|
13
|
+
export { records };
|
package/locales/en.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/shell-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test --test-concurrency=1"
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"./client/navigation/linkResolver": "./src/client/navigation/linkResolver.js",
|
|
16
16
|
"./client/navigation/usePaths": "./src/client/navigation/usePaths.js",
|
|
17
17
|
"./client/navigation/useSurfaceRouteContext": "./src/client/navigation/useSurfaceRouteContext.js",
|
|
18
|
+
"./client/navigation/useShellNavigation": "./src/client/navigation/useShellNavigation.js",
|
|
19
|
+
"./client/navigation/documentNavigation": "./src/client/navigation/documentNavigation.js",
|
|
18
20
|
"./client/components/ShellLayout": "./src/client/components/ShellLayout.vue",
|
|
19
21
|
"./client/components/ShellOutlet": "./src/client/components/ShellOutlet.vue",
|
|
20
22
|
"./client/components/ShellOutletMenuWidget": "./src/client/components/ShellOutletMenuWidget.vue",
|
|
@@ -23,26 +25,32 @@
|
|
|
23
25
|
"./client/components/ShellMenuLinkItem": "./src/client/components/ShellMenuLinkItem.vue",
|
|
24
26
|
"./client/components/ShellSurfaceAwareMenuLinkItem": "./src/client/components/ShellSurfaceAwareMenuLinkItem.vue",
|
|
25
27
|
"./client/components/ShellTabLinkItem": "./src/client/components/ShellTabLinkItem.vue",
|
|
28
|
+
"./client/components/ShellPageActions": "./src/client/components/ShellPageActions.vue",
|
|
29
|
+
"./client/components/ShellPageAction": "./src/client/components/ShellPageAction.vue",
|
|
30
|
+
"./client/components/ShellListDetail": "./src/client/components/ShellListDetail.vue",
|
|
26
31
|
"./client/composables/useShellLayoutState": "./src/client/composables/useShellLayoutState.js",
|
|
32
|
+
"./client/composables/useShellPageTitle": "./src/client/composables/useShellPageTitle.js",
|
|
33
|
+
"./client/composables/useShellWindowSizeClass": "./src/client/composables/useShellWindowSizeClass.js",
|
|
27
34
|
"./client/providers/ShellWebClientProvider": "./src/client/providers/ShellWebClientProvider.js",
|
|
28
35
|
"./client/types": "./src/client/types.js",
|
|
29
36
|
"./test/adaptiveShellSmoke": "./src/test/adaptiveShellSmoke.js",
|
|
37
|
+
"./test/shellNavigation": "./src/test/shellNavigation.js",
|
|
30
38
|
"./architecture": "./src/architecture/inspectVueArchitecture.js",
|
|
31
39
|
"./locales/en.json": "./locales/en.json"
|
|
32
40
|
},
|
|
33
41
|
"dependencies": {
|
|
34
|
-
"@jskit-ai/architecture-inspector": "0.1.
|
|
35
|
-
"@mdi/js": "^7.4.47"
|
|
42
|
+
"@jskit-ai/architecture-inspector": "0.1.8"
|
|
36
43
|
},
|
|
37
44
|
"devDependencies": {
|
|
45
|
+
"@jskit-ai/material-web": "0.1.0",
|
|
38
46
|
"@vue/compiler-sfc": "3.5.44"
|
|
39
47
|
},
|
|
40
48
|
"peerDependencies": {
|
|
41
|
-
"@jskit-ai/kernel": "0.2.
|
|
49
|
+
"@jskit-ai/kernel": "0.2.10",
|
|
42
50
|
"pinia": "^4.0.3",
|
|
43
51
|
"vue": "^3.5.44",
|
|
44
52
|
"vue-router": "^5.3.1",
|
|
45
|
-
"vuetify": "^4.
|
|
53
|
+
"vuetify": "^4.3.0"
|
|
46
54
|
},
|
|
47
55
|
"description": "Web shell layout runtime with outlet-based placement contributions.",
|
|
48
56
|
"jskit": {
|
|
@@ -78,7 +86,11 @@
|
|
|
78
86
|
"@jskit-ai/shell-web/client/navigation/linkResolver",
|
|
79
87
|
"@jskit-ai/shell-web/client/navigation/usePaths",
|
|
80
88
|
"@jskit-ai/shell-web/client/navigation/useSurfaceRouteContext",
|
|
89
|
+
"@jskit-ai/shell-web/client/navigation/useShellNavigation",
|
|
90
|
+
"@jskit-ai/shell-web/client/navigation/documentNavigation",
|
|
81
91
|
"@jskit-ai/shell-web/client/composables/useShellLayoutState",
|
|
92
|
+
"@jskit-ai/shell-web/client/composables/useShellPageTitle",
|
|
93
|
+
"@jskit-ai/shell-web/client/composables/useShellWindowSizeClass",
|
|
82
94
|
"@jskit-ai/shell-web/client/types"
|
|
83
95
|
],
|
|
84
96
|
"exclude": [
|
|
@@ -66,7 +66,9 @@ placement registry, topology, and adaptive smoke helper exported by
|
|
|
66
66
|
## Example files
|
|
67
67
|
|
|
68
68
|
`example/src/` contains the complete shell composition, standard link
|
|
69
|
-
components, settings routes, placement registry, and topology
|
|
69
|
+
components, settings routes, placement registry, and topology, and a not-found
|
|
70
|
+
view the shell renders, so the top app bar carries its title and the
|
|
71
|
+
navigation leads back into the app. The browser
|
|
70
72
|
example under `example/tests/` exercises the public adaptive-shell contract.
|
|
71
73
|
The `expected-existing/` files show the minimal foundation shapes replaced by
|
|
72
74
|
the complete shell; they are reference inputs, not merge instructions.
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section class="
|
|
3
|
-
<v-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</v-sheet>
|
|
2
|
+
<section class="d-flex flex-column align-center ga-4 py-16 text-center on-surface-variant">
|
|
3
|
+
<v-icon icon="$inbox" size="48" />
|
|
4
|
+
<p class="text-body-large mb-0">
|
|
5
|
+
Recent work, saved records, and next actions will appear here once this app has data.
|
|
6
|
+
</p>
|
|
8
7
|
</section>
|
|
9
8
|
</template>
|
|
10
|
-
|
|
11
|
-
<style scoped>
|
|
12
|
-
.home-start-screen {
|
|
13
|
-
--home-start-panel-padding: 1rem;
|
|
14
|
-
margin-inline: auto;
|
|
15
|
-
max-width: 48rem;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.home-start-screen__panel {
|
|
19
|
-
padding: var(--home-start-panel-padding);
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const title = "Not Found";
|
|
3
|
+
const message = "The page you requested does not exist.";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<v-container class="fill-height d-flex align-center justify-center">
|
|
8
|
+
<section class="on-surface-variant text-center">
|
|
9
|
+
<v-icon icon="$searchOff" size="48" />
|
|
10
|
+
<h1 class="text-headline-small on-surface mt-4 mb-2">{{ title }}</h1>
|
|
11
|
+
<p class="text-body-large mb-0">{{ message }}</p>
|
|
12
|
+
</section>
|
|
13
|
+
</v-container>
|
|
14
|
+
</template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useQuery } from "@tanstack/vue-query";
|
|
4
|
+
import { usePaths } from "@jskit-ai/shell-web/client/navigation/usePaths";
|
|
4
5
|
|
|
6
|
+
const paths = usePaths();
|
|
5
7
|
const healthQuery = useQuery({
|
|
6
8
|
queryKey: ["shell-web", "health"],
|
|
7
9
|
queryFn: async () => {
|
|
@@ -28,63 +30,25 @@ const healthPending = computed(
|
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
32
|
<template>
|
|
31
|
-
<section class="
|
|
32
|
-
<
|
|
33
|
-
<v-
|
|
33
|
+
<section class="d-flex flex-column ga-4">
|
|
34
|
+
<v-card>
|
|
35
|
+
<v-list>
|
|
36
|
+
<v-list-item subtitle="Service health">
|
|
37
|
+
<template #title>
|
|
38
|
+
<v-skeleton-loader
|
|
39
|
+
v-if="healthPending"
|
|
40
|
+
aria-label="Loading service health"
|
|
41
|
+
type="text"
|
|
42
|
+
max-width="80"
|
|
43
|
+
/>
|
|
44
|
+
<span v-else>{{ health }}</span>
|
|
45
|
+
</template>
|
|
46
|
+
</v-list-item>
|
|
47
|
+
<v-list-item title="/home" subtitle="Route" />
|
|
48
|
+
</v-list>
|
|
49
|
+
</v-card>
|
|
50
|
+
<div class="d-flex justify-end">
|
|
51
|
+
<v-btn color="secondary-container" prepend-icon="$settings" :to="paths.page('/settings')">Settings</v-btn>
|
|
34
52
|
</div>
|
|
35
|
-
|
|
36
|
-
<v-sheet rounded="lg" border class="home-surface-screen__panel">
|
|
37
|
-
<div class="home-surface-screen__status">
|
|
38
|
-
<span class="text-caption text-medium-emphasis">Service health</span>
|
|
39
|
-
<v-skeleton-loader
|
|
40
|
-
v-if="healthPending"
|
|
41
|
-
aria-label="Loading service health"
|
|
42
|
-
class="home-surface-screen__health-skeleton"
|
|
43
|
-
type="text"
|
|
44
|
-
/>
|
|
45
|
-
<strong v-else>{{ health }}</strong>
|
|
46
|
-
</div>
|
|
47
|
-
<v-divider vertical class="d-none d-sm-block" />
|
|
48
|
-
<div class="home-surface-screen__status">
|
|
49
|
-
<span class="text-caption text-medium-emphasis">Route</span>
|
|
50
|
-
<strong>/home</strong>
|
|
51
|
-
</div>
|
|
52
|
-
</v-sheet>
|
|
53
53
|
</section>
|
|
54
54
|
</template>
|
|
55
|
-
|
|
56
|
-
<style scoped>
|
|
57
|
-
.home-surface-screen {
|
|
58
|
-
--home-surface-panel-padding: 1rem;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.home-surface-screen__actions {
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: flex-end;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.home-surface-screen__panel {
|
|
67
|
-
align-items: stretch;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-wrap: wrap;
|
|
70
|
-
gap: 1rem;
|
|
71
|
-
padding: var(--home-surface-panel-padding);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.home-surface-screen__status {
|
|
75
|
-
display: grid;
|
|
76
|
-
gap: 0.15rem;
|
|
77
|
-
min-width: 9rem;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.home-surface-screen__health-skeleton {
|
|
81
|
-
max-width: 5rem;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media (max-width: 640px) {
|
|
85
|
-
.home-surface-screen__actions :deep(.v-btn) {
|
|
86
|
-
min-height: 48px;
|
|
87
|
-
width: 100%;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useShellLayoutState } from "@jskit-ai/shell-web/client/composables/useShellLayoutState";
|
|
4
4
|
|
|
5
|
+
definePage({
|
|
6
|
+
meta: {
|
|
7
|
+
jskit: {
|
|
8
|
+
title: "General",
|
|
9
|
+
parent: "/settings"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
5
14
|
const { drawerDefaultOpen, setDrawerDefaultOpen } = useShellLayoutState();
|
|
6
15
|
|
|
7
16
|
const drawerDefaultOpenModel = computed({
|
|
@@ -15,23 +24,19 @@ const drawerDefaultOpenModel = computed({
|
|
|
15
24
|
</script>
|
|
16
25
|
|
|
17
26
|
<template>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
<v-card>
|
|
28
|
+
<v-list lines="three">
|
|
29
|
+
<v-list-item
|
|
30
|
+
title="Start with expanded navigation on wider screens"
|
|
31
|
+
subtitle="On wider screens, collapsed navigation remains available as a rail. Phone layouts close the drawer and keep primary navigation in the bottom bar."
|
|
32
|
+
>
|
|
33
|
+
<template #append>
|
|
34
|
+
<v-switch
|
|
35
|
+
v-model="drawerDefaultOpenModel"
|
|
36
|
+
aria-label="Start with expanded navigation on wider screens"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
</v-list-item>
|
|
40
|
+
</v-list>
|
|
41
|
+
</v-card>
|
|
31
42
|
</template>
|
|
32
|
-
|
|
33
|
-
<style scoped>
|
|
34
|
-
.settings-general-screen :deep(.v-switch) {
|
|
35
|
-
min-height: 48px;
|
|
36
|
-
}
|
|
37
|
-
</style>
|