@wordpress/boot 0.1.1-next.2f1c7c01b.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 +788 -0
- package/build-module/components/app/index.js +32 -0
- package/build-module/components/app/index.js.map +7 -0
- package/build-module/components/app/router.js +119 -0
- package/build-module/components/app/router.js.map +7 -0
- package/build-module/components/navigation/drilldown-item/index.js +49 -0
- package/build-module/components/navigation/drilldown-item/index.js.map +7 -0
- package/build-module/components/navigation/dropdown-item/index.js +162 -0
- package/build-module/components/navigation/dropdown-item/index.js.map +7 -0
- package/build-module/components/navigation/index.js +101 -0
- package/build-module/components/navigation/index.js.map +7 -0
- package/build-module/components/navigation/items.js +60 -0
- package/build-module/components/navigation/items.js.map +7 -0
- package/build-module/components/navigation/navigation-item/index.js +180 -0
- package/build-module/components/navigation/navigation-item/index.js.map +7 -0
- package/build-module/components/navigation/navigation-screen/index.js +196 -0
- package/build-module/components/navigation/navigation-screen/index.js.map +7 -0
- package/build-module/components/navigation/path-matching.js +78 -0
- package/build-module/components/navigation/path-matching.js.map +7 -0
- package/build-module/components/navigation/router-link-item.js +14 -0
- package/build-module/components/navigation/router-link-item.js.map +7 -0
- package/build-module/components/navigation/use-sidebar-parent.js +52 -0
- package/build-module/components/navigation/use-sidebar-parent.js.map +7 -0
- package/build-module/components/root/index.js +115 -0
- package/build-module/components/root/index.js.map +7 -0
- package/build-module/components/sidebar/index.js +78 -0
- package/build-module/components/sidebar/index.js.map +7 -0
- package/build-module/components/site-hub/index.js +153 -0
- package/build-module/components/site-hub/index.js.map +7 -0
- package/build-module/components/site-icon/index.js +115 -0
- package/build-module/components/site-icon/index.js.map +7 -0
- package/build-module/components/site-icon-link/index.js +101 -0
- package/build-module/components/site-icon-link/index.js.map +7 -0
- package/build-module/index.js +622 -0
- package/build-module/index.js.map +7 -0
- package/build-module/lock-unlock.js +11 -0
- package/build-module/lock-unlock.js.map +7 -0
- package/build-module/store/actions.js +19 -0
- package/build-module/store/actions.js.map +7 -0
- package/build-module/store/index.js +17 -0
- package/build-module/store/index.js.map +7 -0
- package/build-module/store/reducer.js +27 -0
- package/build-module/store/reducer.js.map +7 -0
- package/build-module/store/selectors.js +12 -0
- package/build-module/store/selectors.js.map +7 -0
- package/build-module/store/types.js +1 -0
- package/build-module/store/types.js.map +7 -0
- package/build-style/style-rtl.css +612 -0
- package/build-style/style.css +612 -0
- package/build-types/components/app/index.d.ts +6 -0
- package/build-types/components/app/index.d.ts.map +1 -0
- package/build-types/components/app/router.d.ts +7 -0
- package/build-types/components/app/router.d.ts.map +1 -0
- package/build-types/components/navigation/drilldown-item/index.d.ts +34 -0
- package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -0
- package/build-types/components/navigation/dropdown-item/index.d.ts +36 -0
- package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -0
- package/build-types/components/navigation/index.d.ts +3 -0
- package/build-types/components/navigation/index.d.ts.map +1 -0
- package/build-types/components/navigation/items.d.ts +16 -0
- package/build-types/components/navigation/items.d.ts.map +1 -0
- package/build-types/components/navigation/navigation-item/index.d.ts +28 -0
- package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -0
- package/build-types/components/navigation/navigation-screen/index.d.ts +24 -0
- package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -0
- package/build-types/components/navigation/path-matching.d.ts +30 -0
- package/build-types/components/navigation/path-matching.d.ts.map +1 -0
- package/build-types/components/navigation/router-link-item.d.ts +5 -0
- package/build-types/components/navigation/router-link-item.d.ts.map +1 -0
- package/build-types/components/navigation/use-sidebar-parent.d.ts +12 -0
- package/build-types/components/navigation/use-sidebar-parent.d.ts.map +1 -0
- package/build-types/components/root/index.d.ts +3 -0
- package/build-types/components/root/index.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts +3 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -0
- package/build-types/components/site-hub/index.d.ts +4 -0
- package/build-types/components/site-hub/index.d.ts.map +1 -0
- package/build-types/components/site-icon/index.d.ts +9 -0
- package/build-types/components/site-icon/index.d.ts.map +1 -0
- package/build-types/components/site-icon-link/index.d.ts +8 -0
- package/build-types/components/site-icon-link/index.d.ts.map +1 -0
- package/build-types/index.d.ts +6 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +15 -0
- package/build-types/store/actions.d.ts.map +1 -0
- package/build-types/store/index.d.ts +6 -0
- package/build-types/store/index.d.ts.map +1 -0
- package/build-types/store/reducer.d.ts +7 -0
- package/build-types/store/reducer.d.ts.map +1 -0
- package/build-types/store/selectors.d.ts +7 -0
- package/build-types/store/selectors.d.ts.map +1 -0
- package/build-types/store/types.d.ts +63 -0
- package/build-types/store/types.d.ts.map +1 -0
- package/package.json +64 -0
- package/src/components/app/index.tsx +45 -0
- package/src/components/app/router.tsx +198 -0
- package/src/components/navigation/drilldown-item/index.tsx +88 -0
- package/src/components/navigation/dropdown-item/index.tsx +134 -0
- package/src/components/navigation/dropdown-item/style.scss +23 -0
- package/src/components/navigation/index.tsx +126 -0
- package/src/components/navigation/items.tsx +93 -0
- package/src/components/navigation/navigation-item/index.tsx +88 -0
- package/src/components/navigation/navigation-item/style.scss +52 -0
- package/src/components/navigation/navigation-screen/index.tsx +147 -0
- package/src/components/navigation/navigation-screen/style.scss +34 -0
- package/src/components/navigation/path-matching.ts +149 -0
- package/src/components/navigation/router-link-item.tsx +22 -0
- package/src/components/navigation/use-sidebar-parent.ts +77 -0
- package/src/components/root/index.tsx +42 -0
- package/src/components/root/style.scss +41 -0
- package/src/components/sidebar/index.tsx +17 -0
- package/src/components/sidebar/style.scss +15 -0
- package/src/components/site-hub/index.tsx +67 -0
- package/src/components/site-hub/style.scss +54 -0
- package/src/components/site-icon/index.tsx +60 -0
- package/src/components/site-icon/style.scss +19 -0
- package/src/components/site-icon-link/index.tsx +43 -0
- package/src/components/site-icon-link/style.scss +24 -0
- package/src/index.tsx +5 -0
- package/src/lock-unlock.ts +9 -0
- package/src/store/actions.ts +23 -0
- package/src/store/index.ts +23 -0
- package/src/store/reducer.ts +31 -0
- package/src/store/selectors.ts +12 -0
- package/src/store/types.ts +70 -0
- package/src/style.scss +2 -0
- package/tsconfig.json +23 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconType } from '../../../store/types';
|
|
3
|
+
import './style.scss';
|
|
4
|
+
interface DropdownItemProps {
|
|
5
|
+
/**
|
|
6
|
+
* Optional CSS class name.
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Identifier of the parent menu item.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Icon to display with the dropdown item.
|
|
15
|
+
*/
|
|
16
|
+
icon?: IconType;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to show placeholder icons for alignment.
|
|
19
|
+
*/
|
|
20
|
+
shouldShowPlaceholder?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Content to display inside the dropdown item.
|
|
23
|
+
*/
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Whether this dropdown is currently expanded.
|
|
27
|
+
*/
|
|
28
|
+
isExpanded: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Function to toggle this dropdown's expanded state.
|
|
31
|
+
*/
|
|
32
|
+
onToggle: () => void;
|
|
33
|
+
}
|
|
34
|
+
export default function DropdownItem({ className, id, icon, children, isExpanded, onToggle, }: DropdownItemProps): import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/dropdown-item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAwBvC,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC/D,OAAO,cAAc,CAAC;AAItB,UAAU,iBAAiB;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,SAAS,EACT,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,+BA8DnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/index.tsx"],"names":[],"mappings":"AAiBA,iBAAS,UAAU,gCA0GlB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { IconType } from '../../store/types';
|
|
5
|
+
/**
|
|
6
|
+
* Converts the given IconType into a renderable component:
|
|
7
|
+
* - Dashicon string into a Dashicon component
|
|
8
|
+
* - JSX SVG element into an Icon component
|
|
9
|
+
* - Data URL into an img element
|
|
10
|
+
*
|
|
11
|
+
* @param icon - The icon to convert
|
|
12
|
+
* @param shouldShowPlaceholder - Whether to show placeholder when no icon is provided
|
|
13
|
+
* @return The converted icon as a JSX element
|
|
14
|
+
*/
|
|
15
|
+
export declare function wrapIcon(icon?: IconType, shouldShowPlaceholder?: boolean): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element | null;
|
|
16
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/items.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAelD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACvB,IAAI,CAAC,EAAE,QAAQ,EACf,qBAAqB,GAAE,OAAc,qGAuDrC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconType } from '../../../store/types';
|
|
3
|
+
import './style.scss';
|
|
4
|
+
interface NavigationItemProps {
|
|
5
|
+
/**
|
|
6
|
+
* Optional CSS class name.
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Icon to display with the navigation item.
|
|
11
|
+
*/
|
|
12
|
+
icon?: IconType;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show placeholder icons for alignment.
|
|
15
|
+
*/
|
|
16
|
+
shouldShowPlaceholder?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Content to display inside the navigation item.
|
|
19
|
+
*/
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The path to navigate to.
|
|
23
|
+
*/
|
|
24
|
+
to: string;
|
|
25
|
+
}
|
|
26
|
+
export default function NavigationItem({ className, icon, shouldShowPlaceholder, children, to, }: NavigationItemProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/navigation-item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,cAAc,CAAC;AAEtB,UAAU,mBAAmB;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACX;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAE,EACvC,SAAS,EACT,IAAI,EACJ,qBAA4B,EAC5B,QAAQ,EACR,EAAE,GACF,EAAE,mBAAmB,+BAkCrB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode, RefObject } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import './style.scss';
|
|
9
|
+
export default function NavigationScreen({ isRoot, title, actions, content, description, animationDirection, backMenuItem, backButtonRef, navigationKey, onNavigate, }: {
|
|
10
|
+
isRoot?: boolean;
|
|
11
|
+
title: string;
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
content: ReactNode;
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
backMenuItem?: string;
|
|
16
|
+
backButtonRef?: RefObject<HTMLButtonElement>;
|
|
17
|
+
animationDirection?: 'forward' | 'backward';
|
|
18
|
+
navigationKey?: string;
|
|
19
|
+
onNavigate: ({ id, direction, }: {
|
|
20
|
+
id?: string;
|
|
21
|
+
direction: 'forward' | 'backward';
|
|
22
|
+
}) => void;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/navigation-screen/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBlD;;GAEG;AACH,OAAO,cAAc,CAAC;AAkBtB,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,EACzC,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,GACV,EAAE;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,SAAS,CAAE,iBAAiB,CAAE,CAAC;IAC/C,kBAAkB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAE,EACb,EAAE,EACF,SAAS,GACT,EAAE;QACF,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;KAClC,KAAM,IAAI,CAAC;CACZ,+BA8EA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { MenuItem } from '../../store/types';
|
|
5
|
+
/**
|
|
6
|
+
* Finds the menu item that is the closest parent of the current path.
|
|
7
|
+
* Only considers menu items that have a 'to' path defined and are valid parents.
|
|
8
|
+
*
|
|
9
|
+
* @param currentPath - Current page path
|
|
10
|
+
* @param menuItems - Array of all menu items
|
|
11
|
+
* @return Menu item that is the closest parent, or null if no valid parent found
|
|
12
|
+
*/
|
|
13
|
+
export declare const findClosestMenuItem: (currentPath: string, menuItems: MenuItem[]) => MenuItem | null;
|
|
14
|
+
/**
|
|
15
|
+
* Finds the drilldown parent of a menu item by traversing up the menu tree.
|
|
16
|
+
*
|
|
17
|
+
* @param id - The ID of the menu item to find the drilldown parent for
|
|
18
|
+
* @param menuItems - Array of all menu items
|
|
19
|
+
* @return The ID of the drilldown parent, or undefined if none found
|
|
20
|
+
*/
|
|
21
|
+
export declare const findDrilldownParent: (id: string | undefined, menuItems: MenuItem[]) => string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Finds the dropdown parent of a menu item.
|
|
24
|
+
*
|
|
25
|
+
* @param id - The ID of the menu item to find the dropdown parent for
|
|
26
|
+
* @param menuItems - Array of all menu items
|
|
27
|
+
* @return The ID of the dropdown parent, or undefined if none found
|
|
28
|
+
*/
|
|
29
|
+
export declare const findDropdownParent: (id: string | undefined, menuItems: MenuItem[]) => string | undefined;
|
|
30
|
+
//# sourceMappingURL=path-matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-matching.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/path-matching.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAqClD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,gBAClB,MAAM,aACR,QAAQ,EAAE,KACnB,QAAQ,GAAG,IAyBb,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,OAC3B,MAAM,GAAG,SAAS,aACX,QAAQ,EAAE,KACnB,MAAM,GAAG,SA0BX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,OAC1B,MAAM,GAAG,SAAS,aACX,QAAQ,EAAE,KACnB,MAAM,GAAG,SAsBX,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const RouterLinkItem: import("@tanstack/react-router").LinkComponent<import("react").ForwardRefExoticComponent<Omit<import("@wordpress/components/build-types/item-group/types").ItemProps & import("react").RefAttributes<any> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "as" | keyof import("react").RefAttributes<any> | keyof import("@wordpress/components/build-types/item-group/types").ItemProps> & {
|
|
2
|
+
as?: keyof JSX.IntrinsicElements | undefined;
|
|
3
|
+
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>, string>;
|
|
4
|
+
export default RouterLinkItem;
|
|
5
|
+
//# sourceMappingURL=router-link-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-link-item.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/router-link-item.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,cAAc;;sEAA6C,CAAC;AAElE,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `useSidebarParent` hook returns the ID of the parent menu item
|
|
3
|
+
* to render in the sidebar based on the current route.
|
|
4
|
+
*
|
|
5
|
+
* - It finds the closest matching menu item when exact path matches fail
|
|
6
|
+
* - It allows the user to navigate in the sidebar (local state) without changing the URL.
|
|
7
|
+
* - If the URL changes, it will update the parent ID to ensure the correct drilldown level is displayed.
|
|
8
|
+
*
|
|
9
|
+
* @return The ID of the parent menu item to render in the sidebar.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSidebarParent(): readonly [string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>, string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>];
|
|
12
|
+
//# sourceMappingURL=use-sidebar-parent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sidebar-parent.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/use-sidebar-parent.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,kNA6C/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/root/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,cAAc,CAAC;AAItB,MAAM,CAAC,OAAO,UAAU,IAAI,gCAoB3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/index.tsx"],"names":[],"mappings":"AAKA,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,OAAO,gCAS9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-hub/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,cAAc,CAAC;AAEtB,iBAAS,OAAO,gCAsCf;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon/index.tsx"],"names":[],"mappings":"AAcA;;GAEG;AACH,OAAO,cAAc,CAAC;AAEtB,iBAAS,QAAQ,CAAE,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAsCvD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon-link/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AAEtB,iBAAS,YAAY,CAAE,EACtB,EAAE,EACF,YAAY,EACZ,GAAG,KAAK,EACR,EAAE;IACF,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,+BAqBA;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-unlock.d.ts","sourceRoot":"","sources":["../src/lock-unlock.ts"],"names":[],"mappings":"AAIA,eAAO,MAAQ,IAAI,mDAAE,MAAM,iCAIzB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { MenuItem, Route } from './types';
|
|
5
|
+
export declare function registerMenuItem(id: string, menuItem: MenuItem): {
|
|
6
|
+
type: "REGISTER_MENU_ITEM";
|
|
7
|
+
id: string;
|
|
8
|
+
menuItem: MenuItem;
|
|
9
|
+
};
|
|
10
|
+
export declare function registerRoute(route: Route): {
|
|
11
|
+
type: "REGISTER_ROUTE";
|
|
12
|
+
route: Route;
|
|
13
|
+
};
|
|
14
|
+
export type Action = ReturnType<typeof registerMenuItem> | ReturnType<typeof registerRoute>;
|
|
15
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,gBAAgB,CAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;;;;EAM/D;AAED,wBAAgB,aAAa,CAAE,KAAK,EAAE,KAAK;;;EAK1C;AAED,MAAM,MAAM,MAAM,GACf,UAAU,CAAE,OAAO,gBAAgB,CAAE,GACrC,UAAU,CAAE,OAAO,aAAa,CAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as actions from './actions';
|
|
2
|
+
import * as selectors from './selectors';
|
|
3
|
+
declare const STORE_NAME = "wordpress/boot";
|
|
4
|
+
export declare const store: import("@wordpress/data/build-types/types").StoreDescriptor<import("@wordpress/data/build-types/types").ReduxStoreConfig<unknown, typeof actions, typeof selectors>>;
|
|
5
|
+
export { STORE_NAME };
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,QAAA,MAAM,UAAU,mBAAmB,CAAC;AAEpC,eAAO,MAAM,KAAK,sKAIf,CAAC;AAIJ,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAOrC,wBAAgB,OAAO,CAAE,KAAK,EAAE,KAAK,YAAe,EAAE,MAAM,EAAE,MAAM,GAAI,KAAK,CAmB5E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { State } from './types';
|
|
5
|
+
export declare function getMenuItems(state: State): import("./types").MenuItem[];
|
|
6
|
+
export declare function getRoutes(state: State): import("./types").Route[];
|
|
7
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,YAAY,CAAE,KAAK,EAAE,KAAK,gCAEzC;AAED,wBAAgB,SAAS,CAAE,KAAK,EAAE,KAAK,6BAEtC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode, ComponentType } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Icon type supporting multiple formats:
|
|
7
|
+
* - Dashicon strings (e.g., "dashicons-admin-generic")
|
|
8
|
+
* - JSX elements
|
|
9
|
+
* - SVG icons from @wordpress/icons
|
|
10
|
+
* - Data URLs for images
|
|
11
|
+
*/
|
|
12
|
+
export type IconType = string | JSX.Element | ReactNode;
|
|
13
|
+
export interface MenuItem {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
to: string;
|
|
17
|
+
icon?: IconType;
|
|
18
|
+
parent?: string;
|
|
19
|
+
parent_type?: 'drilldown' | 'dropdown';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Route surfaces exported from content_module.
|
|
23
|
+
* Stage is required, inspector is optional.
|
|
24
|
+
*/
|
|
25
|
+
export interface RouteSurfaces {
|
|
26
|
+
stage?: ComponentType;
|
|
27
|
+
inspector?: ComponentType;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Route loader context containing params and search.
|
|
31
|
+
*/
|
|
32
|
+
export interface RouteLoaderContext {
|
|
33
|
+
params: Record<string, string>;
|
|
34
|
+
search: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Route configuration interface.
|
|
38
|
+
* Routes specify content_module for surfaces and optionally route_module for lifecycle functions.
|
|
39
|
+
*/
|
|
40
|
+
export interface Route {
|
|
41
|
+
/**
|
|
42
|
+
* Route path (e.g., "/post-edit/$postId")
|
|
43
|
+
*/
|
|
44
|
+
path: string;
|
|
45
|
+
/**
|
|
46
|
+
* Module path for lazy loading the route's surfaces (stage, inspector).
|
|
47
|
+
* The module must export: RouteSurfaces (stage and/or inspector components)
|
|
48
|
+
* This enables code splitting for better performance.
|
|
49
|
+
*/
|
|
50
|
+
content_module?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Module path for route lifecycle functions.
|
|
53
|
+
* The module should export a named export `route` containing:
|
|
54
|
+
* - beforeLoad?: Pre-navigation hook (authentication, validation, redirects)
|
|
55
|
+
* - loader?: Data preloading function
|
|
56
|
+
*/
|
|
57
|
+
route_module?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface State {
|
|
60
|
+
menuItems: Record<string, MenuItem>;
|
|
61
|
+
routes: Route[];
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,CAAC;IACjC,MAAM,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,KAAK;IACrB,SAAS,EAAE,MAAM,CAAE,MAAM,EAAE,QAAQ,CAAE,CAAC;IACtC,MAAM,EAAE,KAAK,EAAE,CAAC;CAChB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wordpress/boot",
|
|
3
|
+
"version": "0.1.1-next.2f1c7c01b.0",
|
|
4
|
+
"description": "Minimal boot package for WordPress admin pages.",
|
|
5
|
+
"author": "The WordPress Contributors",
|
|
6
|
+
"license": "GPL-2.0-or-later",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"wordpress",
|
|
9
|
+
"gutenberg",
|
|
10
|
+
"boot"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/packages/boot/README.md",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/WordPress/gutenberg.git",
|
|
16
|
+
"directory": "packages/boot"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18.12.0",
|
|
23
|
+
"npm": ">=8.19.2"
|
|
24
|
+
},
|
|
25
|
+
"module": "build-module/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./build-types/index.d.ts",
|
|
29
|
+
"import": "./build-module/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"react-native": "src/index",
|
|
34
|
+
"wpScriptModuleExports": "./build-module/index.js",
|
|
35
|
+
"types": "build-types",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@tanstack/history": "^1.133.28",
|
|
38
|
+
"@tanstack/react-router": "^1.120.5",
|
|
39
|
+
"@wordpress/admin-ui": "^1.2.1-next.2f1c7c01b.0",
|
|
40
|
+
"@wordpress/commands": "^1.34.1-next.2f1c7c01b.0",
|
|
41
|
+
"@wordpress/components": "^30.7.2-next.2f1c7c01b.0",
|
|
42
|
+
"@wordpress/compose": "^7.34.1-next.2f1c7c01b.0",
|
|
43
|
+
"@wordpress/core-data": "^7.34.1-next.2f1c7c01b.0",
|
|
44
|
+
"@wordpress/data": "^10.34.1-next.2f1c7c01b.0",
|
|
45
|
+
"@wordpress/element": "^6.34.1-next.2f1c7c01b.0",
|
|
46
|
+
"@wordpress/html-entities": "^4.34.1-next.2f1c7c01b.0",
|
|
47
|
+
"@wordpress/i18n": "^6.7.1-next.2f1c7c01b.0",
|
|
48
|
+
"@wordpress/icons": "^11.1.1-next.2f1c7c01b.0",
|
|
49
|
+
"@wordpress/keycodes": "^4.34.1-next.2f1c7c01b.0",
|
|
50
|
+
"@wordpress/primitives": "^4.34.1-next.2f1c7c01b.0",
|
|
51
|
+
"@wordpress/private-apis": "^1.34.1-next.2f1c7c01b.0",
|
|
52
|
+
"@wordpress/theme": "^0.1.1-next.2f1c7c01b.0",
|
|
53
|
+
"@wordpress/url": "^4.34.1-next.2f1c7c01b.0",
|
|
54
|
+
"clsx": "^2.1.1"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": "^18.0.0",
|
|
58
|
+
"react-dom": "^18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"gitHead": "c6ddcdf455bc02567a2c9e03de6862a2061b85e8"
|
|
64
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createRoot, StrictMode } from '@wordpress/element';
|
|
5
|
+
import { dispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Router from './router';
|
|
11
|
+
import { store } from '../../store';
|
|
12
|
+
import type { MenuItem, Route } from '../../store/types';
|
|
13
|
+
|
|
14
|
+
function App() {
|
|
15
|
+
const routes = useSelect( ( select ) => select( store ).getRoutes(), [] );
|
|
16
|
+
|
|
17
|
+
return <Router routes={ routes } />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function init( {
|
|
21
|
+
menuItems,
|
|
22
|
+
routes,
|
|
23
|
+
}: {
|
|
24
|
+
menuItems?: MenuItem[];
|
|
25
|
+
routes?: Route[];
|
|
26
|
+
} ) {
|
|
27
|
+
( menuItems ?? [] ).forEach( ( menuItem ) => {
|
|
28
|
+
dispatch( store ).registerMenuItem( menuItem.id, menuItem );
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
( routes ?? [] ).forEach( ( route ) => {
|
|
32
|
+
dispatch( store ).registerRoute( route );
|
|
33
|
+
} );
|
|
34
|
+
|
|
35
|
+
// Render the app
|
|
36
|
+
const rootElement = document.getElementById( 'gutenberg-boot-app' );
|
|
37
|
+
if ( rootElement ) {
|
|
38
|
+
const root = createRoot( rootElement );
|
|
39
|
+
root.render(
|
|
40
|
+
<StrictMode>
|
|
41
|
+
<App />
|
|
42
|
+
</StrictMode>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|