@orthacms/bootstrap-admin 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/RouteAnnouncer/index.tsx"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,gCAiE7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/RouteAnnouncer/index.tsx"],"names":[],"mappings":"AAoDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,gCAiE7B"}
@@ -34,7 +34,14 @@ let lastHeadingText = null;
34
34
  */
35
35
  function readHeading() {
36
36
  const scope = document.querySelector('main') ?? document;
37
- const element = scope.querySelector('h1');
37
+ // Skip a heading that belongs to a loading placeholder. A lazy route's
38
+ // `Suspense` fallback carries its own `sr-only` <h1> ("Loading X") so the
39
+ // page stays navigable by heading while its chunk arrives (ORT-167) — but
40
+ // that names the *state*, not the view the user arrived at, and reading it
41
+ // aloud announces "Loading members" in place of "Members". Every such
42
+ // skeleton marks its root `aria-busy`, so the announcer waits past it and
43
+ // reports the settled heading once the real page mounts.
44
+ const element = Array.from(scope.querySelectorAll('h1')).find((h1) => !h1.closest('[aria-busy="true"]'));
38
45
  const text = element?.textContent?.trim();
39
46
  return element && text ? { element, text } : null;
40
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/createAdmin/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA8J5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA6G7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/createAdmin/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA8J5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA+G7D"}
@@ -4,7 +4,7 @@ import * as ReactDOM from 'react-dom/client';
4
4
  import { BrowserRouter, Navigate, Outlet, Route, Routes } from 'react-router-dom';
5
5
  import { IntlProvider } from 'react-intl';
6
6
  import { QueryClientProvider } from '@tanstack/react-query';
7
- import { queryClient } from '@orthacms/utils-admin';
7
+ import { queryClient, wireSlotContributions } from '@orthacms/utils-admin';
8
8
  import { AppearanceProvider, TooltipProvider, Toaster } from '@orthacms/design-system';
9
9
  import { UnsavedChangesGuard } from '../UnsavedChangesGuard';
10
10
  import { AppErrorBoundary } from '../AppErrorBoundary';
@@ -187,11 +187,13 @@ export function createAdmin(options) {
187
187
  const privateRoutes = routes.filter((route) => !route.public);
188
188
  // Wire every plugin's slot contributions into their target slots before
189
189
  // render, so consumers (e.g. the shell toolbar) see all contributed items.
190
- for (const plugin of plugins) {
191
- for (const contribution of plugin.slots ?? []) {
192
- contribution.slot._register(contribution.items);
193
- }
194
- }
190
+ //
191
+ // `wireSlotContributions` registers from empty rather than appending,
192
+ // because a Vite hot update re-executes this module against the same
193
+ // module-level slot closures instead of reloading the page — so a bare
194
+ // `push` per contribution doubled every nav entry and every workspace, and
195
+ // compounded with each save until a hard reload.
196
+ wireSlotContributions(plugins.flatMap((plugin) => plugin.slots ?? []));
195
197
  // The single layout that wraps every private route; falls back to a bare
196
198
  // outlet before any layout plugin (the shell) is registered.
197
199
  const layout = plugins.map((plugin) => plugin.layout).find(Boolean) ?? (_jsx(Outlet, {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orthacms/bootstrap-admin",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "@orthacms/bootstrap-admin — part of Ortha CMS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ortha-source/ortha-cms/tree/main/packages/bootstrap/admin",
@@ -25,8 +25,8 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@orthacms/design-system": "^0.3.0",
29
- "@orthacms/utils-admin": "^0.3.0",
28
+ "@orthacms/design-system": "^0.4.0",
29
+ "@orthacms/utils-admin": "^0.4.0",
30
30
  "@tanstack/react-query": "^5.0.0",
31
31
  "react-intl": "^7.0.0",
32
32
  "tslib": "^2.3.0"