Editor: Update npm packages for the 6.5 branch.

Updates the editor npm packages to the latest patch versions for 6.5.1.

Built from https://develop.svn.wordpress.org/branches/6.5@57950


git-svn-id: http://core.svn.wordpress.org/branches/6.5@57447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2024-04-09 11:03:28 +00:00
parent 7a5bc0367d
commit 66e36c2f18
20 changed files with 238 additions and 144 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

@ -49,7 +49,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
$label = '';
if ( '_blank' === $attributes['linkTarget'] ) {
// translators: %s is the Author name.
$label = 'aria-label="' . sprintf( esc_attr__( '(%s author archive, opens in a new tab)' ), $author_name ) . '"';
$label = 'aria-label="' . esc_attr( sprintf( __( '(%s author archive, opens in a new tab)' ), $author_name ) ) . '"';
}
// translators: %1$s: Author archive link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
@ -76,7 +76,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
$label = '';
if ( '_blank' === $attributes['linkTarget'] ) {
// translators: %s is the Comment Author name.
$label = 'aria-label="' . sprintf( esc_attr__( '(%s website link, opens in a new tab)' ), $comment->comment_author ) . '"';
$label = 'aria-label="' . esc_attr( sprintf( __( '(%s website link, opens in a new tab)' ), $comment->comment_author ) ) . '"';
}
// translators: %1$s: Comment Author website link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
$avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( $comment->comment_author_url ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );

View File

@ -151,7 +151,8 @@ const {
},
handleMenuFocusout(event) {
const {
modal
modal,
type
} = (0,interactivity_namespaceObject.getContext)();
// If focus is outside modal, and in the document, close menu
// event.target === The element losing focus
@ -160,7 +161,7 @@ const {
// `window.document.activeElement` doesn't change.
// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === 'submenu') {
actions.closeMenu('click');
actions.closeMenu('focus');
}

View File

@ -1 +1 @@
import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown(e){const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}},handleMenuFocusout(e){const{modal:t}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0});
import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown(e){const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}},handleMenuFocusout(e){const{modal:t,type:o}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&"submenu"===o)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0});

View File

@ -586,9 +586,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
border-bottom:none;
}
.is-distraction-free .edit-post-header{
-webkit-backdrop-filter:blur(20px) !important;
backdrop-filter:blur(20px) !important;
background-color:#ffffffe6;
background-color:#fff;
border-bottom:1px solid #e0e0e0;
position:absolute;
width:100%;
@ -596,7 +594,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
.is-distraction-free .edit-post-header>.edit-post-header__settings>.edit-post-header__post-preview-button{
visibility:hidden;
}
.is-distraction-free .edit-post-header>.edit-post-header__settings>.editor-preview-dropdown,.is-distraction-free .edit-post-header>.edit-post-header__settings>.interface-pinned-items,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__document-overview-toggle,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__inserter-toggle{
.is-distraction-free .edit-post-header>.edit-post-header__settings>.editor-preview-dropdown,.is-distraction-free .edit-post-header>.edit-post-header__settings>.interface-pinned-items,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__document-overview-toggle{
display:none;
}
.is-distraction-free .interface-interface-skeleton__header:focus-within{

File diff suppressed because one or more lines are too long

View File

@ -586,9 +586,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
border-bottom:none;
}
.is-distraction-free .edit-post-header{
-webkit-backdrop-filter:blur(20px) !important;
backdrop-filter:blur(20px) !important;
background-color:#ffffffe6;
background-color:#fff;
border-bottom:1px solid #e0e0e0;
position:absolute;
width:100%;
@ -596,7 +594,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
.is-distraction-free .edit-post-header>.edit-post-header__settings>.edit-post-header__post-preview-button{
visibility:hidden;
}
.is-distraction-free .edit-post-header>.edit-post-header__settings>.editor-preview-dropdown,.is-distraction-free .edit-post-header>.edit-post-header__settings>.interface-pinned-items,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__document-overview-toggle,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__inserter-toggle{
.is-distraction-free .edit-post-header>.edit-post-header__settings>.editor-preview-dropdown,.is-distraction-free .edit-post-header>.edit-post-header__settings>.interface-pinned-items,.is-distraction-free .edit-post-header>.edit-post-header__toolbar .editor-document-tools__document-overview-toggle{
display:none;
}
.is-distraction-free .interface-interface-skeleton__header:focus-within{

File diff suppressed because one or more lines are too long

View File

@ -42439,11 +42439,13 @@ function PatternsListHeader({
function PatternList({
searchValue,
selectedCategory,
patternCategories
patternCategories,
rootClientId
}) {
const container = (0,external_wp_element_namespaceObject.useRef)();
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
rootClientId,
shouldFocusBlock: true
});
const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId);
@ -42589,7 +42591,8 @@ function PatternsExplorer({
searchValue: searchValue,
selectedCategory: selectedCategory,
patternCategories: patternCategories,
patternSourceFilter: patternSourceFilter
patternSourceFilter: patternSourceFilter,
rootClientId: rootClientId
}));
}
function PatternsExplorerModal({
@ -60705,7 +60708,8 @@ const ImageURLInputUI = ({
rel,
showLightboxSetting,
lightboxEnabled,
onSetLightbox
onSetLightbox,
resetLightbox
}) => {
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
// Use internal state instead of a ref to make sure that the component
@ -60866,8 +60870,52 @@ const ImageURLInputUI = ({
onChange: onSetLinkClass
}));
const linkEditorValue = urlInput !== null ? urlInput : url;
const showLinkEditor = (!linkEditorValue && !lightboxEnabled) === true;
const hideLightboxPanel = !lightboxEnabled || lightboxEnabled && !showLightboxSetting;
const showLinkEditor = !linkEditorValue && hideLightboxPanel;
const urlLabel = (getLinkDestinations().find(destination => destination.linkDestination === linkDestination) || {}).title;
const PopoverChildren = () => {
if (lightboxEnabled && showLightboxSetting && !url && !isEditingLink) {
return (0,external_React_.createElement)("div", {
className: "block-editor-url-popover__expand-on-click"
}, (0,external_React_.createElement)(build_module_icon, {
icon: library_fullscreen
}), (0,external_React_.createElement)("div", {
className: "text"
}, (0,external_React_.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Expand on click')), (0,external_React_.createElement)("p", {
className: "description"
}, (0,external_wp_i18n_namespaceObject.__)('Scales the image with a lightbox effect'))), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
icon: link_off,
label: (0,external_wp_i18n_namespaceObject.__)('Disable expand on click'),
onClick: () => {
onSetLightbox(false);
},
size: "compact"
}));
} else if (!url || isEditingLink) {
return (0,external_React_.createElement)(url_popover.LinkEditor, {
className: "block-editor-format-toolbar__link-container-content",
value: linkEditorValue,
onChangeInputValue: setUrlInput,
onSubmit: onSubmitLinkChange(),
autocompleteRef: autocompleteRef
});
} else if (url && !isEditingLink) {
return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(url_popover.LinkViewer, {
className: "block-editor-format-toolbar__link-container-content",
url: url,
onEditLinkClick: startEditLink,
urlLabel: urlLabel
}), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
icon: link_off,
label: (0,external_wp_i18n_namespaceObject.__)('Remove link'),
onClick: () => {
onLinkRemove();
resetLightbox();
},
size: "compact"
}));
}
};
return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
icon: library_link,
className: "components-toolbar__control",
@ -60875,13 +60923,13 @@ const ImageURLInputUI = ({
"aria-expanded": isOpen,
onClick: openLinkUI,
ref: setPopoverAnchor,
isActive: !!url || lightboxEnabled
isActive: !!url || lightboxEnabled && showLightboxSetting
}), isOpen && (0,external_React_.createElement)(url_popover, {
ref: wrapperRef,
anchor: popoverAnchor,
onFocusOutside: onFocusOutside(),
onClose: closeLinkUI,
renderSettings: !lightboxEnabled ? () => advancedOptions : null,
renderSettings: hideLightboxPanel ? () => advancedOptions : null,
additionalControls: showLinkEditor && (0,external_React_.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, getLinkDestinations().map(link => (0,external_React_.createElement)(external_wp_components_namespaceObject.MenuItem, {
key: link.linkDestination,
icon: link.icon,
@ -60908,38 +60956,7 @@ const ImageURLInputUI = ({
}
}, (0,external_wp_i18n_namespaceObject.__)('Expand on click'))),
offset: 13
}, (!url || isEditingLink) && !lightboxEnabled && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(url_popover.LinkEditor, {
className: "block-editor-format-toolbar__link-container-content",
value: linkEditorValue,
onChangeInputValue: setUrlInput,
onSubmit: onSubmitLinkChange(),
autocompleteRef: autocompleteRef
})), url && !isEditingLink && !lightboxEnabled && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(url_popover.LinkViewer, {
className: "block-editor-format-toolbar__link-container-content",
url: url,
onEditLinkClick: startEditLink,
urlLabel: urlLabel
}), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
icon: link_off,
label: (0,external_wp_i18n_namespaceObject.__)('Remove link'),
onClick: onLinkRemove,
size: "compact"
})), !url && !isEditingLink && lightboxEnabled && (0,external_React_.createElement)("div", {
className: "block-editor-url-popover__expand-on-click"
}, (0,external_React_.createElement)(build_module_icon, {
icon: library_fullscreen
}), (0,external_React_.createElement)("div", {
className: "text"
}, (0,external_React_.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Expand on click')), (0,external_React_.createElement)("p", {
className: "description"
}, (0,external_wp_i18n_namespaceObject.__)('Scales the image with a lightbox effect'))), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
icon: link_off,
label: (0,external_wp_i18n_namespaceObject.__)('Disable expand on click'),
onClick: () => {
onSetLightbox(false);
},
size: "compact"
}))));
}, PopoverChildren()));
};
@ -62395,12 +62412,12 @@ const DeprecatedExperimentalRecursionProvider = props => {
...props
});
};
const DeprecatedExperimentalUseHasRecursion = props => {
const DeprecatedExperimentalUseHasRecursion = (...args) => {
external_wp_deprecated_default()('wp.blockEditor.__experimentalUseHasRecursion', {
since: '6.5',
alternative: 'wp.blockEditor.useHasRecursion'
});
return useHasRecursion(...props);
return useHasRecursion(...args);
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js

File diff suppressed because one or more lines are too long

View File

@ -25964,6 +25964,23 @@ function image_Image({
});
}
}
function resetLightbox() {
// When deleting a link from an image while lightbox settings
// are enabled by default, we should disable the lightbox,
// otherwise the resulting UX looks like a mistake.
// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.
if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) {
setAttributes({
lightbox: {
enabled: false
}
});
} else {
setAttributes({
lightbox: undefined
});
}
}
function onSetTitle(value) {
// This is the HTML title attribute, separate from the media object
// title.
@ -26031,7 +26048,10 @@ function image_Image({
availableUnits: ['px']
});
const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('lightbox');
const showLightboxSetting = !!lightbox || lightboxSetting?.allowEditing === true;
const showLightboxSetting =
// If a block-level override is set, we should give users the option to
// remove that override, even if the lightbox UI is disabled in the settings.
!!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing;
const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled;
const dimensionsControl = (0,external_React_namespaceObject.createElement)(DimensionsTool, {
value: {
@ -26138,7 +26158,8 @@ function image_Image({
rel: rel,
showLightboxSetting: showLightboxSetting,
lightboxEnabled: lightboxChecked,
onSetLightbox: onSetLightbox
onSetLightbox: onSetLightbox,
resetLightbox: resetLightbox
}), allowCrop && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => setIsEditingImage(true),
icon: library_crop,
@ -45021,7 +45042,15 @@ const useUnsupportedBlocks = clientId => {
const blocks = {};
getClientIdsOfDescendants(clientId).forEach(descendantClientId => {
const blockName = getBlockName(descendantClientId);
if (!blockName.startsWith('core/')) {
/*
* Client side navigation can be true in two states:
* - supports.interactivity = true;
* - supports.interactivity.clientNavigation = true;
*/
const blockSupportsInteractivity = Object.is((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity'), true);
const blockSupportsInteractivityClientNavigation = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity.clientNavigation');
const blockInteractivity = blockSupportsInteractivity || blockSupportsInteractivityClientNavigation;
if (!blockInteractivity) {
blocks.hasBlocksFromPlugins = true;
} else if (blockName === 'core/post-content') {
blocks.hasPostContentBlock = true;
@ -45897,7 +45926,7 @@ function EnhancedPaginationModal({
};
let notice = (0,external_wp_i18n_namespaceObject.__)('If you still want to prevent full page reloads, remove that block, then disable "Force page reload" again in the Query Block settings.');
if (hasBlocksFromPlugins) {
notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when blocks from plugins are present inside the Query block.') + ' ' + notice;
notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when non-interactive or non-clientNavigation compatible blocks from plugins are present inside the Query block.') + ' ' + notice;
} else if (hasPostContentBlock) {
notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.') + ' ' + notice;
}
@ -48945,6 +48974,30 @@ function setBlockEditMode(setEditMode, blocks, mode) {
block.name === block_name ? 'disabled' : mode);
});
}
function RecursionWarning() {
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
return (0,external_React_namespaceObject.createElement)("div", {
...blockProps
}, (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
}
// Wrap the main Edit function for the pattern block with a recursion wrapper
// that allows short-circuiting rendering as early as possible, before any
// of the other effects in the block edit have run.
function ReusableBlockEditRecursionWrapper(props) {
const {
ref
} = props.attributes;
const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref);
if (hasAlreadyRendered) {
return (0,external_React_namespaceObject.createElement)(RecursionWarning, null);
}
return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, {
uniqueId: ref
}, (0,external_React_namespaceObject.createElement)(ReusableBlockEdit, {
...props
}));
}
function ReusableBlockEdit({
name,
attributes: {
@ -48956,7 +49009,6 @@ function ReusableBlockEdit({
setAttributes
}) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref);
const {
record,
editedRecord,
@ -49094,18 +49146,13 @@ function ReusableBlockEdit({
}
};
let children = null;
if (hasAlreadyRendered) {
children = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.'));
}
if (isMissing) {
children = (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.'));
}
if (!hasResolved) {
children = (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
}
return (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RecursionProvider, {
uniqueId: ref
}, userCanEdit && onNavigateToEntityRecord && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, userCanEdit && onNavigateToEntityRecord && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: handleEditOriginal
}, (0,external_wp_i18n_namespaceObject.__)('Edit original')))), canOverrideBlocks && (0,external_React_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: resetContent,
@ -49286,7 +49333,7 @@ const {
const block_settings = {
deprecated: block_deprecated,
edit: ReusableBlockEdit,
edit: ReusableBlockEditRecursionWrapper,
icon: library_symbol,
__experimentalLabel: ({
ref

File diff suppressed because one or more lines are too long

View File

@ -56545,7 +56545,7 @@ const DayButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_butt
justify-self: end;
`, " ", props => props.disabled && `
pointer-events: none;
`, " &&&{border-radius:100%;height:", space(8), ";width:", space(8), ";", props => props.isSelected && `
`, " &&&{border-radius:100%;height:", space(7), ";width:", space(7), ";", props => props.isSelected && `
background: ${COLORS.theme.accent};
color: ${COLORS.white};
`, " ", props => !props.isSelected && props.isToday && `

File diff suppressed because one or more lines are too long

View File

@ -9658,6 +9658,45 @@ function useSupportedStyles(name, element) {
return supportedPanels;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/set-nested-value.js
/**
* Sets the value at path of object.
* If a portion of path doesnt exist, its created.
* Arrays are created for missing index properties while objects are created
* for all other missing properties.
*
* This function intentionally mutates the input object.
*
* Inspired by _.set().
*
* @see https://lodash.com/docs/4.17.15#set
*
* @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.
*
* @param {Object} object Object to modify
* @param {Array} path Path of the property to set.
* @param {*} value Value to set.
*/
function setNestedValue(object, path, value) {
if (!object || typeof object !== 'object') {
return object;
}
path.reduce((acc, key, idx) => {
if (acc[key] === undefined) {
if (Number.isInteger(path[idx + 1])) {
acc[key] = [];
} else {
acc[key] = {};
}
}
if (idx === path.length - 1) {
acc[key] = value;
}
return acc[key];
}, object);
return object;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/hooks/push-changes-to-global-styles/index.js
/**
@ -9679,6 +9718,7 @@ function useSupportedStyles(name, element) {
*/
const {
cleanEmptyObject,
GlobalStylesContext
@ -9877,44 +9917,6 @@ function useChangesToPush(name, attributes, userConfig) {
return changes;
}, [supports, attributes, blockUserConfig]);
}
/**
* Sets the value at path of object.
* If a portion of path doesnt exist, its created.
* Arrays are created for missing index properties while objects are created
* for all other missing properties.
*
* This function intentionally mutates the input object.
*
* Inspired by _.set().
*
* @see https://lodash.com/docs/4.17.15#set
*
* @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.
*
* @param {Object} object Object to modify
* @param {Array} path Path of the property to set.
* @param {*} value Value to set.
*/
function setNestedValue(object, path, value) {
if (!object || typeof object !== 'object') {
return object;
}
path.reduce((acc, key, idx) => {
if (acc[key] === undefined) {
if (Number.isInteger(path[idx + 1])) {
acc[key] = [];
} else {
acc[key] = {};
}
}
if (idx === path.length - 1) {
acc[key] = value;
}
return acc[key];
}, object);
return object;
}
function cloneDeep(object) {
return !object ? {} : JSON.parse(JSON.stringify(object));
}
@ -26985,12 +26987,13 @@ const {
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const FontLibraryContext = (0,external_wp_element_namespaceObject.createContext)({});
function FontLibraryProvider({
children
}) {
const {
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
saveEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
globalStylesId
@ -27031,9 +27034,25 @@ function FontLibraryProvider({
// theme.json file font families
const [baseFontFamilies] = context_useGlobalSetting('typography.fontFamilies', undefined, 'base');
// Save font families to the global styles post in the database.
const saveFontFamilies = () => {
saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
/*
* Save the font families to the database.
* This function is called when the user activates or deactivates a font family.
* It only updates the global styles post content in the database for new font families.
* This avoids saving other styles/settings changed by the user using other parts of the editor.
*
* It uses the font families from the param to avoid using the font families from an outdated state.
*
* @param {Array} fonts - The font families that will be saved to the database.
*/
const saveFontFamilies = async fonts => {
// Gets the global styles database post content.
const updatedGlobalStyles = globalStyles.record;
// Updates the database version of global styles with the edited font families in the client.
setNestedValue(updatedGlobalStyles, ['settings', 'typography', 'fontFamilies'], fonts);
// Saves a new version of the global styles in the database.
await saveEntityRecord('root', 'globalStyles', updatedGlobalStyles);
};
// Library Fonts
@ -27176,10 +27195,9 @@ function FontLibraryProvider({
installationErrors = installationErrors.reduce((unique, item) => unique.includes(item.message) ? unique : [...unique, item.message], []);
if (fontFamiliesToActivate.length > 0) {
// Activate the font family (add the font family to the global styles).
activateCustomFontFamilies(fontFamiliesToActivate);
const activeFonts = activateCustomFontFamilies(fontFamiliesToActivate);
// Save the global styles to the database.
await saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
await saveFontFamilies(activeFonts);
refreshLibrary();
}
if (installationErrors.length > 0) {
@ -27200,9 +27218,9 @@ function FontLibraryProvider({
// Deactivate the font family if delete request is successful
// (Removes the font family from the global styles).
if (uninstalledFontFamily.deleted) {
deactivateFontFamily(fontFamilyToUninstall);
const activeFonts = deactivateFontFamily(fontFamilyToUninstall);
// Save the global styles to the database.
await saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
await saveFontFamilies(activeFonts);
}
// Refresh the library (the library font families from database).
@ -27220,19 +27238,35 @@ function FontLibraryProvider({
// We want to save as active all the theme fonts at the beginning
const initialCustomFonts = (_fontFamilies$font$so = fontFamilies?.[font.source]) !== null && _fontFamilies$font$so !== void 0 ? _fontFamilies$font$so : [];
const newCustomFonts = initialCustomFonts.filter(f => f.slug !== font.slug);
setFontFamilies({
const activeFonts = {
...fontFamilies,
[font.source]: newCustomFonts
});
};
setFontFamilies(activeFonts);
if (font.fontFace) {
font.fontFace.forEach(face => {
unloadFontFaceInBrowser(face, 'all');
});
}
return activeFonts;
};
const activateCustomFontFamilies = fontsToAdd => {
const fontsToActivate = cleanFontsForSave(fontsToAdd);
const activeFonts = {
...fontFamilies,
// Merge the existing custom fonts with the new fonts.
custom: mergeFontFamilies(fontFamilies?.custom, fontsToActivate)
};
// Activate the fonts by set the new custom fonts array.
setFontFamilies(activeFonts);
loadFontsInBrowser(fontsToActivate);
return activeFonts;
};
// Removes the id from the families and faces to avoid saving that to global styles post content.
const fontsToActivate = fontsToAdd.map(({
const cleanFontsForSave = fonts => {
return fonts.map(({
id: _familyDbId,
fontFace,
...font
@ -27245,16 +27279,10 @@ function FontLibraryProvider({
}) => face)
} : {})
}));
// Activate the fonts by set the new custom fonts array.
setFontFamilies({
...fontFamilies,
// Merge the existing custom fonts with the new fonts.
custom: mergeFontFamilies(fontFamilies?.custom, fontsToActivate)
});
};
const loadFontsInBrowser = fonts => {
// Add custom fonts to the browser.
fontsToActivate.forEach(font => {
fonts.forEach(font => {
if (font.fontFace) {
font.fontFace.forEach(face => {
// Load font faces just in the iframe because they already are in the document.
@ -27324,6 +27352,7 @@ function FontLibraryProvider({
value: {
libraryFontSelected,
handleSetLibraryFontSelected,
fontFamilies,
themeFonts,
baseThemeFonts,
customFonts,
@ -27622,7 +27651,8 @@ function InstalledFonts() {
getFontFacesActivated,
fontFamiliesHasChanges,
notice,
setNotice
setNotice,
fontFamilies
} = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext);
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const customFontFamilyId = libraryFontSelected?.source === 'custom' && libraryFontSelected?.id;
@ -27752,7 +27782,9 @@ function InstalledFonts() {
onClick: handleUninstallClick
}, (0,external_wp_i18n_namespaceObject.__)('Delete')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: saveFontFamilies,
onClick: () => {
saveFontFamilies(fontFamilies);
},
disabled: !fontFamiliesHasChanges,
__experimentalIsFocusable: true
}, (0,external_wp_i18n_namespaceObject.__)('Update'))));
@ -28188,6 +28220,7 @@ function FontCollection({
isSmall: true,
onClick: () => {
setSelectedFont(null);
setNotice(null);
},
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
}), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
@ -32375,7 +32408,7 @@ const {
} = unlock(external_wp_components_namespaceObject.privateApis);
const DEFAULT_TAB = {
id: 'installed-fonts',
title: (0,external_wp_i18n_namespaceObject.__)('Library')
title: (0,external_wp_i18n_namespaceObject._x)('Library', 'Font library')
};
const UPLOAD_TAB = {
id: 'upload-fonts',

File diff suppressed because one or more lines are too long

View File

@ -15925,7 +15925,7 @@ function DocumentTools({
variant: "unstyled"
}, (0,external_React_.createElement)("div", {
className: "editor-document-tools__left"
}, (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
}, !isDistractionFree && (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarItem, {
ref: inserterButton,
as: external_wp_components_namespaceObject.Button,
className: "editor-document-tools__inserter-toggle",

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5.1-alpha-57947';
$wp_version = '6.5.1-alpha-57950';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.