Editor: Update @wordpress packages for 6.2 RC1.

Updates the `@wordpress` packages to include the following changes:

- Site Editor: Move "Add Template"'s descriptions to tooltips
- Update template descriptions with more detail
- Distraction Free Mode: Don't show the metaboxes
- Remove actions from SidebarNavigationScreenWrapper
- Fix: Navigation sidebar shows a wrong submenu popover.
- Fix: Site button metrics
- Fix navigation block off-canvas appender for empty menus
- Style Book: Move iframe to root of content area to support styles that overflow block previews
- Fix navigation block off-canvas appender for empty

Reference:
* [446428841b Package publish commit in Gutenberg]

Follow-up to [55475].

Props mamaduka.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55496


git-svn-id: http://core.svn.wordpress.org/trunk@55029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2023-03-09 13:55:07 +00:00
parent 8743a96dfe
commit 338b45ddba
17 changed files with 226 additions and 186 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -459,10 +459,19 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
@media (min-width:600px){ @media (min-width:600px){
.edit-site-new-template-dropdown .edit-site-new-template-dropdown__popover{ .edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups{
min-width:300px; min-width:300px;
} }
} }
.edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content{
border-radius:2px;
max-width:320px;
min-width:0;
padding:8px 12px;
text-align:right;
white-space:pre-wrap;
width:auto;
}
.edit-site-custom-template-modal__contents>.components-button{ .edit-site-custom-template-modal__contents>.components-button{
border-radius:2px; border-radius:2px;
@ -2282,7 +2291,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
background:#1e1e1e; background:#1e1e1e;
flex-shrink:0; flex-shrink:0;
height:60px; height:60px;
width:64px; width:60px;
} }
.edit-site-site-hub__text-content{ .edit-site-site-hub__text-content{
@ -2347,6 +2356,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
color:#fff; color:#fff;
} }
.edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu{
display:none;
}
.edit-site-site-icon__icon{ .edit-site-site-icon__icon{
fill:currentColor; fill:currentColor;
} }
@ -2385,53 +2398,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
bottom:0; bottom:0;
left:0; left:0;
overflow:auto; overflow:auto;
padding:32px; padding:0;
position:absolute; position:absolute;
right:0; right:0;
top:48px; top:48px;
} }
.edit-site-style-book__examples{
margin:0 auto;
max-width:900px;
}
.edit-site-style-book__example{
background:none;
border:none;
border-radius:2px;
color:inherit;
cursor:pointer;
display:flex;
flex-direction:column;
gap:40px;
margin-bottom:40px;
padding:16px;
width:100%;
}
.edit-site-style-book__example.is-selected{
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-style-book.is-wide .edit-site-style-book__example{
flex-direction:row;
}
.edit-site-style-book__example-title{
font-size:11px;
font-weight:500;
margin:0;
text-align:right;
text-transform:uppercase;
}
.edit-site-style-book.is-wide .edit-site-style-book__example-title{
text-align:left;
width:120px;
}
.edit-site-style-book__example-preview{
width:100%;
}
.edit-site-push-changes-to-global-styles-control .components-button{ .edit-site-push-changes-to-global-styles-control .components-button{
justify-content:center; justify-content:center;
width:100%; width:100%;

File diff suppressed because one or more lines are too long

View File

@ -459,10 +459,19 @@ body.is-fullscreen-mode .interface-interface-skeleton{
} }
@media (min-width:600px){ @media (min-width:600px){
.edit-site-new-template-dropdown .edit-site-new-template-dropdown__popover{ .edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups{
min-width:300px; min-width:300px;
} }
} }
.edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content{
border-radius:2px;
max-width:320px;
min-width:0;
padding:8px 12px;
text-align:left;
white-space:pre-wrap;
width:auto;
}
.edit-site-custom-template-modal__contents>.components-button{ .edit-site-custom-template-modal__contents>.components-button{
border-radius:2px; border-radius:2px;
@ -2282,7 +2291,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
background:#1e1e1e; background:#1e1e1e;
flex-shrink:0; flex-shrink:0;
height:60px; height:60px;
width:64px; width:60px;
} }
.edit-site-site-hub__text-content{ .edit-site-site-hub__text-content{
@ -2347,6 +2356,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
color:#fff; color:#fff;
} }
.edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu{
display:none;
}
.edit-site-site-icon__icon{ .edit-site-site-icon__icon{
fill:currentColor; fill:currentColor;
} }
@ -2385,53 +2398,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
bottom:0; bottom:0;
left:0; left:0;
overflow:auto; overflow:auto;
padding:32px; padding:0;
position:absolute; position:absolute;
right:0; right:0;
top:48px; top:48px;
} }
.edit-site-style-book__examples{
margin:0 auto;
max-width:900px;
}
.edit-site-style-book__example{
background:none;
border:none;
border-radius:2px;
color:inherit;
cursor:pointer;
display:flex;
flex-direction:column;
gap:40px;
margin-bottom:40px;
padding:16px;
width:100%;
}
.edit-site-style-book__example.is-selected{
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-style-book.is-wide .edit-site-style-book__example{
flex-direction:row;
}
.edit-site-style-book__example-title{
font-size:11px;
font-weight:500;
margin:0;
text-align:left;
text-transform:uppercase;
}
.edit-site-style-book.is-wide .edit-site-style-book__example-title{
text-align:right;
width:120px;
}
.edit-site-style-book__example-preview{
width:100%;
}
.edit-site-push-changes-to-global-styles-control .components-button{ .edit-site-push-changes-to-global-styles-control .components-button{
justify-content:center; justify-content:center;
width:100%; width:100%;

File diff suppressed because one or more lines are too long

View File

@ -57237,6 +57237,7 @@ const off_canvas_editor_BLOCK_LIST_ITEM_HEIGHT = 36;
* *
* @param {Object} props Components props. * @param {Object} props Components props.
* @param {string} props.id An HTML element id for the root element of ListView. * @param {string} props.id An HTML element id for the root element of ListView.
* @param {string} props.parentClientId The client id of the parent block.
* @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy. * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy.
* @param {boolean} props.showBlockMovers Flag to enable block movers * @param {boolean} props.showBlockMovers Flag to enable block movers
* @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. * @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default.
@ -57250,6 +57251,7 @@ const off_canvas_editor_BLOCK_LIST_ITEM_HEIGHT = 36;
function OffCanvasEditor(_ref, ref) { function OffCanvasEditor(_ref, ref) {
let { let {
id, id,
parentClientId,
blocks, blocks,
showBlockMovers = false, showBlockMovers = false,
isExpanded = false, isExpanded = false,
@ -57381,6 +57383,7 @@ function OffCanvasEditor(_ref, ref) {
}, (0,external_wp_element_namespaceObject.createElement)(context_ListViewContext.Provider, { }, (0,external_wp_element_namespaceObject.createElement)(context_ListViewContext.Provider, {
value: contextValue value: contextValue
}, (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_branch, { }, (0,external_wp_element_namespaceObject.createElement)(off_canvas_editor_branch, {
parentId: parentClientId,
blocks: clientIdsTree, blocks: clientIdsTree,
selectBlock: selectEditorBlock, selectBlock: selectEditorBlock,
showBlockMovers: showBlockMovers, showBlockMovers: showBlockMovers,

File diff suppressed because one or more lines are too long

View File

@ -31854,6 +31854,7 @@ const MainContent = _ref => {
(0,external_wp_i18n_namespaceObject.__)('Structure for navigation menu: %s'), (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.title) || (0,external_wp_i18n_namespaceObject.__)('Untitled menu')) : (0,external_wp_i18n_namespaceObject.__)('You have not yet created any menus. Displaying a list of your Pages'); (0,external_wp_i18n_namespaceObject.__)('Structure for navigation menu: %s'), (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.title) || (0,external_wp_i18n_namespaceObject.__)('Untitled menu')) : (0,external_wp_i18n_namespaceObject.__)('You have not yet created any menus. Displaying a list of your Pages');
return (0,external_wp_element_namespaceObject.createElement)(OffCanvasEditor, { return (0,external_wp_element_namespaceObject.createElement)(OffCanvasEditor, {
blocks: clientIdsTree, blocks: clientIdsTree,
parentClientId: clientId,
isExpanded: true, isExpanded: true,
LeafMoreMenu: LeafMoreMenu, LeafMoreMenu: LeafMoreMenu,
description: description description: description

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7367,7 +7367,7 @@ function PostTemplateCreateModal(_ref) {
onChange: setTitle, onChange: setTitle,
placeholder: DEFAULT_TITLE, placeholder: DEFAULT_TITLE,
disabled: isBusy, disabled: isBusy,
help: (0,external_wp_i18n_namespaceObject.__)('Describe the template, e.g. "Post with sidebar". Custom templates can be applied to any post or page.') help: (0,external_wp_i18n_namespaceObject.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, { }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right" justify: "right"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
@ -9309,7 +9309,7 @@ function Layout(_ref) {
isInserterOpened, isInserterOpened,
isListViewOpened, isListViewOpened,
showIconLabels, showIconLabels,
isDistractionFreeMode, isDistractionFree,
showBlockBreadcrumbs, showBlockBreadcrumbs,
isTemplateMode, isTemplateMode,
documentLabel documentLabel
@ -9333,13 +9333,12 @@ function Layout(_ref) {
previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-post/previous-region'), previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-post/previous-region'),
nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-post/next-region'), nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-post/next-region'),
showIconLabels: select(store_store).isFeatureActive('showIconLabels'), showIconLabels: select(store_store).isFeatureActive('showIconLabels'),
isDistractionFreeMode: select(store_store).isFeatureActive('distractionFree'), isDistractionFree: select(store_store).isFeatureActive('distractionFree'),
showBlockBreadcrumbs: select(store_store).isFeatureActive('showBlockBreadcrumbs'), showBlockBreadcrumbs: select(store_store).isFeatureActive('showBlockBreadcrumbs'),
// translators: Default label for the Document in the Block Breadcrumb. // translators: Default label for the Document in the Block Breadcrumb.
documentLabel: postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun') documentLabel: postTypeLabel || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun')
}; };
}, []); }, []);
const isDistractionFree = isDistractionFreeMode && isLargeViewport;
const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document'); // Inserter and Sidebars are mutually exclusive const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document'); // Inserter and Sidebars are mutually exclusive
@ -9369,7 +9368,7 @@ function Layout(_ref) {
'has-fixed-toolbar': hasFixedToolbar, 'has-fixed-toolbar': hasFixedToolbar,
'has-metaboxes': hasActiveMetaboxes, 'has-metaboxes': hasActiveMetaboxes,
'show-icon-labels': showIconLabels, 'show-icon-labels': showIconLabels,
'is-distraction-free': isDistractionFree, 'is-distraction-free': isDistractionFree && isLargeViewport,
'is-entity-save-view-open': !!entitiesSavedStatesCallback 'is-entity-save-view-open': !!entitiesSavedStatesCallback
}); });
const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('Document Overview') : (0,external_wp_i18n_namespaceObject.__)('Block Library'); const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('Document Overview') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
@ -9395,7 +9394,7 @@ function Layout(_ref) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(fullscreen_mode, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(fullscreen_mode, {
isActive: isFullscreenActive isActive: isFullscreenActive
}), (0,external_wp_element_namespaceObject.createElement)(browser_url, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.UnsavedChangesWarning, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.AutosaveMonitor, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, null), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, null), (0,external_wp_element_namespaceObject.createElement)(settings_sidebar, null), (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, { }), (0,external_wp_element_namespaceObject.createElement)(browser_url, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.UnsavedChangesWarning, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.AutosaveMonitor, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, null), (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, null), (0,external_wp_element_namespaceObject.createElement)(settings_sidebar, null), (0,external_wp_element_namespaceObject.createElement)(interface_skeleton, {
isDistractionFree: isDistractionFree, isDistractionFree: isDistractionFree && isLargeViewport,
className: className, className: className,
labels: { ...interfaceLabels, labels: { ...interfaceLabels,
secondarySidebar: secondarySidebarLabel secondarySidebar: secondarySidebarLabel
@ -9418,14 +9417,14 @@ function Layout(_ref) {
notices: (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorSnackbars, null), notices: (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorSnackbars, null),
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isDistractionFree && (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorNotices, null), (mode === 'text' || !isRichEditingEnabled) && (0,external_wp_element_namespaceObject.createElement)(TextEditor, null), isRichEditingEnabled && mode === 'visual' && (0,external_wp_element_namespaceObject.createElement)(VisualEditor, { content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isDistractionFree && (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorNotices, null), (mode === 'text' || !isRichEditingEnabled) && (0,external_wp_element_namespaceObject.createElement)(TextEditor, null), isRichEditingEnabled && mode === 'visual' && (0,external_wp_element_namespaceObject.createElement)(VisualEditor, {
styles: styles styles: styles
}), !isTemplateMode && (0,external_wp_element_namespaceObject.createElement)("div", { }), !isDistractionFree && !isTemplateMode && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-post-layout__metaboxes" className: "edit-post-layout__metaboxes"
}, (0,external_wp_element_namespaceObject.createElement)(MetaBoxes, { }, (0,external_wp_element_namespaceObject.createElement)(MetaBoxes, {
location: "normal" location: "normal"
}), (0,external_wp_element_namespaceObject.createElement)(MetaBoxes, { }), (0,external_wp_element_namespaceObject.createElement)(MetaBoxes, {
location: "advanced" location: "advanced"
})), isMobileViewport && sidebarIsOpened && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ScrollLock, null)), })), isMobileViewport && sidebarIsOpened && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ScrollLock, null)),
footer: !isDistractionFree && showBlockBreadcrumbs && !isMobileViewport && isRichEditingEnabled && mode === 'visual' && (0,external_wp_element_namespaceObject.createElement)("div", { footer: !isDistractionFree && !isMobileViewport && showBlockBreadcrumbs && isRichEditingEnabled && mode === 'visual' && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-post-layout__footer" className: "edit-post-layout__footer"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
rootLabelText: documentLabel rootLabelText: documentLabel

File diff suppressed because one or more lines are too long

View File

@ -7059,6 +7059,8 @@ function NewTemplate(_ref) {
return null; return null;
} }
const customTemplateDescription = (0,external_wp_i18n_namespaceObject.__)('A custom template can be manually applied to any post or page.');
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
className: "edit-site-new-template-dropdown", className: "edit-site-new-template-dropdown",
icon: showIcon ? library_plus : null, icon: showIcon ? library_plus : null,
@ -7068,8 +7070,8 @@ function NewTemplate(_ref) {
noArrow: false noArrow: false
}, },
toggleProps: toggleProps toggleProps: toggleProps
}, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isCreatingTemplate && (0,external_wp_element_namespaceObject.createElement)(TemplateActionsLoadingScreen, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, { }, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isCreatingTemplate && (0,external_wp_element_namespaceObject.createElement)(TemplateActionsLoadingScreen, null), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-new-template-dropdown__popover" className: "edit-site-new-template-dropdown__menu-groups"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
label: postType.labels.add_new_item label: postType.labels.add_new_item
}, missingTemplates.map(template => { }, missingTemplates.map(template => {
@ -7080,20 +7082,25 @@ function NewTemplate(_ref) {
onClick, onClick,
icon icon
} = template; } = template;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
key: slug,
position: "top right",
text: description,
className: "edit-site-new-template-dropdown__menu-item-tooltip"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
icon: icon || TEMPLATE_ICONS[slug] || library_post, icon: icon || TEMPLATE_ICONS[slug] || library_post,
iconPosition: "left", iconPosition: "left",
info: description,
key: slug,
onClick: () => onClick ? onClick(template) : createTemplate(template) onClick: () => onClick ? onClick(template) : createTemplate(template)
}, title); }, title, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, description)));
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, { })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
position: "top right",
text: customTemplateDescription,
className: "edit-site-new-template-dropdown__menu-item-tooltip"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
icon: library_layout, icon: library_layout,
iconPosition: "left", iconPosition: "left",
info: (0,external_wp_i18n_namespaceObject.__)('Custom templates can be applied to any post or page.'),
key: "custom-template",
onClick: () => setShowCustomGenericTemplateModal(true) onClick: () => setShowCustomGenericTemplateModal(true)
}, (0,external_wp_i18n_namespaceObject.__)('Custom template')))))), showCustomTemplateModal && (0,external_wp_element_namespaceObject.createElement)(add_custom_template_modal, { }, (0,external_wp_i18n_namespaceObject.__)('Custom template'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, null, customTemplateDescription))))))), showCustomTemplateModal && (0,external_wp_element_namespaceObject.createElement)(add_custom_template_modal, {
onClose: () => setShowCustomTemplateModal(false), onClose: () => setShowCustomTemplateModal(false),
onSelect: createTemplate, onSelect: createTemplate,
entityForSuggestions: entityForSuggestions, entityForSuggestions: entityForSuggestions,
@ -7879,7 +7886,6 @@ function NavigationMenuContent(_ref) {
const sidebar_navigation_screen_navigation_menus_noop = () => {}; const sidebar_navigation_screen_navigation_menus_noop = () => {};
const NAVIGATION_MENUS_QUERY = { const NAVIGATION_MENUS_QUERY = {
@ -7900,7 +7906,6 @@ function SidebarNavigationScreenWrapper(_ref) {
}); });
} }
const prioritizedInserterBlocks = ['core/navigation-link/page', 'core/navigation-link'];
function SidebarNavigationScreenNavigationMenus() { function SidebarNavigationScreenNavigationMenus() {
var _orderedNavigationMen; var _orderedNavigationMen;
@ -7958,24 +7963,6 @@ function SidebarNavigationScreenNavigationMenus() {
}); });
} }
}, [history]); }, [history]);
const orderInitialBlockItems = (0,external_wp_element_namespaceObject.useCallback)(items => {
items.sort((_ref2, _ref3) => {
let {
id: aName
} = _ref2;
let {
id: bName
} = _ref3;
// Sort block items according to `prioritizedInserterBlocks`.
let aIndex = prioritizedInserterBlocks.indexOf(aName);
let bIndex = prioritizedInserterBlocks.indexOf(bName); // All other block items should come after that.
if (aIndex < 0) aIndex = prioritizedInserterBlocks.length;
if (bIndex < 0) bIndex = prioritizedInserterBlocks.length;
return aIndex - bIndex;
});
return items;
}, []);
if (hasResolvedNavigationMenus && !hasNavigationMenus) { if (hasResolvedNavigationMenus && !hasNavigationMenus) {
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_i18n_namespaceObject.__)('There are no Navigation Menus.')); return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_i18n_namespaceObject.__)('There are no Navigation Menus.'));
@ -7985,29 +7972,12 @@ function SidebarNavigationScreenNavigationMenus() {
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuLoader, null)); return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuLoader, null));
} }
const {
PrivateInserter
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, {
settings: storedSettings, settings: storedSettings,
value: blocks, value: blocks,
onChange: sidebar_navigation_screen_navigation_menus_noop, onChange: sidebar_navigation_screen_navigation_menus_noop,
onInput: sidebar_navigation_screen_navigation_menus_noop onInput: sidebar_navigation_screen_navigation_menus_noop
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, { }, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_element_namespaceObject.createElement)("div", {
actions: (0,external_wp_element_namespaceObject.createElement)(PrivateInserter, {
rootClientId: blocks[0].clientId,
position: "bottom right",
isAppender: true,
selectBlockOnInsert: false,
shouldDirectInsert: false,
__experimentalIsQuick: true,
toggleProps: {
as: SidebarButton,
label: (0,external_wp_i18n_namespaceObject.__)('Add menu item')
},
orderInitialBlockItems: orderInitialBlockItems
})
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-sidebar-navigation-screen-navigation-menus__content" className: "edit-site-sidebar-navigation-screen-navigation-menus__content"
}, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuContent, { }, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuContent, {
rootClientId: blocks[0].clientId, rootClientId: blocks[0].clientId,
@ -12203,6 +12173,7 @@ function ScreenBorder(_ref) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/style-book/index.js
/** /**
* External dependencies * External dependencies
*/ */
@ -12219,19 +12190,90 @@ function ScreenBorder(_ref) {
/** /**
* Internal dependencies * Internal dependencies
*/ */
const { const {
ExperimentalBlockEditorProvider,
useGlobalStyle: style_book_useGlobalStyle useGlobalStyle: style_book_useGlobalStyle
} = unlock(external_wp_blockEditor_namespaceObject.privateApis); } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const SLOT_FILL_NAME = 'EditSiteStyleBook'; const SLOT_FILL_NAME = 'EditSiteStyleBook';
const { const {
Slot: StyleBookSlot, Slot: StyleBookSlot,
Fill: StyleBookFill Fill: StyleBookFill
} = (0,external_wp_components_namespaceObject.createSlotFill)(SLOT_FILL_NAME); } = (0,external_wp_components_namespaceObject.createSlotFill)(SLOT_FILL_NAME); // The content area of the Style Book is rendered within an iframe so that global styles
// are applied to elements within the entire content area. To support elements that are
// not part of the block previews, such as headings and layout for the block previews,
// additional CSS rules need to be passed into the iframe. These are hard-coded below.
// Note that button styles are unset, and then focus rules from the `Button` component are
// applied to the `button` element, targeted via `.edit-site-style-book__example`.
// This is to ensure that browser default styles for buttons are not applied to the previews.
const STYLE_BOOK_IFRAME_STYLES = `
.edit-site-style-book__examples {
max-width: 900px;
margin: 0 auto;
}
.edit-site-style-book__example {
border-radius: 2px;
cursor: pointer;
display: flex;
flex-direction: column;
gap: 40px;
margin-bottom: 40px;
padding: 16px;
width: 100%;
box-sizing: border-box;
}
.edit-site-style-book__example.is-selected {
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
}
.edit-site-style-book__example:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
outline: 3px solid transparent;
}
.edit-site-style-book__examples.is-wide .edit-site-style-book__example {
flex-direction: row;
}
.edit-site-style-book__example-title {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 11px;
font-weight: 500;
line-height: normal;
margin: 0;
text-align: left;
text-transform: uppercase;
}
.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {
text-align: right;
width: 120px;
}
.edit-site-style-book__example-preview {
width: 100%;
}
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
.edit-site-style-book__example-preview .block-list-appender {
display: none;
}
.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {
margin-top: 0;
}
.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {
margin-bottom: 0;
}
`;
function getExamples() { function getExamples() {
// Use our own example for the Heading block so that we can show multiple // Use our own example for the Heading block so that we can show multiple
@ -12290,6 +12332,10 @@ function StyleBook(_ref) {
title: category.title, title: category.title,
icon: category.icon icon: category.icon
})), [examples]); })), [examples]);
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []);
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings,
__unstableIsPreviewMode: true
}), [originalSettings]);
function closeOnEscape(event) { function closeOnEscape(event) {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
@ -12318,25 +12364,48 @@ function StyleBook(_ref) {
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, { }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TabPanel, {
className: "edit-site-style-book__tab-panel", className: "edit-site-style-book__tab-panel",
tabs: tabs tabs: tabs
}, tab => (0,external_wp_element_namespaceObject.createElement)(Examples, { }, tab => (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableIframe, {
className: "edit-site-style-book__iframe",
head: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, {
styles: settings.styles
}), (0,external_wp_element_namespaceObject.createElement)("style", null, // Forming a "block formatting context" to prevent margin collapsing.
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
`.is-root-container { display: flow-root; }
body { position: relative; padding: 32px !important; }` + STYLE_BOOK_IFRAME_STYLES)),
name: "style-book-canvas",
tabIndex: 0
}, settings.svgFilters, (0,external_wp_element_namespaceObject.createElement)(Examples, {
className: classnames_default()('edit-site-style-book__examples', {
'is-wide': sizes.width > 600
}),
examples: examples, examples: examples,
category: tab.name, category: tab.name,
label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Category of blocks, e.g. Text.
(0,external_wp_i18n_namespaceObject.__)('Examples of blocks in the %s category'), tab.title),
isSelected: isSelected, isSelected: isSelected,
onSelect: onSelect onSelect: onSelect
})))); })))));
} }
const Examples = (0,external_wp_element_namespaceObject.memo)(_ref2 => { const Examples = (0,external_wp_element_namespaceObject.memo)(_ref2 => {
let { let {
className,
examples, examples,
category, category,
label,
isSelected, isSelected,
onSelect onSelect
} = _ref2; } = _ref2;
return (0,external_wp_element_namespaceObject.createElement)("div", { const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)({
className: "edit-site-style-book__examples" orientation: 'vertical'
}, examples.filter(example => example.category === category).map(example => (0,external_wp_element_namespaceObject.createElement)(Example, { });
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, extends_extends({}, composite, {
className: className,
"aria-label": label
}), examples.filter(example => example.category === category).map(example => (0,external_wp_element_namespaceObject.createElement)(Example, {
key: example.name, key: example.name,
id: `example-${example.name}`,
composite: composite,
title: example.title, title: example.title,
blocks: example.blocks, blocks: example.blocks,
isSelected: isSelected(example.name), isSelected: isSelected(example.name),
@ -12345,32 +12414,46 @@ const Examples = (0,external_wp_element_namespaceObject.memo)(_ref2 => {
} }
}))); })));
}); });
const Example = (0,external_wp_element_namespaceObject.memo)(_ref3 => {
const Example = _ref3 => {
let { let {
composite,
id,
title, title,
blocks, blocks,
isSelected, isSelected,
onClick onClick
} = _ref3; } = _ref3;
return (0,external_wp_element_namespaceObject.createElement)("button", { const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings(), []);
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings,
__unstableIsPreviewMode: true
}), [originalSettings]); // Cache the list of blocks to avoid additional processing when the component is re-rendered.
const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, extends_extends({}, composite, {
className: classnames_default()('edit-site-style-book__example', { className: classnames_default()('edit-site-style-book__example', {
'is-selected': isSelected 'is-selected': isSelected
}), }),
id: id,
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of a block, e.g. Heading. "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of a block, e.g. Heading.
(0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title), (0,external_wp_i18n_namespaceObject.__)('Open %s styles in Styles panel'), title),
onClick: onClick onClick: onClick,
}, (0,external_wp_element_namespaceObject.createElement)("span", { role: "button",
as: "div"
}), (0,external_wp_element_namespaceObject.createElement)("span", {
className: "edit-site-style-book__example-title" className: "edit-site-style-book__example-title"
}, title), (0,external_wp_element_namespaceObject.createElement)("div", { }, title), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-style-book__example-preview" className: "edit-site-style-book__example-preview",
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockPreview, { "aria-hidden": true
blocks: blocks, }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
viewportWidth: 0, className: "edit-site-style-book__example-preview__content"
additionalStyles: [{ }, (0,external_wp_element_namespaceObject.createElement)(ExperimentalBlockEditorProvider, {
css: '.wp-block:first-child { margin-top: 0; }' + '.wp-block:last-child { margin-bottom: 0; }' value: renderedBlocks,
}] settings: settings
}))); }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, {
}); renderAppender: false
})))));
};
function useHasStyleBook() { function useHasStyleBook() {
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(SLOT_FILL_NAME); const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(SLOT_FILL_NAME);
@ -13930,7 +14013,7 @@ function EditorCanvas(_ref) {
const { const {
ExperimentalBlockEditorProvider ExperimentalBlockEditorProvider: block_editor_ExperimentalBlockEditorProvider
} = unlock(external_wp_blockEditor_namespaceObject.privateApis); } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const LAYOUT = { const LAYOUT = {
type: 'default', type: 'default',
@ -14005,7 +14088,7 @@ function BlockEditor() {
!isMobileViewport; !isMobileViewport;
const isViewMode = canvasMode === 'view'; const isViewMode = canvasMode === 'view';
const showBlockAppender = isTemplatePart && hasBlocks || isViewMode ? false : undefined; const showBlockAppender = isTemplatePart && hasBlocks || isViewMode ? false : undefined;
return (0,external_wp_element_namespaceObject.createElement)(ExperimentalBlockEditorProvider, { return (0,external_wp_element_namespaceObject.createElement)(block_editor_ExperimentalBlockEditorProvider, {
settings: settings, settings: settings,
value: blocks, value: blocks,
onInput: onInput, onInput: onInput,

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.2-beta5-55495'; $wp_version = '6.2-beta5-55496';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.