@wordpress/boot 0.20.0 → 0.21.2-next.v.202608281122.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/CHANGELOG.md +38 -0
- package/README.md +4 -0
- package/build-module/components/app/router.mjs +100 -4
- package/build-module/components/app/router.mjs.map +3 -3
- package/build-module/components/canvas/index.mjs +72 -13
- package/build-module/components/canvas/index.mjs.map +2 -2
- package/build-module/components/canvas/site-preview.mjs +50 -0
- package/build-module/components/canvas/site-preview.mjs.map +7 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs +122 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +7 -0
- package/build-module/components/canvas/viewport.mjs +18 -0
- package/build-module/components/canvas/viewport.mjs.map +7 -0
- package/build-module/components/error-boundary/index.mjs +129 -0
- package/build-module/components/error-boundary/index.mjs.map +7 -0
- package/build-module/components/navigation/drilldown-item/index.mjs +91 -1
- package/build-module/components/navigation/drilldown-item/index.mjs.map +3 -3
- package/build-module/components/navigation/dropdown-item/index.mjs +98 -11
- package/build-module/components/navigation/dropdown-item/index.mjs.map +4 -4
- package/build-module/components/navigation/index.mjs +0 -1
- package/build-module/components/navigation/index.mjs.map +2 -2
- package/build-module/components/navigation/navigation-item/index.mjs +88 -15
- package/build-module/components/navigation/navigation-item/index.mjs.map +3 -3
- package/build-module/components/navigation/navigation-screen/index.mjs +111 -38
- package/build-module/components/navigation/navigation-screen/index.mjs.map +3 -3
- package/build-module/components/plugin-area/index.mjs +29 -0
- package/build-module/components/plugin-area/index.mjs.map +7 -0
- package/build-module/components/root/index.mjs +220 -122
- package/build-module/components/root/index.mjs.map +3 -3
- package/build-module/components/root/single-page.mjs +139 -47
- package/build-module/components/root/single-page.mjs.map +3 -3
- package/build-module/components/root/use-sync-body-background.mjs.map +1 -1
- package/build-module/components/save-button/index.mjs +127 -16
- package/build-module/components/save-button/index.mjs.map +3 -3
- package/build-module/components/save-panel/index.mjs +91 -1
- package/build-module/components/save-panel/index.mjs.map +3 -3
- package/build-module/components/sidebar/index.mjs +90 -10
- package/build-module/components/sidebar/index.mjs.map +3 -3
- package/build-module/index.mjs +0 -16
- package/build-module/index.mjs.map +3 -3
- package/build-module/store/actions.mjs +8 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/reducer.mjs +16 -1
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +9 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-types/components/app/router.d.ts.map +1 -1
- package/build-types/components/canvas/index.d.ts.map +1 -1
- package/build-types/components/canvas/site-preview.d.ts +10 -0
- package/build-types/components/canvas/site-preview.d.ts.map +1 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +40 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -0
- package/build-types/components/canvas/viewport.d.ts +15 -0
- package/build-types/components/canvas/viewport.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +22 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts +0 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-item/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
- package/build-types/components/plugin-area/index.d.ts +12 -0
- package/build-types/components/plugin-area/index.d.ts.map +1 -0
- package/build-types/components/root/index.d.ts +0 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts +0 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/root/use-sync-body-background.d.ts +1 -1
- package/build-types/components/save-button/index.d.ts +0 -1
- package/build-types/components/save-button/index.d.ts.map +1 -1
- package/build-types/components/save-panel/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts +0 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/index.d.ts +0 -2
- package/build-types/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +15 -2
- 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 +12 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/types.d.ts +34 -3
- package/build-types/store/types.d.ts.map +1 -1
- package/package.json +27 -25
- package/src/components/app/router.tsx +19 -7
- package/src/components/canvas/index.tsx +117 -15
- package/src/components/canvas/site-preview.tsx +64 -0
- package/src/components/canvas/use-navigate-to-entity-record.ts +220 -0
- package/src/components/canvas/viewport.ts +34 -0
- package/src/components/error-boundary/index.tsx +71 -0
- package/src/components/error-boundary/style.module.scss +13 -0
- package/src/components/navigation/drilldown-item/index.tsx +2 -1
- package/src/components/navigation/dropdown-item/index.tsx +10 -6
- package/src/components/navigation/dropdown-item/{style.scss → style.module.scss} +6 -2
- package/src/components/navigation/index.tsx +0 -1
- package/src/components/navigation/navigation-item/index.tsx +3 -6
- package/src/components/navigation/navigation-item/{style.scss → style.module.scss} +7 -14
- package/src/components/navigation/navigation-screen/index.tsx +6 -15
- package/src/components/navigation/navigation-screen/{style.scss → style.module.scss} +10 -9
- package/src/components/plugin-area/index.tsx +34 -0
- package/src/components/root/{style.scss → _layout.module.scss} +71 -40
- package/src/components/root/_view-transitions.module.scss +205 -0
- package/src/components/root/index.tsx +44 -24
- package/src/components/root/single-page.tsx +15 -7
- package/src/components/root/style.module.scss +2 -0
- package/src/components/root/use-sync-body-background.ts +1 -1
- package/src/components/save-button/index.tsx +36 -14
- package/src/components/save-button/style.module.scss +10 -0
- package/src/components/save-panel/index.tsx +2 -1
- package/src/components/save-panel/style.module.scss +7 -0
- package/src/components/sidebar/index.tsx +5 -5
- package/src/components/sidebar/style.module.scss +29 -0
- package/src/index.tsx +0 -2
- package/src/store/actions.ts +18 -1
- package/src/store/reducer.ts +19 -0
- package/src/store/selectors.ts +28 -0
- package/src/store/types.ts +37 -3
- package/build-style/style-rtl.css +0 -133
- package/build-style/style.css +0 -133
- package/build-style/view-transitions-rtl.css +0 -189
- package/build-style/view-transitions.css +0 -189
- package/src/components/save-button/style.scss +0 -9
- package/src/components/sidebar/style.scss +0 -23
- package/src/style.scss +0 -34
- package/src/view-transitions.scss +0 -221
|
@@ -2,12 +2,21 @@ import { useEffect, useState } from '@wordpress/element';
|
|
|
2
2
|
import { useSelect } from '@wordpress/data';
|
|
3
3
|
import { _n, __, sprintf } from '@wordpress/i18n';
|
|
4
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ariaKeyShortcut,
|
|
7
|
+
displayShortcut,
|
|
8
|
+
shortcutAriaLabel,
|
|
9
|
+
} from '@wordpress/keycodes';
|
|
6
10
|
import { check } from '@wordpress/icons';
|
|
7
11
|
import { EntitiesSavedStates } from '@wordpress/editor';
|
|
8
12
|
import { Button, Modal } from '@wordpress/components';
|
|
9
|
-
import {
|
|
10
|
-
|
|
13
|
+
import {
|
|
14
|
+
KeyboardShortcutDescription,
|
|
15
|
+
KeyboardShortcutDisplay,
|
|
16
|
+
Tooltip,
|
|
17
|
+
useKeyboardShortcutProps,
|
|
18
|
+
} from '@wordpress/ui';
|
|
19
|
+
import styles from './style.module.scss';
|
|
11
20
|
import useSaveShortcut from '../save-panel/use-save-shortcut';
|
|
12
21
|
|
|
13
22
|
export default function SaveButton() {
|
|
@@ -53,6 +62,14 @@ export default function SaveButton() {
|
|
|
53
62
|
const shouldShowButton = hasChanges || showSavedState;
|
|
54
63
|
|
|
55
64
|
useSaveShortcut( { openSavePanel: () => setIsSaveViewOpened( true ) } );
|
|
65
|
+
const shortcut = {
|
|
66
|
+
displayShortcut: displayShortcut.primary( 's' ),
|
|
67
|
+
ariaKeyShortcut: ariaKeyShortcut.primary( 's' ),
|
|
68
|
+
label: shortcutAriaLabel.primary( 's' ),
|
|
69
|
+
};
|
|
70
|
+
const { descriptionId, targetProps } = useKeyboardShortcutProps( {
|
|
71
|
+
shortcut,
|
|
72
|
+
} );
|
|
56
73
|
|
|
57
74
|
if ( ! shouldShowButton ) {
|
|
58
75
|
return null;
|
|
@@ -76,12 +93,12 @@ export default function SaveButton() {
|
|
|
76
93
|
);
|
|
77
94
|
};
|
|
78
95
|
const label = getLabel();
|
|
79
|
-
const shortcut = displayShortcut.primary( 's' );
|
|
80
96
|
|
|
81
97
|
return (
|
|
82
98
|
<>
|
|
83
99
|
<Tooltip.Root>
|
|
84
100
|
<Tooltip.Trigger
|
|
101
|
+
{ ...targetProps }
|
|
85
102
|
render={
|
|
86
103
|
<Button
|
|
87
104
|
variant="primary"
|
|
@@ -91,20 +108,25 @@ export default function SaveButton() {
|
|
|
91
108
|
disabled={ disabled }
|
|
92
109
|
accessibleWhenDisabled
|
|
93
110
|
isBusy={ isSaving }
|
|
94
|
-
|
|
95
|
-
className="boot-save-button"
|
|
111
|
+
className={ styles[ 'save-button' ] }
|
|
96
112
|
icon={ isInSavedState ? check : undefined }
|
|
97
|
-
|
|
98
|
-
{ label }
|
|
99
|
-
</Button>
|
|
113
|
+
/>
|
|
100
114
|
}
|
|
101
|
-
|
|
115
|
+
>
|
|
116
|
+
{ label }
|
|
117
|
+
{ descriptionId && (
|
|
118
|
+
<KeyboardShortcutDescription
|
|
119
|
+
descriptionId={ descriptionId }
|
|
120
|
+
shortcut={ shortcut }
|
|
121
|
+
/>
|
|
122
|
+
) }
|
|
123
|
+
</Tooltip.Trigger>
|
|
102
124
|
<Tooltip.Popup>
|
|
103
125
|
{ hasChanges && <span>{ label }</span> }
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{ shortcut }
|
|
107
|
-
|
|
126
|
+
<KeyboardShortcutDisplay
|
|
127
|
+
className={ styles.shortcut }
|
|
128
|
+
shortcut={ shortcut }
|
|
129
|
+
/>
|
|
108
130
|
</Tooltip.Popup>
|
|
109
131
|
</Tooltip.Root>
|
|
110
132
|
{ isSaveViewOpen && (
|
|
@@ -3,6 +3,7 @@ import { Modal } from '@wordpress/components';
|
|
|
3
3
|
import { EntitiesSavedStates } from '@wordpress/editor';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import useSaveShortcut from './use-save-shortcut';
|
|
6
|
+
import styles from './style.module.scss';
|
|
6
7
|
|
|
7
8
|
export default function SavePanel() {
|
|
8
9
|
const [ isOpen, setIsOpen ] = useState< boolean >( false );
|
|
@@ -14,7 +15,7 @@ export default function SavePanel() {
|
|
|
14
15
|
}
|
|
15
16
|
return (
|
|
16
17
|
<Modal
|
|
17
|
-
className=
|
|
18
|
+
className={ styles.modal }
|
|
18
19
|
onRequestClose={ () => setIsOpen( false ) }
|
|
19
20
|
title={ __( 'Review changes' ) }
|
|
20
21
|
size="small"
|
|
@@ -5,7 +5,7 @@ import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
|
5
5
|
import Navigation from '../navigation';
|
|
6
6
|
import SaveButton from '../save-button';
|
|
7
7
|
import { store as bootStore } from '../../store';
|
|
8
|
-
import './style.scss';
|
|
8
|
+
import styles from './style.module.scss';
|
|
9
9
|
|
|
10
10
|
function DashboardBackButton() {
|
|
11
11
|
const dashboardLink = useSelect(
|
|
@@ -15,7 +15,7 @@ function DashboardBackButton() {
|
|
|
15
15
|
return (
|
|
16
16
|
<Button
|
|
17
17
|
__next40pxDefaultSize
|
|
18
|
-
className=
|
|
18
|
+
className={ styles[ 'back-button' ] }
|
|
19
19
|
href={ dashboardLink || '/' }
|
|
20
20
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
21
21
|
label={ __( 'Go to the Dashboard' ) }
|
|
@@ -27,12 +27,12 @@ function DashboardBackButton() {
|
|
|
27
27
|
|
|
28
28
|
export default function Sidebar() {
|
|
29
29
|
return (
|
|
30
|
-
<div className=
|
|
30
|
+
<div className={ styles.scrollable }>
|
|
31
31
|
<DashboardBackButton />
|
|
32
|
-
<div className=
|
|
32
|
+
<div className={ styles.content }>
|
|
33
33
|
<Navigation />
|
|
34
34
|
</div>
|
|
35
|
-
<div className=
|
|
35
|
+
<div className={ styles.footer }>
|
|
36
36
|
<SaveButton />
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/variables";
|
|
2
|
+
|
|
3
|
+
.scrollable {
|
|
4
|
+
overflow: auto;
|
|
5
|
+
height: 100%;
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.content {
|
|
12
|
+
flex-grow: 1;
|
|
13
|
+
contain: content;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.footer {
|
|
18
|
+
padding-block-start: variables.$grid-unit-20;
|
|
19
|
+
padding-inline-end: variables.$grid-unit-10;
|
|
20
|
+
padding-block-end: variables.$grid-unit-10;
|
|
21
|
+
padding-inline-start: variables.$grid-unit-20;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.back-button {
|
|
25
|
+
margin-block-start: variables.$grid-unit-20;
|
|
26
|
+
margin-inline-end: variables.$grid-unit-15;
|
|
27
|
+
margin-block-end: variables.$grid-unit-10;
|
|
28
|
+
margin-inline-start: variables.$grid-unit-15;
|
|
29
|
+
}
|
package/src/index.tsx
CHANGED
package/src/store/actions.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MenuItem, Route } from './types';
|
|
1
|
+
import type { EntityLinks, MenuItem, Route } from './types';
|
|
2
2
|
|
|
3
3
|
export function registerMenuItem( id: string, menuItem: MenuItem ) {
|
|
4
4
|
return {
|
|
@@ -23,6 +23,22 @@ export function registerRoute( route: Route ) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Registers where entities of a post type are listed and edited.
|
|
28
|
+
*
|
|
29
|
+
* Register `default` to cover post types with no entry of their own.
|
|
30
|
+
*
|
|
31
|
+
* @param postType Post type the links belong to, or `default`.
|
|
32
|
+
* @param links Paths to list and edit an entity of that post type.
|
|
33
|
+
*/
|
|
34
|
+
export function registerEntityLinks( postType: string, links: EntityLinks ) {
|
|
35
|
+
return {
|
|
36
|
+
type: 'REGISTER_ENTITY_LINKS' as const,
|
|
37
|
+
postType,
|
|
38
|
+
links,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
26
42
|
export function setDashboardLink( dashboardLink: string ) {
|
|
27
43
|
return {
|
|
28
44
|
type: 'SET_DASHBOARD_LINK' as const,
|
|
@@ -34,4 +50,5 @@ export type Action =
|
|
|
34
50
|
| ReturnType< typeof registerMenuItem >
|
|
35
51
|
| ReturnType< typeof updateMenuItem >
|
|
36
52
|
| ReturnType< typeof registerRoute >
|
|
53
|
+
| ReturnType< typeof registerEntityLinks >
|
|
37
54
|
| ReturnType< typeof setDashboardLink >;
|
package/src/store/reducer.ts
CHANGED
|
@@ -5,6 +5,7 @@ const initialState: State = {
|
|
|
5
5
|
menuItems: {},
|
|
6
6
|
routes: [],
|
|
7
7
|
dashboardLink: undefined,
|
|
8
|
+
entityLinks: {},
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export function reducer( state: State = initialState, action: Action ): State {
|
|
@@ -19,6 +20,12 @@ export function reducer( state: State = initialState, action: Action ): State {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
case 'UPDATE_MENU_ITEM':
|
|
23
|
+
// Updating an item that was never registered would add a partial
|
|
24
|
+
// entry to the menu, which renders as an empty navigation row.
|
|
25
|
+
if ( ! state.menuItems[ action.id ] ) {
|
|
26
|
+
return state;
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
return {
|
|
23
30
|
...state,
|
|
24
31
|
menuItems: {
|
|
@@ -36,6 +43,18 @@ export function reducer( state: State = initialState, action: Action ): State {
|
|
|
36
43
|
routes: [ ...state.routes, action.route ],
|
|
37
44
|
};
|
|
38
45
|
|
|
46
|
+
case 'REGISTER_ENTITY_LINKS':
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
entityLinks: {
|
|
50
|
+
...state.entityLinks,
|
|
51
|
+
[ action.postType ]: {
|
|
52
|
+
...state.entityLinks[ action.postType ],
|
|
53
|
+
...action.links,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
39
58
|
case 'SET_DASHBOARD_LINK':
|
|
40
59
|
return {
|
|
41
60
|
...state,
|
package/src/store/selectors.ts
CHANGED
|
@@ -11,3 +11,31 @@ export function getRoutes( state: State ) {
|
|
|
11
11
|
export function getDashboardLink( state: State ) {
|
|
12
12
|
return state.dashboardLink;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns the path an entity is edited or listed at.
|
|
17
|
+
*
|
|
18
|
+
* Falls back to the links registered for `default`, so a post type with no
|
|
19
|
+
* entry of its own still resolves.
|
|
20
|
+
*
|
|
21
|
+
* @param state Store state.
|
|
22
|
+
* @param postType Post type to resolve for.
|
|
23
|
+
* @param postId Entity to edit. Omit for the list of the post type.
|
|
24
|
+
* @return The path, or undefined when nothing is registered for it.
|
|
25
|
+
*/
|
|
26
|
+
export function getEntityLink(
|
|
27
|
+
state: State,
|
|
28
|
+
postType: string,
|
|
29
|
+
postId?: string | number
|
|
30
|
+
) {
|
|
31
|
+
const links = state.entityLinks[ postType ] ?? state.entityLinks.default;
|
|
32
|
+
const path = postId === undefined ? links?.list : links?.edit;
|
|
33
|
+
|
|
34
|
+
if ( ! path ) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return path
|
|
39
|
+
.replace( '{type}', encodeURIComponent( postType ) )
|
|
40
|
+
.replace( '{id}', encodeURIComponent( postId ?? '' ) );
|
|
41
|
+
}
|
package/src/store/types.ts
CHANGED
|
@@ -53,11 +53,25 @@ export interface CanvasData {
|
|
|
53
53
|
* Indicates if the canvas is in preview mode.
|
|
54
54
|
*/
|
|
55
55
|
isPreview?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The routes an entity of a given post type is edited and listed at.
|
|
60
|
+
*
|
|
61
|
+
* Registered by the application rather than known here, so the shell holds no
|
|
62
|
+
* knowledge of any particular page's URLs.
|
|
63
|
+
*/
|
|
64
|
+
export interface EntityLinks {
|
|
56
65
|
/**
|
|
57
|
-
*
|
|
58
|
-
* When provided with isPreview: true, clicking the canvas navigates to this URL.
|
|
66
|
+
* Path the entities of this post type are listed at.
|
|
59
67
|
*/
|
|
60
|
-
|
|
68
|
+
list?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Path an entity of this post type is edited at. `{id}` is replaced with
|
|
72
|
+
* the encoded entity ID.
|
|
73
|
+
*/
|
|
74
|
+
edit?: string;
|
|
61
75
|
}
|
|
62
76
|
|
|
63
77
|
/**
|
|
@@ -104,6 +118,25 @@ export interface RouteConfig {
|
|
|
104
118
|
*/
|
|
105
119
|
inspector?: ( context: RouteLoaderContext ) => boolean | Promise< boolean >;
|
|
106
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Function that determines whether to show the stage.
|
|
123
|
+
* When not defined, defaults to true (always show stage if component exists).
|
|
124
|
+
* When it returns false, the stage is hidden even if a stage component is
|
|
125
|
+
* exported, leaving the canvas to fill the surfaces area.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```tsx
|
|
129
|
+
* export const route = {
|
|
130
|
+
* stage: async () => {
|
|
131
|
+
* // Only show the stage when there is something to edit
|
|
132
|
+
* const theme = await resolveSelect( coreStore ).getCurrentTheme();
|
|
133
|
+
* return !! theme?.is_block_theme;
|
|
134
|
+
* },
|
|
135
|
+
* };
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
stage?: ( context: RouteLoaderContext ) => boolean | Promise< boolean >;
|
|
139
|
+
|
|
107
140
|
/**
|
|
108
141
|
* Function that returns the document title for the route.
|
|
109
142
|
* The returned title will be formatted as: "{title} ‹ {siteTitle} — WordPress"
|
|
@@ -161,4 +194,5 @@ export interface State {
|
|
|
161
194
|
menuItems: Record< string, MenuItem >;
|
|
162
195
|
routes: Route[];
|
|
163
196
|
dashboardLink?: string;
|
|
197
|
+
entityLinks: Record< string, EntityLinks >;
|
|
164
198
|
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typography
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* SCSS Variables.
|
|
6
|
-
*
|
|
7
|
-
* Please use variables from this sheet to ensure consistency across the UI.
|
|
8
|
-
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
9
|
-
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Colors
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Fonts & basic variables.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Typography
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Grid System.
|
|
22
|
-
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Radius scale.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Elevation scale.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Dimensions.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Mobile specific styles
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Editor styles.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Block & Editor UI.
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Block paddings.
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* React Native specific.
|
|
47
|
-
* These variables do not appear to be used anywhere else.
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* Breakpoints & Media Queries
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* Converts a hex value into the rgb equivalent.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
56
|
-
* @return {string} comma separated rgb values
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Long content fade mixin
|
|
60
|
-
*
|
|
61
|
-
* Creates a fading overlay to signify that the content is longer
|
|
62
|
-
* than the space allows.
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Breakpoint mixins
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Focus styles.
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* Standard focus rings for the WordPress Design System.
|
|
72
|
-
*
|
|
73
|
-
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
-
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
-
*/
|
|
76
|
-
/**
|
|
77
|
-
* Applies editor left position to the selector passed as argument
|
|
78
|
-
*/
|
|
79
|
-
/**
|
|
80
|
-
* Styles that are reused verbatim in a few places
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* Allows users to opt-out of animations via OS-level preferences.
|
|
84
|
-
*/
|
|
85
|
-
/**
|
|
86
|
-
* Reset default styles for JavaScript UI based pages.
|
|
87
|
-
* This is a WP-admin agnostic reset
|
|
88
|
-
*/
|
|
89
|
-
/**
|
|
90
|
-
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
91
|
-
*/
|
|
92
|
-
/**
|
|
93
|
-
* Creates a checkerboard pattern background to indicate transparency.
|
|
94
|
-
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
|
|
95
|
-
*/
|
|
96
|
-
@media (min-width: 600px) {
|
|
97
|
-
.boot-layout-container .boot-layout {
|
|
98
|
-
position: absolute;
|
|
99
|
-
top: 0;
|
|
100
|
-
left: 0;
|
|
101
|
-
bottom: 0;
|
|
102
|
-
right: 0;
|
|
103
|
-
min-height: calc(100vh - 46px);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
@media (min-width: 782px) {
|
|
107
|
-
.boot-layout-container .boot-layout {
|
|
108
|
-
min-height: calc(100vh - 32px);
|
|
109
|
-
}
|
|
110
|
-
body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout {
|
|
111
|
-
min-height: 100vh;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
:where(.boot-layout) img {
|
|
116
|
-
max-width: 100%;
|
|
117
|
-
height: auto;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.boot-layout .boot-notices__snackbar {
|
|
121
|
-
position: fixed;
|
|
122
|
-
bottom: var(--wpds-dimension-size-md, 32px);
|
|
123
|
-
right: 0;
|
|
124
|
-
left: 0;
|
|
125
|
-
padding-inline: 16px;
|
|
126
|
-
box-sizing: border-box;
|
|
127
|
-
display: flex;
|
|
128
|
-
flex-direction: column;
|
|
129
|
-
pointer-events: none;
|
|
130
|
-
}
|
|
131
|
-
.boot-layout .boot-notices__snackbar .components-snackbar {
|
|
132
|
-
margin-inline: auto;
|
|
133
|
-
}
|
package/build-style/style.css
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typography
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* SCSS Variables.
|
|
6
|
-
*
|
|
7
|
-
* Please use variables from this sheet to ensure consistency across the UI.
|
|
8
|
-
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
9
|
-
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Colors
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Fonts & basic variables.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Typography
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Grid System.
|
|
22
|
-
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Radius scale.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Elevation scale.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Dimensions.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Mobile specific styles
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Editor styles.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Block & Editor UI.
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Block paddings.
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* React Native specific.
|
|
47
|
-
* These variables do not appear to be used anywhere else.
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* Breakpoints & Media Queries
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* Converts a hex value into the rgb equivalent.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
56
|
-
* @return {string} comma separated rgb values
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Long content fade mixin
|
|
60
|
-
*
|
|
61
|
-
* Creates a fading overlay to signify that the content is longer
|
|
62
|
-
* than the space allows.
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Breakpoint mixins
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Focus styles.
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* Standard focus rings for the WordPress Design System.
|
|
72
|
-
*
|
|
73
|
-
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
-
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
-
*/
|
|
76
|
-
/**
|
|
77
|
-
* Applies editor left position to the selector passed as argument
|
|
78
|
-
*/
|
|
79
|
-
/**
|
|
80
|
-
* Styles that are reused verbatim in a few places
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* Allows users to opt-out of animations via OS-level preferences.
|
|
84
|
-
*/
|
|
85
|
-
/**
|
|
86
|
-
* Reset default styles for JavaScript UI based pages.
|
|
87
|
-
* This is a WP-admin agnostic reset
|
|
88
|
-
*/
|
|
89
|
-
/**
|
|
90
|
-
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
91
|
-
*/
|
|
92
|
-
/**
|
|
93
|
-
* Creates a checkerboard pattern background to indicate transparency.
|
|
94
|
-
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
|
|
95
|
-
*/
|
|
96
|
-
@media (min-width: 600px) {
|
|
97
|
-
.boot-layout-container .boot-layout {
|
|
98
|
-
position: absolute;
|
|
99
|
-
top: 0;
|
|
100
|
-
right: 0;
|
|
101
|
-
bottom: 0;
|
|
102
|
-
left: 0;
|
|
103
|
-
min-height: calc(100vh - 46px);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
@media (min-width: 782px) {
|
|
107
|
-
.boot-layout-container .boot-layout {
|
|
108
|
-
min-height: calc(100vh - 32px);
|
|
109
|
-
}
|
|
110
|
-
body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout {
|
|
111
|
-
min-height: 100vh;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
:where(.boot-layout) img {
|
|
116
|
-
max-width: 100%;
|
|
117
|
-
height: auto;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.boot-layout .boot-notices__snackbar {
|
|
121
|
-
position: fixed;
|
|
122
|
-
bottom: var(--wpds-dimension-size-md, 32px);
|
|
123
|
-
left: 0;
|
|
124
|
-
right: 0;
|
|
125
|
-
padding-inline: 16px;
|
|
126
|
-
box-sizing: border-box;
|
|
127
|
-
display: flex;
|
|
128
|
-
flex-direction: column;
|
|
129
|
-
pointer-events: none;
|
|
130
|
-
}
|
|
131
|
-
.boot-layout .boot-notices__snackbar .components-snackbar {
|
|
132
|
-
margin-inline: auto;
|
|
133
|
-
}
|