@jskit-ai/shell-web 0.2.13 → 0.2.15
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 +18 -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 +59 -12
- package/src/client/navigation/usePaths.js +13 -0
- package/src/client/navigation/useShellNavigation.js +2 -0
- package/src/client/providers/ShellWebClientProvider.js +25 -9
- 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 +272 -0
|
@@ -69,7 +69,16 @@ async function expectElementVisibility(page, expect, testId, visible) {
|
|
|
69
69
|
).toBe(visible);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
// The layout class comes from the drawer, which carries it; a phone shell whose destinations are all in the
|
|
73
|
+
// navigation bar draws no drawer (or menu control), and its navigation bar says it is compact.
|
|
74
|
+
async function readShellLayoutClass(drawer, bottomNavigation, expect) {
|
|
75
|
+
await expect(
|
|
76
|
+
drawer.or(bottomNavigation).first(),
|
|
77
|
+
"The shell drew neither a drawer nor a navigation bar."
|
|
78
|
+
).toBeAttached();
|
|
79
|
+
if (await drawer.count() === 0) {
|
|
80
|
+
return "compact";
|
|
81
|
+
}
|
|
73
82
|
const layoutClass = String(await drawer.getAttribute("data-layout") || "");
|
|
74
83
|
if (!["compact", "medium", "expanded"].includes(layoutClass)) {
|
|
75
84
|
throw new Error(`Shell drawer exposed an invalid data-layout value: ${layoutClass || "(empty)"}.`);
|
|
@@ -290,8 +299,9 @@ async function runAdaptiveShellSmokeCase({
|
|
|
290
299
|
await expect(page.getByRole("main").first()).toBeVisible();
|
|
291
300
|
await expectNoHorizontalOverflow(page, expect);
|
|
292
301
|
const drawer = page.getByTestId("jskit-shell-drawer");
|
|
302
|
+
const bottomNavigation = page.getByTestId("jskit-shell-bottom-nav");
|
|
293
303
|
const toggle = page.getByTestId("jskit-shell-nav-toggle");
|
|
294
|
-
const layoutClass = await readShellLayoutClass(drawer);
|
|
304
|
+
const layoutClass = await readShellLayoutClass(drawer, bottomNavigation, expect);
|
|
295
305
|
|
|
296
306
|
if (layoutClass === "compact") {
|
|
297
307
|
let bootstrapRequests = 0;
|
|
@@ -301,21 +311,26 @@ async function runAdaptiveShellSmokeCase({
|
|
|
301
311
|
});
|
|
302
312
|
const bootstrapRequestsBeforePull = bootstrapRequests;
|
|
303
313
|
|
|
304
|
-
await expect(
|
|
305
|
-
await
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
await expect(bottomNavigation).toBeVisible();
|
|
315
|
+
if (await drawer.count() === 0) {
|
|
316
|
+
// Every destination is in the navigation bar, so there is no drawer to open and no menu control.
|
|
317
|
+
await expect(toggle).toHaveCount(0);
|
|
318
|
+
} else {
|
|
319
|
+
await expectElementVisibility(page, expect, "jskit-shell-drawer", false);
|
|
320
|
+
|
|
321
|
+
// The modal drawer opens over the app bar, as Material 3 draws it; tapping the scrim beside it closes it.
|
|
322
|
+
await openCompactDrawer(page, expect);
|
|
323
|
+
await expect(toggle).toHaveAttribute("aria-label", "Close navigation menu");
|
|
324
|
+
await page.mouse.click(viewport.width - 8, Math.round(viewport.height / 2));
|
|
325
|
+
await expectElementVisibility(page, expect, "jskit-shell-drawer", false);
|
|
326
|
+
|
|
327
|
+
await openCompactDrawer(page, expect);
|
|
328
|
+
await page.keyboard.press("Escape");
|
|
329
|
+
await expectElementVisibility(page, expect, "jskit-shell-drawer", false);
|
|
330
|
+
await expect(toggle).toBeFocused();
|
|
331
|
+
}
|
|
317
332
|
|
|
318
|
-
const navButtonHeights = await
|
|
333
|
+
const navButtonHeights = await bottomNavigation.locator(".v-btn").evaluateAll((buttons) =>
|
|
319
334
|
buttons.map((button) => button.getBoundingClientRect().height)
|
|
320
335
|
);
|
|
321
336
|
expect(navButtonHeights.length).toBeGreaterThan(0);
|