@wordpress/boot 0.3.1-next.6deb34194.0 → 0.3.1-next.76cff8c98.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.
- package/LICENSE.md +1 -1
- package/build-module/components/app/{index.js → index.mjs} +9 -5
- package/build-module/components/app/index.mjs.map +7 -0
- package/build-module/components/app/{router.js → router.mjs} +53 -42
- package/build-module/components/app/router.mjs.map +7 -0
- package/build-module/components/app/use-route-title.mjs +50 -0
- package/build-module/components/app/use-route-title.mjs.map +7 -0
- package/build-module/components/canvas/{back-button.js → back-button.mjs} +2 -2
- package/build-module/components/canvas/{index.js → index.mjs} +2 -2
- package/build-module/components/canvas-renderer/{index.js → index.mjs} +2 -2
- package/build-module/components/navigation/drilldown-item/{index.js → index.mjs} +2 -2
- package/build-module/components/navigation/dropdown-item/{index.js → index.mjs} +4 -4
- package/build-module/components/navigation/{index.js → index.mjs} +7 -7
- package/build-module/components/navigation/{items.js → items.mjs} +1 -1
- package/build-module/components/navigation/navigation-item/index.mjs +184 -0
- package/build-module/components/navigation/navigation-item/index.mjs.map +7 -0
- package/build-module/components/navigation/navigation-screen/{index.js → index.mjs} +1 -1
- package/build-module/components/navigation/{path-matching.js → path-matching.mjs} +1 -1
- package/build-module/components/navigation/{router-link-item.js → router-link-item.mjs} +2 -2
- package/build-module/components/navigation/{use-sidebar-parent.js → use-sidebar-parent.mjs} +4 -4
- package/build-module/components/root/index.mjs +425 -0
- package/build-module/components/root/index.mjs.map +7 -0
- package/build-module/components/root/single-page.mjs +334 -0
- package/build-module/components/root/single-page.mjs.map +7 -0
- package/build-module/components/save-button/{index.js → index.mjs} +2 -2
- package/build-module/components/save-panel/{index.js → index.mjs} +2 -2
- package/build-module/components/save-panel/{use-save-shortcut.js → use-save-shortcut.mjs} +1 -1
- package/build-module/components/sidebar/{index.js → index.mjs} +4 -4
- package/build-module/components/site-hub/index.mjs +179 -0
- package/build-module/components/site-hub/index.mjs.map +7 -0
- package/build-module/components/site-icon/{index.js → index.mjs} +3 -3
- package/build-module/components/site-icon/index.mjs.map +7 -0
- package/build-module/components/site-icon-link/{index.js → index.mjs} +6 -5
- package/build-module/components/site-icon-link/index.mjs.map +7 -0
- package/build-module/components/user-theme-provider/index.mjs +33 -0
- package/build-module/components/user-theme-provider/index.mjs.map +7 -0
- package/build-module/index.mjs +708 -0
- package/build-module/index.mjs.map +7 -0
- package/build-module/{lock-unlock.js → lock-unlock.mjs} +1 -1
- package/build-module/store/{actions.js → actions.mjs} +8 -1
- package/build-module/store/{actions.js.map → actions.mjs.map} +2 -2
- package/build-module/store/{index.js → index.mjs} +4 -4
- package/build-module/store/{reducer.js → reducer.mjs} +8 -2
- package/build-module/store/reducer.mjs.map +7 -0
- package/build-module/store/{selectors.js → selectors.mjs} +5 -1
- package/build-module/store/{selectors.js.map → selectors.mjs.map} +2 -2
- package/build-module/store/types.mjs +1 -0
- package/build-style/style-rtl.css +58 -44
- package/build-style/style.css +58 -44
- package/build-types/components/app/index.d.ts +2 -1
- package/build-types/components/app/index.d.ts.map +1 -1
- package/build-types/components/app/router.d.ts.map +1 -1
- package/build-types/components/app/use-route-title.d.ts +8 -0
- package/build-types/components/app/use-route-title.d.ts.map +1 -0
- package/build-types/components/navigation/items.d.ts +1 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/site-hub/index.d.ts.map +1 -1
- package/build-types/components/site-icon-link/index.d.ts.map +1 -1
- package/build-types/components/user-theme-provider/index.d.ts +6 -0
- package/build-types/components/user-theme-provider/index.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +5 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +1 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/types.d.ts +24 -0
- package/build-types/store/types.d.ts.map +1 -1
- package/package.json +32 -24
- package/src/components/app/index.tsx +6 -0
- package/src/components/app/router.tsx +65 -52
- package/src/components/app/use-route-title.ts +80 -0
- package/src/components/root/index.tsx +47 -49
- package/src/components/root/single-page.tsx +37 -32
- package/src/components/root/style.scss +5 -0
- package/src/components/site-hub/index.tsx +13 -3
- package/src/components/site-hub/style.scss +21 -6
- package/src/components/site-icon/style.scss +1 -1
- package/src/components/site-icon-link/index.tsx +18 -15
- package/src/components/user-theme-provider/index.tsx +35 -0
- package/src/components/user-theme-provider/test/index.test.ts +11 -0
- package/src/store/actions.ts +9 -1
- package/src/store/reducer.ts +7 -0
- package/src/store/selectors.ts +4 -0
- package/src/store/types.ts +25 -0
- package/src/style.scss +19 -33
- package/build-module/components/app/index.js.map +0 -7
- package/build-module/components/app/router.js.map +0 -7
- package/build-module/components/navigation/navigation-item/index.js +0 -180
- package/build-module/components/navigation/navigation-item/index.js.map +0 -7
- package/build-module/components/root/index.js +0 -428
- package/build-module/components/root/index.js.map +0 -7
- package/build-module/components/root/single-page.js +0 -329
- package/build-module/components/root/single-page.js.map +0 -7
- package/build-module/components/site-hub/index.js +0 -153
- package/build-module/components/site-hub/index.js.map +0 -7
- package/build-module/components/site-icon/index.js.map +0 -7
- package/build-module/components/site-icon-link/index.js.map +0 -7
- package/build-module/index.js +0 -694
- package/build-module/index.js.map +0 -7
- package/build-module/store/reducer.js.map +0 -7
- package/build-module/store/types.js +0 -1
- package/tsconfig.json +0 -26
- package/tsconfig.tsbuildinfo +0 -1
- /package/build-module/components/canvas/{back-button.js.map → back-button.mjs.map} +0 -0
- /package/build-module/components/canvas/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/canvas-renderer/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/navigation/drilldown-item/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/navigation/dropdown-item/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/navigation/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/navigation/{items.js.map → items.mjs.map} +0 -0
- /package/build-module/components/navigation/navigation-screen/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/navigation/{path-matching.js.map → path-matching.mjs.map} +0 -0
- /package/build-module/components/navigation/{router-link-item.js.map → router-link-item.mjs.map} +0 -0
- /package/build-module/components/navigation/{use-sidebar-parent.js.map → use-sidebar-parent.mjs.map} +0 -0
- /package/build-module/components/save-button/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/save-panel/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/components/save-panel/{use-save-shortcut.js.map → use-save-shortcut.mjs.map} +0 -0
- /package/build-module/components/sidebar/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/{lock-unlock.js.map → lock-unlock.mjs.map} +0 -0
- /package/build-module/store/{index.js.map → index.mjs.map} +0 -0
- /package/build-module/store/{types.js.map → types.mjs.map} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// packages/boot/src/components/app/index.tsx
|
|
2
2
|
import { createRoot, StrictMode } from "@wordpress/element";
|
|
3
3
|
import { dispatch, useSelect } from "@wordpress/data";
|
|
4
|
-
import Router from "./router";
|
|
5
|
-
import RootSinglePage from "../root/single-page";
|
|
6
|
-
import { store } from "../../store";
|
|
4
|
+
import Router from "./router.mjs";
|
|
5
|
+
import RootSinglePage from "../root/single-page.mjs";
|
|
6
|
+
import { store } from "../../store/index.mjs";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
function App({ rootComponent }) {
|
|
9
9
|
const routes = useSelect((select) => select(store).getRoutes(), []);
|
|
@@ -13,7 +13,8 @@ async function init({
|
|
|
13
13
|
mountId,
|
|
14
14
|
menuItems,
|
|
15
15
|
routes,
|
|
16
|
-
initModules
|
|
16
|
+
initModules,
|
|
17
|
+
dashboardLink
|
|
17
18
|
}) {
|
|
18
19
|
(menuItems ?? []).forEach((menuItem) => {
|
|
19
20
|
dispatch(store).registerMenuItem(menuItem.id, menuItem);
|
|
@@ -21,6 +22,9 @@ async function init({
|
|
|
21
22
|
(routes ?? []).forEach((route) => {
|
|
22
23
|
dispatch(store).registerRoute(route);
|
|
23
24
|
});
|
|
25
|
+
if (dashboardLink) {
|
|
26
|
+
dispatch(store).setDashboardLink(dashboardLink);
|
|
27
|
+
}
|
|
24
28
|
for (const moduleId of initModules ?? []) {
|
|
25
29
|
const module = await import(moduleId);
|
|
26
30
|
await module.init();
|
|
@@ -52,4 +56,4 @@ export {
|
|
|
52
56
|
init,
|
|
53
57
|
initSinglePage
|
|
54
58
|
};
|
|
55
|
-
//# sourceMappingURL=index.
|
|
59
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/app/index.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode, type ComponentType } from '@wordpress/element';\nimport { dispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport Router from './router';\nimport RootSinglePage from '../root/single-page';\nimport { store } from '../../store';\nimport type { MenuItem, Route } from '../../store/types';\n\nfunction App( { rootComponent }: { rootComponent?: ComponentType } ) {\n\tconst routes = useSelect( ( select ) => select( store ).getRoutes(), [] );\n\n\treturn <Router routes={ routes } rootComponent={ rootComponent } />;\n}\n\nexport async function init( {\n\tmountId,\n\tmenuItems,\n\troutes,\n\tinitModules,\n\tdashboardLink,\n}: {\n\tmountId: string;\n\tmenuItems?: MenuItem[];\n\troutes?: Route[];\n\tinitModules?: string[];\n\tdashboardLink?: string;\n} ) {\n\t( menuItems ?? [] ).forEach( ( menuItem ) => {\n\t\tdispatch( store ).registerMenuItem( menuItem.id, menuItem );\n\t} );\n\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\tif ( dashboardLink ) {\n\t\tdispatch( store ).setDashboardLink( dashboardLink );\n\t}\n\n\tfor ( const moduleId of initModules ?? [] ) {\n\t\tconst module = await import( moduleId );\n\t\tawait module.init();\n\t}\n\n\t// Render the app\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n\nexport async function initSinglePage( {\n\tmountId,\n\troutes,\n}: {\n\tmountId: string;\n\troutes?: Route[];\n} ) {\n\t( routes ?? [] ).forEach( ( route ) => {\n\t\tdispatch( store ).registerRoute( route );\n\t} );\n\n\t// Render the app without sidebar\n\tconst rootElement = document.getElementById( mountId );\n\tif ( rootElement ) {\n\t\tconst root = createRoot( rootElement );\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<App rootComponent={ RootSinglePage } />\n\t\t\t</StrictMode>\n\t\t);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,YAAY,kBAAsC;AAC3D,SAAS,UAAU,iBAAiB;AAKpC,OAAO,YAAY;AACnB,OAAO,oBAAoB;AAC3B,SAAS,aAAa;AAMd;AAHR,SAAS,IAAK,EAAE,cAAc,GAAuC;AACpE,QAAM,SAAS,UAAW,CAAE,WAAY,OAAQ,KAAM,EAAE,UAAU,GAAG,CAAC,CAAE;AAExE,SAAO,oBAAC,UAAO,QAAkB,eAAgC;AAClE;AAEA,eAAsB,KAAM;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAMI;AACH,GAAE,aAAa,CAAC,GAAI,QAAS,CAAE,aAAc;AAC5C,aAAU,KAAM,EAAE,iBAAkB,SAAS,IAAI,QAAS;AAAA,EAC3D,CAAE;AAEF,GAAE,UAAU,CAAC,GAAI,QAAS,CAAE,UAAW;AACtC,aAAU,KAAM,EAAE,cAAe,KAAM;AAAA,EACxC,CAAE;AAEF,MAAK,eAAgB;AACpB,aAAU,KAAM,EAAE,iBAAkB,aAAc;AAAA,EACnD;AAEA,aAAY,YAAY,eAAe,CAAC,GAAI;AAC3C,UAAM,SAAS,MAAM,OAAQ;AAC7B,UAAM,OAAO,KAAK;AAAA,EACnB;AAGA,QAAM,cAAc,SAAS,eAAgB,OAAQ;AACrD,MAAK,aAAc;AAClB,UAAM,OAAO,WAAY,WAAY;AACrC,SAAK;AAAA,MACJ,oBAAC,cACA,8BAAC,OAAI,GACN;AAAA,IACD;AAAA,EACD;AACD;AAEA,eAAsB,eAAgB;AAAA,EACrC;AAAA,EACA;AACD,GAGI;AACH,GAAE,UAAU,CAAC,GAAI,QAAS,CAAE,UAAW;AACtC,aAAU,KAAM,EAAE,cAAe,KAAM;AAAA,EACxC,CAAE;AAGF,QAAM,cAAc,SAAS,eAAgB,OAAQ;AACrD,MAAK,aAAc;AAClB,UAAM,OAAO,WAAY,WAAY;AACrC,SAAK;AAAA,MACJ,oBAAC,cACA,8BAAC,OAAI,eAAgB,gBAAiB,GACvC;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// packages/boot/src/components/app/router.tsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo } from "@wordpress/element";
|
|
4
4
|
import { Page } from "@wordpress/admin-ui";
|
|
5
5
|
import {
|
|
6
6
|
privateApis as routePrivateApis
|
|
7
7
|
} from "@wordpress/route";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import { resolveSelect } from "@wordpress/data";
|
|
9
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
10
|
+
import Root from "../root/index.mjs";
|
|
11
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
10
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
13
|
var {
|
|
12
14
|
createLazyRoute,
|
|
@@ -21,27 +23,40 @@ var {
|
|
|
21
23
|
function NotFoundComponent() {
|
|
22
24
|
return /* @__PURE__ */ jsx("div", { className: "boot-layout__stage", children: /* @__PURE__ */ jsx(Page, { title: __("Route not found"), hasPadding: true, children: __("The page you're looking for does not exist") }) });
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
let routeConfig = {};
|
|
26
|
-
if (route.route_module) {
|
|
27
|
-
const module = await import(route.route_module);
|
|
28
|
-
routeConfig = module.route || {};
|
|
29
|
-
}
|
|
26
|
+
function createRouteFromDefinition(route, parentRoute) {
|
|
30
27
|
let tanstackRoute = createRoute({
|
|
31
28
|
getParentRoute: () => parentRoute,
|
|
32
29
|
path: route.path,
|
|
33
|
-
beforeLoad:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
beforeLoad: async (opts) => {
|
|
31
|
+
if (route.route_module) {
|
|
32
|
+
const module = await import(route.route_module);
|
|
33
|
+
const routeConfig = module.route || {};
|
|
34
|
+
if (routeConfig.beforeLoad) {
|
|
35
|
+
return routeConfig.beforeLoad({
|
|
36
|
+
params: opts.params || {},
|
|
37
|
+
search: opts.search || {}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
37
42
|
loader: async (opts) => {
|
|
43
|
+
let routeConfig = {};
|
|
44
|
+
if (route.route_module) {
|
|
45
|
+
const module = await import(route.route_module);
|
|
46
|
+
routeConfig = module.route || {};
|
|
47
|
+
}
|
|
38
48
|
const context = {
|
|
39
49
|
params: opts.params || {},
|
|
40
50
|
search: opts.deps || {}
|
|
41
51
|
};
|
|
42
|
-
const [loaderData, canvasData] = await Promise.all([
|
|
52
|
+
const [, loaderData, canvasData, titleData] = await Promise.all([
|
|
53
|
+
resolveSelect(coreStore).getEntityRecord(
|
|
54
|
+
"root",
|
|
55
|
+
"__unstableBase"
|
|
56
|
+
),
|
|
43
57
|
routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0),
|
|
44
|
-
routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0)
|
|
58
|
+
routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0),
|
|
59
|
+
routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0)
|
|
45
60
|
]);
|
|
46
61
|
let inspector = true;
|
|
47
62
|
if (routeConfig.inspector) {
|
|
@@ -51,6 +66,7 @@ async function createRouteFromDefinition(route, parentRoute) {
|
|
|
51
66
|
...loaderData,
|
|
52
67
|
canvas: canvasData,
|
|
53
68
|
inspector,
|
|
69
|
+
title: titleData,
|
|
54
70
|
routeContentModule: route.content_module
|
|
55
71
|
};
|
|
56
72
|
},
|
|
@@ -72,13 +88,13 @@ async function createRouteFromDefinition(route, parentRoute) {
|
|
|
72
88
|
});
|
|
73
89
|
return tanstackRoute;
|
|
74
90
|
}
|
|
75
|
-
|
|
91
|
+
function createRouteTree(routes, rootComponent = Root) {
|
|
76
92
|
const rootRoute = createRootRoute({
|
|
77
93
|
component: rootComponent,
|
|
78
94
|
context: () => ({})
|
|
79
95
|
});
|
|
80
|
-
const dynamicRoutes =
|
|
81
|
-
|
|
96
|
+
const dynamicRoutes = routes.map(
|
|
97
|
+
(route) => createRouteFromDefinition(route, rootRoute)
|
|
82
98
|
);
|
|
83
99
|
return rootRoute.addChildren(dynamicRoutes);
|
|
84
100
|
}
|
|
@@ -101,34 +117,29 @@ function Router({
|
|
|
101
117
|
routes,
|
|
102
118
|
rootComponent = Root
|
|
103
119
|
}) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
const router = useMemo(() => {
|
|
121
|
+
const history = createPathHistory();
|
|
122
|
+
const routeTree = createRouteTree(routes, rootComponent);
|
|
123
|
+
return createRouter({
|
|
124
|
+
history,
|
|
125
|
+
routeTree,
|
|
126
|
+
defaultPreload: "intent",
|
|
127
|
+
defaultNotFoundComponent: NotFoundComponent,
|
|
128
|
+
defaultViewTransition: {
|
|
129
|
+
types: ({
|
|
130
|
+
fromLocation
|
|
131
|
+
}) => {
|
|
132
|
+
if (!fromLocation) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return ["navigate"];
|
|
136
|
+
}
|
|
119
137
|
}
|
|
120
|
-
}
|
|
121
|
-
initializeRouter();
|
|
122
|
-
return () => {
|
|
123
|
-
cancelled = true;
|
|
124
|
-
};
|
|
138
|
+
});
|
|
125
139
|
}, [routes, rootComponent]);
|
|
126
|
-
if (!router) {
|
|
127
|
-
return /* @__PURE__ */ jsx("div", { children: "Loading routes..." });
|
|
128
|
-
}
|
|
129
140
|
return /* @__PURE__ */ jsx(RouterProvider, { router });
|
|
130
141
|
}
|
|
131
142
|
export {
|
|
132
143
|
Router as default
|
|
133
144
|
};
|
|
134
|
-
//# sourceMappingURL=router.
|
|
145
|
+
//# sourceMappingURL=router.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/app/router.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { ComponentType } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { Page } from '@wordpress/admin-ui';\nimport {\n\tprivateApis as routePrivateApis,\n\ttype AnyRoute,\n} from '@wordpress/route';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Root from '../root';\nimport type { Route, RouteConfig, RouteLoaderContext } from '../../store/types';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tRouterProvider,\n\tcreateBrowserHistory,\n\tparseHref,\n\tuseLoaderData,\n} = unlock( routePrivateApis );\n\n// Not found component\nfunction NotFoundComponent() {\n\treturn (\n\t\t<div className=\"boot-layout__stage\">\n\t\t\t<Page title={ __( 'Route not found' ) } hasPadding>\n\t\t\t\t{ __( \"The page you're looking for does not exist\" ) }\n\t\t\t</Page>\n\t\t</div>\n\t);\n}\n\n/**\n * Creates a TanStack route from a Route definition.\n *\n * @param route Route configuration\n * @param parentRoute Parent route.\n * @return Tanstack Route.\n */\nfunction createRouteFromDefinition( route: Route, parentRoute: AnyRoute ) {\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\tconst routeConfig = module.route || {};\n\n\t\t\t\tif ( routeConfig.beforeLoad ) {\n\t\t\t\t\treturn routeConfig.beforeLoad( {\n\t\t\t\t\t\tparams: opts.params || {},\n\t\t\t\t\t\tsearch: opts.search || {},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tloader: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tlet routeConfig: RouteConfig = {};\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\trouteConfig = module.route || {};\n\t\t\t}\n\n\t\t\tconst context: RouteLoaderContext = {\n\t\t\t\tparams: opts.params || {},\n\t\t\t\tsearch: opts.deps || {},\n\t\t\t};\n\n\t\t\tconst [ , loaderData, canvasData, titleData ] = await Promise.all( [\n\t\t\t\tresolveSelect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t),\n\t\t\t\trouteConfig.loader\n\t\t\t\t\t? routeConfig.loader( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.canvas\n\t\t\t\t\t? routeConfig.canvas( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.title\n\t\t\t\t\t? routeConfig.title( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t] );\n\n\t\t\tlet inspector = true;\n\t\t\tif ( routeConfig.inspector ) {\n\t\t\t\tinspector = await routeConfig.inspector( context );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...( loaderData as any ),\n\t\t\t\tcanvas: canvasData,\n\t\t\t\tinspector,\n\t\t\t\ttitle: titleData,\n\t\t\t\trouteContentModule: route.content_module,\n\t\t\t};\n\t\t},\n\t\tloaderDeps: ( opts: any ) => opts.search,\n\t} );\n\n\t// Chain .lazy() to preload content module on intent\n\ttanstackRoute = tanstackRoute.lazy( async () => {\n\t\tconst module = route.content_module\n\t\t\t? await import( route.content_module )\n\t\t\t: {};\n\n\t\tconst Stage = module.stage;\n\t\tconst Inspector = module.inspector;\n\n\t\treturn createLazyRoute( route.path )( {\n\t\t\tcomponent: function RouteComponent() {\n\t\t\t\tconst { inspector: showInspector } =\n\t\t\t\t\tuseLoaderData( { from: route.path } ) ?? {};\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ Stage && (\n\t\t\t\t\t\t\t<div className=\"boot-layout__stage\">\n\t\t\t\t\t\t\t\t<Stage />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Inspector && showInspector && (\n\t\t\t\t\t\t\t<div className=\"boot-layout__inspector\">\n\t\t\t\t\t\t\t\t<Inspector />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\t} );\n\n\treturn tanstackRoute;\n}\n\n/**\n * Creates a route tree from route definitions.\n *\n * @param routes Routes definition.\n * @param rootComponent Root component to use for the router.\n * @return Router tree.\n */\nfunction createRouteTree(\n\troutes: Route[],\n\trootComponent: ComponentType = Root\n) {\n\tconst rootRoute = createRootRoute( {\n\t\tcomponent: rootComponent as any,\n\t\tcontext: () => ( {} ),\n\t} );\n\n\t// Create routes from definitions (now synchronous)\n\tconst dynamicRoutes = routes.map( ( route ) =>\n\t\tcreateRouteFromDefinition( route, rootRoute )\n\t);\n\n\treturn rootRoute.addChildren( dynamicRoutes );\n}\n\n// Create custom history that parses ?p= query parameter\nfunction createPathHistory() {\n\treturn createBrowserHistory( {\n\t\tparseLocation: () => {\n\t\t\tconst url = new URL( window.location.href );\n\t\t\tconst path = url.searchParams.get( 'p' ) || '/';\n\t\t\tconst pathHref = `${ path }${ url.hash }`;\n\t\t\treturn parseHref( pathHref, window.history.state );\n\t\t},\n\t\tcreateHref: ( href: string ) => {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tsearchParams.set( 'p', href );\n\t\t\treturn `${ window.location.pathname }?${ searchParams }`;\n\t\t},\n\t} );\n}\n\ninterface RouterProps {\n\troutes: Route[];\n\trootComponent?: ComponentType;\n}\n\nexport default function Router( {\n\troutes,\n\trootComponent = Root,\n}: RouterProps ) {\n\tconst router = useMemo( () => {\n\t\tconst history = createPathHistory();\n\t\tconst routeTree = createRouteTree( routes, rootComponent );\n\n\t\treturn createRouter( {\n\t\t\thistory,\n\t\t\trouteTree,\n\t\t\tdefaultPreload: 'intent',\n\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\tdefaultViewTransition: {\n\t\t\t\ttypes: ( {\n\t\t\t\t\tfromLocation,\n\t\t\t\t}: {\n\t\t\t\t\tfromLocation?: unknown;\n\t\t\t\t\ttoLocation: unknown;\n\t\t\t\t\tpathChanged: boolean;\n\t\t\t\t\threfChanged: boolean;\n\t\t\t\t\thashChanged: boolean;\n\t\t\t\t} ) => {\n\t\t\t\t\t// Disable view transition on initial navigation (no previous location)\n\t\t\t\t\tif ( ! fromLocation ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable with navigation type for subsequent navigations\n\t\t\t\t\treturn [ 'navigate' ];\n\t\t\t\t},\n\t\t\t},\n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
|
|
1
|
+
// packages/boot/src/components/app/use-route-title.ts
|
|
2
|
+
import { useEffect, useRef } from "@wordpress/element";
|
|
3
|
+
import { useSelect } from "@wordpress/data";
|
|
4
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
5
|
+
import { __, sprintf } from "@wordpress/i18n";
|
|
6
|
+
import { speak } from "@wordpress/a11y";
|
|
7
|
+
import { decodeEntities } from "@wordpress/html-entities";
|
|
8
|
+
import { privateApis as routePrivateApis } from "@wordpress/route";
|
|
9
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
10
|
+
var { useLocation, useMatches } = unlock(routePrivateApis);
|
|
11
|
+
function useRouteTitle() {
|
|
12
|
+
const location = useLocation();
|
|
13
|
+
const matches = useMatches();
|
|
14
|
+
const currentMatch = matches[matches.length - 1];
|
|
15
|
+
const routeTitle = currentMatch?.loaderData?.title;
|
|
16
|
+
const siteTitle = useSelect(
|
|
17
|
+
(select) => select(coreStore).getEntityRecord(
|
|
18
|
+
"root",
|
|
19
|
+
"__unstableBase"
|
|
20
|
+
)?.name,
|
|
21
|
+
[]
|
|
22
|
+
);
|
|
23
|
+
const isInitialLocationRef = useRef(true);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
isInitialLocationRef.current = false;
|
|
26
|
+
}, [location]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (isInitialLocationRef.current) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") {
|
|
32
|
+
const decodedRouteTitle = decodeEntities(routeTitle);
|
|
33
|
+
const decodedSiteTitle = decodeEntities(siteTitle);
|
|
34
|
+
const formattedTitle = sprintf(
|
|
35
|
+
/* translators: Admin document title. 1: Admin screen name, 2: Site name. */
|
|
36
|
+
__("%1$s \u2039 %2$s \u2014 WordPress"),
|
|
37
|
+
decodedRouteTitle,
|
|
38
|
+
decodedSiteTitle
|
|
39
|
+
);
|
|
40
|
+
document.title = formattedTitle;
|
|
41
|
+
if (decodedRouteTitle) {
|
|
42
|
+
speak(decodedRouteTitle, "assertive");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, [routeTitle, siteTitle, location]);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
useRouteTitle as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=use-route-title.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/app/use-route-title.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore, type UnstableBase } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useMatches } = unlock( routePrivateApis );\n\n/**\n * Hook that manages document title updates based on route changes.\n * Formats titles with WordPress conventions and announces them to screen readers.\n *\n * This hook should be called from the Root component to ensure it runs on every route.\n */\nexport default function useRouteTitle() {\n\tconst location = useLocation();\n\tconst matches = useMatches();\n\tconst currentMatch = matches[ matches.length - 1 ];\n\tconst routeTitle = ( currentMatch?.loaderData as any )?.title as\n\t\t| string\n\t\t| undefined;\n\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord< UnstableBase >(\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase'\n\t\t\t)?.name,\n\t\t[]\n\t);\n\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\trouteTitle &&\n\t\t\ttypeof routeTitle === 'string' &&\n\t\t\tsiteTitle &&\n\t\t\ttypeof siteTitle === 'string'\n\t\t) {\n\t\t\t// Decode entities for display\n\t\t\tconst decodedRouteTitle = decodeEntities( routeTitle );\n\t\t\tconst decodedSiteTitle = decodeEntities( siteTitle );\n\n\t\t\t// Format title following WordPress admin conventions\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Site name. */\n\t\t\t\t__( '%1$s \u2039 %2$s \u2014 WordPress' ),\n\t\t\t\tdecodedRouteTitle,\n\t\t\t\tdecodedSiteTitle\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tif ( decodedRouteTitle ) {\n\t\t\t\tspeak( decodedRouteTitle, 'assertive' );\n\t\t\t}\n\t\t}\n\t}, [ routeTitle, siteTitle, location ] );\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW,cAAc;AAClC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAoC;AACtD,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,eAAe,wBAAwB;AAKhD,SAAS,cAAc;AAEvB,IAAM,EAAE,aAAa,WAAW,IAAI,OAAQ,gBAAiB;AAQ9C,SAAR,gBAAiC;AACvC,QAAM,WAAW,YAAY;AAC7B,QAAM,UAAU,WAAW;AAC3B,QAAM,eAAe,QAAS,QAAQ,SAAS,CAAE;AACjD,QAAM,aAAe,cAAc,YAAqB;AAIxD,QAAM,YAAY;AAAA,IACjB,CAAE,WACD,OAAQ,SAAU,EAAE;AAAA,MACnB;AAAA,MACA;AAAA,IACD,GAAG;AAAA,IACJ,CAAC;AAAA,EACF;AAEA,QAAM,uBAAuB,OAAQ,IAAK;AAE1C,YAAW,MAAM;AAChB,yBAAqB,UAAU;AAAA,EAChC,GAAG,CAAE,QAAS,CAAE;AAEhB,YAAW,MAAM;AAEhB,QAAK,qBAAqB,SAAU;AACnC;AAAA,IACD;AAEA,QACC,cACA,OAAO,eAAe,YACtB,aACA,OAAO,cAAc,UACpB;AAED,YAAM,oBAAoB,eAAgB,UAAW;AACrD,YAAM,mBAAmB,eAAgB,SAAU;AAGnD,YAAM,iBAAiB;AAAA;AAAA,QAEtB,GAAI,mCAA0B;AAAA,QAC9B;AAAA,QACA;AAAA,MACD;AAEA,eAAS,QAAQ;AAGjB,UAAK,mBAAoB;AACxB,cAAO,mBAAmB,WAAY;AAAA,MACvC;AAAA,IACD;AAAA,EACD,GAAG,CAAE,YAAY,WAAW,QAAS,CAAE;AACxC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { arrowUpLeft } from "@wordpress/icons";
|
|
8
8
|
import { useReducedMotion } from "@wordpress/compose";
|
|
9
9
|
import { __ } from "@wordpress/i18n";
|
|
10
|
-
import SiteIcon from "../site-icon";
|
|
10
|
+
import SiteIcon from "../site-icon/index.mjs";
|
|
11
11
|
|
|
12
12
|
// packages/boot/src/components/canvas/back-button.scss
|
|
13
13
|
var css = `/**
|
|
@@ -177,4 +177,4 @@ function BootBackButton({ length }) {
|
|
|
177
177
|
export {
|
|
178
178
|
BootBackButton as default
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=back-button.
|
|
180
|
+
//# sourceMappingURL=back-button.mjs.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useState, useEffect } from "@wordpress/element";
|
|
3
3
|
import { Spinner } from "@wordpress/components";
|
|
4
4
|
import { useNavigate } from "@wordpress/route";
|
|
5
|
-
import BootBackButton from "./back-button";
|
|
5
|
+
import BootBackButton from "./back-button.mjs";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
function Canvas({ canvas }) {
|
|
8
8
|
const [Editor, setEditor] = useState(null);
|
|
@@ -73,4 +73,4 @@ function Canvas({ canvas }) {
|
|
|
73
73
|
export {
|
|
74
74
|
Canvas as default
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=index.
|
|
76
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/boot/src/components/canvas-renderer/index.tsx
|
|
2
2
|
import { useState, useEffect } from "@wordpress/element";
|
|
3
|
-
import Canvas from "../canvas";
|
|
3
|
+
import Canvas from "../canvas/index.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function CanvasRenderer({
|
|
6
6
|
canvas,
|
|
@@ -32,4 +32,4 @@ function CanvasRenderer({
|
|
|
32
32
|
export {
|
|
33
33
|
CanvasRenderer as default
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=index.
|
|
35
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@wordpress/components";
|
|
9
9
|
import { isRTL } from "@wordpress/i18n";
|
|
10
10
|
import { chevronRightSmall, chevronLeftSmall } from "@wordpress/icons";
|
|
11
|
-
import { wrapIcon } from "../items";
|
|
11
|
+
import { wrapIcon } from "../items.mjs";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
function DrilldownItem({
|
|
14
14
|
className,
|
|
@@ -46,4 +46,4 @@ function DrilldownItem({
|
|
|
46
46
|
export {
|
|
47
47
|
DrilldownItem as default
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=index.
|
|
49
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
import { chevronDownSmall } from "@wordpress/icons";
|
|
12
12
|
import { useReducedMotion } from "@wordpress/compose";
|
|
13
13
|
import { useSelect } from "@wordpress/data";
|
|
14
|
-
import { STORE_NAME } from "../../../store";
|
|
15
|
-
import NavigationItem from "../navigation-item";
|
|
16
|
-
import { wrapIcon } from "../items";
|
|
14
|
+
import { STORE_NAME } from "../../../store/index.mjs";
|
|
15
|
+
import NavigationItem from "../navigation-item/index.mjs";
|
|
16
|
+
import { wrapIcon } from "../items.mjs";
|
|
17
17
|
|
|
18
18
|
// packages/boot/src/components/navigation/dropdown-item/style.scss
|
|
19
19
|
var css = `/**
|
|
@@ -159,4 +159,4 @@ function DropdownItem({
|
|
|
159
159
|
export {
|
|
160
160
|
DropdownItem as default
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=index.
|
|
162
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// packages/boot/src/components/navigation/index.tsx
|
|
2
2
|
import { useState, useMemo, useRef } from "@wordpress/element";
|
|
3
3
|
import { useSelect } from "@wordpress/data";
|
|
4
|
-
import { STORE_NAME } from "../../store";
|
|
5
|
-
import NavigationItem from "./navigation-item";
|
|
6
|
-
import DrilldownItem from "./drilldown-item";
|
|
7
|
-
import DropdownItem from "./dropdown-item";
|
|
8
|
-
import NavigationScreen from "./navigation-screen";
|
|
9
|
-
import { useSidebarParent } from "./use-sidebar-parent";
|
|
4
|
+
import { STORE_NAME } from "../../store/index.mjs";
|
|
5
|
+
import NavigationItem from "./navigation-item/index.mjs";
|
|
6
|
+
import DrilldownItem from "./drilldown-item/index.mjs";
|
|
7
|
+
import DropdownItem from "./dropdown-item/index.mjs";
|
|
8
|
+
import NavigationScreen from "./navigation-screen/index.mjs";
|
|
9
|
+
import { useSidebarParent } from "./use-sidebar-parent.mjs";
|
|
10
10
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
11
11
|
function Navigation() {
|
|
12
12
|
const backButtonRef = useRef(null);
|
|
@@ -98,4 +98,4 @@ var navigation_default = Navigation;
|
|
|
98
98
|
export {
|
|
99
99
|
navigation_default as default
|
|
100
100
|
};
|
|
101
|
-
//# sourceMappingURL=index.
|
|
101
|
+
//# sourceMappingURL=index.mjs.map
|