@wordpress/boot 0.3.1-next.738bb1424.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.
- package/build-module/components/app/index.js +3 -3
- package/build-module/components/app/router.js +39 -42
- package/build-module/components/app/router.js.map +2 -2
- package/build-module/components/app/use-route-title.js +1 -1
- package/build-module/components/canvas/back-button.js +1 -1
- package/build-module/components/canvas/index.js +1 -1
- package/build-module/components/canvas-renderer/index.js +1 -1
- package/build-module/components/navigation/drilldown-item/index.js +1 -1
- package/build-module/components/navigation/dropdown-item/index.js +3 -3
- package/build-module/components/navigation/index.js +6 -6
- package/build-module/components/navigation/navigation-item/index.js +2 -2
- package/build-module/components/navigation/router-link-item.js +1 -1
- package/build-module/components/navigation/use-sidebar-parent.js +3 -3
- package/build-module/components/root/index.js +112 -102
- package/build-module/components/root/index.js.map +2 -2
- package/build-module/components/root/single-page.js +17 -11
- package/build-module/components/root/single-page.js.map +2 -2
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/sidebar/index.js +3 -3
- package/build-module/components/site-hub/index.js +10 -28
- package/build-module/components/site-hub/index.js.map +2 -2
- package/build-module/components/site-icon-link/index.js +2 -2
- package/build-module/index.js +62 -20
- package/build-module/index.js.map +2 -2
- package/build-module/store/index.js +3 -3
- package/build-style/style-rtl.css +59 -17
- package/build-style/style.css +59 -17
- package/build-types/components/app/router.d.ts.map +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/package.json +22 -30
- package/src/components/app/router.tsx +51 -54
- package/src/components/root/index.tsx +46 -44
- package/src/components/root/single-page.tsx +19 -18
- package/src/components/root/style.scss +0 -1
- package/src/components/site-hub/index.tsx +1 -6
- package/src/components/site-hub/style.scss +6 -21
- package/src/style.scss +34 -19
- package/tsconfig.json +27 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build-module/components/user-theme-provider/index.js +0 -33
- package/build-module/components/user-theme-provider/index.js.map +0 -7
- package/build-types/components/user-theme-provider/index.d.ts +0 -6
- package/build-types/components/user-theme-provider/index.d.ts.map +0 -1
- package/src/components/user-theme-provider/index.tsx +0 -35
- package/src/components/user-theme-provider/test/index.test.ts +0 -11
|
@@ -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";
|
|
5
|
+
import RootSinglePage from "../root/single-page";
|
|
6
|
+
import { store } from "../../store";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
function App({ rootComponent }) {
|
|
9
9
|
const routes = useSelect((select) => select(store).getRoutes(), []);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// packages/boot/src/components/app/router.tsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
|
-
import {
|
|
3
|
+
import { useState, useEffect } 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
8
|
import { resolveSelect } from "@wordpress/data";
|
|
9
9
|
import { store as coreStore } from "@wordpress/core-data";
|
|
10
|
-
import Root from "../root
|
|
11
|
-
import { unlock } from "../../lock-unlock
|
|
10
|
+
import Root from "../root";
|
|
11
|
+
import { unlock } from "../../lock-unlock";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
var {
|
|
14
14
|
createLazyRoute,
|
|
@@ -23,28 +23,20 @@ var {
|
|
|
23
23
|
function NotFoundComponent() {
|
|
24
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") }) });
|
|
25
25
|
}
|
|
26
|
-
function createRouteFromDefinition(route, parentRoute) {
|
|
26
|
+
async function createRouteFromDefinition(route, parentRoute) {
|
|
27
|
+
let routeConfig = {};
|
|
28
|
+
if (route.route_module) {
|
|
29
|
+
const module = await import(route.route_module);
|
|
30
|
+
routeConfig = module.route || {};
|
|
31
|
+
}
|
|
27
32
|
let tanstackRoute = createRoute({
|
|
28
33
|
getParentRoute: () => parentRoute,
|
|
29
34
|
path: route.path,
|
|
30
|
-
beforeLoad:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (routeConfig.beforeLoad) {
|
|
35
|
-
return routeConfig.beforeLoad({
|
|
36
|
-
params: opts.params || {},
|
|
37
|
-
search: opts.search || {}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
35
|
+
beforeLoad: routeConfig.beforeLoad ? (opts) => routeConfig.beforeLoad({
|
|
36
|
+
params: opts.params || {},
|
|
37
|
+
search: opts.search || {}
|
|
38
|
+
}) : void 0,
|
|
42
39
|
loader: async (opts) => {
|
|
43
|
-
let routeConfig = {};
|
|
44
|
-
if (route.route_module) {
|
|
45
|
-
const module = await import(route.route_module);
|
|
46
|
-
routeConfig = module.route || {};
|
|
47
|
-
}
|
|
48
40
|
const context = {
|
|
49
41
|
params: opts.params || {},
|
|
50
42
|
search: opts.deps || {}
|
|
@@ -88,13 +80,13 @@ function createRouteFromDefinition(route, parentRoute) {
|
|
|
88
80
|
});
|
|
89
81
|
return tanstackRoute;
|
|
90
82
|
}
|
|
91
|
-
function createRouteTree(routes, rootComponent = Root) {
|
|
83
|
+
async function createRouteTree(routes, rootComponent = Root) {
|
|
92
84
|
const rootRoute = createRootRoute({
|
|
93
85
|
component: rootComponent,
|
|
94
86
|
context: () => ({})
|
|
95
87
|
});
|
|
96
|
-
const dynamicRoutes =
|
|
97
|
-
(route) => createRouteFromDefinition(route, rootRoute)
|
|
88
|
+
const dynamicRoutes = await Promise.all(
|
|
89
|
+
routes.map((route) => createRouteFromDefinition(route, rootRoute))
|
|
98
90
|
);
|
|
99
91
|
return rootRoute.addChildren(dynamicRoutes);
|
|
100
92
|
}
|
|
@@ -117,26 +109,31 @@ function Router({
|
|
|
117
109
|
routes,
|
|
118
110
|
rootComponent = Root
|
|
119
111
|
}) {
|
|
120
|
-
const router =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
history
|
|
125
|
-
routeTree,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return ["navigate"];
|
|
136
|
-
}
|
|
112
|
+
const [router, setRouter] = useState(null);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
let cancelled = false;
|
|
115
|
+
async function initializeRouter() {
|
|
116
|
+
const history = createPathHistory();
|
|
117
|
+
const routeTree = await createRouteTree(routes, rootComponent);
|
|
118
|
+
if (!cancelled) {
|
|
119
|
+
const newRouter = createRouter({
|
|
120
|
+
history,
|
|
121
|
+
routeTree,
|
|
122
|
+
defaultPreload: "intent",
|
|
123
|
+
defaultNotFoundComponent: NotFoundComponent,
|
|
124
|
+
defaultViewTransition: true
|
|
125
|
+
});
|
|
126
|
+
setRouter(newRouter);
|
|
137
127
|
}
|
|
138
|
-
}
|
|
128
|
+
}
|
|
129
|
+
initializeRouter();
|
|
130
|
+
return () => {
|
|
131
|
+
cancelled = true;
|
|
132
|
+
};
|
|
139
133
|
}, [routes, rootComponent]);
|
|
134
|
+
if (!router) {
|
|
135
|
+
return /* @__PURE__ */ jsx("div", { children: "Loading routes..." });
|
|
136
|
+
}
|
|
140
137
|
return /* @__PURE__ */ jsx(RouterProvider, { router });
|
|
141
138
|
}
|
|
142
139
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 {
|
|
5
|
-
"mappings": ";AAQA,SAAS,UAAU;AACnB,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { ComponentType } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect } 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 */\nasync function createRouteFromDefinition(\n\troute: Route,\n\tparentRoute: AnyRoute\n) {\n\tlet routeConfig: RouteConfig = {};\n\n\tif ( route.route_module ) {\n\t\tconst module = await import( route.route_module );\n\t\trouteConfig = module.route || {};\n\t}\n\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: routeConfig.beforeLoad\n\t\t\t? ( opts: any ) =>\n\t\t\t\t\trouteConfig.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: undefined,\n\t\tloader: async ( opts: any ) => {\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 */\nasync function 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\n\tconst dynamicRoutes = await Promise.all(\n\t\troutes.map( ( route ) => createRouteFromDefinition( 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, setRouter ] = useState< any >( null );\n\n\tuseEffect( () => {\n\t\tlet cancelled = false;\n\n\t\tasync function initializeRouter() {\n\t\t\tconst history = createPathHistory();\n\t\t\tconst routeTree = await createRouteTree( routes, rootComponent );\n\n\t\t\tif ( ! cancelled ) {\n\t\t\t\tconst newRouter = createRouter( {\n\t\t\t\t\thistory,\n\t\t\t\t\trouteTree,\n\t\t\t\t\tdefaultPreload: 'intent',\n\t\t\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\t\t\tdefaultViewTransition: true,\n\t\t\t\t} );\n\t\t\t\tsetRouter( newRouter );\n\t\t\t}\n\t\t}\n\n\t\tinitializeRouter();\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t};\n\t}, [ routes, rootComponent ] );\n\n\tif ( ! router ) {\n\t\treturn <div>Loading routes...</div>;\n\t}\n\n\treturn <RouterProvider router={ router } />;\n}\n"],
|
|
5
|
+
"mappings": ";AAQA,SAAS,UAAU;AACnB,SAAS,UAAU,iBAAiB;AACpC,SAAS,YAAY;AACrB;AAAA,EACC,eAAe;AAAA,OAET;AACP,SAAS,qBAAqB;AAC9B,SAAS,SAAS,iBAAiB;AAKnC,OAAO,UAAU;AAEjB,SAAS,cAAc;AAiBpB,SAyFE,UAzFF,KAyFE,YAzFF;AAfH,IAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,IAAI,OAAQ,gBAAiB;AAG7B,SAAS,oBAAoB;AAC5B,SACC,oBAAC,SAAI,WAAU,sBACd,8BAAC,QAAK,OAAQ,GAAI,iBAAkB,GAAI,YAAU,MAC/C,aAAI,4CAA6C,GACpD,GACD;AAEF;AASA,eAAe,0BACd,OACA,aACC;AACD,MAAI,cAA2B,CAAC;AAEhC,MAAK,MAAM,cAAe;AACzB,UAAM,SAAS,MAAM,OAAQ,MAAM;AACnC,k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BAAmB;AACjC,YAAM,UAAU,kBAAkB;AAClC,YAAM,YAAY,MAAM,gBAAiB,QAAQ,aAAc;AAE/D,UAAK,CAAE,WAAY;AAClB,cAAM,YAAY,aAAc;AAAA,UAC/B;AAAA,UACA;AAAA,UACA,gBAAgB;AAAA,UAChB,0BAA0B;AAAA,UAC1B,uBAAuB;AAAA,QACxB,CAAE;AACF,kBAAW,SAAU;AAAA,MACtB;AAAA,IACD;AAEA,qBAAiB;AAEjB,WAAO,MAAM;AACZ,kBAAY;AAAA,IACb;AAAA,EACD,GAAG,CAAE,QAAQ,aAAc,CAAE;AAE7B,MAAK,CAAE,QAAS;AACf,WAAO,oBAAC,SAAI,+BAAiB;AAAA,EAC9B;AAEA,SAAO,oBAAC,kBAAe,QAAkB;AAC1C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ import { __, sprintf } from "@wordpress/i18n";
|
|
|
6
6
|
import { speak } from "@wordpress/a11y";
|
|
7
7
|
import { decodeEntities } from "@wordpress/html-entities";
|
|
8
8
|
import { privateApis as routePrivateApis } from "@wordpress/route";
|
|
9
|
-
import { unlock } from "../../lock-unlock
|
|
9
|
+
import { unlock } from "../../lock-unlock";
|
|
10
10
|
var { useLocation, useMatches } = unlock(routePrivateApis);
|
|
11
11
|
function useRouteTitle() {
|
|
12
12
|
const location = useLocation();
|
|
@@ -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";
|
|
11
11
|
|
|
12
12
|
// packages/boot/src/components/canvas/back-button.scss
|
|
13
13
|
var css = `/**
|
|
@@ -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";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
function Canvas({ canvas }) {
|
|
8
8
|
const [Editor, setEditor] = useState(null);
|
|
@@ -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";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function CanvasRenderer({
|
|
6
6
|
canvas,
|
|
@@ -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";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
function DrilldownItem({
|
|
14
14
|
className,
|
|
@@ -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";
|
|
15
|
+
import NavigationItem from "../navigation-item";
|
|
16
|
+
import { wrapIcon } from "../items";
|
|
17
17
|
|
|
18
18
|
// packages/boot/src/components/navigation/dropdown-item/style.scss
|
|
19
19
|
var css = `/**
|
|
@@ -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";
|
|
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";
|
|
10
10
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
11
11
|
function Navigation() {
|
|
12
12
|
const backButtonRef = useRef(null);
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
__experimentalItem as Item,
|
|
6
6
|
__experimentalHStack as HStack
|
|
7
7
|
} from "@wordpress/components";
|
|
8
|
-
import RouterLinkItem from "../router-link-item
|
|
9
|
-
import { wrapIcon } from "../items
|
|
8
|
+
import RouterLinkItem from "../router-link-item";
|
|
9
|
+
import { wrapIcon } from "../items";
|
|
10
10
|
|
|
11
11
|
// packages/boot/src/components/navigation/navigation-item/style.scss
|
|
12
12
|
var css = `/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { forwardRef } from "@wordpress/element";
|
|
3
3
|
import { __experimentalItem as Item } from "@wordpress/components";
|
|
4
4
|
import { privateApis as routePrivateApis } from "@wordpress/route";
|
|
5
|
-
import { unlock } from "../../lock-unlock
|
|
5
|
+
import { unlock } from "../../lock-unlock";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
var { createLink } = unlock(routePrivateApis);
|
|
8
8
|
function AnchorOnlyItem(props, forwardedRef) {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { privateApis as routePrivateApis } from "@wordpress/route";
|
|
3
3
|
import { useEffect, useState } from "@wordpress/element";
|
|
4
4
|
import { useSelect } from "@wordpress/data";
|
|
5
|
-
import { unlock } from "../../lock-unlock
|
|
6
|
-
import { STORE_NAME } from "../../store
|
|
5
|
+
import { unlock } from "../../lock-unlock";
|
|
6
|
+
import { STORE_NAME } from "../../store";
|
|
7
7
|
import {
|
|
8
8
|
findDrilldownParent,
|
|
9
9
|
findDropdownParent,
|
|
10
10
|
findClosestMenuItem
|
|
11
|
-
} from "./path-matching
|
|
11
|
+
} from "./path-matching";
|
|
12
12
|
var { useRouter, useMatches } = unlock(routePrivateApis);
|
|
13
13
|
function useSidebarParent() {
|
|
14
14
|
const matches = useMatches();
|