Editor: Update npm packages.
Updates the editor npm packages to the latest patch versions for 6.5.1. See https://github.com/WordPress/gutenberg/pull/60577. Built from https://develop.svn.wordpress.org/trunk@57949 git-svn-id: http://core.svn.wordpress.org/trunk@57446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8fbd2fc6f4
commit
a04dc48ea7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -49,7 +49,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
||||||
$label = '';
|
$label = '';
|
||||||
if ( '_blank' === $attributes['linkTarget'] ) {
|
if ( '_blank' === $attributes['linkTarget'] ) {
|
||||||
// translators: %s is the Author name.
|
// 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.
|
// 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 );
|
$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 = '';
|
$label = '';
|
||||||
if ( '_blank' === $attributes['linkTarget'] ) {
|
if ( '_blank' === $attributes['linkTarget'] ) {
|
||||||
// translators: %s is the Comment Author name.
|
// 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.
|
// 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 );
|
$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 );
|
||||||
|
|
|
@ -151,7 +151,8 @@ const {
|
||||||
},
|
},
|
||||||
handleMenuFocusout(event) {
|
handleMenuFocusout(event) {
|
||||||
const {
|
const {
|
||||||
modal
|
modal,
|
||||||
|
type
|
||||||
} = (0,interactivity_namespaceObject.getContext)();
|
} = (0,interactivity_namespaceObject.getContext)();
|
||||||
// If focus is outside modal, and in the document, close menu
|
// If focus is outside modal, and in the document, close menu
|
||||||
// event.target === The element losing focus
|
// event.target === The element losing focus
|
||||||
|
@ -160,7 +161,7 @@ const {
|
||||||
// `window.document.activeElement` doesn't change.
|
// `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.
|
// 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('click');
|
||||||
actions.closeMenu('focus');
|
actions.closeMenu('focus');
|
||||||
}
|
}
|
||||||
|
|
|
@ -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});
|
|
@ -586,9 +586,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
||||||
border-bottom:none;
|
border-bottom:none;
|
||||||
}
|
}
|
||||||
.is-distraction-free .edit-post-header{
|
.is-distraction-free .edit-post-header{
|
||||||
-webkit-backdrop-filter:blur(20px) !important;
|
background-color:#fff;
|
||||||
backdrop-filter:blur(20px) !important;
|
|
||||||
background-color:#ffffffe6;
|
|
||||||
border-bottom:1px solid #e0e0e0;
|
border-bottom:1px solid #e0e0e0;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
width:100%;
|
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{
|
.is-distraction-free .edit-post-header>.edit-post-header__settings>.edit-post-header__post-preview-button{
|
||||||
visibility:hidden;
|
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;
|
display:none;
|
||||||
}
|
}
|
||||||
.is-distraction-free .interface-interface-skeleton__header:focus-within{
|
.is-distraction-free .interface-interface-skeleton__header:focus-within{
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -586,9 +586,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
||||||
border-bottom:none;
|
border-bottom:none;
|
||||||
}
|
}
|
||||||
.is-distraction-free .edit-post-header{
|
.is-distraction-free .edit-post-header{
|
||||||
-webkit-backdrop-filter:blur(20px) !important;
|
background-color:#fff;
|
||||||
backdrop-filter:blur(20px) !important;
|
|
||||||
background-color:#ffffffe6;
|
|
||||||
border-bottom:1px solid #e0e0e0;
|
border-bottom:1px solid #e0e0e0;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
width:100%;
|
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{
|
.is-distraction-free .edit-post-header>.edit-post-header__settings>.edit-post-header__post-preview-button{
|
||||||
visibility:hidden;
|
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;
|
display:none;
|
||||||
}
|
}
|
||||||
.is-distraction-free .interface-interface-skeleton__header:focus-within{
|
.is-distraction-free .interface-interface-skeleton__header:focus-within{
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42439,11 +42439,13 @@ function PatternsListHeader({
|
||||||
function PatternList({
|
function PatternList({
|
||||||
searchValue,
|
searchValue,
|
||||||
selectedCategory,
|
selectedCategory,
|
||||||
patternCategories
|
patternCategories,
|
||||||
|
rootClientId
|
||||||
}) {
|
}) {
|
||||||
const container = (0,external_wp_element_namespaceObject.useRef)();
|
const container = (0,external_wp_element_namespaceObject.useRef)();
|
||||||
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
|
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
|
||||||
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
|
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
|
||||||
|
rootClientId,
|
||||||
shouldFocusBlock: true
|
shouldFocusBlock: true
|
||||||
});
|
});
|
||||||
const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId);
|
const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId);
|
||||||
|
@ -42589,7 +42591,8 @@ function PatternsExplorer({
|
||||||
searchValue: searchValue,
|
searchValue: searchValue,
|
||||||
selectedCategory: selectedCategory,
|
selectedCategory: selectedCategory,
|
||||||
patternCategories: patternCategories,
|
patternCategories: patternCategories,
|
||||||
patternSourceFilter: patternSourceFilter
|
patternSourceFilter: patternSourceFilter,
|
||||||
|
rootClientId: rootClientId
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
function PatternsExplorerModal({
|
function PatternsExplorerModal({
|
||||||
|
@ -60705,7 +60708,8 @@ const ImageURLInputUI = ({
|
||||||
rel,
|
rel,
|
||||||
showLightboxSetting,
|
showLightboxSetting,
|
||||||
lightboxEnabled,
|
lightboxEnabled,
|
||||||
onSetLightbox
|
onSetLightbox,
|
||||||
|
resetLightbox
|
||||||
}) => {
|
}) => {
|
||||||
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
|
const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||||
// Use internal state instead of a ref to make sure that the component
|
// Use internal state instead of a ref to make sure that the component
|
||||||
|
@ -60866,8 +60870,52 @@ const ImageURLInputUI = ({
|
||||||
onChange: onSetLinkClass
|
onChange: onSetLinkClass
|
||||||
}));
|
}));
|
||||||
const linkEditorValue = urlInput !== null ? urlInput : url;
|
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 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, {
|
return (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
||||||
icon: library_link,
|
icon: library_link,
|
||||||
className: "components-toolbar__control",
|
className: "components-toolbar__control",
|
||||||
|
@ -60875,13 +60923,13 @@ const ImageURLInputUI = ({
|
||||||
"aria-expanded": isOpen,
|
"aria-expanded": isOpen,
|
||||||
onClick: openLinkUI,
|
onClick: openLinkUI,
|
||||||
ref: setPopoverAnchor,
|
ref: setPopoverAnchor,
|
||||||
isActive: !!url || lightboxEnabled
|
isActive: !!url || lightboxEnabled && showLightboxSetting
|
||||||
}), isOpen && (0,external_React_.createElement)(url_popover, {
|
}), isOpen && (0,external_React_.createElement)(url_popover, {
|
||||||
ref: wrapperRef,
|
ref: wrapperRef,
|
||||||
anchor: popoverAnchor,
|
anchor: popoverAnchor,
|
||||||
onFocusOutside: onFocusOutside(),
|
onFocusOutside: onFocusOutside(),
|
||||||
onClose: closeLinkUI,
|
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, {
|
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,
|
key: link.linkDestination,
|
||||||
icon: link.icon,
|
icon: link.icon,
|
||||||
|
@ -60908,38 +60956,7 @@ const ImageURLInputUI = ({
|
||||||
}
|
}
|
||||||
}, (0,external_wp_i18n_namespaceObject.__)('Expand on click'))),
|
}, (0,external_wp_i18n_namespaceObject.__)('Expand on click'))),
|
||||||
offset: 13
|
offset: 13
|
||||||
}, (!url || isEditingLink) && !lightboxEnabled && (0,external_React_.createElement)(external_React_.Fragment, null, (0,external_React_.createElement)(url_popover.LinkEditor, {
|
}, PopoverChildren()));
|
||||||
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"
|
|
||||||
}))));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -62395,12 +62412,12 @@ const DeprecatedExperimentalRecursionProvider = props => {
|
||||||
...props
|
...props
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const DeprecatedExperimentalUseHasRecursion = props => {
|
const DeprecatedExperimentalUseHasRecursion = (...args) => {
|
||||||
external_wp_deprecated_default()('wp.blockEditor.__experimentalUseHasRecursion', {
|
external_wp_deprecated_default()('wp.blockEditor.__experimentalUseHasRecursion', {
|
||||||
since: '6.5',
|
since: '6.5',
|
||||||
alternative: 'wp.blockEditor.useHasRecursion'
|
alternative: 'wp.blockEditor.useHasRecursion'
|
||||||
});
|
});
|
||||||
return useHasRecursion(...props);
|
return useHasRecursion(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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) {
|
function onSetTitle(value) {
|
||||||
// This is the HTML title attribute, separate from the media object
|
// This is the HTML title attribute, separate from the media object
|
||||||
// title.
|
// title.
|
||||||
|
@ -26031,7 +26048,10 @@ function image_Image({
|
||||||
availableUnits: ['px']
|
availableUnits: ['px']
|
||||||
});
|
});
|
||||||
const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('lightbox');
|
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 lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled;
|
||||||
const dimensionsControl = (0,external_React_namespaceObject.createElement)(DimensionsTool, {
|
const dimensionsControl = (0,external_React_namespaceObject.createElement)(DimensionsTool, {
|
||||||
value: {
|
value: {
|
||||||
|
@ -26138,7 +26158,8 @@ function image_Image({
|
||||||
rel: rel,
|
rel: rel,
|
||||||
showLightboxSetting: showLightboxSetting,
|
showLightboxSetting: showLightboxSetting,
|
||||||
lightboxEnabled: lightboxChecked,
|
lightboxEnabled: lightboxChecked,
|
||||||
onSetLightbox: onSetLightbox
|
onSetLightbox: onSetLightbox,
|
||||||
|
resetLightbox: resetLightbox
|
||||||
}), allowCrop && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
}), allowCrop && (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
||||||
onClick: () => setIsEditingImage(true),
|
onClick: () => setIsEditingImage(true),
|
||||||
icon: library_crop,
|
icon: library_crop,
|
||||||
|
@ -45021,7 +45042,15 @@ const useUnsupportedBlocks = clientId => {
|
||||||
const blocks = {};
|
const blocks = {};
|
||||||
getClientIdsOfDescendants(clientId).forEach(descendantClientId => {
|
getClientIdsOfDescendants(clientId).forEach(descendantClientId => {
|
||||||
const blockName = getBlockName(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;
|
blocks.hasBlocksFromPlugins = true;
|
||||||
} else if (blockName === 'core/post-content') {
|
} else if (blockName === 'core/post-content') {
|
||||||
blocks.hasPostContentBlock = true;
|
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.');
|
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) {
|
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) {
|
} 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;
|
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);
|
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({
|
function ReusableBlockEdit({
|
||||||
name,
|
name,
|
||||||
attributes: {
|
attributes: {
|
||||||
|
@ -48956,7 +49009,6 @@ function ReusableBlockEdit({
|
||||||
setAttributes
|
setAttributes
|
||||||
}) {
|
}) {
|
||||||
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
|
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
|
||||||
const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref);
|
|
||||||
const {
|
const {
|
||||||
record,
|
record,
|
||||||
editedRecord,
|
editedRecord,
|
||||||
|
@ -49094,18 +49146,13 @@ function ReusableBlockEdit({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let children = null;
|
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) {
|
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.'));
|
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) {
|
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));
|
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, {
|
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, {
|
||||||
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, {
|
|
||||||
onClick: handleEditOriginal
|
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, {
|
}, (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,
|
onClick: resetContent,
|
||||||
|
@ -49286,7 +49333,7 @@ const {
|
||||||
|
|
||||||
const block_settings = {
|
const block_settings = {
|
||||||
deprecated: block_deprecated,
|
deprecated: block_deprecated,
|
||||||
edit: ReusableBlockEdit,
|
edit: ReusableBlockEditRecursionWrapper,
|
||||||
icon: library_symbol,
|
icon: library_symbol,
|
||||||
__experimentalLabel: ({
|
__experimentalLabel: ({
|
||||||
ref
|
ref
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -56545,7 +56545,7 @@ const DayButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_butt
|
||||||
justify-self: end;
|
justify-self: end;
|
||||||
`, " ", props => props.disabled && `
|
`, " ", props => props.disabled && `
|
||||||
pointer-events: none;
|
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};
|
background: ${COLORS.theme.accent};
|
||||||
color: ${COLORS.white};
|
color: ${COLORS.white};
|
||||||
`, " ", props => !props.isSelected && props.isToday && `
|
`, " ", props => !props.isSelected && props.isToday && `
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9658,6 +9658,45 @@ function useSupportedStyles(name, element) {
|
||||||
return supportedPanels;
|
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 doesn’t exist, it’s 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
|
;// 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 {
|
const {
|
||||||
cleanEmptyObject,
|
cleanEmptyObject,
|
||||||
GlobalStylesContext
|
GlobalStylesContext
|
||||||
|
@ -9877,44 +9917,6 @@ function useChangesToPush(name, attributes, userConfig) {
|
||||||
return changes;
|
return changes;
|
||||||
}, [supports, attributes, blockUserConfig]);
|
}, [supports, attributes, blockUserConfig]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value at path of object.
|
|
||||||
* If a portion of path doesn’t exist, it’s 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) {
|
function cloneDeep(object) {
|
||||||
return !object ? {} : JSON.parse(JSON.stringify(object));
|
return !object ? {} : JSON.parse(JSON.stringify(object));
|
||||||
}
|
}
|
||||||
|
@ -26985,12 +26987,13 @@ const {
|
||||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
|
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const FontLibraryContext = (0,external_wp_element_namespaceObject.createContext)({});
|
const FontLibraryContext = (0,external_wp_element_namespaceObject.createContext)({});
|
||||||
function FontLibraryProvider({
|
function FontLibraryProvider({
|
||||||
children
|
children
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
|
saveEntityRecord
|
||||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
|
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
|
||||||
const {
|
const {
|
||||||
globalStylesId
|
globalStylesId
|
||||||
|
@ -27031,9 +27034,25 @@ function FontLibraryProvider({
|
||||||
// theme.json file font families
|
// theme.json file font families
|
||||||
const [baseFontFamilies] = context_useGlobalSetting('typography.fontFamilies', undefined, 'base');
|
const [baseFontFamilies] = context_useGlobalSetting('typography.fontFamilies', undefined, 'base');
|
||||||
|
|
||||||
// Save font families to the global styles post in the database.
|
/*
|
||||||
const saveFontFamilies = () => {
|
* Save the font families to the database.
|
||||||
saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
|
* 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
|
// Library Fonts
|
||||||
|
@ -27176,10 +27195,9 @@ function FontLibraryProvider({
|
||||||
installationErrors = installationErrors.reduce((unique, item) => unique.includes(item.message) ? unique : [...unique, item.message], []);
|
installationErrors = installationErrors.reduce((unique, item) => unique.includes(item.message) ? unique : [...unique, item.message], []);
|
||||||
if (fontFamiliesToActivate.length > 0) {
|
if (fontFamiliesToActivate.length > 0) {
|
||||||
// Activate the font family (add the font family to the global styles).
|
// 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.
|
// Save the global styles to the database.
|
||||||
await saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
|
await saveFontFamilies(activeFonts);
|
||||||
refreshLibrary();
|
refreshLibrary();
|
||||||
}
|
}
|
||||||
if (installationErrors.length > 0) {
|
if (installationErrors.length > 0) {
|
||||||
|
@ -27200,9 +27218,9 @@ function FontLibraryProvider({
|
||||||
// Deactivate the font family if delete request is successful
|
// Deactivate the font family if delete request is successful
|
||||||
// (Removes the font family from the global styles).
|
// (Removes the font family from the global styles).
|
||||||
if (uninstalledFontFamily.deleted) {
|
if (uninstalledFontFamily.deleted) {
|
||||||
deactivateFontFamily(fontFamilyToUninstall);
|
const activeFonts = deactivateFontFamily(fontFamilyToUninstall);
|
||||||
// Save the global styles to the database.
|
// 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).
|
// 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
|
// 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 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);
|
const newCustomFonts = initialCustomFonts.filter(f => f.slug !== font.slug);
|
||||||
setFontFamilies({
|
const activeFonts = {
|
||||||
...fontFamilies,
|
...fontFamilies,
|
||||||
[font.source]: newCustomFonts
|
[font.source]: newCustomFonts
|
||||||
});
|
};
|
||||||
|
setFontFamilies(activeFonts);
|
||||||
if (font.fontFace) {
|
if (font.fontFace) {
|
||||||
font.fontFace.forEach(face => {
|
font.fontFace.forEach(face => {
|
||||||
unloadFontFaceInBrowser(face, 'all');
|
unloadFontFaceInBrowser(face, 'all');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return activeFonts;
|
||||||
};
|
};
|
||||||
const activateCustomFontFamilies = fontsToAdd => {
|
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.
|
// 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,
|
id: _familyDbId,
|
||||||
fontFace,
|
fontFace,
|
||||||
...font
|
...font
|
||||||
|
@ -27245,16 +27279,10 @@ function FontLibraryProvider({
|
||||||
}) => face)
|
}) => face)
|
||||||
} : {})
|
} : {})
|
||||||
}));
|
}));
|
||||||
|
};
|
||||||
// Activate the fonts by set the new custom fonts array.
|
const loadFontsInBrowser = fonts => {
|
||||||
setFontFamilies({
|
|
||||||
...fontFamilies,
|
|
||||||
// Merge the existing custom fonts with the new fonts.
|
|
||||||
custom: mergeFontFamilies(fontFamilies?.custom, fontsToActivate)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add custom fonts to the browser.
|
// Add custom fonts to the browser.
|
||||||
fontsToActivate.forEach(font => {
|
fonts.forEach(font => {
|
||||||
if (font.fontFace) {
|
if (font.fontFace) {
|
||||||
font.fontFace.forEach(face => {
|
font.fontFace.forEach(face => {
|
||||||
// Load font faces just in the iframe because they already are in the document.
|
// Load font faces just in the iframe because they already are in the document.
|
||||||
|
@ -27324,6 +27352,7 @@ function FontLibraryProvider({
|
||||||
value: {
|
value: {
|
||||||
libraryFontSelected,
|
libraryFontSelected,
|
||||||
handleSetLibraryFontSelected,
|
handleSetLibraryFontSelected,
|
||||||
|
fontFamilies,
|
||||||
themeFonts,
|
themeFonts,
|
||||||
baseThemeFonts,
|
baseThemeFonts,
|
||||||
customFonts,
|
customFonts,
|
||||||
|
@ -27622,7 +27651,8 @@ function InstalledFonts() {
|
||||||
getFontFacesActivated,
|
getFontFacesActivated,
|
||||||
fontFamiliesHasChanges,
|
fontFamiliesHasChanges,
|
||||||
notice,
|
notice,
|
||||||
setNotice
|
setNotice,
|
||||||
|
fontFamilies
|
||||||
} = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext);
|
} = (0,external_wp_element_namespaceObject.useContext)(FontLibraryContext);
|
||||||
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0,external_wp_element_namespaceObject.useState)(false);
|
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||||
const customFontFamilyId = libraryFontSelected?.source === 'custom' && libraryFontSelected?.id;
|
const customFontFamilyId = libraryFontSelected?.source === 'custom' && libraryFontSelected?.id;
|
||||||
|
@ -27752,7 +27782,9 @@ function InstalledFonts() {
|
||||||
onClick: handleUninstallClick
|
onClick: handleUninstallClick
|
||||||
}, (0,external_wp_i18n_namespaceObject.__)('Delete')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
|
}, (0,external_wp_i18n_namespaceObject.__)('Delete')), (0,external_React_.createElement)(external_wp_components_namespaceObject.Button, {
|
||||||
variant: "primary",
|
variant: "primary",
|
||||||
onClick: saveFontFamilies,
|
onClick: () => {
|
||||||
|
saveFontFamilies(fontFamilies);
|
||||||
|
},
|
||||||
disabled: !fontFamiliesHasChanges,
|
disabled: !fontFamiliesHasChanges,
|
||||||
__experimentalIsFocusable: true
|
__experimentalIsFocusable: true
|
||||||
}, (0,external_wp_i18n_namespaceObject.__)('Update'))));
|
}, (0,external_wp_i18n_namespaceObject.__)('Update'))));
|
||||||
|
@ -28188,6 +28220,7 @@ function FontCollection({
|
||||||
isSmall: true,
|
isSmall: true,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setSelectedFont(null);
|
setSelectedFont(null);
|
||||||
|
setNotice(null);
|
||||||
},
|
},
|
||||||
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
|
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous view')
|
||||||
}), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
|
}), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
|
||||||
|
@ -32375,7 +32408,7 @@ const {
|
||||||
} = unlock(external_wp_components_namespaceObject.privateApis);
|
} = unlock(external_wp_components_namespaceObject.privateApis);
|
||||||
const DEFAULT_TAB = {
|
const DEFAULT_TAB = {
|
||||||
id: 'installed-fonts',
|
id: 'installed-fonts',
|
||||||
title: (0,external_wp_i18n_namespaceObject.__)('Library')
|
title: (0,external_wp_i18n_namespaceObject._x)('Library', 'Font library')
|
||||||
};
|
};
|
||||||
const UPLOAD_TAB = {
|
const UPLOAD_TAB = {
|
||||||
id: 'upload-fonts',
|
id: 'upload-fonts',
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -15925,7 +15925,7 @@ function DocumentTools({
|
||||||
variant: "unstyled"
|
variant: "unstyled"
|
||||||
}, (0,external_React_.createElement)("div", {
|
}, (0,external_React_.createElement)("div", {
|
||||||
className: "editor-document-tools__left"
|
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,
|
ref: inserterButton,
|
||||||
as: external_wp_components_namespaceObject.Button,
|
as: external_wp_components_namespaceObject.Button,
|
||||||
className: "editor-document-tools__inserter-toggle",
|
className: "editor-document-tools__inserter-toggle",
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.6-alpha-57948';
|
$wp_version = '6.6-alpha-57949';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue