Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 10.5.1 |
Comparing to | |
See all releases |
Code changes from version 10.5.0 to 10.5.1
- build/block-editor/index.asset.php +1 -1
- build/block-editor/index.js +2 -2
- changelog.txt +226 -209
- gutenberg.php +3 -3
- lib/block-editor.php +1 -1
- lib/block-patterns.php +4 -1
- readme.txt +1 -1
build/block-editor/index.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-wordcount'), 'version' => '03b49d2fb4f620da6199dad936b24233');
|
build/block-editor/index.js
CHANGED
@@ -26,9 +26,9 @@ Object(k.__)("Block %1$s is at the beginning of the content and can’t be moved
|
|
26 |
Object(k.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(s,O&&O.title,E,y,_,"up"===r?-1:1,C)))})),os=Object(l.forwardRef)((function(e,t){return Object(l.createElement)(rs,Object(i.a)({direction:"up",ref:t},e))})),cs=Object(l.forwardRef)((function(e,t){return Object(l.createElement)(rs,Object(i.a)({direction:"down",ref:t},e))})),is=Object(l.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),as=function(){return Object(l.useContext)(is)},ls=Object(l.createElement)(Ir.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(Ir.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),ss=function(e){var t=e.className,n=e.actions,r=e.children,o=e.secondaryActions;return Object(l.createElement)("div",{className:u()(t,"block-editor-warning")},Object(l.createElement)("div",{className:"block-editor-warning__contents"},Object(l.createElement)("p",{className:"block-editor-warning__message"},r),(l.Children.count(n)>0||o)&&Object(l.createElement)("div",{className:"block-editor-warning__actions"},l.Children.count(n)>0&&l.Children.map(n,(function(e,t){return Object(l.createElement)("span",{key:t,className:"block-editor-warning__action"},e)})),o&&Object(l.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:ls,label:Object(k.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(function(){return Object(l.createElement)(m.MenuGroup,null,o.map((function(e,t){return Object(l.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title)})))})))))},us=n(356),ds=function(e){var t=e.title,n=e.rawContent,r=e.renderedContent,o=e.action,c=e.actionText,i=e.className;return Object(l.createElement)("div",{className:i},Object(l.createElement)("div",{className:"block-editor-block-compare__content"},Object(l.createElement)("h2",{className:"block-editor-block-compare__heading"},t),Object(l.createElement)("div",{className:"block-editor-block-compare__html"},n),Object(l.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},r)),Object(l.createElement)("div",{className:"block-editor-block-compare__action"},Object(l.createElement)(m.Button,{isSecondary:!0,tabIndex:"0",onClick:o},c)))},bs=function(e){var t,n,r,o,c=e.block,i=e.onKeep,a=e.onConvert,s=e.convertor,b=e.convertButtonText,f={rawContent:c.originalContent,renderedContent:Object(p.getSaveElement)(c.name,c.attributes)},m=(t=s(c),r=(n=Object(d.castArray)(t)).map((function(e){return Object(p.getSaveContent)(e.name,e.attributes,e.innerBlocks)})),o=n.map((function(e){return Object(p.getSaveElement)(e.name,e.attributes,e.innerBlocks)})),{rawContent:r.join(""),renderedContent:o}),v=function(e,t){return Object(us.diffChars)(e,t).map((function(e,t){var n=u()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return Object(l.createElement)("span",{key:t,className:n},e.value)}))}(f.rawContent,m.rawContent);return Object(l.createElement)("div",{className:"block-editor-block-compare__wrapper"},Object(l.createElement)(ds,{title:Object(k.__)("Current"),className:"block-editor-block-compare__current",action:i,actionText:Object(k.__)("Convert to HTML"),rawContent:f.rawContent,renderedContent:f.renderedContent}),Object(l.createElement)(ds,{title:Object(k.__)("After Conversion"),className:"block-editor-block-compare__converted",action:a,actionText:b,rawContent:v,renderedContent:m.renderedContent}))},fs=function(e){return Object(p.rawHandler)({HTML:e.originalContent})},ps=Object(b.compose)([Object(v.withSelect)((function(e,t){var n=t.clientId;return{block:e(yr).getBlock(n)}})),Object(v.withDispatch)((function(e,t){var n=t.block,r=e(yr).replaceBlock;return{convertToClassic:function(){r(n.clientId,function(e){return Object(p.createBlock)("core/freeform",{content:e.originalContent})}(n))},convertToHTML:function(){r(n.clientId,function(e){return Object(p.createBlock)("core/html",{content:e.originalContent})}(n))},convertToBlocks:function(){r(n.clientId,fs(n))},attemptBlockRecovery:function(){var e,t,o,c;r(n.clientId,(t=(e=n).name,o=e.attributes,c=e.innerBlocks,Object(p.createBlock)(t,o,c)))}}}))])((function(e){var t=e.convertToHTML,n=e.convertToBlocks,r=e.convertToClassic,o=e.attemptBlockRecovery,c=e.block,i=!!Object(p.getBlockType)("core/html"),a=Object(l.useState)(!1),s=Object(Co.a)(a,2),u=s[0],d=s[1],b=Object(l.useCallback)((function(){return d(!0)}),[]),f=Object(l.useCallback)((function(){return d(!1)}),[]),v=Object(l.useMemo)((function(){return[{
|
27 |
// translators: Button to fix block content
|
28 |
title:Object(k._x)("Resolve","imperative verb"),onClick:b},i&&{title:Object(k.__)("Convert to HTML"),onClick:t},{title:Object(k.__)("Convert to Classic Block"),onClick:r}].filter(Boolean)}),[b,t,r]);return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(ss,{actions:[Object(l.createElement)(m.Button,{key:"recover",onClick:o,isPrimary:!0},Object(k.__)("Attempt Block Recovery"))],secondaryActions:v},Object(k.__)("This block contains unexpected or invalid content.")),u&&Object(l.createElement)(m.Modal,{title:// translators: Dialog title to fix block content
|
29 |
-
Object(k.__)("Resolve Block"),onRequestClose:f,className:"block-editor-block-compare"},Object(l.createElement)(bs,{block:c,onKeep:t,onConvert:n,convertor:fs,convertButtonText:Object(k.__)("Convert to Blocks")})))})),ms=Object(l.createElement)(ss,{className:"block-editor-block-list__block-crash-warning"},Object(k.__)("This block has encountered an error and cannot be previewed.")),vs=function(){return ms};var Os=function(e){Object(Oa.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(ha.a)(t);if(n){var o=Object(ha.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(ga.a)(this,e)});function o(){var e;return Object(pa.a)(this,o),(e=r.apply(this,arguments)).state={hasError:!1},e}return Object(ma.a)(o,[{key:"componentDidCatch",value:function(){this.setState({hasError:!0})}},{key:"render",value:function(){return this.state.hasError?this.props.fallback:this.props.children}}]),o}(l.Component),gs=n(121),hs=n.n(gs),js=function(e){var t=e.clientId,n=Object(l.useState)(""),r=Object(Co.a)(n,2),o=r[0],c=r[1],i=Object(v.useSelect)((function(e){return e(yr).getBlock(t)}),[t]),a=Object(v.useDispatch)(yr).updateBlock;return Object(l.useEffect)((function(){c(Object(p.getBlockContent)(i))}),[i]),Object(l.createElement)(hs.a,{className:"block-editor-block-list__block-html-textarea",value:o,onBlur:function(){var e=Object(p.getBlockType)(i.name),n=Object(p.getBlockAttributes)(e,o,i.attributes),r=o||Object(p.getSaveContent)(e,n),l=!o||Object(p.isValidBlockContent)(e,n,r);a(t,{attributes:n,originalContent:r,isValid:l}),o||c({content:r})},onChange:function(e){return c(e.target.value)}})};function ys(e){var t=Object(l.useRef)(),n=function(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.getSelectedBlocksInitialCaretPosition,o=n.isMultiSelecting,c=n.isNavigationMode;if((0,n.isBlockSelected)(e)&&!o()&&!c())return r()}),[e])}(e);return Object(l.useEffect)((function(){if(null!=n&&t.current){var e=t.current.ownerDocument;if(!t.current.contains(e.activeElement)){var r=Wl.focus.tabbable.find(t.current).filter((function(e){return Object(Wl.isTextField)(e)})),o=-1===n,c=(o?d.last:d.first)(r)||t.current;Bc(t.current,c)&&!c.closest(".block-list-appender")?Object(Wl.placeCaretAtHorizontalEdge)(c,o):t.current.focus()}}}),[n]),t}function ks(e){if(!e.defaultPrevented){var t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}}function _s(){var e=Object(v.useSelect)((function(e){var t=e(yr),n=t.isNavigationMode,r=t.getSettings;return n()||r().outlineMode}),[]);return Object(b.useRefEffect)((function(t){if(e)return t.addEventListener("mouseout",ks),t.addEventListener("mouseover",ks),function(){t.removeEventListener("mouseout",ks),t.removeEventListener("mouseover",ks),t.classList.remove("is-hovered")}}),[e])}function Es(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.isBlockBeingDragged,o=n.isBlockHighlighted,c=n.isBlockSelected,i=n.isBlockMultiSelected,a=n.getBlockName,l=n.getSettings,s=n.hasSelectedInnerBlock,d=n.__experimentalGetActiveBlockIdByBlockNames,b=l().__experimentalSpotlightEntityBlocks,f=r(e),m=c(e),v=a(e),O=s(e,!0),g=d(b);return u()("block-editor-block-list__block",{"is-selected":m,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":Object(p.isReusableBlock)(Object(p.getBlockType)(v)),"is-dragging":f,"has-child-selected":O,"has-active-entity":g,"is-active-entity":g===e})}),[e])}function ws(e){return Object(v.useSelect)((function(t){var n=t(yr).getBlockName(e),r=Object(p.getBlockType)(n);if(r.apiVersion>1||Object(p.hasBlockSupport)(r,"lightBlockWrapper",!1))return Object(p.getBlockDefaultClassName)(n)}),[e])}function Cs(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.getBlockName,o=(0,n.getBlockAttributes)(e).className;if(o){var c=Object(p.getBlockType)(r(e));if(c.apiVersion>1||Object(p.hasBlockSupport)(c,"lightBlockWrapper",!1))return o}}),[e])}function Ss(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.hasBlockMovingClientId,o=n.canInsertBlockType,c=n.getBlockName,i=n.getBlockRootClientId;if((0,n.isBlockSelected)(e)){var a=r();if(a)return u()("is-block-moving-mode",{"can-insert-moving-block":o(c(a),i(e))})}}),[e])}function Bs(e,t){for(var n="start"===t?"firstChild":"lastChild",r="start"===t?"nextSibling":"previousSibling";e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[r];)e=e[r];return e}function Is(e){var t=e(yr),n=t.isSelectionEnabled,r=t.isMultiSelecting,o=t.getMultiSelectedBlockClientIds,c=t.hasMultiSelection,i=t.getBlockParents,a=t.getSelectedBlockClientId;return{isSelectionEnabled:n(),isMultiSelecting:r(),multiSelectedBlockClientIds:o(),hasMultiSelection:c(),getBlockParents:i,selectedBlockClientId:a()}}function xs(e,t){Array.from(e.querySelectorAll(".rich-text")).forEach((function(e){t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}var Ps=Object(l.createContext)(),Ts={position:"fixed"};function Ns(e){var t=e.tagName;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Ds(e,t,n,r){var o,c=Wl.focus.focusable.find(n);return t&&(c=Object(d.reverse)(c)),c=c.slice(c.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),Object(d.find)(c,(function(e){if(!Wl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){var t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}))}function As(e){var t=e(yr),n=t.getSelectedBlockClientId,r=t.getMultiSelectedBlocksStartClientId,o=t.getMultiSelectedBlocksEndClientId,c=t.getPreviousBlockClientId,i=t.getNextBlockClientId,a=t.getFirstMultiSelectedBlockClientId,l=t.getLastMultiSelectedBlockClientId,s=t.hasMultiSelection,u=t.getBlockOrder,b=t.isSelectionEnabled,f=t.getBlockSelectionStart,p=t.isMultiSelecting,m=t.getSettings,v=t.isNavigationMode,O=n(),g=r(),h=o(),j=u();return{selectedBlockClientId:O,selectionStartClientId:g,selectionBeforeEndClientId:c(h||O),selectionAfterEndClientId:i(h||O),selectedFirstClientId:a(),selectedLastClientId:l(),hasMultiSelection:s(),firstBlock:Object(d.first)(j),lastBlock:Object(d.last)(j),isSelectionEnabled:b(),blockSelectionStart:f(),isMultiSelecting:p(),keepCaretInsideBlock:m().keepCaretInsideBlock,isNavigationMode:v()}}function Ls(e){var t=e.children,n=Object(l.useRef)(),r=Object(l.useRef)(),o=Object(l.useRef)(),c=Object(l.useRef)(),i=Object(l.useRef)(),a=Object(l.useRef)(),s=Object(l.useRef)(),u=Object(v.useSelect)(As,[]),d=u.selectedBlockClientId,b=u.selectionStartClientId,f=u.selectionBeforeEndClientId,p=u.selectionAfterEndClientId,m=u.selectedFirstClientId,O=u.selectedLastClientId,g=u.hasMultiSelection,h=u.firstBlock,j=u.lastBlock,_=u.isSelectionEnabled,E=u.blockSelectionStart,w=u.isMultiSelecting,C=u.keepCaretInsideBlock,S=u.isNavigationMode,B=Object(v.useDispatch)(yr),I=B.multiSelect,x=B.selectBlock,P=B.setNavigationMode;function T(e){var t=e?f:p;t&&I(b||d,t)}function N(e){var t=e?m:O;t&&x(t)}Object(l.useEffect)((function(){g&&!w&&c.current.focus()}),[g,w]);var D=function(e){var t=Object(v.useSelect)(Is,[]),n=t.isSelectionEnabled,r=t.isMultiSelecting,o=t.multiSelectedBlockClientIds,c=t.hasMultiSelection,i=t.getBlockParents,a=t.selectedBlockClientId,s=Object(v.useDispatch)(yr),u=s.startMultiSelect,d=s.stopMultiSelect,b=s.multiSelect,f=s.selectBlock,p=Object(l.useRef)(),m=Object(l.useRef)(),O=Object(l.useRef)();Object(l.useEffect)((function(){var t=e.current.ownerDocument,n=t.defaultView;if(c&&!r){var i=o.length;if(!(i<2)){var l=o[0],s=o[i-1],u=Sc(l,t),d=Sc(s,t),b=n.getSelection(),f=t.createRange();u=Bs(u,"start"),d=Bs(d,"end"),f.setStartBefore(u),f.setEndAfter(d),b.removeAllRanges(),b.addRange(f)}}else{if(!a||r)return;var p=n.getSelection();if(p.rangeCount&&!p.isCollapsed){var m=Sc(a,t),v=p.getRangeAt(0),O=v.startContainer,g=v.endContainer;!m||m.contains(O)&&m.contains(g)||p.removeAllRanges()}}}),[c,r,o,f,a]);var g=Object(l.useCallback)((function(t){var n=t.isSelectionEnd,r=e.current.ownerDocument.defaultView.getSelection();if(r.rangeCount&&!r.isCollapsed){var o=Ic(r.focusNode);if(m.current===o){if(f(o),n&&(xs(e.current,!0),r.rangeCount)){var c=r.getRangeAt(0).commonAncestorContainer;O.current.contains(c)&&O.current.focus()}}else{var a=[].concat(Object(y.a)(i(m.current)),[m.current]),l=[].concat(Object(y.a)(i(o)),[o]),s=Math.min(a.length,l.length)-1;b(a[s],l[s])}}else xs(e.current,!0)}),[f,i,b]),h=Object(l.useCallback)((function(){var t=e.current.ownerDocument,n=t.defaultView;t.removeEventListener("selectionchange",g),n.removeEventListener("mouseup",h),p.current=n.requestAnimationFrame((function(){g({isSelectionEnd:!0}),d()}))}),[g,d]);return Object(l.useEffect)((function(){var t=e.current.ownerDocument,n=t.defaultView;return function(){t.removeEventListener("selectionchange",g),n.removeEventListener("mouseup",h),n.cancelAnimationFrame(p.current)}}),[g,h]),Object(l.useCallback)((function(t){if(n){var r=e.current.ownerDocument,o=r.defaultView;m.current=t,O.current=r.activeElement,u(),r.addEventListener("selectionchange",g),o.addEventListener("mouseup",h),xs(e.current,!1)}}),[n,u,h])}(n),A=Object(l.useRef)();function L(e){if(a.current)a.current=null;else if(g)c.current.focus();else if(d)A.current.focus();else{P(!0);var t=e.target.compareDocumentPosition(n.current)&e.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Wl.focus.tabbable[t](e.target).focus()}}Object(l.useEffect)((function(){function e(e){A.current=e.target}return n.current.addEventListener("focusout",e),function(){n.current.removeEventListener("focusout",e)}}),[]);var R=S?void 0:"0";return Object(l.createElement)(Ps.Provider,{value:D},Object(l.createElement)("div",{ref:r,tabIndex:R,onFocus:L,style:Ts}),Object(l.createElement)("div",{ref:c,tabIndex:g?"0":void 0,"aria-label":g?Object(k.__)("Multiple selected blocks"):void 0,style:Ts,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey,c=t===li.UP,i=t===li.DOWN,l=t===li.LEFT,s=t===li.RIGHT,u=c||l,d=l||s||c||i;t===li.TAB?(a.current=!0,n?r.current.focus():o.current.focus()):d&&((n?T:N)(u),e.preventDefault())}}),Object(l.createElement)("div",{ref:n,className:"block-editor-writing-flow",onKeyDown:function(e){var t=e.keyCode,c=e.target;if(n.current.contains(c)){var l=t===li.UP,u=t===li.DOWN,b=t===li.LEFT,m=t===li.RIGHT,v=t===li.TAB,O=t===li.ESCAPE,g=l||b,y=b||m,k=l||u,_=y||k,E=e.shiftKey,w=E||e.ctrlKey||e.altKey||e.metaKey,S=k?Wl.isVerticalEdge:Wl.isHorizontalEdge,B=n.current.ownerDocument.defaultView;if(d){if(v){var x=E?"findPrevious":"findNext";if(Ns(c)&&Ns(Wl.focus.tabbable[x](c)))return;var N=E?r:o;return a.current=!0,void N.current.focus()}O&&P(!0)}if(k?s.current||(s.current=Object(Wl.computeCaretRect)(B)):s.current=null,!_)return li.isKeyboardEvent.primary(e)&&(i.current=Object(Wl.isEntirelySelected)(c)),void(li.isKeyboardEvent.primary(e,"a")&&((c.isContentEditable?i.current:Object(Wl.isEntirelySelected)(c))&&(I(h,j),e.preventDefault()),i.current=!0));if(!e.nativeEvent.defaultPrevented&&function(e,t,n){if((t===li.UP||t===li.DOWN)&&!n)return!0;var r=e.tagName;return"INPUT"!==r&&"TEXTAREA"!==r}(c,t,w)){var D,A="rtl"===(D=c).ownerDocument.defaultView.getComputedStyle(D).direction?!g:g;if(E)(g&&f||!g&&p)&&function(e,t){var r,o,c=Ds(e,t,n.current);return!(c&&(r=e,o=c,r.closest(".block-editor-block-list__block")===o.closest(".block-editor-block-list__block")))}(c,g)&&S(c,g)&&(T(g),e.preventDefault());else if(k&&Object(Wl.isVerticalEdge)(c,g)&&!C){var L=Ds(c,g,n.current,!0);L&&(Object(Wl.placeCaretAtVerticalEdge)(L,g,s.current),e.preventDefault())}else if(y&&B.getSelection().isCollapsed&&Object(Wl.isHorizontalEdge)(c,A)&&!C){var R=Ds(c,A,n.current);Object(Wl.placeCaretAtHorizontalEdge)(R,A),e.preventDefault()}}}},onMouseDown:function(e){if(s.current=null,_&&0===e.button){var t=Ic(e.target);t&&(e.shiftKey?E!==t&&(I(E,t),e.preventDefault()):g&&x(t))}}},t),Object(l.createElement)("div",{ref:o,tabIndex:R,onFocus:L,style:Ts}))}function Rs(e){var t=Object(l.useContext)(Ps),n=Object(v.useSelect)((function(t){var n=t(yr),r=n.isBlockSelected,o=n.getBlockRootClientId,c=n.getBlockIndex;return{isSelected:r(e),rootClientId:o(e),index:c(e)}}),[e]),r=n.isSelected,o=n.rootClientId,c=n.index,i=Object(v.useDispatch)(yr),a=i.insertDefaultBlock,s=i.removeBlock,u=i.selectBlock;return Object(b.useRefEffect)((function(n){if(!r){function i(t){Bc(n,t.target)&&u(e)}return n.addEventListener("focusin",i),function(){n.removeEventListener("focusin",i)}}function l(t){var r=t.keyCode,i=t.target;r!==li.ENTER&&r!==li.BACKSPACE&&r!==li.DELETE||i!==n||Object(Wl.isTextField)(i)||(t.preventDefault(),r===li.ENTER?a({},o,c+1):s(e))}function d(n){1===n.buttons&&t(e)}function b(e){e.preventDefault()}return n.addEventListener("keydown",l),n.addEventListener("mouseleave",d),n.addEventListener("dragstart",b),function(){n.removeEventListener("mouseleave",d),n.removeEventListener("keydown",l),n.removeEventListener("dragstart",b)}}),[r,o,c,t,a,s,u])}function Ms(e){var t=Object(v.useSelect)((function(t){var n=t(yr),r=n.isNavigationMode,o=n.isBlockSelected;return r()&&o(e)}),[]),n=Object(v.useDispatch)(yr).setNavigationMode;return Object(b.useRefEffect)((function(e){if(t)return e.addEventListener("mousedown",r),function(){e.addEventListener("mousedown",r)};function r(){n(!1)}}),[t])}var Fs=n(71),Vs=n(177),Hs=[Object(l.createInterpolateElement)(Object(k.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:Object(l.createElement)("kbd",null)}),Object(l.createInterpolateElement)(Object(k.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:Object(l.createElement)("kbd",null)}),Object(l.createInterpolateElement)(Object(k.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:Object(l.createElement)("kbd",null)}),Object(k.__)("Drag files into the editor to automatically insert media blocks."),Object(k.__)("Change a block's type by pressing the block icon on the toolbar.")],zs=function(){var e=Object(l.useState)(Math.floor(Math.random()*Hs.length)),t=Object(Co.a)(e,1)[0];return Object(l.createElement)(m.Tip,null,Hs[t])},Gs=n(135),Us=n(282),Ws=function e(t){var n=t.className,r=t.onChange,o=t.value,c=t.label,i=t.placeholder,a=Object(b.useInstanceId)(e),s=Object(l.useRef)();return Object(l.createElement)("div",{className:u()("block-editor-inserter__search",n)},Object(l.createElement)(m.VisuallyHidden,{as:"label",htmlFor:"block-editor-inserter__search-".concat(a)},c||i),Object(l.createElement)("input",{ref:s,className:"block-editor-inserter__search-input",id:"block-editor-inserter__search-".concat(a),type:"search",placeholder:i,onChange:function(e){return r(e.target.value)},autoComplete:"off",value:o||""}),Object(l.createElement)("div",{className:"block-editor-inserter__search-icon"},!!o&&Object(l.createElement)(m.Button,{icon:Gs.a,label:Object(k.__)("Reset search"),onClick:function(){r(""),s.current.focus()}}),!o&&Object(l.createElement)(ra.a,{icon:Us.a})))},Ks=function(e){var t=e.title,n=e.icon,r=e.description,o=e.blockType;return o&&(Ft()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),t=o.title,n=o.icon,r=o.description),Object(l.createElement)("div",{className:"block-editor-block-card"},Object(l.createElement)(hl,{icon:n,showColors:!0}),Object(l.createElement)("div",{className:"block-editor-block-card__content"},Object(l.createElement)("h2",{className:"block-editor-block-card__title"},t),Object(l.createElement)("span",{className:"block-editor-block-card__description"},r)))};function qs(e){var t=e.clientId,n=void 0===t?null:t,r=e.value,o=e.selection,c=e.onChange,i=void 0===c?d.noop:c,a=e.onInput,s=void 0===a?d.noop:a,u=Object(v.useRegistry)(),b=u.dispatch(yr),f=b.resetBlocks,m=b.resetSelection,O=b.replaceInnerBlocks,g=b.setHasControlledInnerBlocks,h=b.__unstableMarkNextChangeAsNotPersistent,j=u.select(yr),y=j.getBlockName,k=j.getBlocks,_=Object(l.useRef)({incoming:null,outgoing:[]}),E=Object(l.useRef)(!1),w=Object(l.useRef)(s),C=Object(l.useRef)(i);Object(l.useEffect)((function(){w.current=s,C.current=i}),[s,i]),Object(l.useEffect)((function(){_.current.outgoing.includes(r)?Object(d.last)(_.current.outgoing)===r&&(_.current.outgoing=[]):k(n)!==r&&(_.current.outgoing=[],function(){if(r)if(h(),n){g(n,!0),h();var e=r.map((function(e){return Object(p.cloneBlock)(e)}));E.current&&(_.current.incoming=e),O(n,e)}else E.current&&(_.current.incoming=r),f(r)}(),o&&m(o.selectionStart,o.selectionEnd,o.initialPosition))}),[r,n]),Object(l.useEffect)((function(){var e=u.select(yr),t=e.getSelectionStart,r=e.getSelectionEnd,o=e.getSelectedBlocksInitialCaretPosition,c=e.isLastBlockChangePersistent,i=e.__unstableIsLastBlockChangeIgnored,a=k(n),l=c(),s=!1;E.current=!0;var d=u.subscribe((function(){if(null===n||null!==y(n)){var e=c(),u=k(n),d=u!==a;if(a=u,d&&(_.current.incoming||i()))return _.current.incoming=null,void(l=e);(d||s&&!d&&e&&!l)&&(l=e,_.current.outgoing.push(a),(l?C.current:w.current)(a,{selection:{selectionStart:t(),selectionEnd:r(),initialPosition:o()}})),s=d}}));return function(){return d()}}),[u,n])}var $s,Ys=Object(b.createHigherOrderComponent)((function(e){return Object(v.withRegistry)((function(t){var n=t.useSubRegistry,r=void 0===n||n,o=t.registry,c=Object(j.a)(t,["useSubRegistry","registry"]);if(!r)return Object(l.createElement)(e,Object(i.a)({registry:o},c));var a=Object(l.useState)(null),s=Object(Co.a)(a,2),u=s[0],d=s[1];return Object(l.useEffect)((function(){var e=Object(v.createRegistry)({},o);e.registerStore(Ht,jr),d(e)}),[o]),u?Object(l.createElement)(v.RegistryProvider,{value:u},Object(l.createElement)(e,Object(i.a)({registry:u},c))):null}))}),"withRegistryProvider")((function(e){var t=e.children,n=e.settings,r=Object(v.useDispatch)(yr).updateSettings;return Object(l.useEffect)((function(){r(n)}),[n]),qs(e),t}));function Xs(e){var t=e.onClick;return Object(l.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},Object(l.createElement)(m.Disabled,null,Object(l.createElement)(kb,null)))}var Qs=function(e){var t=e.viewportWidth,n=e.__experimentalPadding,r=Object(b.useResizeObserver)(),o=Object(Co.a)(r,2),c=o[0],i=o[1].width,a=Object(b.useResizeObserver)(),s=Object(Co.a)(a,2),u=s[0],d=s[1].height;$s=$s||Object(b.pure)(kb);var f=(i-2*n)/t;return Object(l.createElement)("div",{className:"block-editor-block-preview__container editor-styles-wrapper","aria-hidden":!0,style:{height:d*f+2*n}},c,Object(l.createElement)(m.Disabled,{style:{transform:"scale(".concat(f,")"),width:t,left:n,right:n,top:n},className:"block-editor-block-preview__content"},u,Object(l.createElement)($s,null)))};function Zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Js=Object(l.memo)((function(e){var t=e.blocks,n=e.__experimentalPadding,r=void 0===n?0:n,o=e.viewportWidth,c=void 0===o?1200:o,i=e.__experimentalLive,s=void 0!==i&&i,u=e.__experimentalOnClick,b=Object(v.useSelect)((function(e){return e(yr).getSettings()}),[]),f=Object(l.useMemo)((function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},b);return e.__experimentalBlockPatterns=[],e}),[b]),p=Object(l.useMemo)((function(){return Object(d.castArray)(t)}),[t]);return t&&0!==t.length?Object(l.createElement)(Ys,{value:p,settings:f},s?Object(l.createElement)(Xs,{onClick:u}):Object(l.createElement)(Qs,{viewportWidth:c,__experimentalPadding:r})):null}));function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nu=function(e){var t,n,r=e.item,o=r.name,c=r.title,i=r.icon,a=r.description,s=r.initialAttributes,u=Object(p.getBlockType)(o),d=Object(p.isReusableBlock)(r);return Object(l.createElement)("div",{className:"block-editor-inserter__preview-container"},Object(l.createElement)("div",{className:"block-editor-inserter__preview"},d||u.example?Object(l.createElement)("div",{className:"block-editor-inserter__preview-content"},Object(l.createElement)(Js,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=u.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:u.example?Object(p.getBlockFromExample)(r.name,{attributes:tu(tu({},u.example.attributes),s),innerBlocks:u.example.innerBlocks}):Object(p.createBlock)(o,s)})):Object(l.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},Object(k.__)("No Preview Available."))),!d&&Object(l.createElement)(Ks,{title:c,icon:i,description:a}))},ru=Object(l.createContext)();function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var iu=Object(l.forwardRef)((function(e,t){var n=e.isFirst,r=e.as,o=e.children,c=Object(j.a)(e,["isFirst","as","children"]),a=Object(l.useContext)(ru);return Object(l.createElement)(m.__unstableCompositeItem,Object(i.a)({ref:t,state:a,role:"option",focusable:!0},c),(function(e){var t=cu(cu({},e),{},{tabIndex:n?0:e.tabIndex});return r?Object(l.createElement)(r,t,o):"function"==typeof o?o(t):Object(l.createElement)(m.Button,t,o)}))})),au=Object(l.createElement)(Ir.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(l.createElement)(Ir.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function lu(e){var t=e.count,n=e.icon;return Object(l.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},Object(l.createElement)("div",{className:"block-editor-block-draggable-chip"},Object(l.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},Object(l.createElement)(m.FlexItem,null,n?Object(l.createElement)(hl,{icon:n}):Object(k.sprintf)(
|
30 |
/* translators: %d: Number of blocks. */
|
31 |
-
Object(k._n)("%d block","%d blocks",t),t)),Object(l.createElement)(m.FlexItem,null,Object(l.createElement)(hl,{icon:au})))))}var su=function(e){var t=e.isEnabled,n=e.blocks,r=e.icon,o=e.children,c={type:"inserter",blocks:n};return Object(l.createElement)(m.Draggable,{transferData:c,__experimentalDragComponent:Object(l.createElement)(lu,{count:n.length,icon:r})},(function(e){var n=e.onDraggableStart,r=e.onDraggableEnd;return o({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?r:void 0})}))};function uu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.navigator.platform;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var du=Object(l.memo)((function(e){var t=e.className,n=e.isFirst,r=e.item,o=e.onSelect,c=e.onHover,a=e.isDraggable,s=Object(j.a)(e,["className","isFirst","item","onSelect","onHover","isDraggable"]),d=Object(l.useRef)(!1),b=r.icon?{backgroundColor:r.icon.background,color:r.icon.foreground}:{},f=Object(l.useMemo)((function(){return[Object(p.createBlock)(r.name,r.initialAttributes,Object(p.createBlocksFromInnerBlocksTemplate)(r.innerBlocks))]}),[r.name,r.initialAttributes,r.initialAttributes]);return Object(l.createElement)(su,{isEnabled:a&&!r.disabled,blocks:f,icon:r.icon},(function(e){var a=e.draggable,f=e.onDragStart,p=e.onDragEnd;return Object(l.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:a,onDragStart:function(e){d.current=!0,f&&(c(null),f(e))},onDragEnd:function(e){d.current=!1,p&&p(e)}},Object(l.createElement)(iu,Object(i.a)({isFirst:n,className:u()("block-editor-block-types-list__item",t),disabled:r.isDisabled,onClick:function(e){e.preventDefault(),o(r,uu()?e.metaKey:e.ctrlKey),c(null)},onKeyDown:function(e){e.keyCode===li.ENTER&&(e.preventDefault(),o(r,uu()?e.metaKey:e.ctrlKey),c(null))},onFocus:function(){d.current||c(r)},onMouseEnter:function(){d.current||c(r)},onMouseLeave:function(){return c(null)},onBlur:function(){return c(null)}},s),Object(l.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:b},Object(l.createElement)(hl,{icon:r.icon,showColors:!0})),Object(l.createElement)("span",{className:"block-editor-block-types-list__item-title"},r.title)))}))})),bu=Object(l.forwardRef)((function(e,t){var n=Object(l.useState)(!1),r=Object(Co.a)(n,2),o=r[0],c=r[1];return Object(l.useEffect)((function(){o&&Object(Rt.speak)(Object(k.__)("Use left and right arrow keys to move through blocks"))}),[o]),Object(l.createElement)("div",Object(i.a)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:function(){c(!0)},onBlur:function(e){!e.currentTarget.contains(e.relatedTarget)&&c(!1)}},e))})),fu=Object(l.forwardRef)((function(e,t){var n=Object(l.useContext)(ru);return Object(l.createElement)(m.__unstableCompositeGroup,Object(i.a)({state:n,role:"presentation",ref:t},e))})),pu=function(e){var t=e.items,n=void 0===t?[]:t,r=e.onSelect,o=e.onHover,c=void 0===o?function(){}:o,i=e.children,a=e.label,s=e.isDraggable,u=void 0===s||s;return Object(l.createElement)(bu,{className:"block-editor-block-types-list","aria-label":a},function(e,t){for(var n=[],r=0,o=e.length;r<o;r+=3)n.push(e.slice(r,r+3));return n}(n).map((function(e,t){return Object(l.createElement)(fu,{key:t},e.map((function(e,n){return Object(l.createElement)(du,{key:e.id,item:e,className:Object(p.getBlockMenuDefaultClassName)(e.id),onSelect:r,onHover:c,isDraggable:u,isFirst:0===t&&0===n})})))})),i)},mu=function(e){var t=e.title,n=e.icon,r=e.children;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"block-editor-inserter__panel-header"},Object(l.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),Object(l.createElement)(m.Icon,{icon:n})),Object(l.createElement)("div",{className:"block-editor-inserter__panel-content"},r))},vu=function(e){var t=e.children,n=Object(m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return Object(l.createElement)(ru.Provider,{value:n},t)};function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var gu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onHover,o=e.showMostUsedBlocks,c=Ol(t,n),i=Object(Co.a)(c,4),s=i[0],u=i[1],b=i[2],f=i[3],p=Object(l.useMemo)((function(){return Object(d.orderBy)(s,["frecency"],["desc"]).slice(0,6)}),[s]),m=Object(l.useMemo)((function(){return s.filter((function(e){return!e.category}))}),[s]),v=Object(l.useMemo)((function(){return Object(d.flow)((function(e){return e.filter((function(e){return e.category&&"reusable"!==e.category}))}),(function(e){return Object(d.groupBy)(e,"category")}))(s)}),[s]),O=Object(l.useMemo)((function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},b);return Object.keys(b).forEach((function(t){e[t]=s.filter((function(e){return function(e){return e.name.split("/")[0]}(e)===t})),0===e[t].length&&delete e[t]})),e}),[s,b]);return Object(l.useEffect)((function(){return function(){return r(null)}}),[]),Object(l.createElement)(vu,null,Object(l.createElement)("div",null,o&&!!p.length&&Object(l.createElement)(mu,{title:Object(k._x)("Most used","blocks")},Object(l.createElement)(pu,{items:p,onSelect:f,onHover:r,label:Object(k._x)("Most used","blocks")})),Object(d.map)(u,(function(e){var t=v[e.slug];return t&&t.length?Object(l.createElement)(mu,{key:e.slug,title:e.title,icon:e.icon},Object(l.createElement)(pu,{items:t,onSelect:f,onHover:r,label:e.title})):null})),m.length>0&&Object(l.createElement)(mu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:Object(k.__)("Uncategorized")},Object(l.createElement)(pu,{items:m,onSelect:f,onHover:r,label:Object(k.__)("Uncategorized")})),Object(d.map)(b,(function(e,t){var n=O[t];return n&&n.length?Object(l.createElement)(mu,{key:t,title:e.title,icon:e.icon},Object(l.createElement)(pu,{items:n,onSelect:f,onHover:r,label:e.title})):null}))))},hu=function(e){var t,n=e.selectedCategory,r=e.patternCategories,o=e.onClickCategory,c=e.children;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:u()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns")},Object(l.createElement)(m.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:Object(k.__)("Filter patterns"),hideLabelFromVision:!0,value:n.name,onChange:function(e){o(r.find((function(t){return e===t.name})))},onBlur:function(e){null!=e&&e.relatedTarget||e.stopPropagation()},options:(t=[],r.map((function(e){return t.push({value:e.name,label:e.label})})),t)})),Object(l.createElement)("div",{className:"block-editor-inserter__panel-content"},c))},ju=n(45),yu=function(e,t){var n=Object(v.useSelect)((function(e){var n=e(yr),r=n.__experimentalGetAllowedPatterns,o=n.getSettings;return{patterns:r(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),r=n.patternCategories,o=n.patterns,c=Object(v.useDispatch)(ju.store).createSuccessNotice;return[o,r,Object(l.useCallback)((function(t,n){e(Object(d.map)(n,(function(e){return Object(p.cloneBlock)(e)})),t.name),c(Object(k.sprintf)(
|
32 |
/* translators: %s: block pattern title. */
|
33 |
Object(k.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function ku(e){var t=e.isDraggable,n=e.pattern,r=e.onClick,o=e.composite,c=n.name,a=n.viewportWidth,s=Object(v.useSelect)((function(e){return e(yr).__experimentalGetParsedPattern(c)}),[c]).blocks,u=Object(b.useInstanceId)(ku),d="block-editor-block-patterns-list__item-description-".concat(u);return Object(l.createElement)(su,{isEnabled:t,blocks:s},(function(e){var t=e.draggable,c=e.onDragStart,u=e.onDragEnd;return Object(l.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?d:void 0,draggable:t,onDragStart:c,onDragEnd:u},Object(l.createElement)(m.__unstableCompositeItem,Object(i.a)({role:"option",as:"div"},o,{className:"block-editor-block-patterns-list__item",onClick:function(){return r(n,s)}}),Object(l.createElement)(Js,{blocks:s,viewportWidth:a}),Object(l.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&Object(l.createElement)(m.VisuallyHidden,{id:d},n.description)))}))}function _u(){return Object(l.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Eu=function(e){var t=e.isDraggable,n=e.blockPatterns,r=e.shownPatterns,o=e.onClickPattern,c=e.orientation,a=e.label,s=void 0===a?Object(k.__)("Block Patterns"):a,u=Object(m.__unstableUseCompositeState)({orientation:c});return Object(l.createElement)(m.__unstableComposite,Object(i.a)({},u,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((function(e){return r.includes(e)?Object(l.createElement)(ku,{key:e.name,pattern:e,onClick:o,isDraggable:t,composite:u}):Object(l.createElement)(_u,{key:e.name})})))};function wu(e){var t=e.rootClientId,n=e.onInsert,r=e.selectedCategory,o=e.onClickCategory,c=yu(n,t),i=Object(Co.a)(c,3),a=i[0],s=i[1],u=i[2],f=Object(l.useMemo)((function(){return s.filter((function(e){return a.some((function(t){var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)}))}))}),[a,s]),p=r||f[0];Object(l.useEffect)((function(){a.some((function(e){return m(e)===1/0}))&&!f.find((function(e){return"uncategorized"===e.name}))&&f.push({name:"uncategorized",label:Object(k._x)("Uncategorized")})}),[f,a]);var m=Object(l.useCallback)((function(e){if(!e.categories||!e.categories.length)return 1/0;var t=Object(d.fromPairs)(f.map((function(e,t){return[e.name,t]})));return Math.min.apply(Math,Object(y.a)(e.categories.map((function(e){return void 0!==t[e]?t[e]:1/0}))))}),[f]),v=Object(l.useMemo)((function(){return a.filter((function(e){return"uncategorized"===p.name?m(e)===1/0:e.categories&&e.categories.includes(p.name)}))}),[a,p]),O=Object(l.useMemo)((function(){return v.sort((function(e,t){return m(e)-m(t)}))}),[v,m]),g=Object(b.useAsyncList)(O);return Object(l.createElement)(l.Fragment,null,!!v.length&&Object(l.createElement)(hu,{selectedCategory:p,patternCategories:f,onClickCategory:o},Object(l.createElement)(Eu,{shownPatterns:g,blockPatterns:v,onClickPattern:u,label:p.label,orientation:"vertical",isDraggable:!0})))}var Cu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onClickCategory,o=e.selectedCategory;return Object(l.createElement)(wu,{rootClientId:t,selectedCategory:o,onInsert:n,onClickCategory:r})},Su=n(31),Bu=function(){return Object(l.createElement)("div",{className:"block-editor-inserter__no-results"},Object(l.createElement)(ra.a,{className:"block-editor-inserter__no-results-icon",icon:gl.a}),Object(l.createElement)("p",null,Object(k.__)("No results found.")))};function Iu(e){var t=e.onHover,n=e.onInsert,r=e.rootClientId,o=Ol(r,n),c=Object(Co.a)(o,4),i=c[0],a=c[3],s=Object(l.useMemo)((function(){return i.filter((function(e){return"reusable"===e.category}))}),[i]);return 0===s.length?Object(l.createElement)(Bu,null):Object(l.createElement)(mu,{title:Object(k.__)("Reusable blocks")},Object(l.createElement)(pu,{items:s,onSelect:a,onHover:t,label:Object(k.__)("Reusable blocks")}))}var xu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onHover;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(Iu,{onHover:r,onInsert:n,rootClientId:t}),Object(l.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},Object(l.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:Object(Su.addQueryArgs)("edit.php",{post_type:"wp_block"})},Object(k.__)("Manage Reusable blocks"))))},Pu=Object(m.createSlotFill)("__experimentalInserterMenuExtension"),Tu=Pu.Fill,Nu=Pu.Slot;Tu.Slot=Nu;var Du=Tu,Au=function(e){var t=e.rootClientId,n=e.insertionIndex,r=e.clientId,o=e.isAppender,c=e.onSelect,i=e.shouldFocusBlock,a=void 0===i||i,s=Object(v.useSelect)((function(e){var c,i,a=e(yr),l=a.getSelectedBlock,s=a.getBlockIndex,u=a.getBlockOrder,d=a.getBlockInsertionPoint;if(t||n||r||o)c=t,i=n||(r?s(r,c):u(c).length);else{var b=d();c=b.rootClientId,i=b.index}return{getSelectedBlock:l,destinationRootClientId:c,destinationIndex:i}}),[t,n,r,o]),u=s.destinationRootClientId,b=s.destinationIndex,f=s.getSelectedBlock,m=Object(v.useDispatch)(yr),O=m.replaceBlocks,g=m.insertBlocks,h=m.showInsertionPoint,j=m.hideInsertionPoint,y=Object(l.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=f();!o&&r&&Object(p.isUnmodifiedDefaultBlock)(r)?O(r.clientId,e,null,a||n?0:null,t):g(e,b,u,!0,a||n?0:null,t);var i=Object(k.sprintf)(// translators: %d: the name of the block that has been added
|
34 |
Object(k._n)("%d block added.","%d blocks added.",Object(d.castArray)(e).length),Object(d.castArray)(e).length);Object(Rt.speak)(i),c&&c()}),[o,f,O,g,u,b,c,a]),_=Object(l.useCallback)((function(e){e?h(u,b):j()}),[h,j,u,b]);return[u,y,_]},Lu=function(e){var t=e.filterValue,n=e.onSelect,r=e.onHover,o=e.rootClientId,c=e.clientId,i=e.isAppender,a=e.maxBlockPatterns,s=e.maxBlockTypes,u=e.showBlockDirectory,f=void 0!==u&&u,p=e.isDraggable,v=void 0===p||p,O=e.shouldFocusBlock,g=void 0===O||O,h=Object(b.useDebounce)(Rt.speak,500),j=Au({onSelect:n,rootClientId:o,clientId:c,isAppender:i,shouldFocusBlock:g}),y=Object(Co.a)(j,2),_=y[0],E=y[1],w=Ol(_,E),C=Object(Co.a)(w,4),S=C[0],B=C[1],I=C[2],x=C[3],P=yu(E,_),T=Object(Co.a)(P,3),N=T[0],D=T[2],A=Object(l.useMemo)((function(){var e=pl(Object(d.orderBy)(S,["frecency"],["desc"]),B,I,t);return void 0!==s?e.slice(0,s):e}),[t,S,B,I,s]),L=Object(l.useMemo)((function(){var e=ml(N,t);return void 0!==a?e.slice(0,a):e}),[t,N,a]);Object(l.useEffect)((function(){if(t){var e=A.length+L.length,n=Object(k.sprintf)(
|
26 |
Object(k.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(s,O&&O.title,E,y,_,"up"===r?-1:1,C)))})),os=Object(l.forwardRef)((function(e,t){return Object(l.createElement)(rs,Object(i.a)({direction:"up",ref:t},e))})),cs=Object(l.forwardRef)((function(e,t){return Object(l.createElement)(rs,Object(i.a)({direction:"down",ref:t},e))})),is=Object(l.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),as=function(){return Object(l.useContext)(is)},ls=Object(l.createElement)(Ir.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(l.createElement)(Ir.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),ss=function(e){var t=e.className,n=e.actions,r=e.children,o=e.secondaryActions;return Object(l.createElement)("div",{className:u()(t,"block-editor-warning")},Object(l.createElement)("div",{className:"block-editor-warning__contents"},Object(l.createElement)("p",{className:"block-editor-warning__message"},r),(l.Children.count(n)>0||o)&&Object(l.createElement)("div",{className:"block-editor-warning__actions"},l.Children.count(n)>0&&l.Children.map(n,(function(e,t){return Object(l.createElement)("span",{key:t,className:"block-editor-warning__action"},e)})),o&&Object(l.createElement)(m.DropdownMenu,{className:"block-editor-warning__secondary",icon:ls,label:Object(k.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(function(){return Object(l.createElement)(m.MenuGroup,null,o.map((function(e,t){return Object(l.createElement)(m.MenuItem,{onClick:e.onClick,key:t},e.title)})))})))))},us=n(356),ds=function(e){var t=e.title,n=e.rawContent,r=e.renderedContent,o=e.action,c=e.actionText,i=e.className;return Object(l.createElement)("div",{className:i},Object(l.createElement)("div",{className:"block-editor-block-compare__content"},Object(l.createElement)("h2",{className:"block-editor-block-compare__heading"},t),Object(l.createElement)("div",{className:"block-editor-block-compare__html"},n),Object(l.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},r)),Object(l.createElement)("div",{className:"block-editor-block-compare__action"},Object(l.createElement)(m.Button,{isSecondary:!0,tabIndex:"0",onClick:o},c)))},bs=function(e){var t,n,r,o,c=e.block,i=e.onKeep,a=e.onConvert,s=e.convertor,b=e.convertButtonText,f={rawContent:c.originalContent,renderedContent:Object(p.getSaveElement)(c.name,c.attributes)},m=(t=s(c),r=(n=Object(d.castArray)(t)).map((function(e){return Object(p.getSaveContent)(e.name,e.attributes,e.innerBlocks)})),o=n.map((function(e){return Object(p.getSaveElement)(e.name,e.attributes,e.innerBlocks)})),{rawContent:r.join(""),renderedContent:o}),v=function(e,t){return Object(us.diffChars)(e,t).map((function(e,t){var n=u()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return Object(l.createElement)("span",{key:t,className:n},e.value)}))}(f.rawContent,m.rawContent);return Object(l.createElement)("div",{className:"block-editor-block-compare__wrapper"},Object(l.createElement)(ds,{title:Object(k.__)("Current"),className:"block-editor-block-compare__current",action:i,actionText:Object(k.__)("Convert to HTML"),rawContent:f.rawContent,renderedContent:f.renderedContent}),Object(l.createElement)(ds,{title:Object(k.__)("After Conversion"),className:"block-editor-block-compare__converted",action:a,actionText:b,rawContent:v,renderedContent:m.renderedContent}))},fs=function(e){return Object(p.rawHandler)({HTML:e.originalContent})},ps=Object(b.compose)([Object(v.withSelect)((function(e,t){var n=t.clientId;return{block:e(yr).getBlock(n)}})),Object(v.withDispatch)((function(e,t){var n=t.block,r=e(yr).replaceBlock;return{convertToClassic:function(){r(n.clientId,function(e){return Object(p.createBlock)("core/freeform",{content:e.originalContent})}(n))},convertToHTML:function(){r(n.clientId,function(e){return Object(p.createBlock)("core/html",{content:e.originalContent})}(n))},convertToBlocks:function(){r(n.clientId,fs(n))},attemptBlockRecovery:function(){var e,t,o,c;r(n.clientId,(t=(e=n).name,o=e.attributes,c=e.innerBlocks,Object(p.createBlock)(t,o,c)))}}}))])((function(e){var t=e.convertToHTML,n=e.convertToBlocks,r=e.convertToClassic,o=e.attemptBlockRecovery,c=e.block,i=!!Object(p.getBlockType)("core/html"),a=Object(l.useState)(!1),s=Object(Co.a)(a,2),u=s[0],d=s[1],b=Object(l.useCallback)((function(){return d(!0)}),[]),f=Object(l.useCallback)((function(){return d(!1)}),[]),v=Object(l.useMemo)((function(){return[{
|
27 |
// translators: Button to fix block content
|
28 |
title:Object(k._x)("Resolve","imperative verb"),onClick:b},i&&{title:Object(k.__)("Convert to HTML"),onClick:t},{title:Object(k.__)("Convert to Classic Block"),onClick:r}].filter(Boolean)}),[b,t,r]);return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(ss,{actions:[Object(l.createElement)(m.Button,{key:"recover",onClick:o,isPrimary:!0},Object(k.__)("Attempt Block Recovery"))],secondaryActions:v},Object(k.__)("This block contains unexpected or invalid content.")),u&&Object(l.createElement)(m.Modal,{title:// translators: Dialog title to fix block content
|
29 |
+
Object(k.__)("Resolve Block"),onRequestClose:f,className:"block-editor-block-compare"},Object(l.createElement)(bs,{block:c,onKeep:t,onConvert:n,convertor:fs,convertButtonText:Object(k.__)("Convert to Blocks")})))})),ms=Object(l.createElement)(ss,{className:"block-editor-block-list__block-crash-warning"},Object(k.__)("This block has encountered an error and cannot be previewed.")),vs=function(){return ms};var Os=function(e){Object(Oa.a)(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Object(ha.a)(t);if(n){var o=Object(ha.a)(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Object(ga.a)(this,e)});function o(){var e;return Object(pa.a)(this,o),(e=r.apply(this,arguments)).state={hasError:!1},e}return Object(ma.a)(o,[{key:"componentDidCatch",value:function(){this.setState({hasError:!0})}},{key:"render",value:function(){return this.state.hasError?this.props.fallback:this.props.children}}]),o}(l.Component),gs=n(121),hs=n.n(gs),js=function(e){var t=e.clientId,n=Object(l.useState)(""),r=Object(Co.a)(n,2),o=r[0],c=r[1],i=Object(v.useSelect)((function(e){return e(yr).getBlock(t)}),[t]),a=Object(v.useDispatch)(yr).updateBlock;return Object(l.useEffect)((function(){c(Object(p.getBlockContent)(i))}),[i]),Object(l.createElement)(hs.a,{className:"block-editor-block-list__block-html-textarea",value:o,onBlur:function(){var e=Object(p.getBlockType)(i.name),n=Object(p.getBlockAttributes)(e,o,i.attributes),r=o||Object(p.getSaveContent)(e,n),l=!o||Object(p.isValidBlockContent)(e,n,r);a(t,{attributes:n,originalContent:r,isValid:l}),o||c({content:r})},onChange:function(e){return c(e.target.value)}})};function ys(e){var t=Object(l.useRef)(),n=function(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.getSelectedBlocksInitialCaretPosition,o=n.isMultiSelecting,c=n.isNavigationMode;if((0,n.isBlockSelected)(e)&&!o()&&!c())return r()}),[e])}(e);return Object(l.useEffect)((function(){if(null!=n&&t.current){var e=t.current.ownerDocument;if(!t.current.contains(e.activeElement)){var r=Wl.focus.tabbable.find(t.current).filter((function(e){return Object(Wl.isTextField)(e)})),o=-1===n,c=(o?d.last:d.first)(r)||t.current;Bc(t.current,c)&&!c.closest(".block-list-appender")?Object(Wl.placeCaretAtHorizontalEdge)(c,o):t.current.focus()}}}),[n]),t}function ks(e){if(!e.defaultPrevented){var t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}}function _s(){var e=Object(v.useSelect)((function(e){var t=e(yr),n=t.isNavigationMode,r=t.getSettings;return n()||r().outlineMode}),[]);return Object(b.useRefEffect)((function(t){if(e)return t.addEventListener("mouseout",ks),t.addEventListener("mouseover",ks),function(){t.removeEventListener("mouseout",ks),t.removeEventListener("mouseover",ks),t.classList.remove("is-hovered")}}),[e])}function Es(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.isBlockBeingDragged,o=n.isBlockHighlighted,c=n.isBlockSelected,i=n.isBlockMultiSelected,a=n.getBlockName,l=n.getSettings,s=n.hasSelectedInnerBlock,d=n.__experimentalGetActiveBlockIdByBlockNames,b=l().__experimentalSpotlightEntityBlocks,f=r(e),m=c(e),v=a(e),O=s(e,!0),g=d(b);return u()("block-editor-block-list__block",{"is-selected":m,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":Object(p.isReusableBlock)(Object(p.getBlockType)(v)),"is-dragging":f,"has-child-selected":O,"has-active-entity":g,"is-active-entity":g===e})}),[e])}function ws(e){return Object(v.useSelect)((function(t){var n=t(yr).getBlockName(e),r=Object(p.getBlockType)(n);if(r.apiVersion>1||Object(p.hasBlockSupport)(r,"lightBlockWrapper",!1))return Object(p.getBlockDefaultClassName)(n)}),[e])}function Cs(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.getBlockName,o=(0,n.getBlockAttributes)(e).className;if(o){var c=Object(p.getBlockType)(r(e));if(c.apiVersion>1||Object(p.hasBlockSupport)(c,"lightBlockWrapper",!1))return o}}),[e])}function Ss(e){return Object(v.useSelect)((function(t){var n=t(yr),r=n.hasBlockMovingClientId,o=n.canInsertBlockType,c=n.getBlockName,i=n.getBlockRootClientId;if((0,n.isBlockSelected)(e)){var a=r();if(a)return u()("is-block-moving-mode",{"can-insert-moving-block":o(c(a),i(e))})}}),[e])}function Bs(e,t){for(var n="start"===t?"firstChild":"lastChild",r="start"===t?"nextSibling":"previousSibling";e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[r];)e=e[r];return e}function Is(e){var t=e(yr),n=t.isSelectionEnabled,r=t.isMultiSelecting,o=t.getMultiSelectedBlockClientIds,c=t.hasMultiSelection,i=t.getBlockParents,a=t.getSelectedBlockClientId;return{isSelectionEnabled:n(),isMultiSelecting:r(),multiSelectedBlockClientIds:o(),hasMultiSelection:c(),getBlockParents:i,selectedBlockClientId:a()}}function xs(e,t){Array.from(e.querySelectorAll(".rich-text")).forEach((function(e){t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}var Ps=Object(l.createContext)(),Ts={position:"fixed"};function Ns(e){var t=e.tagName;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Ds(e,t,n,r){var o,c=Wl.focus.focusable.find(n);return t&&(c=Object(d.reverse)(c)),c=c.slice(c.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),Object(d.find)(c,(function(e){if(!Wl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){var t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}))}function As(e){var t=e(yr),n=t.getSelectedBlockClientId,r=t.getMultiSelectedBlocksStartClientId,o=t.getMultiSelectedBlocksEndClientId,c=t.getPreviousBlockClientId,i=t.getNextBlockClientId,a=t.getFirstMultiSelectedBlockClientId,l=t.getLastMultiSelectedBlockClientId,s=t.hasMultiSelection,u=t.getBlockOrder,b=t.isSelectionEnabled,f=t.getBlockSelectionStart,p=t.isMultiSelecting,m=t.getSettings,v=t.isNavigationMode,O=n(),g=r(),h=o(),j=u();return{selectedBlockClientId:O,selectionStartClientId:g,selectionBeforeEndClientId:c(h||O),selectionAfterEndClientId:i(h||O),selectedFirstClientId:a(),selectedLastClientId:l(),hasMultiSelection:s(),firstBlock:Object(d.first)(j),lastBlock:Object(d.last)(j),isSelectionEnabled:b(),blockSelectionStart:f(),isMultiSelecting:p(),keepCaretInsideBlock:m().keepCaretInsideBlock,isNavigationMode:v()}}function Ls(e){var t=e.children,n=Object(l.useRef)(),r=Object(l.useRef)(),o=Object(l.useRef)(),c=Object(l.useRef)(),i=Object(l.useRef)(),a=Object(l.useRef)(),s=Object(l.useRef)(),u=Object(v.useSelect)(As,[]),d=u.selectedBlockClientId,b=u.selectionStartClientId,f=u.selectionBeforeEndClientId,p=u.selectionAfterEndClientId,m=u.selectedFirstClientId,O=u.selectedLastClientId,g=u.hasMultiSelection,h=u.firstBlock,j=u.lastBlock,_=u.isSelectionEnabled,E=u.blockSelectionStart,w=u.isMultiSelecting,C=u.keepCaretInsideBlock,S=u.isNavigationMode,B=Object(v.useDispatch)(yr),I=B.multiSelect,x=B.selectBlock,P=B.setNavigationMode;function T(e){var t=e?f:p;t&&I(b||d,t)}function N(e){var t=e?m:O;t&&x(t)}Object(l.useEffect)((function(){g&&!w&&c.current.focus()}),[g,w]);var D=function(e){var t=Object(v.useSelect)(Is,[]),n=t.isSelectionEnabled,r=t.isMultiSelecting,o=t.multiSelectedBlockClientIds,c=t.hasMultiSelection,i=t.getBlockParents,a=t.selectedBlockClientId,s=Object(v.useDispatch)(yr),u=s.startMultiSelect,d=s.stopMultiSelect,b=s.multiSelect,f=s.selectBlock,p=Object(l.useRef)(),m=Object(l.useRef)(),O=Object(l.useRef)();Object(l.useEffect)((function(){var t=e.current.ownerDocument,n=t.defaultView;if(c&&!r){var i=o.length;if(!(i<2)){var l=o[0],s=o[i-1],u=Sc(l,t),d=Sc(s,t),b=n.getSelection(),f=t.createRange();u=Bs(u,"start"),d=Bs(d,"end"),f.setStartBefore(u),f.setEndAfter(d),b.removeAllRanges(),b.addRange(f)}}else{if(!a||r)return;var p=n.getSelection();if(p.rangeCount&&!p.isCollapsed){var m=Sc(a,t),v=p.getRangeAt(0),O=v.startContainer,g=v.endContainer;!m||m.contains(O)&&m.contains(g)||p.removeAllRanges()}}}),[c,r,o,f,a]);var g=Object(l.useCallback)((function(t){var n=t.isSelectionEnd,r=e.current.ownerDocument.defaultView.getSelection();if(r.rangeCount&&!r.isCollapsed){var o=Ic(r.focusNode);if(m.current===o){if(f(o),n&&(xs(e.current,!0),r.rangeCount)){var c=r.getRangeAt(0).commonAncestorContainer;O.current.contains(c)&&O.current.focus()}}else{var a=[].concat(Object(y.a)(i(m.current)),[m.current]),l=[].concat(Object(y.a)(i(o)),[o]),s=Math.min(a.length,l.length)-1;b(a[s],l[s])}}else xs(e.current,!0)}),[f,i,b]),h=Object(l.useCallback)((function(){var t=e.current.ownerDocument,n=t.defaultView;t.removeEventListener("selectionchange",g),n.removeEventListener("mouseup",h),p.current=n.requestAnimationFrame((function(){g({isSelectionEnd:!0}),d()}))}),[g,d]);return Object(l.useEffect)((function(){var t=e.current.ownerDocument,n=t.defaultView;return function(){t.removeEventListener("selectionchange",g),n.removeEventListener("mouseup",h),n.cancelAnimationFrame(p.current)}}),[g,h]),Object(l.useCallback)((function(t){if(n){var r=e.current.ownerDocument,o=r.defaultView;m.current=t,O.current=r.activeElement,u(),r.addEventListener("selectionchange",g),o.addEventListener("mouseup",h),xs(e.current,!1)}}),[n,u,h])}(n),A=Object(l.useRef)();function L(e){if(a.current)a.current=null;else if(g)c.current.focus();else if(d)A.current.focus();else{P(!0);var t=e.target.compareDocumentPosition(n.current)&e.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Wl.focus.tabbable[t](e.target).focus()}}Object(l.useEffect)((function(){function e(e){A.current=e.target}return n.current.addEventListener("focusout",e),function(){n.current.removeEventListener("focusout",e)}}),[]);var R=S?void 0:"0";return Object(l.createElement)(Ps.Provider,{value:D},Object(l.createElement)("div",{ref:r,tabIndex:R,onFocus:L,style:Ts}),Object(l.createElement)("div",{ref:c,tabIndex:g?"0":void 0,"aria-label":g?Object(k.__)("Multiple selected blocks"):void 0,style:Ts,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey,c=t===li.UP,i=t===li.DOWN,l=t===li.LEFT,s=t===li.RIGHT,u=c||l,d=l||s||c||i;t===li.TAB?(a.current=!0,n?r.current.focus():o.current.focus()):d&&((n?T:N)(u),e.preventDefault())}}),Object(l.createElement)("div",{ref:n,className:"block-editor-writing-flow",onKeyDown:function(e){var t=e.keyCode,c=e.target;if(n.current.contains(c)){var l=t===li.UP,u=t===li.DOWN,b=t===li.LEFT,m=t===li.RIGHT,v=t===li.TAB,O=t===li.ESCAPE,g=l||b,y=b||m,k=l||u,_=y||k,E=e.shiftKey,w=E||e.ctrlKey||e.altKey||e.metaKey,S=k?Wl.isVerticalEdge:Wl.isHorizontalEdge,B=n.current.ownerDocument.defaultView;if(d){if(v){var x=E?"findPrevious":"findNext";if(Ns(c)&&Ns(Wl.focus.tabbable[x](c)))return;var N=E?r:o;return a.current=!0,void N.current.focus()}O&&P(!0)}if(k?s.current||(s.current=Object(Wl.computeCaretRect)(B)):s.current=null,!_)return li.isKeyboardEvent.primary(e)&&(i.current=Object(Wl.isEntirelySelected)(c)),void(li.isKeyboardEvent.primary(e,"a")&&((c.isContentEditable?i.current:Object(Wl.isEntirelySelected)(c))&&(I(h,j),e.preventDefault()),i.current=!0));if(!e.nativeEvent.defaultPrevented&&function(e,t,n){if((t===li.UP||t===li.DOWN)&&!n)return!0;var r=e.tagName;return"INPUT"!==r&&"TEXTAREA"!==r}(c,t,w)){var D,A="rtl"===(D=c).ownerDocument.defaultView.getComputedStyle(D).direction?!g:g;if(E)(g&&f||!g&&p)&&function(e,t){var r,o,c=Ds(e,t,n.current);return!(c&&(r=e,o=c,r.closest(".block-editor-block-list__block")===o.closest(".block-editor-block-list__block")))}(c,g)&&S(c,g)&&(T(g),e.preventDefault());else if(k&&Object(Wl.isVerticalEdge)(c,g)&&!C){var L=Ds(c,g,n.current,!0);L&&(Object(Wl.placeCaretAtVerticalEdge)(L,g,s.current),e.preventDefault())}else if(y&&B.getSelection().isCollapsed&&Object(Wl.isHorizontalEdge)(c,A)&&!C){var R=Ds(c,A,n.current);Object(Wl.placeCaretAtHorizontalEdge)(R,A),e.preventDefault()}}}},onMouseDown:function(e){if(s.current=null,_&&0===e.button){var t=Ic(e.target);t&&(e.shiftKey?E!==t&&(I(E,t),e.preventDefault()):g&&x(t))}}},t),Object(l.createElement)("div",{ref:o,tabIndex:R,onFocus:L,style:Ts}))}function Rs(e){var t=Object(l.useContext)(Ps),n=Object(v.useSelect)((function(t){var n=t(yr),r=n.isBlockSelected,o=n.getBlockRootClientId,c=n.getBlockIndex;return{isSelected:r(e),rootClientId:o(e),index:c(e)}}),[e]),r=n.isSelected,o=n.rootClientId,c=n.index,i=Object(v.useDispatch)(yr),a=i.insertDefaultBlock,s=i.removeBlock,u=i.selectBlock;return Object(b.useRefEffect)((function(n){if(!r){function i(t){Bc(n,t.target)&&u(e)}return n.addEventListener("focusin",i),function(){n.removeEventListener("focusin",i)}}function l(t){var r=t.keyCode,i=t.target;r!==li.ENTER&&r!==li.BACKSPACE&&r!==li.DELETE||i!==n||Object(Wl.isTextField)(i)||(t.preventDefault(),r===li.ENTER?a({},o,c+1):s(e))}function d(n){1===n.buttons&&t(e)}function b(e){e.preventDefault()}return n.addEventListener("keydown",l),n.addEventListener("mouseleave",d),n.addEventListener("dragstart",b),function(){n.removeEventListener("mouseleave",d),n.removeEventListener("keydown",l),n.removeEventListener("dragstart",b)}}),[r,o,c,t,a,s,u])}function Ms(e){var t=Object(v.useSelect)(yr),n=t.isNavigationMode,r=t.isBlockSelected,o=Object(v.useDispatch)(yr),c=o.setNavigationMode,i=o.selectBlock;return Object(b.useRefEffect)((function(t){function o(t){n()&&!t.defaultPrevented&&(t.preventDefault(),r(e)?c(!1):i(e))}return t.addEventListener("mousedown",o),function(){t.addEventListener("mousedown",o)}}),[e,n,r,c])}var Fs=n(71),Vs=n(177),Hs=[Object(l.createInterpolateElement)(Object(k.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:Object(l.createElement)("kbd",null)}),Object(l.createInterpolateElement)(Object(k.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:Object(l.createElement)("kbd",null)}),Object(l.createInterpolateElement)(Object(k.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:Object(l.createElement)("kbd",null)}),Object(k.__)("Drag files into the editor to automatically insert media blocks."),Object(k.__)("Change a block's type by pressing the block icon on the toolbar.")],zs=function(){var e=Object(l.useState)(Math.floor(Math.random()*Hs.length)),t=Object(Co.a)(e,1)[0];return Object(l.createElement)(m.Tip,null,Hs[t])},Gs=n(135),Us=n(282),Ws=function e(t){var n=t.className,r=t.onChange,o=t.value,c=t.label,i=t.placeholder,a=Object(b.useInstanceId)(e),s=Object(l.useRef)();return Object(l.createElement)("div",{className:u()("block-editor-inserter__search",n)},Object(l.createElement)(m.VisuallyHidden,{as:"label",htmlFor:"block-editor-inserter__search-".concat(a)},c||i),Object(l.createElement)("input",{ref:s,className:"block-editor-inserter__search-input",id:"block-editor-inserter__search-".concat(a),type:"search",placeholder:i,onChange:function(e){return r(e.target.value)},autoComplete:"off",value:o||""}),Object(l.createElement)("div",{className:"block-editor-inserter__search-icon"},!!o&&Object(l.createElement)(m.Button,{icon:Gs.a,label:Object(k.__)("Reset search"),onClick:function(){r(""),s.current.focus()}}),!o&&Object(l.createElement)(ra.a,{icon:Us.a})))},Ks=function(e){var t=e.title,n=e.icon,r=e.description,o=e.blockType;return o&&(Ft()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),t=o.title,n=o.icon,r=o.description),Object(l.createElement)("div",{className:"block-editor-block-card"},Object(l.createElement)(hl,{icon:n,showColors:!0}),Object(l.createElement)("div",{className:"block-editor-block-card__content"},Object(l.createElement)("h2",{className:"block-editor-block-card__title"},t),Object(l.createElement)("span",{className:"block-editor-block-card__description"},r)))};function qs(e){var t=e.clientId,n=void 0===t?null:t,r=e.value,o=e.selection,c=e.onChange,i=void 0===c?d.noop:c,a=e.onInput,s=void 0===a?d.noop:a,u=Object(v.useRegistry)(),b=u.dispatch(yr),f=b.resetBlocks,m=b.resetSelection,O=b.replaceInnerBlocks,g=b.setHasControlledInnerBlocks,h=b.__unstableMarkNextChangeAsNotPersistent,j=u.select(yr),y=j.getBlockName,k=j.getBlocks,_=Object(l.useRef)({incoming:null,outgoing:[]}),E=Object(l.useRef)(!1),w=Object(l.useRef)(s),C=Object(l.useRef)(i);Object(l.useEffect)((function(){w.current=s,C.current=i}),[s,i]),Object(l.useEffect)((function(){_.current.outgoing.includes(r)?Object(d.last)(_.current.outgoing)===r&&(_.current.outgoing=[]):k(n)!==r&&(_.current.outgoing=[],function(){if(r)if(h(),n){g(n,!0),h();var e=r.map((function(e){return Object(p.cloneBlock)(e)}));E.current&&(_.current.incoming=e),O(n,e)}else E.current&&(_.current.incoming=r),f(r)}(),o&&m(o.selectionStart,o.selectionEnd,o.initialPosition))}),[r,n]),Object(l.useEffect)((function(){var e=u.select(yr),t=e.getSelectionStart,r=e.getSelectionEnd,o=e.getSelectedBlocksInitialCaretPosition,c=e.isLastBlockChangePersistent,i=e.__unstableIsLastBlockChangeIgnored,a=k(n),l=c(),s=!1;E.current=!0;var d=u.subscribe((function(){if(null===n||null!==y(n)){var e=c(),u=k(n),d=u!==a;if(a=u,d&&(_.current.incoming||i()))return _.current.incoming=null,void(l=e);(d||s&&!d&&e&&!l)&&(l=e,_.current.outgoing.push(a),(l?C.current:w.current)(a,{selection:{selectionStart:t(),selectionEnd:r(),initialPosition:o()}})),s=d}}));return function(){return d()}}),[u,n])}var $s,Ys=Object(b.createHigherOrderComponent)((function(e){return Object(v.withRegistry)((function(t){var n=t.useSubRegistry,r=void 0===n||n,o=t.registry,c=Object(j.a)(t,["useSubRegistry","registry"]);if(!r)return Object(l.createElement)(e,Object(i.a)({registry:o},c));var a=Object(l.useState)(null),s=Object(Co.a)(a,2),u=s[0],d=s[1];return Object(l.useEffect)((function(){var e=Object(v.createRegistry)({},o);e.registerStore(Ht,jr),d(e)}),[o]),u?Object(l.createElement)(v.RegistryProvider,{value:u},Object(l.createElement)(e,Object(i.a)({registry:u},c))):null}))}),"withRegistryProvider")((function(e){var t=e.children,n=e.settings,r=Object(v.useDispatch)(yr).updateSettings;return Object(l.useEffect)((function(){r(n)}),[n]),qs(e),t}));function Xs(e){var t=e.onClick;return Object(l.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},Object(l.createElement)(m.Disabled,null,Object(l.createElement)(kb,null)))}var Qs=function(e){var t=e.viewportWidth,n=e.__experimentalPadding,r=Object(b.useResizeObserver)(),o=Object(Co.a)(r,2),c=o[0],i=o[1].width,a=Object(b.useResizeObserver)(),s=Object(Co.a)(a,2),u=s[0],d=s[1].height;$s=$s||Object(b.pure)(kb);var f=(i-2*n)/t;return Object(l.createElement)("div",{className:"block-editor-block-preview__container editor-styles-wrapper","aria-hidden":!0,style:{height:d*f+2*n}},c,Object(l.createElement)(m.Disabled,{style:{transform:"scale(".concat(f,")"),width:t,left:n,right:n,top:n},className:"block-editor-block-preview__content"},u,Object(l.createElement)($s,null)))};function Zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Js=Object(l.memo)((function(e){var t=e.blocks,n=e.__experimentalPadding,r=void 0===n?0:n,o=e.viewportWidth,c=void 0===o?1200:o,i=e.__experimentalLive,s=void 0!==i&&i,u=e.__experimentalOnClick,b=Object(v.useSelect)((function(e){return e(yr).getSettings()}),[]),f=Object(l.useMemo)((function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},b);return e.__experimentalBlockPatterns=[],e}),[b]),p=Object(l.useMemo)((function(){return Object(d.castArray)(t)}),[t]);return t&&0!==t.length?Object(l.createElement)(Ys,{value:p,settings:f},s?Object(l.createElement)(Xs,{onClick:u}):Object(l.createElement)(Qs,{viewportWidth:c,__experimentalPadding:r})):null}));function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nu=function(e){var t,n,r=e.item,o=r.name,c=r.title,i=r.icon,a=r.description,s=r.initialAttributes,u=Object(p.getBlockType)(o),d=Object(p.isReusableBlock)(r);return Object(l.createElement)("div",{className:"block-editor-inserter__preview-container"},Object(l.createElement)("div",{className:"block-editor-inserter__preview"},d||u.example?Object(l.createElement)("div",{className:"block-editor-inserter__preview-content"},Object(l.createElement)(Js,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=u.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:u.example?Object(p.getBlockFromExample)(r.name,{attributes:tu(tu({},u.example.attributes),s),innerBlocks:u.example.innerBlocks}):Object(p.createBlock)(o,s)})):Object(l.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},Object(k.__)("No Preview Available."))),!d&&Object(l.createElement)(Ks,{title:c,icon:i,description:a}))},ru=Object(l.createContext)();function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var iu=Object(l.forwardRef)((function(e,t){var n=e.isFirst,r=e.as,o=e.children,c=Object(j.a)(e,["isFirst","as","children"]),a=Object(l.useContext)(ru);return Object(l.createElement)(m.__unstableCompositeItem,Object(i.a)({ref:t,state:a,role:"option",focusable:!0},c),(function(e){var t=cu(cu({},e),{},{tabIndex:n?0:e.tabIndex});return r?Object(l.createElement)(r,t,o):"function"==typeof o?o(t):Object(l.createElement)(m.Button,t,o)}))})),au=Object(l.createElement)(Ir.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(l.createElement)(Ir.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function lu(e){var t=e.count,n=e.icon;return Object(l.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},Object(l.createElement)("div",{className:"block-editor-block-draggable-chip"},Object(l.createElement)(m.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},Object(l.createElement)(m.FlexItem,null,n?Object(l.createElement)(hl,{icon:n}):Object(k.sprintf)(
|
30 |
/* translators: %d: Number of blocks. */
|
31 |
+
Object(k._n)("%d block","%d blocks",t),t)),Object(l.createElement)(m.FlexItem,null,Object(l.createElement)(hl,{icon:au})))))}var su=function(e){var t=e.isEnabled,n=e.blocks,r=e.icon,o=e.children,c={type:"inserter",blocks:n};return Object(l.createElement)(m.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:c,__experimentalDragComponent:Object(l.createElement)(lu,{count:n.length,icon:r})},(function(e){var n=e.onDraggableStart,r=e.onDraggableEnd;return o({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?r:void 0})}))};function uu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=e.navigator.platform;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var du=Object(l.memo)((function(e){var t=e.className,n=e.isFirst,r=e.item,o=e.onSelect,c=e.onHover,a=e.isDraggable,s=Object(j.a)(e,["className","isFirst","item","onSelect","onHover","isDraggable"]),d=Object(l.useRef)(!1),b=r.icon?{backgroundColor:r.icon.background,color:r.icon.foreground}:{},f=Object(l.useMemo)((function(){return[Object(p.createBlock)(r.name,r.initialAttributes,Object(p.createBlocksFromInnerBlocksTemplate)(r.innerBlocks))]}),[r.name,r.initialAttributes,r.initialAttributes]);return Object(l.createElement)(su,{isEnabled:a&&!r.disabled,blocks:f,icon:r.icon},(function(e){var a=e.draggable,f=e.onDragStart,p=e.onDragEnd;return Object(l.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:a,onDragStart:function(e){d.current=!0,f&&(c(null),f(e))},onDragEnd:function(e){d.current=!1,p&&p(e)}},Object(l.createElement)(iu,Object(i.a)({isFirst:n,className:u()("block-editor-block-types-list__item",t),disabled:r.isDisabled,onClick:function(e){e.preventDefault(),o(r,uu()?e.metaKey:e.ctrlKey),c(null)},onKeyDown:function(e){e.keyCode===li.ENTER&&(e.preventDefault(),o(r,uu()?e.metaKey:e.ctrlKey),c(null))},onFocus:function(){d.current||c(r)},onMouseEnter:function(){d.current||c(r)},onMouseLeave:function(){return c(null)},onBlur:function(){return c(null)}},s),Object(l.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:b},Object(l.createElement)(hl,{icon:r.icon,showColors:!0})),Object(l.createElement)("span",{className:"block-editor-block-types-list__item-title"},r.title)))}))})),bu=Object(l.forwardRef)((function(e,t){var n=Object(l.useState)(!1),r=Object(Co.a)(n,2),o=r[0],c=r[1];return Object(l.useEffect)((function(){o&&Object(Rt.speak)(Object(k.__)("Use left and right arrow keys to move through blocks"))}),[o]),Object(l.createElement)("div",Object(i.a)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:function(){c(!0)},onBlur:function(e){!e.currentTarget.contains(e.relatedTarget)&&c(!1)}},e))})),fu=Object(l.forwardRef)((function(e,t){var n=Object(l.useContext)(ru);return Object(l.createElement)(m.__unstableCompositeGroup,Object(i.a)({state:n,role:"presentation",ref:t},e))})),pu=function(e){var t=e.items,n=void 0===t?[]:t,r=e.onSelect,o=e.onHover,c=void 0===o?function(){}:o,i=e.children,a=e.label,s=e.isDraggable,u=void 0===s||s;return Object(l.createElement)(bu,{className:"block-editor-block-types-list","aria-label":a},function(e,t){for(var n=[],r=0,o=e.length;r<o;r+=3)n.push(e.slice(r,r+3));return n}(n).map((function(e,t){return Object(l.createElement)(fu,{key:t},e.map((function(e,n){return Object(l.createElement)(du,{key:e.id,item:e,className:Object(p.getBlockMenuDefaultClassName)(e.id),onSelect:r,onHover:c,isDraggable:u,isFirst:0===t&&0===n})})))})),i)},mu=function(e){var t=e.title,n=e.icon,r=e.children;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"block-editor-inserter__panel-header"},Object(l.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),Object(l.createElement)(m.Icon,{icon:n})),Object(l.createElement)("div",{className:"block-editor-inserter__panel-content"},r))},vu=function(e){var t=e.children,n=Object(m.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return Object(l.createElement)(ru.Provider,{value:n},t)};function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var gu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onHover,o=e.showMostUsedBlocks,c=Ol(t,n),i=Object(Co.a)(c,4),s=i[0],u=i[1],b=i[2],f=i[3],p=Object(l.useMemo)((function(){return Object(d.orderBy)(s,["frecency"],["desc"]).slice(0,6)}),[s]),m=Object(l.useMemo)((function(){return s.filter((function(e){return!e.category}))}),[s]),v=Object(l.useMemo)((function(){return Object(d.flow)((function(e){return e.filter((function(e){return e.category&&"reusable"!==e.category}))}),(function(e){return Object(d.groupBy)(e,"category")}))(s)}),[s]),O=Object(l.useMemo)((function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},b);return Object.keys(b).forEach((function(t){e[t]=s.filter((function(e){return function(e){return e.name.split("/")[0]}(e)===t})),0===e[t].length&&delete e[t]})),e}),[s,b]);return Object(l.useEffect)((function(){return function(){return r(null)}}),[]),Object(l.createElement)(vu,null,Object(l.createElement)("div",null,o&&!!p.length&&Object(l.createElement)(mu,{title:Object(k._x)("Most used","blocks")},Object(l.createElement)(pu,{items:p,onSelect:f,onHover:r,label:Object(k._x)("Most used","blocks")})),Object(d.map)(u,(function(e){var t=v[e.slug];return t&&t.length?Object(l.createElement)(mu,{key:e.slug,title:e.title,icon:e.icon},Object(l.createElement)(pu,{items:t,onSelect:f,onHover:r,label:e.title})):null})),m.length>0&&Object(l.createElement)(mu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:Object(k.__)("Uncategorized")},Object(l.createElement)(pu,{items:m,onSelect:f,onHover:r,label:Object(k.__)("Uncategorized")})),Object(d.map)(b,(function(e,t){var n=O[t];return n&&n.length?Object(l.createElement)(mu,{key:t,title:e.title,icon:e.icon},Object(l.createElement)(pu,{items:n,onSelect:f,onHover:r,label:e.title})):null}))))},hu=function(e){var t,n=e.selectedCategory,r=e.patternCategories,o=e.onClickCategory,c=e.children;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:u()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns")},Object(l.createElement)(m.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:Object(k.__)("Filter patterns"),hideLabelFromVision:!0,value:n.name,onChange:function(e){o(r.find((function(t){return e===t.name})))},onBlur:function(e){null!=e&&e.relatedTarget||e.stopPropagation()},options:(t=[],r.map((function(e){return t.push({value:e.name,label:e.label})})),t)})),Object(l.createElement)("div",{className:"block-editor-inserter__panel-content"},c))},ju=n(45),yu=function(e,t){var n=Object(v.useSelect)((function(e){var n=e(yr),r=n.__experimentalGetAllowedPatterns,o=n.getSettings;return{patterns:r(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),r=n.patternCategories,o=n.patterns,c=Object(v.useDispatch)(ju.store).createSuccessNotice;return[o,r,Object(l.useCallback)((function(t,n){e(Object(d.map)(n,(function(e){return Object(p.cloneBlock)(e)})),t.name),c(Object(k.sprintf)(
|
32 |
/* translators: %s: block pattern title. */
|
33 |
Object(k.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function ku(e){var t=e.isDraggable,n=e.pattern,r=e.onClick,o=e.composite,c=n.name,a=n.viewportWidth,s=Object(v.useSelect)((function(e){return e(yr).__experimentalGetParsedPattern(c)}),[c]).blocks,u=Object(b.useInstanceId)(ku),d="block-editor-block-patterns-list__item-description-".concat(u);return Object(l.createElement)(su,{isEnabled:t,blocks:s},(function(e){var t=e.draggable,c=e.onDragStart,u=e.onDragEnd;return Object(l.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?d:void 0,draggable:t,onDragStart:c,onDragEnd:u},Object(l.createElement)(m.__unstableCompositeItem,Object(i.a)({role:"option",as:"div"},o,{className:"block-editor-block-patterns-list__item",onClick:function(){return r(n,s)}}),Object(l.createElement)(Js,{blocks:s,viewportWidth:a}),Object(l.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&Object(l.createElement)(m.VisuallyHidden,{id:d},n.description)))}))}function _u(){return Object(l.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Eu=function(e){var t=e.isDraggable,n=e.blockPatterns,r=e.shownPatterns,o=e.onClickPattern,c=e.orientation,a=e.label,s=void 0===a?Object(k.__)("Block Patterns"):a,u=Object(m.__unstableUseCompositeState)({orientation:c});return Object(l.createElement)(m.__unstableComposite,Object(i.a)({},u,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":s}),n.map((function(e){return r.includes(e)?Object(l.createElement)(ku,{key:e.name,pattern:e,onClick:o,isDraggable:t,composite:u}):Object(l.createElement)(_u,{key:e.name})})))};function wu(e){var t=e.rootClientId,n=e.onInsert,r=e.selectedCategory,o=e.onClickCategory,c=yu(n,t),i=Object(Co.a)(c,3),a=i[0],s=i[1],u=i[2],f=Object(l.useMemo)((function(){return s.filter((function(e){return a.some((function(t){var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)}))}))}),[a,s]),p=r||f[0];Object(l.useEffect)((function(){a.some((function(e){return m(e)===1/0}))&&!f.find((function(e){return"uncategorized"===e.name}))&&f.push({name:"uncategorized",label:Object(k._x)("Uncategorized")})}),[f,a]);var m=Object(l.useCallback)((function(e){if(!e.categories||!e.categories.length)return 1/0;var t=Object(d.fromPairs)(f.map((function(e,t){return[e.name,t]})));return Math.min.apply(Math,Object(y.a)(e.categories.map((function(e){return void 0!==t[e]?t[e]:1/0}))))}),[f]),v=Object(l.useMemo)((function(){return a.filter((function(e){return"uncategorized"===p.name?m(e)===1/0:e.categories&&e.categories.includes(p.name)}))}),[a,p]),O=Object(l.useMemo)((function(){return v.sort((function(e,t){return m(e)-m(t)}))}),[v,m]),g=Object(b.useAsyncList)(O);return Object(l.createElement)(l.Fragment,null,!!v.length&&Object(l.createElement)(hu,{selectedCategory:p,patternCategories:f,onClickCategory:o},Object(l.createElement)(Eu,{shownPatterns:g,blockPatterns:v,onClickPattern:u,label:p.label,orientation:"vertical",isDraggable:!0})))}var Cu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onClickCategory,o=e.selectedCategory;return Object(l.createElement)(wu,{rootClientId:t,selectedCategory:o,onInsert:n,onClickCategory:r})},Su=n(31),Bu=function(){return Object(l.createElement)("div",{className:"block-editor-inserter__no-results"},Object(l.createElement)(ra.a,{className:"block-editor-inserter__no-results-icon",icon:gl.a}),Object(l.createElement)("p",null,Object(k.__)("No results found.")))};function Iu(e){var t=e.onHover,n=e.onInsert,r=e.rootClientId,o=Ol(r,n),c=Object(Co.a)(o,4),i=c[0],a=c[3],s=Object(l.useMemo)((function(){return i.filter((function(e){return"reusable"===e.category}))}),[i]);return 0===s.length?Object(l.createElement)(Bu,null):Object(l.createElement)(mu,{title:Object(k.__)("Reusable blocks")},Object(l.createElement)(pu,{items:s,onSelect:a,onHover:t,label:Object(k.__)("Reusable blocks")}))}var xu=function(e){var t=e.rootClientId,n=e.onInsert,r=e.onHover;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)(Iu,{onHover:r,onInsert:n,rootClientId:t}),Object(l.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},Object(l.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:Object(Su.addQueryArgs)("edit.php",{post_type:"wp_block"})},Object(k.__)("Manage Reusable blocks"))))},Pu=Object(m.createSlotFill)("__experimentalInserterMenuExtension"),Tu=Pu.Fill,Nu=Pu.Slot;Tu.Slot=Nu;var Du=Tu,Au=function(e){var t=e.rootClientId,n=e.insertionIndex,r=e.clientId,o=e.isAppender,c=e.onSelect,i=e.shouldFocusBlock,a=void 0===i||i,s=Object(v.useSelect)((function(e){var c,i,a=e(yr),l=a.getSelectedBlock,s=a.getBlockIndex,u=a.getBlockOrder,d=a.getBlockInsertionPoint;if(t||n||r||o)c=t,i=n||(r?s(r,c):u(c).length);else{var b=d();c=b.rootClientId,i=b.index}return{getSelectedBlock:l,destinationRootClientId:c,destinationIndex:i}}),[t,n,r,o]),u=s.destinationRootClientId,b=s.destinationIndex,f=s.getSelectedBlock,m=Object(v.useDispatch)(yr),O=m.replaceBlocks,g=m.insertBlocks,h=m.showInsertionPoint,j=m.hideInsertionPoint,y=Object(l.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=f();!o&&r&&Object(p.isUnmodifiedDefaultBlock)(r)?O(r.clientId,e,null,a||n?0:null,t):g(e,b,u,!0,a||n?0:null,t);var i=Object(k.sprintf)(// translators: %d: the name of the block that has been added
|
34 |
Object(k._n)("%d block added.","%d blocks added.",Object(d.castArray)(e).length),Object(d.castArray)(e).length);Object(Rt.speak)(i),c&&c()}),[o,f,O,g,u,b,c,a]),_=Object(l.useCallback)((function(e){e?h(u,b):j()}),[h,j,u,b]);return[u,y,_]},Lu=function(e){var t=e.filterValue,n=e.onSelect,r=e.onHover,o=e.rootClientId,c=e.clientId,i=e.isAppender,a=e.maxBlockPatterns,s=e.maxBlockTypes,u=e.showBlockDirectory,f=void 0!==u&&u,p=e.isDraggable,v=void 0===p||p,O=e.shouldFocusBlock,g=void 0===O||O,h=Object(b.useDebounce)(Rt.speak,500),j=Au({onSelect:n,rootClientId:o,clientId:c,isAppender:i,shouldFocusBlock:g}),y=Object(Co.a)(j,2),_=y[0],E=y[1],w=Ol(_,E),C=Object(Co.a)(w,4),S=C[0],B=C[1],I=C[2],x=C[3],P=yu(E,_),T=Object(Co.a)(P,3),N=T[0],D=T[2],A=Object(l.useMemo)((function(){var e=pl(Object(d.orderBy)(S,["frecency"],["desc"]),B,I,t);return void 0!==s?e.slice(0,s):e}),[t,S,B,I,s]),L=Object(l.useMemo)((function(){var e=ml(N,t);return void 0!==a?e.slice(0,a):e}),[t,N,a]);Object(l.useEffect)((function(){if(t){var e=A.length+L.length,n=Object(k.sprintf)(
|
changelog.txt
CHANGED
@@ -1,224 +1,241 @@
|
|
1 |
== Changelog ==
|
2 |
|
3 |
-
= 10.5.
|
4 |
|
5 |
-
### Enhancements
|
6 |
-
|
7 |
-
- Block Library:
|
8 |
-
- Buttons:
|
9 |
-
- Add Typography support. ([30394](https://github.com/WordPress/gutenberg/pull/30394))
|
10 |
-
- Explicitly add text-align-center to legacy buttons. ([30525](https://github.com/WordPress/gutenberg/pull/30525))
|
11 |
-
- Update to use color support utils to retrieve classes and styles. ([30870](https://github.com/WordPress/gutenberg/pull/30870))
|
12 |
-
- Columns: Add column count to the column block label. ([30248](https://github.com/WordPress/gutenberg/pull/30248))
|
13 |
-
- File: Add support for embedding PDFs. ([30857](https://github.com/WordPress/gutenberg/pull/30857))
|
14 |
-
- List: Add placeholder attribute. ([30958](https://github.com/WordPress/gutenberg/pull/30958))
|
15 |
-
- Post Comments Link: New block added. ([29564](https://github.com/WordPress/gutenberg/pull/29564))
|
16 |
-
- Site Logo:
|
17 |
-
- Update the site logo description to be more illustrative. ([30909](https://github.com/WordPress/gutenberg/pull/30909))
|
18 |
-
- Add an initial value to the Site Logo block. ([30907](https://github.com/WordPress/gutenberg/pull/30907))
|
19 |
-
- Site Title:
|
20 |
-
- Normalize the toolbar. ([30999](https://github.com/WordPress/gutenberg/pull/30999))
|
21 |
-
- Normalize the toolbar (II). ([31032](https://github.com/WordPress/gutenberg/pull/31032))
|
22 |
-
- Social Links:
|
23 |
-
- Add text placeholder next to appender. ([29851](https://github.com/WordPress/gutenberg/pull/29851))
|
24 |
-
- Remove obsolete hardcoded focus style from Social Links. ([30721](https://github.com/WordPress/gutenberg/pull/30721))
|
25 |
-
- Template Part: Add active block variation information in Block Parent Selector. ([30731](https://github.com/WordPress/gutenberg/pull/30731))
|
26 |
-
- Term Description: Don't output if there's no description. ([30564](https://github.com/WordPress/gutenberg/pull/30564))
|
27 |
-
- Verse: Add support for custom colors. ([27736](https://github.com/WordPress/gutenberg/pull/27736))
|
28 |
-
- Video: Add uploading state. ([30837](https://github.com/WordPress/gutenberg/pull/30837))
|
29 |
-
- Block Patterns:
|
30 |
-
- Revisit the bundled block patterns. ([29973](https://github.com/WordPress/gutenberg/pull/29973))
|
31 |
-
- Small adjustments to bundled block patterns. ([31105](https://github.com/WordPress/gutenberg/pull/31105))
|
32 |
-
- Suggest block pattern transformations that are contextual to the currently selected 'simple' blocks (no InnerBlocks). ([30469](https://github.com/WordPress/gutenberg/pull/30469))
|
33 |
-
- Query Patterns:
|
34 |
-
- Try more opinionated query block patterns. ([30763](https://github.com/WordPress/gutenberg/pull/30763))
|
35 |
-
- Add the small image and title pattern back in, fix excerpt length.. ([30817](https://github.com/WordPress/gutenberg/pull/30817))
|
36 |
-
- Components: Add create-styles. ([30509](https://github.com/WordPress/gutenberg/pull/30509))
|
37 |
-
- Design Tools:
|
38 |
-
- Add border color, style and width support. ([30124](https://github.com/WordPress/gutenberg/pull/30124))
|
39 |
-
- BoxControl: Allow configurable sides. ([30606](https://github.com/WordPress/gutenberg/pull/30606))
|
40 |
-
- Color Block Support: Add utilities to retrieve color classes and styles. ([30869](https://github.com/WordPress/gutenberg/pull/30869))
|
41 |
-
- General Interface:
|
42 |
-
- Animate the canvas transitions. ([30802](https://github.com/WordPress/gutenberg/pull/30802))
|
43 |
-
- Include block title into block switcher label. ([30808](https://github.com/WordPress/gutenberg/pull/30808))
|
44 |
-
- Inspector Controls: Rephrase, polish, and make consistent color labels. ([30075](https://github.com/WordPress/gutenberg/pull/30075))
|
45 |
-
- Move the template mode edit and new links to a dedicated template panel. ([30900](https://github.com/WordPress/gutenberg/pull/30900))
|
46 |
-
- Update design of the resize handles. ([30339](https://github.com/WordPress/gutenberg/pull/30339))
|
47 |
-
- Icons: Update icons for text overlay and crop. ([30673](https://github.com/WordPress/gutenberg/pull/30673))
|
48 |
-
- i18n: Add `resetLocaleData` method. ([30419](https://github.com/WordPress/gutenberg/pull/30419))
|
49 |
-
- Publishing Flow: Show post events in the post schedule calendar. ([29716](https://github.com/WordPress/gutenberg/pull/29716))
|
50 |
-
- Template Editing Mode:
|
51 |
-
- Allow creating custom block templates in classic themes. ([30438](https://github.com/WordPress/gutenberg/pull/30438))
|
52 |
-
- Replace the document tab with a template tab in template mode. ([30860](https://github.com/WordPress/gutenberg/pull/30860))
|
53 |
-
- Unify saving flow between template mode and default mode. ([30793](https://github.com/WordPress/gutenberg/pull/30793))
|
54 |
-
- Updates the template mode canvas padding and adds a backlink. ([30658](https://github.com/WordPress/gutenberg/pull/30658))
|
55 |
-
- Site Editor:
|
56 |
-
- Add 'area' selection to convert to template part flow. ([30395](https://github.com/WordPress/gutenberg/pull/30395))
|
57 |
-
- Add do_block_template_part function. ([30345](https://github.com/WordPress/gutenberg/pull/30345))
|
58 |
-
- Add skip link to block templates. ([30336](https://github.com/WordPress/gutenberg/pull/30336))
|
59 |
-
- Remove single-post from the default templates set. ([29668](https://github.com/WordPress/gutenberg/pull/29668))
|
60 |
-
- Themes: Fix template-hierarchy fallbacks. ([30599](https://github.com/WordPress/gutenberg/pull/30599))
|
61 |
-
- Writing Flow: Scroll selected block only if it has no focus. ([30924](https://github.com/WordPress/gutenberg/pull/30924))
|
62 |
|
63 |
|
64 |
### Bug Fixes
|
65 |
|
66 |
-
-
|
67 |
-
-
|
68 |
-
|
69 |
-
- Image Block: Disable media buttons in the uploading state. ([30863](https://github.com/WordPress/gutenberg/pull/30863))
|
70 |
-
- Query: Fix max-height to query pattern preview. ([30757](https://github.com/WordPress/gutenberg/pull/30757))
|
71 |
-
- Post Title: Fix warnings for RichText in inline containers. ([30666](https://github.com/WordPress/gutenberg/pull/30666))
|
72 |
-
- Site Title Add default block after pressing enter at the end of Site Title. ([30996](https://github.com/WordPress/gutenberg/pull/30996))
|
73 |
-
- Block Editor:
|
74 |
-
- Bring back imageDefaultSize shim for WP 5.7. ([30955](https://github.com/WordPress/gutenberg/pull/30955))
|
75 |
-
- Fix the position of vertical add a new block in RTL mode. ([31035](https://github.com/WordPress/gutenberg/pull/31035))
|
76 |
-
- Template part: Fix PHP notice for placeholder block. ([30928](https://github.com/WordPress/gutenberg/pull/30928))
|
77 |
-
- Components:
|
78 |
-
- Add a StyleProvider to support CSS-in-JS components inside iframes. ([31010](https://github.com/WordPress/gutenberg/pull/31010))
|
79 |
-
- Apply a StyleProvider around fills that can be used inside the iframe. ([31073](https://github.com/WordPress/gutenberg/pull/31073))
|
80 |
-
- Fix "RadioControl: checked" style outside of Gutenberg. ([30670](https://github.com/WordPress/gutenberg/pull/30670))
|
81 |
-
- Fix Post Date component. ([30790](https://github.com/WordPress/gutenberg/pull/30790))
|
82 |
-
- Fix Post Publishing Popover moving when certain dates are clicked. ([30298](https://github.com/WordPress/gutenberg/pull/30298))
|
83 |
-
- Fix useForceUpdate Memory Leak: Only setState if the component is still mounted. ([30667](https://github.com/WordPress/gutenberg/pull/30667))
|
84 |
-
- General Interface: Fix is-link style to take colors from wp-admin theme. ([30823](https://github.com/WordPress/gutenberg/pull/30823))
|
85 |
-
- Inserter: Stop event propagation for the select element's onBlur to fix the behavior in iOS when selecting a pattern category. ([30717](https://github.com/WordPress/gutenberg/pull/30717))
|
86 |
-
- Site Editor:
|
87 |
-
- Focus save button when entities save states panel is opened. ([30873](https://github.com/WordPress/gutenberg/pull/30873))
|
88 |
-
- Remove call to wpautop that unintentionally alters block markup in template parts. ([30552](https://github.com/WordPress/gutenberg/pull/30552))
|
89 |
-
- Template Editing Mode: Hide the template selector and template mode from non-viewable post types. ([30861](https://github.com/WordPress/gutenberg/pull/30861))
|
90 |
-
|
91 |
-
### Experiments
|
92 |
-
|
93 |
-
- Block-based Widgets:
|
94 |
-
- API:
|
95 |
-
- Don't use deprecated widget_class property. ([30429](https://github.com/WordPress/gutenberg/pull/30429))
|
96 |
-
- Fix null instance property when instance settings are empty. ([30713](https://github.com/WordPress/gutenberg/pull/30713))
|
97 |
-
- Remove deprecated properties. ([30853](https://github.com/WordPress/gutenberg/pull/30853))
|
98 |
-
- Customizer Integration:
|
99 |
-
- Add media uploader capabilities to block-based widget customize screen. ([30954](https://github.com/WordPress/gutenberg/pull/30954))
|
100 |
-
- Add move to widget area dropdown in customizer. ([30896](https://github.com/WordPress/gutenberg/pull/30896))
|
101 |
-
- Add rich text formats. ([30952](https://github.com/WordPress/gutenberg/pull/30952))
|
102 |
-
- Fix editing performance in Widgets Customizer. ([30654](https://github.com/WordPress/gutenberg/pull/30654))
|
103 |
-
- Fix block-based widget customizer initializing too soon. ([30864](https://github.com/WordPress/gutenberg/pull/30864))
|
104 |
-
- Refactor the inspector in Widgets Customizer to use core's controls. ([30431](https://github.com/WordPress/gutenberg/pull/30431))
|
105 |
-
- Legacy Widget: Improve backwards compatibility. ([30709](https://github.com/WordPress/gutenberg/pull/30709))
|
106 |
-
- Widget editor:
|
107 |
-
- Add a toolbar button to move between widget areas. ([30826](https://github.com/WordPress/gutenberg/pull/30826))
|
108 |
-
- Fix the undo/redo buttons in the standalone block-based widgets editor. ([30989](https://github.com/WordPress/gutenberg/pull/30989))
|
109 |
-
- Navigation Editor and Block:
|
110 |
-
- Fix navigation placeholder height issue. ([30824](https://github.com/WordPress/gutenberg/pull/30824))
|
111 |
-
- Fix alignment issue on the nav screen manage locations buttons. ([30441](https://github.com/WordPress/gutenberg/pull/30441))
|
112 |
-
- Limit navigation nesting depth to 5. ([30199](https://github.com/WordPress/gutenberg/pull/30199))
|
113 |
-
- Nav-created drafts should not render on the front end. ([29692](https://github.com/WordPress/gutenberg/pull/29692))
|
114 |
-
- Page List: Add ability to convert to navigation links. ([30390](https://github.com/WordPress/gutenberg/pull/30390))
|
115 |
-
- Show justification controls for vertical variant. ([30351](https://github.com/WordPress/gutenberg/pull/30351))
|
116 |
-
- Use theme locations description instead of the slug for navigation screen location labels. ([30797](https://github.com/WordPress/gutenberg/pull/30797))
|
117 |
-
- Global Styles:
|
118 |
-
- Absorb editor settings transformation in WP_Theme_JSON. ([30610](https://github.com/WordPress/gutenberg/pull/30610))
|
119 |
-
- Clean cached data when switching themes. ([30830](https://github.com/WordPress/gutenberg/pull/30830))
|
120 |
-
- Extract sanitize method. ([30809](https://github.com/WordPress/gutenberg/pull/30809))
|
121 |
-
- Fix: CSS variable reference mechanism regression. ([31015](https://github.com/WordPress/gutenberg/pull/31015))
|
122 |
-
- Make the dependency of the star matcher explicit when translating `theme.json`. ([30604](https://github.com/WordPress/gutenberg/pull/30604))
|
123 |
-
- Only remove the default font family in the editor from themes with theme.json file. ([30895](https://github.com/WordPress/gutenberg/pull/30895))
|
124 |
-
- Refactor how we iterate over the tree. ([30801](https://github.com/WordPress/gutenberg/pull/30801))
|
125 |
-
- Remove no longer needed translations handled in PHP for settings. ([30605](https://github.com/WordPress/gutenberg/pull/30605))
|
126 |
-
- theme.json: Add util to transform from a v0 schema to the latest. ([30600](https://github.com/WordPress/gutenberg/pull/30600))
|
127 |
-
|
128 |
-
### Documentation
|
129 |
-
|
130 |
-
- docgen:
|
131 |
-
- Add support for TS exported static non-function variables. ([30971](https://github.com/WordPress/gutenberg/pull/30971))
|
132 |
-
- Add support for assignment patterns. ([30681](https://github.com/WordPress/gutenberg/pull/30681))
|
133 |
-
- Add support for object-destructuring. ([30675](https://github.com/WordPress/gutenberg/pull/30675))
|
134 |
-
- Find parameters by index rather than name and handle array destructuring. ([29945](https://github.com/WordPress/gutenberg/pull/29945))
|
135 |
-
- Handbook:
|
136 |
-
- Add documentation for border block supports. ([31039](https://github.com/WordPress/gutenberg/pull/31039))
|
137 |
-
- Add documentation for border styles. ([31040](https://github.com/WordPress/gutenberg/pull/31040))
|
138 |
-
- Add fix to suggested prefixes of the branch. ([30953](https://github.com/WordPress/gutenberg/pull/30953))
|
139 |
-
- Change references from Block Style Variations to Block Styles. ([30911](https://github.com/WordPress/gutenberg/pull/30911))
|
140 |
-
- Fix Block Editor Accessibility link. ([30569](https://github.com/WordPress/gutenberg/pull/30569))
|
141 |
-
- Fix more example for register_block_type - apiVersion to api_version. ([30819](https://github.com/WordPress/gutenberg/pull/30819))
|
142 |
-
- Fix PHP example for register_block_type - apiVersion to api_version. ([30818](https://github.com/WordPress/gutenberg/pull/30818))
|
143 |
-
- Fixed a type and made the whole explanation more clear. ([30487](https://github.com/WordPress/gutenberg/pull/30487))
|
144 |
-
- Fixes broken GitHub links to commonly used labels. ([30875](https://github.com/WordPress/gutenberg/pull/30875))
|
145 |
-
- Improve semantics in the block-based theme guide. ([30946](https://github.com/WordPress/gutenberg/pull/30946))
|
146 |
-
- Include a note about `is_default` property for `register_block_style`. ([30792](https://github.com/WordPress/gutenberg/pull/30792))
|
147 |
-
- Organize Block API Reference. ([30980](https://github.com/WordPress/gutenberg/pull/30980))
|
148 |
-
- Packages: Further clarify the npm publishing process. ([30733](https://github.com/WordPress/gutenberg/pull/30733))
|
149 |
-
- Update getting started with code. ([30447](https://github.com/WordPress/gutenberg/pull/30447))
|
150 |
-
- Libs:
|
151 |
-
- Blocks: Fix PHPDocs of `gutenberg_block_has_support`. ([31050](https://github.com/WordPress/gutenberg/pull/31050))
|
152 |
-
- Query Utils: Fix return type of `construct_wp_query_args()`. ([30611](https://github.com/WordPress/gutenberg/pull/30611))
|
153 |
-
- License: Interim dual license license of future contributions. ([30383](https://github.com/WordPress/gutenberg/pull/30383))
|
154 |
-
- Packages:
|
155 |
-
- Block Library - Social Links: Update param type. ([30652](https://github.com/WordPress/gutenberg/pull/30652))
|
156 |
-
- Components: Add documentation for the text prop on the Button component. ([30796](https://github.com/WordPress/gutenberg/pull/30796))
|
157 |
-
- Core Data: Fixes return type for getEntitiesByKind. ([30639](https://github.com/WordPress/gutenberg/pull/30639))
|
158 |
-
- Block Editor: Update import statement of ImageSizeControl component. ([30704](https://github.com/WordPress/gutenberg/pull/30704))
|
159 |
-
- Hooks: Add namespace param clarification. ([30501](https://github.com/WordPress/gutenberg/pull/30501))
|
160 |
|
161 |
### Code Quality
|
162 |
|
163 |
-
-
|
164 |
-
- Simplify focus capture. ([31036](https://github.com/WordPress/gutenberg/pull/31036))
|
165 |
-
- Standardize loading default block editor settings. ([30245](https://github.com/WordPress/gutenberg/pull/30245))
|
166 |
-
- Block Library:
|
167 |
-
- Button Block: Use hook-based border support. ([30194](https://github.com/WordPress/gutenberg/pull/30194))
|
168 |
-
- Cover: Rename isBlogUrl to isUploadingMedia. ([30435](https://github.com/WordPress/gutenberg/pull/30435))
|
169 |
-
- Cover: Use ALLOWED_MEDIA_TYPES shared constant. ([30977](https://github.com/WordPress/gutenberg/pull/30977))
|
170 |
-
- Block Patterns: Clean up bundled pattern titles & categories. ([30998](https://github.com/WordPress/gutenberg/pull/30998))
|
171 |
-
- Components: Remove `create-styles` in favor of vanilla emotion. ([31048](https://github.com/WordPress/gutenberg/pull/31048))
|
172 |
-
- dom:
|
173 |
-
- Add types to caret placement functions. ([30750](https://github.com/WordPress/gutenberg/pull/30750))
|
174 |
-
- Add types to document-has-selection. ([30386](https://github.com/WordPress/gutenberg/pull/30386))
|
175 |
-
- Add types to is-edge and dependencies. ([30546](https://github.com/WordPress/gutenberg/pull/30546))
|
176 |
-
- Add types to miscellaneous files. ([30774](https://github.com/WordPress/gutenberg/pull/30774))
|
177 |
-
- Add types to removeInvalidHTML and stripHTML. ([30752](https://github.com/WordPress/gutenberg/pull/30752))
|
178 |
-
- Only assert defined in development. ([30807](https://github.com/WordPress/gutenberg/pull/30807))
|
179 |
-
- Type the remaining files. ([30841](https://github.com/WordPress/gutenberg/pull/30841))
|
180 |
-
- Drop zone: Rewrite without provider. ([30310](https://github.com/WordPress/gutenberg/pull/30310))
|
181 |
-
- Gutenberg Plugin:
|
182 |
-
- Account for editor styles file removal on WP trunk. ([30894](https://github.com/WordPress/gutenberg/pull/30894))
|
183 |
-
- Format all markdown files using Prettier formatter. ([30715](https://github.com/WordPress/gutenberg/pull/30715))
|
184 |
-
- Format all JSON files using Prettier formatter. ([30714](https://github.com/WordPress/gutenberg/pull/30714))
|
185 |
-
- Updated `.editorconfig` files to work with automatic file formatting. ([30794](https://github.com/WordPress/gutenberg/pull/30794))
|
186 |
-
- Update WP compatibility check in `gutenberg_pre_init()`. ([29938](https://github.com/WordPress/gutenberg/pull/29938))
|
187 |
-
- Improve get_merged_data() code. ([30612](https://github.com/WordPress/gutenberg/pull/30612))
|
188 |
-
- Remove unnecessary semicolons in PHP. ([30780](https://github.com/WordPress/gutenberg/pull/30780))
|
189 |
-
- Replace older-style PHP type conversion functions with typecasts. ([30531](https://github.com/WordPress/gutenberg/pull/30531))
|
190 |
|
191 |
-
### Tools
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
-
|
201 |
-
|
202 |
-
-
|
203 |
-
|
204 |
-
-
|
205 |
-
-
|
206 |
-
-
|
207 |
-
-
|
208 |
-
-
|
209 |
-
|
210 |
-
|
211 |
-
-
|
212 |
-
|
213 |
-
|
214 |
-
-
|
215 |
-
|
216 |
-
|
217 |
-
-
|
218 |
-
-
|
219 |
-
-
|
220 |
-
-
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
|
224 |
= 10.4.1 =
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 10.5.1 =
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
|
7 |
### Bug Fixes
|
8 |
|
9 |
+
- Plugin: Fix "Undefined variable: $image_default_size". ([31324](https://github.com/WordPress/gutenberg/pull/31324))
|
10 |
+
- Select mode: Fix navigate by pointer. ([31321](https://github.com/WordPress/gutenberg/pull/31321))
|
11 |
+
- Fix Inserter Drag and Drop. ([31319](https://github.com/WordPress/gutenberg/pull/31319))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
### Code Quality
|
14 |
|
15 |
+
- Plugin: Unregister only registered block patterns. ([31325](https://github.com/WordPress/gutenberg/pull/31325))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
|
|
17 |
|
18 |
+
|
19 |
+
|
20 |
+
= 10.5.0 =
|
21 |
+
|
22 |
+
### Enhancements
|
23 |
+
|
24 |
+
- Block Library:
|
25 |
+
- Buttons:
|
26 |
+
- Add Typography support. ([30394](https://github.com/WordPress/gutenberg/pull/30394))
|
27 |
+
- Explicitly add text-align-center to legacy buttons. ([30525](https://github.com/WordPress/gutenberg/pull/30525))
|
28 |
+
- Update to use color support utils to retrieve classes and styles. ([30870](https://github.com/WordPress/gutenberg/pull/30870))
|
29 |
+
- Columns: Add column count to the column block label. ([30248](https://github.com/WordPress/gutenberg/pull/30248))
|
30 |
+
- File: Add support for embedding PDFs. ([30857](https://github.com/WordPress/gutenberg/pull/30857))
|
31 |
+
- List: Add placeholder attribute. ([30958](https://github.com/WordPress/gutenberg/pull/30958))
|
32 |
+
- Post Comments Link: New block added. ([29564](https://github.com/WordPress/gutenberg/pull/29564))
|
33 |
+
- Site Logo:
|
34 |
+
- Update the site logo description to be more illustrative. ([30909](https://github.com/WordPress/gutenberg/pull/30909))
|
35 |
+
- Add an initial value to the Site Logo block. ([30907](https://github.com/WordPress/gutenberg/pull/30907))
|
36 |
+
- Site Title:
|
37 |
+
- Normalize the toolbar. ([30999](https://github.com/WordPress/gutenberg/pull/30999))
|
38 |
+
- Normalize the toolbar (II). ([31032](https://github.com/WordPress/gutenberg/pull/31032))
|
39 |
+
- Social Links:
|
40 |
+
- Add text placeholder next to appender. ([29851](https://github.com/WordPress/gutenberg/pull/29851))
|
41 |
+
- Remove obsolete hardcoded focus style from Social Links. ([30721](https://github.com/WordPress/gutenberg/pull/30721))
|
42 |
+
- Template Part: Add active block variation information in Block Parent Selector. ([30731](https://github.com/WordPress/gutenberg/pull/30731))
|
43 |
+
- Term Description: Don't output if there's no description. ([30564](https://github.com/WordPress/gutenberg/pull/30564))
|
44 |
+
- Verse: Add support for custom colors. ([27736](https://github.com/WordPress/gutenberg/pull/27736))
|
45 |
+
- Video: Add uploading state. ([30837](https://github.com/WordPress/gutenberg/pull/30837))
|
46 |
+
- Block Patterns:
|
47 |
+
- Revisit the bundled block patterns. ([29973](https://github.com/WordPress/gutenberg/pull/29973))
|
48 |
+
- Small adjustments to bundled block patterns. ([31105](https://github.com/WordPress/gutenberg/pull/31105))
|
49 |
+
- Suggest block pattern transformations that are contextual to the currently selected 'simple' blocks (no InnerBlocks). ([30469](https://github.com/WordPress/gutenberg/pull/30469))
|
50 |
+
- Query Patterns:
|
51 |
+
- Try more opinionated query block patterns. ([30763](https://github.com/WordPress/gutenberg/pull/30763))
|
52 |
+
- Add the small image and title pattern back in, fix excerpt length.. ([30817](https://github.com/WordPress/gutenberg/pull/30817))
|
53 |
+
- Components: Add create-styles. ([30509](https://github.com/WordPress/gutenberg/pull/30509))
|
54 |
+
- Design Tools:
|
55 |
+
- Add border color, style and width support. ([30124](https://github.com/WordPress/gutenberg/pull/30124))
|
56 |
+
- BoxControl: Allow configurable sides. ([30606](https://github.com/WordPress/gutenberg/pull/30606))
|
57 |
+
- Color Block Support: Add utilities to retrieve color classes and styles. ([30869](https://github.com/WordPress/gutenberg/pull/30869))
|
58 |
+
- General Interface:
|
59 |
+
- Animate the canvas transitions. ([30802](https://github.com/WordPress/gutenberg/pull/30802))
|
60 |
+
- Include block title into block switcher label. ([30808](https://github.com/WordPress/gutenberg/pull/30808))
|
61 |
+
- Inspector Controls: Rephrase, polish, and make consistent color labels. ([30075](https://github.com/WordPress/gutenberg/pull/30075))
|
62 |
+
- Move the template mode edit and new links to a dedicated template panel. ([30900](https://github.com/WordPress/gutenberg/pull/30900))
|
63 |
+
- Update design of the resize handles. ([30339](https://github.com/WordPress/gutenberg/pull/30339))
|
64 |
+
- Icons: Update icons for text overlay and crop. ([30673](https://github.com/WordPress/gutenberg/pull/30673))
|
65 |
+
- i18n: Add `resetLocaleData` method. ([30419](https://github.com/WordPress/gutenberg/pull/30419))
|
66 |
+
- Publishing Flow: Show post events in the post schedule calendar. ([29716](https://github.com/WordPress/gutenberg/pull/29716))
|
67 |
+
- Template Editing Mode:
|
68 |
+
- Allow creating custom block templates in classic themes. ([30438](https://github.com/WordPress/gutenberg/pull/30438))
|
69 |
+
- Replace the document tab with a template tab in template mode. ([30860](https://github.com/WordPress/gutenberg/pull/30860))
|
70 |
+
- Unify saving flow between template mode and default mode. ([30793](https://github.com/WordPress/gutenberg/pull/30793))
|
71 |
+
- Updates the template mode canvas padding and adds a backlink. ([30658](https://github.com/WordPress/gutenberg/pull/30658))
|
72 |
+
- Site Editor:
|
73 |
+
- Add 'area' selection to convert to template part flow. ([30395](https://github.com/WordPress/gutenberg/pull/30395))
|
74 |
+
- Add do_block_template_part function. ([30345](https://github.com/WordPress/gutenberg/pull/30345))
|
75 |
+
- Add skip link to block templates. ([30336](https://github.com/WordPress/gutenberg/pull/30336))
|
76 |
+
- Remove single-post from the default templates set. ([29668](https://github.com/WordPress/gutenberg/pull/29668))
|
77 |
+
- Themes: Fix template-hierarchy fallbacks. ([30599](https://github.com/WordPress/gutenberg/pull/30599))
|
78 |
+
- Writing Flow: Scroll selected block only if it has no focus. ([30924](https://github.com/WordPress/gutenberg/pull/30924))
|
79 |
+
|
80 |
+
|
81 |
+
### Bug Fixes
|
82 |
+
|
83 |
+
- API Fetch: Make preloaded OPTIONS requests use `parse` setting. ([28862](https://github.com/WordPress/gutenberg/pull/28862))
|
84 |
+
- Block Library:
|
85 |
+
- Duplicate media types to avoid bad imports. ([30973](https://github.com/WordPress/gutenberg/pull/30973))
|
86 |
+
- Image Block: Disable media buttons in the uploading state. ([30863](https://github.com/WordPress/gutenberg/pull/30863))
|
87 |
+
- Query: Fix max-height to query pattern preview. ([30757](https://github.com/WordPress/gutenberg/pull/30757))
|
88 |
+
- Post Title: Fix warnings for RichText in inline containers. ([30666](https://github.com/WordPress/gutenberg/pull/30666))
|
89 |
+
- Site Title Add default block after pressing enter at the end of Site Title. ([30996](https://github.com/WordPress/gutenberg/pull/30996))
|
90 |
+
- Block Editor:
|
91 |
+
- Bring back imageDefaultSize shim for WP 5.7. ([30955](https://github.com/WordPress/gutenberg/pull/30955))
|
92 |
+
- Fix the position of vertical add a new block in RTL mode. ([31035](https://github.com/WordPress/gutenberg/pull/31035))
|
93 |
+
- Template part: Fix PHP notice for placeholder block. ([30928](https://github.com/WordPress/gutenberg/pull/30928))
|
94 |
+
- Components:
|
95 |
+
- Add a StyleProvider to support CSS-in-JS components inside iframes. ([31010](https://github.com/WordPress/gutenberg/pull/31010))
|
96 |
+
- Apply a StyleProvider around fills that can be used inside the iframe. ([31073](https://github.com/WordPress/gutenberg/pull/31073))
|
97 |
+
- Fix "RadioControl: checked" style outside of Gutenberg. ([30670](https://github.com/WordPress/gutenberg/pull/30670))
|
98 |
+
- Fix Post Date component. ([30790](https://github.com/WordPress/gutenberg/pull/30790))
|
99 |
+
- Fix Post Publishing Popover moving when certain dates are clicked. ([30298](https://github.com/WordPress/gutenberg/pull/30298))
|
100 |
+
- Fix useForceUpdate Memory Leak: Only setState if the component is still mounted. ([30667](https://github.com/WordPress/gutenberg/pull/30667))
|
101 |
+
- General Interface: Fix is-link style to take colors from wp-admin theme. ([30823](https://github.com/WordPress/gutenberg/pull/30823))
|
102 |
+
- Inserter: Stop event propagation for the select element's onBlur to fix the behavior in iOS when selecting a pattern category. ([30717](https://github.com/WordPress/gutenberg/pull/30717))
|
103 |
+
- Site Editor:
|
104 |
+
- Focus save button when entities save states panel is opened. ([30873](https://github.com/WordPress/gutenberg/pull/30873))
|
105 |
+
- Remove call to wpautop that unintentionally alters block markup in template parts. ([30552](https://github.com/WordPress/gutenberg/pull/30552))
|
106 |
+
- Template Editing Mode: Hide the template selector and template mode from non-viewable post types. ([30861](https://github.com/WordPress/gutenberg/pull/30861))
|
107 |
+
|
108 |
+
### Experiments
|
109 |
+
|
110 |
+
- Block-based Widgets:
|
111 |
+
- API:
|
112 |
+
- Don't use deprecated widget_class property. ([30429](https://github.com/WordPress/gutenberg/pull/30429))
|
113 |
+
- Fix null instance property when instance settings are empty. ([30713](https://github.com/WordPress/gutenberg/pull/30713))
|
114 |
+
- Remove deprecated properties. ([30853](https://github.com/WordPress/gutenberg/pull/30853))
|
115 |
+
- Customizer Integration:
|
116 |
+
- Add media uploader capabilities to block-based widget customize screen. ([30954](https://github.com/WordPress/gutenberg/pull/30954))
|
117 |
+
- Add move to widget area dropdown in customizer. ([30896](https://github.com/WordPress/gutenberg/pull/30896))
|
118 |
+
- Add rich text formats. ([30952](https://github.com/WordPress/gutenberg/pull/30952))
|
119 |
+
- Fix editing performance in Widgets Customizer. ([30654](https://github.com/WordPress/gutenberg/pull/30654))
|
120 |
+
- Fix block-based widget customizer initializing too soon. ([30864](https://github.com/WordPress/gutenberg/pull/30864))
|
121 |
+
- Refactor the inspector in Widgets Customizer to use core's controls. ([30431](https://github.com/WordPress/gutenberg/pull/30431))
|
122 |
+
- Legacy Widget: Improve backwards compatibility. ([30709](https://github.com/WordPress/gutenberg/pull/30709))
|
123 |
+
- Widget editor:
|
124 |
+
- Add a toolbar button to move between widget areas. ([30826](https://github.com/WordPress/gutenberg/pull/30826))
|
125 |
+
- Fix the undo/redo buttons in the standalone block-based widgets editor. ([30989](https://github.com/WordPress/gutenberg/pull/30989))
|
126 |
+
- Navigation Editor and Block:
|
127 |
+
- Fix navigation placeholder height issue. ([30824](https://github.com/WordPress/gutenberg/pull/30824))
|
128 |
+
- Fix alignment issue on the nav screen manage locations buttons. ([30441](https://github.com/WordPress/gutenberg/pull/30441))
|
129 |
+
- Limit navigation nesting depth to 5. ([30199](https://github.com/WordPress/gutenberg/pull/30199))
|
130 |
+
- Nav-created drafts should not render on the front end. ([29692](https://github.com/WordPress/gutenberg/pull/29692))
|
131 |
+
- Page List: Add ability to convert to navigation links. ([30390](https://github.com/WordPress/gutenberg/pull/30390))
|
132 |
+
- Show justification controls for vertical variant. ([30351](https://github.com/WordPress/gutenberg/pull/30351))
|
133 |
+
- Use theme locations description instead of the slug for navigation screen location labels. ([30797](https://github.com/WordPress/gutenberg/pull/30797))
|
134 |
+
- Global Styles:
|
135 |
+
- Absorb editor settings transformation in WP_Theme_JSON. ([30610](https://github.com/WordPress/gutenberg/pull/30610))
|
136 |
+
- Clean cached data when switching themes. ([30830](https://github.com/WordPress/gutenberg/pull/30830))
|
137 |
+
- Extract sanitize method. ([30809](https://github.com/WordPress/gutenberg/pull/30809))
|
138 |
+
- Fix: CSS variable reference mechanism regression. ([31015](https://github.com/WordPress/gutenberg/pull/31015))
|
139 |
+
- Make the dependency of the star matcher explicit when translating `theme.json`. ([30604](https://github.com/WordPress/gutenberg/pull/30604))
|
140 |
+
- Only remove the default font family in the editor from themes with theme.json file. ([30895](https://github.com/WordPress/gutenberg/pull/30895))
|
141 |
+
- Refactor how we iterate over the tree. ([30801](https://github.com/WordPress/gutenberg/pull/30801))
|
142 |
+
- Remove no longer needed translations handled in PHP for settings. ([30605](https://github.com/WordPress/gutenberg/pull/30605))
|
143 |
+
- theme.json: Add util to transform from a v0 schema to the latest. ([30600](https://github.com/WordPress/gutenberg/pull/30600))
|
144 |
+
|
145 |
+
### Documentation
|
146 |
+
|
147 |
+
- docgen:
|
148 |
+
- Add support for TS exported static non-function variables. ([30971](https://github.com/WordPress/gutenberg/pull/30971))
|
149 |
+
- Add support for assignment patterns. ([30681](https://github.com/WordPress/gutenberg/pull/30681))
|
150 |
+
- Add support for object-destructuring. ([30675](https://github.com/WordPress/gutenberg/pull/30675))
|
151 |
+
- Find parameters by index rather than name and handle array destructuring. ([29945](https://github.com/WordPress/gutenberg/pull/29945))
|
152 |
+
- Handbook:
|
153 |
+
- Add documentation for border block supports. ([31039](https://github.com/WordPress/gutenberg/pull/31039))
|
154 |
+
- Add documentation for border styles. ([31040](https://github.com/WordPress/gutenberg/pull/31040))
|
155 |
+
- Add fix to suggested prefixes of the branch. ([30953](https://github.com/WordPress/gutenberg/pull/30953))
|
156 |
+
- Change references from Block Style Variations to Block Styles. ([30911](https://github.com/WordPress/gutenberg/pull/30911))
|
157 |
+
- Fix Block Editor Accessibility link. ([30569](https://github.com/WordPress/gutenberg/pull/30569))
|
158 |
+
- Fix more example for register_block_type - apiVersion to api_version. ([30819](https://github.com/WordPress/gutenberg/pull/30819))
|
159 |
+
- Fix PHP example for register_block_type - apiVersion to api_version. ([30818](https://github.com/WordPress/gutenberg/pull/30818))
|
160 |
+
- Fixed a type and made the whole explanation more clear. ([30487](https://github.com/WordPress/gutenberg/pull/30487))
|
161 |
+
- Fixes broken GitHub links to commonly used labels. ([30875](https://github.com/WordPress/gutenberg/pull/30875))
|
162 |
+
- Improve semantics in the block-based theme guide. ([30946](https://github.com/WordPress/gutenberg/pull/30946))
|
163 |
+
- Include a note about `is_default` property for `register_block_style`. ([30792](https://github.com/WordPress/gutenberg/pull/30792))
|
164 |
+
- Organize Block API Reference. ([30980](https://github.com/WordPress/gutenberg/pull/30980))
|
165 |
+
- Packages: Further clarify the npm publishing process. ([30733](https://github.com/WordPress/gutenberg/pull/30733))
|
166 |
+
- Update getting started with code. ([30447](https://github.com/WordPress/gutenberg/pull/30447))
|
167 |
+
- Libs:
|
168 |
+
- Blocks: Fix PHPDocs of `gutenberg_block_has_support`. ([31050](https://github.com/WordPress/gutenberg/pull/31050))
|
169 |
+
- Query Utils: Fix return type of `construct_wp_query_args()`. ([30611](https://github.com/WordPress/gutenberg/pull/30611))
|
170 |
+
- License: Interim dual license license of future contributions. ([30383](https://github.com/WordPress/gutenberg/pull/30383))
|
171 |
+
- Packages:
|
172 |
+
- Block Library - Social Links: Update param type. ([30652](https://github.com/WordPress/gutenberg/pull/30652))
|
173 |
+
- Components: Add documentation for the text prop on the Button component. ([30796](https://github.com/WordPress/gutenberg/pull/30796))
|
174 |
+
- Core Data: Fixes return type for getEntitiesByKind. ([30639](https://github.com/WordPress/gutenberg/pull/30639))
|
175 |
+
- Block Editor: Update import statement of ImageSizeControl component. ([30704](https://github.com/WordPress/gutenberg/pull/30704))
|
176 |
+
- Hooks: Add namespace param clarification. ([30501](https://github.com/WordPress/gutenberg/pull/30501))
|
177 |
+
|
178 |
+
### Code Quality
|
179 |
+
|
180 |
+
- Block Editor:
|
181 |
+
- Simplify focus capture. ([31036](https://github.com/WordPress/gutenberg/pull/31036))
|
182 |
+
- Standardize loading default block editor settings. ([30245](https://github.com/WordPress/gutenberg/pull/30245))
|
183 |
+
- Block Library:
|
184 |
+
- Button Block: Use hook-based border support. ([30194](https://github.com/WordPress/gutenberg/pull/30194))
|
185 |
+
- Cover: Rename isBlogUrl to isUploadingMedia. ([30435](https://github.com/WordPress/gutenberg/pull/30435))
|
186 |
+
- Cover: Use ALLOWED_MEDIA_TYPES shared constant. ([30977](https://github.com/WordPress/gutenberg/pull/30977))
|
187 |
+
- Block Patterns: Clean up bundled pattern titles & categories. ([30998](https://github.com/WordPress/gutenberg/pull/30998))
|
188 |
+
- Components: Remove `create-styles` in favor of vanilla emotion. ([31048](https://github.com/WordPress/gutenberg/pull/31048))
|
189 |
+
- dom:
|
190 |
+
- Add types to caret placement functions. ([30750](https://github.com/WordPress/gutenberg/pull/30750))
|
191 |
+
- Add types to document-has-selection. ([30386](https://github.com/WordPress/gutenberg/pull/30386))
|
192 |
+
- Add types to is-edge and dependencies. ([30546](https://github.com/WordPress/gutenberg/pull/30546))
|
193 |
+
- Add types to miscellaneous files. ([30774](https://github.com/WordPress/gutenberg/pull/30774))
|
194 |
+
- Add types to removeInvalidHTML and stripHTML. ([30752](https://github.com/WordPress/gutenberg/pull/30752))
|
195 |
+
- Only assert defined in development. ([30807](https://github.com/WordPress/gutenberg/pull/30807))
|
196 |
+
- Type the remaining files. ([30841](https://github.com/WordPress/gutenberg/pull/30841))
|
197 |
+
- Drop zone: Rewrite without provider. ([30310](https://github.com/WordPress/gutenberg/pull/30310))
|
198 |
+
- Gutenberg Plugin:
|
199 |
+
- Account for editor styles file removal on WP trunk. ([30894](https://github.com/WordPress/gutenberg/pull/30894))
|
200 |
+
- Format all markdown files using Prettier formatter. ([30715](https://github.com/WordPress/gutenberg/pull/30715))
|
201 |
+
- Format all JSON files using Prettier formatter. ([30714](https://github.com/WordPress/gutenberg/pull/30714))
|
202 |
+
- Updated `.editorconfig` files to work with automatic file formatting. ([30794](https://github.com/WordPress/gutenberg/pull/30794))
|
203 |
+
- Update WP compatibility check in `gutenberg_pre_init()`. ([29938](https://github.com/WordPress/gutenberg/pull/29938))
|
204 |
+
- Improve get_merged_data() code. ([30612](https://github.com/WordPress/gutenberg/pull/30612))
|
205 |
+
- Remove unnecessary semicolons in PHP. ([30780](https://github.com/WordPress/gutenberg/pull/30780))
|
206 |
+
- Replace older-style PHP type conversion functions with typecasts. ([30531](https://github.com/WordPress/gutenberg/pull/30531))
|
207 |
+
|
208 |
+
### Tools
|
209 |
+
|
210 |
+
- Testing:
|
211 |
+
- Block Library - Cover Block:
|
212 |
+
- Add edit media integration tests. ([30270](https://github.com/WordPress/gutenberg/pull/30270))
|
213 |
+
- Replace media end-to-end test. ([30306](https://github.com/WordPress/gutenberg/pull/30306))
|
214 |
+
- Fix end-to-end test failure screenshots not capturing at the right time. ([28449](https://github.com/WordPress/gutenberg/pull/28449))
|
215 |
+
- Fixture regeneration: Infer tabs use from prettier configuration. ([30813](https://github.com/WordPress/gutenberg/pull/30813))
|
216 |
+
- Skip unstable template part end-to-end test. ([30748](https://github.com/WordPress/gutenberg/pull/30748))
|
217 |
+
- Trim block fixture HTML when generating other test fixture files. ([30981](https://github.com/WordPress/gutenberg/pull/30981))
|
218 |
+
- Wire PHP tests for block editor settings. ([30984](https://github.com/WordPress/gutenberg/pull/30984))
|
219 |
+
- wp-env:
|
220 |
+
- Better errors when Docker is not started. ([30882](https://github.com/WordPress/gutenberg/pull/30882))
|
221 |
+
- Bump tt1-blocks dependency to v0.4.5. ([30045](https://github.com/WordPress/gutenberg/pull/30045))
|
222 |
+
- Disable Xdebug for php < 7.2. ([30651](https://github.com/WordPress/gutenberg/pull/30651))
|
223 |
+
- Fix chown cannot access 'wp-config.php'. ([30053](https://github.com/WordPress/gutenberg/pull/30053))
|
224 |
+
- Fix issue with unquoted paths in docker-compose call. ([30692](https://github.com/WordPress/gutenberg/pull/30692))
|
225 |
+
- Remove platform-specific destroy commands. ([30638](https://github.com/WordPress/gutenberg/pull/30638))
|
226 |
+
- Set default environment type to local. ([28808](https://github.com/WordPress/gutenberg/pull/28808))
|
227 |
+
- Update changelog and CI. ([30646](https://github.com/WordPress/gutenberg/pull/30646))
|
228 |
+
- Build Tooling:
|
229 |
+
- Add comments to webpack entrypoint function. ([30629](https://github.com/WordPress/gutenberg/pull/30629))
|
230 |
+
- Create frontend entry points for block-library, outputting code loadable from the browser.. ([30341](https://github.com/WordPress/gutenberg/pull/30341))
|
231 |
+
- Perf Workflow: Trigger upon release publishing. ([30628](https://github.com/WordPress/gutenberg/pull/30628))
|
232 |
+
- Pull trunk before pushing. ([30615](https://github.com/WordPress/gutenberg/pull/30615))
|
233 |
+
- Remind about required cherry-picks after npm publishing. ([30868](https://github.com/WordPress/gutenberg/pull/30868))
|
234 |
+
- Update development tools to work with PostCSS (try 2). ([30347](https://github.com/WordPress/gutenberg/pull/30347))
|
235 |
+
- Use consistently latest keyword for npm publishing. ([30866](https://github.com/WordPress/gutenberg/pull/30866))
|
236 |
+
- Scripts:
|
237 |
+
- Allow CSS modules in the build commands. ([29182](https://github.com/WordPress/gutenberg/pull/29182))
|
238 |
+
- Include YAML files in prettification. ([30240](https://github.com/WordPress/gutenberg/pull/30240))
|
239 |
|
240 |
|
241 |
= 10.4.1 =
|
gutenberg.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.6
|
7 |
* Requires PHP: 5.6
|
8 |
-
* Version: 10.5.
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
@@ -13,8 +13,8 @@
|
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
-
define( 'GUTENBERG_VERSION', '10.5.
|
17 |
-
define( 'GUTENBERG_GIT_COMMIT', '
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.6
|
7 |
* Requires PHP: 5.6
|
8 |
+
* Version: 10.5.1
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
+
define( 'GUTENBERG_VERSION', '10.5.1' );
|
17 |
+
define( 'GUTENBERG_GIT_COMMIT', 'bd35b8c6dbfefc181661096362785d6bb9f03f0d' );
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
lib/block-editor.php
CHANGED
@@ -191,7 +191,7 @@ function gutenberg_get_default_block_editor_settings() {
|
|
191 |
}
|
192 |
|
193 |
$default_size = get_option( 'image_default_size', 'large' );
|
194 |
-
$image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $
|
195 |
|
196 |
$image_dimensions = array();
|
197 |
$all_sizes = wp_get_registered_image_subsizes();
|
191 |
}
|
192 |
|
193 |
$default_size = get_option( 'image_default_size', 'large' );
|
194 |
+
$image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $default_size : 'large';
|
195 |
|
196 |
$image_dimensions = array();
|
197 |
$all_sizes = wp_get_registered_image_subsizes();
|
lib/block-patterns.php
CHANGED
@@ -213,7 +213,10 @@ add_action(
|
|
213 |
}
|
214 |
|
215 |
foreach ( $core_block_patterns as $core_block_pattern ) {
|
216 |
-
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
foreach ( $new_core_block_patterns as $core_block_pattern ) {
|
213 |
}
|
214 |
|
215 |
foreach ( $core_block_patterns as $core_block_pattern ) {
|
216 |
+
$name = 'core/' . $core_block_pattern;
|
217 |
+
if ( WP_Block_Patterns_Registry::get_instance()->is_registered( $name ) ) {
|
218 |
+
unregister_block_pattern( $name );
|
219 |
+
}
|
220 |
}
|
221 |
|
222 |
foreach ( $new_core_block_patterns as $core_block_pattern ) {
|
readme.txt
CHANGED
@@ -55,4 +55,4 @@ View <a href="https://developer.wordpress.org/block-editor/principles/versions-i
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
-
To read the changelog for Gutenberg 10.5.
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
To read the changelog for Gutenberg 10.5.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.5.1">release page</a>.
|